xerces-c-3.2.2/000755 000765 000024 00000000000 13345765735 014065 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/configure.ac000644 000765 000024 00000047450 13345573230 016350 0ustar00scantorstaff000000 000000 # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. # # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # # $Id: configure.ac 1840430 2018-09-09 18:57:49Z rleigh $ # AC_PREREQ(2.60) AC_INIT([xerces-c],[3.2.2]) INTERFACE_VERSION=3.2 GRAMMAR_SERIALIZATION_LEVEL=7 XERCES_VERSION_MAJOR=$(echo $PACKAGE_VERSION | cut -d. -f1) XERCES_VERSION_MINOR=$(echo $PACKAGE_VERSION | cut -d. -f2) XERCES_VERSION_REVISION=$(echo $PACKAGE_VERSION | cut -d. -f3) INTERFACE_VERSION_MAJOR=$(echo $INTERFACE_VERSION | cut -d. -f1) INTERFACE_VERSION_MINOR=$(echo $INTERFACE_VERSION | cut -d. -f2) INTERFACE_VERSION_D="${INTERFACE_VERSION_MAJOR}.${INTERFACE_VERSION_MINOR}" INTERFACE_VERSION_U="${INTERFACE_VERSION_MAJOR}_${INTERFACE_VERSION_MINOR}" AC_SUBST([XERCES_VERSION_MAJOR]) AC_SUBST([XERCES_VERSION_MINOR]) AC_SUBST([XERCES_VERSION_REVISION]) AC_SUBST([INTERFACE_VERSION_MAJOR]) AC_SUBST([INTERFACE_VERSION_MINOR]) AC_SUBST([INTERFACE_VERSION_D]) AC_SUBST([INTERFACE_VERSION_U]) AC_DEFINE_UNQUOTED([XERCES_VERSION_MAJOR], $XERCES_VERSION_MAJOR, [Definition of Xerces major version]) AC_DEFINE_UNQUOTED([XERCES_VERSION_MINOR], $XERCES_VERSION_MINOR, [Definition of Xerces minor version]) AC_DEFINE_UNQUOTED([XERCES_VERSION_REVISION], $XERCES_VERSION_REVISION, [Definition of Xerces patch version]) AC_DEFINE_UNQUOTED([INTERFACE_VERSION_MAJOR], $INTERFACE_VERSION_MAJOR, [Definition of Xerces interface major version]) AC_DEFINE_UNQUOTED([INTERFACE_VERSION_MINOR], $INTERFACE_VERSION_MINOR, [Definition of Xerces interface minor version]) AC_DEFINE_UNQUOTED([XERCES_GRAMMAR_SERIALIZATION_LEVEL], $GRAMMAR_SERIALIZATION_LEVEL, [Definition of Xerces grammar serialization level]) AC_CONFIG_SRCDIR([src/Makefile.am]) AC_CONFIG_LIBOBJ_DIR([src]) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h src/xercesc/util/Xerces_autoconf_config.hpp]) AC_CONFIG_HEADER([src/xercesc/util/XercesVersion.hpp]) AC_CONFIG_FILES([Makefile doc/Makefile doc/Doxyfile doc/style/dtd/entities.ent src/Makefile tests/Makefile samples/Makefile xerces-c.pc scripts/run-test]) # Check the target system AC_CANONICAL_HOST # Initialize automake AM_SILENT_RULES([yes]) AM_INIT_AUTOMAKE([foreign subdir-objects dist-bzip2 tar-ustar]) AM_MAINTAINER_MODE # Check if rpath is disabled AC_MSG_CHECKING(whether to use rpath) AC_ARG_ENABLE(rpath, [AC_HELP_STRING([--disable-rpath], [Patches libtool to not use rpath in the libraries produced.])], [xerces_cv_rpath="$enable_rpath"], [xerces_cv_rpath="yes"]) AC_MSG_RESULT($xerces_cv_rpath) # Checks for programs. AC_PROG_CXX # Use the C++ compiler for the compile tests AC_LANG(C++) # used by "make check" AC_PROG_SED #it would be nice to also check for PERL... #AC_PROG_PERL #skip detection of Fortran m4_undefine([AC_PROG_F77]) m4_defun([AC_PROG_F77],[]) AC_PROG_LN_S AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL AM_PROG_CC_C_O AS_IF([test x$AR = xfalse], AC_MSG_ERROR([Cannot find a valid 'ar' tool])) # Patch libtool to not use rpath if requested. # AC_CONFIG_COMMANDS([libtool-rpath-patch], [if test "$libtool_patch_use_rpath" = "no"; then echo config.status: patching libtool to not use rpath sed < libtool > libtool-2 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_NO_RPATH__ "/' mv libtool-2 libtool chmod 755 libtool fi], [libtool_patch_use_rpath=$xerces_cv_rpath]) # Export information on whether we are building static/shared libraries. # enable_shared and enable_static are defined by AC_PROG_LIBTOOL. # AC_SUBST([BUILD_SHARED], [$enable_shared]) AC_SUBST([BUILD_STATIC], [$enable_static]) # Checks for header files. AC_HEADER_STDC AC_HEADER_TIME AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h inttypes.h langinfo.h limits.h locale.h \ memory.h netdb.h netinet/in.h nl_types.h stddef.h stdint.h stdlib.h \ string.h strings.h \ sys/param.h sys/socket.h sys/time.h sys/timeb.h \ unistd.h wchar.h wctype.h \ CoreServices/CoreServices.h \ endian.h machine/endian.h arpa/nameser_compat.h \ ]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_C_INLINE AC_C_VOLATILE AC_CHECK_SIZEOF(wchar_t) AC_CHECK_TYPE(size_t) AC_CHECK_TYPE(ssize_t) AC_TYPE_OFF_T AC_TYPE_SIZE_T XERCES_INT_TYPES AC_CXX_HAVE_BOOL AC_CXX_HAVE_NAMESPACES AC_CXX_HAVE_STD_NAMESPACE AC_CXX_HAVE_STD_LIBS AC_CXX_HAVE_LSTRING ACX_PTHREAD # Checks for library functions. #AC_FUNC_ERROR_AT_LINE #AC_FUNC_MALLOC #AC_FUNC_MEMCMP #AC_FUNC_STRCOLL #AC_FUNC_STRTOD AC_CHECK_FUNCS([getcwd pathconf realpath \ getaddrinfo gethostbyaddr gethostbyname socket \ clock_gettime ftime gettimeofday timegm gmtime_r \ memmove memset nl_langinfo setlocale localeconv \ strcasecmp strncasecmp stricmp strnicmp strchr strdup \ strrchr strstr strtol strtoul snprintf \ towupper towlower mblen \ wcsupr wcslwr wcsnicmp wcsicmp \ ]) # Some Unix systems, like Gnu Hurd, don't define PATH_MAX AC_MSG_CHECKING([for PATH_MAX]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[char dummy[PATH_MAX];]])], [ AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED([HAVE_PATH_MAX], 1, [Define to 1 if you have the PATH_MAX macro.]) ], [ AC_MSG_RESULT([no]) AC_DEFINE_UNQUOTED([HAVE_PATH_MAX], 0, [Define to 1 if you have the PATH_MAX macro.]) ] ) # Check for functional cstdint header AC_MSG_CHECKING([for cstdint]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ uint32_t v1 = 342; int64_t v2 = -23; return 0; ]])], [ AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED([XERCES_HAVE_CSTDINT], 1, [Define to 1 if cstdint is functional.]) ], [ AC_MSG_RESULT([no]) AC_DEFINE_UNQUOTED([XERCES_HAVE_CSTDINT], 0, [Define to 1 if cstdint is functional.]) ] ) # The check for mbrlen, wcsrtombs and mbsrtowcs gives a false # positive on HP-UX, so we use a different snippet to set the # corresponding macro # Furthermore, OpenBSD 5.1 doesn't follow the standard that states # that the "src" pointer must be set to NULL when a \0 has been # converted in the source data, a behaviour that we rely on # So we also check for this scenario before using these functions AC_MSG_CHECKING([for mbrlen]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[mbstate_t st; mbrlen( "t", 5, &st );]])], [ AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED([HAVE_MBRLEN], 1, [Define to 1 if you have the `mbrlen' function.]) ], [ AC_MSG_RESULT([no]) AC_DEFINE_UNQUOTED([HAVE_MBRLEN], 0, [Define to 1 if you have the `mbrlen' function.]) ] ) AC_MSG_CHECKING([for wcsrtombs]) AC_RUN_IFELSE( [AC_LANG_PROGRAM([[#include #include ]], [[ mbstate_t st; memset(&st, 0, sizeof(st)); char buffer[32]; const wchar_t* src=L"help"; wcsrtombs(buffer, &src, 32, &st); if(src==0) return 0; else return 1;]])], [ AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 1, [Define to 1 if you have the `wcsrtombs' function.]) ], [ AC_MSG_RESULT([no]) AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 0, [Define to 1 if you have the `wcsrtombs' function.]) ] ) AC_MSG_CHECKING([for mbsrtowcs]) AC_RUN_IFELSE( [AC_LANG_PROGRAM([[#include #include ]], [[ mbstate_t st; memset(&st, 0, sizeof(st)); wchar_t buffer[32]; const char* src="help"; mbsrtowcs(buffer, &src, 32, &st); if(src==0) return 0; else return 1;]])], [ AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 1, [Define to 1 if you have the `mbsrtowcs' function.]) ], [ AC_MSG_RESULT([no]) AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 0, [Define to 1 if you have the `mbsrtowcs' function.]) ] ) AC_MSG_CHECKING([if iconv uses const pointers]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[ const char *fromPtr=0; size_t fromLen=0; char *toPtr=0; size_t toLen=0; iconv_t cv=0; iconv(cv, &fromPtr, &fromLen, &toPtr, &toLen); ]])], [ AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED([ICONV_USES_CONST_POINTER], 1, [Define to 1 if you have to use const char* with iconv, to 0 if you must use char*.]) ], [ AC_MSG_RESULT([no]) AC_DEFINE_UNQUOTED([ICONV_USES_CONST_POINTER], 0, [Define to 1 if you have to use const char* with iconv, to 0 if you must use char*.]) ] ) AC_SUBST([SHREXT], [$shrext_cmds]) # # Orchestrate the replacement of missing functions # AC_REPLACE_FUNCS([stricmp strnicmp towlower towupper]) abs_top_srcdir=`cd $srcdir; pwd` AC_SUBST(abs_top_srcdir) abs_top_builddir=`pwd` AC_SUBST(abs_top_builddir) ###################################################### # Look for availability of available packages ###################################################### XERCES_PATH_DELIMITERS XERCES_MUTEXMGR_SELECTION XERCES_NETACCESSOR_SELECTION XERCES_TRANSCODER_SELECTION XERCES_MSGLOADER_SELECTION XERCES_FILEMGR_SELECTION # Allow the user to specify the pkgconfig directory. # AC_ARG_WITH(pkgconfigdir, AC_HELP_STRING([--with-pkgconfigdir=DIR],[Specify location of pkgconfig dir (default is libdir/pkgconfig)]), [pkgconfigdir=${withval}], [pkgconfigdir='${libdir}/pkgconfig']) AC_SUBST([pkgconfigdir]) # Allow the user to disable the SSE2 support # AC_ARG_ENABLE(sse2, AC_HELP_STRING([--disable-sse2],[disable SSE2 optimizations]), [have_sse2=${enableval}], [have_sse2=yes]) ###################################################### # Define some namespace-protected macros for use in the # publicly visible Xerces_autoconf_config.h file. ###################################################### AC_DEFINE([XERCES_AUTOCONF], 1, [Define to true if autoconf is used in this configuration]) AS_IF([test x$ac_cv_header_stdint_h = xyes], AC_DEFINE([XERCES_HAVE_STDINT_H], 1, [Define to 1 if we have stdint.h])) AS_IF([test x$ac_cv_header_sys_types_h = xyes], AC_DEFINE([XERCES_HAVE_SYS_TYPES_H], 1, [Define to 1 if we have sys/types.h])) AS_IF([test x$ac_cv_header_inttypes_h = xyes], AC_DEFINE([XERCES_HAVE_INTTYPES_H], 1, [Define to 1 if we have inttypes.h])) case $host in *-*-msdos* | *-*-mingw32* | *-*-cygwin* | *-*-windows* ) platform_export="__declspec(dllexport)" platform_import="__declspec(dllimport)" template_extern="" ;; * ) platform_export="" platform_import="" template_extern="extern" ;; esac AC_DEFINE_UNQUOTED([XERCES_PLATFORM_EXPORT], [$platform_export], [Define as the platform's export attribute]) AC_DEFINE_UNQUOTED([XERCES_PLATFORM_IMPORT], [$platform_import], [Define as the platform's import attribute]) AC_DEFINE_UNQUOTED([XERCES_TEMPLATE_EXTERN], [$template_extern], [Define as the platform's template extern attribute]) AS_IF([test ! $ac_cv_cxx_have_bool], AC_DEFINE([XERCES_NO_NATIVE_BOOL], 1, [Define if there is no native bool support in this environment])) XERCES_XMLCH_SELECTION AC_MSG_CHECKING([whether the compiler chokes on a placement operator delete]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include class XMemory { public : void* operator new(size_t s) { return 0; } void* operator new(size_t s, void* ptr) { return 0; } void operator delete(void* p) {} void operator delete(void* p, void* ptr) {} };]], [[ ]])], [ AC_MSG_RESULT([no]) ], [ AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED([XERCES_NO_MATCHING_DELETE_OPERATOR], 1, [Define to have XMemory.hpp avoid declaring a matching operator delete for the placement operator new]) ] ) if test "$have_sse2" = "yes"; then no_sse2_CXXFLAGS="$CXXFLAGS" save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -msse2" AC_MSG_CHECKING([whether we need to add -msse2]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[__m128i one;]])], [msse2_ok=yes], [msse2_ok=no] ) AC_MSG_RESULT($msse2_ok) if test x"$msse2_ok" = xno; then CXXFLAGS="$save_CXXFLAGS" fi # Sun CC option test. Currently disabled since it doesn't work. Also note # that Sun CC will accept -msse2 (i.e., it won't fail) but will keep issuing # warnings. So if enabled this test needs to be moved before -msse2 and if # it passes, then -msse2 should be skipped. # # save_CXXFLAGS="$CXXFLAGS" # CXXFLAGS="$CXXFLAGS -xarch=sse2" # AC_MSG_CHECKING([whether we need to add -xarch=sse2]) # AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[__m128i one;]])], # [xarchsse2_ok=yes], # [xarchsse2_ok=no] # ) # AC_MSG_RESULT($xarchsse2_ok) # if test x"$xarchsse2_ok" = xno; then # CXXFLAGS="$save_CXXFLAGS" # fi AC_MSG_CHECKING([for intrin.h usability]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[]])], [ AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED([XERCES_HAVE_INTRIN_H], 1, [Define to 1 if you have intrin.h]) ], [ AC_MSG_RESULT([no]) ] ) AC_MSG_CHECKING([for emmintrin.h usability]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[]])], [ AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED([XERCES_HAVE_EMMINTRIN_H], 1, [Define to 1 if you have emmintrin.h]) ], [ AC_MSG_RESULT([no]) ] ) AC_MSG_CHECKING([for cpuid.h usability]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[]])], [ AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED([HAVE_CPUID_H], 1, [Define to 1 if you have cpuid.h]) ], [ AC_MSG_RESULT([no]) ] ) AC_MSG_CHECKING([whether the compiler has the CPUID intrinsic]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[int CPUInfo[4]; __cpuid(CPUInfo, 1); ]])], [ AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED([XERCES_HAVE_CPUID_INTRINSIC], 1, [Define to have SSE2 instruction support detected at runtime using __cpuid]) ], [ AC_MSG_RESULT([no]) ] ) AC_MSG_CHECKING([whether the compiler has the _get_cpuid intrinsic]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[unsigned int eax, ebx, ecx, edx; __get_cpuid (1, &eax, &ebx, &ecx, &edx); ]])], [ AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED([XERCES_HAVE_GETCPUID], 1, [Define to have SSE2 instruction support detected at runtime using __get_cpuid]) ], [ AC_MSG_RESULT([no]) ] ) AC_MSG_CHECKING([whether the compiler has the SSE2 intrinsic]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[__m128i* one=(__m128i*)_mm_malloc(4, 16); __m128i* two=(__m128i*)_mm_malloc(4, 16); __m128i xmm1 = _mm_load_si128(one); __m128i xmm2 = _mm_load_si128(two); __m128i xmm3 = _mm_or_si128(xmm1, xmm2); _mm_store_si128(one, xmm3); _mm_free(one); _mm_free(two); ]])], [ AC_MSG_RESULT([yes]) sse2_usable=yes AC_DEFINE_UNQUOTED([XERCES_HAVE_SSE2_INTRINSIC], 1, [Define to have SSE2 instruction used at runtime]) ], [ AC_MSG_RESULT([no]) sse2_usable=no ] ) # Restore original CXXFLAGS if SSE2 is not usable. # if test "$sse2_usable" = "no"; then CXXFLAGS="$no_sse2_CXXFLAGS" fi fi AS_IF([test x$ac_cv_type_size_t = xyes], AC_DEFINE([XERCES_SIZE_T], [size_t], [Define as the appropriate size_t type]) AC_DEFINE([XERCES_SIZE_MAX], [SIZE_MAX], [Define as the appropriate SIZE_MAX macro]), AC_DEFINE([XERCES_SIZE_T], [unsigned long], [Define as the appropriate size_t type]) AC_DEFINE([XERCES_SIZE_MAX], [ULONG_MAX], [Define as the appropriate SIZE_MAX macro])) AS_IF([test x$ac_cv_type_ssize_t = xyes], AC_DEFINE([XERCES_SSIZE_T], [ssize_t], [Define as the appropriate ssize_t type]) AC_DEFINE([XERCES_SSIZE_MAX], [SSIZE_MAX], [Define as the appropriate SSIZE_MAX macro]), AC_DEFINE([XERCES_SSIZE_T], [long], [Define as the appropriate ssize_t type]) AC_DEFINE([XERCES_SSIZE_MAX], [LONG_MAX], [Define as the appropriate SSIZE_MAX macro])) AS_IF([test x$ac_cv_cxx_have_namespaces = xyes], AC_DEFINE([XERCES_HAS_CPP_NAMESPACE], 1, [Define if namespaces is supported by the compiler])) AS_IF([test x$ac_cv_cxx_have_std_namespace = xyes], AC_DEFINE([XERCES_STD_NAMESPACE], 1, [Define if the std namespace is supported])) AS_IF([test x$ac_cv_cxx_have_std_libs = xyes], AC_DEFINE([XERCES_NEW_IOSTREAMS], 1, [Define if the isstream library can be included as ])) AC_OUTPUT AC_MSG_NOTICE AC_MSG_NOTICE([Report:]) AC_MSG_NOTICE([ File Manager: $filemgr]) AC_MSG_NOTICE([ Mutex Manager: $mutexmgr]) AC_MSG_NOTICE([ Transcoder: $transcoder]) AC_MSG_NOTICE([ NetAccessor: $netaccessor]) AC_MSG_NOTICE([ Message Loader: $msgloader]) AC_MSG_NOTICE([ XMLCh Type: $xmlch]) xerces-c-3.2.2/tools/000755 000765 000024 00000000000 13241416723 015206 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/INSTALL000644 000765 000024 00000000143 13241160344 015070 0ustar00scantorstaff000000 000000 See the xerces.apache.org web site for installation instructions and other relevant documentation. xerces-c-3.2.2/CMakeLists.txt000644 000765 000024 00000015452 13242664434 016622 0ustar00scantorstaff000000 000000 # CMake build for xerces-c # # Written by Roger Leigh # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Run "cmake" to generate the build files for your platform cmake_minimum_required(VERSION 3.2.0) # Use new variable expansion policy. if (POLICY CMP0053) cmake_policy(SET CMP0053 NEW) endif(POLICY CMP0053) if (POLICY CMP0054) cmake_policy(SET CMP0054 NEW) endif(POLICY CMP0054) if (POLICY CMP0067) cmake_policy(SET CMP0067 NEW) endif(POLICY CMP0067) # Try C++14, then fall back to C++11 and C++98. Used for feature tests # for optional features. set(CMAKE_CXX_STANDARD 14) # Use folders (for IDE project grouping) set_property(GLOBAL PROPERTY USE_FOLDERS ON) # Source additional modules from the "cmake" directory list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") # Read version information from configure.ac. file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/configure.ac" configure REGEX "^AC_INIT\\(\\[xerces-c\\],\\[(.*)\\]\\)") foreach(line IN LISTS configure) string(REGEX REPLACE "^AC_INIT\\(\\[xerces-c\\],\\[(.*)\\]\\)" "\\1" xerces_c_version "${line}") break() endforeach() file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/configure.ac" configure REGEX "^INTERFACE_VERSION=.*") foreach(line IN LISTS configure) string(REGEX REPLACE "^INTERFACE_VERSION=(.*)" "\\1" xerces_c_interface_version "${line}") break() endforeach() file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/configure.ac" configure REGEX "^GRAMMAR_SERIALIZATION_LEVEL=.*") foreach(line IN LISTS configure) string(REGEX REPLACE "^GRAMMAR_SERIALIZATION_LEVEL=(.*)" "\\1" xerces_c_grammar_serialization_level "${line}") break() endforeach() message(STATUS "Configuring Apache Xerces-C++ version ${xerces_c_version}") # Project version project(xerces-c VERSION "${xerces_c_version}" LANGUAGES C CXX) enable_testing() # For autotools header compatibility set(PACKAGE "${PROJECT_NAME}") set(PACKAGE_NAME "${PROJECT_NAME}") set(PACKAGE_TARNAME "${PROJECT_NAME}") set(PACKAGE_VERSION "${PROJECT_VERSION}") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "c-dev@xerces.apache.org") set(PACKAGE_URL "https://xerces.apache.org/xerces-c/") set(VERSION "${PROJECT_VERSION}") set(XERCES_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") set(XERCES_VERSION_MINOR "${PROJECT_VERSION_MINOR}") set(XERCES_VERSION_REVISION "${PROJECT_VERSION_PATCH}") string(REPLACE "." ";" interface_version_parts "${xerces_c_interface_version}") list(GET interface_version_parts 0 INTERFACE_VERSION_MAJOR) list(GET interface_version_parts 1 INTERFACE_VERSION_MINOR) set(INTERFACE_VERSION_D "${INTERFACE_VERSION_MAJOR}.${INTERFACE_VERSION_MINOR}") set(INTERFACE_VERSION_U "${INTERFACE_VERSION_MAJOR}_${INTERFACE_VERSION_MINOR}") set(XERCES_GRAMMAR_SERIALIZATION_LEVEL "${xerces_c_grammar_serialization_level}") set(EXTRA_DIST xerces-c.spec xerces-c.pc.in CREDITS INSTALL KEYS LICENSE NOTICE README config/pretty-make doc projects reconf scripts/createBindingsFormatFromHPP.pl scripts/makeStringDefinition.pl tools ) include(GNUInstallDirs) include(XercesWarnings) include(XercesIncludes) include(XercesFunctions) include(XercesDLL) include(XercesIntTypes) include(XercesPathDelimiters) include(XercesICU) include(XercesMutexMgrSelection) include(XercesNetAccessorSelection) include(XercesMsgLoaderSelection) include(XercesTranscoderSelection) include(XercesFileMgrSelection) include(XercesXMLCh) include(XercesOperatorDelete) include(XercesBool) include(XercesConst) include(XercesInline) include(XercesVolatile) include(XercesLString) include(XercesMFC) include(XercesNamespaces) include(XercesStdLibs) include(XercesStdNamespace) include(XercesSSE2) include(XercesPathMax) include(XercesWChar) include(XercesIconvConst) include(XercesLFS) # Generate headers configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/src/xercesc/util/Xerces_autoconf_config.hpp.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/src/xercesc/util/Xerces_autoconf_config.hpp @ONLY) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/src/xercesc/util/XercesVersion.hpp.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/src/xercesc/util/XercesVersion.hpp @ONLY) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/doc/style/dtd/entities.ent.in ${CMAKE_CURRENT_BINARY_DIR}/doc/style/dtd/entities.ent @ONLY) # Generate pkg-config file set(pkgconfig-dir "${CMAKE_INSTALL_LIBDIR}/pkgconfig" CACHE STRING "pkg-config installation directory (default ${CMAKE_INSTALL_LIBDIR}/pkgconfig)") set(PKGCONFIGDIR "${pkgconfig-dir}") set(prefix "${CMAKE_INSTALL_PREFIX}") set(exec_prefix "${CMAKE_INSTALL_PREFIX}") set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}") set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/xerces-c.pc.in ${CMAKE_CURRENT_BINARY_DIR}/xerces-c.pc) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/xerces-c.pc DESTINATION "${PKGCONFIGDIR}" COMPONENT "development") # Process subdirectories add_subdirectory(doc) add_subdirectory(src) add_subdirectory(tests) add_subdirectory(samples) # Display configuration summary message(STATUS "") message(STATUS "Xerces-C++ configuration summary") message(STATUS "--------------------------------") message(STATUS "") message(STATUS " Version: ${xerces-c_VERSION}") message(STATUS " Library interface version: ${xerces_c_interface_version}") message(STATUS "") message(STATUS " Installation directory: ${prefix}") message(STATUS " C compiler: ${CMAKE_C_COMPILER}") message(STATUS " C++ compiler: ${CMAKE_CXX_COMPILER}") message(STATUS "") message(STATUS " Build shared libraries: ${BUILD_SHARED_LIBS}") message(STATUS " Path delimiters: \"${path_delims}\"") message(STATUS " File Manager: ${filemgr}") message(STATUS " Mutex Manager: ${mutexmgr}") message(STATUS " Transcoder: ${transcoder}") message(STATUS " NetAccessor: ${netaccessor}") message(STATUS " Message Loader: ${msgloader}") message(STATUS " XMLCh type: ${xmlch_type}") xerces-c-3.2.2/LICENSE000644 000765 000024 00000026136 13241160332 015053 0ustar00scantorstaff000000 000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. xerces-c-3.2.2/cmake/000755 000765 000024 00000000000 13345765706 015143 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/configure000755 000765 000024 00002625615 13345744065 016006 0ustar00scantorstaff000000 000000 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for xerces-c 3.2.2. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xerces-c' PACKAGE_TARNAME='xerces-c' PACKAGE_VERSION='3.2.2' PACKAGE_STRING='xerces-c 3.2.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="src/Makefile.am" ac_config_libobj_dir=src # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS XERCES_USE_CHAR16_FALSE XERCES_USE_CHAR16_TRUE pkgconfigdir XERCES_USE_FILEMGR_WINDOWS_FALSE XERCES_USE_FILEMGR_WINDOWS_TRUE XERCES_USE_FILEMGR_POSIX_FALSE XERCES_USE_FILEMGR_POSIX_TRUE XERCES_USE_MSGLOADER_INMEMORY_FALSE XERCES_USE_MSGLOADER_INMEMORY_TRUE XERCES_USE_MSGLOADER_ICONV_FALSE XERCES_USE_MSGLOADER_ICONV_TRUE XERCES_USE_MSGLOADER_ICU_FALSE XERCES_USE_MSGLOADER_ICU_TRUE XERCES_USE_TRANSCODER_WINDOWS_FALSE XERCES_USE_TRANSCODER_WINDOWS_TRUE XERCES_USE_TRANSCODER_ICONV_FALSE XERCES_USE_TRANSCODER_ICONV_TRUE XERCES_USE_TRANSCODER_GNUICONV_FALSE XERCES_USE_TRANSCODER_GNUICONV_TRUE XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER_FALSE XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER_TRUE XERCES_USE_TRANSCODER_ICU_FALSE XERCES_USE_TRANSCODER_ICU_TRUE ICU_SBIN ICU_BIN ICU_LIBS ICU_FLAGS ICU_PRESENT icu_config XERCES_USE_NETACCESSOR_SOCKET_FALSE XERCES_USE_NETACCESSOR_SOCKET_TRUE XERCES_USE_NETACCESSOR_WINSOCK_FALSE XERCES_USE_NETACCESSOR_WINSOCK_TRUE XERCES_USE_NETACCESSOR_CFURL_FALSE XERCES_USE_NETACCESSOR_CFURL_TRUE XERCES_USE_NETACCESSOR_CURL_FALSE XERCES_USE_NETACCESSOR_CURL_TRUE CURL_LIBS CURL_FLAGS CURL_PRESENT curl_config XERCES_USE_MUTEXMGR_WINDOWS_FALSE XERCES_USE_MUTEXMGR_WINDOWS_TRUE XERCES_USE_MUTEXMGR_POSIX_FALSE XERCES_USE_MUTEXMGR_POSIX_TRUE XERCES_USE_MUTEXMGR_STD_FALSE XERCES_USE_MUTEXMGR_STD_TRUE XERCES_USE_MUTEXMGR_NOTHREAD_FALSE XERCES_USE_MUTEXMGR_NOTHREAD_TRUE abs_top_builddir abs_top_srcdir LIBOBJS SHREXT PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CC acx_pthread_config BUILD_STATIC BUILD_SHARED CXXCPP CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE ac_ct_CC CFLAGS CC LIBTOOL OBJDUMP DLLTOOL AS LN_S SED am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CXX CPPFLAGS LDFLAGS CXXFLAGS CXX MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V host_os host_vendor host_cpu host build_os build_vendor build_cpu build INTERFACE_VERSION_U INTERFACE_VERSION_D INTERFACE_VERSION_MINOR INTERFACE_VERSION_MAJOR XERCES_VERSION_REVISION XERCES_VERSION_MINOR XERCES_VERSION_MAJOR target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_rpath enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock enable_threads enable_mutexmgr_standard enable_mutexmgr_windows enable_mutexmgr_posix enable_mutexmgr_nothreads enable_network with_curl enable_netaccessor_curl enable_netaccessor_socket enable_netaccessor_cfurl enable_netaccessor_winsock enable_transcoder_gnuiconv enable_transcoder_iconv with_icu enable_transcoder_icu enable_transcoder_macosunicodeconverter enable_transcoder_windows enable_msgloader_inmemory enable_msgloader_icu enable_msgloader_iconv with_pkgconfigdir enable_sse2 enable_xmlch_char16_t enable_xmlch_wchar_t enable_xmlch_uint16_t ' ac_precious_vars='build_alias host_alias target_alias CXX CXXFLAGS LDFLAGS LIBS CPPFLAGS CCC CC CFLAGS LT_SYS_LIBRARY_PATH CPP CXXCPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures xerces-c 3.2.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/xerces-c] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of xerces-c 3.2.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-rpath Patches libtool to not use rpath in the libraries produced. --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-threads Disable threads (enabled by default) --enable-mutexmgr-standard Enable Standard C++11 threads mutex manager support --enable-mutexmgr-windows Enable Windows mutex manager support --enable-mutexmgr-posix Enable POSIX mutex manager support --enable-mutexmgr-nothreads Enable NoThreads mutex manager support (no threading) --disable-network Disable network support (enabled by default) --enable-netaccessor-curl Enable libcurl-based NetAccessor support --enable-netaccessor-socket Enable sockets-based NetAccessor support --enable-netaccessor-cfurl Enable cfurl-based NetAccessor support --enable-netaccessor-winsock Enable winsock-based NetAccessor support --enable-transcoder-gnuiconv Enable GNU iconv-based transcoder support --enable-transcoder-iconv Enable iconv-based transcoder support --enable-transcoder-icu Enable icu-based transcoder support --enable-transcoder-macosunicodeconverter Enable MacOSUnicodeConverter-based transcoder support --enable-transcoder-windows Enable Windows-based transcoder support --enable-msgloader-inmemory Enable InMemory MsgLoader support --enable-msgloader-icu Enable ICU-based MsgLoader support --enable-msgloader-iconv Enable Iconv-based MsgLoader support --disable-sse2 disable SSE2 optimizations --enable-xmlch-char16_t Enable char16_t XMLCh --enable-xmlch-wchar_t Enable wchar_t XMLCh --enable-xmlch-uint16_t Enable uint16_t XMLCh Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-curl[[[=DIR]]] Specify location of libcurl --with-icu[[[=DIR]]] Specify location of icu --with-pkgconfigdir=DIR Specify location of pkgconfig dir (default is libdir/pkgconfig) Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CC C compiler command CFLAGS C compiler flags LT_SYS_LIBRARY_PATH User-defined run-time library search path. CPP C preprocessor CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF xerces-c configure 3.2.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_cxx_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_cxx_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel # ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES # --------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_cxx_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_type # ac_fn_cxx_compute_int LINENO EXPR VAR INCLUDES # ---------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_cxx_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by xerces-c $as_me 3.2.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu INTERFACE_VERSION=3.2 GRAMMAR_SERIALIZATION_LEVEL=7 XERCES_VERSION_MAJOR=$(echo $PACKAGE_VERSION | cut -d. -f1) XERCES_VERSION_MINOR=$(echo $PACKAGE_VERSION | cut -d. -f2) XERCES_VERSION_REVISION=$(echo $PACKAGE_VERSION | cut -d. -f3) INTERFACE_VERSION_MAJOR=$(echo $INTERFACE_VERSION | cut -d. -f1) INTERFACE_VERSION_MINOR=$(echo $INTERFACE_VERSION | cut -d. -f2) INTERFACE_VERSION_D="${INTERFACE_VERSION_MAJOR}.${INTERFACE_VERSION_MINOR}" INTERFACE_VERSION_U="${INTERFACE_VERSION_MAJOR}_${INTERFACE_VERSION_MINOR}" cat >>confdefs.h <<_ACEOF #define XERCES_VERSION_MAJOR $XERCES_VERSION_MAJOR _ACEOF cat >>confdefs.h <<_ACEOF #define XERCES_VERSION_MINOR $XERCES_VERSION_MINOR _ACEOF cat >>confdefs.h <<_ACEOF #define XERCES_VERSION_REVISION $XERCES_VERSION_REVISION _ACEOF cat >>confdefs.h <<_ACEOF #define INTERFACE_VERSION_MAJOR $INTERFACE_VERSION_MAJOR _ACEOF cat >>confdefs.h <<_ACEOF #define INTERFACE_VERSION_MINOR $INTERFACE_VERSION_MINOR _ACEOF cat >>confdefs.h <<_ACEOF #define XERCES_GRAMMAR_SERIALIZATION_LEVEL $GRAMMAR_SERIALIZATION_LEVEL _ACEOF ac_aux_dir= for ac_dir in config "$srcdir"/config; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ac_config_headers="$ac_config_headers config.h src/xercesc/util/Xerces_autoconf_config.hpp" ac_config_headers="$ac_config_headers src/xercesc/util/XercesVersion.hpp" ac_config_files="$ac_config_files Makefile doc/Makefile doc/Doxyfile doc/style/dtd/entities.ent src/Makefile tests/Makefile samples/Makefile xerces-c.pc scripts/run-test" # Check the target system # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Initialize automake # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='xerces-c' VERSION='3.2.2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar plaintar pax cpio none' # The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 $as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; } if test $am_uid -le $am_max_uid; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } _am_tools=none fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 $as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; } if test $am_gid -le $am_max_gid; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } _am_tools=none fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 $as_echo_n "checking how to create a ustar tar archive... " >&6; } # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_ustar-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break done am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x ustar -w "$$tardir"' am__tar_='pax -L -x ustar -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H ustar -L' am__tar_='find "$tardir" -print | cpio -o -H ustar -L' am__untar='cpio -i -H ustar -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_ustar}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -rf conftest.dir if test -s conftest.tar; then { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 (cat conftest.dir/file) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir if ${am_cv_prog_tar_ustar+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_prog_tar_ustar=$_am_tool fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 $as_echo "$am_cv_prog_tar_ustar" >&6; } # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Check if rpath is disabled { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use rpath" >&5 $as_echo_n "checking whether to use rpath... " >&6; } # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; xerces_cv_rpath="$enable_rpath" else xerces_cv_rpath="yes" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xerces_cv_rpath" >&5 $as_echo "$xerces_cv_rpath" >&6; } # Checks for programs. ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 $as_echo_n "checking whether the C++ compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C++ compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 $as_echo_n "checking for C++ compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi # Use the C++ compiler for the compile tests ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # used by "make check" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed #it would be nice to also check for PERL... #AC_PROG_PERL #skip detection of Fortran { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done func_stripname_cnf () { case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CC=$lt_save_CC if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_CXX='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' $wl-bernotok' allow_undefined_flag_CXX=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='$wl--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else ld_shlibs_CXX=no fi ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='$wl-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='$wl-E' whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then no_undefined_flag_CXX=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='$wl-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='$wl-z,text' allow_undefined_flag_CXX='$wl-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX LD_CXX=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX=$prev$p else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX=$prev$p else postdeps_CXX="${postdeps_CXX} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$predep_objects_CXX"; then predep_objects_CXX=$p else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX=$p else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_CXX='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: if test x$AR = xfalse; then : as_fn_error $? "Cannot find a valid 'ar' tool" "$LINENO" 5 fi # Patch libtool to not use rpath if requested. # ac_config_commands="$ac_config_commands libtool-rpath-patch" # Export information on whether we are building static/shared libraries. # enable_shared and enable_static are defined by AC_PROG_LIBTOOL. # BUILD_SHARED=$enable_shared BUILD_STATIC=$enable_static # Checks for header files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi for ac_header in arpa/inet.h fcntl.h float.h inttypes.h langinfo.h limits.h locale.h \ memory.h netdb.h netinet/in.h nl_types.h stddef.h stdint.h stdlib.h \ string.h strings.h \ sys/param.h sys/socket.h sys/time.h sys/timeb.h \ unistd.h wchar.h wctype.h \ CoreServices/CoreServices.h \ endian.h machine/endian.h arpa/nameser_compat.h \ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 $as_echo_n "checking for working volatile... " >&6; } if ${ac_cv_c_volatile+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { volatile int x; int * volatile y = (int *) 0; return !x && !y; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_volatile=yes else ac_cv_c_volatile=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 $as_echo "$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then $as_echo "#define volatile /**/" >>confdefs.h fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5 $as_echo_n "checking size of wchar_t... " >&6; } if ${ac_cv_sizeof_wchar_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t" "$ac_includes_default"; then : else if test "$ac_cv_type_wchar_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (wchar_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_wchar_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_wchar_t" >&5 $as_echo "$ac_cv_sizeof_wchar_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t _ACEOF ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : fi ac_fn_cxx_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes; then : fi ac_fn_cxx_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi for ac_header in inttypes.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" if test "x$ac_cv_header_inttypes_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_INTTYPES_H 1 _ACEOF fi done # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 $as_echo_n "checking size of short... " >&6; } if ${ac_cv_sizeof_short+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : else if test "$ac_cv_type_short" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (short) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_short=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 $as_echo "$ac_cv_sizeof_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 $as_echo_n "checking size of long long... " >&6; } if ${ac_cv_sizeof_long_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 $as_echo "$ac_cv_sizeof_long_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64" >&5 $as_echo_n "checking size of __int64... " >&6; } if ${ac_cv_sizeof___int64+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (__int64))" "ac_cv_sizeof___int64" "$ac_includes_default"; then : else if test "$ac_cv_type___int64" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (__int64) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof___int64=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int64" >&5 $as_echo "$ac_cv_sizeof___int64" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF___INT64 $ac_cv_sizeof___int64 _ACEOF ac_fn_cxx_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "$ac_includes_default" if test "x$ac_cv_type_int16_t" = xyes; then : fi ac_fn_cxx_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default" if test "x$ac_cv_type_int32_t" = xyes; then : fi ac_fn_cxx_check_type "$LINENO" "int64_t" "ac_cv_type_int64_t" "$ac_includes_default" if test "x$ac_cv_type_int64_t" = xyes; then : fi ac_fn_cxx_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "$ac_includes_default" if test "x$ac_cv_type_uint16_t" = xyes; then : fi ac_fn_cxx_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default" if test "x$ac_cv_type_uint32_t" = xyes; then : fi ac_fn_cxx_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "$ac_includes_default" if test "x$ac_cv_type_uint64_t" = xyes; then : fi # # Select a signed 16 bit integer type # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an appropriate signed 16 bit integer type" >&5 $as_echo_n "checking for an appropriate signed 16 bit integer type... " >&6; } if ${xerces_cv_type_s16bit_int+:} false; then : $as_echo_n "(cached) " >&6 else if test x$ac_cv_header_inttypes_h = xyes && test x$ac_cv_type_int16_t = xyes; then : xerces_cv_type_s16bit_int=int16_t else case $ac_cv_sizeof_int in 2*) xerces_cv_type_s16bit_int=int;; *) case $ac_cv_sizeof_short in 2*) xerces_cv_type_s16bit_int=short;; *) as_fn_error $? "Couldn't find a signed 16 bit int type" "$LINENO" 5;; esac ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xerces_cv_type_s16bit_int" >&5 $as_echo "$xerces_cv_type_s16bit_int" >&6; } # # Select an unsigned 16 bit integer type # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an appropriate unsigned 16 bit integer type" >&5 $as_echo_n "checking for an appropriate unsigned 16 bit integer type... " >&6; } if ${xerces_cv_type_u16bit_int+:} false; then : $as_echo_n "(cached) " >&6 else if test x$ac_cv_header_inttypes_h = xyes && test x$ac_cv_type_uint16_t = xyes; then : xerces_cv_type_u16bit_int=uint16_t else case $ac_cv_sizeof_int in 2*) xerces_cv_type_u16bit_int="unsigned int";; *) case $ac_cv_sizeof_short in 2*) xerces_cv_type_u16bit_int="unsigned short";; *) as_fn_error $? "Couldn't find an unsigned 16 bit int type" "$LINENO" 5;; esac ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xerces_cv_type_u16bit_int" >&5 $as_echo "$xerces_cv_type_u16bit_int" >&6; } # # Select a signed 32 bit integer type # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an appropriate signed 32 bit integer type" >&5 $as_echo_n "checking for an appropriate signed 32 bit integer type... " >&6; } if ${xerces_cv_type_s32bit_int+:} false; then : $as_echo_n "(cached) " >&6 else if test x$ac_cv_header_inttypes_h = xyes && test x$ac_cv_type_int32_t = xyes; then : xerces_cv_type_s32bit_int=int32_t else case $ac_cv_sizeof_int in 4*) xerces_cv_type_s32bit_int=int;; *) case $ac_cv_sizeof_long in 4*) xerces_cv_type_s32bit_int=long;; *) as_fn_error $? "Couldn't find a signed 32 bit int type" "$LINENO" 5;; esac ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xerces_cv_type_s32bit_int" >&5 $as_echo "$xerces_cv_type_s32bit_int" >&6; } # # Select an unsigned 32 bit integer type # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an appropriate unsigned 32 bit integer type" >&5 $as_echo_n "checking for an appropriate unsigned 32 bit integer type... " >&6; } if ${xerces_cv_type_u32bit_int+:} false; then : $as_echo_n "(cached) " >&6 else if test x$ac_cv_header_inttypes_h = xyes && test x$ac_cv_type_uint32_t = xyes; then : xerces_cv_type_u32bit_int=uint32_t else case $ac_cv_sizeof_int in 4*) xerces_cv_type_u32bit_int="unsigned int";; *) case $ac_cv_sizeof_long in 4*) xerces_cv_type_u32bit_int="unsigned long";; *) as_fn_error $? "Couldn't find an unsigned 32 bit int type" "$LINENO" 5;; esac ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xerces_cv_type_u32bit_int" >&5 $as_echo "$xerces_cv_type_u32bit_int" >&6; } # # Select an signed 64 bit integer type # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an appropriate signed 64 bit integer type" >&5 $as_echo_n "checking for an appropriate signed 64 bit integer type... " >&6; } if ${xerces_cv_type_s64bit_int+:} false; then : $as_echo_n "(cached) " >&6 else if test x$ac_cv_header_inttypes_h = xyes && test x$ac_cv_type_int64_t = xyes; then : xerces_cv_type_s64bit_int=int64_t xerces_cv_sizeof_int64=8 else case $ac_cv_sizeof_int in 8*) xerces_cv_type_s64bit_int="int" xerces_cv_sizeof_int64=8 ;; *) case $ac_cv_sizeof_long in 8*) xerces_cv_type_s64bit_int="long" xerces_cv_sizeof_int64=8 ;; *) case $ac_cv_sizeof_long_long in 8*) xerces_cv_type_s64bit_int="long long" xerces_cv_sizeof_int64=8 ;; *) case $ac_cv_sizeof___int64 in 8*) xerces_cv_type_s64bit_int="__int64" xerces_cv_sizeof_int64=8 ;; *) xerces_cv_type_s64bit_int=$xerces_cv_type_s32bit_int xerces_cv_sizeof_int64=4 ;; esac ;; esac ;; esac ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xerces_cv_type_s64bit_int" >&5 $as_echo "$xerces_cv_type_s64bit_int" >&6; } # # Select an unsigned 64 bit integer type # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an appropriate unsigned 64 bit integer type" >&5 $as_echo_n "checking for an appropriate unsigned 64 bit integer type... " >&6; } if ${xerces_cv_type_u64bit_int+:} false; then : $as_echo_n "(cached) " >&6 else if test x$ac_cv_header_inttypes_h = xyes && test x$ac_cv_type_uint64_t = xyes; then : xerces_cv_type_u64bit_int=uint64_t else case $ac_cv_sizeof_int in 8*) xerces_cv_type_u64bit_int="unsigned int";; *) case $ac_cv_sizeof_long in 8*) xerces_cv_type_u64bit_int="unsigned long";; *) case $ac_cv_sizeof_long_long in 8*) xerces_cv_type_u64bit_int="unsigned long long";; *) case $ac_cv_sizeof___int64 in 8*) xerces_cv_type_u64bit_int="unsigned __int64";; *) xerces_cv_type_u64bit_int=$xerces_cv_type_u32bit_int;; esac ;; esac ;; esac ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xerces_cv_type_u64bit_int" >&5 $as_echo "$xerces_cv_type_u64bit_int" >&6; } cat >>confdefs.h <<_ACEOF #define XERCES_S16BIT_INT $xerces_cv_type_s16bit_int _ACEOF cat >>confdefs.h <<_ACEOF #define XERCES_U16BIT_INT $xerces_cv_type_u16bit_int _ACEOF cat >>confdefs.h <<_ACEOF #define XERCES_S32BIT_INT $xerces_cv_type_s32bit_int _ACEOF cat >>confdefs.h <<_ACEOF #define XERCES_U32BIT_INT $xerces_cv_type_u32bit_int _ACEOF cat >>confdefs.h <<_ACEOF #define XERCES_S64BIT_INT $xerces_cv_type_s64bit_int _ACEOF cat >>confdefs.h <<_ACEOF #define XERCES_U64BIT_INT $xerces_cv_type_u64bit_int _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler recognizes bool as a built-in type" >&5 $as_echo_n "checking whether the compiler recognizes bool as a built-in type... " >&6; } if ${ac_cv_cxx_have_bool+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int f(int x){return 1;} int f(char x){return 1;} int f(bool x){return 1;} int main () { bool b = true; return f(b); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_cxx_have_bool=yes else ac_cv_cxx_have_bool=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_have_bool" >&5 $as_echo "$ac_cv_cxx_have_bool" >&6; } if test "$ac_cv_cxx_have_bool" = yes; then $as_echo "#define HAVE_BOOL /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler implements namespaces" >&5 $as_echo_n "checking whether the compiler implements namespaces... " >&6; } if ${ac_cv_cxx_have_namespaces+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ namespace Outer { namespace Inner { int i = 0; }} int main () { using namespace Outer::Inner; return i; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_cxx_have_namespaces=yes else ac_cv_cxx_have_namespaces=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_have_namespaces" >&5 $as_echo "$ac_cv_cxx_have_namespaces" >&6; } if test "$ac_cv_cxx_have_namespaces" = yes; then $as_echo "#define HAVE_NAMESPACES /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the std namespace" >&5 $as_echo_n "checking whether the compiler supports the std namespace... " >&6; } if ${ac_cv_cxx_have_std_namespace+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include std::istream& is = std::cin; int main () { return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_cxx_have_std_namespace=yes else ac_cv_cxx_have_std_namespace=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_have_std_namespace" >&5 $as_echo "$ac_cv_cxx_have_std_namespace" >&6; } if test "$ac_cv_cxx_have_std_namespace" = yes; then $as_echo "#define HAVE_STD_NAMESPACE /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports ISO C++ standard library" >&5 $as_echo_n "checking whether the compiler supports ISO C++ standard library... " >&6; } if ${ac_cv_cxx_have_std_libs+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #ifdef HAVE_NAMESPACES using namespace std; #endif int main () { return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_cxx_have_std_libs=yes else ac_cv_cxx_have_std_libs=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_have_std_libs" >&5 $as_echo "$ac_cv_cxx_have_std_libs" >&6; } if test "$ac_cv_cxx_have_std_libs" = yes; then $as_echo "#define HAVE_STD_LIBS /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler implements L\"widestring\"" >&5 $as_echo_n "checking whether the compiler implements L\"widestring\"... " >&6; } if ${ac_cv_cxx_have_lstring+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ const wchar_t* s=L"wide string"; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_cxx_have_lstring=yes else ac_cv_cxx_have_lstring=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_have_lstring" >&5 $as_echo "$ac_cv_cxx_have_lstring" >&6; } if test "$ac_cv_cxx_have_lstring" = yes; then $as_echo "#define HAVE_LSTRING /**/" >>confdefs.h fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 $as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_join (); int main () { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : acx_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 $as_echo "$acx_pthread_ok" >&6; } if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. # XERCES: On GNU/Linux with gcc both -pthread and -lpthread are valid. # However, libtool links libraries with -nostdlib which results in # -pthread being stripped from the linker command line. To resolve # this we move pthread from after -mthreads to after pthreads. # acx_pthread_flags="pthreads pthread none -Kthread -kthread lthread -pthread -pthreads -mthreads --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 $as_echo_n "checking whether pthreads work without any flags... " >&6; } ;; -*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 $as_echo_n "checking whether pthreads work with $flag... " >&6; } PTHREAD_CFLAGS="$flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_acx_pthread_config+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$acx_pthread_config"; then ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_acx_pthread_config="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no" fi fi acx_pthread_config=$ac_cv_prog_acx_pthread_config if test -n "$acx_pthread_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_config" >&5 $as_echo "$acx_pthread_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$acx_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 $as_echo_n "checking for the pthreads library -l$flag... " >&6; } PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. # XERCES: Add tests for pthread_mutexattr_init and # pthread_mutexattr_destroy. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); pthread_mutexattr_init(0); pthread_mutexattr_destroy(0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : acx_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 $as_echo "$acx_pthread_ok" >&6; } if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 $as_echo_n "checking for joinable pthread attribute... " >&6; } attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int attr=$attr; return attr; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : attr_name=$attr; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 $as_echo "$attr_name" >&6; } if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then cat >>confdefs.h <<_ACEOF #define PTHREAD_CREATE_JOINABLE $attr_name _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 $as_echo_n "checking if more special flags are required for pthreads... " >&6; } flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 $as_echo "${flag}" >&6; } if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with xlc_r or cc_r if test x"$GCC" != xyes; then for ac_prog in xlc_r cc_r do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PTHREAD_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PTHREAD_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 $as_echo "$PTHREAD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PTHREAD_CC" && break done test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}" else PTHREAD_CC=$CC fi else PTHREAD_CC="$CC" fi # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h : else acx_pthread_ok=no fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Checks for library functions. #AC_FUNC_ERROR_AT_LINE #AC_FUNC_MALLOC #AC_FUNC_MEMCMP #AC_FUNC_STRCOLL #AC_FUNC_STRTOD for ac_func in getcwd pathconf realpath \ getaddrinfo gethostbyaddr gethostbyname socket \ clock_gettime ftime gettimeofday timegm gmtime_r \ memmove memset nl_langinfo setlocale localeconv \ strcasecmp strncasecmp stricmp strnicmp strchr strdup \ strrchr strstr strtol strtoul snprintf \ towupper towlower mblen \ wcsupr wcslwr wcsnicmp wcsicmp \ do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # Some Unix systems, like Gnu Hurd, don't define PATH_MAX { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PATH_MAX" >&5 $as_echo_n "checking for PATH_MAX... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char dummy[PATH_MAX]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_PATH_MAX 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_PATH_MAX 0 _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Check for functional cstdint header { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cstdint" >&5 $as_echo_n "checking for cstdint... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { uint32_t v1 = 342; int64_t v2 = -23; return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define XERCES_HAVE_CSTDINT 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } cat >>confdefs.h <<_ACEOF #define XERCES_HAVE_CSTDINT 0 _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # The check for mbrlen, wcsrtombs and mbsrtowcs gives a false # positive on HP-UX, so we use a different snippet to set the # corresponding macro # Furthermore, OpenBSD 5.1 doesn't follow the standard that states # that the "src" pointer must be set to NULL when a \0 has been # converted in the source data, a behaviour that we rely on # So we also check for this scenario before using these functions { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbrlen" >&5 $as_echo_n "checking for mbrlen... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { mbstate_t st; mbrlen( "t", 5, &st ); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_MBRLEN 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_MBRLEN 0 _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wcsrtombs" >&5 $as_echo_n "checking for wcsrtombs... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { mbstate_t st; memset(&st, 0, sizeof(st)); char buffer[32]; const wchar_t* src=L"help"; wcsrtombs(buffer, &src, 32, &st); if(src==0) return 0; else return 1; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_WCSRTOMBS 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_WCSRTOMBS 0 _ACEOF fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbsrtowcs" >&5 $as_echo_n "checking for mbsrtowcs... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { mbstate_t st; memset(&st, 0, sizeof(st)); wchar_t buffer[32]; const char* src="help"; mbsrtowcs(buffer, &src, 32, &st); if(src==0) return 0; else return 1; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_MBSRTOWCS 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_MBSRTOWCS 0 _ACEOF fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if iconv uses const pointers" >&5 $as_echo_n "checking if iconv uses const pointers... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { const char *fromPtr=0; size_t fromLen=0; char *toPtr=0; size_t toLen=0; iconv_t cv=0; iconv(cv, &fromPtr, &fromLen, &toPtr, &toLen); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_USES_CONST_POINTER 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_USES_CONST_POINTER 0 _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext SHREXT=$shrext_cmds # # Orchestrate the replacement of missing functions # ac_fn_cxx_check_func "$LINENO" "stricmp" "ac_cv_func_stricmp" if test "x$ac_cv_func_stricmp" = xyes; then : $as_echo "#define HAVE_STRICMP 1" >>confdefs.h else case " $LIBOBJS " in *" stricmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS stricmp.$ac_objext" ;; esac fi ac_fn_cxx_check_func "$LINENO" "strnicmp" "ac_cv_func_strnicmp" if test "x$ac_cv_func_strnicmp" = xyes; then : $as_echo "#define HAVE_STRNICMP 1" >>confdefs.h else case " $LIBOBJS " in *" strnicmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strnicmp.$ac_objext" ;; esac fi ac_fn_cxx_check_func "$LINENO" "towlower" "ac_cv_func_towlower" if test "x$ac_cv_func_towlower" = xyes; then : $as_echo "#define HAVE_TOWLOWER 1" >>confdefs.h else case " $LIBOBJS " in *" towlower.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS towlower.$ac_objext" ;; esac fi ac_fn_cxx_check_func "$LINENO" "towupper" "ac_cv_func_towupper" if test "x$ac_cv_func_towupper" = xyes; then : $as_echo "#define HAVE_TOWUPPER 1" >>confdefs.h else case " $LIBOBJS " in *" towupper.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS towupper.$ac_objext" ;; esac fi abs_top_srcdir=`cd $srcdir; pwd` abs_top_builddir=`pwd` ###################################################### # Look for availability of available packages ###################################################### { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which path delimiter characters to accept" >&5 $as_echo_n "checking for which path delimiter characters to accept... " >&6; } path_delims=/ case $host_os in msdos* | windows* | mingw*) $as_echo "#define XERCES_PATH_DELIMITER_BACKSLASH 1" >>confdefs.h path_delims="${path_delims}\\" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_delims" >&5 $as_echo "$path_delims" >&6; } # Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then : enableval=$enable_threads; if test x"$enableval" = xno; then : xerces_cv_no_threads=yes fi else xerces_cv_no_threads=no fi if test x$xerces_cv_no_threads = xyes; then : $as_echo "#define APP_NO_THREADS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports ISO C++11 and " >&5 $as_echo_n "checking whether the compiler supports ISO C++11 and ... " >&6; } if ${ac_cv_cxx_have_std_thread+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include namespace { std::mutex m1; std::recursive_mutex m2; void threadmain() { std::lock_guard lock1(m1); std::lock_guard lock2(m2); std::cout << "In thread" << std::endl; } } int main () { std::thread foo(threadmain); foo.join(); return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_cxx_have_std_thread=yes else ac_cv_cxx_have_std_thread=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_have_std_thread" >&5 $as_echo "$ac_cv_cxx_have_std_thread" >&6; } if test "$ac_cv_cxx_have_std_thread" = yes; then $as_echo "#define HAVE_STD_THREAD /**/" >>confdefs.h fi ###################################################### # Test for availability of each mutex manager on this host. # For each mutex manager that's available, and hasn't been # disabled, add it to our list. If the mutex manager has been # explicitly "enable"d, then vote for it strongly, in upper # case. ###################################################### ml_list= # Use Standard C++11 threads if available list_add= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can support the Standard C++11 threads-based MutexMgr" >&5 $as_echo_n "checking whether we can support the Standard C++11 threads-based MutexMgr... " >&6; } if test x$xerces_cv_no_threads = xno && test x$ac_cv_cxx_have_std_thread = xyes; then : # Check whether --enable-mutexmgr-standard was given. if test "${enable_mutexmgr_standard+set}" = set; then : enableval=$enable_mutexmgr_standard; if test x"$enableval" = xyes; then : list_add=STANDARD fi else list_add=standard fi fi if test x"$list_add" != x; then : mm_list="$mm_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check for OS-specific mutex managers case $host_os in windows* | mingw*) # Native Windows threads list_add= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can support the Windows threads-based MutexMgr" >&5 $as_echo_n "checking whether we can support the Windows threads-based MutexMgr... " >&6; } if test x$xerces_cv_no_threads = xno; then : # Check whether --enable-mutexmgr-windows was given. if test "${enable_mutexmgr_windows+set}" = set; then : enableval=$enable_mutexmgr_windows; if test x"$enableval" = xyes; then : list_add=WINDOWS fi else list_add=windows fi fi if test x"$list_add" != x; then : mm_list="$mm_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi break ;; *) # Native POSIX threads list_add= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can support the POSIX threads (pthreads)-based MutexMgr" >&5 $as_echo_n "checking whether we can support the POSIX threads (pthreads)-based MutexMgr... " >&6; } if test x$xerces_cv_no_threads = xno; then : # Check whether --enable-mutexmgr-posix was given. if test "${enable_mutexmgr_posix+set}" = set; then : enableval=$enable_mutexmgr_posix; if test x"$enableval" = xyes; then : list_add=POSIX fi else list_add=posix fi fi if test x"$list_add" != x; then : mm_list="$mm_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi break ;; esac # If no threads is specified, use the NoThread Mutex Mgr list_add= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can support the NoThreads MutexMgr" >&5 $as_echo_n "checking whether we can support the NoThreads MutexMgr... " >&6; } # Check whether --enable-mutexmgr-nothreads was given. if test "${enable_mutexmgr_nothreads+set}" = set; then : enableval=$enable_mutexmgr_nothreads; if test x"$enableval" = xyes; then : list_add=NOTHREADS fi else list_add=nothreads fi if test x"$list_add" != x; then : mm_list="$mm_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ###################################################### # Determine which mutex manager to use. # # We do this in two passes. Mutex managers that have been # enabled with "yes", and which start out in upper case, get # the top priority on the first pass. On the second pass, we # consider those which are simply available, but which were # not "disable"d (these won't even be in our list). ###################################################### mutexmgr= az_lower=abcdefghijklmnopqrstuvwxyz az_upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which mutex manager to use (choices:$mm_list)" >&5 $as_echo_n "checking for which mutex manager to use (choices:$mm_list)... " >&6; } for i in 1 2; do # Swap upper/lower case in the mm_list. Cannot use tr ranges # because of the portability issues. # mm_list=`echo $mm_list | tr "$az_lower$az_upper" "$az_upper$az_lower"` # Check for each mutexmgr, in implicit rank order case $mm_list in *-standard-*) mutexmgr=standard; $as_echo "#define XERCES_USE_MUTEXMGR_STD 1" >>confdefs.h case $host_os in mingw*) CXXFLAGS="${CXXFLAGS} -mthreads" ;; esac if test "$acx_pthread_ok" = yes; then LIBS="${LIBS} ${PTHREAD_LIBS}" CXXFLAGS="${CXXFLAGS} ${PTHREAD_CFLAGS}" fi break ;; *-posix-*) mutexmgr=POSIX; $as_echo "#define XERCES_USE_MUTEXMGR_POSIX 1" >>confdefs.h # Set additional flags for link and compile LIBS="${LIBS} ${PTHREAD_LIBS}" CXXFLAGS="${CXXFLAGS} ${PTHREAD_CFLAGS}" break ;; *-windows-*) mutexmgr=Windows; $as_echo "#define XERCES_USE_MUTEXMGR_WINDOWS 1" >>confdefs.h case $host_os in mingw*) CXXFLAGS="${CXXFLAGS} -mthreads" ;; esac break ;; *-nothreads-*) mutexmgr=NoThreads $as_echo "#define XERCES_USE_MUTEXMGR_NOTHREAD 1" >>confdefs.h break ;; *) if test $i -eq 2; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: Xerces cannot function without mutex support. You may want to --disable-threads." >&5 $as_echo "Xerces cannot function without mutex support. You may want to --disable-threads." >&6; } fi ;; esac done if test x"$mutexmgr" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mutexmgr" >&5 $as_echo "$mutexmgr" >&6; } fi # Define the auto-make conditionals which determine what actually gets compiled # Note that these macros can't be executed conditionally, which is why they're here, not above. if test x"$mutexmgr" = xNoThreads; then XERCES_USE_MUTEXMGR_NOTHREAD_TRUE= XERCES_USE_MUTEXMGR_NOTHREAD_FALSE='#' else XERCES_USE_MUTEXMGR_NOTHREAD_TRUE='#' XERCES_USE_MUTEXMGR_NOTHREAD_FALSE= fi if test x"$mutexmgr" = xstandard; then XERCES_USE_MUTEXMGR_STD_TRUE= XERCES_USE_MUTEXMGR_STD_FALSE='#' else XERCES_USE_MUTEXMGR_STD_TRUE='#' XERCES_USE_MUTEXMGR_STD_FALSE= fi if test x"$mutexmgr" = xPOSIX; then XERCES_USE_MUTEXMGR_POSIX_TRUE= XERCES_USE_MUTEXMGR_POSIX_FALSE='#' else XERCES_USE_MUTEXMGR_POSIX_TRUE='#' XERCES_USE_MUTEXMGR_POSIX_FALSE= fi if test x"$mutexmgr" = xWindows; then XERCES_USE_MUTEXMGR_WINDOWS_TRUE= XERCES_USE_MUTEXMGR_WINDOWS_FALSE='#' else XERCES_USE_MUTEXMGR_WINDOWS_TRUE='#' XERCES_USE_MUTEXMGR_WINDOWS_FALSE= fi # Check whether --with-curl was given. if test "${with_curl+set}" = set; then : withval=$with_curl; if test x"$with_curl" = x"yes"; then with_curl= fi else with_curl= fi # Determine if curl is available if ${xerces_cv_curl_present+:} false; then : $as_echo_n "(cached) " >&6 else xerces_cv_curl_present=no if test x"$with_curl" != x"no"; then # See if we were given a prefix. # if test -n "$with_curl"; then # Extract the first word of "curl-config", so it can be a program name with args. set dummy curl-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_curl_config+:} false; then : $as_echo_n "(cached) " >&6 else case $curl_config in [\\/]* | ?:[\\/]*) ac_cv_path_curl_config="$curl_config" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $with_curl/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_curl_config="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi curl_config=$ac_cv_path_curl_config if test -n "$curl_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_config" >&5 $as_echo "$curl_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else # Extract the first word of "curl-config", so it can be a program name with args. set dummy curl-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_curl_config+:} false; then : $as_echo_n "(cached) " >&6 else case $curl_config in [\\/]* | ?:[\\/]*) ac_cv_path_curl_config="$curl_config" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_curl_config="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi curl_config=$ac_cv_path_curl_config if test -n "$curl_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_config" >&5 $as_echo "$curl_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -n "$curl_config"; then curl_flags=`$curl_config --cflags` curl_libs=`$curl_config --libs` else if test -n "$with_curl"; then curl_flags="-I$with_curl/include" curl_libs="-L$with_curl/lib -lcurl" else # Default compiler paths. # curl_flags= curl_libs=-lcurl fi fi # Check that the headers exist and can be compiled. # orig_cppflags=$CPPFLAGS if test -n "$curl_flags"; then CPPFLAGS="$curl_flags $CPPFLAGS" fi ac_fn_cxx_check_header_mongrel "$LINENO" "curl/curl.h" "ac_cv_header_curl_curl_h" "$ac_includes_default" if test "x$ac_cv_header_curl_curl_h" = xyes; then : xerces_cv_curl_present=yes fi CPPFLAGS=$orig_cppflags if test x"$xerces_cv_curl_present" != x"no"; then # Check that the library can be linked. # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl_multi_init in -lcurl" >&5 $as_echo_n "checking for curl_multi_init in -lcurl... " >&6; } orig_libs=$LIBS LIBS="$curl_libs $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { curl_multi_init(); return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : else xerces_cv_curl_present=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$orig_libs if test x"$xerces_cv_curl_present" != x"no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi fi if ${xerces_cv_curl_flags+:} false; then : $as_echo_n "(cached) " >&6 else xerces_cv_curl_flags=$curl_flags fi if ${xerces_cv_curl_libs+:} false; then : $as_echo_n "(cached) " >&6 else xerces_cv_curl_libs=$curl_libs fi CURL_PRESENT=$xerces_cv_curl_present CURL_FLAGS=$xerces_cv_curl_flags CURL_LIBS=$xerces_cv_curl_libs network=yes # Check whether --enable-network was given. if test "${enable_network+set}" = set; then : enableval=$enable_network; if test x"$enableval" = xno; then : network=no fi fi # If network is disabled we don't need to check any of the # netaccessors. # na_list= if test x"$network" = xyes; then # Checks for libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if ${ac_cv_lib_socket_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_socket_socket=yes else ac_cv_lib_socket_socket=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } if test "x$ac_cv_lib_socket_socket" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi ###################################################### # Test for availability of each netaccessor on this host. # For each netaccessor that's available, and hasn't been disabled, add it to our list. # If the netaccessor has been explicitly "enable"d, then vote for it strongly, # in upper case. ###################################################### { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can support the libcurl-based NetAccessor" >&5 $as_echo_n "checking whether we can support the libcurl-based NetAccessor... " >&6; } list_add= if test x"$xerces_cv_curl_present" != x"no"; then : # Check whether --enable-netaccessor-curl was given. if test "${enable_netaccessor_curl+set}" = set; then : enableval=$enable_netaccessor_curl; if test x"$enableval" = xyes; then : list_add=CURL fi else list_add=curl fi fi if test x"$list_add" != x; then : na_list="$na_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can support the sockets-based NetAccessor" >&5 $as_echo_n "checking whether we can support the sockets-based NetAccessor... " >&6; } list_add= if test x"$ac_cv_header_sys_socket_h" = xyes; then : # Check whether --enable-netaccessor-socket was given. if test "${enable_netaccessor_socket+set}" = set; then : enableval=$enable_netaccessor_socket; if test x"$enableval" = xyes; then : list_add=SOCKET fi else list_add=socket fi fi if test x"$list_add" != x; then : na_list="$na_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check for OS-specific netaccessors case $host_os in darwin*) list_add= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can support the CFURL NetAccessor (Mac OS X)" >&5 $as_echo_n "checking whether we can support the CFURL NetAccessor (Mac OS X)... " >&6; } if test x"$ac_cv_header_CoreServices_CoreServices_h" = xyes; then : # Check whether --enable-netaccessor-cfurl was given. if test "${enable_netaccessor_cfurl+set}" = set; then : enableval=$enable_netaccessor_cfurl; if test x"$enableval" = xyes; then : list_add=CFURL fi else list_add=cfurl fi fi if test x"$list_add" != x; then : na_list="$na_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; windows* | mingw*) list_add= no_winsock=false for ac_header in winsock2.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" if test "x$ac_cv_header_winsock2_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WINSOCK2_H 1 _ACEOF else no_winsock=true fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can support the WinSock NetAccessor (Windows)" >&5 $as_echo_n "checking whether we can support the WinSock NetAccessor (Windows)... " >&6; } if ! $no_winsock; then : # Check whether --enable-netaccessor-winsock was given. if test "${enable_netaccessor_winsock+set}" = set; then : enableval=$enable_netaccessor_winsock; if test x"$enableval" = xyes; then : list_add=WINSOCK fi else list_add=winsock fi fi if test x"$list_add" != x; then : na_list="$na_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; cygwin*) # Only add it to the list if the user explicitly asked # for it. # list_add= no_winsock=false for ac_header in winsock2.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" if test "x$ac_cv_header_winsock2_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WINSOCK2_H 1 _ACEOF else no_winsock=true fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use the WinSock NetAccessor (Windows)" >&5 $as_echo_n "checking whether to use the WinSock NetAccessor (Windows)... " >&6; } if ! $no_winsock; then : # Check whether --enable-netaccessor-winsock was given. if test "${enable_netaccessor_winsock+set}" = set; then : enableval=$enable_netaccessor_winsock; if test x"$enableval" = xyes; then : list_add=WINSOCK fi fi fi if test x"$list_add" != x; then : na_list="$na_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; esac ###################################################### # Determine which netaccessor to use. # # We do this in two passes. Accessors that have been enabled with "yes", # and which start out in upper case, get the top priority on the first pass. # On the second pass, we consider those which are simply available, but # which were not "disable"d (these won't even be in our list). ###################################################### netaccessor= az_lower=abcdefghijklmnopqrstuvwxyz az_upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which NetAccessor to use (choices:$na_list)" >&5 $as_echo_n "checking for which NetAccessor to use (choices:$na_list)... " >&6; } for i in 1 2; do # Swap upper/lower case in the na_list. Cannot use tr ranges # because of the portability issues. # na_list=`echo $na_list | tr "$az_lower$az_upper" "$az_upper$az_lower"` # Check for each netaccessor, in implicit rank order case $na_list in *-curl-*) netaccessor=curl $as_echo "#define XERCES_USE_NETACCESSOR_CURL 1" >>confdefs.h LIBS="${LIBS} ${xerces_cv_curl_libs}" break ;; *-winsock-*) netaccessor=winsock $as_echo "#define XERCES_USE_NETACCESSOR_WINSOCK 1" >>confdefs.h break ;; *-socket-*) netaccessor=socket $as_echo "#define XERCES_USE_NETACCESSOR_SOCKET 1" >>confdefs.h break ;; *-cfurl-*) netaccessor=cfurl $as_echo "#define XERCES_USE_NETACCESSOR_CFURL 1" >>confdefs.h case $host_os in darwin*) test -z "${xerces_darwin_frameworks}" && xerces_darwin_frameworks="-" case ${xerces_darwin_frameworks} in *-CoreServices-*) ;; *) xerces_darwin_frameworks="-CoreServices${xerces_darwin_frameworks}" LIBS="-Wl,-framework -Wl,CoreServices $LIBS" ;; esac ;; esac break ;; *) if test $i -eq 2; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: none available; there will be no network access!!!" >&5 $as_echo "none available; there will be no network access!!!" >&6; } fi ;; esac done if test x"$netaccessor" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $netaccessor" >&5 $as_echo "$netaccessor" >&6; } fi else # network netaccessor=disabled # for the report fi # Define the auto-make conditionals which determine what actually gets compiled # Note that these macros can't be executed conditionally, which is why they're here, not above. if test x"$netaccessor" = xcurl; then XERCES_USE_NETACCESSOR_CURL_TRUE= XERCES_USE_NETACCESSOR_CURL_FALSE='#' else XERCES_USE_NETACCESSOR_CURL_TRUE='#' XERCES_USE_NETACCESSOR_CURL_FALSE= fi if test x"$netaccessor" = xcfurl; then XERCES_USE_NETACCESSOR_CFURL_TRUE= XERCES_USE_NETACCESSOR_CFURL_FALSE='#' else XERCES_USE_NETACCESSOR_CFURL_TRUE='#' XERCES_USE_NETACCESSOR_CFURL_FALSE= fi if test x"$netaccessor" = xwinsock; then XERCES_USE_NETACCESSOR_WINSOCK_TRUE= XERCES_USE_NETACCESSOR_WINSOCK_FALSE='#' else XERCES_USE_NETACCESSOR_WINSOCK_TRUE='#' XERCES_USE_NETACCESSOR_WINSOCK_FALSE= fi if test x"$netaccessor" = xsocket; then XERCES_USE_NETACCESSOR_SOCKET_TRUE= XERCES_USE_NETACCESSOR_SOCKET_FALSE='#' else XERCES_USE_NETACCESSOR_SOCKET_TRUE='#' XERCES_USE_NETACCESSOR_SOCKET_FALSE= fi # Check whether --with-icu was given. if test "${with_icu+set}" = set; then : withval=$with_icu; if test x"$with_icu" = x"yes"; then with_icu= fi else with_icu= fi # Determine if icu is available if ${xerces_cv_icu_present+:} false; then : $as_echo_n "(cached) " >&6 else xerces_cv_icu_present=no if test x"$with_icu" != x"no"; then # See if we were given a prefix. # if test -n "$with_icu"; then # Extract the first word of "icu-config", so it can be a program name with args. set dummy icu-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_icu_config+:} false; then : $as_echo_n "(cached) " >&6 else case $icu_config in [\\/]* | ?:[\\/]*) ac_cv_path_icu_config="$icu_config" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $with_icu/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_icu_config="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi icu_config=$ac_cv_path_icu_config if test -n "$icu_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $icu_config" >&5 $as_echo "$icu_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else # Extract the first word of "icu-config", so it can be a program name with args. set dummy icu-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_icu_config+:} false; then : $as_echo_n "(cached) " >&6 else case $icu_config in [\\/]* | ?:[\\/]*) ac_cv_path_icu_config="$icu_config" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_icu_config="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi icu_config=$ac_cv_path_icu_config if test -n "$icu_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $icu_config" >&5 $as_echo "$icu_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi # Add trailing slash to bin and sbin vars so that we # can use them uniformly whether they are empty or not. # if test -n "$icu_config"; then icu_flags=`$icu_config --cppflags-searchpath` icu_libs=`$icu_config --ldflags` icu_bin=`$icu_config --bindir` icu_sbin=`$icu_config --sbindir` if test -n "$icu_bin"; then icu_bin="$icu_bin/" fi if test -n "$icu_sbin"; then icu_sbin="$icu_sbin/" fi else if test -n "$with_icu"; then icu_flags="-I$with_icu/include" icu_libs="-L$with_icu/lib -licuuc -licudata" icu_bin="$with_icu/bin/" icu_sbin="$with_icu/sbin/" else # Default compiler paths. # icu_flags= icu_libs="-licuuc -licudata" icu_bin= icu_sbin= fi fi # Check that the headers exist and can be compiled. # orig_cppflags=$CPPFLAGS if test -n "$icu_flags"; then CPPFLAGS="$icu_flags $CPPFLAGS" fi ac_fn_cxx_check_header_mongrel "$LINENO" "unicode/ucnv.h" "ac_cv_header_unicode_ucnv_h" "$ac_includes_default" if test "x$ac_cv_header_unicode_ucnv_h" = xyes; then : xerces_cv_icu_present=yes fi if test x"$xerces_cv_icu_present" != x"no"; then # Check that the library can be linked. # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ucnv_open in -licuuc" >&5 $as_echo_n "checking for ucnv_open in -licuuc... " >&6; } orig_libs=$LIBS LIBS="$icu_libs $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { ucnv_open (0, 0); return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : else xerces_cv_icu_present=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$orig_libs if test x"$xerces_cv_icu_present" != x"no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi CPPFLAGS=$orig_cppflags fi fi if ${xerces_cv_icu_flags+:} false; then : $as_echo_n "(cached) " >&6 else xerces_cv_icu_flags=$icu_flags fi if ${xerces_cv_icu_libs+:} false; then : $as_echo_n "(cached) " >&6 else xerces_cv_icu_libs=$icu_libs fi if ${xerces_cv_icu_bin+:} false; then : $as_echo_n "(cached) " >&6 else xerces_cv_icu_bin=$icu_bin fi if ${xerces_cv_icu_sbin+:} false; then : $as_echo_n "(cached) " >&6 else xerces_cv_icu_sbin=$icu_sbin fi ICU_PRESENT=$xerces_cv_icu_present ICU_FLAGS=$xerces_cv_icu_flags ICU_LIBS=$xerces_cv_icu_libs ICU_BIN=$xerces_cv_icu_bin ICU_SBIN=$xerces_cv_icu_sbin ###################################################### # Test for availability of each transcoder on this host. # For each transcoder that's available, and hasn't been disabled, add it to our list. # If the transcoder has been explicitly "enable"d, then vote for it strongly, # in upper case. ###################################################### tc_list= # Check for GNU iconv support no_GNUiconv=false for ac_header in iconv.h wchar.h string.h stdlib.h stdio.h ctype.h locale.h errno.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else no_GNUiconv=true fi done # The code in iconv needs just on of these include files ac_fn_cxx_check_header_mongrel "$LINENO" "endian.h" "ac_cv_header_endian_h" "$ac_includes_default" if test "x$ac_cv_header_endian_h" = xyes; then : else ac_fn_cxx_check_header_mongrel "$LINENO" "machine/endian.h" "ac_cv_header_machine_endian_h" "$ac_includes_default" if test "x$ac_cv_header_machine_endian_h" = xyes; then : else ac_fn_cxx_check_header_mongrel "$LINENO" "arpa/nameser_compat.h" "ac_cv_header_arpa_nameser_compat_h" "$ac_includes_default" if test "x$ac_cv_header_arpa_nameser_compat_h" = xyes; then : else no_GNUiconv=true fi fi fi for ac_func in iconv_open iconv_close iconv do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else no_GNUiconv=true fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can support the GNU iconv Transcoder" >&5 $as_echo_n "checking whether we can support the GNU iconv Transcoder... " >&6; } list_add= if ! $no_GNUiconv; then : # Check whether --enable-transcoder-gnuiconv was given. if test "${enable_transcoder_gnuiconv+set}" = set; then : enableval=$enable_transcoder_gnuiconv; if test x"$enableval" = xyes; then : list_add=GNUICONV fi else list_add=gnuiconv fi fi if test x"$list_add" != x; then : tc_list="$tc_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check for iconv support no_iconv=false for ac_header in wchar.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default" if test "x$ac_cv_header_wchar_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WCHAR_H 1 _ACEOF else no_iconv=true fi done for ac_func in mblen wcstombs mbstowcs do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else no_iconv=true fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can support the iconv Transcoder" >&5 $as_echo_n "checking whether we can support the iconv Transcoder... " >&6; } list_add= if ! $no_iconv; then : # Check whether --enable-transcoder-iconv was given. if test "${enable_transcoder_iconv+set}" = set; then : enableval=$enable_transcoder_iconv; if test x"$enableval" = xyes; then : list_add=ICONV fi else list_add=iconv fi fi if test x"$list_add" != x; then : tc_list="$tc_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check for ICU { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can support the ICU Transcoder" >&5 $as_echo_n "checking whether we can support the ICU Transcoder... " >&6; } list_add= if test x"$xerces_cv_icu_present" != x"no"; then : # Check whether --enable-transcoder-icu was given. if test "${enable_transcoder_icu+set}" = set; then : enableval=$enable_transcoder_icu; if test x"$enableval" = xyes; then : list_add=ICU fi else list_add=icu fi fi if test x"$list_add" != x; then : tc_list="$tc_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check for platform-specific transcoders list_add= case $host_os in darwin*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can support the MacOSUnicodeConverter Transcoder" >&5 $as_echo_n "checking whether we can support the MacOSUnicodeConverter Transcoder... " >&6; } if test x"$ac_cv_header_CoreServices_CoreServices_h" = xyes; then : # Check whether --enable-transcoder-macosunicodeconverter was given. if test "${enable_transcoder_macosunicodeconverter+set}" = set; then : enableval=$enable_transcoder_macosunicodeconverter; if test x"$enableval" = xyes; then : list_add=MACOSUNICODECONVERTER fi else list_add=macosunicodeconverter fi fi if test x"$list_add" != x; then : tc_list="$tc_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; windows* | mingw*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can support the Windows Transcoder" >&5 $as_echo_n "checking whether we can support the Windows Transcoder... " >&6; } # Check whether --enable-transcoder-windows was given. if test "${enable_transcoder_windows+set}" = set; then : enableval=$enable_transcoder_windows; if test x"$enableval" = xyes; then : list_add=WINDOWS fi else list_add=windows fi if test x"$list_add" != x; then : tc_list="$tc_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; cygwin*) # Only add it to the list if the user explicitly asked # for it. # { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use the Windows Transcoder" >&5 $as_echo_n "checking whether to use the Windows Transcoder... " >&6; } # Check whether --enable-transcoder-windows was given. if test "${enable_transcoder_windows+set}" = set; then : enableval=$enable_transcoder_windows; if test x"$enableval" = xyes; then : list_add=WINDOWS fi fi if test x"$list_add" != x; then : tc_list="$tc_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; esac # TODO: Tests for additional transcoders ###################################################### # Determine which transcoder to use. # # We do this in two passes. Transcoders that have been enabled with "yes", # and which start out in upper case, get the top priority on the first pass. # On the second pass, we consider those which are simply available, but # which were not "disable"d (these won't even be in our list). ###################################################### transcoder= az_lower=abcdefghijklmnopqrstuvwxyz az_upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which Transcoder to use (choices:$tc_list)" >&5 $as_echo_n "checking for which Transcoder to use (choices:$tc_list)... " >&6; } for i in 1 2; do # Swap upper/lower case in the tc_list. Cannot use tr ranges # because of the portability issues. # tc_list=`echo $tc_list | tr "$az_lower$az_upper" "$az_upper$az_lower"` # Check for each transcoder, in implicit rank order case $tc_list in *-icu-*) transcoder=icu $as_echo "#define XERCES_USE_TRANSCODER_ICU 1" >>confdefs.h LIBS="${LIBS} ${xerces_cv_icu_libs}" break ;; *-macosunicodeconverter-*) transcoder=macosunicodeconverter $as_echo "#define XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER 1" >>confdefs.h case $host_os in darwin*) test -z "${xerces_darwin_frameworks}" && xerces_darwin_frameworks="-" case ${xerces_darwin_frameworks} in *-CoreServices-*) ;; *) xerces_darwin_frameworks="-CoreServices${xerces_darwin_frameworks}" LIBS="-Wl,-framework -Wl,CoreServices $LIBS" ;; esac ;; esac break ;; *-gnuiconv-*) transcoder=gnuiconv $as_echo "#define XERCES_USE_TRANSCODER_GNUICONV 1" >>confdefs.h break ;; *-windows-*) transcoder=windows $as_echo "#define XERCES_USE_TRANSCODER_WINDOWS 1" >>confdefs.h break ;; *-iconv-*) transcoder=iconv $as_echo "#define XERCES_USE_TRANSCODER_ICONV 1" >>confdefs.h break ;; *) if test $i -eq 2; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } as_fn_error $? "Xerces cannot function without a transcoder" "$LINENO" 5 fi ;; esac done if test x"$transcoder" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $transcoder" >&5 $as_echo "$transcoder" >&6; } fi # Define the auto-make conditionals which determine what actually gets compiled # Note that these macros can't be executed conditionally, which is why they're here, not above. if test x"$transcoder" = xicu; then XERCES_USE_TRANSCODER_ICU_TRUE= XERCES_USE_TRANSCODER_ICU_FALSE='#' else XERCES_USE_TRANSCODER_ICU_TRUE='#' XERCES_USE_TRANSCODER_ICU_FALSE= fi if test x"$transcoder" = xmacosunicodeconverter; then XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER_TRUE= XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER_FALSE='#' else XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER_TRUE='#' XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER_FALSE= fi if test x"$transcoder" = xgnuiconv; then XERCES_USE_TRANSCODER_GNUICONV_TRUE= XERCES_USE_TRANSCODER_GNUICONV_FALSE='#' else XERCES_USE_TRANSCODER_GNUICONV_TRUE='#' XERCES_USE_TRANSCODER_GNUICONV_FALSE= fi if test x"$transcoder" = xiconv; then XERCES_USE_TRANSCODER_ICONV_TRUE= XERCES_USE_TRANSCODER_ICONV_FALSE='#' else XERCES_USE_TRANSCODER_ICONV_TRUE='#' XERCES_USE_TRANSCODER_ICONV_FALSE= fi if test x"$transcoder" = xwindows; then XERCES_USE_TRANSCODER_WINDOWS_TRUE= XERCES_USE_TRANSCODER_WINDOWS_FALSE='#' else XERCES_USE_TRANSCODER_WINDOWS_TRUE='#' XERCES_USE_TRANSCODER_WINDOWS_FALSE= fi ###################################################### # Test for availability of each msgloader on this host. # For each msgloader that's available, and hasn't been disabled, add it to our list. # If the msgloader has been explicitly "enable"d, then vote for it strongly, # in upper case. ###################################################### ml_list= # Check for inmemory msgloader { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we support the InMemory MsgLoader" >&5 $as_echo_n "checking whether we support the InMemory MsgLoader... " >&6; } list_add= if true; then : # Check whether --enable-msgloader-inmemory was given. if test "${enable_msgloader_inmemory+set}" = set; then : enableval=$enable_msgloader_inmemory; if test x"$enableval" = xyes; then : list_add=INMEMORY fi else list_add=inmemory fi fi if test x"$list_add" != x; then : ml_list="$ml_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check for ICU { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we support the ICU MsgLoader" >&5 $as_echo_n "checking whether we support the ICU MsgLoader... " >&6; } list_add= if test x"$xerces_cv_icu_present" != x"no"; then : # Check whether --enable-msgloader-icu was given. if test "${enable_msgloader_icu+set}" = set; then : enableval=$enable_msgloader_icu; if test x"$enableval" = xyes; then : list_add=ICU fi else list_add=icu fi fi if test x"$list_add" != x; then : ml_list="$ml_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check for iconv support no_iconv=false for ac_header in nl_types.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "nl_types.h" "ac_cv_header_nl_types_h" "$ac_includes_default" if test "x$ac_cv_header_nl_types_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NL_TYPES_H 1 _ACEOF else no_iconv=true fi done for ac_func in catopen catclose catgets do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else no_iconv=true fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can support the iconv MsgLoader" >&5 $as_echo_n "checking whether we can support the iconv MsgLoader... " >&6; } list_add= if ! $no_iconv; then : # Check whether --enable-msgloader-iconv was given. if test "${enable_msgloader_iconv+set}" = set; then : enableval=$enable_msgloader_iconv; if test x"$enableval" = xyes; then : list_add=ICONV fi else list_add=iconv fi fi if test x"$list_add" != x; then : ml_list="$ml_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # TODO: Add test for additional msgloaders ###################################################### # Determine which msgloader to use. # # We do this in two passes. MsgLoaders that have been enabled with "yes", # and which start out in upper case, get the top priority on the first pass. # On the second pass, we consider those which are simply available, but # which were not "disable"d (these won't even be in our list). ###################################################### msgloader= az_lower=abcdefghijklmnopqrstuvwxyz az_upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which MsgLoader to use (choices:$ml_list)" >&5 $as_echo_n "checking for which MsgLoader to use (choices:$ml_list)... " >&6; } for i in 1 2; do # Swap upper/lower case in the ml_list. Cannot use tr ranges # because of the portability issues. # ml_list=`echo $ml_list | tr "$az_lower$az_upper" "$az_upper$az_lower"` # Check for each msgloader, in implicit rank order case $ml_list in *-inmemory-*) $as_echo "#define XERCES_USE_MSGLOADER_INMEMORY 1" >>confdefs.h msgloader=inmemory break ;; *-icu-*) $as_echo "#define XERCES_USE_MSGLOADER_ICU 1" >>confdefs.h msgloader=icu LIBS="${LIBS} ${xerces_cv_icu_libs}" break ;; *-iconv-*) $as_echo "#define XERCES_USE_MSGLOADER_ICONV 1" >>confdefs.h msgloader=iconv break ;; *) if test $i -eq 2; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } as_fn_error $? "Xerces cannot function without a MsgLoader" "$LINENO" 5 fi ;; esac done if test x"$msgloader" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $msgloader" >&5 $as_echo "$msgloader" >&6; } fi # Define the auto-make conditionals which determine what actually gets compiled # Note that these macros can't be executed conditionally, which is why they're here, not above. if test x"$msgloader" = xicu; then XERCES_USE_MSGLOADER_ICU_TRUE= XERCES_USE_MSGLOADER_ICU_FALSE='#' else XERCES_USE_MSGLOADER_ICU_TRUE='#' XERCES_USE_MSGLOADER_ICU_FALSE= fi if test x"$msgloader" = xiconv; then XERCES_USE_MSGLOADER_ICONV_TRUE= XERCES_USE_MSGLOADER_ICONV_FALSE='#' else XERCES_USE_MSGLOADER_ICONV_TRUE='#' XERCES_USE_MSGLOADER_ICONV_FALSE= fi if test x"$msgloader" = xinmemory; then XERCES_USE_MSGLOADER_INMEMORY_TRUE= XERCES_USE_MSGLOADER_INMEMORY_FALSE='#' else XERCES_USE_MSGLOADER_INMEMORY_TRUE='#' XERCES_USE_MSGLOADER_INMEMORY_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which File Manager to use" >&5 $as_echo_n "checking for which File Manager to use... " >&6; } filemgr= # Platform specific checks case $host_os in windows* | mingw*) filemgr=Windows; $as_echo "#define XERCES_USE_FILEMGR_WINDOWS 1" >>confdefs.h ;; esac # Fall back to using posix files if test -z "$filemgr"; then : filemgr=POSIX; $as_echo "#define XERCES_USE_FILEMGR_POSIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $filemgr" >&5 $as_echo "$filemgr" >&6; } # Define the auto-make conditionals which determine what actually gets compiled # Note that these macros can't be executed conditionally, which is why they're here, not above. if test x"$filemgr" = xPOSIX; then XERCES_USE_FILEMGR_POSIX_TRUE= XERCES_USE_FILEMGR_POSIX_FALSE='#' else XERCES_USE_FILEMGR_POSIX_TRUE='#' XERCES_USE_FILEMGR_POSIX_FALSE= fi if test x"$filemgr" = xWindows; then XERCES_USE_FILEMGR_WINDOWS_TRUE= XERCES_USE_FILEMGR_WINDOWS_FALSE='#' else XERCES_USE_FILEMGR_WINDOWS_TRUE='#' XERCES_USE_FILEMGR_WINDOWS_FALSE= fi # Allow the user to specify the pkgconfig directory. # # Check whether --with-pkgconfigdir was given. if test "${with_pkgconfigdir+set}" = set; then : withval=$with_pkgconfigdir; pkgconfigdir=${withval} else pkgconfigdir='${libdir}/pkgconfig' fi # Allow the user to disable the SSE2 support # # Check whether --enable-sse2 was given. if test "${enable_sse2+set}" = set; then : enableval=$enable_sse2; have_sse2=${enableval} else have_sse2=yes fi ###################################################### # Define some namespace-protected macros for use in the # publicly visible Xerces_autoconf_config.h file. ###################################################### $as_echo "#define XERCES_AUTOCONF 1" >>confdefs.h if test x$ac_cv_header_stdint_h = xyes; then : $as_echo "#define XERCES_HAVE_STDINT_H 1" >>confdefs.h fi if test x$ac_cv_header_sys_types_h = xyes; then : $as_echo "#define XERCES_HAVE_SYS_TYPES_H 1" >>confdefs.h fi if test x$ac_cv_header_inttypes_h = xyes; then : $as_echo "#define XERCES_HAVE_INTTYPES_H 1" >>confdefs.h fi case $host in *-*-msdos* | *-*-mingw32* | *-*-cygwin* | *-*-windows* ) platform_export="__declspec(dllexport)" platform_import="__declspec(dllimport)" template_extern="" ;; * ) platform_export="" platform_import="" template_extern="extern" ;; esac cat >>confdefs.h <<_ACEOF #define XERCES_PLATFORM_EXPORT $platform_export _ACEOF cat >>confdefs.h <<_ACEOF #define XERCES_PLATFORM_IMPORT $platform_import _ACEOF cat >>confdefs.h <<_ACEOF #define XERCES_TEMPLATE_EXTERN $template_extern _ACEOF if test ! $ac_cv_cxx_have_bool; then : $as_echo "#define XERCES_NO_NATIVE_BOOL 1" >>confdefs.h fi xmlch_list= if test $ac_cv_cxx_have_lstring; then : $as_echo "#define XERCES_LSTRSUPPORT 1" >>confdefs.h fi ###################################################### # Test for availability of each XML character type on this host. # For each type that's available, and hasn't been disabled, add it to our list. # If the type has been explicitly "enable"d, then vote for it strongly, # in upper case. ###################################################### char16_t_available=false { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++11 char16_t is available" >&5 $as_echo_n "checking whether C++11 char16_t is available... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { const char16_t *unicode = u"Test ünícodè → ©"; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : char16_t_available=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else char16_t_available=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can support char16_t XMLCh" >&5 $as_echo_n "checking whether we can support char16_t XMLCh... " >&6; } list_add= if test x"$char16_t_available" != x"no"; then : # Check whether --enable-xmlch-char16_t was given. if test "${enable_xmlch_char16_t+set}" = set; then : enableval=$enable_xmlch_char16_t; if test x"$enableval" = xyes; then : list_add=CHAR16_T fi else list_add=char16_t fi fi if test x"$list_add" != x; then : xmlch_list="$xmlch_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check if the Windows API is defined as using wchar_t or # unsigned short; if it's wchar_t, we need to map XMLCh to be wchar_t # (this is safe because on Windows wchar_t is used to store UTF-16 # codepoints, while it is not true on Unix) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Windows SDK is available and using wchar_t as wide string" >&5 $as_echo_n "checking whether the Windows SDK is available and using wchar_t as wide string... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include wchar_t file[] = L"dummy.file"; int main () { DeleteFileW(file); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : wchar_t_available=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else wchar_t_available=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can support wchar_t XMLCh" >&5 $as_echo_n "checking whether we can support wchar_t XMLCh... " >&6; } list_add= if test x"$wchar_t_available" = xyes; then : # Check whether --enable-xmlch-wchar_t was given. if test "${enable_xmlch_wchar_t+set}" = set; then : enableval=$enable_xmlch_wchar_t; if test x"$enableval" = xyes; then : list_add=WCHAR_T fi else list_add=wchar_t fi fi if test x"$list_add" != x; then : xmlch_list="$xmlch_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can support uint16_t XMLCh" >&5 $as_echo_n "checking whether we can support uint16_t XMLCh... " >&6; } list_add= # Check whether --enable-xmlch-uint16_t was given. if test "${enable_xmlch_uint16_t+set}" = set; then : enableval=$enable_xmlch_uint16_t; if test x"$enableval" = xyes; then : list_add=UINT16_T fi else list_add=uint16_t fi if test x"$list_add" != x; then : xmlch_list="$xmlch_list -$list_add-"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ###################################################### # Determine which XMLCh type to use. # # We do this in two passes. Types that have been enabled with "yes", # and which start out in upper case, get the top priority on the first pass. # On the second pass, we consider those which are simply available, but # which were not "disable"d (these won't even be in our list). ###################################################### xmlch= az_lower=abcdefghijklmnopqrstuvwxyz az_upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which XMLCh type to use (choices:$xmlch_list)" >&5 $as_echo_n "checking for which XMLCh type to use (choices:$xmlch_list)... " >&6; } for i in 1 2; do # Swap upper/lower case in the xmlch_list. Cannot use tr ranges # because of the portability issues. # xmlch_list=`echo $xmlch_list | tr "$az_lower$az_upper" "$az_upper$az_lower"` # Check for each xmlch, in implicit rank order case $xmlch_list in *-char16_t-*) xmlch=char16_t xmlch_type=char16_t break ;; *-wchar_t-*) xmlch=wchar_t xmlch_type=wchar_t break ;; *-uint16_t-*) xmlch=uint16_t xmlch_type=$xerces_cv_type_u16bit_int break ;; *) if test $i -eq 2; then : xmlch=uint16_t xmlch_type=$xerces_cv_type_u16bit_int { $as_echo "$as_me:${as_lineno-$LINENO}: result: none available; falling back to uint16_t" >&5 $as_echo "none available; falling back to uint16_t" >&6; } fi ;; esac done if test x"$xmlch" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xmlch" >&5 $as_echo "$xmlch" >&6; } fi if test "x$xmlch" = "xchar16_t"; then XERCES_USE_CHAR16_TRUE= XERCES_USE_CHAR16_FALSE='#' else XERCES_USE_CHAR16_TRUE='#' XERCES_USE_CHAR16_FALSE= fi cat >>confdefs.h <<_ACEOF #define XERCES_XMLCH_T $xmlch_type _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler chokes on a placement operator delete" >&5 $as_echo_n "checking whether the compiler chokes on a placement operator delete... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include class XMemory { public : void* operator new(size_t s) { return 0; } void* operator new(size_t s, void* ptr) { return 0; } void operator delete(void* p) {} void operator delete(void* p, void* ptr) {} }; int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define XERCES_NO_MATCHING_DELETE_OPERATOR 1 _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$have_sse2" = "yes"; then no_sse2_CXXFLAGS="$CXXFLAGS" save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -msse2" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need to add -msse2" >&5 $as_echo_n "checking whether we need to add -msse2... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { __m128i one; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : msse2_ok=yes else msse2_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $msse2_ok" >&5 $as_echo "$msse2_ok" >&6; } if test x"$msse2_ok" = xno; then CXXFLAGS="$save_CXXFLAGS" fi # Sun CC option test. Currently disabled since it doesn't work. Also note # that Sun CC will accept -msse2 (i.e., it won't fail) but will keep issuing # warnings. So if enabled this test needs to be moved before -msse2 and if # it passes, then -msse2 should be skipped. # # save_CXXFLAGS="$CXXFLAGS" # CXXFLAGS="$CXXFLAGS -xarch=sse2" # AC_MSG_CHECKING([whether we need to add -xarch=sse2]) # AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[__m128i one;]])], # [xarchsse2_ok=yes], # [xarchsse2_ok=no] # ) # AC_MSG_RESULT($xarchsse2_ok) # if test x"$xarchsse2_ok" = xno; then # CXXFLAGS="$save_CXXFLAGS" # fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intrin.h usability" >&5 $as_echo_n "checking for intrin.h usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define XERCES_HAVE_INTRIN_H 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for emmintrin.h usability" >&5 $as_echo_n "checking for emmintrin.h usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define XERCES_HAVE_EMMINTRIN_H 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cpuid.h usability" >&5 $as_echo_n "checking for cpuid.h usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_CPUID_H 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler has the CPUID intrinsic" >&5 $as_echo_n "checking whether the compiler has the CPUID intrinsic... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int CPUInfo[4]; __cpuid(CPUInfo, 1); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define XERCES_HAVE_CPUID_INTRINSIC 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler has the _get_cpuid intrinsic" >&5 $as_echo_n "checking whether the compiler has the _get_cpuid intrinsic... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { unsigned int eax, ebx, ecx, edx; __get_cpuid (1, &eax, &ebx, &ecx, &edx); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define XERCES_HAVE_GETCPUID 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler has the SSE2 intrinsic" >&5 $as_echo_n "checking whether the compiler has the SSE2 intrinsic... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { __m128i* one=(__m128i*)_mm_malloc(4, 16); __m128i* two=(__m128i*)_mm_malloc(4, 16); __m128i xmm1 = _mm_load_si128(one); __m128i xmm2 = _mm_load_si128(two); __m128i xmm3 = _mm_or_si128(xmm1, xmm2); _mm_store_si128(one, xmm3); _mm_free(one); _mm_free(two); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } sse2_usable=yes cat >>confdefs.h <<_ACEOF #define XERCES_HAVE_SSE2_INTRINSIC 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } sse2_usable=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Restore original CXXFLAGS if SSE2 is not usable. # if test "$sse2_usable" = "no"; then CXXFLAGS="$no_sse2_CXXFLAGS" fi fi if test x$ac_cv_type_size_t = xyes; then : $as_echo "#define XERCES_SIZE_T size_t" >>confdefs.h $as_echo "#define XERCES_SIZE_MAX SIZE_MAX" >>confdefs.h else $as_echo "#define XERCES_SIZE_T unsigned long" >>confdefs.h $as_echo "#define XERCES_SIZE_MAX ULONG_MAX" >>confdefs.h fi if test x$ac_cv_type_ssize_t = xyes; then : $as_echo "#define XERCES_SSIZE_T ssize_t" >>confdefs.h $as_echo "#define XERCES_SSIZE_MAX SSIZE_MAX" >>confdefs.h else $as_echo "#define XERCES_SSIZE_T long" >>confdefs.h $as_echo "#define XERCES_SSIZE_MAX LONG_MAX" >>confdefs.h fi if test x$ac_cv_cxx_have_namespaces = xyes; then : $as_echo "#define XERCES_HAS_CPP_NAMESPACE 1" >>confdefs.h fi if test x$ac_cv_cxx_have_std_namespace = xyes; then : $as_echo "#define XERCES_STD_NAMESPACE 1" >>confdefs.h fi if test x$ac_cv_cxx_have_std_libs = xyes; then : $as_echo "#define XERCES_NEW_IOSTREAMS 1" >>confdefs.h fi cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_MUTEXMGR_NOTHREAD_TRUE}" && test -z "${XERCES_USE_MUTEXMGR_NOTHREAD_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_MUTEXMGR_NOTHREAD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_MUTEXMGR_STD_TRUE}" && test -z "${XERCES_USE_MUTEXMGR_STD_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_MUTEXMGR_STD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_MUTEXMGR_POSIX_TRUE}" && test -z "${XERCES_USE_MUTEXMGR_POSIX_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_MUTEXMGR_POSIX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_MUTEXMGR_WINDOWS_TRUE}" && test -z "${XERCES_USE_MUTEXMGR_WINDOWS_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_MUTEXMGR_WINDOWS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_NETACCESSOR_CURL_TRUE}" && test -z "${XERCES_USE_NETACCESSOR_CURL_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_NETACCESSOR_CURL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_NETACCESSOR_CFURL_TRUE}" && test -z "${XERCES_USE_NETACCESSOR_CFURL_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_NETACCESSOR_CFURL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_NETACCESSOR_WINSOCK_TRUE}" && test -z "${XERCES_USE_NETACCESSOR_WINSOCK_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_NETACCESSOR_WINSOCK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_NETACCESSOR_SOCKET_TRUE}" && test -z "${XERCES_USE_NETACCESSOR_SOCKET_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_NETACCESSOR_SOCKET\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_TRANSCODER_ICU_TRUE}" && test -z "${XERCES_USE_TRANSCODER_ICU_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_TRANSCODER_ICU\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER_TRUE}" && test -z "${XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_TRANSCODER_GNUICONV_TRUE}" && test -z "${XERCES_USE_TRANSCODER_GNUICONV_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_TRANSCODER_GNUICONV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_TRANSCODER_ICONV_TRUE}" && test -z "${XERCES_USE_TRANSCODER_ICONV_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_TRANSCODER_ICONV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_TRANSCODER_WINDOWS_TRUE}" && test -z "${XERCES_USE_TRANSCODER_WINDOWS_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_TRANSCODER_WINDOWS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_MSGLOADER_ICU_TRUE}" && test -z "${XERCES_USE_MSGLOADER_ICU_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_MSGLOADER_ICU\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_MSGLOADER_ICONV_TRUE}" && test -z "${XERCES_USE_MSGLOADER_ICONV_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_MSGLOADER_ICONV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_MSGLOADER_INMEMORY_TRUE}" && test -z "${XERCES_USE_MSGLOADER_INMEMORY_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_MSGLOADER_INMEMORY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_FILEMGR_POSIX_TRUE}" && test -z "${XERCES_USE_FILEMGR_POSIX_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_FILEMGR_POSIX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_FILEMGR_WINDOWS_TRUE}" && test -z "${XERCES_USE_FILEMGR_WINDOWS_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_FILEMGR_WINDOWS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XERCES_USE_CHAR16_TRUE}" && test -z "${XERCES_USE_CHAR16_FALSE}"; then as_fn_error $? "conditional \"XERCES_USE_CHAR16\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by xerces-c $as_me 3.2.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ xerces-c config.status 3.2.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' libtool_patch_use_rpath=$xerces_cv_rpath _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "src/xercesc/util/Xerces_autoconf_config.hpp") CONFIG_HEADERS="$CONFIG_HEADERS src/xercesc/util/Xerces_autoconf_config.hpp" ;; "src/xercesc/util/XercesVersion.hpp") CONFIG_HEADERS="$CONFIG_HEADERS src/xercesc/util/XercesVersion.hpp" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/Doxyfile") CONFIG_FILES="$CONFIG_FILES doc/Doxyfile" ;; "doc/style/dtd/entities.ent") CONFIG_FILES="$CONFIG_FILES doc/style/dtd/entities.ent" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "samples/Makefile") CONFIG_FILES="$CONFIG_FILES samples/Makefile" ;; "xerces-c.pc") CONFIG_FILES="$CONFIG_FILES xerces-c.pc" ;; "scripts/run-test") CONFIG_FILES="$CONFIG_FILES scripts/run-test" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "libtool-rpath-patch") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool-rpath-patch" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='CXX ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; "libtool-rpath-patch":C) if test "$libtool_patch_use_rpath" = "no"; then echo config.status: patching libtool to not use rpath sed < libtool > libtool-2 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_NO_RPATH__ "/' mv libtool-2 libtool chmod 755 libtool fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5 $as_echo "$as_me: " >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Report:" >&5 $as_echo "$as_me: Report:" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: File Manager: $filemgr" >&5 $as_echo "$as_me: File Manager: $filemgr" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Mutex Manager: $mutexmgr" >&5 $as_echo "$as_me: Mutex Manager: $mutexmgr" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Transcoder: $transcoder" >&5 $as_echo "$as_me: Transcoder: $transcoder" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: NetAccessor: $netaccessor" >&5 $as_echo "$as_me: NetAccessor: $netaccessor" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Message Loader: $msgloader" >&5 $as_echo "$as_me: Message Loader: $msgloader" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: XMLCh Type: $xmlch" >&5 $as_echo "$as_me: XMLCh Type: $xmlch" >&6;} xerces-c-3.2.2/config/000755 000765 000024 00000000000 13345765734 015331 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/tests/000755 000765 000024 00000000000 13345765734 015226 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/config.h.in000644 000765 000024 00000033712 13345573665 016115 0ustar00scantorstaff000000 000000 /* config.h.in. Generated from configure.ac by autoheader. */ /* Define to specify no threading is used */ #undef APP_NO_THREADS /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_NAMESER_COMPAT_H /* define if bool is a built-in type */ #undef HAVE_BOOL /* Define to 1 if you have the `catclose' function. */ #undef HAVE_CATCLOSE /* Define to 1 if you have the `catgets' function. */ #undef HAVE_CATGETS /* Define to 1 if you have the `catopen' function. */ #undef HAVE_CATOPEN /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME /* Define to 1 if you have the header file. */ #undef HAVE_CORESERVICES_CORESERVICES_H /* Define to 1 if you have cpuid.h */ #undef HAVE_CPUID_H /* Define to 1 if you have the header file. */ #undef HAVE_CTYPE_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_ENDIAN_H /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H /* Define to 1 if you have the `ftime' function. */ #undef HAVE_FTIME /* Define to 1 if you have the `getaddrinfo' function. */ #undef HAVE_GETADDRINFO /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `gethostbyaddr' function. */ #undef HAVE_GETHOSTBYADDR /* Define to 1 if you have the `gethostbyname' function. */ #undef HAVE_GETHOSTBYNAME /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the `gmtime_r' function. */ #undef HAVE_GMTIME_R /* Define to 1 if you have the `iconv' function. */ #undef HAVE_ICONV /* Define to 1 if you have the `iconv_close' function. */ #undef HAVE_ICONV_CLOSE /* Define to 1 if you have the header file. */ #undef HAVE_ICONV_H /* Define to 1 if you have the `iconv_open' function. */ #undef HAVE_ICONV_OPEN /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the `localeconv' function. */ #undef HAVE_LOCALECONV /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* define if the compiler implements L"widestring" */ #undef HAVE_LSTRING /* Define to 1 if you have the header file. */ #undef HAVE_MACHINE_ENDIAN_H /* Define to 1 if you have the `mblen' function. */ #undef HAVE_MBLEN /* Define to 1 if you have the `mbrlen' function. */ #undef HAVE_MBRLEN /* Define to 1 if you have the `mbsrtowcs' function. */ #undef HAVE_MBSRTOWCS /* Define to 1 if you have the `mbstowcs' function. */ #undef HAVE_MBSTOWCS /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* define if the compiler implements namespaces */ #undef HAVE_NAMESPACES /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the `nl_langinfo' function. */ #undef HAVE_NL_LANGINFO /* Define to 1 if you have the header file. */ #undef HAVE_NL_TYPES_H /* Define to 1 if you have the `pathconf' function. */ #undef HAVE_PATHCONF /* Define to 1 if you have the PATH_MAX macro. */ #undef HAVE_PATH_MAX /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* Define to 1 if you have the `realpath' function. */ #undef HAVE_REALPATH /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* define if the compiler supports ISO C++ standard library */ #undef HAVE_STD_LIBS /* define if the compiler supports the std namespace */ #undef HAVE_STD_NAMESPACE /* define if the compiler supports ISO C++11 and */ #undef HAVE_STD_THREAD /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `stricmp' function. */ #undef HAVE_STRICMP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strnicmp' function. */ #undef HAVE_STRNICMP /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIMEB_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the `timegm' function. */ #undef HAVE_TIMEGM /* Define to 1 if you have the `towlower' function. */ #undef HAVE_TOWLOWER /* Define to 1 if you have the `towupper' function. */ #undef HAVE_TOWUPPER /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if you have the `wcsicmp' function. */ #undef HAVE_WCSICMP /* Define to 1 if you have the `wcslwr' function. */ #undef HAVE_WCSLWR /* Define to 1 if you have the `wcsnicmp' function. */ #undef HAVE_WCSNICMP /* Define to 1 if you have the `wcsrtombs' function. */ #undef HAVE_WCSRTOMBS /* Define to 1 if you have the `wcstombs' function. */ #undef HAVE_WCSTOMBS /* Define to 1 if you have the `wcsupr' function. */ #undef HAVE_WCSUPR /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H /* Define to 1 if you have the header file. */ #undef HAVE_WINSOCK2_H /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Define to 1 if you have to use const char* with iconv, to 0 if you must use char*. */ #undef ICONV_USES_CONST_POINTER /* Definition of Xerces interface major version */ #undef INTERFACE_VERSION_MAJOR /* Definition of Xerces interface minor version */ #undef INTERFACE_VERSION_MINOR /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG /* The size of `short', as computed by sizeof. */ #undef SIZEOF_SHORT /* The size of `wchar_t', as computed by sizeof. */ #undef SIZEOF_WCHAR_T /* The size of `__int64', as computed by sizeof. */ #undef SIZEOF___INT64 /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Define to true if autoconf is used in this configuration */ #undef XERCES_AUTOCONF /* Definition of Xerces grammar serialization level */ #undef XERCES_GRAMMAR_SERIALIZATION_LEVEL /* Define if namespaces is supported by the compiler */ #undef XERCES_HAS_CPP_NAMESPACE /* Define to have SSE2 instruction support detected at runtime using __cpuid */ #undef XERCES_HAVE_CPUID_INTRINSIC /* Define to 1 if cstdint is functional. */ #undef XERCES_HAVE_CSTDINT /* Define to 1 if you have emmintrin.h */ #undef XERCES_HAVE_EMMINTRIN_H /* Define to have SSE2 instruction support detected at runtime using __get_cpuid */ #undef XERCES_HAVE_GETCPUID /* Define to 1 if you have intrin.h */ #undef XERCES_HAVE_INTRIN_H /* Define to 1 if we have inttypes.h */ #undef XERCES_HAVE_INTTYPES_H /* Define to have SSE2 instruction used at runtime */ #undef XERCES_HAVE_SSE2_INTRINSIC /* Define to 1 if we have stdint.h */ #undef XERCES_HAVE_STDINT_H /* Define to 1 if we have sys/types.h */ #undef XERCES_HAVE_SYS_TYPES_H /* Define if there is support for L"widestring" */ #undef XERCES_LSTRSUPPORT /* Define if the isstream library can be included as */ #undef XERCES_NEW_IOSTREAMS /* Define to have XMemory.hpp avoid declaring a matching operator delete for the placement operator new */ #undef XERCES_NO_MATCHING_DELETE_OPERATOR /* Define if there is no native bool support in this environment */ #undef XERCES_NO_NATIVE_BOOL /* Define to use backslash as an extra path delimiter character */ #undef XERCES_PATH_DELIMITER_BACKSLASH /* Define as the platform's export attribute */ #undef XERCES_PLATFORM_EXPORT /* Define as the platform's import attribute */ #undef XERCES_PLATFORM_IMPORT /* An appropriate signed 16 bit integer type */ #undef XERCES_S16BIT_INT /* An appropriate signed 32 bit integer type */ #undef XERCES_S32BIT_INT /* An appropriate signed 64 bit integer type */ #undef XERCES_S64BIT_INT /* Define as the appropriate SIZE_MAX macro */ #undef XERCES_SIZE_MAX /* Define as the appropriate size_t type */ #undef XERCES_SIZE_T /* Define as the appropriate SSIZE_MAX macro */ #undef XERCES_SSIZE_MAX /* Define as the appropriate ssize_t type */ #undef XERCES_SSIZE_T /* Define if the std namespace is supported */ #undef XERCES_STD_NAMESPACE /* Define as the platform's template extern attribute */ #undef XERCES_TEMPLATE_EXTERN /* An appropriate unsigned 16 bit integer type */ #undef XERCES_U16BIT_INT /* An appropriate unsigned 32 bit integer type */ #undef XERCES_U32BIT_INT /* An appropriate unsigned 64 bit integer type */ #undef XERCES_U64BIT_INT /* Define to use the POSIX file mgr */ #undef XERCES_USE_FILEMGR_POSIX /* Define to use the Windows file mgr */ #undef XERCES_USE_FILEMGR_WINDOWS /* Define to use the iconv-based MsgLoader */ #undef XERCES_USE_MSGLOADER_ICONV /* Define to use the ICU-based MsgLoader */ #undef XERCES_USE_MSGLOADER_ICU /* Define to use the InMemory MsgLoader */ #undef XERCES_USE_MSGLOADER_INMEMORY /* Define to use the NoThread mutex mgr */ #undef XERCES_USE_MUTEXMGR_NOTHREAD /* Define to use the POSIX mutex mgr */ #undef XERCES_USE_MUTEXMGR_POSIX /* Define to use the C++ standard mutex mgr (requires C++11) */ #undef XERCES_USE_MUTEXMGR_STD /* Define to use the Windows mutex mgr */ #undef XERCES_USE_MUTEXMGR_WINDOWS /* Define to use the Mac OS X CFURL NetAccessor */ #undef XERCES_USE_NETACCESSOR_CFURL /* Define to use the CURL NetAccessor */ #undef XERCES_USE_NETACCESSOR_CURL /* Define to use the Sockets-based NetAccessor */ #undef XERCES_USE_NETACCESSOR_SOCKET /* Define to use the WinSock NetAccessor */ #undef XERCES_USE_NETACCESSOR_WINSOCK /* Define to use the GNU iconv transcoder */ #undef XERCES_USE_TRANSCODER_GNUICONV /* Define to use the iconv transcoder */ #undef XERCES_USE_TRANSCODER_ICONV /* Define to use the ICU-based transcoder */ #undef XERCES_USE_TRANSCODER_ICU /* Define to use the Mac OS UnicodeConverter-based transcoder */ #undef XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER /* Define to use the Windows transcoder */ #undef XERCES_USE_TRANSCODER_WINDOWS /* Definition of Xerces major version */ #undef XERCES_VERSION_MAJOR /* Definition of Xerces minor version */ #undef XERCES_VERSION_MINOR /* Definition of Xerces patch version */ #undef XERCES_VERSION_REVISION /* Define to the 16 bit type used to represent Xerces UTF-16 characters */ #undef XERCES_XMLCH_T /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `long int' if does not define. */ #undef off_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to empty if the keyword `volatile' does not work. Warning: valid code using `volatile' can become incorrect without. Disable with care. */ #undef volatile xerces-c-3.2.2/README000644 000765 000024 00000000143 13241160340 014713 0ustar00scantorstaff000000 000000 See the doc/html/index.html for the description of the Xerces-C++ project and other documentation. xerces-c-3.2.2/NOTICE000644 000765 000024 00000001060 13241160332 014737 0ustar00scantorstaff000000 000000 ========================================================================= == NOTICE file corresponding to section 4(d) of the Apache License, == == Version 2.0, in this case for the Apache Xerces distribution. == ========================================================================= This product includes software developed by The Apache Software Foundation (http://www.apache.org/). Portions of this software were originally based on the following: - software copyright (c) 1999, IBM Corporation., http://www.ibm.com. xerces-c-3.2.2/Makefile.am000644 000765 000024 00000001160 13241416723 016100 0ustar00scantorstaff000000 000000 SUBDIRS = doc src tests samples EXTRA_DIST = CMakeLists.txt \ cmake \ config.h.cmake.in \ xerces-c.spec \ xerces-c.pc.in \ CREDITS \ INSTALL \ KEYS \ LICENSE \ NOTICE \ README \ config/pretty-make \ reconf \ scripts/createBindingsFormatFromHPP.pl \ scripts/makeStringDefinition.pl \ tools AUTOMAKE_OPTIONS = foreign dist-bzip2 dist-zip dist-xz ACLOCAL_AMFLAGS = -I m4 pkgconfigdir = @pkgconfigdir@ pkgconfig_DATA= xerces-c.pc xerces-c-3.2.2/samples/000755 000765 000024 00000000000 13345765735 015531 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/config.h.cmake.in000644 000765 000024 00000035471 13272177434 017171 0ustar00scantorstaff000000 000000 /* config.h.cmake.in. Not generated, but originated from autoheader. */ /* This file must be kept up-to-date with needed substitutions from config.h.in. */ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_CSTDINT 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDINT_H 1 #if defined(__cplusplus) && defined(HAVE_CSTDINT) #include #elif HAVE_STDINT_H #include #elif HAVE_INTTYPES_H #include #endif /* Define to specify no threading is used */ #cmakedefine APP_NO_THREADS 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ARPA_INET_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ARPA_NAMESER_COMPAT_H 1 /* define if bool is a built-in type */ #cmakedefine HAVE_BOOL 1 /* Define to 1 if you have the `catclose' function. */ #cmakedefine HAVE_CATCLOSE 1 /* Define to 1 if you have the `catgets' function. */ #cmakedefine HAVE_CATGETS 1 /* Define to 1 if you have the `catopen' function. */ #cmakedefine HAVE_CATOPEN 1 /* Define to 1 if you have the `clock_gettime' function. */ #cmakedefine HAVE_CLOCK_GETTIME 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_CORESERVICES_CORESERVICES_H 1 /* Define to 1 if you have cpuid.h */ #cmakedefine HAVE_CPUID_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_CTYPE_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_DLFCN_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ENDIAN_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ERRNO_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_FCNTL_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_FLOAT_H 1 /* Define to 1 if you have the `ftime' function. */ #cmakedefine HAVE_FTIME 1 /* Define to 1 if you have the `getaddrinfo' function. */ #cmakedefine HAVE_GETADDRINFO 1 /* Define to 1 if you have the `getcwd' function. */ #cmakedefine HAVE_GETCWD 1 /* Define to 1 if you have the `gethostbyaddr' function. */ #cmakedefine HAVE_GETHOSTBYADDR 1 /* Define to 1 if you have the `gethostbyname' function. */ #cmakedefine HAVE_GETHOSTBYNAME 1 /* Define to 1 if you have the `gettimeofday' function. */ #cmakedefine HAVE_GETTIMEOFDAY 1 /* Define to 1 if you have the `gmtime_r' function. */ #cmakedefine HAVE_GMTIME_R 1 /* Define to 1 if you have the `iconv' function. */ #cmakedefine HAVE_ICONV 1 /* Define to 1 if you have the `iconv_close' function. */ #cmakedefine HAVE_ICONV_CLOSE 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ICONV_H 1 /* Define to 1 if you have the `iconv_open' function. */ #cmakedefine HAVE_ICONV_OPEN 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_INTTYPES_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LANGINFO_H 1 /* Define to 1 if you have the `nsl' library (-lnsl). */ #cmakedefine HAVE_LIBNSL 1 /* Define to 1 if you have the `socket' library (-lsocket). */ #cmakedefine HAVE_LIBSOCKET 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LIMITS_H 1 /* Define to 1 if you have the `localeconv' function. */ #cmakedefine HAVE_LOCALECONV 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LOCALE_H 1 /* define if the compiler implements L"widestring" */ #cmakedefine HAVE_LSTRING 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_MACHINE_ENDIAN_H 1 /* Define to 1 if you have the `mblen' function. */ #cmakedefine HAVE_MBLEN 1 /* Define to 1 if you have the `mbrlen' function. */ #cmakedefine HAVE_MBRLEN 1 /* Define to 1 if you have the `mbsrtowcs' function. */ #cmakedefine HAVE_MBSRTOWCS 1 /* Define to 1 if you have the `mbstowcs' function. */ #cmakedefine HAVE_MBSTOWCS 1 /* Define to 1 if you have the `memmove' function. */ #cmakedefine HAVE_MEMMOVE 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_MEMORY_H 1 /* Define to 1 if you have the `memset' function. */ #cmakedefine HAVE_MEMSET 1 /* define if the compiler implements namespaces */ #cmakedefine HAVE_NAMESPACES 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NETDB_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NETINET_IN_H 1 /* Define to 1 if you have the `nl_langinfo' function. */ #cmakedefine HAVE_NL_LANGINFO 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NL_TYPES_H 1 /* Define to 1 if you have the `pathconf' function. */ #cmakedefine HAVE_PATHCONF 1 /* Define to 1 if you have the PATH_MAX macro. */ #cmakedefine HAVE_PATH_MAX 1 /* Define if you have POSIX threads libraries and header files. */ #cmakedefine HAVE_PTHREAD 1 /* Define to 1 if you have the `realpath' function. */ #cmakedefine HAVE_REALPATH 1 /* Define to 1 if you have the `setlocale' function. */ #cmakedefine HAVE_SETLOCALE 1 /* Define to 1 if you have the `snprintf' function. */ #cmakedefine HAVE_SNPRINTF 1 /* Define to 1 if you have the `socket' function. */ #cmakedefine HAVE_SOCKET 1 /* Define to 1 if stdbool.h conforms to C99. */ #cmakedefine HAVE_STDBOOL_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDDEF_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDIO_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDLIB_H 1 /* define if the compiler supports ISO C++ standard library */ #cmakedefine HAVE_STD_LIBS 1 /* define if the compiler supports the std namespace */ #cmakedefine HAVE_STD_NAMESPACE 1 /* Define to 1 if you have the `strcasecmp' function. */ #cmakedefine HAVE_STRCASECMP 1 /* Define to 1 if you have the `strchr' function. */ #cmakedefine HAVE_STRCHR 1 /* Define to 1 if you have the `strdup' function. */ #cmakedefine HAVE_STRDUP 1 /* Define to 1 if you have the `stricmp' function. */ #cmakedefine HAVE_STRICMP 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STRING_H 1 /* Define to 1 if you have the `strncasecmp' function. */ #cmakedefine HAVE_STRNCASECMP 1 /* Define to 1 if you have the `strnicmp' function. */ #cmakedefine HAVE_STRNICMP 1 /* Define to 1 if you have the `strrchr' function. */ #cmakedefine HAVE_STRRCHR 1 /* Define to 1 if you have the `strstr' function. */ #cmakedefine HAVE_STRSTR 1 /* Define to 1 if you have the `strtol' function. */ #cmakedefine HAVE_STRTOL 1 /* Define to 1 if you have the `strtoul' function. */ #cmakedefine HAVE_STRTOUL 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_SOCKET_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_TIMEB_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_TIME_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the `timegm' function. */ #cmakedefine HAVE_TIMEGM 1 /* Define to 1 if you have the `towlower' function. */ #cmakedefine HAVE_TOWLOWER 1 /* Define to 1 if you have the `towupper' function. */ #cmakedefine HAVE_TOWUPPER 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_UNISTD_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_WCHAR_H 1 /* Define to 1 if you have the `wcsicmp' function. */ #cmakedefine HAVE_WCSICMP 1 /* Define to 1 if you have the `wcslwr' function. */ #cmakedefine HAVE_WCSLWR 1 /* Define to 1 if you have the `wcsnicmp' function. */ #cmakedefine HAVE_WCSNICMP 1 /* Define to 1 if you have the `wcsrtombs' function. */ #cmakedefine HAVE_WCSRTOMBS 1 /* Define to 1 if you have the `wcstombs' function. */ #cmakedefine HAVE_WCSTOMBS 1 /* Define to 1 if you have the `wcsupr' function. */ #cmakedefine HAVE_WCSUPR 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_WCTYPE_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_WINSOCK2_H 1 /* Define to 1 if you have to use const char* with iconv, to 0 if you must use char*. */ #define ICONV_USES_CONST_POINTER @ICONV_USES_CONST_POINTER@ /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #cmakedefine NO_MINUS_C_MINUS_O 1 /* Name of package */ #define PACKAGE "@PACKAGE@" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" /* Define to the full name of this package. */ #define PACKAGE_NAME "@PACKAGE_NAME@" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "@PACKAGE_STRING@" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "@PACKAGE_TARNAME@" /* Define to the home page for this package. */ #define PACKAGE_URL "@PACKAGE_URL@" /* Define to the version of this package. */ #define PACKAGE_VERSION "@PACKAGE_VERSION@" /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT @SIZEOF_INT@ /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG @SIZEOF_LONG@ /* The size of `long long', as computed by sizeof. */ #define SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@ /* The size of `short', as computed by sizeof. */ #define SIZEOF_SHORT @SIZEOF_SHORT@ /* The size of `wchar_t', as computed by sizeof. */ #define SIZEOF_WCHAR_T @SIZEOF_WCHAR_T@ /* The size of `__int64', as computed by sizeof. */ #define SIZEOF___INT64 @SIZEOF___INT64@ /* Version number of package */ #define VERSION "@PACKAGE_VERSION@" /* Define if DLL symbols should be exported */ #cmakedefine XERCES_DLL_EXPORT 1 /* Define if namespaces is supported by the compiler */ #cmakedefine XERCES_HAS_CPP_NAMESPACE 1 /* Define to have SSE2 instruction support detected at runtime using __cpuid */ #cmakedefine XERCES_HAVE_CPUID_INTRINSIC 1 /* Define to 1 if you have emmintrin.h */ #cmakedefine XERCES_HAVE_EMMINTRIN_H 1 /* Define to have SSE2 instruction support detected at runtime using __get_cpuid */ #cmakedefine XERCES_HAVE_GETCPUID 1 /* Define to 1 if you have intrin.h */ #cmakedefine XERCES_HAVE_INTRIN_H 1 /* Define to 1 if we have inttypes.h */ #cmakedefine XERCES_HAVE_INTTYPES_H 1 /* Define to have SSE2 instruction used at runtime */ #cmakedefine XERCES_HAVE_SSE2_INTRINSIC 1 /* Define to 1 if we have sys/types.h */ #cmakedefine XERCES_HAVE_SYS_TYPES_H 1 /* Define to have Xerces_autoconf_config.hpp include wchar.h */ #cmakedefine XERCES_INCLUDE_WCHAR_H 1 /* Define if there is support for L"widestring" */ #cmakedefine XERCES_LSTRSUPPORT 1 /* Define if the isstream library can be included as */ #cmakedefine XERCES_NEW_IOSTREAMS 1 /* Define to have XMemory.hpp avoid declaring a matching operator delete for the placement operator new */ #cmakedefine XERCES_NO_MATCHING_DELETE_OPERATOR 1 /* Define if there is no native bool support in this environment */ #cmakedefine XERCES_NO_NATIVE_BOOL 1 /* Define to use backslash as an extra path delimiter character */ #cmakedefine XERCES_PATH_DELIMITER_BACKSLASH 1 /* Define as the platform's export attribute */ #define XERCES_PLATFORM_EXPORT @XERCES_PLATFORM_EXPORT@ /* Define as the platform's import attribute */ #define XERCES_PLATFORM_IMPORT @XERCES_PLATFORM_IMPORT@ /* An appropriate signed 16 bit integer type */ #define XERCES_S16BIT_INT @XERCES_S16BIT_INT@ /* An appropriate signed 32 bit integer type */ #define XERCES_S32BIT_INT @XERCES_S32BIT_INT@ /* An appropriate signed 64 bit integer type */ #define XERCES_S64BIT_INT @XERCES_S64BIT_INT@ /* Define as the appropriate SIZE_MAX macro */ #define XERCES_SIZE_MAX @XERCES_SIZE_MAX@ /* Define as the appropriate size_t type */ #define XERCES_SIZE_T @XERCES_SIZE_T@ /* Define as the appropriate SSIZE_MAX macro */ #define XERCES_SSIZE_MAX @XERCES_SSIZE_MAX@ /* Define as the appropriate ssize_t type */ #define XERCES_SSIZE_T @XERCES_SSIZE_T@ /* Define if building a static library */ #cmakedefine XERCES_STATIC_LIBRARY 1 /* Define if the std namespace is supported */ #cmakedefine XERCES_STD_NAMESPACE 1 /* An appropriate unsigned 16 bit integer type */ #define XERCES_U16BIT_INT @XERCES_U16BIT_INT@ /* An appropriate unsigned 32 bit integer type */ #define XERCES_U32BIT_INT @XERCES_U32BIT_INT@ /* An appropriate unsigned 64 bit integer type */ #define XERCES_U64BIT_INT @XERCES_U64BIT_INT@ /* Define to use the POSIX file mgr */ #cmakedefine XERCES_USE_FILEMGR_POSIX 1 /* Define to use the Windows file mgr */ #cmakedefine XERCES_USE_FILEMGR_WINDOWS 1 /* Define to use the iconv-based MsgLoader */ #cmakedefine XERCES_USE_MSGLOADER_ICONV 1 /* Define to use the ICU-based MsgLoader */ #cmakedefine XERCES_USE_MSGLOADER_ICU 1 /* Define to use the InMemory MsgLoader */ #cmakedefine XERCES_USE_MSGLOADER_INMEMORY 1 /* Define to use the NoThread mutex mgr */ #cmakedefine XERCES_USE_MUTEXMGR_NOTHREAD 1 /* Define to use the C++11 standard mutex mgr */ #cmakedefine XERCES_USE_MUTEXMGR_STD 1 /* Define to use the POSIX mutex mgr */ #cmakedefine XERCES_USE_MUTEXMGR_POSIX 1 /* Define to use the Windows mutex mgr */ #cmakedefine XERCES_USE_MUTEXMGR_WINDOWS 1 /* Define to use the Mac OS X CFURL NetAccessor */ #cmakedefine XERCES_USE_NETACCESSOR_CFURL 1 /* Define to use the CURL NetAccessor */ #cmakedefine XERCES_USE_NETACCESSOR_CURL 1 /* Define to use the Sockets-based NetAccessor */ #cmakedefine XERCES_USE_NETACCESSOR_SOCKET 1 /* Define to use the WinSock NetAccessor */ #cmakedefine XERCES_USE_NETACCESSOR_WINSOCK 1 /* Define to use the GNU iconv transcoder */ #cmakedefine XERCES_USE_TRANSCODER_GNUICONV 1 /* Define to use the iconv transcoder */ #cmakedefine XERCES_USE_TRANSCODER_ICONV 1 /* Define to use the ICU-based transcoder */ #cmakedefine XERCES_USE_TRANSCODER_ICU 1 /* Define to use the Mac OS UnicodeConverter-based transcoder */ #cmakedefine XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER 1 /* Define to use the Windows transcoder */ #cmakedefine XERCES_USE_TRANSCODER_WINDOWS 1 /* Define to the 16 bit type used to represent Xerces UTF-16 characters */ #define XERCES_XMLCH_T @XERCES_XMLCH_T@ /* Define to empty if `const' does not conform to ANSI C. */ #if !@HAVE_CONST@ #define const #endif /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #if !@HAVE_INLINE@ #if @NEED_INLINE@ #define inline @inline_keyword@ #else #define inline #endif #endif #endif /* Define to empty if the keyword `volatile' does not work. Warning: valid code using `volatile' can become incorrect without. Disable with care. */ #if !@HAVE_VOLATILE@ #define volatile #endif xerces-c-3.2.2/xerces-c.pc.in000644 000765 000024 00000000371 13241160332 016501 0ustar00scantorstaff000000 000000 prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: Xerces-C++ Description: Validating XML parser library for C++ Version: @VERSION@ Libs: -L${libdir} -lxerces-c Libs.private: @CURL_LIBS@ Cflags: -I${includedir} xerces-c-3.2.2/scripts/000755 000765 000024 00000000000 13345765715 015552 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/m4/000755 000765 000024 00000000000 13345765715 014403 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/doc/000755 000765 000024 00000000000 13345765716 014631 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/KEYS000644 000765 000024 00000030711 13241160332 014536 0ustar00scantorstaff000000 000000 This file contains the PGP keys of various Xerces-C++ developers. Please don't use them for email unless you have to. Their main purpose is code signing. Xerces-C++ users: If you use PGP: pgp < KEYS If you use gpg: gpg --import < KEYS Xerces-C++ developers: If you use pgp: pgp -kxa and append it to this file. If you use gpg: gpg --export -a >>KEYS should do the trick Name User ID Boris Kolpackov boris@kolpackov.net Tinny Ng tng@apache.org Gareth Reakes gareth@apache.org Neil Graham neilg@apache.org -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.2.5 (GNU/Linux) mQGLBD7gyjQBDADjboRuWsUo7JXgicFS5DGpqIhhHqmzifDxI1Sb/xHk7WZfxsNG YFp1c5NXCsMKx801UUCeiezam9iiWILSl7SOnTvE4LUPkMJSSB9gsekt8YCDnUFr cYdohOKSZvZi5l9KGLwAmF7CXhRItVWzbEHPcFQvWpBqtl7UXbWu+j3RPMHocNH8 I6ujnPCGhuaYYCsbUQzzlzVMw0mROm6vFKP2PcYmthXqS5eBLE2oNmUX06tn7U0i 5RjH34yLsaneXCwFJDeDc8RoYGvN8W4KR0uJp0i2BSop3dfkgYlxeB3NoqCh58Rk jMrzJrhG3aetT2OIASNhsD80GT6phBvKLhPnBI/ifHxvUbKBkes5MlfMe/2TuHAq op8iby2Kh54aW7TtUn8aWCZE0kWkOjYYXTH8wBPiTr/RBcdPNXkwofpLIDbV+JL4 qxebeZ8/HxPYoE2yN4mAM765sIWiZyKQhf4VurOXjOO/zsaGiP54vdnDO2ZlwVuS RaglWAZ2+SR79YUABim0KUJvcmlzIEtvbHBhY2tvdiA8Ym9yaXNAY29kZXN5bnRo ZXNpcy5jb20+iQG0BBMBAgAeBQJC1WiIAhsDBgsJCAcDAgMVAgMDFgIBAh4BAheA AAoJEMiAKQuuCE8dkCAMAJqV/8EzQphusvSblnI2LZFaFFLKlot8PUNrqZGEq4D2 mrTQkrkOBVHzSSm/MGOuhSeknzSS6hgEb+L647oxPSQ/YVJ6C7JFkQqcp6gfrYj/ AaCIhJkBccLIxkoNE5gaEZJvhd0WhDg0O0Xy7Jfsl0OQS9mvS5Prw69+ZRE0gFj/ H6XCm7zxpoXtQhFT1QZL/WJEyUIbDQeGppwueHAockV30f6VU+Q+t5PPYDd2+9hf i6hOrHo6Ldne0or1xid+b27uqCid2mCHZM6Q00cMlbupiDiFw0Pjd3pcK7bgFS6o kiHpFieMNgwhVEzz+nqOLoxO8dWz190MPbiW7k2zH+4PWVW3+Qwjq5QAtl18PNRE Lt7XgIT/5AI/ov5CoyVLA0w9I3iL1ChcbzPlHGz0eQgOKM79PikSjkvfAns757te yyWtnfwJcajph2fmz2GTmBAdwVELskmZCqntxIpM3vVZqDl+Sn3JtPl5uNl7zgIl JCjYv/trdjqRIHW9ty7s1rQlQm9yaXMgS29scGFja292IDxib3Jpc0Brb2xwYWNr b3YubmV0PokBtwQTAQIAIQIbAwYLCQgHAwIDFQIDAxYCAQIeAQIXgAUCQtVpVQIZ AQAKCRDIgCkLrghPHWNODACJkRxgIhj6sbLk10nfC4c7DDLhO96HzaWl4W/f34RT 2ZcT9QMlT0rGim93HadI5160aTb3I8uxdsNKUpjZbFMl/6W6jb/rU5qVWPLIKgHG THvskJchTylklhZWhc2/QTHMWZPF2ipr0v6djkIMtEkH1os6cevPvPNkXxFcQmBk GxUgINYe+F5snRmXnR2Fbm56Xam9TWKNfrpNLY03s/S7iHmonLSw7qW5Ixjmrdeh Snil6TxGhDU/AiRX/EEa5O/pqUwlm2E/6TvgQoeX1fEx0YjLevVWjoqASFg75INk N8D6P10mT0LvgIAuK3Ppcd69No3RLufsJGgXjb8NIQyzltqH/S0qPeSBrrpisf/y lV51RuIZBgYHRHl7xVG+KEJ5JLyLzfwebPmRyXiHkM1yz749tiyhV5JMcKsO3hOy 6nZtQRt1as5Dmm0dzhFHYLImqP8nQAblu6q7FRLJLcXLJl8NlOWVPttPcmuGaXc2 NeYuUdtFi+hquk268CtpCJW5Aw0EPuDNnBAMAPa+/MHQ5JBkR+VoVU+9bVLb+RFq lORX9Mtl7MwYBSQwOOv0KTMXVv/ucqh7A4cLQkK7QVD878C1kTYjupDdrAp7GDlN vhzoE+ltuJaUYFDbviwH++vOMMR3DqkPvfcWxUbCGIFDWyHIqVUmGkOzzTIk62IT gYNBvIhxqSh+r5LG0dNFYO+W5bd0FzftmP4AnfhMPDKM6OJsZ2ZrHR0t8EJnn4Pn 6/D1e02/1CUdlMM8gTSAXk4wF69TCsE9fvDq5jgLoud1I2RKLmhRDDxxmQUAjBir aab32oeRzNgbU5RbtolHxfvDiRmHUDDqQavNT3HpElbeXj/J5/Jkh0LcpF1QsDUJ pewVVX4ltMCnCATqUqqgx5UpnfEY1Dt5N3uuO5znQ5oznZHsLWx3qWegTJn7acta /HlFUpSMaxteuXT/6EiE7lAzsGSWTcX8BpCHviDVPhQMy2AFzWSQlUItXyfkfX0B SOgFypLjffx4+bms/DXJPYgwEhjFiTaATBeUOwADBQwAuPTkktfoMsI4lL4UYBr5 afW1R6lHwMZeoH7Mspb82bC9Lqi5gU3wBu3RJwm1CswGMBys+o9J0eA7EDRPw8wM e0THds93rhlABnvhkElbSD/ypsUsX+DRbjiVrV5gTwVRg+5Qmu754BUPrbt14awO 4yLWqV7NN2oOglZy2BTN1WTECOzODRVyxlb3AAL+KWoc0L2QzfRErY5t6ZbIYf2C +8jXgf6iFl6eLDlecWcrHds/rl1A5w+MP1I+EjozMnjejEjUOuVyq4B80YmAquPL 6BB76CyjZnpJjvGLijVU4RrD1vduKlMsy4dh7gQaVTQ+SvrQktrFbEcTy2Gj/Jir LVQagYPSqpcRwLvd0sOGxkipKqIjDi7v8huc+jGmUCFpBcMwJPndzNwuBmJUEGhp QM0VeYHDugZ1+GWVrxDcjAsYKjwjm/qdjP/1el3a9rgMVYrmxHKobiuqYklIWtw6 mp7gzdzwMwUNOX8hHCL21ojStlUs5BbzZQ8X8h8a7sX9iQGcBBgBAgAGBQI+4M2c AAoJEMiAKQuuCE8d4LYL/iUOcqAT3enonrSOu9v8SGKqEc6z7H/5f0t7vZxREVqJ PIEL/Lj5787NouhtZ+k7KBz4Ssu2lmOA63PUXtSllQx8mg/Jb2PUrjUVLCr22WqA mr3zAQQ/14B5cLkhnpSID0oQL5UyP7dZ4beUWB3wYydp/hbOLl7+OrP+2EpIopYB Mdk383GsnN2wWP9pEEDhJ1Lt7DsWuNV/ATZ9yWIvs82s8QiGvWfKbYSHvvzIKAET UkPD7uWU3IdXgm9kuQQ7TNqX6q857PAC3SK+b+qepmyGDJtoeYS19WsxfqZr2Iot i75/zy43w9bhbX17JNQynaMsAP4nG+HHzvnSEp8p0s38Cz5xi6xVb8fig6g3WFwn 6OdZakQ8sI+DyhsrdwlgSCNQTsi85X7Opv8Q+8EQwt+QBTF85O5RjO1Szacsedvl RXSIWXj8vl8TJZ1VsEOBehdSjAjpUJMUHAoq9c69H5ynXzFrVwOWCwfAYcrFNsmX hN0wyp3I8BVY5rjH33DQTA== =ehLR -----END PGP PUBLIC KEY BLOCK----- -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.0.6 (MingW32) Comment: For info see http://www.gnupg.org mQGiBDyHxtYRBACZ0tjwBxGJZgu/xVMwgCCUdzXcwMlt4xym2Vx0ZZ6bDJWDVlfa U/BvSVrrGGgkuYt2fFOeboYIVqW5OsQKJX5a6eZbywkhiK9CehDoh0Ask0hTgyzf C+kBldozpSv2adBeD4shv8E6mPFsAaA1N7wOIYE6dOuRJBAPIjeZ/ziFxwCg8kaX r59ZEWL2dD4RISap5mGwyA0D/02DYwBN0V8iSqAi6gu1yYAccsz8kw573DRre0Rh h8rgNUh5FA63MMDoifYKW1bcKWZkp9BfAE0Q6qwi7bfs/FOBHBCZpI47FYJ1n8yh VRHA3MxayIqZQlETTNbLMPDJ2rtRs8NJZ7brXnJ2zOuDexzlS2vhKdeJP9gsrfXF LYDeBACBYd6a1WRm5aZMvMpO16C925UbRmDBZ+TfWRtxPqRYSfVM+hkPKw5GObWJ gL1GbF5bIS0C/Ddi7oegB77lGn8XNDTQT5e47SWkeboU+6fuSgsLLSgMfKivh++S 29kngiFIUsKnB4F102GwoAkpsO12Vhnsi9INaXVYLkZmhR3x07QwVGlubnkgTmcg KFhlcmNlcy1DKysgY29tbWl0dGVyKSA8dG5nQGFwYWNoZS5vcmc+iFcEExECABcF AjyHxtYFCwcKAwQDFQMCAxYCAQIXgAAKCRA+PBlAJOh0GSTcAJ9hqoz+wf70Dw84 H2RX7ZEo1jhvggCg1QA//1Ur9XFxLUlFVnbppAMPl5S5AQ0EPIfG1xAEAOjBKfzF 4aZaY1biEUxZCk6PMofuXVE32XFrsm1Pn3AcYThtSEBQM76yXOx7d30IdA6yPSkF rsd9gfB379KfQHAc5VnNZU1xE3rmmT7+s5rRPr0zoBCRtI/qCajFV1IczqmvlAHq QJunztZNB3D2Uu4GGZ2sAQMFyPzBzNk3UODLAAMFBAC1KB5yJkbDhMPeT4ewFhow Yy/VbQSPfYcbTjY/+JXZ6XKZUvZSq75S1id/9vgxMBljfruQKlYQ54P6yQqreWTt IXtR9yQt0C5FVzl7lZKXZYZLJjKmEavqG7dtDNXtmVUWIx7JJwzSv/h6HyXlJZuw Sj5q9RAV/QoRf6bHiNZzgYhGBBgRAgAGBQI8h8bXAAoJED48GUAk6HQZd54An1tZ V9tsv1XZSRmh6SKUHkUn8ZNiAJwOO/uRRPfoeyAUbP+qfro53b+UQpkBogQ8h8bW EQQAmdLY8AcRiWYLv8VTMIAglHc13MDJbeMcptlcdGWemwyVg1ZX2lPwb0la6xho JLmLdnxTnm6GCFaluTrECiV+WunmW8sJIYivQnoQ6IdALJNIU4Ms3wvpAZXaM6Ur 9mnQXg+LIb/BOpjxbAGgNTe8DiGBOnTrkSQQDyI3mf84hccAoPJGl6+fWRFi9nQ+ ESEmqeZhsMgNA/9Ng2MATdFfIkqgIuoLtcmAHHLM/JMOe9w0a3tEYYfK4DVIeRQO tzDA6In2CltW3ClmZKfQXwBNEOqsIu237PxTgRwQmaSOOxWCdZ/MoVURwNzMWsiK mUJRE0zWyzDwydq7UbPDSWe2615ydszrg3sc5Utr4SnXiT/YLK31xS2A3gQAgWHe mtVkZuWmTLzKTtegvduVG0ZgwWfk31kbcT6kWEn1TPoZDysORjm1iYC9RmxeWyEt Avw3Yu6HoAe+5Rp/FzQ00E+XuO0lpHm6FPun7koLCy0oDHyor4fvktvZJ4IhSFLC pweBddNhsKAJKbDtdlYZ7IvSDWl1WC5GZoUd8dO0MFRpbm55IE5nIChYZXJjZXMt QysrIGNvbW1pdHRlcikgPHRuZ0BhcGFjaGUub3JnPohXBBMRAgAXBQI8h8bWBQsH CgMEAxUDAgMWAgECF4AACgkQPjwZQCTodBkk3ACfYaqM/sH+9A8POB9kV+2RKNY4 b4IAoNUAP/9VK/VxcS1JRVZ26aQDD5eUuQENBDyHxtcQBADowSn8xeGmWmNW4hFM WQpOjzKH7l1RN9lxa7JtT59wHGE4bUhAUDO+slzse3d9CHQOsj0pBa7HfYHwd+/S n0BwHOVZzWVNcRN65pk+/rOa0T69M6AQkbSP6gmoxVdSHM6pr5QB6kCbp87WTQdw 9lLuBhmdrAEDBcj8wczZN1DgywADBQQAtSgeciZGw4TD3k+HsBYaMGMv1W0Ej32H G042P/iV2elymVL2Uqu+UtYnf/b4MTAZY367kCpWEOeD+skKq3lk7SF7UfckLdAu RVc5e5WSl2WGSyYyphGr6hu3bQzV7ZlVFiMeyScM0r/4eh8l5SWbsEo+avUQFf0K EX+mx4jWc4GIRgQYEQIABgUCPIfG1wAKCRA+PBlAJOh0GXeeAJ9bWVfbbL9V2UkZ oekilB5FJ/GTYgCcDjv7kUT36HsgFGz/qn66Od2/lEI= =8B+D -----END PGP PUBLIC KEY BLOCK----- -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org mQGiBD6IPYoRBADdZZVTi5dsdtKm9tbJu2PRTMnkgP61zYxT41O9oVoUDhkqKUd3 Kv9Jm+0Kr5RWdega+m9Ew1zEIilywu08xf1Ne6YsXViZB0E+8D+ObLDSGVjm4fBW G5HLeYnPnuivqsXNy71MVOiaM9IGLemvUPkIgteMBBP7dcNko8Ykea2I8wCg2O6J tx2Uj3ZqtSyyC1GOiIBq81UEAM8XTQQm7k+Q2BjommfTHli97WdJrPD/BMCc9MOx wFia80g3nGfrp9F9L2U5jBzOTHmthBSjeCTmIybh4iHz7TfLcj1zqtG+Q4BqrOV6 /N6gKJivAJSLaqEECxyi8VmMnayg/WEe8eaF1QtPh7b3mO9QhZj839GPpHEpNlti noqEA/wM+dx6cy/IcOuKVefon6KMsjJ0oWzBtUE+zWrmWN4oXUWY1C8zHBugqvKf w3Yrse5IHRtvraqrc+37DfVKEP2DheL526zuTMLBNwQc36UeDcL8n1V+0K/Ay7Zs O5/9lxwd9PhmL9E5n2tHbrXKCsMx1HaW1pjMj4BzL1cNo0LS0rQhR2FyZXRoIFJl YWtlcyA8Z2FyZXRoQGFwYWNoZS5vcmc+iFcEExECABcFAj6IPYoFCwcKAwQDFQMC AxYCAQIXgAAKCRAe3w93r4d3pnlSAJwPfmNsaTTRtTLXuhll1FG4kFtTvgCggYB0 YhTzmMtD59n/ymg09SCHKC+IRgQQEQIABgUCPog+iwAKCRA7Ok8Kx55bak8bAJ9Y 73xLuFKBxlkqASo4j9GtRjFW0gCfcZhJzZAApR6Mixy9ei7ykb3adguIRgQQEQIA BgUCPog/jAAKCRBqo+AVTsqIBUSGAJ4jfdTVDT0lhD9DfsZDX9pXPWKNBwCfaaWb YXZ6aSHV0kaZDK7uj3kKQ7m5Ag0EPog9khAIAK5cD5+GcY2bZTfCeHzdbaOGXatl IWr3z8A56L4xA1Mp2D/tpF1Cky1hpFu8SMmNiO4+OqbNF08iJK7p+0HIb7KU2+Fk 4rNumfVkAi+QMvfKyr78pvq2DCqsgyQdFmkFhEYOkgZvas52CRLKW/GGXh+xnQI7 NvJuXu0+z130QcS9Q+f90NSrZWOzcHiz08LzvLnt5miLF0AxJGWwQj/4TzB+Xnwu CS8QV2k81LiHH+qbbPi2+VyMD/dimYZE6Fti/ZziO1KJXcMxfN62/QiYw+ui7K9F YXqiWY+RfXsX3QCfJdMhUtHXArVzMDF6UcDU76lMG1PBcD12zGfRL8iLoBcAAwUH /3ro3uF9Mix2URdXxTfJn4vfDJ/hiAbhENTtCDU5M30lSI9JG5HamVsSMo0hrtJd RaU7fLhbw/1IXn0tvbbeWmWZhDV5fYwuMKywwTvMWBmNZ7eBbZUlFlRyKYQqmrH7 cMBUGbA2ePHpDwvAvgU/zIayvhx87cq3RcbcfJaGvPB8v1thPMek1QK/xyFZowO3 SGSjS7yf1DoTR7cKAatE0bxfL4A6lRa7iWk6ZMgQ5XgQryPoSwqsAAdcjW7wZj+J 7wlDdkWaY5MMPLbmNgRCpbcw/L77x4Wp7u7Nc0vcy/Qc8bYiBmyaavIBwn5BEHWN 85SNootv8flkreqsEKJy8KCIRgQYEQIABgUCPog9kgAKCRAe3w93r4d3ptC8AJ9D O5xVcnBvZRCv2nN6pr9Erm1NZgCgjWXqDC0aQj7rtZq0i9UUCn+/PFA= =QJwD -----END PGP PUBLIC KEY BLOCK----- -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.2.2 (Cygwin) mQGiBDp4qeoRBAC0LNU4DKxiGD4WlaCZytDOlzEpUEJ2osubqdUSnexv/NzOA3Jy ZaAsITi1kj8dQR/pqpFHEMeWsb1Xua33TtlPcCN3kFicjbTOo3jbilx4gUFeO9Oy mcMeu/scYGan4erT++vXEAVd+qKCUzOymFqpDCa3xpqmeDuWxBUjqbCRFwCgt6w/ dvC1VRG2bh7Ja09zfCPr4hkEAIYdq/2k3YYc0T1Fh8fKDRzsRsDYj+8BAGg8YmDy wx04Nh6l3XmKt1DmR0U3ciH6rY3oWXB9oCzGoyr/ZvkakfknGsptBpVK0m9vVHVw uHvIEZDdsX2l4Eplc/FovueZQadCj1R6zwTNvri7h0vTDg9Pk0+dRUcWHuoBhWvN +hv3A/4mWImGrPsx6nq85TJWRJxqFeAnYiEqB69ns69S//+lqBRFWecTYu60dde/ sHJ0mHDTP0u5FRUSj5BVufR5wLZH8+ieGNHl4Jei3VnN3voGhuGNpwGxLDTdXD3W bMlOVx0H2R9+yqlDANLAfRS8GZb93I+riE0H1yMG5YgQC58+VLRUTmVpbCBHcmFo YW0gKHRoaXMga2V5IGlzIHByaW1hcmlseSBmb3Igc2lnbmluZyBYZXJjZXMtSiBy ZWxlYXNlcykgPG5laWxnQGNhLmlibS5jb20+iFcEExECABcFAjp4qeoFCwcKAwQD FQMCAxYCAQIXgAAKCRCL9vl1lVl7BQNhAJ9nucE0TtlFxStFCepoV638ma/jQQCe ILRbfFIo/pef/k551p2+wNqI/DyIRgQQEQIABgUCP6HMvgAKCRABBWa85BNjkiWe AJ9Q0r6at4PhTAukVTIT1jFaIzJaoQCfQwzCjO54eu+zYLJyF4bOJ+i0eSOIRgQT EQIABgUCP6K/ewAKCRCAzn5dyXJfO6jWAKCgr5/0+YchPX1LP975eEhAamZVGQCg qnGt3A7/7LuKF18MjlpZWQOWvuOIRgQQEQIABgUCP61QjwAKCRCl/zLuaIOFDbEQ AJ9CMksH+ujhz2QxiBSd81QtObxotgCgtwqHcr4sYZIhCYCcWp+LkihXgtS5BA0E OnirwBAQAJDuhNBw4SXWZwW84XJclbDzrsftmuI7GeXVYtYQyJCWk4OX+fqR1xpq td6IDLJl/Q/lvde42jxVMSTH2k0NfYsCh+5lIDQ54pYOiHZYQYx6ZhochZJTXxy9 R+gs/vK/UT9f8SqdwY5BlOBTh14hJV33lxk5Ptk9li92NSiiLI3+9GB0bl6dLWnQ PqFeaSvY962i7zgIhnaDOC43cDzwRlTA9zJsI92wYs+QC3LSm5e5falQ7GtQf4dZ 4oid+ayTOE4B9jMumLHn/YQPMzyNFWYQJkyohfninxm8+aPOAOmveF+K8FE0dQsX agIjHSX/4cJFoWGnOdq8emkhlNQaoPIldpSQcNLIB0Psnc4RhKQ30tK5a1unTgex mYLfFO8oLd439SKSaU1D00V0blf/e5cfFaJsRoQnPjG+jLu9l5cj7wkYH1XC7efy QJ2tW8br+0ENn2Ap30Uy6C7fQshyATFPk0rSonfIpH0Gd7//b8DutYpY6/ySHoWM muoqeqc1RdJc6qiJPj6OLrfzgLJrVt3Mj6GgCltsHXreRqMtwhRZ1xx5EZIDXGQ7 /wnbDYgTU1NsY6VmBgZdkNOoCySg7Tf7NuJzLJ1Mlc2HBWhRBcrkwYhjGMsPIzK/ 2jVY9qTDecPNMZcscWTPQp6t7VzgzxEe8UJlDDtVMUY02QKw+0ELAAMFD/9mdmU/ mEgwv9IxfNwisRW7jRQJjo4weUU6K9zkKZvRSg0tPLlyjTGtYKV4JTkeY++O38ie cLJQOtBc5OikPbfhF2EMF7U+ATsd0hVvEVpCzsxcBr76Nt607Hcq7EeyL7GrvpaS o5pTG89DFktB1xVji3X4ko+JI+uP5rva29y0o0KbjTReRqvdVUHHvnGgKu7UVmxW AEAikEd2mQ5OYwqgO53VfL49akWR6Br30mymNw4oof1VqnPu0ZwN2WJkhM6fXA0N k1+MsG8XZUe1hOX4pwFEmiv4R9htUhv3Hvl/HxY3oMRedHrkwLwEQQkW8UVJkS/u 6QZzeOplEG4s7ArmxEWqr3pBxXehvDvcpeWn8P+yhd8NgeZ7zDT1W+RT9iqIYvVv UOYvEop32HJeJKeaZR1WUhTOxrHggCFQ8G6VEVeVmcJrcrvHI+9mbM+5oxt2NeGX pf4eOErDxaFglvYSvXeX+IW3u7XQaxHs/D8v1fADzMi0xOIF7lxA7iyfNmfmb8NN vej/F/Wj99od18agGy566pNYquu0VSV1nU4v2JRyZFkvtxjqZK+WVjZlMvbjaZPN 9IPWCtC7nKPOkpLdr1XoDrcIIZBldcOcGf/MdIaG5idzwIl3264vtCeIIDrGjxol nQtO/wBr3R4e1BEksCNsHok+HoGfDvaKNTCWU4hGBBgRAgAGBQI6eKvAAAoJEIv2 +XWVWXsFH1cAn3k4YjXAjj+xOnPXTckz7jMXwkZoAJ9+F70Jxv1uoUGzpBnFs4Cu H39QDg== =cl3K -----END PGP PUBLIC KEY BLOCK----- -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.2.4 (MingW32) mQGiBEAxJWARBACJ4GAREpL61NDClbabHkC6iPIQgX5B8uYkupPT7aKW0bdkB10z M6mu6HSLHKm8mzpWK+Uzsvm+PLVWpumKh2CtdhqPskbnsn+kqL/bnYQcMMPG6ddC WR8DwqT0NEIzHa6KhCom1WnSfwQxIP7mi+xGr+GHFbT17dXJM+eVSnlkqwCgqsoq ZNMbMzJRJe0yAVp8khG0bgED/2Azm+oj88WMRIKSfuYvmCzOPHql6j94gCVUYsfu Ygg37Y+ajPiLEL0YSn/fVlTdqQ6rNXPPwFnbxJpQeAKu7arppHmsRv0RrfbG4wpW tmbLASrqYI3MpjcH8uHKSszv4Pdx81sk27O0VHtrtWowhk1Cale/IPUXe+a/9KXE GQfOA/9THDQh+wj1JYx35rBideVcCgKwU83F4lcIKD0yaYH2zFlk3X6YmXEiglaP CkYOcrJiJiNmbnXTwbASmed/xKy3d8ltvR0yJIctveZlZ2Qn4PAJbbSkBOpQ2uSF 39t0Ucu/9411JjkEGlR28pOxo83EKNOqs3NO0RTKxS+OA9IX0LQjUGVpWW9uZyBa aGFuZyA8cGVpeW9uZ3pAY2EuaWJtLmNvbT6IXgQTEQIAHgUCQDElYAIbAwYLCQgH AwIDFQIDAxYCAQIeAQIXgAAKCRDs6whVcdsjNe3qAJwKTZzF0Pi4gpEaYG8ejeFk fd8uqACglgUrALCA7T0DENQrIfg37gX+ovu5AQ0EQDElYxAEANsUYxWjFKamG1A0 K2ASNgp29IevQdk+YTRkqax8Zxv7tHWB6SOg65GJt6Oc2iwvJ+zV4d/B4KGEpL87 GpbpeJTeT4HIRfaKrtO4T6bJ1Wr4gf/EhWi1NVXK0oOVAxyfSaIbkl+2Y8u0jfVO Vgw//xuFGdx3IOjLNQSTbQ/w49V3AAMFA/4r8qJmfnerpK8xVQFDd/f9+j44rxQh 1RaXVKka1AxXTKdjyaDTze73RFX1AX3++FS9bMoqv0KamGFj/HMcGJP65ominoyu Hmea9zMJSXLF/KlhQ2ZIF8sG/kci2RthmZVxvJ6oWH1wXscfjCIjFgWLqY29/sGF smUlVt+wRiRQmIhJBBgRAgAJBQJAMSVjAhsMAAoJEOzrCFVx2yM1QjkAnjJl6YHS HnUmiKj1nzOTMG+DlKq0AJ42j+nRdCDjdX6tK5/7cy5JnUe7bg== =jqXV -----END PGP PUBLIC KEY BLOCK----- xerces-c-3.2.2/xerces-c.spec000644 000765 000024 00000005733 13345573230 016445 0ustar00scantorstaff000000 000000 Summary: Xerces-C++ validating XML parser Name: xerces-c Version: 3.2.2 Release: 1 URL: http://xerces.apache.org/xerces-c/ Source0: %{name}-%{version}.tar.bz2 License: Apache Group: Libraries BuildRoot: %{_tmppath}/%{name}-root Prefix: /usr %{!?_without_curl:BuildRequires: curl-devel} %{?_with_icu:BuildRequires: libicu-devel} %description Xerces-C++ is a validating XML parser written in a portable subset of C++. Xerces-C++ makes it easy to give your application the ability to read and write XML data. A shared library is provided for parsing, generating, manipulating, and validating XML documents. The parser provides high performance, modularity, and scalability. Source code, samples and API documentation are provided with the parser. For portability, care has been taken to make minimal use of templates, no RTTI, and minimal use of #ifdefs. %package devel Requires: %{name} = %{version} Group: Development/Libraries Summary: Header files for Xerces-C++ validating XML parser %description devel Header files you can use to develop XML applications with Xerces-C++. Xerces-C++ is a validating XML parser written in a portable subset of C++. Xerces-C++ makes it easy to give your application the ability to read and write XML data. A shared library is provided for parsing, generating, manipulating, and validating XML documents. %prep %setup -q %build %configure %{!?_without_curl:--enable-netaccessor-curl} %{?_with_icu:--enable-transcoder-icu --enable-msgloader-icu} %{?xerces_options} %{__make} %install [ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT %{__make} install DESTDIR=$RPM_BUILD_ROOT %clean [ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT %ifnos solaris2.8 solaris2.9 solaris2.10 %post -p /sbin/ldconfig %endif %ifnos solaris2.8 solaris2.9 solaris2.10 %postun -p /sbin/ldconfig %endif %files %defattr(755,root,root) %{_bindir}/* %{_libdir}/lib%{name}-*.so %exclude %{_libdir}/lib%{name}.la %files devel %defattr(-,root,root) %{_includedir}/xercesc %{_libdir}/lib%{name}.so %{_libdir}/lib%{name}.a %{_libdir}/pkgconfig/%{name}.pc %changelog * Wed Jun 21 2017 Scott Cantor - Upped version * Thu Jun 9 2016 Scott Cantor - Upped version * Fri Feb 27 2015 Scott Cantor - Upped version and avoided ownership of /usr/include * Fri Mar 7 2008 Boris Kolpackov - Integrated updates for 3.0.0 from Scott Cantor. * Fri Jun 6 2003 Tuan Hoang - updated for new Xerces-C filename and directory format - fixed date format in changelog section * Fri Mar 14 2003 Tinny Ng - changed to 2.3 * Wed Dec 18 2002 Albert Strasheim - added symlink to libxerces-c.so in lib directory * Fri Dec 13 2002 Albert Strasheim - added seperate doc package - major cleanups * Tue Sep 03 2002 - fixed missing DESTDIR in Makefile.util.submodule * Mon Sep 02 2002 - Initial build. xerces-c-3.2.2/Makefile.in000644 000765 000024 00000076713 13345744067 016143 0ustar00scantorstaff000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/cxx_have_bool.m4 \ $(top_srcdir)/m4/cxx_have_lstring.m4 \ $(top_srcdir)/m4/cxx_have_namespaces.m4 \ $(top_srcdir)/m4/cxx_have_std_libs.m4 \ $(top_srcdir)/m4/cxx_have_std_namespace.m4 \ $(top_srcdir)/m4/cxx_have_std_thread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/xerces_curl_prefix.m4 \ $(top_srcdir)/m4/xerces_filemgr_selection.m4 \ $(top_srcdir)/m4/xerces_icu_prefix.m4 \ $(top_srcdir)/m4/xerces_int_types.m4 \ $(top_srcdir)/m4/xerces_link_darwin_framework.m4 \ $(top_srcdir)/m4/xerces_msgloader_selection.m4 \ $(top_srcdir)/m4/xerces_mutexmgr_selection.m4 \ $(top_srcdir)/m4/xerces_netaccessor_selection.m4 \ $(top_srcdir)/m4/xerces_no_threads.m4 \ $(top_srcdir)/m4/xerces_path_delimiters.m4 \ $(top_srcdir)/m4/xerces_transcoder_selection.m4 \ $(top_srcdir)/m4/xerces_xmlch_selection.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h \ $(top_builddir)/src/xercesc/util/Xerces_autoconf_config.hpp \ $(top_builddir)/src/xercesc/util/XercesVersion.hpp CONFIG_CLEAN_FILES = doc/style/dtd/entities.ent xerces-c.pc \ scripts/run-test CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/xerces-c.pc.in $(top_srcdir)/config/compile \ $(top_srcdir)/config/config.guess \ $(top_srcdir)/config/config.sub \ $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ $(top_srcdir)/config/missing \ $(top_srcdir)/doc/style/dtd/entities.ent.in \ $(top_srcdir)/scripts/run-test.in \ $(top_srcdir)/src/xercesc/util/XercesVersion.hpp.in \ $(top_srcdir)/src/xercesc/util/Xerces_autoconf_config.hpp.in \ INSTALL README config/compile config/config.guess \ config/config.sub config/depcomp config/install-sh \ config/ltmain.sh config/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).tar.xz \ $(distdir).zip GZIP_ENV = --best DIST_TARGETS = dist-xz dist-bzip2 dist-gzip dist-zip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_SHARED = @BUILD_SHARED@ BUILD_STATIC = @BUILD_STATIC@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURL_FLAGS = @CURL_FLAGS@ CURL_LIBS = @CURL_LIBS@ CURL_PRESENT = @CURL_PRESENT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICU_BIN = @ICU_BIN@ ICU_FLAGS = @ICU_FLAGS@ ICU_LIBS = @ICU_LIBS@ ICU_PRESENT = @ICU_PRESENT@ ICU_SBIN = @ICU_SBIN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERFACE_VERSION_D = @INTERFACE_VERSION_D@ INTERFACE_VERSION_MAJOR = @INTERFACE_VERSION_MAJOR@ INTERFACE_VERSION_MINOR = @INTERFACE_VERSION_MINOR@ INTERFACE_VERSION_U = @INTERFACE_VERSION_U@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHREXT = @SHREXT@ STRIP = @STRIP@ VERSION = @VERSION@ XERCES_VERSION_MAJOR = @XERCES_VERSION_MAJOR@ XERCES_VERSION_MINOR = @XERCES_VERSION_MINOR@ XERCES_VERSION_REVISION = @XERCES_VERSION_REVISION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ curl_config = @curl_config@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ icu_config = @icu_config@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = doc src tests samples EXTRA_DIST = CMakeLists.txt \ cmake \ config.h.cmake.in \ xerces-c.spec \ xerces-c.pc.in \ CREDITS \ INSTALL \ KEYS \ LICENSE \ NOTICE \ README \ config/pretty-make \ reconf \ scripts/createBindingsFormatFromHPP.pl \ scripts/makeStringDefinition.pl \ tools AUTOMAKE_OPTIONS = foreign dist-bzip2 dist-zip dist-xz ACLOCAL_AMFLAGS = -I m4 pkgconfig_DATA = xerces-c.pc all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ src/xercesc/util/Xerces_autoconf_config.hpp: src/xercesc/util/stamp-h2 @test -f $@ || rm -f src/xercesc/util/stamp-h2 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) src/xercesc/util/stamp-h2 src/xercesc/util/stamp-h2: $(top_srcdir)/src/xercesc/util/Xerces_autoconf_config.hpp.in $(top_builddir)/config.status @rm -f src/xercesc/util/stamp-h2 cd $(top_builddir) && $(SHELL) ./config.status src/xercesc/util/Xerces_autoconf_config.hpp src/xercesc/util/XercesVersion.hpp: src/xercesc/util/stamp-h3 @test -f $@ || rm -f src/xercesc/util/stamp-h3 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) src/xercesc/util/stamp-h3 src/xercesc/util/stamp-h3: $(top_srcdir)/src/xercesc/util/XercesVersion.hpp.in $(top_builddir)/config.status @rm -f src/xercesc/util/stamp-h3 cd $(top_builddir) && $(SHELL) ./config.status src/xercesc/util/XercesVersion.hpp distclean-hdr: -rm -f config.h stamp-h1 src/xercesc/util/Xerces_autoconf_config.hpp src/xercesc/util/stamp-h2 src/xercesc/util/XercesVersion.hpp src/xercesc/util/stamp-h3 doc/style/dtd/entities.ent: $(top_builddir)/config.status $(top_srcdir)/doc/style/dtd/entities.ent.in cd $(top_builddir) && $(SHELL) ./config.status $@ xerces-c.pc: $(top_builddir)/config.status $(srcdir)/xerces-c.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ scripts/run-test: $(top_builddir)/config.status $(top_srcdir)/scripts/run-test.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-libtool distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-pkgconfigDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-pkgconfigDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xerces-c-3.2.2/aclocal.m4000644 000765 000024 00000126677 13345573663 015745 0ustar00scantorstaff000000 000000 # generated automatically by aclocal 1.16.1 -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/acx_pthread.m4]) m4_include([m4/cxx_have_bool.m4]) m4_include([m4/cxx_have_lstring.m4]) m4_include([m4/cxx_have_namespaces.m4]) m4_include([m4/cxx_have_std_libs.m4]) m4_include([m4/cxx_have_std_namespace.m4]) m4_include([m4/cxx_have_std_thread.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/xerces_curl_prefix.m4]) m4_include([m4/xerces_filemgr_selection.m4]) m4_include([m4/xerces_icu_prefix.m4]) m4_include([m4/xerces_int_types.m4]) m4_include([m4/xerces_link_darwin_framework.m4]) m4_include([m4/xerces_msgloader_selection.m4]) m4_include([m4/xerces_mutexmgr_selection.m4]) m4_include([m4/xerces_netaccessor_selection.m4]) m4_include([m4/xerces_no_threads.m4]) m4_include([m4/xerces_path_delimiters.m4]) m4_include([m4/xerces_transcoder_selection.m4]) m4_include([m4/xerces_xmlch_selection.m4]) xerces-c-3.2.2/CREDITS000644 000765 000024 00000004004 13241160337 015061 0ustar00scantorstaff000000 000000 The following people (in no particular order) have contributed to the development of the Xerces-C++ source code. Nadav Aharoni Curt Arnold Edward Avis Anupam Bagchi Torbjörn Bäckström Abe Backus Frank Balluffi Matthew Baker Devin Barnhart James Berry David Bertoni John Bellardo Arundhati Bhowmick Joanne Bogart Michael Boos Edward Bortner Sean Bright Phil Brown Robert Buck Scott Cantor David Cargill Chris Cates Sumit Chawla Nick Chiang Chih Hsiang Chou Radovan Chytracek Hiram Clawson John Clayton Todd Collins Nathan Codding Michael Crawford Murray Cumming Zeid Derhally James Devries Ailian Ding Steve Dulin David Earlam Helmut Eiken Mark Everline Andrew Fang Simon Fell Paul Ferguson Greg Franks Pierpaolo Fumagalli Syam Gadde Guido Gagliardi Gary Gale Michael Glavassevich Natalie Gorden Max Gotlib Petr Gotthard Neil Graham Matthew Hall Jay Hansen Susan Hardenbrook Jeff Harrell Andrew Hefford Adam Heinz Andy Heninger John Hibbert William L. Hopper Michael Huedepohl Anders Hybertz Rahul Jain Tom Jordahl Christopher Just Martin Kalen Joe Kesselman Artur Klauser Bob Kline Richard Ko Paul Kramer Volker Krause Berin Lautenbach Arnaud LeHors Andy Levine Jeff Lewis James Littlejohn Ray Logel Pedro Lopes Matt Lovett Sean MacRoibeaird Alberto Massari Don Mastrovito David McCreedy Shin'ya MORINO Urs Muff Jordan Naftolin Tinny Ng David Nickerson Khaled Noaman Michael Ottati Anthony O'Dowd Mike Pawlowski Kevin Philips Mike Pogue Joe Polastre John Ponzo Vitaly Prapirny Shengkai Qu Gareth Reakes Jim Reitz Caroline Rioux Dean Roddey John Roper Dan Rosen Steven Rosenthal Erik Rydgren Markus Scherer Bill Schindler Erik Schroeder Christian Schuhegger John Smirl Andrei Smirnov John Snelson Gereon Steffens Jason Stewart Rick J. Stevens Roman Sulzhyk Linda M. Swan Vasily Tchekalkin Pieter Van-Dyck Curtis Walker John Warrier Tom Watson Mark Weaver Roger Webster Robert Weir Axel Weiss Carolyn Weiss Kari Whitcomb Christian Will Dietrich Wolf Kirk Wylie Peter A. Volchek Grace Yan Hiramatsu Yoshifumi PeiYong Zhang Henry Zongaro Boris Kolpackov xerces-c-3.2.2/reconf000755 000765 000024 00000000337 13241160332 015243 0ustar00scantorstaff000000 000000 #!/bin/sh set -x rm -f config.cache type -p glibtoolize 1>/dev/null 2>&1 if test "$?" = "0"; then glibtoolize --copy --force else libtoolize --copy --force fi aclocal -I m4 autoheader automake -a -c -f autoconf exit xerces-c-3.2.2/src/000755 000765 000024 00000000000 13345765734 014653 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/strnicmp.h000644 000765 000024 00000002066 13241160332 016641 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: strnicmp.h 673966 2008-07-04 08:59:34Z borisk $ */ #ifndef STRNICMP_H #define STRNICMP_H #include #ifdef __cplusplus extern "C" { #endif extern int strnicmp(const char* str1, const char* str2, size_t count); #ifdef __cplusplus } #endif #endif xerces-c-3.2.2/src/XercesCConfig.cmake.in000644 000765 000024 00000000656 13241160332 020725 0ustar00scantorstaff000000 000000 @PACKAGE_INIT@ include(${CMAKE_CURRENT_LIST_DIR}/XercesCConfigInternal.cmake) add_library(XercesC::XercesC INTERFACE IMPORTED) set_target_properties(XercesC::XercesC PROPERTIES INTERFACE_LINK_LIBRARIES xerces_xerces-c) # For compatibility with FindXercesC. set(XercesC_VERSION "@xerces-c_VERSION@") get_target_property(XercesC_INCLUDE_DIRS xerces_xerces-c INTERFACE_INCLUDE_DIRECTORIES) set(XercesC_LIBRARIES XercesC::XercesC) xerces-c-3.2.2/src/CMakeLists.txt000644 000765 000024 00000136046 13272177434 017416 0ustar00scantorstaff000000 000000 # CMake build for xerces-c # # Written by Roger Leigh # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. set(EXTRA_DIST stricmp.h strnicmp.h towlower.h towupper.h xercesc/NLS xercesc/util/Xerces_autoconf_config.hpp.cmake.in xercesc/util/Xerces_autoconf_config.hpp.in xercesc/util/XercesVersion.hpp.cmake.in xercesc/util/XercesVersion.hpp.in xercesc/util/MsgLoaders/ICU/resources ) set(missing_sources stricmp.c stricmp.h strnicmp.c strnicmp.h towlower.c towlower.h towupper.c towupper.h ) add_custom_target(xerces-c-missing SOURCES ${missing_sources}) set_target_properties(xerces-c-missing PROPERTIES FOLDER "Library") #libxerces_c_la_LIBADD = ${LTLIBOBJS} # # Definition of sources/headers # # # A line like the following will generate a list of headers # for a given directory: (must be issued from src directory) # find xercesc/framework -name '*.hpp' -exec echo {} \\ ";" # find xercesc/framework -name '*.cpp' -exec echo {} \\ ";" # set(dom_headers xercesc/dom/DOM.hpp xercesc/dom/DOMAttr.hpp xercesc/dom/DOMCDATASection.hpp xercesc/dom/DOMCharacterData.hpp xercesc/dom/DOMComment.hpp xercesc/dom/DOMConfiguration.hpp xercesc/dom/DOMDocument.hpp xercesc/dom/DOMDocumentFragment.hpp xercesc/dom/DOMDocumentRange.hpp xercesc/dom/DOMDocumentTraversal.hpp xercesc/dom/DOMDocumentType.hpp xercesc/dom/DOMElement.hpp xercesc/dom/DOMEntity.hpp xercesc/dom/DOMEntityReference.hpp xercesc/dom/DOMError.hpp xercesc/dom/DOMErrorHandler.hpp xercesc/dom/DOMException.hpp xercesc/dom/DOMImplementation.hpp xercesc/dom/DOMImplementationList.hpp xercesc/dom/DOMImplementationLS.hpp xercesc/dom/DOMImplementationRegistry.hpp xercesc/dom/DOMImplementationSource.hpp xercesc/dom/DOMLocator.hpp xercesc/dom/DOMLSException.hpp xercesc/dom/DOMLSInput.hpp xercesc/dom/DOMLSOutput.hpp xercesc/dom/DOMLSParser.hpp xercesc/dom/DOMLSParserFilter.hpp xercesc/dom/DOMLSResourceResolver.hpp xercesc/dom/DOMLSSerializer.hpp xercesc/dom/DOMLSSerializerFilter.hpp xercesc/dom/DOMMemoryManager.hpp xercesc/dom/DOMNamedNodeMap.hpp xercesc/dom/DOMNode.hpp xercesc/dom/DOMNodeFilter.hpp xercesc/dom/DOMNodeIterator.hpp xercesc/dom/DOMNodeList.hpp xercesc/dom/DOMNotation.hpp xercesc/dom/DOMProcessingInstruction.hpp xercesc/dom/DOMPSVITypeInfo.hpp xercesc/dom/DOMRange.hpp xercesc/dom/DOMRangeException.hpp xercesc/dom/DOMStringList.hpp xercesc/dom/DOMText.hpp xercesc/dom/DOMTreeWalker.hpp xercesc/dom/DOMTypeInfo.hpp xercesc/dom/DOMUserDataHandler.hpp xercesc/dom/DOMXPathEvaluator.hpp xercesc/dom/DOMXPathException.hpp xercesc/dom/DOMXPathExpression.hpp xercesc/dom/DOMXPathNamespace.hpp xercesc/dom/DOMXPathNSResolver.hpp xercesc/dom/DOMXPathResult.hpp xercesc/dom/StDOMNode.hpp ) set(dom_sources xercesc/dom/DOMException.cpp xercesc/dom/DOMLSException.cpp xercesc/dom/DOMRangeException.cpp xercesc/dom/DOMXPathException.cpp ) set(domimpl_headers xercesc/dom/impl/DOMAttrImpl.hpp xercesc/dom/impl/DOMAttrMapImpl.hpp xercesc/dom/impl/DOMAttrNSImpl.hpp xercesc/dom/impl/DOMCasts.hpp xercesc/dom/impl/DOMCDATASectionImpl.hpp xercesc/dom/impl/DOMCharacterDataImpl.hpp xercesc/dom/impl/DOMChildNode.hpp xercesc/dom/impl/DOMCommentImpl.hpp xercesc/dom/impl/DOMConfigurationImpl.hpp xercesc/dom/impl/DOMDeepNodeListImpl.hpp xercesc/dom/impl/DOMDeepNodeListPool.hpp xercesc/dom/impl/DOMDeepNodeListPool.c xercesc/dom/impl/DOMDocumentFragmentImpl.hpp xercesc/dom/impl/DOMDocumentImpl.hpp xercesc/dom/impl/DOMDocumentTypeImpl.hpp xercesc/dom/impl/DOMElementImpl.hpp xercesc/dom/impl/DOMElementNSImpl.hpp xercesc/dom/impl/DOMEntityImpl.hpp xercesc/dom/impl/DOMEntityReferenceImpl.hpp xercesc/dom/impl/DOMErrorImpl.hpp xercesc/dom/impl/DOMImplementationImpl.hpp xercesc/dom/impl/DOMImplementationListImpl.hpp xercesc/dom/impl/DOMLocatorImpl.hpp xercesc/dom/impl/DOMNamedNodeMapImpl.hpp xercesc/dom/impl/DOMNodeBase.hpp xercesc/dom/impl/DOMNodeIDMap.hpp xercesc/dom/impl/DOMNodeImpl.hpp xercesc/dom/impl/DOMNodeIteratorImpl.hpp xercesc/dom/impl/DOMNodeListImpl.hpp xercesc/dom/impl/DOMNodeVector.hpp xercesc/dom/impl/DOMNormalizer.hpp xercesc/dom/impl/DOMNotationImpl.hpp xercesc/dom/impl/DOMParentNode.hpp xercesc/dom/impl/DOMProcessingInstructionImpl.hpp xercesc/dom/impl/DOMRangeImpl.hpp xercesc/dom/impl/DOMStringListImpl.hpp xercesc/dom/impl/DOMStringPool.hpp xercesc/dom/impl/DOMTextImpl.hpp xercesc/dom/impl/DOMTreeWalkerImpl.hpp xercesc/dom/impl/DOMTypeInfoImpl.hpp xercesc/dom/impl/DOMLSSerializerImpl.hpp xercesc/dom/impl/DOMLSInputImpl.hpp xercesc/dom/impl/DOMLSOutputImpl.hpp xercesc/dom/impl/DOMXPathExpressionImpl.hpp xercesc/dom/impl/DOMXPathNSResolverImpl.hpp xercesc/dom/impl/DOMXPathResultImpl.hpp xercesc/dom/impl/XSDElementNSImpl.hpp ) set(domimpl_sources xercesc/dom/impl/DOMAttrImpl.cpp xercesc/dom/impl/DOMAttrMapImpl.cpp xercesc/dom/impl/DOMAttrNSImpl.cpp xercesc/dom/impl/DOMCDATASectionImpl.cpp xercesc/dom/impl/DOMCharacterDataImpl.cpp xercesc/dom/impl/DOMChildNode.cpp xercesc/dom/impl/DOMCommentImpl.cpp xercesc/dom/impl/DOMConfigurationImpl.cpp xercesc/dom/impl/DOMDeepNodeListImpl.cpp xercesc/dom/impl/DOMDocumentFragmentImpl.cpp xercesc/dom/impl/DOMDocumentImpl.cpp xercesc/dom/impl/DOMDocumentTypeImpl.cpp xercesc/dom/impl/DOMElementImpl.cpp xercesc/dom/impl/DOMElementNSImpl.cpp xercesc/dom/impl/DOMEntityImpl.cpp xercesc/dom/impl/DOMEntityReferenceImpl.cpp xercesc/dom/impl/DOMErrorImpl.cpp xercesc/dom/impl/DOMImplementationImpl.cpp xercesc/dom/impl/DOMImplementationListImpl.cpp xercesc/dom/impl/DOMImplementationRegistry.cpp xercesc/dom/impl/DOMLocatorImpl.cpp xercesc/dom/impl/DOMNamedNodeMapImpl.cpp xercesc/dom/impl/DOMNodeIDMap.cpp xercesc/dom/impl/DOMNodeImpl.cpp xercesc/dom/impl/DOMNodeIteratorImpl.cpp xercesc/dom/impl/DOMNodeListImpl.cpp xercesc/dom/impl/DOMNodeVector.cpp xercesc/dom/impl/DOMNormalizer.cpp xercesc/dom/impl/DOMNotationImpl.cpp xercesc/dom/impl/DOMParentNode.cpp xercesc/dom/impl/DOMProcessingInstructionImpl.cpp xercesc/dom/impl/DOMRangeImpl.cpp xercesc/dom/impl/DOMStringListImpl.cpp xercesc/dom/impl/DOMStringPool.cpp xercesc/dom/impl/DOMTextImpl.cpp xercesc/dom/impl/DOMTreeWalkerImpl.cpp xercesc/dom/impl/DOMTypeInfoImpl.cpp xercesc/dom/impl/DOMLSSerializerImpl.cpp xercesc/dom/impl/DOMLSInputImpl.cpp xercesc/dom/impl/DOMLSOutputImpl.cpp xercesc/dom/impl/DOMXPathExpressionImpl.cpp xercesc/dom/impl/DOMXPathNSResolverImpl.cpp xercesc/dom/impl/DOMXPathResultImpl.cpp xercesc/dom/impl/XSDElementNSImpl.cpp ) set(framework_headers xercesc/framework/BinOutputStream.hpp xercesc/framework/LocalFileFormatTarget.hpp xercesc/framework/LocalFileInputSource.hpp xercesc/framework/MemBufFormatTarget.hpp xercesc/framework/MemBufInputSource.hpp xercesc/framework/MemoryManager.hpp xercesc/framework/psvi/PSVIAttribute.hpp xercesc/framework/psvi/PSVIAttributeList.hpp xercesc/framework/psvi/PSVIElement.hpp xercesc/framework/psvi/PSVIHandler.hpp xercesc/framework/psvi/PSVIItem.hpp xercesc/framework/psvi/XSAnnotation.hpp xercesc/framework/psvi/XSAttributeDeclaration.hpp xercesc/framework/psvi/XSAttributeGroupDefinition.hpp xercesc/framework/psvi/XSAttributeUse.hpp xercesc/framework/psvi/XSComplexTypeDefinition.hpp xercesc/framework/psvi/XSConstants.hpp xercesc/framework/psvi/XSElementDeclaration.hpp xercesc/framework/psvi/XSFacet.hpp xercesc/framework/psvi/XSIDCDefinition.hpp xercesc/framework/psvi/XSModel.hpp xercesc/framework/psvi/XSModelGroup.hpp xercesc/framework/psvi/XSModelGroupDefinition.hpp xercesc/framework/psvi/XSMultiValueFacet.hpp xercesc/framework/psvi/XSNamedMap.hpp xercesc/framework/psvi/XSNamedMap.c xercesc/framework/psvi/XSNamespaceItem.hpp xercesc/framework/psvi/XSNotationDeclaration.hpp xercesc/framework/psvi/XSObject.hpp xercesc/framework/psvi/XSParticle.hpp xercesc/framework/psvi/XSSimpleTypeDefinition.hpp xercesc/framework/psvi/XSTypeDefinition.hpp xercesc/framework/psvi/XSValue.hpp xercesc/framework/psvi/XSWildcard.hpp xercesc/framework/StdInInputSource.hpp xercesc/framework/StdOutFormatTarget.hpp xercesc/framework/URLInputSource.hpp xercesc/framework/ValidationContext.hpp xercesc/framework/Wrapper4DOMLSInput.hpp xercesc/framework/Wrapper4InputSource.hpp xercesc/framework/XMLAttDef.hpp xercesc/framework/XMLAttDefList.hpp xercesc/framework/XMLAttr.hpp xercesc/framework/XMLBuffer.hpp xercesc/framework/XMLBufferMgr.hpp xercesc/framework/XMLContentModel.hpp xercesc/framework/XMLDocumentHandler.hpp xercesc/framework/XMLDTDDescription.hpp xercesc/framework/XMLElementDecl.hpp xercesc/framework/XMLEntityDecl.hpp xercesc/framework/XMLEntityHandler.hpp xercesc/framework/XMLErrorCodes.hpp xercesc/framework/XMLErrorReporter.hpp xercesc/framework/XMLFormatter.hpp xercesc/framework/XMLGrammarDescription.hpp xercesc/framework/XMLGrammarPool.hpp xercesc/framework/XMLGrammarPoolImpl.hpp xercesc/framework/XMLNotationDecl.hpp xercesc/framework/XMLPScanToken.hpp xercesc/framework/XMLRecognizer.hpp xercesc/framework/XMLRefInfo.hpp xercesc/framework/XMLSchemaDescription.hpp xercesc/framework/XMLValidator.hpp xercesc/framework/XMLValidityCodes.hpp ) set(framework_sources xercesc/framework/BinOutputStream.cpp xercesc/framework/LocalFileFormatTarget.cpp xercesc/framework/LocalFileInputSource.cpp xercesc/framework/MemBufFormatTarget.cpp xercesc/framework/MemBufInputSource.cpp xercesc/framework/psvi/PSVIAttribute.cpp xercesc/framework/psvi/PSVIAttributeList.cpp xercesc/framework/psvi/PSVIElement.cpp xercesc/framework/psvi/PSVIItem.cpp xercesc/framework/psvi/XSAnnotation.cpp xercesc/framework/psvi/XSAttributeDeclaration.cpp xercesc/framework/psvi/XSAttributeGroupDefinition.cpp xercesc/framework/psvi/XSAttributeUse.cpp xercesc/framework/psvi/XSComplexTypeDefinition.cpp xercesc/framework/psvi/XSElementDeclaration.cpp xercesc/framework/psvi/XSFacet.cpp xercesc/framework/psvi/XSIDCDefinition.cpp xercesc/framework/psvi/XSModel.cpp xercesc/framework/psvi/XSModelGroup.cpp xercesc/framework/psvi/XSModelGroupDefinition.cpp xercesc/framework/psvi/XSMultiValueFacet.cpp xercesc/framework/psvi/XSNamespaceItem.cpp xercesc/framework/psvi/XSNotationDeclaration.cpp xercesc/framework/psvi/XSObject.cpp xercesc/framework/psvi/XSParticle.cpp xercesc/framework/psvi/XSSimpleTypeDefinition.cpp xercesc/framework/psvi/XSTypeDefinition.cpp xercesc/framework/psvi/XSValue.cpp xercesc/framework/psvi/XSWildcard.cpp xercesc/framework/StdInInputSource.cpp xercesc/framework/StdOutFormatTarget.cpp xercesc/framework/URLInputSource.cpp xercesc/framework/Wrapper4DOMLSInput.cpp xercesc/framework/Wrapper4InputSource.cpp xercesc/framework/XMLAttDef.cpp xercesc/framework/XMLAttDefList.cpp xercesc/framework/XMLAttr.cpp xercesc/framework/XMLBuffer.cpp xercesc/framework/XMLBufferMgr.cpp xercesc/framework/XMLContentModel.cpp xercesc/framework/XMLDTDDescription.cpp xercesc/framework/XMLElementDecl.cpp xercesc/framework/XMLEntityDecl.cpp xercesc/framework/XMLFormatter.cpp xercesc/framework/XMLGrammarDescription.cpp xercesc/framework/XMLGrammarPoolImpl.cpp xercesc/framework/XMLNotationDecl.cpp xercesc/framework/XMLRecognizer.cpp xercesc/framework/XMLRefInfo.cpp xercesc/framework/XMLSchemaDescription.cpp xercesc/framework/XMLValidator.cpp ) set(internal_headers xercesc/internal/BinFileOutputStream.hpp xercesc/internal/BinMemOutputStream.hpp xercesc/internal/CharTypeTables.hpp xercesc/internal/DGXMLScanner.hpp xercesc/internal/ElemStack.hpp xercesc/internal/EndOfEntityException.hpp xercesc/internal/IANAEncodings.hpp xercesc/internal/IGXMLScanner.hpp xercesc/internal/MemoryManagerImpl.hpp xercesc/internal/ReaderMgr.hpp xercesc/internal/SGXMLScanner.hpp xercesc/internal/ValidationContextImpl.hpp xercesc/internal/VecAttributesImpl.hpp xercesc/internal/VecAttrListImpl.hpp xercesc/internal/WFXMLScanner.hpp xercesc/internal/XMLInternalErrorHandler.hpp xercesc/internal/XMLReader.hpp xercesc/internal/XMLScanner.hpp xercesc/internal/XMLScannerResolver.hpp xercesc/internal/XProtoType.hpp xercesc/internal/XSAXMLScanner.hpp xercesc/internal/XSerializable.hpp xercesc/internal/XSerializationException.hpp xercesc/internal/XSerializeEngine.hpp xercesc/internal/XSObjectFactory.hpp xercesc/internal/XTemplateSerializer.hpp ) set(internal_sources xercesc/internal/BinFileOutputStream.cpp xercesc/internal/BinMemOutputStream.cpp xercesc/internal/DGXMLScanner.cpp xercesc/internal/ElemStack.cpp xercesc/internal/IGXMLScanner.cpp xercesc/internal/IGXMLScanner2.cpp xercesc/internal/MemoryManagerImpl.cpp xercesc/internal/ReaderMgr.cpp xercesc/internal/SGXMLScanner.cpp xercesc/internal/ValidationContextImpl.cpp xercesc/internal/VecAttributesImpl.cpp xercesc/internal/VecAttrListImpl.cpp xercesc/internal/WFXMLScanner.cpp xercesc/internal/XMLReader.cpp xercesc/internal/XMLScanner.cpp xercesc/internal/XMLScannerResolver.cpp xercesc/internal/XProtoType.cpp xercesc/internal/XSAXMLScanner.cpp xercesc/internal/XSerializeEngine.cpp xercesc/internal/XSObjectFactory.cpp xercesc/internal/XTemplateSerializer.cpp ) set(parsers_headers xercesc/parsers/AbstractDOMParser.hpp xercesc/parsers/DOMLSParserImpl.hpp xercesc/parsers/SAX2XMLFilterImpl.hpp xercesc/parsers/SAX2XMLReaderImpl.hpp xercesc/parsers/SAXParser.hpp xercesc/parsers/XercesDOMParser.hpp ) set(parsers_sources xercesc/parsers/AbstractDOMParser.cpp xercesc/parsers/DOMLSParserImpl.cpp xercesc/parsers/SAX2XMLFilterImpl.cpp xercesc/parsers/SAX2XMLReaderImpl.cpp xercesc/parsers/SAXParser.cpp xercesc/parsers/XercesDOMParser.cpp ) set(sax_headers xercesc/sax/AttributeList.hpp xercesc/sax/DocumentHandler.hpp xercesc/sax/DTDHandler.hpp xercesc/sax/EntityResolver.hpp xercesc/sax/ErrorHandler.hpp xercesc/sax/HandlerBase.hpp xercesc/sax/InputSource.hpp xercesc/sax/Locator.hpp xercesc/sax/Parser.hpp xercesc/sax/SAXException.hpp xercesc/sax/SAXParseException.hpp ) set(sax_sources xercesc/sax/Dummy.cpp xercesc/sax/InputSource.cpp xercesc/sax/SAXException.cpp xercesc/sax/SAXParseException.cpp ) set(sax2_headers xercesc/sax2/Attributes.hpp xercesc/sax2/ContentHandler.hpp xercesc/sax2/DeclHandler.hpp xercesc/sax2/DefaultHandler.hpp xercesc/sax2/LexicalHandler.hpp xercesc/sax2/SAX2XMLFilter.hpp xercesc/sax2/SAX2XMLReader.hpp xercesc/sax2/XMLReaderFactory.hpp ) set(sax2_sources xercesc/sax2/sax2Dummy.cpp ) set(util_headers xercesc/util/ArrayIndexOutOfBoundsException.hpp xercesc/util/Base64.hpp xercesc/util/BaseRefVectorOf.hpp xercesc/util/BaseRefVectorOf.c xercesc/util/BinFileInputStream.hpp xercesc/util/BinInputStream.hpp xercesc/util/BinMemInputStream.hpp xercesc/util/BitOps.hpp xercesc/util/BitSet.hpp xercesc/util/CountedPointer.hpp xercesc/util/CountedPointer.c xercesc/util/DefaultPanicHandler.hpp xercesc/util/EmptyStackException.hpp xercesc/util/EncodingValidator.hpp xercesc/util/FlagJanitor.hpp xercesc/util/FlagJanitor.c xercesc/util/Hashers.hpp xercesc/util/Hash2KeysSetOf.hpp xercesc/util/Hash2KeysSetOf.c xercesc/util/HexBin.hpp xercesc/util/IllegalArgumentException.hpp xercesc/util/InvalidCastException.hpp xercesc/util/IOException.hpp xercesc/util/Janitor.hpp xercesc/util/Janitor.c xercesc/util/KeyRefPair.hpp xercesc/util/KeyRefPair.c xercesc/util/KeyValuePair.hpp xercesc/util/KeyValuePair.c xercesc/util/KVStringPair.hpp xercesc/util/Mutexes.hpp xercesc/util/LogicalPath.c xercesc/util/NameIdPool.hpp xercesc/util/NameIdPool.c xercesc/util/NoSuchElementException.hpp xercesc/util/NullPointerException.hpp xercesc/util/NumberFormatException.hpp xercesc/util/OutOfMemoryException.hpp xercesc/util/PanicHandler.hpp xercesc/util/ParseException.hpp xercesc/util/PlatformUtils.hpp xercesc/util/PSVIUni.hpp xercesc/util/QName.hpp xercesc/util/RefArrayOf.hpp xercesc/util/RefArrayOf.c xercesc/util/RefArrayVectorOf.hpp xercesc/util/RefArrayVectorOf.c xercesc/util/RefHash2KeysTableOf.hpp xercesc/util/RefHash2KeysTableOf.c xercesc/util/RefHash3KeysIdPool.hpp xercesc/util/RefHash3KeysIdPool.c xercesc/util/RefHashTableOf.hpp xercesc/util/RefHashTableOf.c xercesc/util/RefStackOf.hpp xercesc/util/RefStackOf.c xercesc/util/RefVectorOf.hpp xercesc/util/RefVectorOf.c xercesc/util/regx/ASCIIRangeFactory.hpp xercesc/util/regx/BlockRangeFactory.hpp xercesc/util/regx/BMPattern.hpp xercesc/util/regx/CharToken.hpp xercesc/util/regx/ClosureToken.hpp xercesc/util/regx/ConcatToken.hpp xercesc/util/regx/Match.hpp xercesc/util/regx/Op.hpp xercesc/util/regx/OpFactory.hpp xercesc/util/regx/ParenToken.hpp xercesc/util/regx/ParserForXMLSchema.hpp xercesc/util/regx/RangeFactory.hpp xercesc/util/regx/RangeToken.hpp xercesc/util/regx/RangeTokenMap.hpp xercesc/util/regx/RegularExpression.hpp xercesc/util/regx/RegxDefs.hpp xercesc/util/regx/RegxParser.hpp xercesc/util/regx/RegxUtil.hpp xercesc/util/regx/StringToken.hpp xercesc/util/regx/Token.hpp xercesc/util/regx/TokenFactory.hpp xercesc/util/regx/TokenInc.hpp xercesc/util/regx/UniCharTable.hpp xercesc/util/regx/UnicodeRangeFactory.hpp xercesc/util/regx/UnionToken.hpp xercesc/util/regx/XMLRangeFactory.hpp xercesc/util/regx/XMLUniCharacter.hpp xercesc/util/RuntimeException.hpp xercesc/util/SchemaDateTimeException.hpp xercesc/util/SecurityManager.hpp xercesc/util/StringPool.hpp xercesc/util/SynchronizedStringPool.hpp xercesc/util/TranscodingException.hpp xercesc/util/TransENameMap.hpp xercesc/util/TransENameMap.c xercesc/util/TransService.hpp xercesc/util/UnexpectedEOFException.hpp xercesc/util/UnsupportedEncodingException.hpp xercesc/util/UTFDataFormatException.hpp xercesc/util/ValueArrayOf.hpp xercesc/util/ValueArrayOf.c xercesc/util/ValueHashTableOf.hpp xercesc/util/ValueHashTableOf.c xercesc/util/ValueStackOf.hpp xercesc/util/ValueStackOf.c xercesc/util/ValueVectorOf.hpp xercesc/util/ValueVectorOf.c xercesc/util/XercesDefs.hpp xercesc/util/XMemory.hpp xercesc/util/XML256TableTranscoder.hpp xercesc/util/XML88591Transcoder.hpp xercesc/util/XMLAbstractDoubleFloat.hpp xercesc/util/XMLASCIITranscoder.hpp xercesc/util/XMLBigDecimal.hpp xercesc/util/XMLBigInteger.hpp xercesc/util/XMLChar.hpp xercesc/util/XMLChTranscoder.hpp xercesc/util/XMLDateTime.hpp xercesc/util/XMLDOMMsg.hpp xercesc/util/XMLDouble.hpp xercesc/util/XMLEBCDICTranscoder.hpp xercesc/util/XMLEntityResolver.hpp xercesc/util/XMLEnumerator.hpp xercesc/util/XMLException.hpp xercesc/util/XMLExceptMsgs.hpp xercesc/util/XMLFileMgr.hpp xercesc/util/XMLFloat.hpp xercesc/util/XMLIBM1047Transcoder.hpp xercesc/util/XMLIBM1140Transcoder.hpp xercesc/util/XMLInitializer.hpp xercesc/util/XMLInteger.hpp xercesc/util/XMLMutexMgr.hpp xercesc/util/XMLMsgLoader.hpp xercesc/util/XMLNetAccessor.hpp xercesc/util/XMLNumber.hpp xercesc/util/XMLResourceIdentifier.hpp xercesc/util/XMLString.hpp xercesc/util/XMLStringTokenizer.hpp xercesc/util/XMLUCS4Transcoder.hpp xercesc/util/XMLUni.hpp xercesc/util/XMLUniDefs.hpp xercesc/util/XMLUri.hpp xercesc/util/XMLURL.hpp xercesc/util/XMLUTF16Transcoder.hpp xercesc/util/XMLUTF8Transcoder.hpp xercesc/util/XMLWin1252Transcoder.hpp ) set(util_sources xercesc/util/Base64.cpp xercesc/util/BinFileInputStream.cpp xercesc/util/BinInputStream.cpp xercesc/util/BinMemInputStream.cpp xercesc/util/BitSet.cpp xercesc/util/DefaultPanicHandler.cpp xercesc/util/EncodingValidator.cpp xercesc/util/HeaderDummy.cpp xercesc/util/HexBin.cpp xercesc/util/JanitorExports.cpp xercesc/util/KVStringPair.cpp xercesc/util/Mutexes.cpp xercesc/util/PanicHandler.cpp xercesc/util/PlatformUtils.cpp xercesc/util/PSVIUni.cpp xercesc/util/QName.cpp xercesc/util/regx/ASCIIRangeFactory.cpp xercesc/util/regx/BlockRangeFactory.cpp xercesc/util/regx/BMPattern.cpp xercesc/util/regx/CharToken.cpp xercesc/util/regx/ClosureToken.cpp xercesc/util/regx/ConcatToken.cpp xercesc/util/regx/Match.cpp xercesc/util/regx/Op.cpp xercesc/util/regx/OpFactory.cpp xercesc/util/regx/ParenToken.cpp xercesc/util/regx/ParserForXMLSchema.cpp xercesc/util/regx/RangeFactory.cpp xercesc/util/regx/RangeToken.cpp xercesc/util/regx/RangeTokenMap.cpp xercesc/util/regx/RegularExpression.cpp xercesc/util/regx/RegxParser.cpp xercesc/util/regx/RegxUtil.cpp xercesc/util/regx/StringToken.cpp xercesc/util/regx/Token.cpp xercesc/util/regx/TokenFactory.cpp xercesc/util/regx/UnicodeRangeFactory.cpp xercesc/util/regx/UnionToken.cpp xercesc/util/regx/XMLRangeFactory.cpp xercesc/util/regx/XMLUniCharacter.cpp xercesc/util/StringPool.cpp xercesc/util/SynchronizedStringPool.cpp xercesc/util/TransService.cpp xercesc/util/XMemory.cpp xercesc/util/XML256TableTranscoder.cpp xercesc/util/XML88591Transcoder.cpp xercesc/util/XMLAbstractDoubleFloat.cpp xercesc/util/XMLASCIITranscoder.cpp xercesc/util/XMLBigDecimal.cpp xercesc/util/XMLBigInteger.cpp xercesc/util/XMLChar.cpp xercesc/util/XMLChTranscoder.cpp xercesc/util/XMLDateTime.cpp xercesc/util/XMLDouble.cpp xercesc/util/XMLEBCDICTranscoder.cpp xercesc/util/XMLException.cpp xercesc/util/XMLFloat.cpp xercesc/util/XMLIBM1047Transcoder.cpp xercesc/util/XMLIBM1140Transcoder.cpp xercesc/util/XMLInitializer.cpp xercesc/util/XMLMsgLoader.cpp xercesc/util/XMLNumber.cpp xercesc/util/XMLString.cpp xercesc/util/XMLStringTokenizer.cpp xercesc/util/XMLUCS4Transcoder.cpp xercesc/util/XMLUni.cpp xercesc/util/XMLUri.cpp xercesc/util/XMLURL.cpp xercesc/util/XMLUTF16Transcoder.cpp xercesc/util/XMLUTF8Transcoder.cpp xercesc/util/XMLWin1252Transcoder.cpp ) set(validators_headers xercesc/validators/common/AllContentModel.hpp xercesc/validators/common/CMAny.hpp xercesc/validators/common/CMBinaryOp.hpp xercesc/validators/common/CMLeaf.hpp xercesc/validators/common/CMRepeatingLeaf.hpp xercesc/validators/common/CMNode.hpp xercesc/validators/common/CMStateSet.hpp xercesc/validators/common/CMUnaryOp.hpp xercesc/validators/common/ContentLeafNameTypeVector.hpp xercesc/validators/common/ContentSpecNode.hpp xercesc/validators/common/DFAContentModel.hpp xercesc/validators/common/Grammar.hpp xercesc/validators/common/GrammarResolver.hpp xercesc/validators/common/MixedContentModel.hpp xercesc/validators/common/SimpleContentModel.hpp xercesc/validators/datatype/AbstractNumericFacetValidator.hpp xercesc/validators/datatype/AbstractNumericValidator.hpp xercesc/validators/datatype/AbstractStringValidator.hpp xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.hpp xercesc/validators/datatype/AnyURIDatatypeValidator.hpp xercesc/validators/datatype/Base64BinaryDatatypeValidator.hpp xercesc/validators/datatype/BooleanDatatypeValidator.hpp xercesc/validators/datatype/DatatypeValidator.hpp xercesc/validators/datatype/DatatypeValidatorFactory.hpp xercesc/validators/datatype/DateDatatypeValidator.hpp xercesc/validators/datatype/DateTimeDatatypeValidator.hpp xercesc/validators/datatype/DateTimeValidator.hpp xercesc/validators/datatype/DayDatatypeValidator.hpp xercesc/validators/datatype/DecimalDatatypeValidator.hpp xercesc/validators/datatype/DoubleDatatypeValidator.hpp xercesc/validators/datatype/DurationDatatypeValidator.hpp xercesc/validators/datatype/ENTITYDatatypeValidator.hpp xercesc/validators/datatype/FloatDatatypeValidator.hpp xercesc/validators/datatype/HexBinaryDatatypeValidator.hpp xercesc/validators/datatype/IDDatatypeValidator.hpp xercesc/validators/datatype/IDREFDatatypeValidator.hpp xercesc/validators/datatype/InvalidDatatypeFacetException.hpp xercesc/validators/datatype/InvalidDatatypeValueException.hpp xercesc/validators/datatype/ListDatatypeValidator.hpp xercesc/validators/datatype/MonthDatatypeValidator.hpp xercesc/validators/datatype/MonthDayDatatypeValidator.hpp xercesc/validators/datatype/NameDatatypeValidator.hpp xercesc/validators/datatype/NCNameDatatypeValidator.hpp xercesc/validators/datatype/NOTATIONDatatypeValidator.hpp xercesc/validators/datatype/QNameDatatypeValidator.hpp xercesc/validators/datatype/StringDatatypeValidator.hpp xercesc/validators/datatype/TimeDatatypeValidator.hpp xercesc/validators/datatype/UnionDatatypeValidator.hpp xercesc/validators/datatype/XMLCanRepGroup.hpp xercesc/validators/datatype/YearDatatypeValidator.hpp xercesc/validators/datatype/YearMonthDatatypeValidator.hpp xercesc/validators/DTD/DocTypeHandler.hpp xercesc/validators/DTD/DTDAttDef.hpp xercesc/validators/DTD/DTDAttDefList.hpp xercesc/validators/DTD/DTDElementDecl.hpp xercesc/validators/DTD/DTDEntityDecl.hpp xercesc/validators/DTD/DTDGrammar.hpp xercesc/validators/DTD/DTDScanner.hpp xercesc/validators/DTD/DTDValidator.hpp xercesc/validators/DTD/XMLDTDDescriptionImpl.hpp xercesc/validators/schema/ComplexTypeInfo.hpp xercesc/validators/schema/GeneralAttributeCheck.hpp xercesc/validators/schema/identity/FieldActivator.hpp xercesc/validators/schema/identity/FieldValueMap.hpp xercesc/validators/schema/identity/IC_Field.hpp xercesc/validators/schema/identity/IC_Key.hpp xercesc/validators/schema/identity/IC_KeyRef.hpp xercesc/validators/schema/identity/IC_Selector.hpp xercesc/validators/schema/identity/IC_Unique.hpp xercesc/validators/schema/identity/IdentityConstraint.hpp xercesc/validators/schema/identity/IdentityConstraintHandler.hpp xercesc/validators/schema/identity/ValueStore.hpp xercesc/validators/schema/identity/ValueStoreCache.hpp xercesc/validators/schema/identity/XercesXPath.hpp xercesc/validators/schema/identity/XPathException.hpp xercesc/validators/schema/identity/XPathMatcher.hpp xercesc/validators/schema/identity/XPathMatcherStack.hpp xercesc/validators/schema/identity/XPathSymbols.hpp xercesc/validators/schema/NamespaceScope.hpp xercesc/validators/schema/PSVIDefs.hpp xercesc/validators/schema/SchemaAttDef.hpp xercesc/validators/schema/SchemaAttDefList.hpp xercesc/validators/schema/SchemaElementDecl.hpp xercesc/validators/schema/SchemaGrammar.hpp xercesc/validators/schema/SchemaInfo.hpp xercesc/validators/schema/SchemaSymbols.hpp xercesc/validators/schema/SchemaValidator.hpp xercesc/validators/schema/SubstitutionGroupComparator.hpp xercesc/validators/schema/TraverseSchema.hpp xercesc/validators/schema/XercesAttGroupInfo.hpp xercesc/validators/schema/XercesElementWildcard.hpp xercesc/validators/schema/XercesGroupInfo.hpp xercesc/validators/schema/XMLSchemaDescriptionImpl.hpp xercesc/validators/schema/XSDDOMParser.hpp xercesc/validators/schema/XSDErrorReporter.hpp xercesc/validators/schema/XSDLocator.hpp xercesc/validators/schema/XUtil.hpp ) set(validators_sources xercesc/validators/common/AllContentModel.cpp xercesc/validators/common/CMAny.cpp xercesc/validators/common/CMBinaryOp.cpp xercesc/validators/common/CMUnaryOp.cpp xercesc/validators/common/ContentLeafNameTypeVector.cpp xercesc/validators/common/ContentSpecNode.cpp xercesc/validators/common/DFAContentModel.cpp xercesc/validators/common/Grammar.cpp xercesc/validators/common/GrammarResolver.cpp xercesc/validators/common/MixedContentModel.cpp xercesc/validators/common/SimpleContentModel.cpp xercesc/validators/datatype/AbstractNumericFacetValidator.cpp xercesc/validators/datatype/AbstractNumericValidator.cpp xercesc/validators/datatype/AbstractStringValidator.cpp xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.cpp xercesc/validators/datatype/AnyURIDatatypeValidator.cpp xercesc/validators/datatype/Base64BinaryDatatypeValidator.cpp xercesc/validators/datatype/BooleanDatatypeValidator.cpp xercesc/validators/datatype/DatatypeValidator.cpp xercesc/validators/datatype/DatatypeValidatorFactory.cpp xercesc/validators/datatype/DateDatatypeValidator.cpp xercesc/validators/datatype/DateTimeDatatypeValidator.cpp xercesc/validators/datatype/DateTimeValidator.cpp xercesc/validators/datatype/DayDatatypeValidator.cpp xercesc/validators/datatype/DecimalDatatypeValidator.cpp xercesc/validators/datatype/DoubleDatatypeValidator.cpp xercesc/validators/datatype/DurationDatatypeValidator.cpp xercesc/validators/datatype/ENTITYDatatypeValidator.cpp xercesc/validators/datatype/FloatDatatypeValidator.cpp xercesc/validators/datatype/HexBinaryDatatypeValidator.cpp xercesc/validators/datatype/IDDatatypeValidator.cpp xercesc/validators/datatype/IDREFDatatypeValidator.cpp xercesc/validators/datatype/ListDatatypeValidator.cpp xercesc/validators/datatype/MonthDatatypeValidator.cpp xercesc/validators/datatype/MonthDayDatatypeValidator.cpp xercesc/validators/datatype/NameDatatypeValidator.cpp xercesc/validators/datatype/NCNameDatatypeValidator.cpp xercesc/validators/datatype/NOTATIONDatatypeValidator.cpp xercesc/validators/datatype/QNameDatatypeValidator.cpp xercesc/validators/datatype/StringDatatypeValidator.cpp xercesc/validators/datatype/TimeDatatypeValidator.cpp xercesc/validators/datatype/UnionDatatypeValidator.cpp xercesc/validators/datatype/XMLCanRepGroup.cpp xercesc/validators/datatype/YearDatatypeValidator.cpp xercesc/validators/datatype/YearMonthDatatypeValidator.cpp xercesc/validators/DTD/DTDAttDef.cpp xercesc/validators/DTD/DTDAttDefList.cpp xercesc/validators/DTD/DTDElementDecl.cpp xercesc/validators/DTD/DTDEntityDecl.cpp xercesc/validators/DTD/DTDGrammar.cpp xercesc/validators/DTD/DTDScanner.cpp xercesc/validators/DTD/DTDValidator.cpp xercesc/validators/DTD/XMLDTDDescriptionImpl.cpp xercesc/validators/schema/ComplexTypeInfo.cpp xercesc/validators/schema/GeneralAttributeCheck.cpp xercesc/validators/schema/identity/FieldActivator.cpp xercesc/validators/schema/identity/FieldValueMap.cpp xercesc/validators/schema/identity/IC_Field.cpp xercesc/validators/schema/identity/IC_Key.cpp xercesc/validators/schema/identity/IC_KeyRef.cpp xercesc/validators/schema/identity/IC_Selector.cpp xercesc/validators/schema/identity/IC_Unique.cpp xercesc/validators/schema/identity/IdentityConstraint.cpp xercesc/validators/schema/identity/IdentityConstraintHandler.cpp xercesc/validators/schema/identity/ValueStore.cpp xercesc/validators/schema/identity/ValueStoreCache.cpp xercesc/validators/schema/identity/XercesXPath.cpp xercesc/validators/schema/identity/XPathMatcher.cpp xercesc/validators/schema/identity/XPathMatcherStack.cpp xercesc/validators/schema/identity/XPathSymbols.cpp xercesc/validators/schema/NamespaceScope.cpp xercesc/validators/schema/SchemaAttDef.cpp xercesc/validators/schema/SchemaAttDefList.cpp xercesc/validators/schema/SchemaElementDecl.cpp xercesc/validators/schema/SchemaGrammar.cpp xercesc/validators/schema/SchemaInfo.cpp xercesc/validators/schema/SchemaSymbols.cpp xercesc/validators/schema/SchemaValidator.cpp xercesc/validators/schema/SubstitutionGroupComparator.cpp xercesc/validators/schema/TraverseSchema.cpp xercesc/validators/schema/XercesAttGroupInfo.cpp xercesc/validators/schema/XercesElementWildcard.cpp xercesc/validators/schema/XercesGroupInfo.cpp xercesc/validators/schema/XMLSchemaDescriptionImpl.cpp xercesc/validators/schema/XSDDOMParser.cpp xercesc/validators/schema/XSDErrorReporter.cpp xercesc/validators/schema/XSDLocator.cpp xercesc/validators/schema/XUtil.cpp ) set(xinclude_headers xercesc/xinclude/XIncludeDOMDocumentProcessor.hpp xercesc/xinclude/XIncludeLocation.hpp xercesc/xinclude/XIncludeUtils.hpp ) set(xinclude_sources xercesc/xinclude/XIncludeDOMDocumentProcessor.cpp xercesc/xinclude/XIncludeLocation.cpp xercesc/xinclude/XIncludeUtils.cpp ) set(icu_headers xercesc/util/Transcoders/ICU/ICUTransService.hpp ) set(icu_sources xercesc/util/Transcoders/ICU/ICUTransService.cpp ) set(gnuiconv_headers xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.hpp ) set(gnuiconv_sources xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp ) set(iconv_headers xercesc/util/Transcoders/Iconv/IconvTransService.hpp ) set(iconv_sources xercesc/util/Transcoders/Iconv/IconvTransService.cpp ) set(macosunicodeconverter_headers xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp ) set(macosunicodeconverter_sources xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp ) set(wintrans_headers xercesc/util/Transcoders/Win32/Win32TransService.hpp ) set(wintrans_sources xercesc/util/Transcoders/Win32/Win32TransService.cpp ) set(curl_headers xercesc/util/NetAccessors/Curl/CurlNetAccessor.hpp xercesc/util/NetAccessors/Curl/CurlURLInputStream.hpp ) set(curl_sources xercesc/util/NetAccessors/Curl/CurlNetAccessor.cpp xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp ) set(sockets_headers xercesc/util/NetAccessors/Socket/SocketNetAccessor.hpp xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.hpp xercesc/util/NetAccessors/BinHTTPInputStreamCommon.hpp ) set(sockets_sources xercesc/util/NetAccessors/Socket/SocketNetAccessor.cpp xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp xercesc/util/NetAccessors/BinHTTPInputStreamCommon.cpp ) set(cfurl_headers xercesc/util/NetAccessors/MacOSURLAccessCF/MacOSURLAccessCF.hpp xercesc/util/NetAccessors/MacOSURLAccessCF/URLAccessCFBinInputStream.hpp ) set(cfurl_sources xercesc/util/NetAccessors/MacOSURLAccessCF/MacOSURLAccessCF.cpp xercesc/util/NetAccessors/MacOSURLAccessCF/URLAccessCFBinInputStream.cpp ) set(winsock_headers xercesc/util/NetAccessors/WinSock/WinSockNetAccessor.hpp xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.hpp xercesc/util/NetAccessors/BinHTTPInputStreamCommon.hpp ) set(winsock_sources xercesc/util/NetAccessors/WinSock/WinSockNetAccessor.cpp xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp xercesc/util/NetAccessors/BinHTTPInputStreamCommon.cpp ) set(msginmemory_headers xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.hpp xercesc/util/MsgLoaders/InMemory/XercesMessages_en_US.hpp ) set(msginmemory_sources xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp ) set(msgicu_headers xercesc/util/MsgLoaders/ICU/ICUMsgLoader.hpp ) set(msgicu_sources xercesc/util/MsgLoaders/ICU/ICUMsgLoader.cpp ) set(msgicu_nodist_sources "${CMAKE_CURRENT_BINARY_DIR}/xercesc_messages.c" "${CMAKE_CURRENT_BINARY_DIR}/root_res.c" ) set(msgiconv_headers xercesc/util/MsgLoaders/MsgCatalog/MsgCatalogLoader.hpp xercesc/util/MsgLoaders/MsgCatalog/XMLMsgCat_Ids.hpp ) set(msgiconv_sources xercesc/util/MsgLoaders/MsgCatalog/MsgCatalogLoader.cpp ) set(posixfmgr_headers xercesc/util/FileManagers/PosixFileMgr.hpp ) set(posixfmgr_sources xercesc/util/FileManagers/PosixFileMgr.cpp ) set(winfmgr_headers xercesc/util/FileManagers/WindowsFileMgr.hpp ) set(winfmgr_sources xercesc/util/FileManagers/WindowsFileMgr.cpp ) set(nothreadmmgr_headers xercesc/util/MutexManagers/NoThreadMutexMgr.hpp ) set(nothreadmmgr_sources xercesc/util/MutexManagers/NoThreadMutexMgr.cpp ) set(stdmmgr_headers xercesc/util/MutexManagers/StdMutexMgr.hpp ) set(stdmmgr_sources xercesc/util/MutexManagers/StdMutexMgr.cpp ) set(posixmmgr_headers xercesc/util/MutexManagers/PosixMutexMgr.hpp ) set(posixmmgr_sources xercesc/util/MutexManagers/PosixMutexMgr.cpp ) set(winmmgr_headers xercesc/util/MutexManagers/WindowsMutexMgr.hpp ) set(winmmgr_sources xercesc/util/MutexManagers/WindowsMutexMgr.cpp ) set(libxerces_c_SOURCES ${util_sources} ${dom_sources} ${domimpl_sources} ${framework_sources} ${internal_sources} ${parsers_sources} ${sax_sources} ${sax2_sources} ${validators_sources} ${xinclude_sources} ) set(libxerces_c_HEADERS ${util_headers} ${dom_headers} ${domimpl_headers} ${framework_headers} ${internal_headers} ${parsers_headers} ${sax_headers} ${sax2_headers} ${validators_headers} ${xinclude_headers} ) # Add replacement functions if(NOT HAVE_STRICMP) list(APPEND xerces_replacement_funcs stricmp.c) endif() if(NOT HAVE_STRNICMP) list(APPEND xerces_replacement_funcs strnicmp.c) endif() if(NOT HAVE_TOWLOWER) list(APPEND xerces_replacement_funcs towlower.c) endif() if(NOT HAVE_TOWUPPER) list(APPEND xerces_replacement_funcs towupper.c) endif() list(APPEND libxerces_c_SOURCES ${xerces_replacement_funcs}) # NetAccessors, conditionally built based on selection if(SOCKET_LIBRARY) list(APPEND libxerces_c_DEPS ${SOCKET_LIBRARY}) endif() if(NSL_LIBRARY) list(APPEND libxerces_c_DEPS ${NSL_LIBRARY}) endif() if(XERCES_USE_NETACCESSOR_CURL) list(APPEND libxerces_c_SOURCES ${curl_sources}) list(APPEND libxerces_c_HEADERS ${curl_headers}) list(APPEND libxerces_c_DEPS ${CURL_LIBRARIES}) endif() if(XERCES_USE_NETACCESSOR_SOCKET) list(APPEND libxerces_c_SOURCES ${sockets_sources}) list(APPEND libxerces_c_HEADERS ${sockets_headers}) endif() if(XERCES_USE_NETACCESSOR_CFURL) list(APPEND libxerces_c_SOURCES ${cfurl_sources}) list(APPEND libxerces_c_HEADERS ${cfurl_headers}) list(APPEND libxerces_c_DEPS ${CORE_SERVICES_LIBRARY}) endif() if(XERCES_USE_NETACCESSOR_WINSOCK) list(APPEND libxerces_c_SOURCES ${winsock_sources}) list(APPEND libxerces_c_HEADERS ${winsock_headers}) endif() # Transcoders, conditionally built based on selection # if(XERCES_USE_TRANSCODER_ICU) list(APPEND libxerces_c_SOURCES ${icu_sources}) list(APPEND libxerces_c_HEADERS ${icu_headers}) list(APPEND libxerces_c_DEPS ICU::uc ICU::data) endif() if(XERCES_USE_TRANSCODER_GNUICONV) list(APPEND libxerces_c_SOURCES ${gnuiconv_sources}) list(APPEND libxerces_c_HEADERS ${gnuiconv_headers}) endif() if(XERCES_USE_TRANSCODER_ICONV) list(APPEND libxerces_c_SOURCES ${iconv_sources}) list(APPEND libxerces_c_HEADERS ${iconv_headers}) endif() if(XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER) list(APPEND libxerces_c_SOURCES ${macosunicodeconverter_sources}) list(APPEND libxerces_c_HEADERS ${macosunicodeconverter_headers}) list(APPEND libxerces_c_DEPS ${CORE_SERVICES_LIBRARY}) endif() if(XERCES_USE_TRANSCODER_WINDOWS) list(APPEND libxerces_c_SOURCES ${wintrans_sources}) list(APPEND libxerces_c_HEADERS ${wintrans_headers}) endif() # MsgLoaders, conditionally built based on selection # if(XERCES_USE_MSGLOADER_INMEMORY) list(APPEND libxerces_c_SOURCES ${msginmemory_sources}) list(APPEND libxerces_c_HEADERS ${msginmemory_headers}) endif() if(XERCES_USE_MSGLOADER_ICU) list(APPEND libxerces_c_SOURCES ${msgicu_sources} ${msgicu_nodist_sources}) list(APPEND libxerces_c_HEADERS ${msgicu_headers}) list(APPEND libxerces_c_DEPS ICU::uc ICU::data) # Resource shortname set(PKGNAME xercesc_messages_${INTERFACE_VERSION_U}) add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/xercesc_messages.c" COMMAND "${ICU_GENCMN_EXECUTABLE}" --name "${PKGNAME}" -S "${PKGNAME}_dat.c" -d . "${CMAKE_CURRENT_SOURCE_DIR}/xercesc/util/MsgLoaders/ICU/resources/res-file-list.txt" COMMAND "${CMAKE_COMMAND}" -E rename "${PKGNAME}_dat.c" xercesc_messages.c DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/xercesc/util/MsgLoaders/ICU/resources/res-file-list.txt" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/root.res" COMMAND "${ICU_GENRB_EXECUTABLE}" -d . "${CMAKE_CURRENT_SOURCE_DIR}/xercesc/util/MsgLoaders/ICU/resources/root.txt" DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/xercesc/util/MsgLoaders/ICU/resources/root.txt" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/root_res.c" COMMAND "${ICU_GENCCODE_EXECUTABLE}" --name ${PKGNAME} -d . root.res DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/root.res" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") add_custom_target( genicu DEPENDS xercesc_messages.c root_res.c) set_target_properties(genicu PROPERTIES FOLDER "Library") endif() if(XERCES_USE_MSGLOADER_ICONV) list(APPEND libxerces_c_SOURCES ${msgiconv_sources}) list(APPEND libxerces_c_HEADERS ${msgiconv_headers}) set(PKGNAME XercesMessages) set(RESTARGET ${CMAKE_CURRENT_BINARY_DIR}/${PKGNAME}_en_US.cat) set(RESFILE ${CMAKE_CURRENT_SOURCE_DIR}/xercesc/util/MsgLoaders/MsgCatalog/XercesMessages_en_US.Msg) add_custom_command( OUTPUT ${RESTARGET} COMMAND gencat ${RESTARGET} ${RESFILE} DEPENDS ${RESFILE}) add_custom_target( gencat ALL DEPENDS ${RESTARGET}) set_target_properties(gencat PROPERTIES FOLDER "Library") install( FILES "${RESTARGET}" DESTINATION "${CMAKE_INSTALL_PREFIX}/msg" COMPONENT "runtime") endif() # Mutex Managers, conditionally built based on selection # if(XERCES_USE_MUTEXMGR_NOTHREAD) list(APPEND libxerces_c_SOURCES ${nothreadmmgr_sources}) list(APPEND libxerces_c_HEADERS ${nothreadmmgr_headers}) endif() if(XERCES_USE_MUTEXMGR_STD) list(APPEND libxerces_c_SOURCES ${stdmmgr_sources}) list(APPEND libxerces_c_HEADERS ${stdmmgr_headers}) list(APPEND libxerces_c_DEPS Threads::Threads) endif() if(XERCES_USE_MUTEXMGR_POSIX) list(APPEND libxerces_c_SOURCES ${posixmmgr_sources}) list(APPEND libxerces_c_HEADERS ${posixmmgr_headers}) list(APPEND libxerces_c_DEPS Threads::Threads) endif() if(XERCES_USE_MUTEXMGR_WINDOWS) list(APPEND libxerces_c_SOURCES ${winmmgr_sources}) list(APPEND libxerces_c_HEADERS ${winmmgr_headers}) endif() # File Managers, conditionally built based on selection # if(XERCES_USE_FILEMGR_POSIX) list(APPEND libxerces_c_SOURCES ${posixfmgr_sources}) list(APPEND libxerces_c_HEADERS ${posixfmgr_headers}) endif() if(XERCES_USE_FILEMGR_WINDOWS) list(APPEND libxerces_c_SOURCES ${winfmgr_sources}) list(APPEND libxerces_c_HEADERS ${winfmgr_headers}) endif() # Windows resource. With some additional work to clean it up, it # might be possible to use with Cygwin and MinGW. if(MSVC) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/xercesc/util/version.rc.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/xercesc/util/version.rc" @ONLY) list(APPEND libxerces_c_RESOURCES "${CMAKE_CURRENT_BINARY_DIR}/xercesc/util/version.rc") endif() # Definitions required for building add_definitions( -DHAVE_CONFIG_H=1 -DXERCES_BUILDING_LIBRARY=1 ) # Search the project binary dir for config.h include_directories( ${PROJECT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) #if(XERCES_USE_NETACCESSOR_CURL) # include_directories(SYSTEM ${CURL_INCLUDE_DIRS}) #endif() add_custom_target(xerces-c-headers SOURCES ${libxerces_c_HEADERS}) set_target_properties(xerces-c-headers PROPERTIES FOLDER "Library") add_library(xerces-c ${libxerces_c_SOURCES} ${libxerces_c_RESOURCES}) target_link_libraries(xerces-c ${libxerces_c_DEPS}) if(XERCES_USE_NETACCESSOR_CURL) target_include_directories(xerces-c SYSTEM PRIVATE ${CURL_INCLUDE_DIRS}) endif() if(MSVC) # Add configuration-specific library name to resource file. target_compile_definitions(xerces-c PRIVATE "XERCES_DLL_NAME=\"$\\0\"") # Different naming for Windows than for Unix builds for backward # compatibility with the existing project files. set_target_properties(xerces-c PROPERTIES OUTPUT_NAME "xerces-c_${INTERFACE_VERSION_MAJOR}") set_target_properties(xerces-c PROPERTIES RUNTIME_OUTPUT_NAME "xerces-c_${INTERFACE_VERSION_U}") set_target_properties(xerces-c PROPERTIES DEBUG_POSTFIX "D") elseif(UNIX) # For strict libtool compatibility on Unix. It's a horrible hack to # set the version in the filename, and create the symlink at install # time. Note: could be dropped when the SONAME is updated and # libtool compatibility is no longer required. set_target_properties(xerces-c PROPERTIES OUTPUT_NAME "xerces-c-${INTERFACE_VERSION_D}") file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/InstallLibrarySymlink.cmake" CONTENT "execute_process(COMMAND ln -sf \"$\" \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LIBDIR}/libxerces-c.so\")") install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/InstallLibrarySymlink.cmake") else() # Not used for the common cases, though this would be the default if # not for libtool compatibility. set_target_properties(xerces-c PROPERTIES SOVERSION ${INTERFACE_VERSION_D}) if(NOT CYGWIN) # This property causes shared libraries on Linux to have the full # version encoded into their final filename. We disable this on # Cygwin because it causes xerces-c-${XERCES_C_FULL_VERSION}.dll # to be created when xerces-c.dll seems to be the default. set_target_properties(xerces-c PROPERTIES VERSION ${INTERFACE_VERSION_D}) endif() endif() set_target_properties(xerces-c PROPERTIES FOLDER "Library") if(WIN32) set(xerces_config_dir "cmake") else() set(xerces_config_dir "${CMAKE_INSTALL_LIBDIR}/cmake/XercesC") endif() install(TARGETS xerces-c EXPORT XercesCConfigInternal RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT "runtime" INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") install(EXPORT XercesCConfigInternal DESTINATION "${xerces_config_dir}" NAMESPACE "xerces_" COMPONENT "development") include(CMakePackageConfigHelpers) configure_package_config_file( "${CMAKE_CURRENT_SOURCE_DIR}/XercesCConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/XercesCConfig.cmake" INSTALL_DESTINATION "${xerces_config_dir}") write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/XercesCConfigVersion.cmake VERSION "${PROJECT_VERSION}" COMPATIBILITY SameMajorVersion) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/XercesCConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/XercesCConfigVersion.cmake DESTINATION "${xerces_config_dir}") foreach(hdr IN LISTS libxerces_c_HEADERS) get_filename_component(hdrdir "${hdr}" DIRECTORY) install( FILES "${hdr}" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${hdrdir}" COMPONENT "development") endforeach() # Source file grouping (for IDE project layout) set(source_files ${libxerces_c_SOURCES} ${libxerces_c_HEADERS}) list(SORT source_files) unset(group_dir) unset(group_files) foreach(file IN LISTS source_files) get_filename_component(dir "${file}" PATH) if(group_dir AND NOT dir STREQUAL group_dir) if(group_files) source_group("${group_dir}" FILES ${group_files}) endif() unset(group_files) endif() list(APPEND group_files "${file}") set(group_dir "${dir}") endforeach() if(group_files) source_group("${group_dir}" FILES ${group_files}) endif() unset(group_dir) unset(group_files) # Make sure cmake-generated Xerces_autoconf_config.hpp and # XercesVersion.hpp end up in a proper place when installed. install( FILES "${CMAKE_CURRENT_BINARY_DIR}/xercesc/util/Xerces_autoconf_config.hpp" "${CMAKE_CURRENT_BINARY_DIR}/xercesc/util/XercesVersion.hpp" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/xercesc/util" COMPONENT "development") xerces-c-3.2.2/src/towupper.h000644 000765 000024 00000001767 13241160332 016676 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: towupper.h 631983 2008-02-28 14:30:15Z borisk $ */ #ifndef TOWUPPER_H #define TOWUPPER_H #ifdef __cplusplus extern "C" { #endif extern int towupper(int wc); #ifdef __cplusplus } #endif #endif xerces-c-3.2.2/src/towlower.h000644 000765 000024 00000001767 13241160332 016673 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: towlower.h 631983 2008-02-28 14:30:15Z borisk $ */ #ifndef TOWLOWER_H #define TOWLOWER_H #ifdef __cplusplus extern "C" { #endif extern int towlower(int wc); #ifdef __cplusplus } #endif #endif xerces-c-3.2.2/src/stricmp.h000644 000765 000024 00000002017 13241160332 016457 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: stricmp.h 673966 2008-07-04 08:59:34Z borisk $ */ #ifndef STRICMP_H #define STRICMP_H #ifdef __cplusplus extern "C" { #endif extern int stricmp(const char* str1, const char* str2); #ifdef __cplusplus } #endif #endif xerces-c-3.2.2/src/Makefile.am000644 000765 000024 00000122340 13345744023 016675 0ustar00scantorstaff000000 000000 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # # $Id: Makefile.am 1840539 2018-09-11 10:40:26Z rleigh $ # DEFS += -DXERCES_BUILDING_LIBRARY # # lib_LTLIBRARIES = libxerces-c.la # Use AM_* variables instead of per-target ones otherwise the # make pretty-printing won't work. # AM_CPPFLAGS = libxerces_c_la_LDFLAGS = -release @INTERFACE_VERSION_D@ # This sets {install}/include as target for the headers libxerces_c_ladir = ${includedir} libxerces_c_la_SOURCES = ${util_sources} ${dom_sources} ${domimpl_sources} \ ${framework_sources} ${internal_sources} ${parsers_sources} ${sax_sources} \ ${sax2_sources} ${validators_sources} ${xinclude_sources} nobase_libxerces_c_la_HEADERS = ${util_headers} ${dom_headers} \ ${domimpl_headers} ${framework_headers} ${internal_headers} \ ${parsers_headers} ${sax_headers} ${sax2_headers} ${validators_headers} \ ${xinclude_headers} # Make sure autoconf-generated Xerces_autoconf_config.hpp and # XercesVersion.hpp end up in a proper place when installed. # autoconfheadersdir = $(includedir)/xercesc/util nodist_autoconfheaders_HEADERS = \ ${top_builddir}/src/xercesc/util/Xerces_autoconf_config.hpp \ ${top_builddir}/src/xercesc/util/XercesVersion.hpp # Compatibility library. # EXTRA_DIST = CMakeLists.txt \ XercesCConfig.cmake.in \ stricmp.h strnicmp.h towlower.h towupper.h \ xercesc/NLS \ xercesc/util/Xerces_autoconf_config.hpp.cmake.in \ xercesc/util/XercesVersion.hpp.cmake.in \ xercesc/util/version.rc.cmake.in \ xercesc/util/MsgLoaders/ICU/resources libxerces_c_la_LIBADD = ${LTLIBOBJS} # NetAccessors, conditionally built based on settings from configure # if XERCES_USE_NETACCESSOR_CURL libxerces_c_la_SOURCES += ${curl_sources} nobase_libxerces_c_la_HEADERS += ${curl_headers} AM_CPPFLAGS += ${CURL_FLAGS} endif if XERCES_USE_NETACCESSOR_SOCKET libxerces_c_la_SOURCES += ${sockets_sources} nobase_libxerces_c_la_HEADERS += ${sockets_headers} endif if XERCES_USE_NETACCESSOR_CFURL libxerces_c_la_SOURCES += ${cfurl_sources} nobase_libxerces_c_la_HEADERS += ${cfurl_headers} endif if XERCES_USE_NETACCESSOR_WINSOCK libxerces_c_la_SOURCES += ${winsock_sources} nobase_libxerces_c_la_HEADERS += ${winsock_headers} endif # Transcoders, conditionally built based on settings from configure # if XERCES_USE_TRANSCODER_ICU libxerces_c_la_SOURCES += ${icu_sources} nobase_libxerces_c_la_HEADERS += ${icu_headers} AM_CPPFLAGS += ${ICU_FLAGS} endif if XERCES_USE_TRANSCODER_GNUICONV libxerces_c_la_SOURCES += ${gnuiconv_sources} nobase_libxerces_c_la_HEADERS += ${gnuiconv_headers} endif if XERCES_USE_TRANSCODER_ICONV libxerces_c_la_SOURCES += ${iconv_sources} nobase_libxerces_c_la_HEADERS += ${iconv_headers} endif if XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER libxerces_c_la_SOURCES += ${macosunicodeconverter_sources} nobase_libxerces_c_la_HEADERS += ${macosunicodeconverter_headers} endif if XERCES_USE_TRANSCODER_WINDOWS libxerces_c_la_SOURCES += ${wintrans_sources} nobase_libxerces_c_la_HEADERS += ${wintrans_headers} endif # MsgLoaders, conditionally built based on settings from configure # if XERCES_USE_MSGLOADER_INMEMORY libxerces_c_la_SOURCES += ${msginmemory_sources} nobase_libxerces_c_la_HEADERS += ${msginmemory_headers} endif if XERCES_USE_MSGLOADER_ICU libxerces_c_la_SOURCES += ${msgicu_sources} nodist_libxerces_c_la_SOURCES = ${msgicu_nodist_sources} nobase_libxerces_c_la_HEADERS += ${msgicu_headers} AM_CPPFLAGS += ${ICU_FLAGS} # Resource shortname PKGNAME=xercesc_messages_@INTERFACE_VERSION_U@ CLEANFILES = xercesc_messages.c root_res.c root.res BUILT_SOURCES = xercesc_messages.c root_res.c xercesc_messages.c: ${top_srcdir}/src/xercesc/util/MsgLoaders/ICU/resources/res-file-list.txt ${ICU_SBIN}gencmn --name ${PKGNAME} -S ${PKGNAME}_dat.c -d . ${top_srcdir}/src/xercesc/util/MsgLoaders/ICU/resources/res-file-list.txt @mv ${PKGNAME}_dat.c xercesc_messages.c root_res.c: ${top_srcdir}/src/xercesc/util/MsgLoaders/ICU/resources/root.txt ${ICU_BIN}genrb -d . ${top_srcdir}/src/xercesc/util/MsgLoaders/ICU/resources/root.txt ${ICU_SBIN}genccode --name ${PKGNAME} -d . root.res endif if XERCES_USE_MSGLOADER_ICONV libxerces_c_la_SOURCES += ${msgiconv_sources} nobase_libxerces_c_la_HEADERS += ${msgiconv_headers} # Resource shortname PKGNAME=XercesMessages # Resource file RESFILE=$(PKGNAME)_en_US.cat # Resources XercesMessages_en_US.cat: @srcdir@/xercesc/util/MsgLoaders/MsgCatalog/XercesMessages_en_US.Msg @echo "generating $@ from @srcdir@/xercesc/util/MsgLoaders/MsgCatalog/XercesMessages_en_US.Msg" gencat $@ @srcdir@/xercesc/util/MsgLoaders/MsgCatalog/XercesMessages_en_US.Msg iconv_msgdir=$(prefix)/msg iconv_msg_DATA = $(RESFILE) endif # Mutex Managers, conditionally built based on settings from configure # if XERCES_USE_MUTEXMGR_NOTHREAD libxerces_c_la_SOURCES += ${nothreadmmgr_sources} nobase_libxerces_c_la_HEADERS += ${nothreadmmgr_headers} endif if XERCES_USE_MUTEXMGR_STD libxerces_c_la_SOURCES += ${stdmmgr_sources} nobase_libxerces_c_la_HEADERS += ${stdmmgr_headers} endif if XERCES_USE_MUTEXMGR_POSIX libxerces_c_la_SOURCES += ${posixmmgr_sources} nobase_libxerces_c_la_HEADERS += ${posixmmgr_headers} endif if XERCES_USE_MUTEXMGR_WINDOWS libxerces_c_la_SOURCES += ${winmmgr_sources} nobase_libxerces_c_la_HEADERS += ${winmmgr_headers} endif # File Managers, conditionally built based on settings from configure # if XERCES_USE_FILEMGR_POSIX libxerces_c_la_SOURCES += ${posixfmgr_sources} nobase_libxerces_c_la_HEADERS += ${posixfmgr_headers} endif if XERCES_USE_FILEMGR_WINDOWS libxerces_c_la_SOURCES += ${winfmgr_sources} nobase_libxerces_c_la_HEADERS += ${winfmgr_headers} endif # # Definition of sources/headers for each convenience library # # # A line like the following will generate a list of headers # for a given directory: (must be issued from src directory) # find xercesc/framework -name '*.hpp' -exec echo {} \\ ";" # find xercesc/framework -name '*.cpp' -exec echo {} \\ ";" # dom_headers = \ xercesc/dom/DOM.hpp \ xercesc/dom/DOMAttr.hpp \ xercesc/dom/DOMCDATASection.hpp \ xercesc/dom/DOMCharacterData.hpp \ xercesc/dom/DOMComment.hpp \ xercesc/dom/DOMConfiguration.hpp \ xercesc/dom/DOMDocument.hpp \ xercesc/dom/DOMDocumentFragment.hpp \ xercesc/dom/DOMDocumentRange.hpp \ xercesc/dom/DOMDocumentTraversal.hpp \ xercesc/dom/DOMDocumentType.hpp \ xercesc/dom/DOMElement.hpp \ xercesc/dom/DOMEntity.hpp \ xercesc/dom/DOMEntityReference.hpp \ xercesc/dom/DOMError.hpp \ xercesc/dom/DOMErrorHandler.hpp \ xercesc/dom/DOMException.hpp \ xercesc/dom/DOMImplementation.hpp \ xercesc/dom/DOMImplementationList.hpp \ xercesc/dom/DOMImplementationLS.hpp \ xercesc/dom/DOMImplementationRegistry.hpp \ xercesc/dom/DOMImplementationSource.hpp \ xercesc/dom/DOMLocator.hpp \ xercesc/dom/DOMLSException.hpp \ xercesc/dom/DOMLSInput.hpp \ xercesc/dom/DOMLSOutput.hpp \ xercesc/dom/DOMLSParser.hpp \ xercesc/dom/DOMLSParserFilter.hpp \ xercesc/dom/DOMLSResourceResolver.hpp \ xercesc/dom/DOMLSSerializer.hpp \ xercesc/dom/DOMLSSerializerFilter.hpp \ xercesc/dom/DOMMemoryManager.hpp \ xercesc/dom/DOMNamedNodeMap.hpp \ xercesc/dom/DOMNode.hpp \ xercesc/dom/DOMNodeFilter.hpp \ xercesc/dom/DOMNodeIterator.hpp \ xercesc/dom/DOMNodeList.hpp \ xercesc/dom/DOMNotation.hpp \ xercesc/dom/DOMProcessingInstruction.hpp \ xercesc/dom/DOMPSVITypeInfo.hpp \ xercesc/dom/DOMRange.hpp \ xercesc/dom/DOMRangeException.hpp \ xercesc/dom/DOMStringList.hpp \ xercesc/dom/DOMText.hpp \ xercesc/dom/DOMTreeWalker.hpp \ xercesc/dom/DOMTypeInfo.hpp \ xercesc/dom/DOMUserDataHandler.hpp \ xercesc/dom/DOMXPathEvaluator.hpp \ xercesc/dom/DOMXPathException.hpp \ xercesc/dom/DOMXPathExpression.hpp \ xercesc/dom/DOMXPathNamespace.hpp \ xercesc/dom/DOMXPathNSResolver.hpp \ xercesc/dom/DOMXPathResult.hpp \ xercesc/dom/StDOMNode.hpp dom_sources = \ xercesc/dom/DOMException.cpp \ xercesc/dom/DOMLSException.cpp \ xercesc/dom/DOMRangeException.cpp \ xercesc/dom/DOMXPathException.cpp domimpl_headers = \ xercesc/dom/impl/DOMAttrImpl.hpp \ xercesc/dom/impl/DOMAttrMapImpl.hpp \ xercesc/dom/impl/DOMAttrNSImpl.hpp \ xercesc/dom/impl/DOMCasts.hpp \ xercesc/dom/impl/DOMCDATASectionImpl.hpp \ xercesc/dom/impl/DOMCharacterDataImpl.hpp \ xercesc/dom/impl/DOMChildNode.hpp \ xercesc/dom/impl/DOMCommentImpl.hpp \ xercesc/dom/impl/DOMConfigurationImpl.hpp \ xercesc/dom/impl/DOMDeepNodeListImpl.hpp \ xercesc/dom/impl/DOMDeepNodeListPool.hpp \ xercesc/dom/impl/DOMDeepNodeListPool.c \ xercesc/dom/impl/DOMDocumentFragmentImpl.hpp \ xercesc/dom/impl/DOMDocumentImpl.hpp \ xercesc/dom/impl/DOMDocumentTypeImpl.hpp \ xercesc/dom/impl/DOMElementImpl.hpp \ xercesc/dom/impl/DOMElementNSImpl.hpp \ xercesc/dom/impl/DOMEntityImpl.hpp \ xercesc/dom/impl/DOMEntityReferenceImpl.hpp \ xercesc/dom/impl/DOMErrorImpl.hpp \ xercesc/dom/impl/DOMImplementationImpl.hpp \ xercesc/dom/impl/DOMImplementationListImpl.hpp \ xercesc/dom/impl/DOMLocatorImpl.hpp \ xercesc/dom/impl/DOMNamedNodeMapImpl.hpp \ xercesc/dom/impl/DOMNodeBase.hpp \ xercesc/dom/impl/DOMNodeIDMap.hpp \ xercesc/dom/impl/DOMNodeImpl.hpp \ xercesc/dom/impl/DOMNodeIteratorImpl.hpp \ xercesc/dom/impl/DOMNodeListImpl.hpp \ xercesc/dom/impl/DOMNodeVector.hpp \ xercesc/dom/impl/DOMNormalizer.hpp \ xercesc/dom/impl/DOMNotationImpl.hpp \ xercesc/dom/impl/DOMParentNode.hpp \ xercesc/dom/impl/DOMProcessingInstructionImpl.hpp \ xercesc/dom/impl/DOMRangeImpl.hpp \ xercesc/dom/impl/DOMStringListImpl.hpp \ xercesc/dom/impl/DOMStringPool.hpp \ xercesc/dom/impl/DOMTextImpl.hpp \ xercesc/dom/impl/DOMTreeWalkerImpl.hpp \ xercesc/dom/impl/DOMTypeInfoImpl.hpp \ xercesc/dom/impl/DOMLSSerializerImpl.hpp \ xercesc/dom/impl/DOMLSInputImpl.hpp \ xercesc/dom/impl/DOMLSOutputImpl.hpp \ xercesc/dom/impl/DOMXPathExpressionImpl.hpp \ xercesc/dom/impl/DOMXPathNSResolverImpl.hpp \ xercesc/dom/impl/DOMXPathResultImpl.hpp \ xercesc/dom/impl/XSDElementNSImpl.hpp domimpl_sources = \ xercesc/dom/impl/DOMAttrImpl.cpp \ xercesc/dom/impl/DOMAttrMapImpl.cpp \ xercesc/dom/impl/DOMAttrNSImpl.cpp \ xercesc/dom/impl/DOMCDATASectionImpl.cpp \ xercesc/dom/impl/DOMCharacterDataImpl.cpp \ xercesc/dom/impl/DOMChildNode.cpp \ xercesc/dom/impl/DOMCommentImpl.cpp \ xercesc/dom/impl/DOMConfigurationImpl.cpp \ xercesc/dom/impl/DOMDeepNodeListImpl.cpp \ xercesc/dom/impl/DOMDocumentFragmentImpl.cpp \ xercesc/dom/impl/DOMDocumentImpl.cpp \ xercesc/dom/impl/DOMDocumentTypeImpl.cpp \ xercesc/dom/impl/DOMElementImpl.cpp \ xercesc/dom/impl/DOMElementNSImpl.cpp \ xercesc/dom/impl/DOMEntityImpl.cpp \ xercesc/dom/impl/DOMEntityReferenceImpl.cpp \ xercesc/dom/impl/DOMErrorImpl.cpp \ xercesc/dom/impl/DOMImplementationImpl.cpp \ xercesc/dom/impl/DOMImplementationListImpl.cpp \ xercesc/dom/impl/DOMImplementationRegistry.cpp \ xercesc/dom/impl/DOMLocatorImpl.cpp \ xercesc/dom/impl/DOMNamedNodeMapImpl.cpp \ xercesc/dom/impl/DOMNodeIDMap.cpp \ xercesc/dom/impl/DOMNodeImpl.cpp \ xercesc/dom/impl/DOMNodeIteratorImpl.cpp \ xercesc/dom/impl/DOMNodeListImpl.cpp \ xercesc/dom/impl/DOMNodeVector.cpp \ xercesc/dom/impl/DOMNormalizer.cpp \ xercesc/dom/impl/DOMNotationImpl.cpp \ xercesc/dom/impl/DOMParentNode.cpp \ xercesc/dom/impl/DOMProcessingInstructionImpl.cpp \ xercesc/dom/impl/DOMRangeImpl.cpp \ xercesc/dom/impl/DOMStringListImpl.cpp \ xercesc/dom/impl/DOMStringPool.cpp \ xercesc/dom/impl/DOMTextImpl.cpp \ xercesc/dom/impl/DOMTreeWalkerImpl.cpp \ xercesc/dom/impl/DOMTypeInfoImpl.cpp \ xercesc/dom/impl/DOMLSSerializerImpl.cpp \ xercesc/dom/impl/DOMLSInputImpl.cpp \ xercesc/dom/impl/DOMLSOutputImpl.cpp \ xercesc/dom/impl/DOMXPathExpressionImpl.cpp \ xercesc/dom/impl/DOMXPathNSResolverImpl.cpp \ xercesc/dom/impl/DOMXPathResultImpl.cpp \ xercesc/dom/impl/XSDElementNSImpl.cpp framework_headers = \ xercesc/framework/BinOutputStream.hpp \ xercesc/framework/LocalFileFormatTarget.hpp \ xercesc/framework/LocalFileInputSource.hpp \ xercesc/framework/MemBufFormatTarget.hpp \ xercesc/framework/MemBufInputSource.hpp \ xercesc/framework/MemoryManager.hpp \ xercesc/framework/psvi/PSVIAttribute.hpp \ xercesc/framework/psvi/PSVIAttributeList.hpp \ xercesc/framework/psvi/PSVIElement.hpp \ xercesc/framework/psvi/PSVIHandler.hpp \ xercesc/framework/psvi/PSVIItem.hpp \ xercesc/framework/psvi/XSAnnotation.hpp \ xercesc/framework/psvi/XSAttributeDeclaration.hpp \ xercesc/framework/psvi/XSAttributeGroupDefinition.hpp \ xercesc/framework/psvi/XSAttributeUse.hpp \ xercesc/framework/psvi/XSComplexTypeDefinition.hpp \ xercesc/framework/psvi/XSConstants.hpp \ xercesc/framework/psvi/XSElementDeclaration.hpp \ xercesc/framework/psvi/XSFacet.hpp \ xercesc/framework/psvi/XSIDCDefinition.hpp \ xercesc/framework/psvi/XSModel.hpp \ xercesc/framework/psvi/XSModelGroup.hpp \ xercesc/framework/psvi/XSModelGroupDefinition.hpp \ xercesc/framework/psvi/XSMultiValueFacet.hpp \ xercesc/framework/psvi/XSNamedMap.hpp \ xercesc/framework/psvi/XSNamedMap.c \ xercesc/framework/psvi/XSNamespaceItem.hpp \ xercesc/framework/psvi/XSNotationDeclaration.hpp \ xercesc/framework/psvi/XSObject.hpp \ xercesc/framework/psvi/XSParticle.hpp \ xercesc/framework/psvi/XSSimpleTypeDefinition.hpp \ xercesc/framework/psvi/XSTypeDefinition.hpp \ xercesc/framework/psvi/XSValue.hpp \ xercesc/framework/psvi/XSWildcard.hpp \ xercesc/framework/StdInInputSource.hpp \ xercesc/framework/StdOutFormatTarget.hpp \ xercesc/framework/URLInputSource.hpp \ xercesc/framework/ValidationContext.hpp \ xercesc/framework/Wrapper4DOMLSInput.hpp \ xercesc/framework/Wrapper4InputSource.hpp \ xercesc/framework/XMLAttDef.hpp \ xercesc/framework/XMLAttDefList.hpp \ xercesc/framework/XMLAttr.hpp \ xercesc/framework/XMLBuffer.hpp \ xercesc/framework/XMLBufferMgr.hpp \ xercesc/framework/XMLContentModel.hpp \ xercesc/framework/XMLDocumentHandler.hpp \ xercesc/framework/XMLDTDDescription.hpp \ xercesc/framework/XMLElementDecl.hpp \ xercesc/framework/XMLEntityDecl.hpp \ xercesc/framework/XMLEntityHandler.hpp \ xercesc/framework/XMLErrorCodes.hpp \ xercesc/framework/XMLErrorReporter.hpp \ xercesc/framework/XMLFormatter.hpp \ xercesc/framework/XMLGrammarDescription.hpp \ xercesc/framework/XMLGrammarPool.hpp \ xercesc/framework/XMLGrammarPoolImpl.hpp \ xercesc/framework/XMLNotationDecl.hpp \ xercesc/framework/XMLPScanToken.hpp \ xercesc/framework/XMLRecognizer.hpp \ xercesc/framework/XMLRefInfo.hpp \ xercesc/framework/XMLSchemaDescription.hpp \ xercesc/framework/XMLValidator.hpp \ xercesc/framework/XMLValidityCodes.hpp framework_sources = \ xercesc/framework/BinOutputStream.cpp \ xercesc/framework/LocalFileFormatTarget.cpp \ xercesc/framework/LocalFileInputSource.cpp \ xercesc/framework/MemBufFormatTarget.cpp \ xercesc/framework/MemBufInputSource.cpp \ xercesc/framework/psvi/PSVIAttribute.cpp \ xercesc/framework/psvi/PSVIAttributeList.cpp \ xercesc/framework/psvi/PSVIElement.cpp \ xercesc/framework/psvi/PSVIItem.cpp \ xercesc/framework/psvi/XSAnnotation.cpp \ xercesc/framework/psvi/XSAttributeDeclaration.cpp \ xercesc/framework/psvi/XSAttributeGroupDefinition.cpp \ xercesc/framework/psvi/XSAttributeUse.cpp \ xercesc/framework/psvi/XSComplexTypeDefinition.cpp \ xercesc/framework/psvi/XSElementDeclaration.cpp \ xercesc/framework/psvi/XSFacet.cpp \ xercesc/framework/psvi/XSIDCDefinition.cpp \ xercesc/framework/psvi/XSModel.cpp \ xercesc/framework/psvi/XSModelGroup.cpp \ xercesc/framework/psvi/XSModelGroupDefinition.cpp \ xercesc/framework/psvi/XSMultiValueFacet.cpp \ xercesc/framework/psvi/XSNamespaceItem.cpp \ xercesc/framework/psvi/XSNotationDeclaration.cpp \ xercesc/framework/psvi/XSObject.cpp \ xercesc/framework/psvi/XSParticle.cpp \ xercesc/framework/psvi/XSSimpleTypeDefinition.cpp \ xercesc/framework/psvi/XSTypeDefinition.cpp \ xercesc/framework/psvi/XSValue.cpp \ xercesc/framework/psvi/XSWildcard.cpp \ xercesc/framework/StdInInputSource.cpp \ xercesc/framework/StdOutFormatTarget.cpp \ xercesc/framework/URLInputSource.cpp \ xercesc/framework/Wrapper4DOMLSInput.cpp \ xercesc/framework/Wrapper4InputSource.cpp \ xercesc/framework/XMLAttDef.cpp \ xercesc/framework/XMLAttDefList.cpp \ xercesc/framework/XMLAttr.cpp \ xercesc/framework/XMLBuffer.cpp \ xercesc/framework/XMLBufferMgr.cpp \ xercesc/framework/XMLContentModel.cpp \ xercesc/framework/XMLDTDDescription.cpp \ xercesc/framework/XMLElementDecl.cpp \ xercesc/framework/XMLEntityDecl.cpp \ xercesc/framework/XMLFormatter.cpp \ xercesc/framework/XMLGrammarDescription.cpp \ xercesc/framework/XMLGrammarPoolImpl.cpp \ xercesc/framework/XMLNotationDecl.cpp \ xercesc/framework/XMLRecognizer.cpp \ xercesc/framework/XMLRefInfo.cpp \ xercesc/framework/XMLSchemaDescription.cpp \ xercesc/framework/XMLValidator.cpp internal_headers = \ xercesc/internal/BinFileOutputStream.hpp \ xercesc/internal/BinMemOutputStream.hpp \ xercesc/internal/CharTypeTables.hpp \ xercesc/internal/DGXMLScanner.hpp \ xercesc/internal/ElemStack.hpp \ xercesc/internal/EndOfEntityException.hpp \ xercesc/internal/IANAEncodings.hpp \ xercesc/internal/IGXMLScanner.hpp \ xercesc/internal/MemoryManagerImpl.hpp \ xercesc/internal/ReaderMgr.hpp \ xercesc/internal/SGXMLScanner.hpp \ xercesc/internal/ValidationContextImpl.hpp \ xercesc/internal/VecAttributesImpl.hpp \ xercesc/internal/VecAttrListImpl.hpp \ xercesc/internal/WFXMLScanner.hpp \ xercesc/internal/XMLInternalErrorHandler.hpp \ xercesc/internal/XMLReader.hpp \ xercesc/internal/XMLScanner.hpp \ xercesc/internal/XMLScannerResolver.hpp \ xercesc/internal/XProtoType.hpp \ xercesc/internal/XSAXMLScanner.hpp \ xercesc/internal/XSerializable.hpp \ xercesc/internal/XSerializationException.hpp \ xercesc/internal/XSerializeEngine.hpp \ xercesc/internal/XSObjectFactory.hpp \ xercesc/internal/XTemplateSerializer.hpp internal_sources = \ xercesc/internal/BinFileOutputStream.cpp \ xercesc/internal/BinMemOutputStream.cpp \ xercesc/internal/DGXMLScanner.cpp \ xercesc/internal/ElemStack.cpp \ xercesc/internal/IGXMLScanner.cpp \ xercesc/internal/IGXMLScanner2.cpp \ xercesc/internal/MemoryManagerImpl.cpp \ xercesc/internal/ReaderMgr.cpp \ xercesc/internal/SGXMLScanner.cpp \ xercesc/internal/ValidationContextImpl.cpp \ xercesc/internal/VecAttributesImpl.cpp \ xercesc/internal/VecAttrListImpl.cpp \ xercesc/internal/WFXMLScanner.cpp \ xercesc/internal/XMLReader.cpp \ xercesc/internal/XMLScanner.cpp \ xercesc/internal/XMLScannerResolver.cpp \ xercesc/internal/XProtoType.cpp \ xercesc/internal/XSAXMLScanner.cpp \ xercesc/internal/XSerializeEngine.cpp \ xercesc/internal/XSObjectFactory.cpp \ xercesc/internal/XTemplateSerializer.cpp parsers_headers = \ xercesc/parsers/AbstractDOMParser.hpp \ xercesc/parsers/DOMLSParserImpl.hpp \ xercesc/parsers/SAX2XMLFilterImpl.hpp \ xercesc/parsers/SAX2XMLReaderImpl.hpp \ xercesc/parsers/SAXParser.hpp \ xercesc/parsers/XercesDOMParser.hpp parsers_sources = \ xercesc/parsers/AbstractDOMParser.cpp \ xercesc/parsers/DOMLSParserImpl.cpp \ xercesc/parsers/SAX2XMLFilterImpl.cpp \ xercesc/parsers/SAX2XMLReaderImpl.cpp \ xercesc/parsers/SAXParser.cpp \ xercesc/parsers/XercesDOMParser.cpp sax_headers = \ xercesc/sax/AttributeList.hpp \ xercesc/sax/DocumentHandler.hpp \ xercesc/sax/DTDHandler.hpp \ xercesc/sax/EntityResolver.hpp \ xercesc/sax/ErrorHandler.hpp \ xercesc/sax/HandlerBase.hpp \ xercesc/sax/InputSource.hpp \ xercesc/sax/Locator.hpp \ xercesc/sax/Parser.hpp \ xercesc/sax/SAXException.hpp \ xercesc/sax/SAXParseException.hpp sax_sources = \ xercesc/sax/Dummy.cpp \ xercesc/sax/InputSource.cpp \ xercesc/sax/SAXException.cpp \ xercesc/sax/SAXParseException.cpp sax2_headers = \ xercesc/sax2/Attributes.hpp \ xercesc/sax2/ContentHandler.hpp \ xercesc/sax2/DeclHandler.hpp \ xercesc/sax2/DefaultHandler.hpp \ xercesc/sax2/LexicalHandler.hpp \ xercesc/sax2/SAX2XMLFilter.hpp \ xercesc/sax2/SAX2XMLReader.hpp \ xercesc/sax2/XMLReaderFactory.hpp sax2_sources = \ xercesc/sax2/sax2Dummy.cpp util_headers = \ xercesc/util/ArrayIndexOutOfBoundsException.hpp \ xercesc/util/Base64.hpp \ xercesc/util/BaseRefVectorOf.hpp \ xercesc/util/BaseRefVectorOf.c \ xercesc/util/BinFileInputStream.hpp \ xercesc/util/BinInputStream.hpp \ xercesc/util/BinMemInputStream.hpp \ xercesc/util/BitOps.hpp \ xercesc/util/BitSet.hpp \ xercesc/util/CountedPointer.hpp \ xercesc/util/CountedPointer.c \ xercesc/util/DefaultPanicHandler.hpp \ xercesc/util/EmptyStackException.hpp \ xercesc/util/EncodingValidator.hpp \ xercesc/util/FlagJanitor.hpp \ xercesc/util/FlagJanitor.c \ xercesc/util/Hashers.hpp \ xercesc/util/Hash2KeysSetOf.hpp \ xercesc/util/Hash2KeysSetOf.c \ xercesc/util/HexBin.hpp \ xercesc/util/IllegalArgumentException.hpp \ xercesc/util/InvalidCastException.hpp \ xercesc/util/IOException.hpp \ xercesc/util/Janitor.hpp \ xercesc/util/Janitor.c \ xercesc/util/KeyRefPair.hpp \ xercesc/util/KeyRefPair.c \ xercesc/util/KeyValuePair.hpp \ xercesc/util/KeyValuePair.c \ xercesc/util/KVStringPair.hpp \ xercesc/util/Mutexes.hpp \ xercesc/util/LogicalPath.c \ xercesc/util/NameIdPool.hpp \ xercesc/util/NameIdPool.c \ xercesc/util/NoSuchElementException.hpp \ xercesc/util/NullPointerException.hpp \ xercesc/util/NumberFormatException.hpp \ xercesc/util/OutOfMemoryException.hpp \ xercesc/util/PanicHandler.hpp \ xercesc/util/ParseException.hpp \ xercesc/util/PlatformUtils.hpp \ xercesc/util/PSVIUni.hpp \ xercesc/util/QName.hpp \ xercesc/util/RefArrayOf.hpp \ xercesc/util/RefArrayOf.c \ xercesc/util/RefArrayVectorOf.hpp \ xercesc/util/RefArrayVectorOf.c \ xercesc/util/RefHash2KeysTableOf.hpp \ xercesc/util/RefHash2KeysTableOf.c \ xercesc/util/RefHash3KeysIdPool.hpp \ xercesc/util/RefHash3KeysIdPool.c \ xercesc/util/RefHashTableOf.hpp \ xercesc/util/RefHashTableOf.c \ xercesc/util/RefStackOf.hpp \ xercesc/util/RefStackOf.c \ xercesc/util/RefVectorOf.hpp \ xercesc/util/RefVectorOf.c \ xercesc/util/regx/ASCIIRangeFactory.hpp \ xercesc/util/regx/BlockRangeFactory.hpp \ xercesc/util/regx/BMPattern.hpp \ xercesc/util/regx/CharToken.hpp \ xercesc/util/regx/ClosureToken.hpp \ xercesc/util/regx/ConcatToken.hpp \ xercesc/util/regx/Match.hpp \ xercesc/util/regx/Op.hpp \ xercesc/util/regx/OpFactory.hpp \ xercesc/util/regx/ParenToken.hpp \ xercesc/util/regx/ParserForXMLSchema.hpp \ xercesc/util/regx/RangeFactory.hpp \ xercesc/util/regx/RangeToken.hpp \ xercesc/util/regx/RangeTokenMap.hpp \ xercesc/util/regx/RegularExpression.hpp \ xercesc/util/regx/RegxDefs.hpp \ xercesc/util/regx/RegxParser.hpp \ xercesc/util/regx/RegxUtil.hpp \ xercesc/util/regx/StringToken.hpp \ xercesc/util/regx/Token.hpp \ xercesc/util/regx/TokenFactory.hpp \ xercesc/util/regx/TokenInc.hpp \ xercesc/util/regx/UniCharTable.hpp \ xercesc/util/regx/UnicodeRangeFactory.hpp \ xercesc/util/regx/UnionToken.hpp \ xercesc/util/regx/XMLRangeFactory.hpp \ xercesc/util/regx/XMLUniCharacter.hpp \ xercesc/util/RuntimeException.hpp \ xercesc/util/SchemaDateTimeException.hpp \ xercesc/util/SecurityManager.hpp \ xercesc/util/StringPool.hpp \ xercesc/util/SynchronizedStringPool.hpp \ xercesc/util/TranscodingException.hpp \ xercesc/util/TransENameMap.hpp \ xercesc/util/TransENameMap.c \ xercesc/util/TransService.hpp \ xercesc/util/UnexpectedEOFException.hpp \ xercesc/util/UnsupportedEncodingException.hpp \ xercesc/util/UTFDataFormatException.hpp \ xercesc/util/ValueArrayOf.hpp \ xercesc/util/ValueArrayOf.c \ xercesc/util/ValueHashTableOf.hpp \ xercesc/util/ValueHashTableOf.c \ xercesc/util/ValueStackOf.hpp \ xercesc/util/ValueStackOf.c \ xercesc/util/ValueVectorOf.hpp \ xercesc/util/ValueVectorOf.c \ xercesc/util/XercesDefs.hpp \ xercesc/util/XMemory.hpp \ xercesc/util/XML256TableTranscoder.hpp \ xercesc/util/XML88591Transcoder.hpp \ xercesc/util/XMLAbstractDoubleFloat.hpp \ xercesc/util/XMLASCIITranscoder.hpp \ xercesc/util/XMLBigDecimal.hpp \ xercesc/util/XMLBigInteger.hpp \ xercesc/util/XMLChar.hpp \ xercesc/util/XMLChTranscoder.hpp \ xercesc/util/XMLDateTime.hpp \ xercesc/util/XMLDOMMsg.hpp \ xercesc/util/XMLDouble.hpp \ xercesc/util/XMLEBCDICTranscoder.hpp \ xercesc/util/XMLEntityResolver.hpp \ xercesc/util/XMLEnumerator.hpp \ xercesc/util/XMLException.hpp \ xercesc/util/XMLExceptMsgs.hpp \ xercesc/util/XMLFileMgr.hpp \ xercesc/util/XMLFloat.hpp \ xercesc/util/XMLIBM1047Transcoder.hpp \ xercesc/util/XMLIBM1140Transcoder.hpp \ xercesc/util/XMLInitializer.hpp \ xercesc/util/XMLInteger.hpp \ xercesc/util/XMLMutexMgr.hpp \ xercesc/util/XMLMsgLoader.hpp \ xercesc/util/XMLNetAccessor.hpp \ xercesc/util/XMLNumber.hpp \ xercesc/util/XMLResourceIdentifier.hpp \ xercesc/util/XMLString.hpp \ xercesc/util/XMLStringTokenizer.hpp \ xercesc/util/XMLUCS4Transcoder.hpp \ xercesc/util/XMLUni.hpp \ xercesc/util/XMLUniDefs.hpp \ xercesc/util/XMLUri.hpp \ xercesc/util/XMLURL.hpp \ xercesc/util/XMLUTF16Transcoder.hpp \ xercesc/util/XMLUTF8Transcoder.hpp \ xercesc/util/XMLWin1252Transcoder.hpp util_sources = \ xercesc/util/Base64.cpp \ xercesc/util/BinFileInputStream.cpp \ xercesc/util/BinInputStream.cpp \ xercesc/util/BinMemInputStream.cpp \ xercesc/util/BitSet.cpp \ xercesc/util/DefaultPanicHandler.cpp \ xercesc/util/EncodingValidator.cpp \ xercesc/util/HeaderDummy.cpp \ xercesc/util/HexBin.cpp \ xercesc/util/JanitorExports.cpp \ xercesc/util/KVStringPair.cpp \ xercesc/util/Mutexes.cpp \ xercesc/util/PanicHandler.cpp \ xercesc/util/PlatformUtils.cpp \ xercesc/util/PSVIUni.cpp \ xercesc/util/QName.cpp \ xercesc/util/regx/ASCIIRangeFactory.cpp \ xercesc/util/regx/BlockRangeFactory.cpp \ xercesc/util/regx/BMPattern.cpp \ xercesc/util/regx/CharToken.cpp \ xercesc/util/regx/ClosureToken.cpp \ xercesc/util/regx/ConcatToken.cpp \ xercesc/util/regx/Match.cpp \ xercesc/util/regx/Op.cpp \ xercesc/util/regx/OpFactory.cpp \ xercesc/util/regx/ParenToken.cpp \ xercesc/util/regx/ParserForXMLSchema.cpp \ xercesc/util/regx/RangeFactory.cpp \ xercesc/util/regx/RangeToken.cpp \ xercesc/util/regx/RangeTokenMap.cpp \ xercesc/util/regx/RegularExpression.cpp \ xercesc/util/regx/RegxParser.cpp \ xercesc/util/regx/RegxUtil.cpp \ xercesc/util/regx/StringToken.cpp \ xercesc/util/regx/Token.cpp \ xercesc/util/regx/TokenFactory.cpp \ xercesc/util/regx/UnicodeRangeFactory.cpp \ xercesc/util/regx/UnionToken.cpp \ xercesc/util/regx/XMLRangeFactory.cpp \ xercesc/util/regx/XMLUniCharacter.cpp \ xercesc/util/StringPool.cpp \ xercesc/util/SynchronizedStringPool.cpp \ xercesc/util/TransService.cpp \ xercesc/util/XMemory.cpp \ xercesc/util/XML256TableTranscoder.cpp \ xercesc/util/XML88591Transcoder.cpp \ xercesc/util/XMLAbstractDoubleFloat.cpp \ xercesc/util/XMLASCIITranscoder.cpp \ xercesc/util/XMLBigDecimal.cpp \ xercesc/util/XMLBigInteger.cpp \ xercesc/util/XMLChar.cpp \ xercesc/util/XMLChTranscoder.cpp \ xercesc/util/XMLDateTime.cpp \ xercesc/util/XMLDouble.cpp \ xercesc/util/XMLEBCDICTranscoder.cpp \ xercesc/util/XMLException.cpp \ xercesc/util/XMLFloat.cpp \ xercesc/util/XMLIBM1047Transcoder.cpp \ xercesc/util/XMLIBM1140Transcoder.cpp \ xercesc/util/XMLInitializer.cpp \ xercesc/util/XMLMsgLoader.cpp \ xercesc/util/XMLNumber.cpp \ xercesc/util/XMLString.cpp \ xercesc/util/XMLStringTokenizer.cpp \ xercesc/util/XMLUCS4Transcoder.cpp \ xercesc/util/XMLUni.cpp \ xercesc/util/XMLUri.cpp \ xercesc/util/XMLURL.cpp \ xercesc/util/XMLUTF16Transcoder.cpp \ xercesc/util/XMLUTF8Transcoder.cpp \ xercesc/util/XMLWin1252Transcoder.cpp validators_headers = \ xercesc/validators/common/AllContentModel.hpp \ xercesc/validators/common/CMAny.hpp \ xercesc/validators/common/CMBinaryOp.hpp \ xercesc/validators/common/CMLeaf.hpp \ xercesc/validators/common/CMRepeatingLeaf.hpp \ xercesc/validators/common/CMNode.hpp \ xercesc/validators/common/CMStateSet.hpp \ xercesc/validators/common/CMUnaryOp.hpp \ xercesc/validators/common/ContentLeafNameTypeVector.hpp \ xercesc/validators/common/ContentSpecNode.hpp \ xercesc/validators/common/DFAContentModel.hpp \ xercesc/validators/common/Grammar.hpp \ xercesc/validators/common/GrammarResolver.hpp \ xercesc/validators/common/MixedContentModel.hpp \ xercesc/validators/common/SimpleContentModel.hpp \ xercesc/validators/datatype/AbstractNumericFacetValidator.hpp \ xercesc/validators/datatype/AbstractNumericValidator.hpp \ xercesc/validators/datatype/AbstractStringValidator.hpp \ xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.hpp \ xercesc/validators/datatype/AnyURIDatatypeValidator.hpp \ xercesc/validators/datatype/Base64BinaryDatatypeValidator.hpp \ xercesc/validators/datatype/BooleanDatatypeValidator.hpp \ xercesc/validators/datatype/DatatypeValidator.hpp \ xercesc/validators/datatype/DatatypeValidatorFactory.hpp \ xercesc/validators/datatype/DateDatatypeValidator.hpp \ xercesc/validators/datatype/DateTimeDatatypeValidator.hpp \ xercesc/validators/datatype/DateTimeValidator.hpp \ xercesc/validators/datatype/DayDatatypeValidator.hpp \ xercesc/validators/datatype/DecimalDatatypeValidator.hpp \ xercesc/validators/datatype/DoubleDatatypeValidator.hpp \ xercesc/validators/datatype/DurationDatatypeValidator.hpp \ xercesc/validators/datatype/ENTITYDatatypeValidator.hpp \ xercesc/validators/datatype/FloatDatatypeValidator.hpp \ xercesc/validators/datatype/HexBinaryDatatypeValidator.hpp \ xercesc/validators/datatype/IDDatatypeValidator.hpp \ xercesc/validators/datatype/IDREFDatatypeValidator.hpp \ xercesc/validators/datatype/InvalidDatatypeFacetException.hpp \ xercesc/validators/datatype/InvalidDatatypeValueException.hpp \ xercesc/validators/datatype/ListDatatypeValidator.hpp \ xercesc/validators/datatype/MonthDatatypeValidator.hpp \ xercesc/validators/datatype/MonthDayDatatypeValidator.hpp \ xercesc/validators/datatype/NameDatatypeValidator.hpp \ xercesc/validators/datatype/NCNameDatatypeValidator.hpp \ xercesc/validators/datatype/NOTATIONDatatypeValidator.hpp \ xercesc/validators/datatype/QNameDatatypeValidator.hpp \ xercesc/validators/datatype/StringDatatypeValidator.hpp \ xercesc/validators/datatype/TimeDatatypeValidator.hpp \ xercesc/validators/datatype/UnionDatatypeValidator.hpp \ xercesc/validators/datatype/XMLCanRepGroup.hpp \ xercesc/validators/datatype/YearDatatypeValidator.hpp \ xercesc/validators/datatype/YearMonthDatatypeValidator.hpp \ xercesc/validators/DTD/DocTypeHandler.hpp \ xercesc/validators/DTD/DTDAttDef.hpp \ xercesc/validators/DTD/DTDAttDefList.hpp \ xercesc/validators/DTD/DTDElementDecl.hpp \ xercesc/validators/DTD/DTDEntityDecl.hpp \ xercesc/validators/DTD/DTDGrammar.hpp \ xercesc/validators/DTD/DTDScanner.hpp \ xercesc/validators/DTD/DTDValidator.hpp \ xercesc/validators/DTD/XMLDTDDescriptionImpl.hpp \ xercesc/validators/schema/ComplexTypeInfo.hpp \ xercesc/validators/schema/GeneralAttributeCheck.hpp \ xercesc/validators/schema/identity/FieldActivator.hpp \ xercesc/validators/schema/identity/FieldValueMap.hpp \ xercesc/validators/schema/identity/IC_Field.hpp \ xercesc/validators/schema/identity/IC_Key.hpp \ xercesc/validators/schema/identity/IC_KeyRef.hpp \ xercesc/validators/schema/identity/IC_Selector.hpp \ xercesc/validators/schema/identity/IC_Unique.hpp \ xercesc/validators/schema/identity/IdentityConstraint.hpp \ xercesc/validators/schema/identity/IdentityConstraintHandler.hpp \ xercesc/validators/schema/identity/ValueStore.hpp \ xercesc/validators/schema/identity/ValueStoreCache.hpp \ xercesc/validators/schema/identity/XercesXPath.hpp \ xercesc/validators/schema/identity/XPathException.hpp \ xercesc/validators/schema/identity/XPathMatcher.hpp \ xercesc/validators/schema/identity/XPathMatcherStack.hpp \ xercesc/validators/schema/identity/XPathSymbols.hpp \ xercesc/validators/schema/NamespaceScope.hpp \ xercesc/validators/schema/PSVIDefs.hpp \ xercesc/validators/schema/SchemaAttDef.hpp \ xercesc/validators/schema/SchemaAttDefList.hpp \ xercesc/validators/schema/SchemaElementDecl.hpp \ xercesc/validators/schema/SchemaGrammar.hpp \ xercesc/validators/schema/SchemaInfo.hpp \ xercesc/validators/schema/SchemaSymbols.hpp \ xercesc/validators/schema/SchemaValidator.hpp \ xercesc/validators/schema/SubstitutionGroupComparator.hpp \ xercesc/validators/schema/TraverseSchema.hpp \ xercesc/validators/schema/XercesAttGroupInfo.hpp \ xercesc/validators/schema/XercesElementWildcard.hpp \ xercesc/validators/schema/XercesGroupInfo.hpp \ xercesc/validators/schema/XMLSchemaDescriptionImpl.hpp \ xercesc/validators/schema/XSDDOMParser.hpp \ xercesc/validators/schema/XSDErrorReporter.hpp \ xercesc/validators/schema/XSDLocator.hpp \ xercesc/validators/schema/XUtil.hpp validators_sources = \ xercesc/validators/common/AllContentModel.cpp \ xercesc/validators/common/CMAny.cpp \ xercesc/validators/common/CMBinaryOp.cpp \ xercesc/validators/common/CMUnaryOp.cpp \ xercesc/validators/common/ContentLeafNameTypeVector.cpp \ xercesc/validators/common/ContentSpecNode.cpp \ xercesc/validators/common/DFAContentModel.cpp \ xercesc/validators/common/Grammar.cpp \ xercesc/validators/common/GrammarResolver.cpp \ xercesc/validators/common/MixedContentModel.cpp \ xercesc/validators/common/SimpleContentModel.cpp \ xercesc/validators/datatype/AbstractNumericFacetValidator.cpp \ xercesc/validators/datatype/AbstractNumericValidator.cpp \ xercesc/validators/datatype/AbstractStringValidator.cpp \ xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.cpp \ xercesc/validators/datatype/AnyURIDatatypeValidator.cpp \ xercesc/validators/datatype/Base64BinaryDatatypeValidator.cpp \ xercesc/validators/datatype/BooleanDatatypeValidator.cpp \ xercesc/validators/datatype/DatatypeValidator.cpp \ xercesc/validators/datatype/DatatypeValidatorFactory.cpp \ xercesc/validators/datatype/DateDatatypeValidator.cpp \ xercesc/validators/datatype/DateTimeDatatypeValidator.cpp \ xercesc/validators/datatype/DateTimeValidator.cpp \ xercesc/validators/datatype/DayDatatypeValidator.cpp \ xercesc/validators/datatype/DecimalDatatypeValidator.cpp \ xercesc/validators/datatype/DoubleDatatypeValidator.cpp \ xercesc/validators/datatype/DurationDatatypeValidator.cpp \ xercesc/validators/datatype/ENTITYDatatypeValidator.cpp \ xercesc/validators/datatype/FloatDatatypeValidator.cpp \ xercesc/validators/datatype/HexBinaryDatatypeValidator.cpp \ xercesc/validators/datatype/IDDatatypeValidator.cpp \ xercesc/validators/datatype/IDREFDatatypeValidator.cpp \ xercesc/validators/datatype/ListDatatypeValidator.cpp \ xercesc/validators/datatype/MonthDatatypeValidator.cpp \ xercesc/validators/datatype/MonthDayDatatypeValidator.cpp \ xercesc/validators/datatype/NameDatatypeValidator.cpp \ xercesc/validators/datatype/NCNameDatatypeValidator.cpp \ xercesc/validators/datatype/NOTATIONDatatypeValidator.cpp \ xercesc/validators/datatype/QNameDatatypeValidator.cpp \ xercesc/validators/datatype/StringDatatypeValidator.cpp \ xercesc/validators/datatype/TimeDatatypeValidator.cpp \ xercesc/validators/datatype/UnionDatatypeValidator.cpp \ xercesc/validators/datatype/XMLCanRepGroup.cpp \ xercesc/validators/datatype/YearDatatypeValidator.cpp \ xercesc/validators/datatype/YearMonthDatatypeValidator.cpp \ xercesc/validators/DTD/DTDAttDef.cpp \ xercesc/validators/DTD/DTDAttDefList.cpp \ xercesc/validators/DTD/DTDElementDecl.cpp \ xercesc/validators/DTD/DTDEntityDecl.cpp \ xercesc/validators/DTD/DTDGrammar.cpp \ xercesc/validators/DTD/DTDScanner.cpp \ xercesc/validators/DTD/DTDValidator.cpp \ xercesc/validators/DTD/XMLDTDDescriptionImpl.cpp \ xercesc/validators/schema/ComplexTypeInfo.cpp \ xercesc/validators/schema/GeneralAttributeCheck.cpp \ xercesc/validators/schema/identity/FieldActivator.cpp \ xercesc/validators/schema/identity/FieldValueMap.cpp \ xercesc/validators/schema/identity/IC_Field.cpp \ xercesc/validators/schema/identity/IC_Key.cpp \ xercesc/validators/schema/identity/IC_KeyRef.cpp \ xercesc/validators/schema/identity/IC_Selector.cpp \ xercesc/validators/schema/identity/IC_Unique.cpp \ xercesc/validators/schema/identity/IdentityConstraint.cpp \ xercesc/validators/schema/identity/IdentityConstraintHandler.cpp \ xercesc/validators/schema/identity/ValueStore.cpp \ xercesc/validators/schema/identity/ValueStoreCache.cpp \ xercesc/validators/schema/identity/XercesXPath.cpp \ xercesc/validators/schema/identity/XPathMatcher.cpp \ xercesc/validators/schema/identity/XPathMatcherStack.cpp \ xercesc/validators/schema/identity/XPathSymbols.cpp \ xercesc/validators/schema/NamespaceScope.cpp \ xercesc/validators/schema/SchemaAttDef.cpp \ xercesc/validators/schema/SchemaAttDefList.cpp \ xercesc/validators/schema/SchemaElementDecl.cpp \ xercesc/validators/schema/SchemaGrammar.cpp \ xercesc/validators/schema/SchemaInfo.cpp \ xercesc/validators/schema/SchemaSymbols.cpp \ xercesc/validators/schema/SchemaValidator.cpp \ xercesc/validators/schema/SubstitutionGroupComparator.cpp \ xercesc/validators/schema/TraverseSchema.cpp \ xercesc/validators/schema/XercesAttGroupInfo.cpp \ xercesc/validators/schema/XercesElementWildcard.cpp \ xercesc/validators/schema/XercesGroupInfo.cpp \ xercesc/validators/schema/XMLSchemaDescriptionImpl.cpp \ xercesc/validators/schema/XSDDOMParser.cpp \ xercesc/validators/schema/XSDErrorReporter.cpp \ xercesc/validators/schema/XSDLocator.cpp \ xercesc/validators/schema/XUtil.cpp xinclude_headers = \ xercesc/xinclude/XIncludeDOMDocumentProcessor.hpp \ xercesc/xinclude/XIncludeLocation.hpp \ xercesc/xinclude/XIncludeUtils.hpp xinclude_sources = \ xercesc/xinclude/XIncludeDOMDocumentProcessor.cpp \ xercesc/xinclude/XIncludeLocation.cpp \ xercesc/xinclude/XIncludeUtils.cpp icu_headers = \ xercesc/util/Transcoders/ICU/ICUTransService.hpp icu_sources = \ xercesc/util/Transcoders/ICU/ICUTransService.cpp gnuiconv_headers = \ xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.hpp gnuiconv_sources = \ xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp iconv_headers = \ xercesc/util/Transcoders/Iconv/IconvTransService.hpp iconv_sources = \ xercesc/util/Transcoders/Iconv/IconvTransService.cpp macosunicodeconverter_headers = \ xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp macosunicodeconverter_sources = \ xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp wintrans_headers = \ xercesc/util/Transcoders/Win32/Win32TransService.hpp wintrans_sources = \ xercesc/util/Transcoders/Win32/Win32TransService.cpp curl_headers = \ xercesc/util/NetAccessors/Curl/CurlNetAccessor.hpp \ xercesc/util/NetAccessors/Curl/CurlURLInputStream.hpp curl_sources = \ xercesc/util/NetAccessors/Curl/CurlNetAccessor.cpp \ xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp sockets_headers = \ xercesc/util/NetAccessors/Socket/SocketNetAccessor.hpp \ xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.hpp \ xercesc/util/NetAccessors/BinHTTPInputStreamCommon.hpp sockets_sources = \ xercesc/util/NetAccessors/Socket/SocketNetAccessor.cpp \ xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp \ xercesc/util/NetAccessors/BinHTTPInputStreamCommon.cpp cfurl_headers = \ xercesc/util/NetAccessors/MacOSURLAccessCF/MacOSURLAccessCF.hpp \ xercesc/util/NetAccessors/MacOSURLAccessCF/URLAccessCFBinInputStream.hpp cfurl_sources = \ xercesc/util/NetAccessors/MacOSURLAccessCF/MacOSURLAccessCF.cpp \ xercesc/util/NetAccessors/MacOSURLAccessCF/URLAccessCFBinInputStream.cpp winsock_headers = \ xercesc/util/NetAccessors/WinSock/WinSockNetAccessor.hpp \ xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.hpp \ xercesc/util/NetAccessors/BinHTTPInputStreamCommon.hpp winsock_sources = \ xercesc/util/NetAccessors/WinSock/WinSockNetAccessor.cpp \ xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp \ xercesc/util/NetAccessors/BinHTTPInputStreamCommon.cpp msginmemory_headers = \ xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.hpp \ xercesc/util/MsgLoaders/InMemory/XercesMessages_en_US.hpp msginmemory_sources = \ xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp msgicu_headers = \ xercesc/util/MsgLoaders/ICU/ICUMsgLoader.hpp msgicu_sources = \ xercesc/util/MsgLoaders/ICU/ICUMsgLoader.cpp msgicu_nodist_sources = \ xercesc_messages.c \ root_res.c msgiconv_headers = \ xercesc/util/MsgLoaders/MsgCatalog/MsgCatalogLoader.hpp \ xercesc/util/MsgLoaders/MsgCatalog/XMLMsgCat_Ids.hpp msgiconv_sources = \ xercesc/util/MsgLoaders/MsgCatalog/MsgCatalogLoader.cpp posixfmgr_headers = \ xercesc/util/FileManagers/PosixFileMgr.hpp posixfmgr_sources = \ xercesc/util/FileManagers/PosixFileMgr.cpp winfmgr_headers = \ xercesc/util/FileManagers/WindowsFileMgr.hpp winfmgr_sources = \ xercesc/util/FileManagers/WindowsFileMgr.cpp nothreadmmgr_headers = \ xercesc/util/MutexManagers/NoThreadMutexMgr.hpp nothreadmmgr_sources = \ xercesc/util/MutexManagers/NoThreadMutexMgr.cpp stdmmgr_headers = \ xercesc/util/MutexManagers/StdMutexMgr.hpp stdmmgr_sources = \ xercesc/util/MutexManagers/StdMutexMgr.cpp posixmmgr_headers = \ xercesc/util/MutexManagers/PosixMutexMgr.hpp posixmmgr_sources = \ xercesc/util/MutexManagers/PosixMutexMgr.cpp winmmgr_headers = \ xercesc/util/MutexManagers/WindowsMutexMgr.hpp winmmgr_sources = \ xercesc/util/MutexManagers/WindowsMutexMgr.cpp xerces-c-3.2.2/src/strnicmp.c000644 000765 000024 00000002320 13241160332 016625 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: strnicmp.c 679398 2008-07-24 12:52:20Z borisk $ */ #include "strnicmp.h" #include "config.h" #if HAVE_STRING_H # include #endif #if HAVE_STRINGS_H # include #endif int strnicmp(const char* str1, const char* str2, size_t count) { #if HAVE_STRNCASECMP return (count == 0) ? 0 : strncasecmp( str1, str2, count); #else #error Need implementation of strnicmp compatibility function #endif } xerces-c-3.2.2/src/towupper.c000644 000765 000024 00000001731 13241160332 016660 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: towupper.c 631983 2008-02-28 14:30:15Z borisk $ */ #include "towupper.h" int towupper(int c) { return (c >= 'a') && (c <= 'z') ? c - 'a' + 'A' : c ; } xerces-c-3.2.2/src/xercesc/000755 000765 000024 00000000000 13345765734 016307 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/towlower.c000644 000765 000024 00000001735 13241160332 016661 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: towlower.c 631983 2008-02-28 14:30:15Z borisk $ */ #include "towlower.h" int towlower(int wc) { return (wc >= 'A') && (wc <= 'Z') ? wc + 'a' - 'A' : wc ; } xerces-c-3.2.2/src/Makefile.in000644 000765 000024 00001031205 13345744067 016716 0ustar00scantorstaff000000 000000 # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # # $Id: Makefile.am 1840539 2018-09-11 10:40:26Z rleigh $ # VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ # NetAccessors, conditionally built based on settings from configure # @XERCES_USE_NETACCESSOR_CURL_TRUE@am__append_1 = ${curl_sources} @XERCES_USE_NETACCESSOR_CURL_TRUE@am__append_2 = ${curl_headers} @XERCES_USE_NETACCESSOR_CURL_TRUE@am__append_3 = ${CURL_FLAGS} @XERCES_USE_NETACCESSOR_SOCKET_TRUE@am__append_4 = ${sockets_sources} @XERCES_USE_NETACCESSOR_SOCKET_TRUE@am__append_5 = ${sockets_headers} @XERCES_USE_NETACCESSOR_CFURL_TRUE@am__append_6 = ${cfurl_sources} @XERCES_USE_NETACCESSOR_CFURL_TRUE@am__append_7 = ${cfurl_headers} @XERCES_USE_NETACCESSOR_WINSOCK_TRUE@am__append_8 = ${winsock_sources} @XERCES_USE_NETACCESSOR_WINSOCK_TRUE@am__append_9 = ${winsock_headers} # Transcoders, conditionally built based on settings from configure # @XERCES_USE_TRANSCODER_ICU_TRUE@am__append_10 = ${icu_sources} @XERCES_USE_TRANSCODER_ICU_TRUE@am__append_11 = ${icu_headers} @XERCES_USE_TRANSCODER_ICU_TRUE@am__append_12 = ${ICU_FLAGS} @XERCES_USE_TRANSCODER_GNUICONV_TRUE@am__append_13 = ${gnuiconv_sources} @XERCES_USE_TRANSCODER_GNUICONV_TRUE@am__append_14 = ${gnuiconv_headers} @XERCES_USE_TRANSCODER_ICONV_TRUE@am__append_15 = ${iconv_sources} @XERCES_USE_TRANSCODER_ICONV_TRUE@am__append_16 = ${iconv_headers} @XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER_TRUE@am__append_17 = ${macosunicodeconverter_sources} @XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER_TRUE@am__append_18 = ${macosunicodeconverter_headers} @XERCES_USE_TRANSCODER_WINDOWS_TRUE@am__append_19 = ${wintrans_sources} @XERCES_USE_TRANSCODER_WINDOWS_TRUE@am__append_20 = ${wintrans_headers} # MsgLoaders, conditionally built based on settings from configure # @XERCES_USE_MSGLOADER_INMEMORY_TRUE@am__append_21 = ${msginmemory_sources} @XERCES_USE_MSGLOADER_INMEMORY_TRUE@am__append_22 = ${msginmemory_headers} @XERCES_USE_MSGLOADER_ICU_TRUE@am__append_23 = ${msgicu_sources} @XERCES_USE_MSGLOADER_ICU_TRUE@am__append_24 = ${msgicu_headers} @XERCES_USE_MSGLOADER_ICU_TRUE@am__append_25 = ${ICU_FLAGS} @XERCES_USE_MSGLOADER_ICONV_TRUE@am__append_26 = ${msgiconv_sources} @XERCES_USE_MSGLOADER_ICONV_TRUE@am__append_27 = ${msgiconv_headers} # Mutex Managers, conditionally built based on settings from configure # @XERCES_USE_MUTEXMGR_NOTHREAD_TRUE@am__append_28 = ${nothreadmmgr_sources} @XERCES_USE_MUTEXMGR_NOTHREAD_TRUE@am__append_29 = ${nothreadmmgr_headers} @XERCES_USE_MUTEXMGR_STD_TRUE@am__append_30 = ${stdmmgr_sources} @XERCES_USE_MUTEXMGR_STD_TRUE@am__append_31 = ${stdmmgr_headers} @XERCES_USE_MUTEXMGR_POSIX_TRUE@am__append_32 = ${posixmmgr_sources} @XERCES_USE_MUTEXMGR_POSIX_TRUE@am__append_33 = ${posixmmgr_headers} @XERCES_USE_MUTEXMGR_WINDOWS_TRUE@am__append_34 = ${winmmgr_sources} @XERCES_USE_MUTEXMGR_WINDOWS_TRUE@am__append_35 = ${winmmgr_headers} # File Managers, conditionally built based on settings from configure # @XERCES_USE_FILEMGR_POSIX_TRUE@am__append_36 = ${posixfmgr_sources} @XERCES_USE_FILEMGR_POSIX_TRUE@am__append_37 = ${posixfmgr_headers} @XERCES_USE_FILEMGR_WINDOWS_TRUE@am__append_38 = ${winfmgr_sources} @XERCES_USE_FILEMGR_WINDOWS_TRUE@am__append_39 = ${winfmgr_headers} subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/cxx_have_bool.m4 \ $(top_srcdir)/m4/cxx_have_lstring.m4 \ $(top_srcdir)/m4/cxx_have_namespaces.m4 \ $(top_srcdir)/m4/cxx_have_std_libs.m4 \ $(top_srcdir)/m4/cxx_have_std_namespace.m4 \ $(top_srcdir)/m4/cxx_have_std_thread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/xerces_curl_prefix.m4 \ $(top_srcdir)/m4/xerces_filemgr_selection.m4 \ $(top_srcdir)/m4/xerces_icu_prefix.m4 \ $(top_srcdir)/m4/xerces_int_types.m4 \ $(top_srcdir)/m4/xerces_link_darwin_framework.m4 \ $(top_srcdir)/m4/xerces_msgloader_selection.m4 \ $(top_srcdir)/m4/xerces_mutexmgr_selection.m4 \ $(top_srcdir)/m4/xerces_netaccessor_selection.m4 \ $(top_srcdir)/m4/xerces_no_threads.m4 \ $(top_srcdir)/m4/xerces_path_delimiters.m4 \ $(top_srcdir)/m4/xerces_transcoder_selection.m4 \ $(top_srcdir)/m4/xerces_xmlch_selection.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am \ $(am__nobase_libxerces_c_la_HEADERS_DIST) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/src/xercesc/util/Xerces_autoconf_config.hpp \ $(top_builddir)/src/xercesc/util/XercesVersion.hpp CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(iconv_msgdir)" \ "$(DESTDIR)$(libxerces_c_ladir)" \ "$(DESTDIR)$(autoconfheadersdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libxerces_c_la_DEPENDENCIES = $(LTLIBOBJS) am__libxerces_c_la_SOURCES_DIST = xercesc/util/Base64.cpp \ xercesc/util/BinFileInputStream.cpp \ xercesc/util/BinInputStream.cpp \ xercesc/util/BinMemInputStream.cpp xercesc/util/BitSet.cpp \ xercesc/util/DefaultPanicHandler.cpp \ xercesc/util/EncodingValidator.cpp \ xercesc/util/HeaderDummy.cpp xercesc/util/HexBin.cpp \ xercesc/util/JanitorExports.cpp xercesc/util/KVStringPair.cpp \ xercesc/util/Mutexes.cpp xercesc/util/PanicHandler.cpp \ xercesc/util/PlatformUtils.cpp xercesc/util/PSVIUni.cpp \ xercesc/util/QName.cpp xercesc/util/regx/ASCIIRangeFactory.cpp \ xercesc/util/regx/BlockRangeFactory.cpp \ xercesc/util/regx/BMPattern.cpp \ xercesc/util/regx/CharToken.cpp \ xercesc/util/regx/ClosureToken.cpp \ xercesc/util/regx/ConcatToken.cpp xercesc/util/regx/Match.cpp \ xercesc/util/regx/Op.cpp xercesc/util/regx/OpFactory.cpp \ xercesc/util/regx/ParenToken.cpp \ xercesc/util/regx/ParserForXMLSchema.cpp \ xercesc/util/regx/RangeFactory.cpp \ xercesc/util/regx/RangeToken.cpp \ xercesc/util/regx/RangeTokenMap.cpp \ xercesc/util/regx/RegularExpression.cpp \ xercesc/util/regx/RegxParser.cpp \ xercesc/util/regx/RegxUtil.cpp \ xercesc/util/regx/StringToken.cpp xercesc/util/regx/Token.cpp \ xercesc/util/regx/TokenFactory.cpp \ xercesc/util/regx/UnicodeRangeFactory.cpp \ xercesc/util/regx/UnionToken.cpp \ xercesc/util/regx/XMLRangeFactory.cpp \ xercesc/util/regx/XMLUniCharacter.cpp \ xercesc/util/StringPool.cpp \ xercesc/util/SynchronizedStringPool.cpp \ xercesc/util/TransService.cpp xercesc/util/XMemory.cpp \ xercesc/util/XML256TableTranscoder.cpp \ xercesc/util/XML88591Transcoder.cpp \ xercesc/util/XMLAbstractDoubleFloat.cpp \ xercesc/util/XMLASCIITranscoder.cpp \ xercesc/util/XMLBigDecimal.cpp xercesc/util/XMLBigInteger.cpp \ xercesc/util/XMLChar.cpp xercesc/util/XMLChTranscoder.cpp \ xercesc/util/XMLDateTime.cpp xercesc/util/XMLDouble.cpp \ xercesc/util/XMLEBCDICTranscoder.cpp \ xercesc/util/XMLException.cpp xercesc/util/XMLFloat.cpp \ xercesc/util/XMLIBM1047Transcoder.cpp \ xercesc/util/XMLIBM1140Transcoder.cpp \ xercesc/util/XMLInitializer.cpp xercesc/util/XMLMsgLoader.cpp \ xercesc/util/XMLNumber.cpp xercesc/util/XMLString.cpp \ xercesc/util/XMLStringTokenizer.cpp \ xercesc/util/XMLUCS4Transcoder.cpp xercesc/util/XMLUni.cpp \ xercesc/util/XMLUri.cpp xercesc/util/XMLURL.cpp \ xercesc/util/XMLUTF16Transcoder.cpp \ xercesc/util/XMLUTF8Transcoder.cpp \ xercesc/util/XMLWin1252Transcoder.cpp \ xercesc/dom/DOMException.cpp xercesc/dom/DOMLSException.cpp \ xercesc/dom/DOMRangeException.cpp \ xercesc/dom/DOMXPathException.cpp \ xercesc/dom/impl/DOMAttrImpl.cpp \ xercesc/dom/impl/DOMAttrMapImpl.cpp \ xercesc/dom/impl/DOMAttrNSImpl.cpp \ xercesc/dom/impl/DOMCDATASectionImpl.cpp \ xercesc/dom/impl/DOMCharacterDataImpl.cpp \ xercesc/dom/impl/DOMChildNode.cpp \ xercesc/dom/impl/DOMCommentImpl.cpp \ xercesc/dom/impl/DOMConfigurationImpl.cpp \ xercesc/dom/impl/DOMDeepNodeListImpl.cpp \ xercesc/dom/impl/DOMDocumentFragmentImpl.cpp \ xercesc/dom/impl/DOMDocumentImpl.cpp \ xercesc/dom/impl/DOMDocumentTypeImpl.cpp \ xercesc/dom/impl/DOMElementImpl.cpp \ xercesc/dom/impl/DOMElementNSImpl.cpp \ xercesc/dom/impl/DOMEntityImpl.cpp \ xercesc/dom/impl/DOMEntityReferenceImpl.cpp \ xercesc/dom/impl/DOMErrorImpl.cpp \ xercesc/dom/impl/DOMImplementationImpl.cpp \ xercesc/dom/impl/DOMImplementationListImpl.cpp \ xercesc/dom/impl/DOMImplementationRegistry.cpp \ xercesc/dom/impl/DOMLocatorImpl.cpp \ xercesc/dom/impl/DOMNamedNodeMapImpl.cpp \ xercesc/dom/impl/DOMNodeIDMap.cpp \ xercesc/dom/impl/DOMNodeImpl.cpp \ xercesc/dom/impl/DOMNodeIteratorImpl.cpp \ xercesc/dom/impl/DOMNodeListImpl.cpp \ xercesc/dom/impl/DOMNodeVector.cpp \ xercesc/dom/impl/DOMNormalizer.cpp \ xercesc/dom/impl/DOMNotationImpl.cpp \ xercesc/dom/impl/DOMParentNode.cpp \ xercesc/dom/impl/DOMProcessingInstructionImpl.cpp \ xercesc/dom/impl/DOMRangeImpl.cpp \ xercesc/dom/impl/DOMStringListImpl.cpp \ xercesc/dom/impl/DOMStringPool.cpp \ xercesc/dom/impl/DOMTextImpl.cpp \ xercesc/dom/impl/DOMTreeWalkerImpl.cpp \ xercesc/dom/impl/DOMTypeInfoImpl.cpp \ xercesc/dom/impl/DOMLSSerializerImpl.cpp \ xercesc/dom/impl/DOMLSInputImpl.cpp \ xercesc/dom/impl/DOMLSOutputImpl.cpp \ xercesc/dom/impl/DOMXPathExpressionImpl.cpp \ xercesc/dom/impl/DOMXPathNSResolverImpl.cpp \ xercesc/dom/impl/DOMXPathResultImpl.cpp \ xercesc/dom/impl/XSDElementNSImpl.cpp \ xercesc/framework/BinOutputStream.cpp \ xercesc/framework/LocalFileFormatTarget.cpp \ xercesc/framework/LocalFileInputSource.cpp \ xercesc/framework/MemBufFormatTarget.cpp \ xercesc/framework/MemBufInputSource.cpp \ xercesc/framework/psvi/PSVIAttribute.cpp \ xercesc/framework/psvi/PSVIAttributeList.cpp \ xercesc/framework/psvi/PSVIElement.cpp \ xercesc/framework/psvi/PSVIItem.cpp \ xercesc/framework/psvi/XSAnnotation.cpp \ xercesc/framework/psvi/XSAttributeDeclaration.cpp \ xercesc/framework/psvi/XSAttributeGroupDefinition.cpp \ xercesc/framework/psvi/XSAttributeUse.cpp \ xercesc/framework/psvi/XSComplexTypeDefinition.cpp \ xercesc/framework/psvi/XSElementDeclaration.cpp \ xercesc/framework/psvi/XSFacet.cpp \ xercesc/framework/psvi/XSIDCDefinition.cpp \ xercesc/framework/psvi/XSModel.cpp \ xercesc/framework/psvi/XSModelGroup.cpp \ xercesc/framework/psvi/XSModelGroupDefinition.cpp \ xercesc/framework/psvi/XSMultiValueFacet.cpp \ xercesc/framework/psvi/XSNamespaceItem.cpp \ xercesc/framework/psvi/XSNotationDeclaration.cpp \ xercesc/framework/psvi/XSObject.cpp \ xercesc/framework/psvi/XSParticle.cpp \ xercesc/framework/psvi/XSSimpleTypeDefinition.cpp \ xercesc/framework/psvi/XSTypeDefinition.cpp \ xercesc/framework/psvi/XSValue.cpp \ xercesc/framework/psvi/XSWildcard.cpp \ xercesc/framework/StdInInputSource.cpp \ xercesc/framework/StdOutFormatTarget.cpp \ xercesc/framework/URLInputSource.cpp \ xercesc/framework/Wrapper4DOMLSInput.cpp \ xercesc/framework/Wrapper4InputSource.cpp \ xercesc/framework/XMLAttDef.cpp \ xercesc/framework/XMLAttDefList.cpp \ xercesc/framework/XMLAttr.cpp xercesc/framework/XMLBuffer.cpp \ xercesc/framework/XMLBufferMgr.cpp \ xercesc/framework/XMLContentModel.cpp \ xercesc/framework/XMLDTDDescription.cpp \ xercesc/framework/XMLElementDecl.cpp \ xercesc/framework/XMLEntityDecl.cpp \ xercesc/framework/XMLFormatter.cpp \ xercesc/framework/XMLGrammarDescription.cpp \ xercesc/framework/XMLGrammarPoolImpl.cpp \ xercesc/framework/XMLNotationDecl.cpp \ xercesc/framework/XMLRecognizer.cpp \ xercesc/framework/XMLRefInfo.cpp \ xercesc/framework/XMLSchemaDescription.cpp \ xercesc/framework/XMLValidator.cpp \ xercesc/internal/BinFileOutputStream.cpp \ xercesc/internal/BinMemOutputStream.cpp \ xercesc/internal/DGXMLScanner.cpp \ xercesc/internal/ElemStack.cpp \ xercesc/internal/IGXMLScanner.cpp \ xercesc/internal/IGXMLScanner2.cpp \ xercesc/internal/MemoryManagerImpl.cpp \ xercesc/internal/ReaderMgr.cpp \ xercesc/internal/SGXMLScanner.cpp \ xercesc/internal/ValidationContextImpl.cpp \ xercesc/internal/VecAttributesImpl.cpp \ xercesc/internal/VecAttrListImpl.cpp \ xercesc/internal/WFXMLScanner.cpp \ xercesc/internal/XMLReader.cpp xercesc/internal/XMLScanner.cpp \ xercesc/internal/XMLScannerResolver.cpp \ xercesc/internal/XProtoType.cpp \ xercesc/internal/XSAXMLScanner.cpp \ xercesc/internal/XSerializeEngine.cpp \ xercesc/internal/XSObjectFactory.cpp \ xercesc/internal/XTemplateSerializer.cpp \ xercesc/parsers/AbstractDOMParser.cpp \ xercesc/parsers/DOMLSParserImpl.cpp \ xercesc/parsers/SAX2XMLFilterImpl.cpp \ xercesc/parsers/SAX2XMLReaderImpl.cpp \ xercesc/parsers/SAXParser.cpp \ xercesc/parsers/XercesDOMParser.cpp xercesc/sax/Dummy.cpp \ xercesc/sax/InputSource.cpp xercesc/sax/SAXException.cpp \ xercesc/sax/SAXParseException.cpp xercesc/sax2/sax2Dummy.cpp \ xercesc/validators/common/AllContentModel.cpp \ xercesc/validators/common/CMAny.cpp \ xercesc/validators/common/CMBinaryOp.cpp \ xercesc/validators/common/CMUnaryOp.cpp \ xercesc/validators/common/ContentLeafNameTypeVector.cpp \ xercesc/validators/common/ContentSpecNode.cpp \ xercesc/validators/common/DFAContentModel.cpp \ xercesc/validators/common/Grammar.cpp \ xercesc/validators/common/GrammarResolver.cpp \ xercesc/validators/common/MixedContentModel.cpp \ xercesc/validators/common/SimpleContentModel.cpp \ xercesc/validators/datatype/AbstractNumericFacetValidator.cpp \ xercesc/validators/datatype/AbstractNumericValidator.cpp \ xercesc/validators/datatype/AbstractStringValidator.cpp \ xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.cpp \ xercesc/validators/datatype/AnyURIDatatypeValidator.cpp \ xercesc/validators/datatype/Base64BinaryDatatypeValidator.cpp \ xercesc/validators/datatype/BooleanDatatypeValidator.cpp \ xercesc/validators/datatype/DatatypeValidator.cpp \ xercesc/validators/datatype/DatatypeValidatorFactory.cpp \ xercesc/validators/datatype/DateDatatypeValidator.cpp \ xercesc/validators/datatype/DateTimeDatatypeValidator.cpp \ xercesc/validators/datatype/DateTimeValidator.cpp \ xercesc/validators/datatype/DayDatatypeValidator.cpp \ xercesc/validators/datatype/DecimalDatatypeValidator.cpp \ xercesc/validators/datatype/DoubleDatatypeValidator.cpp \ xercesc/validators/datatype/DurationDatatypeValidator.cpp \ xercesc/validators/datatype/ENTITYDatatypeValidator.cpp \ xercesc/validators/datatype/FloatDatatypeValidator.cpp \ xercesc/validators/datatype/HexBinaryDatatypeValidator.cpp \ xercesc/validators/datatype/IDDatatypeValidator.cpp \ xercesc/validators/datatype/IDREFDatatypeValidator.cpp \ xercesc/validators/datatype/ListDatatypeValidator.cpp \ xercesc/validators/datatype/MonthDatatypeValidator.cpp \ xercesc/validators/datatype/MonthDayDatatypeValidator.cpp \ xercesc/validators/datatype/NameDatatypeValidator.cpp \ xercesc/validators/datatype/NCNameDatatypeValidator.cpp \ xercesc/validators/datatype/NOTATIONDatatypeValidator.cpp \ xercesc/validators/datatype/QNameDatatypeValidator.cpp \ xercesc/validators/datatype/StringDatatypeValidator.cpp \ xercesc/validators/datatype/TimeDatatypeValidator.cpp \ xercesc/validators/datatype/UnionDatatypeValidator.cpp \ xercesc/validators/datatype/XMLCanRepGroup.cpp \ xercesc/validators/datatype/YearDatatypeValidator.cpp \ xercesc/validators/datatype/YearMonthDatatypeValidator.cpp \ xercesc/validators/DTD/DTDAttDef.cpp \ xercesc/validators/DTD/DTDAttDefList.cpp \ xercesc/validators/DTD/DTDElementDecl.cpp \ xercesc/validators/DTD/DTDEntityDecl.cpp \ xercesc/validators/DTD/DTDGrammar.cpp \ xercesc/validators/DTD/DTDScanner.cpp \ xercesc/validators/DTD/DTDValidator.cpp \ xercesc/validators/DTD/XMLDTDDescriptionImpl.cpp \ xercesc/validators/schema/ComplexTypeInfo.cpp \ xercesc/validators/schema/GeneralAttributeCheck.cpp \ xercesc/validators/schema/identity/FieldActivator.cpp \ xercesc/validators/schema/identity/FieldValueMap.cpp \ xercesc/validators/schema/identity/IC_Field.cpp \ xercesc/validators/schema/identity/IC_Key.cpp \ xercesc/validators/schema/identity/IC_KeyRef.cpp \ xercesc/validators/schema/identity/IC_Selector.cpp \ xercesc/validators/schema/identity/IC_Unique.cpp \ xercesc/validators/schema/identity/IdentityConstraint.cpp \ xercesc/validators/schema/identity/IdentityConstraintHandler.cpp \ xercesc/validators/schema/identity/ValueStore.cpp \ xercesc/validators/schema/identity/ValueStoreCache.cpp \ xercesc/validators/schema/identity/XercesXPath.cpp \ xercesc/validators/schema/identity/XPathMatcher.cpp \ xercesc/validators/schema/identity/XPathMatcherStack.cpp \ xercesc/validators/schema/identity/XPathSymbols.cpp \ xercesc/validators/schema/NamespaceScope.cpp \ xercesc/validators/schema/SchemaAttDef.cpp \ xercesc/validators/schema/SchemaAttDefList.cpp \ xercesc/validators/schema/SchemaElementDecl.cpp \ xercesc/validators/schema/SchemaGrammar.cpp \ xercesc/validators/schema/SchemaInfo.cpp \ xercesc/validators/schema/SchemaSymbols.cpp \ xercesc/validators/schema/SchemaValidator.cpp \ xercesc/validators/schema/SubstitutionGroupComparator.cpp \ xercesc/validators/schema/TraverseSchema.cpp \ xercesc/validators/schema/XercesAttGroupInfo.cpp \ xercesc/validators/schema/XercesElementWildcard.cpp \ xercesc/validators/schema/XercesGroupInfo.cpp \ xercesc/validators/schema/XMLSchemaDescriptionImpl.cpp \ xercesc/validators/schema/XSDDOMParser.cpp \ xercesc/validators/schema/XSDErrorReporter.cpp \ xercesc/validators/schema/XSDLocator.cpp \ xercesc/validators/schema/XUtil.cpp \ xercesc/xinclude/XIncludeDOMDocumentProcessor.cpp \ xercesc/xinclude/XIncludeLocation.cpp \ xercesc/xinclude/XIncludeUtils.cpp \ xercesc/util/NetAccessors/Curl/CurlNetAccessor.cpp \ xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp \ xercesc/util/NetAccessors/Socket/SocketNetAccessor.cpp \ xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp \ xercesc/util/NetAccessors/BinHTTPInputStreamCommon.cpp \ xercesc/util/NetAccessors/MacOSURLAccessCF/MacOSURLAccessCF.cpp \ xercesc/util/NetAccessors/MacOSURLAccessCF/URLAccessCFBinInputStream.cpp \ xercesc/util/NetAccessors/WinSock/WinSockNetAccessor.cpp \ xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp \ xercesc/util/Transcoders/ICU/ICUTransService.cpp \ xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp \ xercesc/util/Transcoders/Iconv/IconvTransService.cpp \ xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp \ xercesc/util/Transcoders/Win32/Win32TransService.cpp \ xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp \ xercesc/util/MsgLoaders/ICU/ICUMsgLoader.cpp \ xercesc/util/MsgLoaders/MsgCatalog/MsgCatalogLoader.cpp \ xercesc/util/MutexManagers/NoThreadMutexMgr.cpp \ xercesc/util/MutexManagers/StdMutexMgr.cpp \ xercesc/util/MutexManagers/PosixMutexMgr.cpp \ xercesc/util/MutexManagers/WindowsMutexMgr.cpp \ xercesc/util/FileManagers/PosixFileMgr.cpp \ xercesc/util/FileManagers/WindowsFileMgr.cpp am__dirstamp = $(am__leading_dot)dirstamp am__objects_1 = xercesc/util/Base64.lo \ xercesc/util/BinFileInputStream.lo \ xercesc/util/BinInputStream.lo \ xercesc/util/BinMemInputStream.lo xercesc/util/BitSet.lo \ xercesc/util/DefaultPanicHandler.lo \ xercesc/util/EncodingValidator.lo xercesc/util/HeaderDummy.lo \ xercesc/util/HexBin.lo xercesc/util/JanitorExports.lo \ xercesc/util/KVStringPair.lo xercesc/util/Mutexes.lo \ xercesc/util/PanicHandler.lo xercesc/util/PlatformUtils.lo \ xercesc/util/PSVIUni.lo xercesc/util/QName.lo \ xercesc/util/regx/ASCIIRangeFactory.lo \ xercesc/util/regx/BlockRangeFactory.lo \ xercesc/util/regx/BMPattern.lo xercesc/util/regx/CharToken.lo \ xercesc/util/regx/ClosureToken.lo \ xercesc/util/regx/ConcatToken.lo xercesc/util/regx/Match.lo \ xercesc/util/regx/Op.lo xercesc/util/regx/OpFactory.lo \ xercesc/util/regx/ParenToken.lo \ xercesc/util/regx/ParserForXMLSchema.lo \ xercesc/util/regx/RangeFactory.lo \ xercesc/util/regx/RangeToken.lo \ xercesc/util/regx/RangeTokenMap.lo \ xercesc/util/regx/RegularExpression.lo \ xercesc/util/regx/RegxParser.lo xercesc/util/regx/RegxUtil.lo \ xercesc/util/regx/StringToken.lo xercesc/util/regx/Token.lo \ xercesc/util/regx/TokenFactory.lo \ xercesc/util/regx/UnicodeRangeFactory.lo \ xercesc/util/regx/UnionToken.lo \ xercesc/util/regx/XMLRangeFactory.lo \ xercesc/util/regx/XMLUniCharacter.lo \ xercesc/util/StringPool.lo \ xercesc/util/SynchronizedStringPool.lo \ xercesc/util/TransService.lo xercesc/util/XMemory.lo \ xercesc/util/XML256TableTranscoder.lo \ xercesc/util/XML88591Transcoder.lo \ xercesc/util/XMLAbstractDoubleFloat.lo \ xercesc/util/XMLASCIITranscoder.lo \ xercesc/util/XMLBigDecimal.lo xercesc/util/XMLBigInteger.lo \ xercesc/util/XMLChar.lo xercesc/util/XMLChTranscoder.lo \ xercesc/util/XMLDateTime.lo xercesc/util/XMLDouble.lo \ xercesc/util/XMLEBCDICTranscoder.lo \ xercesc/util/XMLException.lo xercesc/util/XMLFloat.lo \ xercesc/util/XMLIBM1047Transcoder.lo \ xercesc/util/XMLIBM1140Transcoder.lo \ xercesc/util/XMLInitializer.lo xercesc/util/XMLMsgLoader.lo \ xercesc/util/XMLNumber.lo xercesc/util/XMLString.lo \ xercesc/util/XMLStringTokenizer.lo \ xercesc/util/XMLUCS4Transcoder.lo xercesc/util/XMLUni.lo \ xercesc/util/XMLUri.lo xercesc/util/XMLURL.lo \ xercesc/util/XMLUTF16Transcoder.lo \ xercesc/util/XMLUTF8Transcoder.lo \ xercesc/util/XMLWin1252Transcoder.lo am__objects_2 = xercesc/dom/DOMException.lo \ xercesc/dom/DOMLSException.lo xercesc/dom/DOMRangeException.lo \ xercesc/dom/DOMXPathException.lo am__objects_3 = xercesc/dom/impl/DOMAttrImpl.lo \ xercesc/dom/impl/DOMAttrMapImpl.lo \ xercesc/dom/impl/DOMAttrNSImpl.lo \ xercesc/dom/impl/DOMCDATASectionImpl.lo \ xercesc/dom/impl/DOMCharacterDataImpl.lo \ xercesc/dom/impl/DOMChildNode.lo \ xercesc/dom/impl/DOMCommentImpl.lo \ xercesc/dom/impl/DOMConfigurationImpl.lo \ xercesc/dom/impl/DOMDeepNodeListImpl.lo \ xercesc/dom/impl/DOMDocumentFragmentImpl.lo \ xercesc/dom/impl/DOMDocumentImpl.lo \ xercesc/dom/impl/DOMDocumentTypeImpl.lo \ xercesc/dom/impl/DOMElementImpl.lo \ xercesc/dom/impl/DOMElementNSImpl.lo \ xercesc/dom/impl/DOMEntityImpl.lo \ xercesc/dom/impl/DOMEntityReferenceImpl.lo \ xercesc/dom/impl/DOMErrorImpl.lo \ xercesc/dom/impl/DOMImplementationImpl.lo \ xercesc/dom/impl/DOMImplementationListImpl.lo \ xercesc/dom/impl/DOMImplementationRegistry.lo \ xercesc/dom/impl/DOMLocatorImpl.lo \ xercesc/dom/impl/DOMNamedNodeMapImpl.lo \ xercesc/dom/impl/DOMNodeIDMap.lo \ xercesc/dom/impl/DOMNodeImpl.lo \ xercesc/dom/impl/DOMNodeIteratorImpl.lo \ xercesc/dom/impl/DOMNodeListImpl.lo \ xercesc/dom/impl/DOMNodeVector.lo \ xercesc/dom/impl/DOMNormalizer.lo \ xercesc/dom/impl/DOMNotationImpl.lo \ xercesc/dom/impl/DOMParentNode.lo \ xercesc/dom/impl/DOMProcessingInstructionImpl.lo \ xercesc/dom/impl/DOMRangeImpl.lo \ xercesc/dom/impl/DOMStringListImpl.lo \ xercesc/dom/impl/DOMStringPool.lo \ xercesc/dom/impl/DOMTextImpl.lo \ xercesc/dom/impl/DOMTreeWalkerImpl.lo \ xercesc/dom/impl/DOMTypeInfoImpl.lo \ xercesc/dom/impl/DOMLSSerializerImpl.lo \ xercesc/dom/impl/DOMLSInputImpl.lo \ xercesc/dom/impl/DOMLSOutputImpl.lo \ xercesc/dom/impl/DOMXPathExpressionImpl.lo \ xercesc/dom/impl/DOMXPathNSResolverImpl.lo \ xercesc/dom/impl/DOMXPathResultImpl.lo \ xercesc/dom/impl/XSDElementNSImpl.lo am__objects_4 = xercesc/framework/BinOutputStream.lo \ xercesc/framework/LocalFileFormatTarget.lo \ xercesc/framework/LocalFileInputSource.lo \ xercesc/framework/MemBufFormatTarget.lo \ xercesc/framework/MemBufInputSource.lo \ xercesc/framework/psvi/PSVIAttribute.lo \ xercesc/framework/psvi/PSVIAttributeList.lo \ xercesc/framework/psvi/PSVIElement.lo \ xercesc/framework/psvi/PSVIItem.lo \ xercesc/framework/psvi/XSAnnotation.lo \ xercesc/framework/psvi/XSAttributeDeclaration.lo \ xercesc/framework/psvi/XSAttributeGroupDefinition.lo \ xercesc/framework/psvi/XSAttributeUse.lo \ xercesc/framework/psvi/XSComplexTypeDefinition.lo \ xercesc/framework/psvi/XSElementDeclaration.lo \ xercesc/framework/psvi/XSFacet.lo \ xercesc/framework/psvi/XSIDCDefinition.lo \ xercesc/framework/psvi/XSModel.lo \ xercesc/framework/psvi/XSModelGroup.lo \ xercesc/framework/psvi/XSModelGroupDefinition.lo \ xercesc/framework/psvi/XSMultiValueFacet.lo \ xercesc/framework/psvi/XSNamespaceItem.lo \ xercesc/framework/psvi/XSNotationDeclaration.lo \ xercesc/framework/psvi/XSObject.lo \ xercesc/framework/psvi/XSParticle.lo \ xercesc/framework/psvi/XSSimpleTypeDefinition.lo \ xercesc/framework/psvi/XSTypeDefinition.lo \ xercesc/framework/psvi/XSValue.lo \ xercesc/framework/psvi/XSWildcard.lo \ xercesc/framework/StdInInputSource.lo \ xercesc/framework/StdOutFormatTarget.lo \ xercesc/framework/URLInputSource.lo \ xercesc/framework/Wrapper4DOMLSInput.lo \ xercesc/framework/Wrapper4InputSource.lo \ xercesc/framework/XMLAttDef.lo \ xercesc/framework/XMLAttDefList.lo \ xercesc/framework/XMLAttr.lo xercesc/framework/XMLBuffer.lo \ xercesc/framework/XMLBufferMgr.lo \ xercesc/framework/XMLContentModel.lo \ xercesc/framework/XMLDTDDescription.lo \ xercesc/framework/XMLElementDecl.lo \ xercesc/framework/XMLEntityDecl.lo \ xercesc/framework/XMLFormatter.lo \ xercesc/framework/XMLGrammarDescription.lo \ xercesc/framework/XMLGrammarPoolImpl.lo \ xercesc/framework/XMLNotationDecl.lo \ xercesc/framework/XMLRecognizer.lo \ xercesc/framework/XMLRefInfo.lo \ xercesc/framework/XMLSchemaDescription.lo \ xercesc/framework/XMLValidator.lo am__objects_5 = xercesc/internal/BinFileOutputStream.lo \ xercesc/internal/BinMemOutputStream.lo \ xercesc/internal/DGXMLScanner.lo xercesc/internal/ElemStack.lo \ xercesc/internal/IGXMLScanner.lo \ xercesc/internal/IGXMLScanner2.lo \ xercesc/internal/MemoryManagerImpl.lo \ xercesc/internal/ReaderMgr.lo xercesc/internal/SGXMLScanner.lo \ xercesc/internal/ValidationContextImpl.lo \ xercesc/internal/VecAttributesImpl.lo \ xercesc/internal/VecAttrListImpl.lo \ xercesc/internal/WFXMLScanner.lo xercesc/internal/XMLReader.lo \ xercesc/internal/XMLScanner.lo \ xercesc/internal/XMLScannerResolver.lo \ xercesc/internal/XProtoType.lo \ xercesc/internal/XSAXMLScanner.lo \ xercesc/internal/XSerializeEngine.lo \ xercesc/internal/XSObjectFactory.lo \ xercesc/internal/XTemplateSerializer.lo am__objects_6 = xercesc/parsers/AbstractDOMParser.lo \ xercesc/parsers/DOMLSParserImpl.lo \ xercesc/parsers/SAX2XMLFilterImpl.lo \ xercesc/parsers/SAX2XMLReaderImpl.lo \ xercesc/parsers/SAXParser.lo \ xercesc/parsers/XercesDOMParser.lo am__objects_7 = xercesc/sax/Dummy.lo xercesc/sax/InputSource.lo \ xercesc/sax/SAXException.lo xercesc/sax/SAXParseException.lo am__objects_8 = xercesc/sax2/sax2Dummy.lo am__objects_9 = xercesc/validators/common/AllContentModel.lo \ xercesc/validators/common/CMAny.lo \ xercesc/validators/common/CMBinaryOp.lo \ xercesc/validators/common/CMUnaryOp.lo \ xercesc/validators/common/ContentLeafNameTypeVector.lo \ xercesc/validators/common/ContentSpecNode.lo \ xercesc/validators/common/DFAContentModel.lo \ xercesc/validators/common/Grammar.lo \ xercesc/validators/common/GrammarResolver.lo \ xercesc/validators/common/MixedContentModel.lo \ xercesc/validators/common/SimpleContentModel.lo \ xercesc/validators/datatype/AbstractNumericFacetValidator.lo \ xercesc/validators/datatype/AbstractNumericValidator.lo \ xercesc/validators/datatype/AbstractStringValidator.lo \ xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.lo \ xercesc/validators/datatype/AnyURIDatatypeValidator.lo \ xercesc/validators/datatype/Base64BinaryDatatypeValidator.lo \ xercesc/validators/datatype/BooleanDatatypeValidator.lo \ xercesc/validators/datatype/DatatypeValidator.lo \ xercesc/validators/datatype/DatatypeValidatorFactory.lo \ xercesc/validators/datatype/DateDatatypeValidator.lo \ xercesc/validators/datatype/DateTimeDatatypeValidator.lo \ xercesc/validators/datatype/DateTimeValidator.lo \ xercesc/validators/datatype/DayDatatypeValidator.lo \ xercesc/validators/datatype/DecimalDatatypeValidator.lo \ xercesc/validators/datatype/DoubleDatatypeValidator.lo \ xercesc/validators/datatype/DurationDatatypeValidator.lo \ xercesc/validators/datatype/ENTITYDatatypeValidator.lo \ xercesc/validators/datatype/FloatDatatypeValidator.lo \ xercesc/validators/datatype/HexBinaryDatatypeValidator.lo \ xercesc/validators/datatype/IDDatatypeValidator.lo \ xercesc/validators/datatype/IDREFDatatypeValidator.lo \ xercesc/validators/datatype/ListDatatypeValidator.lo \ xercesc/validators/datatype/MonthDatatypeValidator.lo \ xercesc/validators/datatype/MonthDayDatatypeValidator.lo \ xercesc/validators/datatype/NameDatatypeValidator.lo \ xercesc/validators/datatype/NCNameDatatypeValidator.lo \ xercesc/validators/datatype/NOTATIONDatatypeValidator.lo \ xercesc/validators/datatype/QNameDatatypeValidator.lo \ xercesc/validators/datatype/StringDatatypeValidator.lo \ xercesc/validators/datatype/TimeDatatypeValidator.lo \ xercesc/validators/datatype/UnionDatatypeValidator.lo \ xercesc/validators/datatype/XMLCanRepGroup.lo \ xercesc/validators/datatype/YearDatatypeValidator.lo \ xercesc/validators/datatype/YearMonthDatatypeValidator.lo \ xercesc/validators/DTD/DTDAttDef.lo \ xercesc/validators/DTD/DTDAttDefList.lo \ xercesc/validators/DTD/DTDElementDecl.lo \ xercesc/validators/DTD/DTDEntityDecl.lo \ xercesc/validators/DTD/DTDGrammar.lo \ xercesc/validators/DTD/DTDScanner.lo \ xercesc/validators/DTD/DTDValidator.lo \ xercesc/validators/DTD/XMLDTDDescriptionImpl.lo \ xercesc/validators/schema/ComplexTypeInfo.lo \ xercesc/validators/schema/GeneralAttributeCheck.lo \ xercesc/validators/schema/identity/FieldActivator.lo \ xercesc/validators/schema/identity/FieldValueMap.lo \ xercesc/validators/schema/identity/IC_Field.lo \ xercesc/validators/schema/identity/IC_Key.lo \ xercesc/validators/schema/identity/IC_KeyRef.lo \ xercesc/validators/schema/identity/IC_Selector.lo \ xercesc/validators/schema/identity/IC_Unique.lo \ xercesc/validators/schema/identity/IdentityConstraint.lo \ xercesc/validators/schema/identity/IdentityConstraintHandler.lo \ xercesc/validators/schema/identity/ValueStore.lo \ xercesc/validators/schema/identity/ValueStoreCache.lo \ xercesc/validators/schema/identity/XercesXPath.lo \ xercesc/validators/schema/identity/XPathMatcher.lo \ xercesc/validators/schema/identity/XPathMatcherStack.lo \ xercesc/validators/schema/identity/XPathSymbols.lo \ xercesc/validators/schema/NamespaceScope.lo \ xercesc/validators/schema/SchemaAttDef.lo \ xercesc/validators/schema/SchemaAttDefList.lo \ xercesc/validators/schema/SchemaElementDecl.lo \ xercesc/validators/schema/SchemaGrammar.lo \ xercesc/validators/schema/SchemaInfo.lo \ xercesc/validators/schema/SchemaSymbols.lo \ xercesc/validators/schema/SchemaValidator.lo \ xercesc/validators/schema/SubstitutionGroupComparator.lo \ xercesc/validators/schema/TraverseSchema.lo \ xercesc/validators/schema/XercesAttGroupInfo.lo \ xercesc/validators/schema/XercesElementWildcard.lo \ xercesc/validators/schema/XercesGroupInfo.lo \ xercesc/validators/schema/XMLSchemaDescriptionImpl.lo \ xercesc/validators/schema/XSDDOMParser.lo \ xercesc/validators/schema/XSDErrorReporter.lo \ xercesc/validators/schema/XSDLocator.lo \ xercesc/validators/schema/XUtil.lo am__objects_10 = xercesc/xinclude/XIncludeDOMDocumentProcessor.lo \ xercesc/xinclude/XIncludeLocation.lo \ xercesc/xinclude/XIncludeUtils.lo am__objects_11 = xercesc/util/NetAccessors/Curl/CurlNetAccessor.lo \ xercesc/util/NetAccessors/Curl/CurlURLInputStream.lo @XERCES_USE_NETACCESSOR_CURL_TRUE@am__objects_12 = $(am__objects_11) am__objects_13 = \ xercesc/util/NetAccessors/Socket/SocketNetAccessor.lo \ xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.lo \ xercesc/util/NetAccessors/BinHTTPInputStreamCommon.lo @XERCES_USE_NETACCESSOR_SOCKET_TRUE@am__objects_14 = \ @XERCES_USE_NETACCESSOR_SOCKET_TRUE@ $(am__objects_13) am__objects_15 = xercesc/util/NetAccessors/MacOSURLAccessCF/MacOSURLAccessCF.lo \ xercesc/util/NetAccessors/MacOSURLAccessCF/URLAccessCFBinInputStream.lo @XERCES_USE_NETACCESSOR_CFURL_TRUE@am__objects_16 = $(am__objects_15) am__objects_17 = \ xercesc/util/NetAccessors/WinSock/WinSockNetAccessor.lo \ xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.lo \ xercesc/util/NetAccessors/BinHTTPInputStreamCommon.lo @XERCES_USE_NETACCESSOR_WINSOCK_TRUE@am__objects_18 = \ @XERCES_USE_NETACCESSOR_WINSOCK_TRUE@ $(am__objects_17) am__objects_19 = xercesc/util/Transcoders/ICU/ICUTransService.lo @XERCES_USE_TRANSCODER_ICU_TRUE@am__objects_20 = $(am__objects_19) am__objects_21 = \ xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.lo @XERCES_USE_TRANSCODER_GNUICONV_TRUE@am__objects_22 = \ @XERCES_USE_TRANSCODER_GNUICONV_TRUE@ $(am__objects_21) am__objects_23 = xercesc/util/Transcoders/Iconv/IconvTransService.lo @XERCES_USE_TRANSCODER_ICONV_TRUE@am__objects_24 = $(am__objects_23) am__objects_25 = xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.lo @XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER_TRUE@am__objects_26 = $(am__objects_25) am__objects_27 = xercesc/util/Transcoders/Win32/Win32TransService.lo @XERCES_USE_TRANSCODER_WINDOWS_TRUE@am__objects_28 = \ @XERCES_USE_TRANSCODER_WINDOWS_TRUE@ $(am__objects_27) am__objects_29 = xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.lo @XERCES_USE_MSGLOADER_INMEMORY_TRUE@am__objects_30 = \ @XERCES_USE_MSGLOADER_INMEMORY_TRUE@ $(am__objects_29) am__objects_31 = xercesc/util/MsgLoaders/ICU/ICUMsgLoader.lo @XERCES_USE_MSGLOADER_ICU_TRUE@am__objects_32 = $(am__objects_31) am__objects_33 = \ xercesc/util/MsgLoaders/MsgCatalog/MsgCatalogLoader.lo @XERCES_USE_MSGLOADER_ICONV_TRUE@am__objects_34 = $(am__objects_33) am__objects_35 = xercesc/util/MutexManagers/NoThreadMutexMgr.lo @XERCES_USE_MUTEXMGR_NOTHREAD_TRUE@am__objects_36 = $(am__objects_35) am__objects_37 = xercesc/util/MutexManagers/StdMutexMgr.lo @XERCES_USE_MUTEXMGR_STD_TRUE@am__objects_38 = $(am__objects_37) am__objects_39 = xercesc/util/MutexManagers/PosixMutexMgr.lo @XERCES_USE_MUTEXMGR_POSIX_TRUE@am__objects_40 = $(am__objects_39) am__objects_41 = xercesc/util/MutexManagers/WindowsMutexMgr.lo @XERCES_USE_MUTEXMGR_WINDOWS_TRUE@am__objects_42 = $(am__objects_41) am__objects_43 = xercesc/util/FileManagers/PosixFileMgr.lo @XERCES_USE_FILEMGR_POSIX_TRUE@am__objects_44 = $(am__objects_43) am__objects_45 = xercesc/util/FileManagers/WindowsFileMgr.lo @XERCES_USE_FILEMGR_WINDOWS_TRUE@am__objects_46 = $(am__objects_45) am_libxerces_c_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ $(am__objects_3) $(am__objects_4) $(am__objects_5) \ $(am__objects_6) $(am__objects_7) $(am__objects_8) \ $(am__objects_9) $(am__objects_10) $(am__objects_12) \ $(am__objects_14) $(am__objects_16) $(am__objects_18) \ $(am__objects_20) $(am__objects_22) $(am__objects_24) \ $(am__objects_26) $(am__objects_28) $(am__objects_30) \ $(am__objects_32) $(am__objects_34) $(am__objects_36) \ $(am__objects_38) $(am__objects_40) $(am__objects_42) \ $(am__objects_44) $(am__objects_46) am__objects_47 = xercesc_messages.lo root_res.lo @XERCES_USE_MSGLOADER_ICU_TRUE@nodist_libxerces_c_la_OBJECTS = \ @XERCES_USE_MSGLOADER_ICU_TRUE@ $(am__objects_47) libxerces_c_la_OBJECTS = $(am_libxerces_c_la_OBJECTS) \ $(nodist_libxerces_c_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libxerces_c_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libxerces_c_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/src/xercesc/util depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = $(DEPDIR)/stricmp.Plo $(DEPDIR)/strnicmp.Plo \ $(DEPDIR)/towlower.Plo $(DEPDIR)/towupper.Plo \ ./$(DEPDIR)/root_res.Plo ./$(DEPDIR)/xercesc_messages.Plo \ xercesc/dom/$(DEPDIR)/DOMException.Plo \ xercesc/dom/$(DEPDIR)/DOMLSException.Plo \ xercesc/dom/$(DEPDIR)/DOMRangeException.Plo \ xercesc/dom/$(DEPDIR)/DOMXPathException.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMAttrImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMAttrMapImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMAttrNSImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMCDATASectionImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMCharacterDataImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMChildNode.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMCommentImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMConfigurationImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMDeepNodeListImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMDocumentFragmentImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMDocumentImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMDocumentTypeImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMElementImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMElementNSImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMEntityImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMEntityReferenceImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMErrorImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMImplementationImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMImplementationListImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMImplementationRegistry.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMLSInputImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMLSOutputImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMLSSerializerImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMLocatorImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMNamedNodeMapImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMNodeIDMap.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMNodeImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMNodeIteratorImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMNodeListImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMNodeVector.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMNormalizer.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMNotationImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMParentNode.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMProcessingInstructionImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMRangeImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMStringListImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMStringPool.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMTextImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMTreeWalkerImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMTypeInfoImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMXPathExpressionImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMXPathNSResolverImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/DOMXPathResultImpl.Plo \ xercesc/dom/impl/$(DEPDIR)/XSDElementNSImpl.Plo \ xercesc/framework/$(DEPDIR)/BinOutputStream.Plo \ xercesc/framework/$(DEPDIR)/LocalFileFormatTarget.Plo \ xercesc/framework/$(DEPDIR)/LocalFileInputSource.Plo \ xercesc/framework/$(DEPDIR)/MemBufFormatTarget.Plo \ xercesc/framework/$(DEPDIR)/MemBufInputSource.Plo \ xercesc/framework/$(DEPDIR)/StdInInputSource.Plo \ xercesc/framework/$(DEPDIR)/StdOutFormatTarget.Plo \ xercesc/framework/$(DEPDIR)/URLInputSource.Plo \ xercesc/framework/$(DEPDIR)/Wrapper4DOMLSInput.Plo \ xercesc/framework/$(DEPDIR)/Wrapper4InputSource.Plo \ xercesc/framework/$(DEPDIR)/XMLAttDef.Plo \ xercesc/framework/$(DEPDIR)/XMLAttDefList.Plo \ xercesc/framework/$(DEPDIR)/XMLAttr.Plo \ xercesc/framework/$(DEPDIR)/XMLBuffer.Plo \ xercesc/framework/$(DEPDIR)/XMLBufferMgr.Plo \ xercesc/framework/$(DEPDIR)/XMLContentModel.Plo \ xercesc/framework/$(DEPDIR)/XMLDTDDescription.Plo \ xercesc/framework/$(DEPDIR)/XMLElementDecl.Plo \ xercesc/framework/$(DEPDIR)/XMLEntityDecl.Plo \ xercesc/framework/$(DEPDIR)/XMLFormatter.Plo \ xercesc/framework/$(DEPDIR)/XMLGrammarDescription.Plo \ xercesc/framework/$(DEPDIR)/XMLGrammarPoolImpl.Plo \ xercesc/framework/$(DEPDIR)/XMLNotationDecl.Plo \ xercesc/framework/$(DEPDIR)/XMLRecognizer.Plo \ xercesc/framework/$(DEPDIR)/XMLRefInfo.Plo \ xercesc/framework/$(DEPDIR)/XMLSchemaDescription.Plo \ xercesc/framework/$(DEPDIR)/XMLValidator.Plo \ xercesc/framework/psvi/$(DEPDIR)/PSVIAttribute.Plo \ xercesc/framework/psvi/$(DEPDIR)/PSVIAttributeList.Plo \ xercesc/framework/psvi/$(DEPDIR)/PSVIElement.Plo \ xercesc/framework/psvi/$(DEPDIR)/PSVIItem.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSAnnotation.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSAttributeDeclaration.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSAttributeGroupDefinition.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSAttributeUse.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSComplexTypeDefinition.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSElementDeclaration.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSFacet.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSIDCDefinition.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSModel.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSModelGroup.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSModelGroupDefinition.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSMultiValueFacet.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSNamespaceItem.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSNotationDeclaration.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSObject.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSParticle.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSSimpleTypeDefinition.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSTypeDefinition.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSValue.Plo \ xercesc/framework/psvi/$(DEPDIR)/XSWildcard.Plo \ xercesc/internal/$(DEPDIR)/BinFileOutputStream.Plo \ xercesc/internal/$(DEPDIR)/BinMemOutputStream.Plo \ xercesc/internal/$(DEPDIR)/DGXMLScanner.Plo \ xercesc/internal/$(DEPDIR)/ElemStack.Plo \ xercesc/internal/$(DEPDIR)/IGXMLScanner.Plo \ xercesc/internal/$(DEPDIR)/IGXMLScanner2.Plo \ xercesc/internal/$(DEPDIR)/MemoryManagerImpl.Plo \ xercesc/internal/$(DEPDIR)/ReaderMgr.Plo \ xercesc/internal/$(DEPDIR)/SGXMLScanner.Plo \ xercesc/internal/$(DEPDIR)/ValidationContextImpl.Plo \ xercesc/internal/$(DEPDIR)/VecAttrListImpl.Plo \ xercesc/internal/$(DEPDIR)/VecAttributesImpl.Plo \ xercesc/internal/$(DEPDIR)/WFXMLScanner.Plo \ xercesc/internal/$(DEPDIR)/XMLReader.Plo \ xercesc/internal/$(DEPDIR)/XMLScanner.Plo \ xercesc/internal/$(DEPDIR)/XMLScannerResolver.Plo \ xercesc/internal/$(DEPDIR)/XProtoType.Plo \ xercesc/internal/$(DEPDIR)/XSAXMLScanner.Plo \ xercesc/internal/$(DEPDIR)/XSObjectFactory.Plo \ xercesc/internal/$(DEPDIR)/XSerializeEngine.Plo \ xercesc/internal/$(DEPDIR)/XTemplateSerializer.Plo \ xercesc/parsers/$(DEPDIR)/AbstractDOMParser.Plo \ xercesc/parsers/$(DEPDIR)/DOMLSParserImpl.Plo \ xercesc/parsers/$(DEPDIR)/SAX2XMLFilterImpl.Plo \ xercesc/parsers/$(DEPDIR)/SAX2XMLReaderImpl.Plo \ xercesc/parsers/$(DEPDIR)/SAXParser.Plo \ xercesc/parsers/$(DEPDIR)/XercesDOMParser.Plo \ xercesc/sax/$(DEPDIR)/Dummy.Plo \ xercesc/sax/$(DEPDIR)/InputSource.Plo \ xercesc/sax/$(DEPDIR)/SAXException.Plo \ xercesc/sax/$(DEPDIR)/SAXParseException.Plo \ xercesc/sax2/$(DEPDIR)/sax2Dummy.Plo \ xercesc/util/$(DEPDIR)/Base64.Plo \ xercesc/util/$(DEPDIR)/BinFileInputStream.Plo \ xercesc/util/$(DEPDIR)/BinInputStream.Plo \ xercesc/util/$(DEPDIR)/BinMemInputStream.Plo \ xercesc/util/$(DEPDIR)/BitSet.Plo \ xercesc/util/$(DEPDIR)/DefaultPanicHandler.Plo \ xercesc/util/$(DEPDIR)/EncodingValidator.Plo \ xercesc/util/$(DEPDIR)/HeaderDummy.Plo \ xercesc/util/$(DEPDIR)/HexBin.Plo \ xercesc/util/$(DEPDIR)/JanitorExports.Plo \ xercesc/util/$(DEPDIR)/KVStringPair.Plo \ xercesc/util/$(DEPDIR)/Mutexes.Plo \ xercesc/util/$(DEPDIR)/PSVIUni.Plo \ xercesc/util/$(DEPDIR)/PanicHandler.Plo \ xercesc/util/$(DEPDIR)/PlatformUtils.Plo \ xercesc/util/$(DEPDIR)/QName.Plo \ xercesc/util/$(DEPDIR)/StringPool.Plo \ xercesc/util/$(DEPDIR)/SynchronizedStringPool.Plo \ xercesc/util/$(DEPDIR)/TransService.Plo \ xercesc/util/$(DEPDIR)/XML256TableTranscoder.Plo \ xercesc/util/$(DEPDIR)/XML88591Transcoder.Plo \ xercesc/util/$(DEPDIR)/XMLASCIITranscoder.Plo \ xercesc/util/$(DEPDIR)/XMLAbstractDoubleFloat.Plo \ xercesc/util/$(DEPDIR)/XMLBigDecimal.Plo \ xercesc/util/$(DEPDIR)/XMLBigInteger.Plo \ xercesc/util/$(DEPDIR)/XMLChTranscoder.Plo \ xercesc/util/$(DEPDIR)/XMLChar.Plo \ xercesc/util/$(DEPDIR)/XMLDateTime.Plo \ xercesc/util/$(DEPDIR)/XMLDouble.Plo \ xercesc/util/$(DEPDIR)/XMLEBCDICTranscoder.Plo \ xercesc/util/$(DEPDIR)/XMLException.Plo \ xercesc/util/$(DEPDIR)/XMLFloat.Plo \ xercesc/util/$(DEPDIR)/XMLIBM1047Transcoder.Plo \ xercesc/util/$(DEPDIR)/XMLIBM1140Transcoder.Plo \ xercesc/util/$(DEPDIR)/XMLInitializer.Plo \ xercesc/util/$(DEPDIR)/XMLMsgLoader.Plo \ xercesc/util/$(DEPDIR)/XMLNumber.Plo \ xercesc/util/$(DEPDIR)/XMLString.Plo \ xercesc/util/$(DEPDIR)/XMLStringTokenizer.Plo \ xercesc/util/$(DEPDIR)/XMLUCS4Transcoder.Plo \ xercesc/util/$(DEPDIR)/XMLURL.Plo \ xercesc/util/$(DEPDIR)/XMLUTF16Transcoder.Plo \ xercesc/util/$(DEPDIR)/XMLUTF8Transcoder.Plo \ xercesc/util/$(DEPDIR)/XMLUni.Plo \ xercesc/util/$(DEPDIR)/XMLUri.Plo \ xercesc/util/$(DEPDIR)/XMLWin1252Transcoder.Plo \ xercesc/util/$(DEPDIR)/XMemory.Plo \ xercesc/util/FileManagers/$(DEPDIR)/PosixFileMgr.Plo \ xercesc/util/FileManagers/$(DEPDIR)/WindowsFileMgr.Plo \ xercesc/util/MsgLoaders/ICU/$(DEPDIR)/ICUMsgLoader.Plo \ xercesc/util/MsgLoaders/InMemory/$(DEPDIR)/InMemMsgLoader.Plo \ xercesc/util/MsgLoaders/MsgCatalog/$(DEPDIR)/MsgCatalogLoader.Plo \ xercesc/util/MutexManagers/$(DEPDIR)/NoThreadMutexMgr.Plo \ xercesc/util/MutexManagers/$(DEPDIR)/PosixMutexMgr.Plo \ xercesc/util/MutexManagers/$(DEPDIR)/StdMutexMgr.Plo \ xercesc/util/MutexManagers/$(DEPDIR)/WindowsMutexMgr.Plo \ xercesc/util/NetAccessors/$(DEPDIR)/BinHTTPInputStreamCommon.Plo \ xercesc/util/NetAccessors/Curl/$(DEPDIR)/CurlNetAccessor.Plo \ xercesc/util/NetAccessors/Curl/$(DEPDIR)/CurlURLInputStream.Plo \ xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR)/MacOSURLAccessCF.Plo \ xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR)/URLAccessCFBinInputStream.Plo \ xercesc/util/NetAccessors/Socket/$(DEPDIR)/SocketNetAccessor.Plo \ xercesc/util/NetAccessors/Socket/$(DEPDIR)/UnixHTTPURLInputStream.Plo \ xercesc/util/NetAccessors/WinSock/$(DEPDIR)/BinHTTPURLInputStream.Plo \ xercesc/util/NetAccessors/WinSock/$(DEPDIR)/WinSockNetAccessor.Plo \ xercesc/util/Transcoders/ICU/$(DEPDIR)/ICUTransService.Plo \ xercesc/util/Transcoders/Iconv/$(DEPDIR)/IconvTransService.Plo \ xercesc/util/Transcoders/IconvGNU/$(DEPDIR)/IconvGNUTransService.Plo \ xercesc/util/Transcoders/MacOSUnicodeConverter/$(DEPDIR)/MacOSUnicodeConverter.Plo \ xercesc/util/Transcoders/Win32/$(DEPDIR)/Win32TransService.Plo \ xercesc/util/regx/$(DEPDIR)/ASCIIRangeFactory.Plo \ xercesc/util/regx/$(DEPDIR)/BMPattern.Plo \ xercesc/util/regx/$(DEPDIR)/BlockRangeFactory.Plo \ xercesc/util/regx/$(DEPDIR)/CharToken.Plo \ xercesc/util/regx/$(DEPDIR)/ClosureToken.Plo \ xercesc/util/regx/$(DEPDIR)/ConcatToken.Plo \ xercesc/util/regx/$(DEPDIR)/Match.Plo \ xercesc/util/regx/$(DEPDIR)/Op.Plo \ xercesc/util/regx/$(DEPDIR)/OpFactory.Plo \ xercesc/util/regx/$(DEPDIR)/ParenToken.Plo \ xercesc/util/regx/$(DEPDIR)/ParserForXMLSchema.Plo \ xercesc/util/regx/$(DEPDIR)/RangeFactory.Plo \ xercesc/util/regx/$(DEPDIR)/RangeToken.Plo \ xercesc/util/regx/$(DEPDIR)/RangeTokenMap.Plo \ xercesc/util/regx/$(DEPDIR)/RegularExpression.Plo \ xercesc/util/regx/$(DEPDIR)/RegxParser.Plo \ xercesc/util/regx/$(DEPDIR)/RegxUtil.Plo \ xercesc/util/regx/$(DEPDIR)/StringToken.Plo \ xercesc/util/regx/$(DEPDIR)/Token.Plo \ xercesc/util/regx/$(DEPDIR)/TokenFactory.Plo \ xercesc/util/regx/$(DEPDIR)/UnicodeRangeFactory.Plo \ xercesc/util/regx/$(DEPDIR)/UnionToken.Plo \ xercesc/util/regx/$(DEPDIR)/XMLRangeFactory.Plo \ xercesc/util/regx/$(DEPDIR)/XMLUniCharacter.Plo \ xercesc/validators/DTD/$(DEPDIR)/DTDAttDef.Plo \ xercesc/validators/DTD/$(DEPDIR)/DTDAttDefList.Plo \ xercesc/validators/DTD/$(DEPDIR)/DTDElementDecl.Plo \ xercesc/validators/DTD/$(DEPDIR)/DTDEntityDecl.Plo \ xercesc/validators/DTD/$(DEPDIR)/DTDGrammar.Plo \ xercesc/validators/DTD/$(DEPDIR)/DTDScanner.Plo \ xercesc/validators/DTD/$(DEPDIR)/DTDValidator.Plo \ xercesc/validators/DTD/$(DEPDIR)/XMLDTDDescriptionImpl.Plo \ xercesc/validators/common/$(DEPDIR)/AllContentModel.Plo \ xercesc/validators/common/$(DEPDIR)/CMAny.Plo \ xercesc/validators/common/$(DEPDIR)/CMBinaryOp.Plo \ xercesc/validators/common/$(DEPDIR)/CMUnaryOp.Plo \ xercesc/validators/common/$(DEPDIR)/ContentLeafNameTypeVector.Plo \ xercesc/validators/common/$(DEPDIR)/ContentSpecNode.Plo \ xercesc/validators/common/$(DEPDIR)/DFAContentModel.Plo \ xercesc/validators/common/$(DEPDIR)/Grammar.Plo \ xercesc/validators/common/$(DEPDIR)/GrammarResolver.Plo \ xercesc/validators/common/$(DEPDIR)/MixedContentModel.Plo \ xercesc/validators/common/$(DEPDIR)/SimpleContentModel.Plo \ xercesc/validators/datatype/$(DEPDIR)/AbstractNumericFacetValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/AbstractNumericValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/AbstractStringValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/AnySimpleTypeDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/AnyURIDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/Base64BinaryDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/BooleanDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/DatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/DatatypeValidatorFactory.Plo \ xercesc/validators/datatype/$(DEPDIR)/DateDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/DateTimeDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/DateTimeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/DayDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/DecimalDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/DoubleDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/DurationDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/ENTITYDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/FloatDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/HexBinaryDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/IDDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/IDREFDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/ListDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/MonthDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/MonthDayDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/NCNameDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/NOTATIONDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/NameDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/QNameDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/StringDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/TimeDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/UnionDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/XMLCanRepGroup.Plo \ xercesc/validators/datatype/$(DEPDIR)/YearDatatypeValidator.Plo \ xercesc/validators/datatype/$(DEPDIR)/YearMonthDatatypeValidator.Plo \ xercesc/validators/schema/$(DEPDIR)/ComplexTypeInfo.Plo \ xercesc/validators/schema/$(DEPDIR)/GeneralAttributeCheck.Plo \ xercesc/validators/schema/$(DEPDIR)/NamespaceScope.Plo \ xercesc/validators/schema/$(DEPDIR)/SchemaAttDef.Plo \ xercesc/validators/schema/$(DEPDIR)/SchemaAttDefList.Plo \ xercesc/validators/schema/$(DEPDIR)/SchemaElementDecl.Plo \ xercesc/validators/schema/$(DEPDIR)/SchemaGrammar.Plo \ xercesc/validators/schema/$(DEPDIR)/SchemaInfo.Plo \ xercesc/validators/schema/$(DEPDIR)/SchemaSymbols.Plo \ xercesc/validators/schema/$(DEPDIR)/SchemaValidator.Plo \ xercesc/validators/schema/$(DEPDIR)/SubstitutionGroupComparator.Plo \ xercesc/validators/schema/$(DEPDIR)/TraverseSchema.Plo \ xercesc/validators/schema/$(DEPDIR)/XMLSchemaDescriptionImpl.Plo \ xercesc/validators/schema/$(DEPDIR)/XSDDOMParser.Plo \ xercesc/validators/schema/$(DEPDIR)/XSDErrorReporter.Plo \ xercesc/validators/schema/$(DEPDIR)/XSDLocator.Plo \ xercesc/validators/schema/$(DEPDIR)/XUtil.Plo \ xercesc/validators/schema/$(DEPDIR)/XercesAttGroupInfo.Plo \ xercesc/validators/schema/$(DEPDIR)/XercesElementWildcard.Plo \ xercesc/validators/schema/$(DEPDIR)/XercesGroupInfo.Plo \ xercesc/validators/schema/identity/$(DEPDIR)/FieldActivator.Plo \ xercesc/validators/schema/identity/$(DEPDIR)/FieldValueMap.Plo \ xercesc/validators/schema/identity/$(DEPDIR)/IC_Field.Plo \ xercesc/validators/schema/identity/$(DEPDIR)/IC_Key.Plo \ xercesc/validators/schema/identity/$(DEPDIR)/IC_KeyRef.Plo \ xercesc/validators/schema/identity/$(DEPDIR)/IC_Selector.Plo \ xercesc/validators/schema/identity/$(DEPDIR)/IC_Unique.Plo \ xercesc/validators/schema/identity/$(DEPDIR)/IdentityConstraint.Plo \ xercesc/validators/schema/identity/$(DEPDIR)/IdentityConstraintHandler.Plo \ xercesc/validators/schema/identity/$(DEPDIR)/ValueStore.Plo \ xercesc/validators/schema/identity/$(DEPDIR)/ValueStoreCache.Plo \ xercesc/validators/schema/identity/$(DEPDIR)/XPathMatcher.Plo \ xercesc/validators/schema/identity/$(DEPDIR)/XPathMatcherStack.Plo \ xercesc/validators/schema/identity/$(DEPDIR)/XPathSymbols.Plo \ xercesc/validators/schema/identity/$(DEPDIR)/XercesXPath.Plo \ xercesc/xinclude/$(DEPDIR)/XIncludeDOMDocumentProcessor.Plo \ xercesc/xinclude/$(DEPDIR)/XIncludeLocation.Plo \ xercesc/xinclude/$(DEPDIR)/XIncludeUtils.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libxerces_c_la_SOURCES) $(nodist_libxerces_c_la_SOURCES) DIST_SOURCES = $(am__libxerces_c_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(iconv_msg_DATA) am__nobase_libxerces_c_la_HEADERS_DIST = \ xercesc/util/ArrayIndexOutOfBoundsException.hpp \ xercesc/util/Base64.hpp xercesc/util/BaseRefVectorOf.hpp \ xercesc/util/BaseRefVectorOf.c \ xercesc/util/BinFileInputStream.hpp \ xercesc/util/BinInputStream.hpp \ xercesc/util/BinMemInputStream.hpp xercesc/util/BitOps.hpp \ xercesc/util/BitSet.hpp xercesc/util/CountedPointer.hpp \ xercesc/util/CountedPointer.c \ xercesc/util/DefaultPanicHandler.hpp \ xercesc/util/EmptyStackException.hpp \ xercesc/util/EncodingValidator.hpp \ xercesc/util/FlagJanitor.hpp xercesc/util/FlagJanitor.c \ xercesc/util/Hashers.hpp xercesc/util/Hash2KeysSetOf.hpp \ xercesc/util/Hash2KeysSetOf.c xercesc/util/HexBin.hpp \ xercesc/util/IllegalArgumentException.hpp \ xercesc/util/InvalidCastException.hpp \ xercesc/util/IOException.hpp xercesc/util/Janitor.hpp \ xercesc/util/Janitor.c xercesc/util/KeyRefPair.hpp \ xercesc/util/KeyRefPair.c xercesc/util/KeyValuePair.hpp \ xercesc/util/KeyValuePair.c xercesc/util/KVStringPair.hpp \ xercesc/util/Mutexes.hpp xercesc/util/LogicalPath.c \ xercesc/util/NameIdPool.hpp xercesc/util/NameIdPool.c \ xercesc/util/NoSuchElementException.hpp \ xercesc/util/NullPointerException.hpp \ xercesc/util/NumberFormatException.hpp \ xercesc/util/OutOfMemoryException.hpp \ xercesc/util/PanicHandler.hpp xercesc/util/ParseException.hpp \ xercesc/util/PlatformUtils.hpp xercesc/util/PSVIUni.hpp \ xercesc/util/QName.hpp xercesc/util/RefArrayOf.hpp \ xercesc/util/RefArrayOf.c xercesc/util/RefArrayVectorOf.hpp \ xercesc/util/RefArrayVectorOf.c \ xercesc/util/RefHash2KeysTableOf.hpp \ xercesc/util/RefHash2KeysTableOf.c \ xercesc/util/RefHash3KeysIdPool.hpp \ xercesc/util/RefHash3KeysIdPool.c \ xercesc/util/RefHashTableOf.hpp xercesc/util/RefHashTableOf.c \ xercesc/util/RefStackOf.hpp xercesc/util/RefStackOf.c \ xercesc/util/RefVectorOf.hpp xercesc/util/RefVectorOf.c \ xercesc/util/regx/ASCIIRangeFactory.hpp \ xercesc/util/regx/BlockRangeFactory.hpp \ xercesc/util/regx/BMPattern.hpp \ xercesc/util/regx/CharToken.hpp \ xercesc/util/regx/ClosureToken.hpp \ xercesc/util/regx/ConcatToken.hpp xercesc/util/regx/Match.hpp \ xercesc/util/regx/Op.hpp xercesc/util/regx/OpFactory.hpp \ xercesc/util/regx/ParenToken.hpp \ xercesc/util/regx/ParserForXMLSchema.hpp \ xercesc/util/regx/RangeFactory.hpp \ xercesc/util/regx/RangeToken.hpp \ xercesc/util/regx/RangeTokenMap.hpp \ xercesc/util/regx/RegularExpression.hpp \ xercesc/util/regx/RegxDefs.hpp \ xercesc/util/regx/RegxParser.hpp \ xercesc/util/regx/RegxUtil.hpp \ xercesc/util/regx/StringToken.hpp xercesc/util/regx/Token.hpp \ xercesc/util/regx/TokenFactory.hpp \ xercesc/util/regx/TokenInc.hpp \ xercesc/util/regx/UniCharTable.hpp \ xercesc/util/regx/UnicodeRangeFactory.hpp \ xercesc/util/regx/UnionToken.hpp \ xercesc/util/regx/XMLRangeFactory.hpp \ xercesc/util/regx/XMLUniCharacter.hpp \ xercesc/util/RuntimeException.hpp \ xercesc/util/SchemaDateTimeException.hpp \ xercesc/util/SecurityManager.hpp xercesc/util/StringPool.hpp \ xercesc/util/SynchronizedStringPool.hpp \ xercesc/util/TranscodingException.hpp \ xercesc/util/TransENameMap.hpp xercesc/util/TransENameMap.c \ xercesc/util/TransService.hpp \ xercesc/util/UnexpectedEOFException.hpp \ xercesc/util/UnsupportedEncodingException.hpp \ xercesc/util/UTFDataFormatException.hpp \ xercesc/util/ValueArrayOf.hpp xercesc/util/ValueArrayOf.c \ xercesc/util/ValueHashTableOf.hpp \ xercesc/util/ValueHashTableOf.c xercesc/util/ValueStackOf.hpp \ xercesc/util/ValueStackOf.c xercesc/util/ValueVectorOf.hpp \ xercesc/util/ValueVectorOf.c xercesc/util/XercesDefs.hpp \ xercesc/util/XMemory.hpp \ xercesc/util/XML256TableTranscoder.hpp \ xercesc/util/XML88591Transcoder.hpp \ xercesc/util/XMLAbstractDoubleFloat.hpp \ xercesc/util/XMLASCIITranscoder.hpp \ xercesc/util/XMLBigDecimal.hpp xercesc/util/XMLBigInteger.hpp \ xercesc/util/XMLChar.hpp xercesc/util/XMLChTranscoder.hpp \ xercesc/util/XMLDateTime.hpp xercesc/util/XMLDOMMsg.hpp \ xercesc/util/XMLDouble.hpp \ xercesc/util/XMLEBCDICTranscoder.hpp \ xercesc/util/XMLEntityResolver.hpp \ xercesc/util/XMLEnumerator.hpp xercesc/util/XMLException.hpp \ xercesc/util/XMLExceptMsgs.hpp xercesc/util/XMLFileMgr.hpp \ xercesc/util/XMLFloat.hpp \ xercesc/util/XMLIBM1047Transcoder.hpp \ xercesc/util/XMLIBM1140Transcoder.hpp \ xercesc/util/XMLInitializer.hpp xercesc/util/XMLInteger.hpp \ xercesc/util/XMLMutexMgr.hpp xercesc/util/XMLMsgLoader.hpp \ xercesc/util/XMLNetAccessor.hpp xercesc/util/XMLNumber.hpp \ xercesc/util/XMLResourceIdentifier.hpp \ xercesc/util/XMLString.hpp xercesc/util/XMLStringTokenizer.hpp \ xercesc/util/XMLUCS4Transcoder.hpp xercesc/util/XMLUni.hpp \ xercesc/util/XMLUniDefs.hpp xercesc/util/XMLUri.hpp \ xercesc/util/XMLURL.hpp xercesc/util/XMLUTF16Transcoder.hpp \ xercesc/util/XMLUTF8Transcoder.hpp \ xercesc/util/XMLWin1252Transcoder.hpp xercesc/dom/DOM.hpp \ xercesc/dom/DOMAttr.hpp xercesc/dom/DOMCDATASection.hpp \ xercesc/dom/DOMCharacterData.hpp xercesc/dom/DOMComment.hpp \ xercesc/dom/DOMConfiguration.hpp xercesc/dom/DOMDocument.hpp \ xercesc/dom/DOMDocumentFragment.hpp \ xercesc/dom/DOMDocumentRange.hpp \ xercesc/dom/DOMDocumentTraversal.hpp \ xercesc/dom/DOMDocumentType.hpp xercesc/dom/DOMElement.hpp \ xercesc/dom/DOMEntity.hpp xercesc/dom/DOMEntityReference.hpp \ xercesc/dom/DOMError.hpp xercesc/dom/DOMErrorHandler.hpp \ xercesc/dom/DOMException.hpp xercesc/dom/DOMImplementation.hpp \ xercesc/dom/DOMImplementationList.hpp \ xercesc/dom/DOMImplementationLS.hpp \ xercesc/dom/DOMImplementationRegistry.hpp \ xercesc/dom/DOMImplementationSource.hpp \ xercesc/dom/DOMLocator.hpp xercesc/dom/DOMLSException.hpp \ xercesc/dom/DOMLSInput.hpp xercesc/dom/DOMLSOutput.hpp \ xercesc/dom/DOMLSParser.hpp xercesc/dom/DOMLSParserFilter.hpp \ xercesc/dom/DOMLSResourceResolver.hpp \ xercesc/dom/DOMLSSerializer.hpp \ xercesc/dom/DOMLSSerializerFilter.hpp \ xercesc/dom/DOMMemoryManager.hpp \ xercesc/dom/DOMNamedNodeMap.hpp xercesc/dom/DOMNode.hpp \ xercesc/dom/DOMNodeFilter.hpp xercesc/dom/DOMNodeIterator.hpp \ xercesc/dom/DOMNodeList.hpp xercesc/dom/DOMNotation.hpp \ xercesc/dom/DOMProcessingInstruction.hpp \ xercesc/dom/DOMPSVITypeInfo.hpp xercesc/dom/DOMRange.hpp \ xercesc/dom/DOMRangeException.hpp \ xercesc/dom/DOMStringList.hpp xercesc/dom/DOMText.hpp \ xercesc/dom/DOMTreeWalker.hpp xercesc/dom/DOMTypeInfo.hpp \ xercesc/dom/DOMUserDataHandler.hpp \ xercesc/dom/DOMXPathEvaluator.hpp \ xercesc/dom/DOMXPathException.hpp \ xercesc/dom/DOMXPathExpression.hpp \ xercesc/dom/DOMXPathNamespace.hpp \ xercesc/dom/DOMXPathNSResolver.hpp \ xercesc/dom/DOMXPathResult.hpp xercesc/dom/StDOMNode.hpp \ xercesc/dom/impl/DOMAttrImpl.hpp \ xercesc/dom/impl/DOMAttrMapImpl.hpp \ xercesc/dom/impl/DOMAttrNSImpl.hpp \ xercesc/dom/impl/DOMCasts.hpp \ xercesc/dom/impl/DOMCDATASectionImpl.hpp \ xercesc/dom/impl/DOMCharacterDataImpl.hpp \ xercesc/dom/impl/DOMChildNode.hpp \ xercesc/dom/impl/DOMCommentImpl.hpp \ xercesc/dom/impl/DOMConfigurationImpl.hpp \ xercesc/dom/impl/DOMDeepNodeListImpl.hpp \ xercesc/dom/impl/DOMDeepNodeListPool.hpp \ xercesc/dom/impl/DOMDeepNodeListPool.c \ xercesc/dom/impl/DOMDocumentFragmentImpl.hpp \ xercesc/dom/impl/DOMDocumentImpl.hpp \ xercesc/dom/impl/DOMDocumentTypeImpl.hpp \ xercesc/dom/impl/DOMElementImpl.hpp \ xercesc/dom/impl/DOMElementNSImpl.hpp \ xercesc/dom/impl/DOMEntityImpl.hpp \ xercesc/dom/impl/DOMEntityReferenceImpl.hpp \ xercesc/dom/impl/DOMErrorImpl.hpp \ xercesc/dom/impl/DOMImplementationImpl.hpp \ xercesc/dom/impl/DOMImplementationListImpl.hpp \ xercesc/dom/impl/DOMLocatorImpl.hpp \ xercesc/dom/impl/DOMNamedNodeMapImpl.hpp \ xercesc/dom/impl/DOMNodeBase.hpp \ xercesc/dom/impl/DOMNodeIDMap.hpp \ xercesc/dom/impl/DOMNodeImpl.hpp \ xercesc/dom/impl/DOMNodeIteratorImpl.hpp \ xercesc/dom/impl/DOMNodeListImpl.hpp \ xercesc/dom/impl/DOMNodeVector.hpp \ xercesc/dom/impl/DOMNormalizer.hpp \ xercesc/dom/impl/DOMNotationImpl.hpp \ xercesc/dom/impl/DOMParentNode.hpp \ xercesc/dom/impl/DOMProcessingInstructionImpl.hpp \ xercesc/dom/impl/DOMRangeImpl.hpp \ xercesc/dom/impl/DOMStringListImpl.hpp \ xercesc/dom/impl/DOMStringPool.hpp \ xercesc/dom/impl/DOMTextImpl.hpp \ xercesc/dom/impl/DOMTreeWalkerImpl.hpp \ xercesc/dom/impl/DOMTypeInfoImpl.hpp \ xercesc/dom/impl/DOMLSSerializerImpl.hpp \ xercesc/dom/impl/DOMLSInputImpl.hpp \ xercesc/dom/impl/DOMLSOutputImpl.hpp \ xercesc/dom/impl/DOMXPathExpressionImpl.hpp \ xercesc/dom/impl/DOMXPathNSResolverImpl.hpp \ xercesc/dom/impl/DOMXPathResultImpl.hpp \ xercesc/dom/impl/XSDElementNSImpl.hpp \ xercesc/framework/BinOutputStream.hpp \ xercesc/framework/LocalFileFormatTarget.hpp \ xercesc/framework/LocalFileInputSource.hpp \ xercesc/framework/MemBufFormatTarget.hpp \ xercesc/framework/MemBufInputSource.hpp \ xercesc/framework/MemoryManager.hpp \ xercesc/framework/psvi/PSVIAttribute.hpp \ xercesc/framework/psvi/PSVIAttributeList.hpp \ xercesc/framework/psvi/PSVIElement.hpp \ xercesc/framework/psvi/PSVIHandler.hpp \ xercesc/framework/psvi/PSVIItem.hpp \ xercesc/framework/psvi/XSAnnotation.hpp \ xercesc/framework/psvi/XSAttributeDeclaration.hpp \ xercesc/framework/psvi/XSAttributeGroupDefinition.hpp \ xercesc/framework/psvi/XSAttributeUse.hpp \ xercesc/framework/psvi/XSComplexTypeDefinition.hpp \ xercesc/framework/psvi/XSConstants.hpp \ xercesc/framework/psvi/XSElementDeclaration.hpp \ xercesc/framework/psvi/XSFacet.hpp \ xercesc/framework/psvi/XSIDCDefinition.hpp \ xercesc/framework/psvi/XSModel.hpp \ xercesc/framework/psvi/XSModelGroup.hpp \ xercesc/framework/psvi/XSModelGroupDefinition.hpp \ xercesc/framework/psvi/XSMultiValueFacet.hpp \ xercesc/framework/psvi/XSNamedMap.hpp \ xercesc/framework/psvi/XSNamedMap.c \ xercesc/framework/psvi/XSNamespaceItem.hpp \ xercesc/framework/psvi/XSNotationDeclaration.hpp \ xercesc/framework/psvi/XSObject.hpp \ xercesc/framework/psvi/XSParticle.hpp \ xercesc/framework/psvi/XSSimpleTypeDefinition.hpp \ xercesc/framework/psvi/XSTypeDefinition.hpp \ xercesc/framework/psvi/XSValue.hpp \ xercesc/framework/psvi/XSWildcard.hpp \ xercesc/framework/StdInInputSource.hpp \ xercesc/framework/StdOutFormatTarget.hpp \ xercesc/framework/URLInputSource.hpp \ xercesc/framework/ValidationContext.hpp \ xercesc/framework/Wrapper4DOMLSInput.hpp \ xercesc/framework/Wrapper4InputSource.hpp \ xercesc/framework/XMLAttDef.hpp \ xercesc/framework/XMLAttDefList.hpp \ xercesc/framework/XMLAttr.hpp xercesc/framework/XMLBuffer.hpp \ xercesc/framework/XMLBufferMgr.hpp \ xercesc/framework/XMLContentModel.hpp \ xercesc/framework/XMLDocumentHandler.hpp \ xercesc/framework/XMLDTDDescription.hpp \ xercesc/framework/XMLElementDecl.hpp \ xercesc/framework/XMLEntityDecl.hpp \ xercesc/framework/XMLEntityHandler.hpp \ xercesc/framework/XMLErrorCodes.hpp \ xercesc/framework/XMLErrorReporter.hpp \ xercesc/framework/XMLFormatter.hpp \ xercesc/framework/XMLGrammarDescription.hpp \ xercesc/framework/XMLGrammarPool.hpp \ xercesc/framework/XMLGrammarPoolImpl.hpp \ xercesc/framework/XMLNotationDecl.hpp \ xercesc/framework/XMLPScanToken.hpp \ xercesc/framework/XMLRecognizer.hpp \ xercesc/framework/XMLRefInfo.hpp \ xercesc/framework/XMLSchemaDescription.hpp \ xercesc/framework/XMLValidator.hpp \ xercesc/framework/XMLValidityCodes.hpp \ xercesc/internal/BinFileOutputStream.hpp \ xercesc/internal/BinMemOutputStream.hpp \ xercesc/internal/CharTypeTables.hpp \ xercesc/internal/DGXMLScanner.hpp \ xercesc/internal/ElemStack.hpp \ xercesc/internal/EndOfEntityException.hpp \ xercesc/internal/IANAEncodings.hpp \ xercesc/internal/IGXMLScanner.hpp \ xercesc/internal/MemoryManagerImpl.hpp \ xercesc/internal/ReaderMgr.hpp \ xercesc/internal/SGXMLScanner.hpp \ xercesc/internal/ValidationContextImpl.hpp \ xercesc/internal/VecAttributesImpl.hpp \ xercesc/internal/VecAttrListImpl.hpp \ xercesc/internal/WFXMLScanner.hpp \ xercesc/internal/XMLInternalErrorHandler.hpp \ xercesc/internal/XMLReader.hpp xercesc/internal/XMLScanner.hpp \ xercesc/internal/XMLScannerResolver.hpp \ xercesc/internal/XProtoType.hpp \ xercesc/internal/XSAXMLScanner.hpp \ xercesc/internal/XSerializable.hpp \ xercesc/internal/XSerializationException.hpp \ xercesc/internal/XSerializeEngine.hpp \ xercesc/internal/XSObjectFactory.hpp \ xercesc/internal/XTemplateSerializer.hpp \ xercesc/parsers/AbstractDOMParser.hpp \ xercesc/parsers/DOMLSParserImpl.hpp \ xercesc/parsers/SAX2XMLFilterImpl.hpp \ xercesc/parsers/SAX2XMLReaderImpl.hpp \ xercesc/parsers/SAXParser.hpp \ xercesc/parsers/XercesDOMParser.hpp \ xercesc/sax/AttributeList.hpp xercesc/sax/DocumentHandler.hpp \ xercesc/sax/DTDHandler.hpp xercesc/sax/EntityResolver.hpp \ xercesc/sax/ErrorHandler.hpp xercesc/sax/HandlerBase.hpp \ xercesc/sax/InputSource.hpp xercesc/sax/Locator.hpp \ xercesc/sax/Parser.hpp xercesc/sax/SAXException.hpp \ xercesc/sax/SAXParseException.hpp xercesc/sax2/Attributes.hpp \ xercesc/sax2/ContentHandler.hpp xercesc/sax2/DeclHandler.hpp \ xercesc/sax2/DefaultHandler.hpp \ xercesc/sax2/LexicalHandler.hpp xercesc/sax2/SAX2XMLFilter.hpp \ xercesc/sax2/SAX2XMLReader.hpp \ xercesc/sax2/XMLReaderFactory.hpp \ xercesc/validators/common/AllContentModel.hpp \ xercesc/validators/common/CMAny.hpp \ xercesc/validators/common/CMBinaryOp.hpp \ xercesc/validators/common/CMLeaf.hpp \ xercesc/validators/common/CMRepeatingLeaf.hpp \ xercesc/validators/common/CMNode.hpp \ xercesc/validators/common/CMStateSet.hpp \ xercesc/validators/common/CMUnaryOp.hpp \ xercesc/validators/common/ContentLeafNameTypeVector.hpp \ xercesc/validators/common/ContentSpecNode.hpp \ xercesc/validators/common/DFAContentModel.hpp \ xercesc/validators/common/Grammar.hpp \ xercesc/validators/common/GrammarResolver.hpp \ xercesc/validators/common/MixedContentModel.hpp \ xercesc/validators/common/SimpleContentModel.hpp \ xercesc/validators/datatype/AbstractNumericFacetValidator.hpp \ xercesc/validators/datatype/AbstractNumericValidator.hpp \ xercesc/validators/datatype/AbstractStringValidator.hpp \ xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.hpp \ xercesc/validators/datatype/AnyURIDatatypeValidator.hpp \ xercesc/validators/datatype/Base64BinaryDatatypeValidator.hpp \ xercesc/validators/datatype/BooleanDatatypeValidator.hpp \ xercesc/validators/datatype/DatatypeValidator.hpp \ xercesc/validators/datatype/DatatypeValidatorFactory.hpp \ xercesc/validators/datatype/DateDatatypeValidator.hpp \ xercesc/validators/datatype/DateTimeDatatypeValidator.hpp \ xercesc/validators/datatype/DateTimeValidator.hpp \ xercesc/validators/datatype/DayDatatypeValidator.hpp \ xercesc/validators/datatype/DecimalDatatypeValidator.hpp \ xercesc/validators/datatype/DoubleDatatypeValidator.hpp \ xercesc/validators/datatype/DurationDatatypeValidator.hpp \ xercesc/validators/datatype/ENTITYDatatypeValidator.hpp \ xercesc/validators/datatype/FloatDatatypeValidator.hpp \ xercesc/validators/datatype/HexBinaryDatatypeValidator.hpp \ xercesc/validators/datatype/IDDatatypeValidator.hpp \ xercesc/validators/datatype/IDREFDatatypeValidator.hpp \ xercesc/validators/datatype/InvalidDatatypeFacetException.hpp \ xercesc/validators/datatype/InvalidDatatypeValueException.hpp \ xercesc/validators/datatype/ListDatatypeValidator.hpp \ xercesc/validators/datatype/MonthDatatypeValidator.hpp \ xercesc/validators/datatype/MonthDayDatatypeValidator.hpp \ xercesc/validators/datatype/NameDatatypeValidator.hpp \ xercesc/validators/datatype/NCNameDatatypeValidator.hpp \ xercesc/validators/datatype/NOTATIONDatatypeValidator.hpp \ xercesc/validators/datatype/QNameDatatypeValidator.hpp \ xercesc/validators/datatype/StringDatatypeValidator.hpp \ xercesc/validators/datatype/TimeDatatypeValidator.hpp \ xercesc/validators/datatype/UnionDatatypeValidator.hpp \ xercesc/validators/datatype/XMLCanRepGroup.hpp \ xercesc/validators/datatype/YearDatatypeValidator.hpp \ xercesc/validators/datatype/YearMonthDatatypeValidator.hpp \ xercesc/validators/DTD/DocTypeHandler.hpp \ xercesc/validators/DTD/DTDAttDef.hpp \ xercesc/validators/DTD/DTDAttDefList.hpp \ xercesc/validators/DTD/DTDElementDecl.hpp \ xercesc/validators/DTD/DTDEntityDecl.hpp \ xercesc/validators/DTD/DTDGrammar.hpp \ xercesc/validators/DTD/DTDScanner.hpp \ xercesc/validators/DTD/DTDValidator.hpp \ xercesc/validators/DTD/XMLDTDDescriptionImpl.hpp \ xercesc/validators/schema/ComplexTypeInfo.hpp \ xercesc/validators/schema/GeneralAttributeCheck.hpp \ xercesc/validators/schema/identity/FieldActivator.hpp \ xercesc/validators/schema/identity/FieldValueMap.hpp \ xercesc/validators/schema/identity/IC_Field.hpp \ xercesc/validators/schema/identity/IC_Key.hpp \ xercesc/validators/schema/identity/IC_KeyRef.hpp \ xercesc/validators/schema/identity/IC_Selector.hpp \ xercesc/validators/schema/identity/IC_Unique.hpp \ xercesc/validators/schema/identity/IdentityConstraint.hpp \ xercesc/validators/schema/identity/IdentityConstraintHandler.hpp \ xercesc/validators/schema/identity/ValueStore.hpp \ xercesc/validators/schema/identity/ValueStoreCache.hpp \ xercesc/validators/schema/identity/XercesXPath.hpp \ xercesc/validators/schema/identity/XPathException.hpp \ xercesc/validators/schema/identity/XPathMatcher.hpp \ xercesc/validators/schema/identity/XPathMatcherStack.hpp \ xercesc/validators/schema/identity/XPathSymbols.hpp \ xercesc/validators/schema/NamespaceScope.hpp \ xercesc/validators/schema/PSVIDefs.hpp \ xercesc/validators/schema/SchemaAttDef.hpp \ xercesc/validators/schema/SchemaAttDefList.hpp \ xercesc/validators/schema/SchemaElementDecl.hpp \ xercesc/validators/schema/SchemaGrammar.hpp \ xercesc/validators/schema/SchemaInfo.hpp \ xercesc/validators/schema/SchemaSymbols.hpp \ xercesc/validators/schema/SchemaValidator.hpp \ xercesc/validators/schema/SubstitutionGroupComparator.hpp \ xercesc/validators/schema/TraverseSchema.hpp \ xercesc/validators/schema/XercesAttGroupInfo.hpp \ xercesc/validators/schema/XercesElementWildcard.hpp \ xercesc/validators/schema/XercesGroupInfo.hpp \ xercesc/validators/schema/XMLSchemaDescriptionImpl.hpp \ xercesc/validators/schema/XSDDOMParser.hpp \ xercesc/validators/schema/XSDErrorReporter.hpp \ xercesc/validators/schema/XSDLocator.hpp \ xercesc/validators/schema/XUtil.hpp \ xercesc/xinclude/XIncludeDOMDocumentProcessor.hpp \ xercesc/xinclude/XIncludeLocation.hpp \ xercesc/xinclude/XIncludeUtils.hpp \ xercesc/util/NetAccessors/Curl/CurlNetAccessor.hpp \ xercesc/util/NetAccessors/Curl/CurlURLInputStream.hpp \ xercesc/util/NetAccessors/Socket/SocketNetAccessor.hpp \ xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.hpp \ xercesc/util/NetAccessors/BinHTTPInputStreamCommon.hpp \ xercesc/util/NetAccessors/MacOSURLAccessCF/MacOSURLAccessCF.hpp \ xercesc/util/NetAccessors/MacOSURLAccessCF/URLAccessCFBinInputStream.hpp \ xercesc/util/NetAccessors/WinSock/WinSockNetAccessor.hpp \ xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.hpp \ xercesc/util/Transcoders/ICU/ICUTransService.hpp \ xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.hpp \ xercesc/util/Transcoders/Iconv/IconvTransService.hpp \ xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp \ xercesc/util/Transcoders/Win32/Win32TransService.hpp \ xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.hpp \ xercesc/util/MsgLoaders/InMemory/XercesMessages_en_US.hpp \ xercesc/util/MsgLoaders/ICU/ICUMsgLoader.hpp \ xercesc/util/MsgLoaders/MsgCatalog/MsgCatalogLoader.hpp \ xercesc/util/MsgLoaders/MsgCatalog/XMLMsgCat_Ids.hpp \ xercesc/util/MutexManagers/NoThreadMutexMgr.hpp \ xercesc/util/MutexManagers/StdMutexMgr.hpp \ xercesc/util/MutexManagers/PosixMutexMgr.hpp \ xercesc/util/MutexManagers/WindowsMutexMgr.hpp \ xercesc/util/FileManagers/PosixFileMgr.hpp \ xercesc/util/FileManagers/WindowsFileMgr.hpp HEADERS = $(nobase_libxerces_c_la_HEADERS) \ $(nodist_autoconfheaders_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \ stricmp.c strnicmp.c towlower.c towupper.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_SHARED = @BUILD_SHARED@ BUILD_STATIC = @BUILD_STATIC@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURL_FLAGS = @CURL_FLAGS@ CURL_LIBS = @CURL_LIBS@ CURL_PRESENT = @CURL_PRESENT@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ -DXERCES_BUILDING_LIBRARY DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICU_BIN = @ICU_BIN@ ICU_FLAGS = @ICU_FLAGS@ ICU_LIBS = @ICU_LIBS@ ICU_PRESENT = @ICU_PRESENT@ ICU_SBIN = @ICU_SBIN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERFACE_VERSION_D = @INTERFACE_VERSION_D@ INTERFACE_VERSION_MAJOR = @INTERFACE_VERSION_MAJOR@ INTERFACE_VERSION_MINOR = @INTERFACE_VERSION_MINOR@ INTERFACE_VERSION_U = @INTERFACE_VERSION_U@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHREXT = @SHREXT@ STRIP = @STRIP@ VERSION = @VERSION@ XERCES_VERSION_MAJOR = @XERCES_VERSION_MAJOR@ XERCES_VERSION_MINOR = @XERCES_VERSION_MINOR@ XERCES_VERSION_REVISION = @XERCES_VERSION_REVISION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ curl_config = @curl_config@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ icu_config = @icu_config@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # # lib_LTLIBRARIES = libxerces-c.la # Use AM_* variables instead of per-target ones otherwise the # make pretty-printing won't work. # AM_CPPFLAGS = $(am__append_3) $(am__append_12) $(am__append_25) libxerces_c_la_LDFLAGS = -release @INTERFACE_VERSION_D@ # This sets {install}/include as target for the headers libxerces_c_ladir = ${includedir} libxerces_c_la_SOURCES = ${util_sources} ${dom_sources} \ ${domimpl_sources} ${framework_sources} ${internal_sources} \ ${parsers_sources} ${sax_sources} ${sax2_sources} \ ${validators_sources} ${xinclude_sources} $(am__append_1) \ $(am__append_4) $(am__append_6) $(am__append_8) \ $(am__append_10) $(am__append_13) $(am__append_15) \ $(am__append_17) $(am__append_19) $(am__append_21) \ $(am__append_23) $(am__append_26) $(am__append_28) \ $(am__append_30) $(am__append_32) $(am__append_34) \ $(am__append_36) $(am__append_38) nobase_libxerces_c_la_HEADERS = ${util_headers} ${dom_headers} \ ${domimpl_headers} ${framework_headers} ${internal_headers} \ ${parsers_headers} ${sax_headers} ${sax2_headers} \ ${validators_headers} ${xinclude_headers} $(am__append_2) \ $(am__append_5) $(am__append_7) $(am__append_9) \ $(am__append_11) $(am__append_14) $(am__append_16) \ $(am__append_18) $(am__append_20) $(am__append_22) \ $(am__append_24) $(am__append_27) $(am__append_29) \ $(am__append_31) $(am__append_33) $(am__append_35) \ $(am__append_37) $(am__append_39) # Make sure autoconf-generated Xerces_autoconf_config.hpp and # XercesVersion.hpp end up in a proper place when installed. # autoconfheadersdir = $(includedir)/xercesc/util nodist_autoconfheaders_HEADERS = \ ${top_builddir}/src/xercesc/util/Xerces_autoconf_config.hpp \ ${top_builddir}/src/xercesc/util/XercesVersion.hpp # Compatibility library. # EXTRA_DIST = CMakeLists.txt \ XercesCConfig.cmake.in \ stricmp.h strnicmp.h towlower.h towupper.h \ xercesc/NLS \ xercesc/util/Xerces_autoconf_config.hpp.cmake.in \ xercesc/util/XercesVersion.hpp.cmake.in \ xercesc/util/version.rc.cmake.in \ xercesc/util/MsgLoaders/ICU/resources libxerces_c_la_LIBADD = ${LTLIBOBJS} @XERCES_USE_MSGLOADER_ICU_TRUE@nodist_libxerces_c_la_SOURCES = ${msgicu_nodist_sources} # Resource shortname @XERCES_USE_MSGLOADER_ICONV_TRUE@PKGNAME = XercesMessages # Resource shortname @XERCES_USE_MSGLOADER_ICU_TRUE@PKGNAME = xercesc_messages_@INTERFACE_VERSION_U@ @XERCES_USE_MSGLOADER_ICU_TRUE@CLEANFILES = xercesc_messages.c root_res.c root.res @XERCES_USE_MSGLOADER_ICU_TRUE@BUILT_SOURCES = xercesc_messages.c root_res.c # Resource file @XERCES_USE_MSGLOADER_ICONV_TRUE@RESFILE = $(PKGNAME)_en_US.cat @XERCES_USE_MSGLOADER_ICONV_TRUE@iconv_msgdir = $(prefix)/msg @XERCES_USE_MSGLOADER_ICONV_TRUE@iconv_msg_DATA = $(RESFILE) # # Definition of sources/headers for each convenience library # # # A line like the following will generate a list of headers # for a given directory: (must be issued from src directory) # find xercesc/framework -name '*.hpp' -exec echo {} \\ ";" # find xercesc/framework -name '*.cpp' -exec echo {} \\ ";" # dom_headers = \ xercesc/dom/DOM.hpp \ xercesc/dom/DOMAttr.hpp \ xercesc/dom/DOMCDATASection.hpp \ xercesc/dom/DOMCharacterData.hpp \ xercesc/dom/DOMComment.hpp \ xercesc/dom/DOMConfiguration.hpp \ xercesc/dom/DOMDocument.hpp \ xercesc/dom/DOMDocumentFragment.hpp \ xercesc/dom/DOMDocumentRange.hpp \ xercesc/dom/DOMDocumentTraversal.hpp \ xercesc/dom/DOMDocumentType.hpp \ xercesc/dom/DOMElement.hpp \ xercesc/dom/DOMEntity.hpp \ xercesc/dom/DOMEntityReference.hpp \ xercesc/dom/DOMError.hpp \ xercesc/dom/DOMErrorHandler.hpp \ xercesc/dom/DOMException.hpp \ xercesc/dom/DOMImplementation.hpp \ xercesc/dom/DOMImplementationList.hpp \ xercesc/dom/DOMImplementationLS.hpp \ xercesc/dom/DOMImplementationRegistry.hpp \ xercesc/dom/DOMImplementationSource.hpp \ xercesc/dom/DOMLocator.hpp \ xercesc/dom/DOMLSException.hpp \ xercesc/dom/DOMLSInput.hpp \ xercesc/dom/DOMLSOutput.hpp \ xercesc/dom/DOMLSParser.hpp \ xercesc/dom/DOMLSParserFilter.hpp \ xercesc/dom/DOMLSResourceResolver.hpp \ xercesc/dom/DOMLSSerializer.hpp \ xercesc/dom/DOMLSSerializerFilter.hpp \ xercesc/dom/DOMMemoryManager.hpp \ xercesc/dom/DOMNamedNodeMap.hpp \ xercesc/dom/DOMNode.hpp \ xercesc/dom/DOMNodeFilter.hpp \ xercesc/dom/DOMNodeIterator.hpp \ xercesc/dom/DOMNodeList.hpp \ xercesc/dom/DOMNotation.hpp \ xercesc/dom/DOMProcessingInstruction.hpp \ xercesc/dom/DOMPSVITypeInfo.hpp \ xercesc/dom/DOMRange.hpp \ xercesc/dom/DOMRangeException.hpp \ xercesc/dom/DOMStringList.hpp \ xercesc/dom/DOMText.hpp \ xercesc/dom/DOMTreeWalker.hpp \ xercesc/dom/DOMTypeInfo.hpp \ xercesc/dom/DOMUserDataHandler.hpp \ xercesc/dom/DOMXPathEvaluator.hpp \ xercesc/dom/DOMXPathException.hpp \ xercesc/dom/DOMXPathExpression.hpp \ xercesc/dom/DOMXPathNamespace.hpp \ xercesc/dom/DOMXPathNSResolver.hpp \ xercesc/dom/DOMXPathResult.hpp \ xercesc/dom/StDOMNode.hpp dom_sources = \ xercesc/dom/DOMException.cpp \ xercesc/dom/DOMLSException.cpp \ xercesc/dom/DOMRangeException.cpp \ xercesc/dom/DOMXPathException.cpp domimpl_headers = \ xercesc/dom/impl/DOMAttrImpl.hpp \ xercesc/dom/impl/DOMAttrMapImpl.hpp \ xercesc/dom/impl/DOMAttrNSImpl.hpp \ xercesc/dom/impl/DOMCasts.hpp \ xercesc/dom/impl/DOMCDATASectionImpl.hpp \ xercesc/dom/impl/DOMCharacterDataImpl.hpp \ xercesc/dom/impl/DOMChildNode.hpp \ xercesc/dom/impl/DOMCommentImpl.hpp \ xercesc/dom/impl/DOMConfigurationImpl.hpp \ xercesc/dom/impl/DOMDeepNodeListImpl.hpp \ xercesc/dom/impl/DOMDeepNodeListPool.hpp \ xercesc/dom/impl/DOMDeepNodeListPool.c \ xercesc/dom/impl/DOMDocumentFragmentImpl.hpp \ xercesc/dom/impl/DOMDocumentImpl.hpp \ xercesc/dom/impl/DOMDocumentTypeImpl.hpp \ xercesc/dom/impl/DOMElementImpl.hpp \ xercesc/dom/impl/DOMElementNSImpl.hpp \ xercesc/dom/impl/DOMEntityImpl.hpp \ xercesc/dom/impl/DOMEntityReferenceImpl.hpp \ xercesc/dom/impl/DOMErrorImpl.hpp \ xercesc/dom/impl/DOMImplementationImpl.hpp \ xercesc/dom/impl/DOMImplementationListImpl.hpp \ xercesc/dom/impl/DOMLocatorImpl.hpp \ xercesc/dom/impl/DOMNamedNodeMapImpl.hpp \ xercesc/dom/impl/DOMNodeBase.hpp \ xercesc/dom/impl/DOMNodeIDMap.hpp \ xercesc/dom/impl/DOMNodeImpl.hpp \ xercesc/dom/impl/DOMNodeIteratorImpl.hpp \ xercesc/dom/impl/DOMNodeListImpl.hpp \ xercesc/dom/impl/DOMNodeVector.hpp \ xercesc/dom/impl/DOMNormalizer.hpp \ xercesc/dom/impl/DOMNotationImpl.hpp \ xercesc/dom/impl/DOMParentNode.hpp \ xercesc/dom/impl/DOMProcessingInstructionImpl.hpp \ xercesc/dom/impl/DOMRangeImpl.hpp \ xercesc/dom/impl/DOMStringListImpl.hpp \ xercesc/dom/impl/DOMStringPool.hpp \ xercesc/dom/impl/DOMTextImpl.hpp \ xercesc/dom/impl/DOMTreeWalkerImpl.hpp \ xercesc/dom/impl/DOMTypeInfoImpl.hpp \ xercesc/dom/impl/DOMLSSerializerImpl.hpp \ xercesc/dom/impl/DOMLSInputImpl.hpp \ xercesc/dom/impl/DOMLSOutputImpl.hpp \ xercesc/dom/impl/DOMXPathExpressionImpl.hpp \ xercesc/dom/impl/DOMXPathNSResolverImpl.hpp \ xercesc/dom/impl/DOMXPathResultImpl.hpp \ xercesc/dom/impl/XSDElementNSImpl.hpp domimpl_sources = \ xercesc/dom/impl/DOMAttrImpl.cpp \ xercesc/dom/impl/DOMAttrMapImpl.cpp \ xercesc/dom/impl/DOMAttrNSImpl.cpp \ xercesc/dom/impl/DOMCDATASectionImpl.cpp \ xercesc/dom/impl/DOMCharacterDataImpl.cpp \ xercesc/dom/impl/DOMChildNode.cpp \ xercesc/dom/impl/DOMCommentImpl.cpp \ xercesc/dom/impl/DOMConfigurationImpl.cpp \ xercesc/dom/impl/DOMDeepNodeListImpl.cpp \ xercesc/dom/impl/DOMDocumentFragmentImpl.cpp \ xercesc/dom/impl/DOMDocumentImpl.cpp \ xercesc/dom/impl/DOMDocumentTypeImpl.cpp \ xercesc/dom/impl/DOMElementImpl.cpp \ xercesc/dom/impl/DOMElementNSImpl.cpp \ xercesc/dom/impl/DOMEntityImpl.cpp \ xercesc/dom/impl/DOMEntityReferenceImpl.cpp \ xercesc/dom/impl/DOMErrorImpl.cpp \ xercesc/dom/impl/DOMImplementationImpl.cpp \ xercesc/dom/impl/DOMImplementationListImpl.cpp \ xercesc/dom/impl/DOMImplementationRegistry.cpp \ xercesc/dom/impl/DOMLocatorImpl.cpp \ xercesc/dom/impl/DOMNamedNodeMapImpl.cpp \ xercesc/dom/impl/DOMNodeIDMap.cpp \ xercesc/dom/impl/DOMNodeImpl.cpp \ xercesc/dom/impl/DOMNodeIteratorImpl.cpp \ xercesc/dom/impl/DOMNodeListImpl.cpp \ xercesc/dom/impl/DOMNodeVector.cpp \ xercesc/dom/impl/DOMNormalizer.cpp \ xercesc/dom/impl/DOMNotationImpl.cpp \ xercesc/dom/impl/DOMParentNode.cpp \ xercesc/dom/impl/DOMProcessingInstructionImpl.cpp \ xercesc/dom/impl/DOMRangeImpl.cpp \ xercesc/dom/impl/DOMStringListImpl.cpp \ xercesc/dom/impl/DOMStringPool.cpp \ xercesc/dom/impl/DOMTextImpl.cpp \ xercesc/dom/impl/DOMTreeWalkerImpl.cpp \ xercesc/dom/impl/DOMTypeInfoImpl.cpp \ xercesc/dom/impl/DOMLSSerializerImpl.cpp \ xercesc/dom/impl/DOMLSInputImpl.cpp \ xercesc/dom/impl/DOMLSOutputImpl.cpp \ xercesc/dom/impl/DOMXPathExpressionImpl.cpp \ xercesc/dom/impl/DOMXPathNSResolverImpl.cpp \ xercesc/dom/impl/DOMXPathResultImpl.cpp \ xercesc/dom/impl/XSDElementNSImpl.cpp framework_headers = \ xercesc/framework/BinOutputStream.hpp \ xercesc/framework/LocalFileFormatTarget.hpp \ xercesc/framework/LocalFileInputSource.hpp \ xercesc/framework/MemBufFormatTarget.hpp \ xercesc/framework/MemBufInputSource.hpp \ xercesc/framework/MemoryManager.hpp \ xercesc/framework/psvi/PSVIAttribute.hpp \ xercesc/framework/psvi/PSVIAttributeList.hpp \ xercesc/framework/psvi/PSVIElement.hpp \ xercesc/framework/psvi/PSVIHandler.hpp \ xercesc/framework/psvi/PSVIItem.hpp \ xercesc/framework/psvi/XSAnnotation.hpp \ xercesc/framework/psvi/XSAttributeDeclaration.hpp \ xercesc/framework/psvi/XSAttributeGroupDefinition.hpp \ xercesc/framework/psvi/XSAttributeUse.hpp \ xercesc/framework/psvi/XSComplexTypeDefinition.hpp \ xercesc/framework/psvi/XSConstants.hpp \ xercesc/framework/psvi/XSElementDeclaration.hpp \ xercesc/framework/psvi/XSFacet.hpp \ xercesc/framework/psvi/XSIDCDefinition.hpp \ xercesc/framework/psvi/XSModel.hpp \ xercesc/framework/psvi/XSModelGroup.hpp \ xercesc/framework/psvi/XSModelGroupDefinition.hpp \ xercesc/framework/psvi/XSMultiValueFacet.hpp \ xercesc/framework/psvi/XSNamedMap.hpp \ xercesc/framework/psvi/XSNamedMap.c \ xercesc/framework/psvi/XSNamespaceItem.hpp \ xercesc/framework/psvi/XSNotationDeclaration.hpp \ xercesc/framework/psvi/XSObject.hpp \ xercesc/framework/psvi/XSParticle.hpp \ xercesc/framework/psvi/XSSimpleTypeDefinition.hpp \ xercesc/framework/psvi/XSTypeDefinition.hpp \ xercesc/framework/psvi/XSValue.hpp \ xercesc/framework/psvi/XSWildcard.hpp \ xercesc/framework/StdInInputSource.hpp \ xercesc/framework/StdOutFormatTarget.hpp \ xercesc/framework/URLInputSource.hpp \ xercesc/framework/ValidationContext.hpp \ xercesc/framework/Wrapper4DOMLSInput.hpp \ xercesc/framework/Wrapper4InputSource.hpp \ xercesc/framework/XMLAttDef.hpp \ xercesc/framework/XMLAttDefList.hpp \ xercesc/framework/XMLAttr.hpp \ xercesc/framework/XMLBuffer.hpp \ xercesc/framework/XMLBufferMgr.hpp \ xercesc/framework/XMLContentModel.hpp \ xercesc/framework/XMLDocumentHandler.hpp \ xercesc/framework/XMLDTDDescription.hpp \ xercesc/framework/XMLElementDecl.hpp \ xercesc/framework/XMLEntityDecl.hpp \ xercesc/framework/XMLEntityHandler.hpp \ xercesc/framework/XMLErrorCodes.hpp \ xercesc/framework/XMLErrorReporter.hpp \ xercesc/framework/XMLFormatter.hpp \ xercesc/framework/XMLGrammarDescription.hpp \ xercesc/framework/XMLGrammarPool.hpp \ xercesc/framework/XMLGrammarPoolImpl.hpp \ xercesc/framework/XMLNotationDecl.hpp \ xercesc/framework/XMLPScanToken.hpp \ xercesc/framework/XMLRecognizer.hpp \ xercesc/framework/XMLRefInfo.hpp \ xercesc/framework/XMLSchemaDescription.hpp \ xercesc/framework/XMLValidator.hpp \ xercesc/framework/XMLValidityCodes.hpp framework_sources = \ xercesc/framework/BinOutputStream.cpp \ xercesc/framework/LocalFileFormatTarget.cpp \ xercesc/framework/LocalFileInputSource.cpp \ xercesc/framework/MemBufFormatTarget.cpp \ xercesc/framework/MemBufInputSource.cpp \ xercesc/framework/psvi/PSVIAttribute.cpp \ xercesc/framework/psvi/PSVIAttributeList.cpp \ xercesc/framework/psvi/PSVIElement.cpp \ xercesc/framework/psvi/PSVIItem.cpp \ xercesc/framework/psvi/XSAnnotation.cpp \ xercesc/framework/psvi/XSAttributeDeclaration.cpp \ xercesc/framework/psvi/XSAttributeGroupDefinition.cpp \ xercesc/framework/psvi/XSAttributeUse.cpp \ xercesc/framework/psvi/XSComplexTypeDefinition.cpp \ xercesc/framework/psvi/XSElementDeclaration.cpp \ xercesc/framework/psvi/XSFacet.cpp \ xercesc/framework/psvi/XSIDCDefinition.cpp \ xercesc/framework/psvi/XSModel.cpp \ xercesc/framework/psvi/XSModelGroup.cpp \ xercesc/framework/psvi/XSModelGroupDefinition.cpp \ xercesc/framework/psvi/XSMultiValueFacet.cpp \ xercesc/framework/psvi/XSNamespaceItem.cpp \ xercesc/framework/psvi/XSNotationDeclaration.cpp \ xercesc/framework/psvi/XSObject.cpp \ xercesc/framework/psvi/XSParticle.cpp \ xercesc/framework/psvi/XSSimpleTypeDefinition.cpp \ xercesc/framework/psvi/XSTypeDefinition.cpp \ xercesc/framework/psvi/XSValue.cpp \ xercesc/framework/psvi/XSWildcard.cpp \ xercesc/framework/StdInInputSource.cpp \ xercesc/framework/StdOutFormatTarget.cpp \ xercesc/framework/URLInputSource.cpp \ xercesc/framework/Wrapper4DOMLSInput.cpp \ xercesc/framework/Wrapper4InputSource.cpp \ xercesc/framework/XMLAttDef.cpp \ xercesc/framework/XMLAttDefList.cpp \ xercesc/framework/XMLAttr.cpp \ xercesc/framework/XMLBuffer.cpp \ xercesc/framework/XMLBufferMgr.cpp \ xercesc/framework/XMLContentModel.cpp \ xercesc/framework/XMLDTDDescription.cpp \ xercesc/framework/XMLElementDecl.cpp \ xercesc/framework/XMLEntityDecl.cpp \ xercesc/framework/XMLFormatter.cpp \ xercesc/framework/XMLGrammarDescription.cpp \ xercesc/framework/XMLGrammarPoolImpl.cpp \ xercesc/framework/XMLNotationDecl.cpp \ xercesc/framework/XMLRecognizer.cpp \ xercesc/framework/XMLRefInfo.cpp \ xercesc/framework/XMLSchemaDescription.cpp \ xercesc/framework/XMLValidator.cpp internal_headers = \ xercesc/internal/BinFileOutputStream.hpp \ xercesc/internal/BinMemOutputStream.hpp \ xercesc/internal/CharTypeTables.hpp \ xercesc/internal/DGXMLScanner.hpp \ xercesc/internal/ElemStack.hpp \ xercesc/internal/EndOfEntityException.hpp \ xercesc/internal/IANAEncodings.hpp \ xercesc/internal/IGXMLScanner.hpp \ xercesc/internal/MemoryManagerImpl.hpp \ xercesc/internal/ReaderMgr.hpp \ xercesc/internal/SGXMLScanner.hpp \ xercesc/internal/ValidationContextImpl.hpp \ xercesc/internal/VecAttributesImpl.hpp \ xercesc/internal/VecAttrListImpl.hpp \ xercesc/internal/WFXMLScanner.hpp \ xercesc/internal/XMLInternalErrorHandler.hpp \ xercesc/internal/XMLReader.hpp \ xercesc/internal/XMLScanner.hpp \ xercesc/internal/XMLScannerResolver.hpp \ xercesc/internal/XProtoType.hpp \ xercesc/internal/XSAXMLScanner.hpp \ xercesc/internal/XSerializable.hpp \ xercesc/internal/XSerializationException.hpp \ xercesc/internal/XSerializeEngine.hpp \ xercesc/internal/XSObjectFactory.hpp \ xercesc/internal/XTemplateSerializer.hpp internal_sources = \ xercesc/internal/BinFileOutputStream.cpp \ xercesc/internal/BinMemOutputStream.cpp \ xercesc/internal/DGXMLScanner.cpp \ xercesc/internal/ElemStack.cpp \ xercesc/internal/IGXMLScanner.cpp \ xercesc/internal/IGXMLScanner2.cpp \ xercesc/internal/MemoryManagerImpl.cpp \ xercesc/internal/ReaderMgr.cpp \ xercesc/internal/SGXMLScanner.cpp \ xercesc/internal/ValidationContextImpl.cpp \ xercesc/internal/VecAttributesImpl.cpp \ xercesc/internal/VecAttrListImpl.cpp \ xercesc/internal/WFXMLScanner.cpp \ xercesc/internal/XMLReader.cpp \ xercesc/internal/XMLScanner.cpp \ xercesc/internal/XMLScannerResolver.cpp \ xercesc/internal/XProtoType.cpp \ xercesc/internal/XSAXMLScanner.cpp \ xercesc/internal/XSerializeEngine.cpp \ xercesc/internal/XSObjectFactory.cpp \ xercesc/internal/XTemplateSerializer.cpp parsers_headers = \ xercesc/parsers/AbstractDOMParser.hpp \ xercesc/parsers/DOMLSParserImpl.hpp \ xercesc/parsers/SAX2XMLFilterImpl.hpp \ xercesc/parsers/SAX2XMLReaderImpl.hpp \ xercesc/parsers/SAXParser.hpp \ xercesc/parsers/XercesDOMParser.hpp parsers_sources = \ xercesc/parsers/AbstractDOMParser.cpp \ xercesc/parsers/DOMLSParserImpl.cpp \ xercesc/parsers/SAX2XMLFilterImpl.cpp \ xercesc/parsers/SAX2XMLReaderImpl.cpp \ xercesc/parsers/SAXParser.cpp \ xercesc/parsers/XercesDOMParser.cpp sax_headers = \ xercesc/sax/AttributeList.hpp \ xercesc/sax/DocumentHandler.hpp \ xercesc/sax/DTDHandler.hpp \ xercesc/sax/EntityResolver.hpp \ xercesc/sax/ErrorHandler.hpp \ xercesc/sax/HandlerBase.hpp \ xercesc/sax/InputSource.hpp \ xercesc/sax/Locator.hpp \ xercesc/sax/Parser.hpp \ xercesc/sax/SAXException.hpp \ xercesc/sax/SAXParseException.hpp sax_sources = \ xercesc/sax/Dummy.cpp \ xercesc/sax/InputSource.cpp \ xercesc/sax/SAXException.cpp \ xercesc/sax/SAXParseException.cpp sax2_headers = \ xercesc/sax2/Attributes.hpp \ xercesc/sax2/ContentHandler.hpp \ xercesc/sax2/DeclHandler.hpp \ xercesc/sax2/DefaultHandler.hpp \ xercesc/sax2/LexicalHandler.hpp \ xercesc/sax2/SAX2XMLFilter.hpp \ xercesc/sax2/SAX2XMLReader.hpp \ xercesc/sax2/XMLReaderFactory.hpp sax2_sources = \ xercesc/sax2/sax2Dummy.cpp util_headers = \ xercesc/util/ArrayIndexOutOfBoundsException.hpp \ xercesc/util/Base64.hpp \ xercesc/util/BaseRefVectorOf.hpp \ xercesc/util/BaseRefVectorOf.c \ xercesc/util/BinFileInputStream.hpp \ xercesc/util/BinInputStream.hpp \ xercesc/util/BinMemInputStream.hpp \ xercesc/util/BitOps.hpp \ xercesc/util/BitSet.hpp \ xercesc/util/CountedPointer.hpp \ xercesc/util/CountedPointer.c \ xercesc/util/DefaultPanicHandler.hpp \ xercesc/util/EmptyStackException.hpp \ xercesc/util/EncodingValidator.hpp \ xercesc/util/FlagJanitor.hpp \ xercesc/util/FlagJanitor.c \ xercesc/util/Hashers.hpp \ xercesc/util/Hash2KeysSetOf.hpp \ xercesc/util/Hash2KeysSetOf.c \ xercesc/util/HexBin.hpp \ xercesc/util/IllegalArgumentException.hpp \ xercesc/util/InvalidCastException.hpp \ xercesc/util/IOException.hpp \ xercesc/util/Janitor.hpp \ xercesc/util/Janitor.c \ xercesc/util/KeyRefPair.hpp \ xercesc/util/KeyRefPair.c \ xercesc/util/KeyValuePair.hpp \ xercesc/util/KeyValuePair.c \ xercesc/util/KVStringPair.hpp \ xercesc/util/Mutexes.hpp \ xercesc/util/LogicalPath.c \ xercesc/util/NameIdPool.hpp \ xercesc/util/NameIdPool.c \ xercesc/util/NoSuchElementException.hpp \ xercesc/util/NullPointerException.hpp \ xercesc/util/NumberFormatException.hpp \ xercesc/util/OutOfMemoryException.hpp \ xercesc/util/PanicHandler.hpp \ xercesc/util/ParseException.hpp \ xercesc/util/PlatformUtils.hpp \ xercesc/util/PSVIUni.hpp \ xercesc/util/QName.hpp \ xercesc/util/RefArrayOf.hpp \ xercesc/util/RefArrayOf.c \ xercesc/util/RefArrayVectorOf.hpp \ xercesc/util/RefArrayVectorOf.c \ xercesc/util/RefHash2KeysTableOf.hpp \ xercesc/util/RefHash2KeysTableOf.c \ xercesc/util/RefHash3KeysIdPool.hpp \ xercesc/util/RefHash3KeysIdPool.c \ xercesc/util/RefHashTableOf.hpp \ xercesc/util/RefHashTableOf.c \ xercesc/util/RefStackOf.hpp \ xercesc/util/RefStackOf.c \ xercesc/util/RefVectorOf.hpp \ xercesc/util/RefVectorOf.c \ xercesc/util/regx/ASCIIRangeFactory.hpp \ xercesc/util/regx/BlockRangeFactory.hpp \ xercesc/util/regx/BMPattern.hpp \ xercesc/util/regx/CharToken.hpp \ xercesc/util/regx/ClosureToken.hpp \ xercesc/util/regx/ConcatToken.hpp \ xercesc/util/regx/Match.hpp \ xercesc/util/regx/Op.hpp \ xercesc/util/regx/OpFactory.hpp \ xercesc/util/regx/ParenToken.hpp \ xercesc/util/regx/ParserForXMLSchema.hpp \ xercesc/util/regx/RangeFactory.hpp \ xercesc/util/regx/RangeToken.hpp \ xercesc/util/regx/RangeTokenMap.hpp \ xercesc/util/regx/RegularExpression.hpp \ xercesc/util/regx/RegxDefs.hpp \ xercesc/util/regx/RegxParser.hpp \ xercesc/util/regx/RegxUtil.hpp \ xercesc/util/regx/StringToken.hpp \ xercesc/util/regx/Token.hpp \ xercesc/util/regx/TokenFactory.hpp \ xercesc/util/regx/TokenInc.hpp \ xercesc/util/regx/UniCharTable.hpp \ xercesc/util/regx/UnicodeRangeFactory.hpp \ xercesc/util/regx/UnionToken.hpp \ xercesc/util/regx/XMLRangeFactory.hpp \ xercesc/util/regx/XMLUniCharacter.hpp \ xercesc/util/RuntimeException.hpp \ xercesc/util/SchemaDateTimeException.hpp \ xercesc/util/SecurityManager.hpp \ xercesc/util/StringPool.hpp \ xercesc/util/SynchronizedStringPool.hpp \ xercesc/util/TranscodingException.hpp \ xercesc/util/TransENameMap.hpp \ xercesc/util/TransENameMap.c \ xercesc/util/TransService.hpp \ xercesc/util/UnexpectedEOFException.hpp \ xercesc/util/UnsupportedEncodingException.hpp \ xercesc/util/UTFDataFormatException.hpp \ xercesc/util/ValueArrayOf.hpp \ xercesc/util/ValueArrayOf.c \ xercesc/util/ValueHashTableOf.hpp \ xercesc/util/ValueHashTableOf.c \ xercesc/util/ValueStackOf.hpp \ xercesc/util/ValueStackOf.c \ xercesc/util/ValueVectorOf.hpp \ xercesc/util/ValueVectorOf.c \ xercesc/util/XercesDefs.hpp \ xercesc/util/XMemory.hpp \ xercesc/util/XML256TableTranscoder.hpp \ xercesc/util/XML88591Transcoder.hpp \ xercesc/util/XMLAbstractDoubleFloat.hpp \ xercesc/util/XMLASCIITranscoder.hpp \ xercesc/util/XMLBigDecimal.hpp \ xercesc/util/XMLBigInteger.hpp \ xercesc/util/XMLChar.hpp \ xercesc/util/XMLChTranscoder.hpp \ xercesc/util/XMLDateTime.hpp \ xercesc/util/XMLDOMMsg.hpp \ xercesc/util/XMLDouble.hpp \ xercesc/util/XMLEBCDICTranscoder.hpp \ xercesc/util/XMLEntityResolver.hpp \ xercesc/util/XMLEnumerator.hpp \ xercesc/util/XMLException.hpp \ xercesc/util/XMLExceptMsgs.hpp \ xercesc/util/XMLFileMgr.hpp \ xercesc/util/XMLFloat.hpp \ xercesc/util/XMLIBM1047Transcoder.hpp \ xercesc/util/XMLIBM1140Transcoder.hpp \ xercesc/util/XMLInitializer.hpp \ xercesc/util/XMLInteger.hpp \ xercesc/util/XMLMutexMgr.hpp \ xercesc/util/XMLMsgLoader.hpp \ xercesc/util/XMLNetAccessor.hpp \ xercesc/util/XMLNumber.hpp \ xercesc/util/XMLResourceIdentifier.hpp \ xercesc/util/XMLString.hpp \ xercesc/util/XMLStringTokenizer.hpp \ xercesc/util/XMLUCS4Transcoder.hpp \ xercesc/util/XMLUni.hpp \ xercesc/util/XMLUniDefs.hpp \ xercesc/util/XMLUri.hpp \ xercesc/util/XMLURL.hpp \ xercesc/util/XMLUTF16Transcoder.hpp \ xercesc/util/XMLUTF8Transcoder.hpp \ xercesc/util/XMLWin1252Transcoder.hpp util_sources = \ xercesc/util/Base64.cpp \ xercesc/util/BinFileInputStream.cpp \ xercesc/util/BinInputStream.cpp \ xercesc/util/BinMemInputStream.cpp \ xercesc/util/BitSet.cpp \ xercesc/util/DefaultPanicHandler.cpp \ xercesc/util/EncodingValidator.cpp \ xercesc/util/HeaderDummy.cpp \ xercesc/util/HexBin.cpp \ xercesc/util/JanitorExports.cpp \ xercesc/util/KVStringPair.cpp \ xercesc/util/Mutexes.cpp \ xercesc/util/PanicHandler.cpp \ xercesc/util/PlatformUtils.cpp \ xercesc/util/PSVIUni.cpp \ xercesc/util/QName.cpp \ xercesc/util/regx/ASCIIRangeFactory.cpp \ xercesc/util/regx/BlockRangeFactory.cpp \ xercesc/util/regx/BMPattern.cpp \ xercesc/util/regx/CharToken.cpp \ xercesc/util/regx/ClosureToken.cpp \ xercesc/util/regx/ConcatToken.cpp \ xercesc/util/regx/Match.cpp \ xercesc/util/regx/Op.cpp \ xercesc/util/regx/OpFactory.cpp \ xercesc/util/regx/ParenToken.cpp \ xercesc/util/regx/ParserForXMLSchema.cpp \ xercesc/util/regx/RangeFactory.cpp \ xercesc/util/regx/RangeToken.cpp \ xercesc/util/regx/RangeTokenMap.cpp \ xercesc/util/regx/RegularExpression.cpp \ xercesc/util/regx/RegxParser.cpp \ xercesc/util/regx/RegxUtil.cpp \ xercesc/util/regx/StringToken.cpp \ xercesc/util/regx/Token.cpp \ xercesc/util/regx/TokenFactory.cpp \ xercesc/util/regx/UnicodeRangeFactory.cpp \ xercesc/util/regx/UnionToken.cpp \ xercesc/util/regx/XMLRangeFactory.cpp \ xercesc/util/regx/XMLUniCharacter.cpp \ xercesc/util/StringPool.cpp \ xercesc/util/SynchronizedStringPool.cpp \ xercesc/util/TransService.cpp \ xercesc/util/XMemory.cpp \ xercesc/util/XML256TableTranscoder.cpp \ xercesc/util/XML88591Transcoder.cpp \ xercesc/util/XMLAbstractDoubleFloat.cpp \ xercesc/util/XMLASCIITranscoder.cpp \ xercesc/util/XMLBigDecimal.cpp \ xercesc/util/XMLBigInteger.cpp \ xercesc/util/XMLChar.cpp \ xercesc/util/XMLChTranscoder.cpp \ xercesc/util/XMLDateTime.cpp \ xercesc/util/XMLDouble.cpp \ xercesc/util/XMLEBCDICTranscoder.cpp \ xercesc/util/XMLException.cpp \ xercesc/util/XMLFloat.cpp \ xercesc/util/XMLIBM1047Transcoder.cpp \ xercesc/util/XMLIBM1140Transcoder.cpp \ xercesc/util/XMLInitializer.cpp \ xercesc/util/XMLMsgLoader.cpp \ xercesc/util/XMLNumber.cpp \ xercesc/util/XMLString.cpp \ xercesc/util/XMLStringTokenizer.cpp \ xercesc/util/XMLUCS4Transcoder.cpp \ xercesc/util/XMLUni.cpp \ xercesc/util/XMLUri.cpp \ xercesc/util/XMLURL.cpp \ xercesc/util/XMLUTF16Transcoder.cpp \ xercesc/util/XMLUTF8Transcoder.cpp \ xercesc/util/XMLWin1252Transcoder.cpp validators_headers = \ xercesc/validators/common/AllContentModel.hpp \ xercesc/validators/common/CMAny.hpp \ xercesc/validators/common/CMBinaryOp.hpp \ xercesc/validators/common/CMLeaf.hpp \ xercesc/validators/common/CMRepeatingLeaf.hpp \ xercesc/validators/common/CMNode.hpp \ xercesc/validators/common/CMStateSet.hpp \ xercesc/validators/common/CMUnaryOp.hpp \ xercesc/validators/common/ContentLeafNameTypeVector.hpp \ xercesc/validators/common/ContentSpecNode.hpp \ xercesc/validators/common/DFAContentModel.hpp \ xercesc/validators/common/Grammar.hpp \ xercesc/validators/common/GrammarResolver.hpp \ xercesc/validators/common/MixedContentModel.hpp \ xercesc/validators/common/SimpleContentModel.hpp \ xercesc/validators/datatype/AbstractNumericFacetValidator.hpp \ xercesc/validators/datatype/AbstractNumericValidator.hpp \ xercesc/validators/datatype/AbstractStringValidator.hpp \ xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.hpp \ xercesc/validators/datatype/AnyURIDatatypeValidator.hpp \ xercesc/validators/datatype/Base64BinaryDatatypeValidator.hpp \ xercesc/validators/datatype/BooleanDatatypeValidator.hpp \ xercesc/validators/datatype/DatatypeValidator.hpp \ xercesc/validators/datatype/DatatypeValidatorFactory.hpp \ xercesc/validators/datatype/DateDatatypeValidator.hpp \ xercesc/validators/datatype/DateTimeDatatypeValidator.hpp \ xercesc/validators/datatype/DateTimeValidator.hpp \ xercesc/validators/datatype/DayDatatypeValidator.hpp \ xercesc/validators/datatype/DecimalDatatypeValidator.hpp \ xercesc/validators/datatype/DoubleDatatypeValidator.hpp \ xercesc/validators/datatype/DurationDatatypeValidator.hpp \ xercesc/validators/datatype/ENTITYDatatypeValidator.hpp \ xercesc/validators/datatype/FloatDatatypeValidator.hpp \ xercesc/validators/datatype/HexBinaryDatatypeValidator.hpp \ xercesc/validators/datatype/IDDatatypeValidator.hpp \ xercesc/validators/datatype/IDREFDatatypeValidator.hpp \ xercesc/validators/datatype/InvalidDatatypeFacetException.hpp \ xercesc/validators/datatype/InvalidDatatypeValueException.hpp \ xercesc/validators/datatype/ListDatatypeValidator.hpp \ xercesc/validators/datatype/MonthDatatypeValidator.hpp \ xercesc/validators/datatype/MonthDayDatatypeValidator.hpp \ xercesc/validators/datatype/NameDatatypeValidator.hpp \ xercesc/validators/datatype/NCNameDatatypeValidator.hpp \ xercesc/validators/datatype/NOTATIONDatatypeValidator.hpp \ xercesc/validators/datatype/QNameDatatypeValidator.hpp \ xercesc/validators/datatype/StringDatatypeValidator.hpp \ xercesc/validators/datatype/TimeDatatypeValidator.hpp \ xercesc/validators/datatype/UnionDatatypeValidator.hpp \ xercesc/validators/datatype/XMLCanRepGroup.hpp \ xercesc/validators/datatype/YearDatatypeValidator.hpp \ xercesc/validators/datatype/YearMonthDatatypeValidator.hpp \ xercesc/validators/DTD/DocTypeHandler.hpp \ xercesc/validators/DTD/DTDAttDef.hpp \ xercesc/validators/DTD/DTDAttDefList.hpp \ xercesc/validators/DTD/DTDElementDecl.hpp \ xercesc/validators/DTD/DTDEntityDecl.hpp \ xercesc/validators/DTD/DTDGrammar.hpp \ xercesc/validators/DTD/DTDScanner.hpp \ xercesc/validators/DTD/DTDValidator.hpp \ xercesc/validators/DTD/XMLDTDDescriptionImpl.hpp \ xercesc/validators/schema/ComplexTypeInfo.hpp \ xercesc/validators/schema/GeneralAttributeCheck.hpp \ xercesc/validators/schema/identity/FieldActivator.hpp \ xercesc/validators/schema/identity/FieldValueMap.hpp \ xercesc/validators/schema/identity/IC_Field.hpp \ xercesc/validators/schema/identity/IC_Key.hpp \ xercesc/validators/schema/identity/IC_KeyRef.hpp \ xercesc/validators/schema/identity/IC_Selector.hpp \ xercesc/validators/schema/identity/IC_Unique.hpp \ xercesc/validators/schema/identity/IdentityConstraint.hpp \ xercesc/validators/schema/identity/IdentityConstraintHandler.hpp \ xercesc/validators/schema/identity/ValueStore.hpp \ xercesc/validators/schema/identity/ValueStoreCache.hpp \ xercesc/validators/schema/identity/XercesXPath.hpp \ xercesc/validators/schema/identity/XPathException.hpp \ xercesc/validators/schema/identity/XPathMatcher.hpp \ xercesc/validators/schema/identity/XPathMatcherStack.hpp \ xercesc/validators/schema/identity/XPathSymbols.hpp \ xercesc/validators/schema/NamespaceScope.hpp \ xercesc/validators/schema/PSVIDefs.hpp \ xercesc/validators/schema/SchemaAttDef.hpp \ xercesc/validators/schema/SchemaAttDefList.hpp \ xercesc/validators/schema/SchemaElementDecl.hpp \ xercesc/validators/schema/SchemaGrammar.hpp \ xercesc/validators/schema/SchemaInfo.hpp \ xercesc/validators/schema/SchemaSymbols.hpp \ xercesc/validators/schema/SchemaValidator.hpp \ xercesc/validators/schema/SubstitutionGroupComparator.hpp \ xercesc/validators/schema/TraverseSchema.hpp \ xercesc/validators/schema/XercesAttGroupInfo.hpp \ xercesc/validators/schema/XercesElementWildcard.hpp \ xercesc/validators/schema/XercesGroupInfo.hpp \ xercesc/validators/schema/XMLSchemaDescriptionImpl.hpp \ xercesc/validators/schema/XSDDOMParser.hpp \ xercesc/validators/schema/XSDErrorReporter.hpp \ xercesc/validators/schema/XSDLocator.hpp \ xercesc/validators/schema/XUtil.hpp validators_sources = \ xercesc/validators/common/AllContentModel.cpp \ xercesc/validators/common/CMAny.cpp \ xercesc/validators/common/CMBinaryOp.cpp \ xercesc/validators/common/CMUnaryOp.cpp \ xercesc/validators/common/ContentLeafNameTypeVector.cpp \ xercesc/validators/common/ContentSpecNode.cpp \ xercesc/validators/common/DFAContentModel.cpp \ xercesc/validators/common/Grammar.cpp \ xercesc/validators/common/GrammarResolver.cpp \ xercesc/validators/common/MixedContentModel.cpp \ xercesc/validators/common/SimpleContentModel.cpp \ xercesc/validators/datatype/AbstractNumericFacetValidator.cpp \ xercesc/validators/datatype/AbstractNumericValidator.cpp \ xercesc/validators/datatype/AbstractStringValidator.cpp \ xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.cpp \ xercesc/validators/datatype/AnyURIDatatypeValidator.cpp \ xercesc/validators/datatype/Base64BinaryDatatypeValidator.cpp \ xercesc/validators/datatype/BooleanDatatypeValidator.cpp \ xercesc/validators/datatype/DatatypeValidator.cpp \ xercesc/validators/datatype/DatatypeValidatorFactory.cpp \ xercesc/validators/datatype/DateDatatypeValidator.cpp \ xercesc/validators/datatype/DateTimeDatatypeValidator.cpp \ xercesc/validators/datatype/DateTimeValidator.cpp \ xercesc/validators/datatype/DayDatatypeValidator.cpp \ xercesc/validators/datatype/DecimalDatatypeValidator.cpp \ xercesc/validators/datatype/DoubleDatatypeValidator.cpp \ xercesc/validators/datatype/DurationDatatypeValidator.cpp \ xercesc/validators/datatype/ENTITYDatatypeValidator.cpp \ xercesc/validators/datatype/FloatDatatypeValidator.cpp \ xercesc/validators/datatype/HexBinaryDatatypeValidator.cpp \ xercesc/validators/datatype/IDDatatypeValidator.cpp \ xercesc/validators/datatype/IDREFDatatypeValidator.cpp \ xercesc/validators/datatype/ListDatatypeValidator.cpp \ xercesc/validators/datatype/MonthDatatypeValidator.cpp \ xercesc/validators/datatype/MonthDayDatatypeValidator.cpp \ xercesc/validators/datatype/NameDatatypeValidator.cpp \ xercesc/validators/datatype/NCNameDatatypeValidator.cpp \ xercesc/validators/datatype/NOTATIONDatatypeValidator.cpp \ xercesc/validators/datatype/QNameDatatypeValidator.cpp \ xercesc/validators/datatype/StringDatatypeValidator.cpp \ xercesc/validators/datatype/TimeDatatypeValidator.cpp \ xercesc/validators/datatype/UnionDatatypeValidator.cpp \ xercesc/validators/datatype/XMLCanRepGroup.cpp \ xercesc/validators/datatype/YearDatatypeValidator.cpp \ xercesc/validators/datatype/YearMonthDatatypeValidator.cpp \ xercesc/validators/DTD/DTDAttDef.cpp \ xercesc/validators/DTD/DTDAttDefList.cpp \ xercesc/validators/DTD/DTDElementDecl.cpp \ xercesc/validators/DTD/DTDEntityDecl.cpp \ xercesc/validators/DTD/DTDGrammar.cpp \ xercesc/validators/DTD/DTDScanner.cpp \ xercesc/validators/DTD/DTDValidator.cpp \ xercesc/validators/DTD/XMLDTDDescriptionImpl.cpp \ xercesc/validators/schema/ComplexTypeInfo.cpp \ xercesc/validators/schema/GeneralAttributeCheck.cpp \ xercesc/validators/schema/identity/FieldActivator.cpp \ xercesc/validators/schema/identity/FieldValueMap.cpp \ xercesc/validators/schema/identity/IC_Field.cpp \ xercesc/validators/schema/identity/IC_Key.cpp \ xercesc/validators/schema/identity/IC_KeyRef.cpp \ xercesc/validators/schema/identity/IC_Selector.cpp \ xercesc/validators/schema/identity/IC_Unique.cpp \ xercesc/validators/schema/identity/IdentityConstraint.cpp \ xercesc/validators/schema/identity/IdentityConstraintHandler.cpp \ xercesc/validators/schema/identity/ValueStore.cpp \ xercesc/validators/schema/identity/ValueStoreCache.cpp \ xercesc/validators/schema/identity/XercesXPath.cpp \ xercesc/validators/schema/identity/XPathMatcher.cpp \ xercesc/validators/schema/identity/XPathMatcherStack.cpp \ xercesc/validators/schema/identity/XPathSymbols.cpp \ xercesc/validators/schema/NamespaceScope.cpp \ xercesc/validators/schema/SchemaAttDef.cpp \ xercesc/validators/schema/SchemaAttDefList.cpp \ xercesc/validators/schema/SchemaElementDecl.cpp \ xercesc/validators/schema/SchemaGrammar.cpp \ xercesc/validators/schema/SchemaInfo.cpp \ xercesc/validators/schema/SchemaSymbols.cpp \ xercesc/validators/schema/SchemaValidator.cpp \ xercesc/validators/schema/SubstitutionGroupComparator.cpp \ xercesc/validators/schema/TraverseSchema.cpp \ xercesc/validators/schema/XercesAttGroupInfo.cpp \ xercesc/validators/schema/XercesElementWildcard.cpp \ xercesc/validators/schema/XercesGroupInfo.cpp \ xercesc/validators/schema/XMLSchemaDescriptionImpl.cpp \ xercesc/validators/schema/XSDDOMParser.cpp \ xercesc/validators/schema/XSDErrorReporter.cpp \ xercesc/validators/schema/XSDLocator.cpp \ xercesc/validators/schema/XUtil.cpp xinclude_headers = \ xercesc/xinclude/XIncludeDOMDocumentProcessor.hpp \ xercesc/xinclude/XIncludeLocation.hpp \ xercesc/xinclude/XIncludeUtils.hpp xinclude_sources = \ xercesc/xinclude/XIncludeDOMDocumentProcessor.cpp \ xercesc/xinclude/XIncludeLocation.cpp \ xercesc/xinclude/XIncludeUtils.cpp icu_headers = \ xercesc/util/Transcoders/ICU/ICUTransService.hpp icu_sources = \ xercesc/util/Transcoders/ICU/ICUTransService.cpp gnuiconv_headers = \ xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.hpp gnuiconv_sources = \ xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp iconv_headers = \ xercesc/util/Transcoders/Iconv/IconvTransService.hpp iconv_sources = \ xercesc/util/Transcoders/Iconv/IconvTransService.cpp macosunicodeconverter_headers = \ xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp macosunicodeconverter_sources = \ xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp wintrans_headers = \ xercesc/util/Transcoders/Win32/Win32TransService.hpp wintrans_sources = \ xercesc/util/Transcoders/Win32/Win32TransService.cpp curl_headers = \ xercesc/util/NetAccessors/Curl/CurlNetAccessor.hpp \ xercesc/util/NetAccessors/Curl/CurlURLInputStream.hpp curl_sources = \ xercesc/util/NetAccessors/Curl/CurlNetAccessor.cpp \ xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp sockets_headers = \ xercesc/util/NetAccessors/Socket/SocketNetAccessor.hpp \ xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.hpp \ xercesc/util/NetAccessors/BinHTTPInputStreamCommon.hpp sockets_sources = \ xercesc/util/NetAccessors/Socket/SocketNetAccessor.cpp \ xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp \ xercesc/util/NetAccessors/BinHTTPInputStreamCommon.cpp cfurl_headers = \ xercesc/util/NetAccessors/MacOSURLAccessCF/MacOSURLAccessCF.hpp \ xercesc/util/NetAccessors/MacOSURLAccessCF/URLAccessCFBinInputStream.hpp cfurl_sources = \ xercesc/util/NetAccessors/MacOSURLAccessCF/MacOSURLAccessCF.cpp \ xercesc/util/NetAccessors/MacOSURLAccessCF/URLAccessCFBinInputStream.cpp winsock_headers = \ xercesc/util/NetAccessors/WinSock/WinSockNetAccessor.hpp \ xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.hpp \ xercesc/util/NetAccessors/BinHTTPInputStreamCommon.hpp winsock_sources = \ xercesc/util/NetAccessors/WinSock/WinSockNetAccessor.cpp \ xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp \ xercesc/util/NetAccessors/BinHTTPInputStreamCommon.cpp msginmemory_headers = \ xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.hpp \ xercesc/util/MsgLoaders/InMemory/XercesMessages_en_US.hpp msginmemory_sources = \ xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp msgicu_headers = \ xercesc/util/MsgLoaders/ICU/ICUMsgLoader.hpp msgicu_sources = \ xercesc/util/MsgLoaders/ICU/ICUMsgLoader.cpp msgicu_nodist_sources = \ xercesc_messages.c \ root_res.c msgiconv_headers = \ xercesc/util/MsgLoaders/MsgCatalog/MsgCatalogLoader.hpp \ xercesc/util/MsgLoaders/MsgCatalog/XMLMsgCat_Ids.hpp msgiconv_sources = \ xercesc/util/MsgLoaders/MsgCatalog/MsgCatalogLoader.cpp posixfmgr_headers = \ xercesc/util/FileManagers/PosixFileMgr.hpp posixfmgr_sources = \ xercesc/util/FileManagers/PosixFileMgr.cpp winfmgr_headers = \ xercesc/util/FileManagers/WindowsFileMgr.hpp winfmgr_sources = \ xercesc/util/FileManagers/WindowsFileMgr.cpp nothreadmmgr_headers = \ xercesc/util/MutexManagers/NoThreadMutexMgr.hpp nothreadmmgr_sources = \ xercesc/util/MutexManagers/NoThreadMutexMgr.cpp stdmmgr_headers = \ xercesc/util/MutexManagers/StdMutexMgr.hpp stdmmgr_sources = \ xercesc/util/MutexManagers/StdMutexMgr.cpp posixmmgr_headers = \ xercesc/util/MutexManagers/PosixMutexMgr.hpp posixmmgr_sources = \ xercesc/util/MutexManagers/PosixMutexMgr.cpp winmmgr_headers = \ xercesc/util/MutexManagers/WindowsMutexMgr.hpp winmmgr_sources = \ xercesc/util/MutexManagers/WindowsMutexMgr.cpp all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } xercesc/util/$(am__dirstamp): @$(MKDIR_P) xercesc/util @: > xercesc/util/$(am__dirstamp) xercesc/util/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/util/$(DEPDIR) @: > xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/Base64.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/BinFileInputStream.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/BinInputStream.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/BinMemInputStream.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/BitSet.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/DefaultPanicHandler.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/EncodingValidator.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/HeaderDummy.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/HexBin.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/JanitorExports.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/KVStringPair.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/Mutexes.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/PanicHandler.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/PlatformUtils.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/PSVIUni.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/QName.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/$(am__dirstamp): @$(MKDIR_P) xercesc/util/regx @: > xercesc/util/regx/$(am__dirstamp) xercesc/util/regx/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/util/regx/$(DEPDIR) @: > xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/ASCIIRangeFactory.lo: \ xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/BlockRangeFactory.lo: \ xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/BMPattern.lo: xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/CharToken.lo: xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/ClosureToken.lo: xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/ConcatToken.lo: xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/Match.lo: xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/Op.lo: xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/OpFactory.lo: xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/ParenToken.lo: xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/ParserForXMLSchema.lo: \ xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/RangeFactory.lo: xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/RangeToken.lo: xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/RangeTokenMap.lo: xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/RegularExpression.lo: \ xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/RegxParser.lo: xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/RegxUtil.lo: xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/StringToken.lo: xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/Token.lo: xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/TokenFactory.lo: xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/UnicodeRangeFactory.lo: \ xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/UnionToken.lo: xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/XMLRangeFactory.lo: \ xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/regx/XMLUniCharacter.lo: \ xercesc/util/regx/$(am__dirstamp) \ xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) xercesc/util/StringPool.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/SynchronizedStringPool.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/TransService.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMemory.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XML256TableTranscoder.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XML88591Transcoder.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLAbstractDoubleFloat.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLASCIITranscoder.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLBigDecimal.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLBigInteger.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLChar.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLChTranscoder.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLDateTime.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLDouble.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLEBCDICTranscoder.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLException.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLFloat.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLIBM1047Transcoder.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLIBM1140Transcoder.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLInitializer.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLMsgLoader.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLNumber.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLString.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLStringTokenizer.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLUCS4Transcoder.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLUni.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLUri.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLURL.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLUTF16Transcoder.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLUTF8Transcoder.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/util/XMLWin1252Transcoder.lo: xercesc/util/$(am__dirstamp) \ xercesc/util/$(DEPDIR)/$(am__dirstamp) xercesc/dom/$(am__dirstamp): @$(MKDIR_P) xercesc/dom @: > xercesc/dom/$(am__dirstamp) xercesc/dom/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/dom/$(DEPDIR) @: > xercesc/dom/$(DEPDIR)/$(am__dirstamp) xercesc/dom/DOMException.lo: xercesc/dom/$(am__dirstamp) \ xercesc/dom/$(DEPDIR)/$(am__dirstamp) xercesc/dom/DOMLSException.lo: xercesc/dom/$(am__dirstamp) \ xercesc/dom/$(DEPDIR)/$(am__dirstamp) xercesc/dom/DOMRangeException.lo: xercesc/dom/$(am__dirstamp) \ xercesc/dom/$(DEPDIR)/$(am__dirstamp) xercesc/dom/DOMXPathException.lo: xercesc/dom/$(am__dirstamp) \ xercesc/dom/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/$(am__dirstamp): @$(MKDIR_P) xercesc/dom/impl @: > xercesc/dom/impl/$(am__dirstamp) xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/dom/impl/$(DEPDIR) @: > xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMAttrImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMAttrMapImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMAttrNSImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMCDATASectionImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMCharacterDataImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMChildNode.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMCommentImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMConfigurationImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMDeepNodeListImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMDocumentFragmentImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMDocumentImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMDocumentTypeImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMElementImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMElementNSImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMEntityImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMEntityReferenceImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMErrorImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMImplementationImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMImplementationListImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMImplementationRegistry.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMLocatorImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMNamedNodeMapImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMNodeIDMap.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMNodeImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMNodeIteratorImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMNodeListImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMNodeVector.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMNormalizer.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMNotationImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMParentNode.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMProcessingInstructionImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMRangeImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMStringListImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMStringPool.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMTextImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMTreeWalkerImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMTypeInfoImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMLSSerializerImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMLSInputImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMLSOutputImpl.lo: xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMXPathExpressionImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMXPathNSResolverImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/DOMXPathResultImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/dom/impl/XSDElementNSImpl.lo: \ xercesc/dom/impl/$(am__dirstamp) \ xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) xercesc/framework/$(am__dirstamp): @$(MKDIR_P) xercesc/framework @: > xercesc/framework/$(am__dirstamp) xercesc/framework/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/framework/$(DEPDIR) @: > xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/BinOutputStream.lo: \ xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/LocalFileFormatTarget.lo: \ xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/LocalFileInputSource.lo: \ xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/MemBufFormatTarget.lo: \ xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/MemBufInputSource.lo: \ xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/$(am__dirstamp): @$(MKDIR_P) xercesc/framework/psvi @: > xercesc/framework/psvi/$(am__dirstamp) xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/framework/psvi/$(DEPDIR) @: > xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/PSVIAttribute.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/PSVIAttributeList.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/PSVIElement.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/PSVIItem.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSAnnotation.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSAttributeDeclaration.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSAttributeGroupDefinition.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSAttributeUse.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSComplexTypeDefinition.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSElementDeclaration.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSFacet.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSIDCDefinition.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSModel.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSModelGroup.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSModelGroupDefinition.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSMultiValueFacet.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSNamespaceItem.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSNotationDeclaration.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSObject.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSParticle.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSSimpleTypeDefinition.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSTypeDefinition.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSValue.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/psvi/XSWildcard.lo: \ xercesc/framework/psvi/$(am__dirstamp) \ xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) xercesc/framework/StdInInputSource.lo: \ xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/StdOutFormatTarget.lo: \ xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/URLInputSource.lo: \ xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/Wrapper4DOMLSInput.lo: \ xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/Wrapper4InputSource.lo: \ xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/XMLAttDef.lo: xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/XMLAttDefList.lo: xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/XMLAttr.lo: xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/XMLBuffer.lo: xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/XMLBufferMgr.lo: xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/XMLContentModel.lo: \ xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/XMLDTDDescription.lo: \ xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/XMLElementDecl.lo: \ xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/XMLEntityDecl.lo: xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/XMLFormatter.lo: xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/XMLGrammarDescription.lo: \ xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/XMLGrammarPoolImpl.lo: \ xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/XMLNotationDecl.lo: \ xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/XMLRecognizer.lo: xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/XMLRefInfo.lo: xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/XMLSchemaDescription.lo: \ xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/framework/XMLValidator.lo: xercesc/framework/$(am__dirstamp) \ xercesc/framework/$(DEPDIR)/$(am__dirstamp) xercesc/internal/$(am__dirstamp): @$(MKDIR_P) xercesc/internal @: > xercesc/internal/$(am__dirstamp) xercesc/internal/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/internal/$(DEPDIR) @: > xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/BinFileOutputStream.lo: \ xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/BinMemOutputStream.lo: \ xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/DGXMLScanner.lo: xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/ElemStack.lo: xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/IGXMLScanner.lo: xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/IGXMLScanner2.lo: xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/MemoryManagerImpl.lo: \ xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/ReaderMgr.lo: xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/SGXMLScanner.lo: xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/ValidationContextImpl.lo: \ xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/VecAttributesImpl.lo: \ xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/VecAttrListImpl.lo: xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/WFXMLScanner.lo: xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/XMLReader.lo: xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/XMLScanner.lo: xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/XMLScannerResolver.lo: \ xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/XProtoType.lo: xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/XSAXMLScanner.lo: xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/XSerializeEngine.lo: \ xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/XSObjectFactory.lo: xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/internal/XTemplateSerializer.lo: \ xercesc/internal/$(am__dirstamp) \ xercesc/internal/$(DEPDIR)/$(am__dirstamp) xercesc/parsers/$(am__dirstamp): @$(MKDIR_P) xercesc/parsers @: > xercesc/parsers/$(am__dirstamp) xercesc/parsers/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/parsers/$(DEPDIR) @: > xercesc/parsers/$(DEPDIR)/$(am__dirstamp) xercesc/parsers/AbstractDOMParser.lo: xercesc/parsers/$(am__dirstamp) \ xercesc/parsers/$(DEPDIR)/$(am__dirstamp) xercesc/parsers/DOMLSParserImpl.lo: xercesc/parsers/$(am__dirstamp) \ xercesc/parsers/$(DEPDIR)/$(am__dirstamp) xercesc/parsers/SAX2XMLFilterImpl.lo: xercesc/parsers/$(am__dirstamp) \ xercesc/parsers/$(DEPDIR)/$(am__dirstamp) xercesc/parsers/SAX2XMLReaderImpl.lo: xercesc/parsers/$(am__dirstamp) \ xercesc/parsers/$(DEPDIR)/$(am__dirstamp) xercesc/parsers/SAXParser.lo: xercesc/parsers/$(am__dirstamp) \ xercesc/parsers/$(DEPDIR)/$(am__dirstamp) xercesc/parsers/XercesDOMParser.lo: xercesc/parsers/$(am__dirstamp) \ xercesc/parsers/$(DEPDIR)/$(am__dirstamp) xercesc/sax/$(am__dirstamp): @$(MKDIR_P) xercesc/sax @: > xercesc/sax/$(am__dirstamp) xercesc/sax/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/sax/$(DEPDIR) @: > xercesc/sax/$(DEPDIR)/$(am__dirstamp) xercesc/sax/Dummy.lo: xercesc/sax/$(am__dirstamp) \ xercesc/sax/$(DEPDIR)/$(am__dirstamp) xercesc/sax/InputSource.lo: xercesc/sax/$(am__dirstamp) \ xercesc/sax/$(DEPDIR)/$(am__dirstamp) xercesc/sax/SAXException.lo: xercesc/sax/$(am__dirstamp) \ xercesc/sax/$(DEPDIR)/$(am__dirstamp) xercesc/sax/SAXParseException.lo: xercesc/sax/$(am__dirstamp) \ xercesc/sax/$(DEPDIR)/$(am__dirstamp) xercesc/sax2/$(am__dirstamp): @$(MKDIR_P) xercesc/sax2 @: > xercesc/sax2/$(am__dirstamp) xercesc/sax2/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/sax2/$(DEPDIR) @: > xercesc/sax2/$(DEPDIR)/$(am__dirstamp) xercesc/sax2/sax2Dummy.lo: xercesc/sax2/$(am__dirstamp) \ xercesc/sax2/$(DEPDIR)/$(am__dirstamp) xercesc/validators/common/$(am__dirstamp): @$(MKDIR_P) xercesc/validators/common @: > xercesc/validators/common/$(am__dirstamp) xercesc/validators/common/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/validators/common/$(DEPDIR) @: > xercesc/validators/common/$(DEPDIR)/$(am__dirstamp) xercesc/validators/common/AllContentModel.lo: \ xercesc/validators/common/$(am__dirstamp) \ xercesc/validators/common/$(DEPDIR)/$(am__dirstamp) xercesc/validators/common/CMAny.lo: \ xercesc/validators/common/$(am__dirstamp) \ xercesc/validators/common/$(DEPDIR)/$(am__dirstamp) xercesc/validators/common/CMBinaryOp.lo: \ xercesc/validators/common/$(am__dirstamp) \ xercesc/validators/common/$(DEPDIR)/$(am__dirstamp) xercesc/validators/common/CMUnaryOp.lo: \ xercesc/validators/common/$(am__dirstamp) \ xercesc/validators/common/$(DEPDIR)/$(am__dirstamp) xercesc/validators/common/ContentLeafNameTypeVector.lo: \ xercesc/validators/common/$(am__dirstamp) \ xercesc/validators/common/$(DEPDIR)/$(am__dirstamp) xercesc/validators/common/ContentSpecNode.lo: \ xercesc/validators/common/$(am__dirstamp) \ xercesc/validators/common/$(DEPDIR)/$(am__dirstamp) xercesc/validators/common/DFAContentModel.lo: \ xercesc/validators/common/$(am__dirstamp) \ xercesc/validators/common/$(DEPDIR)/$(am__dirstamp) xercesc/validators/common/Grammar.lo: \ xercesc/validators/common/$(am__dirstamp) \ xercesc/validators/common/$(DEPDIR)/$(am__dirstamp) xercesc/validators/common/GrammarResolver.lo: \ xercesc/validators/common/$(am__dirstamp) \ xercesc/validators/common/$(DEPDIR)/$(am__dirstamp) xercesc/validators/common/MixedContentModel.lo: \ xercesc/validators/common/$(am__dirstamp) \ xercesc/validators/common/$(DEPDIR)/$(am__dirstamp) xercesc/validators/common/SimpleContentModel.lo: \ xercesc/validators/common/$(am__dirstamp) \ xercesc/validators/common/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/$(am__dirstamp): @$(MKDIR_P) xercesc/validators/datatype @: > xercesc/validators/datatype/$(am__dirstamp) xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/validators/datatype/$(DEPDIR) @: > xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/AbstractNumericFacetValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/AbstractNumericValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/AbstractStringValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/AnyURIDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/Base64BinaryDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/BooleanDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/DatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/DatatypeValidatorFactory.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/DateDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/DateTimeDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/DateTimeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/DayDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/DecimalDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/DoubleDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/DurationDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/ENTITYDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/FloatDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/HexBinaryDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/IDDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/IDREFDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/ListDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/MonthDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/MonthDayDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/NameDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/NCNameDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/NOTATIONDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/QNameDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/StringDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/TimeDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/UnionDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/XMLCanRepGroup.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/YearDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/datatype/YearMonthDatatypeValidator.lo: \ xercesc/validators/datatype/$(am__dirstamp) \ xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) xercesc/validators/DTD/$(am__dirstamp): @$(MKDIR_P) xercesc/validators/DTD @: > xercesc/validators/DTD/$(am__dirstamp) xercesc/validators/DTD/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/validators/DTD/$(DEPDIR) @: > xercesc/validators/DTD/$(DEPDIR)/$(am__dirstamp) xercesc/validators/DTD/DTDAttDef.lo: \ xercesc/validators/DTD/$(am__dirstamp) \ xercesc/validators/DTD/$(DEPDIR)/$(am__dirstamp) xercesc/validators/DTD/DTDAttDefList.lo: \ xercesc/validators/DTD/$(am__dirstamp) \ xercesc/validators/DTD/$(DEPDIR)/$(am__dirstamp) xercesc/validators/DTD/DTDElementDecl.lo: \ xercesc/validators/DTD/$(am__dirstamp) \ xercesc/validators/DTD/$(DEPDIR)/$(am__dirstamp) xercesc/validators/DTD/DTDEntityDecl.lo: \ xercesc/validators/DTD/$(am__dirstamp) \ xercesc/validators/DTD/$(DEPDIR)/$(am__dirstamp) xercesc/validators/DTD/DTDGrammar.lo: \ xercesc/validators/DTD/$(am__dirstamp) \ xercesc/validators/DTD/$(DEPDIR)/$(am__dirstamp) xercesc/validators/DTD/DTDScanner.lo: \ xercesc/validators/DTD/$(am__dirstamp) \ xercesc/validators/DTD/$(DEPDIR)/$(am__dirstamp) xercesc/validators/DTD/DTDValidator.lo: \ xercesc/validators/DTD/$(am__dirstamp) \ xercesc/validators/DTD/$(DEPDIR)/$(am__dirstamp) xercesc/validators/DTD/XMLDTDDescriptionImpl.lo: \ xercesc/validators/DTD/$(am__dirstamp) \ xercesc/validators/DTD/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/$(am__dirstamp): @$(MKDIR_P) xercesc/validators/schema @: > xercesc/validators/schema/$(am__dirstamp) xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/validators/schema/$(DEPDIR) @: > xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/ComplexTypeInfo.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/GeneralAttributeCheck.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/identity/$(am__dirstamp): @$(MKDIR_P) xercesc/validators/schema/identity @: > xercesc/validators/schema/identity/$(am__dirstamp) xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/validators/schema/identity/$(DEPDIR) @: > xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/identity/FieldActivator.lo: \ xercesc/validators/schema/identity/$(am__dirstamp) \ xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/identity/FieldValueMap.lo: \ xercesc/validators/schema/identity/$(am__dirstamp) \ xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/identity/IC_Field.lo: \ xercesc/validators/schema/identity/$(am__dirstamp) \ xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/identity/IC_Key.lo: \ xercesc/validators/schema/identity/$(am__dirstamp) \ xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/identity/IC_KeyRef.lo: \ xercesc/validators/schema/identity/$(am__dirstamp) \ xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/identity/IC_Selector.lo: \ xercesc/validators/schema/identity/$(am__dirstamp) \ xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/identity/IC_Unique.lo: \ xercesc/validators/schema/identity/$(am__dirstamp) \ xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/identity/IdentityConstraint.lo: \ xercesc/validators/schema/identity/$(am__dirstamp) \ xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/identity/IdentityConstraintHandler.lo: \ xercesc/validators/schema/identity/$(am__dirstamp) \ xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/identity/ValueStore.lo: \ xercesc/validators/schema/identity/$(am__dirstamp) \ xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/identity/ValueStoreCache.lo: \ xercesc/validators/schema/identity/$(am__dirstamp) \ xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/identity/XercesXPath.lo: \ xercesc/validators/schema/identity/$(am__dirstamp) \ xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/identity/XPathMatcher.lo: \ xercesc/validators/schema/identity/$(am__dirstamp) \ xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/identity/XPathMatcherStack.lo: \ xercesc/validators/schema/identity/$(am__dirstamp) \ xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/identity/XPathSymbols.lo: \ xercesc/validators/schema/identity/$(am__dirstamp) \ xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/NamespaceScope.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/SchemaAttDef.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/SchemaAttDefList.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/SchemaElementDecl.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/SchemaGrammar.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/SchemaInfo.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/SchemaSymbols.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/SchemaValidator.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/SubstitutionGroupComparator.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/TraverseSchema.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/XercesAttGroupInfo.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/XercesElementWildcard.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/XercesGroupInfo.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/XMLSchemaDescriptionImpl.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/XSDDOMParser.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/XSDErrorReporter.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/XSDLocator.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/validators/schema/XUtil.lo: \ xercesc/validators/schema/$(am__dirstamp) \ xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) xercesc/xinclude/$(am__dirstamp): @$(MKDIR_P) xercesc/xinclude @: > xercesc/xinclude/$(am__dirstamp) xercesc/xinclude/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/xinclude/$(DEPDIR) @: > xercesc/xinclude/$(DEPDIR)/$(am__dirstamp) xercesc/xinclude/XIncludeDOMDocumentProcessor.lo: \ xercesc/xinclude/$(am__dirstamp) \ xercesc/xinclude/$(DEPDIR)/$(am__dirstamp) xercesc/xinclude/XIncludeLocation.lo: \ xercesc/xinclude/$(am__dirstamp) \ xercesc/xinclude/$(DEPDIR)/$(am__dirstamp) xercesc/xinclude/XIncludeUtils.lo: xercesc/xinclude/$(am__dirstamp) \ xercesc/xinclude/$(DEPDIR)/$(am__dirstamp) xercesc/util/NetAccessors/Curl/$(am__dirstamp): @$(MKDIR_P) xercesc/util/NetAccessors/Curl @: > xercesc/util/NetAccessors/Curl/$(am__dirstamp) xercesc/util/NetAccessors/Curl/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/util/NetAccessors/Curl/$(DEPDIR) @: > xercesc/util/NetAccessors/Curl/$(DEPDIR)/$(am__dirstamp) xercesc/util/NetAccessors/Curl/CurlNetAccessor.lo: \ xercesc/util/NetAccessors/Curl/$(am__dirstamp) \ xercesc/util/NetAccessors/Curl/$(DEPDIR)/$(am__dirstamp) xercesc/util/NetAccessors/Curl/CurlURLInputStream.lo: \ xercesc/util/NetAccessors/Curl/$(am__dirstamp) \ xercesc/util/NetAccessors/Curl/$(DEPDIR)/$(am__dirstamp) xercesc/util/NetAccessors/Socket/$(am__dirstamp): @$(MKDIR_P) xercesc/util/NetAccessors/Socket @: > xercesc/util/NetAccessors/Socket/$(am__dirstamp) xercesc/util/NetAccessors/Socket/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/util/NetAccessors/Socket/$(DEPDIR) @: > xercesc/util/NetAccessors/Socket/$(DEPDIR)/$(am__dirstamp) xercesc/util/NetAccessors/Socket/SocketNetAccessor.lo: \ xercesc/util/NetAccessors/Socket/$(am__dirstamp) \ xercesc/util/NetAccessors/Socket/$(DEPDIR)/$(am__dirstamp) xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.lo: \ xercesc/util/NetAccessors/Socket/$(am__dirstamp) \ xercesc/util/NetAccessors/Socket/$(DEPDIR)/$(am__dirstamp) xercesc/util/NetAccessors/$(am__dirstamp): @$(MKDIR_P) xercesc/util/NetAccessors @: > xercesc/util/NetAccessors/$(am__dirstamp) xercesc/util/NetAccessors/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/util/NetAccessors/$(DEPDIR) @: > xercesc/util/NetAccessors/$(DEPDIR)/$(am__dirstamp) xercesc/util/NetAccessors/BinHTTPInputStreamCommon.lo: \ xercesc/util/NetAccessors/$(am__dirstamp) \ xercesc/util/NetAccessors/$(DEPDIR)/$(am__dirstamp) xercesc/util/NetAccessors/MacOSURLAccessCF/$(am__dirstamp): @$(MKDIR_P) xercesc/util/NetAccessors/MacOSURLAccessCF @: > xercesc/util/NetAccessors/MacOSURLAccessCF/$(am__dirstamp) xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR) @: > xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR)/$(am__dirstamp) xercesc/util/NetAccessors/MacOSURLAccessCF/MacOSURLAccessCF.lo: \ xercesc/util/NetAccessors/MacOSURLAccessCF/$(am__dirstamp) \ xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR)/$(am__dirstamp) xercesc/util/NetAccessors/MacOSURLAccessCF/URLAccessCFBinInputStream.lo: \ xercesc/util/NetAccessors/MacOSURLAccessCF/$(am__dirstamp) \ xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR)/$(am__dirstamp) xercesc/util/NetAccessors/WinSock/$(am__dirstamp): @$(MKDIR_P) xercesc/util/NetAccessors/WinSock @: > xercesc/util/NetAccessors/WinSock/$(am__dirstamp) xercesc/util/NetAccessors/WinSock/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/util/NetAccessors/WinSock/$(DEPDIR) @: > xercesc/util/NetAccessors/WinSock/$(DEPDIR)/$(am__dirstamp) xercesc/util/NetAccessors/WinSock/WinSockNetAccessor.lo: \ xercesc/util/NetAccessors/WinSock/$(am__dirstamp) \ xercesc/util/NetAccessors/WinSock/$(DEPDIR)/$(am__dirstamp) xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.lo: \ xercesc/util/NetAccessors/WinSock/$(am__dirstamp) \ xercesc/util/NetAccessors/WinSock/$(DEPDIR)/$(am__dirstamp) xercesc/util/Transcoders/ICU/$(am__dirstamp): @$(MKDIR_P) xercesc/util/Transcoders/ICU @: > xercesc/util/Transcoders/ICU/$(am__dirstamp) xercesc/util/Transcoders/ICU/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/util/Transcoders/ICU/$(DEPDIR) @: > xercesc/util/Transcoders/ICU/$(DEPDIR)/$(am__dirstamp) xercesc/util/Transcoders/ICU/ICUTransService.lo: \ xercesc/util/Transcoders/ICU/$(am__dirstamp) \ xercesc/util/Transcoders/ICU/$(DEPDIR)/$(am__dirstamp) xercesc/util/Transcoders/IconvGNU/$(am__dirstamp): @$(MKDIR_P) xercesc/util/Transcoders/IconvGNU @: > xercesc/util/Transcoders/IconvGNU/$(am__dirstamp) xercesc/util/Transcoders/IconvGNU/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/util/Transcoders/IconvGNU/$(DEPDIR) @: > xercesc/util/Transcoders/IconvGNU/$(DEPDIR)/$(am__dirstamp) xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.lo: \ xercesc/util/Transcoders/IconvGNU/$(am__dirstamp) \ xercesc/util/Transcoders/IconvGNU/$(DEPDIR)/$(am__dirstamp) xercesc/util/Transcoders/Iconv/$(am__dirstamp): @$(MKDIR_P) xercesc/util/Transcoders/Iconv @: > xercesc/util/Transcoders/Iconv/$(am__dirstamp) xercesc/util/Transcoders/Iconv/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/util/Transcoders/Iconv/$(DEPDIR) @: > xercesc/util/Transcoders/Iconv/$(DEPDIR)/$(am__dirstamp) xercesc/util/Transcoders/Iconv/IconvTransService.lo: \ xercesc/util/Transcoders/Iconv/$(am__dirstamp) \ xercesc/util/Transcoders/Iconv/$(DEPDIR)/$(am__dirstamp) xercesc/util/Transcoders/MacOSUnicodeConverter/$(am__dirstamp): @$(MKDIR_P) xercesc/util/Transcoders/MacOSUnicodeConverter @: > xercesc/util/Transcoders/MacOSUnicodeConverter/$(am__dirstamp) xercesc/util/Transcoders/MacOSUnicodeConverter/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/util/Transcoders/MacOSUnicodeConverter/$(DEPDIR) @: > xercesc/util/Transcoders/MacOSUnicodeConverter/$(DEPDIR)/$(am__dirstamp) xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.lo: xercesc/util/Transcoders/MacOSUnicodeConverter/$(am__dirstamp) \ xercesc/util/Transcoders/MacOSUnicodeConverter/$(DEPDIR)/$(am__dirstamp) xercesc/util/Transcoders/Win32/$(am__dirstamp): @$(MKDIR_P) xercesc/util/Transcoders/Win32 @: > xercesc/util/Transcoders/Win32/$(am__dirstamp) xercesc/util/Transcoders/Win32/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/util/Transcoders/Win32/$(DEPDIR) @: > xercesc/util/Transcoders/Win32/$(DEPDIR)/$(am__dirstamp) xercesc/util/Transcoders/Win32/Win32TransService.lo: \ xercesc/util/Transcoders/Win32/$(am__dirstamp) \ xercesc/util/Transcoders/Win32/$(DEPDIR)/$(am__dirstamp) xercesc/util/MsgLoaders/InMemory/$(am__dirstamp): @$(MKDIR_P) xercesc/util/MsgLoaders/InMemory @: > xercesc/util/MsgLoaders/InMemory/$(am__dirstamp) xercesc/util/MsgLoaders/InMemory/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/util/MsgLoaders/InMemory/$(DEPDIR) @: > xercesc/util/MsgLoaders/InMemory/$(DEPDIR)/$(am__dirstamp) xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.lo: \ xercesc/util/MsgLoaders/InMemory/$(am__dirstamp) \ xercesc/util/MsgLoaders/InMemory/$(DEPDIR)/$(am__dirstamp) xercesc/util/MsgLoaders/ICU/$(am__dirstamp): @$(MKDIR_P) xercesc/util/MsgLoaders/ICU @: > xercesc/util/MsgLoaders/ICU/$(am__dirstamp) xercesc/util/MsgLoaders/ICU/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/util/MsgLoaders/ICU/$(DEPDIR) @: > xercesc/util/MsgLoaders/ICU/$(DEPDIR)/$(am__dirstamp) xercesc/util/MsgLoaders/ICU/ICUMsgLoader.lo: \ xercesc/util/MsgLoaders/ICU/$(am__dirstamp) \ xercesc/util/MsgLoaders/ICU/$(DEPDIR)/$(am__dirstamp) xercesc/util/MsgLoaders/MsgCatalog/$(am__dirstamp): @$(MKDIR_P) xercesc/util/MsgLoaders/MsgCatalog @: > xercesc/util/MsgLoaders/MsgCatalog/$(am__dirstamp) xercesc/util/MsgLoaders/MsgCatalog/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/util/MsgLoaders/MsgCatalog/$(DEPDIR) @: > xercesc/util/MsgLoaders/MsgCatalog/$(DEPDIR)/$(am__dirstamp) xercesc/util/MsgLoaders/MsgCatalog/MsgCatalogLoader.lo: \ xercesc/util/MsgLoaders/MsgCatalog/$(am__dirstamp) \ xercesc/util/MsgLoaders/MsgCatalog/$(DEPDIR)/$(am__dirstamp) xercesc/util/MutexManagers/$(am__dirstamp): @$(MKDIR_P) xercesc/util/MutexManagers @: > xercesc/util/MutexManagers/$(am__dirstamp) xercesc/util/MutexManagers/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/util/MutexManagers/$(DEPDIR) @: > xercesc/util/MutexManagers/$(DEPDIR)/$(am__dirstamp) xercesc/util/MutexManagers/NoThreadMutexMgr.lo: \ xercesc/util/MutexManagers/$(am__dirstamp) \ xercesc/util/MutexManagers/$(DEPDIR)/$(am__dirstamp) xercesc/util/MutexManagers/StdMutexMgr.lo: \ xercesc/util/MutexManagers/$(am__dirstamp) \ xercesc/util/MutexManagers/$(DEPDIR)/$(am__dirstamp) xercesc/util/MutexManagers/PosixMutexMgr.lo: \ xercesc/util/MutexManagers/$(am__dirstamp) \ xercesc/util/MutexManagers/$(DEPDIR)/$(am__dirstamp) xercesc/util/MutexManagers/WindowsMutexMgr.lo: \ xercesc/util/MutexManagers/$(am__dirstamp) \ xercesc/util/MutexManagers/$(DEPDIR)/$(am__dirstamp) xercesc/util/FileManagers/$(am__dirstamp): @$(MKDIR_P) xercesc/util/FileManagers @: > xercesc/util/FileManagers/$(am__dirstamp) xercesc/util/FileManagers/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xercesc/util/FileManagers/$(DEPDIR) @: > xercesc/util/FileManagers/$(DEPDIR)/$(am__dirstamp) xercesc/util/FileManagers/PosixFileMgr.lo: \ xercesc/util/FileManagers/$(am__dirstamp) \ xercesc/util/FileManagers/$(DEPDIR)/$(am__dirstamp) xercesc/util/FileManagers/WindowsFileMgr.lo: \ xercesc/util/FileManagers/$(am__dirstamp) \ xercesc/util/FileManagers/$(DEPDIR)/$(am__dirstamp) libxerces-c.la: $(libxerces_c_la_OBJECTS) $(libxerces_c_la_DEPENDENCIES) $(EXTRA_libxerces_c_la_DEPENDENCIES) $(AM_V_CXXLD)$(libxerces_c_la_LINK) -rpath $(libdir) $(libxerces_c_la_OBJECTS) $(libxerces_c_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f xercesc/dom/*.$(OBJEXT) -rm -f xercesc/dom/*.lo -rm -f xercesc/dom/impl/*.$(OBJEXT) -rm -f xercesc/dom/impl/*.lo -rm -f xercesc/framework/*.$(OBJEXT) -rm -f xercesc/framework/*.lo -rm -f xercesc/framework/psvi/*.$(OBJEXT) -rm -f xercesc/framework/psvi/*.lo -rm -f xercesc/internal/*.$(OBJEXT) -rm -f xercesc/internal/*.lo -rm -f xercesc/parsers/*.$(OBJEXT) -rm -f xercesc/parsers/*.lo -rm -f xercesc/sax/*.$(OBJEXT) -rm -f xercesc/sax/*.lo -rm -f xercesc/sax2/*.$(OBJEXT) -rm -f xercesc/sax2/*.lo -rm -f xercesc/util/*.$(OBJEXT) -rm -f xercesc/util/*.lo -rm -f xercesc/util/FileManagers/*.$(OBJEXT) -rm -f xercesc/util/FileManagers/*.lo -rm -f xercesc/util/MsgLoaders/ICU/*.$(OBJEXT) -rm -f xercesc/util/MsgLoaders/ICU/*.lo -rm -f xercesc/util/MsgLoaders/InMemory/*.$(OBJEXT) -rm -f xercesc/util/MsgLoaders/InMemory/*.lo -rm -f xercesc/util/MsgLoaders/MsgCatalog/*.$(OBJEXT) -rm -f xercesc/util/MsgLoaders/MsgCatalog/*.lo -rm -f xercesc/util/MutexManagers/*.$(OBJEXT) -rm -f xercesc/util/MutexManagers/*.lo -rm -f xercesc/util/NetAccessors/*.$(OBJEXT) -rm -f xercesc/util/NetAccessors/*.lo -rm -f xercesc/util/NetAccessors/Curl/*.$(OBJEXT) -rm -f xercesc/util/NetAccessors/Curl/*.lo -rm -f xercesc/util/NetAccessors/MacOSURLAccessCF/*.$(OBJEXT) -rm -f xercesc/util/NetAccessors/MacOSURLAccessCF/*.lo -rm -f xercesc/util/NetAccessors/Socket/*.$(OBJEXT) -rm -f xercesc/util/NetAccessors/Socket/*.lo -rm -f xercesc/util/NetAccessors/WinSock/*.$(OBJEXT) -rm -f xercesc/util/NetAccessors/WinSock/*.lo -rm -f xercesc/util/Transcoders/ICU/*.$(OBJEXT) -rm -f xercesc/util/Transcoders/ICU/*.lo -rm -f xercesc/util/Transcoders/Iconv/*.$(OBJEXT) -rm -f xercesc/util/Transcoders/Iconv/*.lo -rm -f xercesc/util/Transcoders/IconvGNU/*.$(OBJEXT) -rm -f xercesc/util/Transcoders/IconvGNU/*.lo -rm -f xercesc/util/Transcoders/MacOSUnicodeConverter/*.$(OBJEXT) -rm -f xercesc/util/Transcoders/MacOSUnicodeConverter/*.lo -rm -f xercesc/util/Transcoders/Win32/*.$(OBJEXT) -rm -f xercesc/util/Transcoders/Win32/*.lo -rm -f xercesc/util/regx/*.$(OBJEXT) -rm -f xercesc/util/regx/*.lo -rm -f xercesc/validators/DTD/*.$(OBJEXT) -rm -f xercesc/validators/DTD/*.lo -rm -f xercesc/validators/common/*.$(OBJEXT) -rm -f xercesc/validators/common/*.lo -rm -f xercesc/validators/datatype/*.$(OBJEXT) -rm -f xercesc/validators/datatype/*.lo -rm -f xercesc/validators/schema/*.$(OBJEXT) -rm -f xercesc/validators/schema/*.lo -rm -f xercesc/validators/schema/identity/*.$(OBJEXT) -rm -f xercesc/validators/schema/identity/*.lo -rm -f xercesc/xinclude/*.$(OBJEXT) -rm -f xercesc/xinclude/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/stricmp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strnicmp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/towlower.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/towupper.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/root_res.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xercesc_messages.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/$(DEPDIR)/DOMException.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/$(DEPDIR)/DOMLSException.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/$(DEPDIR)/DOMRangeException.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/$(DEPDIR)/DOMXPathException.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMAttrImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMAttrMapImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMAttrNSImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMCDATASectionImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMCharacterDataImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMChildNode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMCommentImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMConfigurationImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMDeepNodeListImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMDocumentFragmentImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMDocumentImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMDocumentTypeImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMElementImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMElementNSImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMEntityImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMEntityReferenceImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMErrorImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMImplementationImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMImplementationListImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMImplementationRegistry.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMLSInputImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMLSOutputImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMLSSerializerImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMLocatorImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMNamedNodeMapImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMNodeIDMap.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMNodeImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMNodeIteratorImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMNodeListImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMNodeVector.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMNormalizer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMNotationImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMParentNode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMProcessingInstructionImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMRangeImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMStringListImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMStringPool.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMTextImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMTreeWalkerImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMTypeInfoImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMXPathExpressionImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMXPathNSResolverImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMXPathResultImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/XSDElementNSImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/BinOutputStream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/LocalFileFormatTarget.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/LocalFileInputSource.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/MemBufFormatTarget.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/MemBufInputSource.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/StdInInputSource.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/StdOutFormatTarget.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/URLInputSource.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/Wrapper4DOMLSInput.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/Wrapper4InputSource.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLAttDef.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLAttDefList.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLAttr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLBuffer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLBufferMgr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLContentModel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLDTDDescription.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLElementDecl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLEntityDecl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLFormatter.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLGrammarDescription.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLGrammarPoolImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLNotationDecl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLRecognizer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLRefInfo.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLSchemaDescription.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/PSVIAttribute.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/PSVIAttributeList.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/PSVIElement.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/PSVIItem.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSAnnotation.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSAttributeDeclaration.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSAttributeGroupDefinition.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSAttributeUse.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSComplexTypeDefinition.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSElementDeclaration.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSFacet.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSIDCDefinition.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSModel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSModelGroup.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSModelGroupDefinition.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSMultiValueFacet.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSNamespaceItem.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSNotationDeclaration.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSObject.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSParticle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSSimpleTypeDefinition.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSTypeDefinition.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSValue.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/psvi/$(DEPDIR)/XSWildcard.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/BinFileOutputStream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/BinMemOutputStream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/DGXMLScanner.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/ElemStack.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/IGXMLScanner.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/IGXMLScanner2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/MemoryManagerImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/ReaderMgr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/SGXMLScanner.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/ValidationContextImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/VecAttrListImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/VecAttributesImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/WFXMLScanner.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/XMLReader.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/XMLScanner.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/XMLScannerResolver.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/XProtoType.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/XSAXMLScanner.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/XSObjectFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/XSerializeEngine.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/internal/$(DEPDIR)/XTemplateSerializer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/parsers/$(DEPDIR)/AbstractDOMParser.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/parsers/$(DEPDIR)/DOMLSParserImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/parsers/$(DEPDIR)/SAX2XMLFilterImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/parsers/$(DEPDIR)/SAX2XMLReaderImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/parsers/$(DEPDIR)/SAXParser.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/parsers/$(DEPDIR)/XercesDOMParser.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/sax/$(DEPDIR)/Dummy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/sax/$(DEPDIR)/InputSource.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/sax/$(DEPDIR)/SAXException.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/sax/$(DEPDIR)/SAXParseException.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/sax2/$(DEPDIR)/sax2Dummy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/Base64.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/BinFileInputStream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/BinInputStream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/BinMemInputStream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/BitSet.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/DefaultPanicHandler.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/EncodingValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/HeaderDummy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/HexBin.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/JanitorExports.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/KVStringPair.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/Mutexes.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/PSVIUni.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/PanicHandler.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/PlatformUtils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/QName.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/StringPool.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/SynchronizedStringPool.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/TransService.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XML256TableTranscoder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XML88591Transcoder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLASCIITranscoder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLAbstractDoubleFloat.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLBigDecimal.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLBigInteger.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLChTranscoder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLChar.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLDateTime.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLDouble.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLEBCDICTranscoder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLException.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLFloat.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLIBM1047Transcoder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLIBM1140Transcoder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLInitializer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLMsgLoader.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLNumber.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLString.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLStringTokenizer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLUCS4Transcoder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLURL.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLUTF16Transcoder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLUTF8Transcoder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLUni.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLUri.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMLWin1252Transcoder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/$(DEPDIR)/XMemory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/FileManagers/$(DEPDIR)/PosixFileMgr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/FileManagers/$(DEPDIR)/WindowsFileMgr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/MsgLoaders/ICU/$(DEPDIR)/ICUMsgLoader.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/MsgLoaders/InMemory/$(DEPDIR)/InMemMsgLoader.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/MsgLoaders/MsgCatalog/$(DEPDIR)/MsgCatalogLoader.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/MutexManagers/$(DEPDIR)/NoThreadMutexMgr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/MutexManagers/$(DEPDIR)/PosixMutexMgr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/MutexManagers/$(DEPDIR)/StdMutexMgr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/MutexManagers/$(DEPDIR)/WindowsMutexMgr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/NetAccessors/$(DEPDIR)/BinHTTPInputStreamCommon.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/NetAccessors/Curl/$(DEPDIR)/CurlNetAccessor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/NetAccessors/Curl/$(DEPDIR)/CurlURLInputStream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR)/MacOSURLAccessCF.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR)/URLAccessCFBinInputStream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/NetAccessors/Socket/$(DEPDIR)/SocketNetAccessor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/NetAccessors/Socket/$(DEPDIR)/UnixHTTPURLInputStream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/NetAccessors/WinSock/$(DEPDIR)/BinHTTPURLInputStream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/NetAccessors/WinSock/$(DEPDIR)/WinSockNetAccessor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/Transcoders/ICU/$(DEPDIR)/ICUTransService.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/Transcoders/Iconv/$(DEPDIR)/IconvTransService.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/Transcoders/IconvGNU/$(DEPDIR)/IconvGNUTransService.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/Transcoders/MacOSUnicodeConverter/$(DEPDIR)/MacOSUnicodeConverter.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/Transcoders/Win32/$(DEPDIR)/Win32TransService.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/ASCIIRangeFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/BMPattern.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/BlockRangeFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/CharToken.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/ClosureToken.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/ConcatToken.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/Match.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/Op.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/OpFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/ParenToken.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/ParserForXMLSchema.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/RangeFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/RangeToken.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/RangeTokenMap.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/RegularExpression.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/RegxParser.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/RegxUtil.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/StringToken.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/Token.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/TokenFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/UnicodeRangeFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/UnionToken.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/XMLRangeFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/util/regx/$(DEPDIR)/XMLUniCharacter.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/DTD/$(DEPDIR)/DTDAttDef.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/DTD/$(DEPDIR)/DTDAttDefList.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/DTD/$(DEPDIR)/DTDElementDecl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/DTD/$(DEPDIR)/DTDEntityDecl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/DTD/$(DEPDIR)/DTDGrammar.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/DTD/$(DEPDIR)/DTDScanner.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/DTD/$(DEPDIR)/DTDValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/DTD/$(DEPDIR)/XMLDTDDescriptionImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/common/$(DEPDIR)/AllContentModel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/common/$(DEPDIR)/CMAny.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/common/$(DEPDIR)/CMBinaryOp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/common/$(DEPDIR)/CMUnaryOp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/common/$(DEPDIR)/ContentLeafNameTypeVector.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/common/$(DEPDIR)/ContentSpecNode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/common/$(DEPDIR)/DFAContentModel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/common/$(DEPDIR)/Grammar.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/common/$(DEPDIR)/GrammarResolver.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/common/$(DEPDIR)/MixedContentModel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/common/$(DEPDIR)/SimpleContentModel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/AbstractNumericFacetValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/AbstractNumericValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/AbstractStringValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/AnySimpleTypeDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/AnyURIDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/Base64BinaryDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/BooleanDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/DatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/DatatypeValidatorFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/DateDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/DateTimeDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/DateTimeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/DayDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/DecimalDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/DoubleDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/DurationDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/ENTITYDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/FloatDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/HexBinaryDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/IDDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/IDREFDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/ListDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/MonthDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/MonthDayDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/NCNameDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/NOTATIONDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/NameDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/QNameDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/StringDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/TimeDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/UnionDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/XMLCanRepGroup.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/YearDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/datatype/$(DEPDIR)/YearMonthDatatypeValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/ComplexTypeInfo.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/GeneralAttributeCheck.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/NamespaceScope.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/SchemaAttDef.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/SchemaAttDefList.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/SchemaElementDecl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/SchemaGrammar.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/SchemaInfo.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/SchemaSymbols.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/SchemaValidator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/SubstitutionGroupComparator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/TraverseSchema.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/XMLSchemaDescriptionImpl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/XSDDOMParser.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/XSDErrorReporter.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/XSDLocator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/XUtil.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/XercesAttGroupInfo.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/XercesElementWildcard.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/$(DEPDIR)/XercesGroupInfo.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/identity/$(DEPDIR)/FieldActivator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/identity/$(DEPDIR)/FieldValueMap.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/identity/$(DEPDIR)/IC_Field.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/identity/$(DEPDIR)/IC_Key.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/identity/$(DEPDIR)/IC_KeyRef.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/identity/$(DEPDIR)/IC_Selector.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/identity/$(DEPDIR)/IC_Unique.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/identity/$(DEPDIR)/IdentityConstraint.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/identity/$(DEPDIR)/IdentityConstraintHandler.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/identity/$(DEPDIR)/ValueStore.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/identity/$(DEPDIR)/ValueStoreCache.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/identity/$(DEPDIR)/XPathMatcher.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/identity/$(DEPDIR)/XPathMatcherStack.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/identity/$(DEPDIR)/XPathSymbols.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/validators/schema/identity/$(DEPDIR)/XercesXPath.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/xinclude/$(DEPDIR)/XIncludeDOMDocumentProcessor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/xinclude/$(DEPDIR)/XIncludeLocation.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@xercesc/xinclude/$(DEPDIR)/XIncludeUtils.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf xercesc/dom/.libs xercesc/dom/_libs -rm -rf xercesc/dom/impl/.libs xercesc/dom/impl/_libs -rm -rf xercesc/framework/.libs xercesc/framework/_libs -rm -rf xercesc/framework/psvi/.libs xercesc/framework/psvi/_libs -rm -rf xercesc/internal/.libs xercesc/internal/_libs -rm -rf xercesc/parsers/.libs xercesc/parsers/_libs -rm -rf xercesc/sax/.libs xercesc/sax/_libs -rm -rf xercesc/sax2/.libs xercesc/sax2/_libs -rm -rf xercesc/util/.libs xercesc/util/_libs -rm -rf xercesc/util/FileManagers/.libs xercesc/util/FileManagers/_libs -rm -rf xercesc/util/MsgLoaders/ICU/.libs xercesc/util/MsgLoaders/ICU/_libs -rm -rf xercesc/util/MsgLoaders/InMemory/.libs xercesc/util/MsgLoaders/InMemory/_libs -rm -rf xercesc/util/MsgLoaders/MsgCatalog/.libs xercesc/util/MsgLoaders/MsgCatalog/_libs -rm -rf xercesc/util/MutexManagers/.libs xercesc/util/MutexManagers/_libs -rm -rf xercesc/util/NetAccessors/.libs xercesc/util/NetAccessors/_libs -rm -rf xercesc/util/NetAccessors/Curl/.libs xercesc/util/NetAccessors/Curl/_libs -rm -rf xercesc/util/NetAccessors/MacOSURLAccessCF/.libs xercesc/util/NetAccessors/MacOSURLAccessCF/_libs -rm -rf xercesc/util/NetAccessors/Socket/.libs xercesc/util/NetAccessors/Socket/_libs -rm -rf xercesc/util/NetAccessors/WinSock/.libs xercesc/util/NetAccessors/WinSock/_libs -rm -rf xercesc/util/Transcoders/ICU/.libs xercesc/util/Transcoders/ICU/_libs -rm -rf xercesc/util/Transcoders/Iconv/.libs xercesc/util/Transcoders/Iconv/_libs -rm -rf xercesc/util/Transcoders/IconvGNU/.libs xercesc/util/Transcoders/IconvGNU/_libs -rm -rf xercesc/util/Transcoders/MacOSUnicodeConverter/.libs xercesc/util/Transcoders/MacOSUnicodeConverter/_libs -rm -rf xercesc/util/Transcoders/Win32/.libs xercesc/util/Transcoders/Win32/_libs -rm -rf xercesc/util/regx/.libs xercesc/util/regx/_libs -rm -rf xercesc/validators/DTD/.libs xercesc/validators/DTD/_libs -rm -rf xercesc/validators/common/.libs xercesc/validators/common/_libs -rm -rf xercesc/validators/datatype/.libs xercesc/validators/datatype/_libs -rm -rf xercesc/validators/schema/.libs xercesc/validators/schema/_libs -rm -rf xercesc/validators/schema/identity/.libs xercesc/validators/schema/identity/_libs -rm -rf xercesc/xinclude/.libs xercesc/xinclude/_libs install-iconv_msgDATA: $(iconv_msg_DATA) @$(NORMAL_INSTALL) @list='$(iconv_msg_DATA)'; test -n "$(iconv_msgdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(iconv_msgdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(iconv_msgdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(iconv_msgdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(iconv_msgdir)" || exit $$?; \ done uninstall-iconv_msgDATA: @$(NORMAL_UNINSTALL) @list='$(iconv_msg_DATA)'; test -n "$(iconv_msgdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(iconv_msgdir)'; $(am__uninstall_files_from_dir) install-nobase_libxerces_c_laHEADERS: $(nobase_libxerces_c_la_HEADERS) @$(NORMAL_INSTALL) @list='$(nobase_libxerces_c_la_HEADERS)'; test -n "$(libxerces_c_ladir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libxerces_c_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libxerces_c_ladir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libxerces_c_ladir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(libxerces_c_ladir)/$$dir"; }; \ echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(libxerces_c_ladir)/$$dir'"; \ $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(libxerces_c_ladir)/$$dir" || exit $$?; }; \ done uninstall-nobase_libxerces_c_laHEADERS: @$(NORMAL_UNINSTALL) @list='$(nobase_libxerces_c_la_HEADERS)'; test -n "$(libxerces_c_ladir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(libxerces_c_ladir)'; $(am__uninstall_files_from_dir) install-nodist_autoconfheadersHEADERS: $(nodist_autoconfheaders_HEADERS) @$(NORMAL_INSTALL) @list='$(nodist_autoconfheaders_HEADERS)'; test -n "$(autoconfheadersdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(autoconfheadersdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(autoconfheadersdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(autoconfheadersdir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(autoconfheadersdir)" || exit $$?; \ done uninstall-nodist_autoconfheadersHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_autoconfheaders_HEADERS)'; test -n "$(autoconfheadersdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(autoconfheadersdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(iconv_msgdir)" "$(DESTDIR)$(libxerces_c_ladir)" "$(DESTDIR)$(autoconfheadersdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f xercesc/dom/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/dom/$(am__dirstamp) -rm -f xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/dom/impl/$(am__dirstamp) -rm -f xercesc/framework/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/framework/$(am__dirstamp) -rm -f xercesc/framework/psvi/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/framework/psvi/$(am__dirstamp) -rm -f xercesc/internal/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/internal/$(am__dirstamp) -rm -f xercesc/parsers/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/parsers/$(am__dirstamp) -rm -f xercesc/sax/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/sax/$(am__dirstamp) -rm -f xercesc/sax2/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/sax2/$(am__dirstamp) -rm -f xercesc/util/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/util/$(am__dirstamp) -rm -f xercesc/util/FileManagers/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/util/FileManagers/$(am__dirstamp) -rm -f xercesc/util/MsgLoaders/ICU/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/util/MsgLoaders/ICU/$(am__dirstamp) -rm -f xercesc/util/MsgLoaders/InMemory/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/util/MsgLoaders/InMemory/$(am__dirstamp) -rm -f xercesc/util/MsgLoaders/MsgCatalog/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/util/MsgLoaders/MsgCatalog/$(am__dirstamp) -rm -f xercesc/util/MutexManagers/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/util/MutexManagers/$(am__dirstamp) -rm -f xercesc/util/NetAccessors/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/util/NetAccessors/$(am__dirstamp) -rm -f xercesc/util/NetAccessors/Curl/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/util/NetAccessors/Curl/$(am__dirstamp) -rm -f xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/util/NetAccessors/MacOSURLAccessCF/$(am__dirstamp) -rm -f xercesc/util/NetAccessors/Socket/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/util/NetAccessors/Socket/$(am__dirstamp) -rm -f xercesc/util/NetAccessors/WinSock/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/util/NetAccessors/WinSock/$(am__dirstamp) -rm -f xercesc/util/Transcoders/ICU/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/util/Transcoders/ICU/$(am__dirstamp) -rm -f xercesc/util/Transcoders/Iconv/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/util/Transcoders/Iconv/$(am__dirstamp) -rm -f xercesc/util/Transcoders/IconvGNU/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/util/Transcoders/IconvGNU/$(am__dirstamp) -rm -f xercesc/util/Transcoders/MacOSUnicodeConverter/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/util/Transcoders/MacOSUnicodeConverter/$(am__dirstamp) -rm -f xercesc/util/Transcoders/Win32/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/util/Transcoders/Win32/$(am__dirstamp) -rm -f xercesc/util/regx/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/util/regx/$(am__dirstamp) -rm -f xercesc/validators/DTD/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/validators/DTD/$(am__dirstamp) -rm -f xercesc/validators/common/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/validators/common/$(am__dirstamp) -rm -f xercesc/validators/datatype/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/validators/datatype/$(am__dirstamp) -rm -f xercesc/validators/schema/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/validators/schema/$(am__dirstamp) -rm -f xercesc/validators/schema/identity/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/validators/schema/identity/$(am__dirstamp) -rm -f xercesc/xinclude/$(DEPDIR)/$(am__dirstamp) -rm -f xercesc/xinclude/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f $(DEPDIR)/stricmp.Plo -rm -f $(DEPDIR)/strnicmp.Plo -rm -f $(DEPDIR)/towlower.Plo -rm -f $(DEPDIR)/towupper.Plo -rm -f ./$(DEPDIR)/root_res.Plo -rm -f ./$(DEPDIR)/xercesc_messages.Plo -rm -f xercesc/dom/$(DEPDIR)/DOMException.Plo -rm -f xercesc/dom/$(DEPDIR)/DOMLSException.Plo -rm -f xercesc/dom/$(DEPDIR)/DOMRangeException.Plo -rm -f xercesc/dom/$(DEPDIR)/DOMXPathException.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMAttrImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMAttrMapImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMAttrNSImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMCDATASectionImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMCharacterDataImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMChildNode.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMCommentImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMConfigurationImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMDeepNodeListImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMDocumentFragmentImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMDocumentImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMDocumentTypeImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMElementImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMElementNSImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMEntityImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMEntityReferenceImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMErrorImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMImplementationImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMImplementationListImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMImplementationRegistry.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMLSInputImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMLSOutputImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMLSSerializerImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMLocatorImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMNamedNodeMapImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMNodeIDMap.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMNodeImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMNodeIteratorImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMNodeListImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMNodeVector.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMNormalizer.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMNotationImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMParentNode.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMProcessingInstructionImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMRangeImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMStringListImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMStringPool.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMTextImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMTreeWalkerImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMTypeInfoImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMXPathExpressionImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMXPathNSResolverImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMXPathResultImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/XSDElementNSImpl.Plo -rm -f xercesc/framework/$(DEPDIR)/BinOutputStream.Plo -rm -f xercesc/framework/$(DEPDIR)/LocalFileFormatTarget.Plo -rm -f xercesc/framework/$(DEPDIR)/LocalFileInputSource.Plo -rm -f xercesc/framework/$(DEPDIR)/MemBufFormatTarget.Plo -rm -f xercesc/framework/$(DEPDIR)/MemBufInputSource.Plo -rm -f xercesc/framework/$(DEPDIR)/StdInInputSource.Plo -rm -f xercesc/framework/$(DEPDIR)/StdOutFormatTarget.Plo -rm -f xercesc/framework/$(DEPDIR)/URLInputSource.Plo -rm -f xercesc/framework/$(DEPDIR)/Wrapper4DOMLSInput.Plo -rm -f xercesc/framework/$(DEPDIR)/Wrapper4InputSource.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLAttDef.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLAttDefList.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLAttr.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLBuffer.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLBufferMgr.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLContentModel.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLDTDDescription.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLElementDecl.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLEntityDecl.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLFormatter.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLGrammarDescription.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLGrammarPoolImpl.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLNotationDecl.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLRecognizer.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLRefInfo.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLSchemaDescription.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLValidator.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/PSVIAttribute.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/PSVIAttributeList.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/PSVIElement.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/PSVIItem.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSAnnotation.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSAttributeDeclaration.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSAttributeGroupDefinition.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSAttributeUse.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSComplexTypeDefinition.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSElementDeclaration.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSFacet.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSIDCDefinition.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSModel.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSModelGroup.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSModelGroupDefinition.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSMultiValueFacet.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSNamespaceItem.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSNotationDeclaration.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSObject.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSParticle.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSSimpleTypeDefinition.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSTypeDefinition.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSValue.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSWildcard.Plo -rm -f xercesc/internal/$(DEPDIR)/BinFileOutputStream.Plo -rm -f xercesc/internal/$(DEPDIR)/BinMemOutputStream.Plo -rm -f xercesc/internal/$(DEPDIR)/DGXMLScanner.Plo -rm -f xercesc/internal/$(DEPDIR)/ElemStack.Plo -rm -f xercesc/internal/$(DEPDIR)/IGXMLScanner.Plo -rm -f xercesc/internal/$(DEPDIR)/IGXMLScanner2.Plo -rm -f xercesc/internal/$(DEPDIR)/MemoryManagerImpl.Plo -rm -f xercesc/internal/$(DEPDIR)/ReaderMgr.Plo -rm -f xercesc/internal/$(DEPDIR)/SGXMLScanner.Plo -rm -f xercesc/internal/$(DEPDIR)/ValidationContextImpl.Plo -rm -f xercesc/internal/$(DEPDIR)/VecAttrListImpl.Plo -rm -f xercesc/internal/$(DEPDIR)/VecAttributesImpl.Plo -rm -f xercesc/internal/$(DEPDIR)/WFXMLScanner.Plo -rm -f xercesc/internal/$(DEPDIR)/XMLReader.Plo -rm -f xercesc/internal/$(DEPDIR)/XMLScanner.Plo -rm -f xercesc/internal/$(DEPDIR)/XMLScannerResolver.Plo -rm -f xercesc/internal/$(DEPDIR)/XProtoType.Plo -rm -f xercesc/internal/$(DEPDIR)/XSAXMLScanner.Plo -rm -f xercesc/internal/$(DEPDIR)/XSObjectFactory.Plo -rm -f xercesc/internal/$(DEPDIR)/XSerializeEngine.Plo -rm -f xercesc/internal/$(DEPDIR)/XTemplateSerializer.Plo -rm -f xercesc/parsers/$(DEPDIR)/AbstractDOMParser.Plo -rm -f xercesc/parsers/$(DEPDIR)/DOMLSParserImpl.Plo -rm -f xercesc/parsers/$(DEPDIR)/SAX2XMLFilterImpl.Plo -rm -f xercesc/parsers/$(DEPDIR)/SAX2XMLReaderImpl.Plo -rm -f xercesc/parsers/$(DEPDIR)/SAXParser.Plo -rm -f xercesc/parsers/$(DEPDIR)/XercesDOMParser.Plo -rm -f xercesc/sax/$(DEPDIR)/Dummy.Plo -rm -f xercesc/sax/$(DEPDIR)/InputSource.Plo -rm -f xercesc/sax/$(DEPDIR)/SAXException.Plo -rm -f xercesc/sax/$(DEPDIR)/SAXParseException.Plo -rm -f xercesc/sax2/$(DEPDIR)/sax2Dummy.Plo -rm -f xercesc/util/$(DEPDIR)/Base64.Plo -rm -f xercesc/util/$(DEPDIR)/BinFileInputStream.Plo -rm -f xercesc/util/$(DEPDIR)/BinInputStream.Plo -rm -f xercesc/util/$(DEPDIR)/BinMemInputStream.Plo -rm -f xercesc/util/$(DEPDIR)/BitSet.Plo -rm -f xercesc/util/$(DEPDIR)/DefaultPanicHandler.Plo -rm -f xercesc/util/$(DEPDIR)/EncodingValidator.Plo -rm -f xercesc/util/$(DEPDIR)/HeaderDummy.Plo -rm -f xercesc/util/$(DEPDIR)/HexBin.Plo -rm -f xercesc/util/$(DEPDIR)/JanitorExports.Plo -rm -f xercesc/util/$(DEPDIR)/KVStringPair.Plo -rm -f xercesc/util/$(DEPDIR)/Mutexes.Plo -rm -f xercesc/util/$(DEPDIR)/PSVIUni.Plo -rm -f xercesc/util/$(DEPDIR)/PanicHandler.Plo -rm -f xercesc/util/$(DEPDIR)/PlatformUtils.Plo -rm -f xercesc/util/$(DEPDIR)/QName.Plo -rm -f xercesc/util/$(DEPDIR)/StringPool.Plo -rm -f xercesc/util/$(DEPDIR)/SynchronizedStringPool.Plo -rm -f xercesc/util/$(DEPDIR)/TransService.Plo -rm -f xercesc/util/$(DEPDIR)/XML256TableTranscoder.Plo -rm -f xercesc/util/$(DEPDIR)/XML88591Transcoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLASCIITranscoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLAbstractDoubleFloat.Plo -rm -f xercesc/util/$(DEPDIR)/XMLBigDecimal.Plo -rm -f xercesc/util/$(DEPDIR)/XMLBigInteger.Plo -rm -f xercesc/util/$(DEPDIR)/XMLChTranscoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLChar.Plo -rm -f xercesc/util/$(DEPDIR)/XMLDateTime.Plo -rm -f xercesc/util/$(DEPDIR)/XMLDouble.Plo -rm -f xercesc/util/$(DEPDIR)/XMLEBCDICTranscoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLException.Plo -rm -f xercesc/util/$(DEPDIR)/XMLFloat.Plo -rm -f xercesc/util/$(DEPDIR)/XMLIBM1047Transcoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLIBM1140Transcoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLInitializer.Plo -rm -f xercesc/util/$(DEPDIR)/XMLMsgLoader.Plo -rm -f xercesc/util/$(DEPDIR)/XMLNumber.Plo -rm -f xercesc/util/$(DEPDIR)/XMLString.Plo -rm -f xercesc/util/$(DEPDIR)/XMLStringTokenizer.Plo -rm -f xercesc/util/$(DEPDIR)/XMLUCS4Transcoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLURL.Plo -rm -f xercesc/util/$(DEPDIR)/XMLUTF16Transcoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLUTF8Transcoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLUni.Plo -rm -f xercesc/util/$(DEPDIR)/XMLUri.Plo -rm -f xercesc/util/$(DEPDIR)/XMLWin1252Transcoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMemory.Plo -rm -f xercesc/util/FileManagers/$(DEPDIR)/PosixFileMgr.Plo -rm -f xercesc/util/FileManagers/$(DEPDIR)/WindowsFileMgr.Plo -rm -f xercesc/util/MsgLoaders/ICU/$(DEPDIR)/ICUMsgLoader.Plo -rm -f xercesc/util/MsgLoaders/InMemory/$(DEPDIR)/InMemMsgLoader.Plo -rm -f xercesc/util/MsgLoaders/MsgCatalog/$(DEPDIR)/MsgCatalogLoader.Plo -rm -f xercesc/util/MutexManagers/$(DEPDIR)/NoThreadMutexMgr.Plo -rm -f xercesc/util/MutexManagers/$(DEPDIR)/PosixMutexMgr.Plo -rm -f xercesc/util/MutexManagers/$(DEPDIR)/StdMutexMgr.Plo -rm -f xercesc/util/MutexManagers/$(DEPDIR)/WindowsMutexMgr.Plo -rm -f xercesc/util/NetAccessors/$(DEPDIR)/BinHTTPInputStreamCommon.Plo -rm -f xercesc/util/NetAccessors/Curl/$(DEPDIR)/CurlNetAccessor.Plo -rm -f xercesc/util/NetAccessors/Curl/$(DEPDIR)/CurlURLInputStream.Plo -rm -f xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR)/MacOSURLAccessCF.Plo -rm -f xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR)/URLAccessCFBinInputStream.Plo -rm -f xercesc/util/NetAccessors/Socket/$(DEPDIR)/SocketNetAccessor.Plo -rm -f xercesc/util/NetAccessors/Socket/$(DEPDIR)/UnixHTTPURLInputStream.Plo -rm -f xercesc/util/NetAccessors/WinSock/$(DEPDIR)/BinHTTPURLInputStream.Plo -rm -f xercesc/util/NetAccessors/WinSock/$(DEPDIR)/WinSockNetAccessor.Plo -rm -f xercesc/util/Transcoders/ICU/$(DEPDIR)/ICUTransService.Plo -rm -f xercesc/util/Transcoders/Iconv/$(DEPDIR)/IconvTransService.Plo -rm -f xercesc/util/Transcoders/IconvGNU/$(DEPDIR)/IconvGNUTransService.Plo -rm -f xercesc/util/Transcoders/MacOSUnicodeConverter/$(DEPDIR)/MacOSUnicodeConverter.Plo -rm -f xercesc/util/Transcoders/Win32/$(DEPDIR)/Win32TransService.Plo -rm -f xercesc/util/regx/$(DEPDIR)/ASCIIRangeFactory.Plo -rm -f xercesc/util/regx/$(DEPDIR)/BMPattern.Plo -rm -f xercesc/util/regx/$(DEPDIR)/BlockRangeFactory.Plo -rm -f xercesc/util/regx/$(DEPDIR)/CharToken.Plo -rm -f xercesc/util/regx/$(DEPDIR)/ClosureToken.Plo -rm -f xercesc/util/regx/$(DEPDIR)/ConcatToken.Plo -rm -f xercesc/util/regx/$(DEPDIR)/Match.Plo -rm -f xercesc/util/regx/$(DEPDIR)/Op.Plo -rm -f xercesc/util/regx/$(DEPDIR)/OpFactory.Plo -rm -f xercesc/util/regx/$(DEPDIR)/ParenToken.Plo -rm -f xercesc/util/regx/$(DEPDIR)/ParserForXMLSchema.Plo -rm -f xercesc/util/regx/$(DEPDIR)/RangeFactory.Plo -rm -f xercesc/util/regx/$(DEPDIR)/RangeToken.Plo -rm -f xercesc/util/regx/$(DEPDIR)/RangeTokenMap.Plo -rm -f xercesc/util/regx/$(DEPDIR)/RegularExpression.Plo -rm -f xercesc/util/regx/$(DEPDIR)/RegxParser.Plo -rm -f xercesc/util/regx/$(DEPDIR)/RegxUtil.Plo -rm -f xercesc/util/regx/$(DEPDIR)/StringToken.Plo -rm -f xercesc/util/regx/$(DEPDIR)/Token.Plo -rm -f xercesc/util/regx/$(DEPDIR)/TokenFactory.Plo -rm -f xercesc/util/regx/$(DEPDIR)/UnicodeRangeFactory.Plo -rm -f xercesc/util/regx/$(DEPDIR)/UnionToken.Plo -rm -f xercesc/util/regx/$(DEPDIR)/XMLRangeFactory.Plo -rm -f xercesc/util/regx/$(DEPDIR)/XMLUniCharacter.Plo -rm -f xercesc/validators/DTD/$(DEPDIR)/DTDAttDef.Plo -rm -f xercesc/validators/DTD/$(DEPDIR)/DTDAttDefList.Plo -rm -f xercesc/validators/DTD/$(DEPDIR)/DTDElementDecl.Plo -rm -f xercesc/validators/DTD/$(DEPDIR)/DTDEntityDecl.Plo -rm -f xercesc/validators/DTD/$(DEPDIR)/DTDGrammar.Plo -rm -f xercesc/validators/DTD/$(DEPDIR)/DTDScanner.Plo -rm -f xercesc/validators/DTD/$(DEPDIR)/DTDValidator.Plo -rm -f xercesc/validators/DTD/$(DEPDIR)/XMLDTDDescriptionImpl.Plo -rm -f xercesc/validators/common/$(DEPDIR)/AllContentModel.Plo -rm -f xercesc/validators/common/$(DEPDIR)/CMAny.Plo -rm -f xercesc/validators/common/$(DEPDIR)/CMBinaryOp.Plo -rm -f xercesc/validators/common/$(DEPDIR)/CMUnaryOp.Plo -rm -f xercesc/validators/common/$(DEPDIR)/ContentLeafNameTypeVector.Plo -rm -f xercesc/validators/common/$(DEPDIR)/ContentSpecNode.Plo -rm -f xercesc/validators/common/$(DEPDIR)/DFAContentModel.Plo -rm -f xercesc/validators/common/$(DEPDIR)/Grammar.Plo -rm -f xercesc/validators/common/$(DEPDIR)/GrammarResolver.Plo -rm -f xercesc/validators/common/$(DEPDIR)/MixedContentModel.Plo -rm -f xercesc/validators/common/$(DEPDIR)/SimpleContentModel.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/AbstractNumericFacetValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/AbstractNumericValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/AbstractStringValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/AnySimpleTypeDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/AnyURIDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/Base64BinaryDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/BooleanDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DatatypeValidatorFactory.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DateDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DateTimeDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DateTimeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DayDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DecimalDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DoubleDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DurationDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/ENTITYDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/FloatDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/HexBinaryDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/IDDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/IDREFDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/ListDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/MonthDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/MonthDayDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/NCNameDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/NOTATIONDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/NameDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/QNameDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/StringDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/TimeDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/UnionDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/XMLCanRepGroup.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/YearDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/YearMonthDatatypeValidator.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/ComplexTypeInfo.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/GeneralAttributeCheck.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/NamespaceScope.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/SchemaAttDef.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/SchemaAttDefList.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/SchemaElementDecl.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/SchemaGrammar.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/SchemaInfo.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/SchemaSymbols.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/SchemaValidator.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/SubstitutionGroupComparator.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/TraverseSchema.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/XMLSchemaDescriptionImpl.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/XSDDOMParser.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/XSDErrorReporter.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/XSDLocator.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/XUtil.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/XercesAttGroupInfo.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/XercesElementWildcard.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/XercesGroupInfo.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/FieldActivator.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/FieldValueMap.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/IC_Field.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/IC_Key.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/IC_KeyRef.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/IC_Selector.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/IC_Unique.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/IdentityConstraint.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/IdentityConstraintHandler.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/ValueStore.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/ValueStoreCache.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/XPathMatcher.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/XPathMatcherStack.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/XPathSymbols.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/XercesXPath.Plo -rm -f xercesc/xinclude/$(DEPDIR)/XIncludeDOMDocumentProcessor.Plo -rm -f xercesc/xinclude/$(DEPDIR)/XIncludeLocation.Plo -rm -f xercesc/xinclude/$(DEPDIR)/XIncludeUtils.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-iconv_msgDATA \ install-nobase_libxerces_c_laHEADERS \ install-nodist_autoconfheadersHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(DEPDIR)/stricmp.Plo -rm -f $(DEPDIR)/strnicmp.Plo -rm -f $(DEPDIR)/towlower.Plo -rm -f $(DEPDIR)/towupper.Plo -rm -f ./$(DEPDIR)/root_res.Plo -rm -f ./$(DEPDIR)/xercesc_messages.Plo -rm -f xercesc/dom/$(DEPDIR)/DOMException.Plo -rm -f xercesc/dom/$(DEPDIR)/DOMLSException.Plo -rm -f xercesc/dom/$(DEPDIR)/DOMRangeException.Plo -rm -f xercesc/dom/$(DEPDIR)/DOMXPathException.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMAttrImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMAttrMapImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMAttrNSImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMCDATASectionImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMCharacterDataImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMChildNode.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMCommentImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMConfigurationImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMDeepNodeListImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMDocumentFragmentImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMDocumentImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMDocumentTypeImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMElementImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMElementNSImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMEntityImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMEntityReferenceImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMErrorImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMImplementationImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMImplementationListImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMImplementationRegistry.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMLSInputImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMLSOutputImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMLSSerializerImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMLocatorImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMNamedNodeMapImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMNodeIDMap.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMNodeImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMNodeIteratorImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMNodeListImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMNodeVector.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMNormalizer.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMNotationImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMParentNode.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMProcessingInstructionImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMRangeImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMStringListImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMStringPool.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMTextImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMTreeWalkerImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMTypeInfoImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMXPathExpressionImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMXPathNSResolverImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/DOMXPathResultImpl.Plo -rm -f xercesc/dom/impl/$(DEPDIR)/XSDElementNSImpl.Plo -rm -f xercesc/framework/$(DEPDIR)/BinOutputStream.Plo -rm -f xercesc/framework/$(DEPDIR)/LocalFileFormatTarget.Plo -rm -f xercesc/framework/$(DEPDIR)/LocalFileInputSource.Plo -rm -f xercesc/framework/$(DEPDIR)/MemBufFormatTarget.Plo -rm -f xercesc/framework/$(DEPDIR)/MemBufInputSource.Plo -rm -f xercesc/framework/$(DEPDIR)/StdInInputSource.Plo -rm -f xercesc/framework/$(DEPDIR)/StdOutFormatTarget.Plo -rm -f xercesc/framework/$(DEPDIR)/URLInputSource.Plo -rm -f xercesc/framework/$(DEPDIR)/Wrapper4DOMLSInput.Plo -rm -f xercesc/framework/$(DEPDIR)/Wrapper4InputSource.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLAttDef.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLAttDefList.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLAttr.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLBuffer.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLBufferMgr.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLContentModel.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLDTDDescription.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLElementDecl.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLEntityDecl.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLFormatter.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLGrammarDescription.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLGrammarPoolImpl.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLNotationDecl.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLRecognizer.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLRefInfo.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLSchemaDescription.Plo -rm -f xercesc/framework/$(DEPDIR)/XMLValidator.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/PSVIAttribute.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/PSVIAttributeList.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/PSVIElement.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/PSVIItem.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSAnnotation.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSAttributeDeclaration.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSAttributeGroupDefinition.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSAttributeUse.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSComplexTypeDefinition.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSElementDeclaration.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSFacet.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSIDCDefinition.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSModel.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSModelGroup.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSModelGroupDefinition.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSMultiValueFacet.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSNamespaceItem.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSNotationDeclaration.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSObject.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSParticle.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSSimpleTypeDefinition.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSTypeDefinition.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSValue.Plo -rm -f xercesc/framework/psvi/$(DEPDIR)/XSWildcard.Plo -rm -f xercesc/internal/$(DEPDIR)/BinFileOutputStream.Plo -rm -f xercesc/internal/$(DEPDIR)/BinMemOutputStream.Plo -rm -f xercesc/internal/$(DEPDIR)/DGXMLScanner.Plo -rm -f xercesc/internal/$(DEPDIR)/ElemStack.Plo -rm -f xercesc/internal/$(DEPDIR)/IGXMLScanner.Plo -rm -f xercesc/internal/$(DEPDIR)/IGXMLScanner2.Plo -rm -f xercesc/internal/$(DEPDIR)/MemoryManagerImpl.Plo -rm -f xercesc/internal/$(DEPDIR)/ReaderMgr.Plo -rm -f xercesc/internal/$(DEPDIR)/SGXMLScanner.Plo -rm -f xercesc/internal/$(DEPDIR)/ValidationContextImpl.Plo -rm -f xercesc/internal/$(DEPDIR)/VecAttrListImpl.Plo -rm -f xercesc/internal/$(DEPDIR)/VecAttributesImpl.Plo -rm -f xercesc/internal/$(DEPDIR)/WFXMLScanner.Plo -rm -f xercesc/internal/$(DEPDIR)/XMLReader.Plo -rm -f xercesc/internal/$(DEPDIR)/XMLScanner.Plo -rm -f xercesc/internal/$(DEPDIR)/XMLScannerResolver.Plo -rm -f xercesc/internal/$(DEPDIR)/XProtoType.Plo -rm -f xercesc/internal/$(DEPDIR)/XSAXMLScanner.Plo -rm -f xercesc/internal/$(DEPDIR)/XSObjectFactory.Plo -rm -f xercesc/internal/$(DEPDIR)/XSerializeEngine.Plo -rm -f xercesc/internal/$(DEPDIR)/XTemplateSerializer.Plo -rm -f xercesc/parsers/$(DEPDIR)/AbstractDOMParser.Plo -rm -f xercesc/parsers/$(DEPDIR)/DOMLSParserImpl.Plo -rm -f xercesc/parsers/$(DEPDIR)/SAX2XMLFilterImpl.Plo -rm -f xercesc/parsers/$(DEPDIR)/SAX2XMLReaderImpl.Plo -rm -f xercesc/parsers/$(DEPDIR)/SAXParser.Plo -rm -f xercesc/parsers/$(DEPDIR)/XercesDOMParser.Plo -rm -f xercesc/sax/$(DEPDIR)/Dummy.Plo -rm -f xercesc/sax/$(DEPDIR)/InputSource.Plo -rm -f xercesc/sax/$(DEPDIR)/SAXException.Plo -rm -f xercesc/sax/$(DEPDIR)/SAXParseException.Plo -rm -f xercesc/sax2/$(DEPDIR)/sax2Dummy.Plo -rm -f xercesc/util/$(DEPDIR)/Base64.Plo -rm -f xercesc/util/$(DEPDIR)/BinFileInputStream.Plo -rm -f xercesc/util/$(DEPDIR)/BinInputStream.Plo -rm -f xercesc/util/$(DEPDIR)/BinMemInputStream.Plo -rm -f xercesc/util/$(DEPDIR)/BitSet.Plo -rm -f xercesc/util/$(DEPDIR)/DefaultPanicHandler.Plo -rm -f xercesc/util/$(DEPDIR)/EncodingValidator.Plo -rm -f xercesc/util/$(DEPDIR)/HeaderDummy.Plo -rm -f xercesc/util/$(DEPDIR)/HexBin.Plo -rm -f xercesc/util/$(DEPDIR)/JanitorExports.Plo -rm -f xercesc/util/$(DEPDIR)/KVStringPair.Plo -rm -f xercesc/util/$(DEPDIR)/Mutexes.Plo -rm -f xercesc/util/$(DEPDIR)/PSVIUni.Plo -rm -f xercesc/util/$(DEPDIR)/PanicHandler.Plo -rm -f xercesc/util/$(DEPDIR)/PlatformUtils.Plo -rm -f xercesc/util/$(DEPDIR)/QName.Plo -rm -f xercesc/util/$(DEPDIR)/StringPool.Plo -rm -f xercesc/util/$(DEPDIR)/SynchronizedStringPool.Plo -rm -f xercesc/util/$(DEPDIR)/TransService.Plo -rm -f xercesc/util/$(DEPDIR)/XML256TableTranscoder.Plo -rm -f xercesc/util/$(DEPDIR)/XML88591Transcoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLASCIITranscoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLAbstractDoubleFloat.Plo -rm -f xercesc/util/$(DEPDIR)/XMLBigDecimal.Plo -rm -f xercesc/util/$(DEPDIR)/XMLBigInteger.Plo -rm -f xercesc/util/$(DEPDIR)/XMLChTranscoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLChar.Plo -rm -f xercesc/util/$(DEPDIR)/XMLDateTime.Plo -rm -f xercesc/util/$(DEPDIR)/XMLDouble.Plo -rm -f xercesc/util/$(DEPDIR)/XMLEBCDICTranscoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLException.Plo -rm -f xercesc/util/$(DEPDIR)/XMLFloat.Plo -rm -f xercesc/util/$(DEPDIR)/XMLIBM1047Transcoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLIBM1140Transcoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLInitializer.Plo -rm -f xercesc/util/$(DEPDIR)/XMLMsgLoader.Plo -rm -f xercesc/util/$(DEPDIR)/XMLNumber.Plo -rm -f xercesc/util/$(DEPDIR)/XMLString.Plo -rm -f xercesc/util/$(DEPDIR)/XMLStringTokenizer.Plo -rm -f xercesc/util/$(DEPDIR)/XMLUCS4Transcoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLURL.Plo -rm -f xercesc/util/$(DEPDIR)/XMLUTF16Transcoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLUTF8Transcoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMLUni.Plo -rm -f xercesc/util/$(DEPDIR)/XMLUri.Plo -rm -f xercesc/util/$(DEPDIR)/XMLWin1252Transcoder.Plo -rm -f xercesc/util/$(DEPDIR)/XMemory.Plo -rm -f xercesc/util/FileManagers/$(DEPDIR)/PosixFileMgr.Plo -rm -f xercesc/util/FileManagers/$(DEPDIR)/WindowsFileMgr.Plo -rm -f xercesc/util/MsgLoaders/ICU/$(DEPDIR)/ICUMsgLoader.Plo -rm -f xercesc/util/MsgLoaders/InMemory/$(DEPDIR)/InMemMsgLoader.Plo -rm -f xercesc/util/MsgLoaders/MsgCatalog/$(DEPDIR)/MsgCatalogLoader.Plo -rm -f xercesc/util/MutexManagers/$(DEPDIR)/NoThreadMutexMgr.Plo -rm -f xercesc/util/MutexManagers/$(DEPDIR)/PosixMutexMgr.Plo -rm -f xercesc/util/MutexManagers/$(DEPDIR)/StdMutexMgr.Plo -rm -f xercesc/util/MutexManagers/$(DEPDIR)/WindowsMutexMgr.Plo -rm -f xercesc/util/NetAccessors/$(DEPDIR)/BinHTTPInputStreamCommon.Plo -rm -f xercesc/util/NetAccessors/Curl/$(DEPDIR)/CurlNetAccessor.Plo -rm -f xercesc/util/NetAccessors/Curl/$(DEPDIR)/CurlURLInputStream.Plo -rm -f xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR)/MacOSURLAccessCF.Plo -rm -f xercesc/util/NetAccessors/MacOSURLAccessCF/$(DEPDIR)/URLAccessCFBinInputStream.Plo -rm -f xercesc/util/NetAccessors/Socket/$(DEPDIR)/SocketNetAccessor.Plo -rm -f xercesc/util/NetAccessors/Socket/$(DEPDIR)/UnixHTTPURLInputStream.Plo -rm -f xercesc/util/NetAccessors/WinSock/$(DEPDIR)/BinHTTPURLInputStream.Plo -rm -f xercesc/util/NetAccessors/WinSock/$(DEPDIR)/WinSockNetAccessor.Plo -rm -f xercesc/util/Transcoders/ICU/$(DEPDIR)/ICUTransService.Plo -rm -f xercesc/util/Transcoders/Iconv/$(DEPDIR)/IconvTransService.Plo -rm -f xercesc/util/Transcoders/IconvGNU/$(DEPDIR)/IconvGNUTransService.Plo -rm -f xercesc/util/Transcoders/MacOSUnicodeConverter/$(DEPDIR)/MacOSUnicodeConverter.Plo -rm -f xercesc/util/Transcoders/Win32/$(DEPDIR)/Win32TransService.Plo -rm -f xercesc/util/regx/$(DEPDIR)/ASCIIRangeFactory.Plo -rm -f xercesc/util/regx/$(DEPDIR)/BMPattern.Plo -rm -f xercesc/util/regx/$(DEPDIR)/BlockRangeFactory.Plo -rm -f xercesc/util/regx/$(DEPDIR)/CharToken.Plo -rm -f xercesc/util/regx/$(DEPDIR)/ClosureToken.Plo -rm -f xercesc/util/regx/$(DEPDIR)/ConcatToken.Plo -rm -f xercesc/util/regx/$(DEPDIR)/Match.Plo -rm -f xercesc/util/regx/$(DEPDIR)/Op.Plo -rm -f xercesc/util/regx/$(DEPDIR)/OpFactory.Plo -rm -f xercesc/util/regx/$(DEPDIR)/ParenToken.Plo -rm -f xercesc/util/regx/$(DEPDIR)/ParserForXMLSchema.Plo -rm -f xercesc/util/regx/$(DEPDIR)/RangeFactory.Plo -rm -f xercesc/util/regx/$(DEPDIR)/RangeToken.Plo -rm -f xercesc/util/regx/$(DEPDIR)/RangeTokenMap.Plo -rm -f xercesc/util/regx/$(DEPDIR)/RegularExpression.Plo -rm -f xercesc/util/regx/$(DEPDIR)/RegxParser.Plo -rm -f xercesc/util/regx/$(DEPDIR)/RegxUtil.Plo -rm -f xercesc/util/regx/$(DEPDIR)/StringToken.Plo -rm -f xercesc/util/regx/$(DEPDIR)/Token.Plo -rm -f xercesc/util/regx/$(DEPDIR)/TokenFactory.Plo -rm -f xercesc/util/regx/$(DEPDIR)/UnicodeRangeFactory.Plo -rm -f xercesc/util/regx/$(DEPDIR)/UnionToken.Plo -rm -f xercesc/util/regx/$(DEPDIR)/XMLRangeFactory.Plo -rm -f xercesc/util/regx/$(DEPDIR)/XMLUniCharacter.Plo -rm -f xercesc/validators/DTD/$(DEPDIR)/DTDAttDef.Plo -rm -f xercesc/validators/DTD/$(DEPDIR)/DTDAttDefList.Plo -rm -f xercesc/validators/DTD/$(DEPDIR)/DTDElementDecl.Plo -rm -f xercesc/validators/DTD/$(DEPDIR)/DTDEntityDecl.Plo -rm -f xercesc/validators/DTD/$(DEPDIR)/DTDGrammar.Plo -rm -f xercesc/validators/DTD/$(DEPDIR)/DTDScanner.Plo -rm -f xercesc/validators/DTD/$(DEPDIR)/DTDValidator.Plo -rm -f xercesc/validators/DTD/$(DEPDIR)/XMLDTDDescriptionImpl.Plo -rm -f xercesc/validators/common/$(DEPDIR)/AllContentModel.Plo -rm -f xercesc/validators/common/$(DEPDIR)/CMAny.Plo -rm -f xercesc/validators/common/$(DEPDIR)/CMBinaryOp.Plo -rm -f xercesc/validators/common/$(DEPDIR)/CMUnaryOp.Plo -rm -f xercesc/validators/common/$(DEPDIR)/ContentLeafNameTypeVector.Plo -rm -f xercesc/validators/common/$(DEPDIR)/ContentSpecNode.Plo -rm -f xercesc/validators/common/$(DEPDIR)/DFAContentModel.Plo -rm -f xercesc/validators/common/$(DEPDIR)/Grammar.Plo -rm -f xercesc/validators/common/$(DEPDIR)/GrammarResolver.Plo -rm -f xercesc/validators/common/$(DEPDIR)/MixedContentModel.Plo -rm -f xercesc/validators/common/$(DEPDIR)/SimpleContentModel.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/AbstractNumericFacetValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/AbstractNumericValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/AbstractStringValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/AnySimpleTypeDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/AnyURIDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/Base64BinaryDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/BooleanDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DatatypeValidatorFactory.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DateDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DateTimeDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DateTimeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DayDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DecimalDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DoubleDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/DurationDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/ENTITYDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/FloatDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/HexBinaryDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/IDDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/IDREFDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/ListDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/MonthDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/MonthDayDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/NCNameDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/NOTATIONDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/NameDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/QNameDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/StringDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/TimeDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/UnionDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/XMLCanRepGroup.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/YearDatatypeValidator.Plo -rm -f xercesc/validators/datatype/$(DEPDIR)/YearMonthDatatypeValidator.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/ComplexTypeInfo.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/GeneralAttributeCheck.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/NamespaceScope.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/SchemaAttDef.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/SchemaAttDefList.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/SchemaElementDecl.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/SchemaGrammar.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/SchemaInfo.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/SchemaSymbols.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/SchemaValidator.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/SubstitutionGroupComparator.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/TraverseSchema.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/XMLSchemaDescriptionImpl.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/XSDDOMParser.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/XSDErrorReporter.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/XSDLocator.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/XUtil.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/XercesAttGroupInfo.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/XercesElementWildcard.Plo -rm -f xercesc/validators/schema/$(DEPDIR)/XercesGroupInfo.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/FieldActivator.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/FieldValueMap.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/IC_Field.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/IC_Key.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/IC_KeyRef.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/IC_Selector.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/IC_Unique.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/IdentityConstraint.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/IdentityConstraintHandler.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/ValueStore.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/ValueStoreCache.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/XPathMatcher.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/XPathMatcherStack.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/XPathSymbols.Plo -rm -f xercesc/validators/schema/identity/$(DEPDIR)/XercesXPath.Plo -rm -f xercesc/xinclude/$(DEPDIR)/XIncludeDOMDocumentProcessor.Plo -rm -f xercesc/xinclude/$(DEPDIR)/XIncludeLocation.Plo -rm -f xercesc/xinclude/$(DEPDIR)/XIncludeUtils.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-iconv_msgDATA uninstall-libLTLIBRARIES \ uninstall-nobase_libxerces_c_laHEADERS \ uninstall-nodist_autoconfheadersHEADERS .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am \ install-iconv_msgDATA install-info install-info-am \ install-libLTLIBRARIES install-man \ install-nobase_libxerces_c_laHEADERS \ install-nodist_autoconfheadersHEADERS install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-iconv_msgDATA \ uninstall-libLTLIBRARIES \ uninstall-nobase_libxerces_c_laHEADERS \ uninstall-nodist_autoconfheadersHEADERS .PRECIOUS: Makefile @XERCES_USE_MSGLOADER_ICU_TRUE@xercesc_messages.c: ${top_srcdir}/src/xercesc/util/MsgLoaders/ICU/resources/res-file-list.txt @XERCES_USE_MSGLOADER_ICU_TRUE@ ${ICU_SBIN}gencmn --name ${PKGNAME} -S ${PKGNAME}_dat.c -d . ${top_srcdir}/src/xercesc/util/MsgLoaders/ICU/resources/res-file-list.txt @XERCES_USE_MSGLOADER_ICU_TRUE@ @mv ${PKGNAME}_dat.c xercesc_messages.c @XERCES_USE_MSGLOADER_ICU_TRUE@root_res.c: ${top_srcdir}/src/xercesc/util/MsgLoaders/ICU/resources/root.txt @XERCES_USE_MSGLOADER_ICU_TRUE@ ${ICU_BIN}genrb -d . ${top_srcdir}/src/xercesc/util/MsgLoaders/ICU/resources/root.txt @XERCES_USE_MSGLOADER_ICU_TRUE@ ${ICU_SBIN}genccode --name ${PKGNAME} -d . root.res # Resources @XERCES_USE_MSGLOADER_ICONV_TRUE@XercesMessages_en_US.cat: @srcdir@/xercesc/util/MsgLoaders/MsgCatalog/XercesMessages_en_US.Msg @XERCES_USE_MSGLOADER_ICONV_TRUE@ @echo "generating $@ from @srcdir@/xercesc/util/MsgLoaders/MsgCatalog/XercesMessages_en_US.Msg" @XERCES_USE_MSGLOADER_ICONV_TRUE@ gencat $@ @srcdir@/xercesc/util/MsgLoaders/MsgCatalog/XercesMessages_en_US.Msg # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xerces-c-3.2.2/src/stricmp.c000644 000765 000024 00000002243 13241160332 016453 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: stricmp.c 679398 2008-07-24 12:52:20Z borisk $ */ #include "stricmp.h" #include "config.h" #if HAVE_STRING_H # include #endif #if HAVE_STRINGS_H # include #endif int stricmp(const char* str1, const char* str2) { #if HAVE_STRCASECMP return strcasecmp(str1, str2); #else #error Need implementation of stricmp compatibility function #endif } xerces-c-3.2.2/src/xercesc/xinclude/000755 000765 000024 00000000000 13345765734 020122 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/parsers/000755 000765 000024 00000000000 13345765733 017765 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/util/000755 000765 000024 00000000000 13345765734 017264 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/NLS/000755 000765 000024 00000000000 13241160333 016716 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/framework/000755 000765 000024 00000000000 13345765733 020303 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/sax/000755 000765 000024 00000000000 13345765733 017101 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/internal/000755 000765 000024 00000000000 13345765733 020122 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/sax2/000755 000765 000024 00000000000 13345765733 017163 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/dom/000755 000765 000024 00000000000 13345765733 017065 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/validators/000755 000765 000024 00000000000 13345765730 020453 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/validators/datatype/000755 000765 000024 00000000000 13345765734 022272 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/validators/schema/000755 000765 000024 00000000000 13345765734 021717 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/validators/common/000755 000765 000024 00000000000 13345765733 021746 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/validators/DTD/000755 000765 000024 00000000000 13345765734 021072 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/validators/DTD/DTDGrammar.hpp000644 000765 000024 00000031267 13241160333 023511 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DTDGrammar.hpp 883368 2009-11-23 15:28:19Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DTDGRAMMAR_HPP) #define XERCESC_INCLUDE_GUARD_DTDGRAMMAR_HPP #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // // This class stores the DTD information // NOTE: DTDs are not namespace aware, so we just use regular NameIdPool // data structures to store element and attribute decls. They are all set // to be in the global namespace and the full QName is used as the base name // of the decl. This means that all the URI parameters below are expected // to be null pointers (and anything else will cause an exception.) // class VALIDATORS_EXPORT DTDGrammar : public Grammar { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- DTDGrammar(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); virtual ~DTDGrammar(); // ----------------------------------------------------------------------- // Implementation of Virtual Interface // ----------------------------------------------------------------------- virtual Grammar::GrammarType getGrammarType() const; virtual const XMLCh* getTargetNamespace() const; // this method should only be used while the grammar is being // constructed, not while it is being used // in a validation episode! virtual XMLElementDecl* findOrAddElemDecl ( const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const prefixName , const XMLCh* const qName , unsigned int scope , bool& wasAdded ) ; virtual XMLSize_t getElemId ( const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const qName , unsigned int scope ) const ; virtual const XMLElementDecl* getElemDecl ( const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const qName , unsigned int scope ) const ; virtual XMLElementDecl* getElemDecl ( const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const qName , unsigned int scope ); virtual const XMLElementDecl* getElemDecl ( const unsigned int elemId ) const; virtual XMLElementDecl* getElemDecl ( const unsigned int elemId ); virtual const XMLNotationDecl* getNotationDecl ( const XMLCh* const notName ) const; virtual XMLNotationDecl* getNotationDecl ( const XMLCh* const notName ); virtual bool getValidated() const; virtual XMLElementDecl* putElemDecl ( const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const prefixName , const XMLCh* const qName , unsigned int scope , const bool notDeclared = false ); virtual XMLSize_t putElemDecl ( XMLElementDecl* const elemDecl , const bool notDeclared = false ) ; virtual XMLSize_t putNotationDecl ( XMLNotationDecl* const notationDecl ) const; virtual void setValidated(const bool newState); virtual void reset(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- const DTDEntityDecl* getEntityDecl(const XMLCh* const entName) const; DTDEntityDecl* getEntityDecl(const XMLCh* const entName); NameIdPool* getEntityDeclPool(); const NameIdPool* getEntityDeclPool() const; NameIdPoolEnumerator getElemEnumerator() const; NameIdPoolEnumerator getEntityEnumerator() const; NameIdPoolEnumerator getNotationEnumerator() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- virtual void setGrammarDescription( XMLGrammarDescription*); virtual XMLGrammarDescription* getGrammarDescription() const; // ----------------------------------------------------------------------- // Content management methods // ----------------------------------------------------------------------- XMLSize_t putEntityDecl(DTDEntityDecl* const entityDecl) const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(DTDGrammar) private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DTDGrammar(const DTDGrammar &); DTDGrammar& operator = (const DTDGrammar&); // ----------------------------------------------------------------------- // Private data members // // fElemDeclPool // This is the element decl pool. It contains all of the elements // declared in the DTD (and their associated attributes.) // // fElemNonDeclPool // This is the element decl pool that is is populated as new elements // are seen in the XML document (not declared in the DTD), and they // are given default characteristics. // // fEntityDeclPool // This is a pool of EntityDecl objects, which contains all of the // general entities that are declared in the DTD subsets, plus the // default entities (such as > < ...) defined by the XML Standard. // // fNotationDeclPool // This is a pool of NotationDecl objects, which contains all of the // notations declared in the DTD subsets. // // fValidated // Indicates if the content of the Grammar has been pre-validated // or not. When using a cached grammar, no need for pre content // validation. // // fGramDesc: adopted // // ----------------------------------------------------------------------- static NameIdPool* fDefaultEntities; MemoryManager* fMemoryManager; NameIdPool* fElemDeclPool; NameIdPool* fElemNonDeclPool; NameIdPool* fEntityDeclPool; NameIdPool* fNotationDeclPool; XMLDTDDescription* fGramDesc; bool fValidated; friend class XMLInitializer; }; // --------------------------------------------------------------------------- // DTDGrammar: Getter methods // --------------------------------------------------------------------------- inline NameIdPoolEnumerator DTDGrammar::getElemEnumerator() const { return NameIdPoolEnumerator(fElemDeclPool, fMemoryManager); } inline NameIdPoolEnumerator DTDGrammar::getEntityEnumerator() const { return NameIdPoolEnumerator(fEntityDeclPool, fMemoryManager); } inline NameIdPoolEnumerator DTDGrammar::getNotationEnumerator() const { return NameIdPoolEnumerator(fNotationDeclPool, fMemoryManager); } inline const DTDEntityDecl* DTDGrammar::getEntityDecl(const XMLCh* const entName) const { DTDEntityDecl* decl = fDefaultEntities->getByKey(entName); if (!decl) return fEntityDeclPool->getByKey(entName); return decl; } inline DTDEntityDecl* DTDGrammar::getEntityDecl(const XMLCh* const entName) { DTDEntityDecl* decl = fDefaultEntities->getByKey(entName); if (!decl) return fEntityDeclPool->getByKey(entName); return decl; } inline NameIdPool* DTDGrammar::getEntityDeclPool() { return fEntityDeclPool; } inline const NameIdPool* DTDGrammar::getEntityDeclPool() const { return fEntityDeclPool; } // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- inline XMLSize_t DTDGrammar::putEntityDecl(DTDEntityDecl* const entityDecl) const { return fEntityDeclPool->put(entityDecl); } // --------------------------------------------------------------------------- // DTDGrammar: Virtual methods // --------------------------------------------------------------------------- inline Grammar::GrammarType DTDGrammar::getGrammarType() const { return Grammar::DTDGrammarType; } inline const XMLCh* DTDGrammar::getTargetNamespace() const { return XMLUni::fgZeroLenString; } // Element Decl inline XMLSize_t DTDGrammar::getElemId (const unsigned int , const XMLCh* const , const XMLCh* const qName , unsigned int) const { // // In this case, we don't return zero to mean 'not found', so we have to // map it to the official not found value if we don't find it. // const DTDElementDecl* decl = fElemDeclPool->getByKey(qName); if (!decl) return XMLElementDecl::fgInvalidElemId; return decl->getId(); } inline const XMLElementDecl* DTDGrammar::getElemDecl( const unsigned int , const XMLCh* const , const XMLCh* const qName , unsigned int) const { const XMLElementDecl* elemDecl = fElemDeclPool->getByKey(qName); if (!elemDecl && fElemNonDeclPool) elemDecl = fElemNonDeclPool->getByKey(qName); return elemDecl; } inline XMLElementDecl* DTDGrammar::getElemDecl (const unsigned int , const XMLCh* const , const XMLCh* const qName , unsigned int) { XMLElementDecl* elemDecl = fElemDeclPool->getByKey(qName); if (!elemDecl && fElemNonDeclPool) elemDecl = fElemNonDeclPool->getByKey(qName); return elemDecl; } inline const XMLElementDecl* DTDGrammar::getElemDecl(const unsigned int elemId) const { // Look up this element decl by id return fElemDeclPool->getById(elemId); } inline XMLElementDecl* DTDGrammar::getElemDecl(const unsigned int elemId) { // Look up this element decl by id return fElemDeclPool->getById(elemId); } inline XMLSize_t DTDGrammar::putElemDecl(XMLElementDecl* const elemDecl, const bool notDeclared) { if (notDeclared) { if(!fElemNonDeclPool) fElemNonDeclPool = new (fMemoryManager) NameIdPool(29, 128, fMemoryManager); return fElemNonDeclPool->put((DTDElementDecl*) elemDecl); } return fElemDeclPool->put((DTDElementDecl*) elemDecl); } // Notation Decl inline const XMLNotationDecl* DTDGrammar::getNotationDecl(const XMLCh* const notName) const { return fNotationDeclPool->getByKey(notName); } inline XMLNotationDecl* DTDGrammar::getNotationDecl(const XMLCh* const notName) { return fNotationDeclPool->getByKey(notName); } inline XMLSize_t DTDGrammar::putNotationDecl(XMLNotationDecl* const notationDecl) const { return fNotationDeclPool->put(notationDecl); } inline bool DTDGrammar::getValidated() const { return fValidated; } inline void DTDGrammar::setValidated(const bool newState) { fValidated = newState; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/DTD/DTDScanner.cpp000644 000765 000024 00000377573 13241160333 023524 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DTDScanner.cpp 1799527 2017-06-21 22:32:05Z scantor $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN #define CONTENTSPEC_DEPTH_LIMIT 1000 // --------------------------------------------------------------------------- // Local methods // --------------------------------------------------------------------------- // // This method automates the grunt work of looking at a char and see if its // a repetition suffix. If so, it creates a new correct rep node and wraps // the pass node in it. Otherwise, it returns the previous node. // static ContentSpecNode* makeRepNode(const XMLCh testCh, ContentSpecNode* const prevNode, MemoryManager* const manager) { if (testCh == chQuestion) { return new (manager) ContentSpecNode ( ContentSpecNode::ZeroOrOne , prevNode , 0 , true , true , manager ); } else if (testCh == chPlus) { return new (manager) ContentSpecNode ( ContentSpecNode::OneOrMore , prevNode , 0 , true , true , manager ); } else if (testCh == chAsterisk) { return new (manager) ContentSpecNode ( ContentSpecNode::ZeroOrMore , prevNode , 0 , true , true , manager ); } // Just return the incoming node return prevNode; } // --------------------------------------------------------------------------- // DTDValidator: Constructors and Destructor // --------------------------------------------------------------------------- DTDScanner::DTDScanner( DTDGrammar* dtdGrammar , DocTypeHandler* const docTypeHandler , MemoryManager* const grammarPoolMemoryManager , MemoryManager* const manager) : fMemoryManager(manager) , fGrammarPoolMemoryManager(grammarPoolMemoryManager) , fDocTypeHandler(docTypeHandler) , fDumAttDef(0) , fDumElemDecl(0) , fDumEntityDecl(0) , fInternalSubset(false) , fNextAttrId(1) , fDTDGrammar(dtdGrammar) , fBufMgr(0) , fReaderMgr(0) , fScanner(0) , fPEntityDeclPool(0) , fEmptyNamespaceId(0) , fDocTypeReaderId(0) { fPEntityDeclPool = new (fMemoryManager) NameIdPool(109, 128, fMemoryManager); } DTDScanner::~DTDScanner() { delete fDumAttDef; delete fDumElemDecl; delete fDumEntityDecl; delete fPEntityDeclPool; } // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void DTDScanner::setScannerInfo(XMLScanner* const owningScanner , ReaderMgr* const readerMgr , XMLBufferMgr* const bufMgr) { // We don't own any of these, we just reference them fScanner = owningScanner; fReaderMgr = readerMgr; fBufMgr = bufMgr; if (fScanner->getDoNamespaces()) fEmptyNamespaceId = fScanner->getEmptyNamespaceId(); else fEmptyNamespaceId = 0; fDocTypeReaderId = fReaderMgr->getCurrentReaderNum(); } // --------------------------------------------------------------------------- // DTDScanner: Private scanning methods // --------------------------------------------------------------------------- bool DTDScanner::checkForPERef( const bool inLiteral , const bool inMarkup) { bool gotSpace = false; // // See if we have any spaces up front. If so, then skip them and set // the gotSpaces flag. // if (fReaderMgr->skippedSpace()) { fReaderMgr->skipPastSpaces(); gotSpace = true; } // If the next char is a percent, then expand the PERef if (!fReaderMgr->skippedChar(chPercent)) return gotSpace; while (true) { if (!expandPERef(false, inLiteral, inMarkup, false)) fScanner->emitError(XMLErrs::ExpectedEntityRefName); // And skip any more spaces in the expanded value if (fReaderMgr->skippedSpace()) { fReaderMgr->skipPastSpaces(); gotSpace = true; } if (!fReaderMgr->skippedChar(chPercent)) break; } return gotSpace; } bool DTDScanner::expandPERef( const bool scanExternal , const bool inLiteral , const bool inMarkup , const bool throwEndOfExt) { fScanner->setHasNoDTD(false); XMLBufBid bbName(fBufMgr); // // If we are in the internal subset and in markup, then this is // an error but we go ahead and do it anyway. // if (fInternalSubset && inMarkup) fScanner->emitError(XMLErrs::PERefInMarkupInIntSubset); if (!fReaderMgr->getName(bbName.getBuffer())) { fScanner->emitError(XMLErrs::ExpectedPEName); // Skip the semicolon if that's what we ended up on fReaderMgr->skippedChar(chSemiColon); return false; } // If no terminating semicolon, emit an error but try to keep going if (!fReaderMgr->skippedChar(chSemiColon)) fScanner->emitError(XMLErrs::UnterminatedEntityRef, bbName.getRawBuffer()); // // Look it up in the PE decl pool and see if it exists. If not, just // emit an error and continue. // XMLEntityDecl* decl = fPEntityDeclPool->getByKey(bbName.getRawBuffer()); if (!decl) { // XML 1.0 Section 4.1 if (fScanner->getStandalone()) { // no need to check fScanner->fHasNoDTD which is for sure false // since we are in expandPERef already fScanner->emitError(XMLErrs::EntityNotFound, bbName.getRawBuffer()); } else { if (fScanner->getValidationScheme() == XMLScanner::Val_Always) fScanner->getValidator()->emitError(XMLValid::VC_EntityNotFound, bbName.getRawBuffer()); } return false; } // // XML 1.0 Section 2.9 // If we are a standalone document, then it has to have been declared // in the internal subset. Keep going though. // if (fScanner->getValidationScheme() == XMLScanner::Val_Always && fScanner->getStandalone() && !decl->getDeclaredInIntSubset()) fScanner->getValidator()->emitError(XMLValid::VC_IllegalRefInStandalone, bbName.getRawBuffer()); // // Okee dokee, we found it. So create either a memory stream with // the entity value contents, or a file stream if its an external // entity. // if (decl->isExternal()) { // And now create a reader to read this entity InputSource* srcUsed; XMLReader* reader = fReaderMgr->createReader ( decl->getBaseURI() , decl->getSystemId() , decl->getPublicId() , false , inLiteral ? XMLReader::RefFrom_Literal : XMLReader::RefFrom_NonLiteral , XMLReader::Type_PE , XMLReader::Source_External , srcUsed , fScanner->getCalculateSrcOfs() , fScanner->getLowWaterMark() , fScanner->getDisableDefaultEntityResolution() ); // Put a janitor on the source so its cleaned up on exit Janitor janSrc(srcUsed); // If the creation failed then throw an exception if (!reader) ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Gen_CouldNotOpenExtEntity, srcUsed ? srcUsed->getSystemId() : decl->getSystemId(), fMemoryManager); // Set the 'throw at end' flag, to the one we were given reader->setThrowAtEnd(throwEndOfExt); // // Push the reader. If its a recursive expansion, then emit an error // and return an failure. // if (!fReaderMgr->pushReader(reader, decl)) { fScanner->emitError(XMLErrs::RecursiveEntity, decl->getName()); return false; } // // If the caller wants us to scan the external entity, then lets // do that now. // if (scanExternal) { XMLEntityHandler* entHandler = fScanner->getEntityHandler(); // If we have an entity handler, tell it we are starting this entity if (entHandler) entHandler->startInputSource(*srcUsed); // // Scan the external entity now. The parameter tells it that // it is not in an include section. Get the current reader // level so we can catch partial markup errors and be sure // to get back to here if we get an exception out of the // ext subset scan. // const XMLSize_t readerNum = fReaderMgr->getCurrentReaderNum(); try { scanExtSubsetDecl(false, false); } catch(const OutOfMemoryException&) { throw; } catch(...) { // Pop the reader back to the original level fReaderMgr->cleanStackBackTo(readerNum); // End the input source, even though its not happy if (entHandler) entHandler->endInputSource(*srcUsed); throw; } // If we have an entity handler, tell it we are ending this entity if (entHandler) entHandler->endInputSource(*srcUsed); } else { // If it starts with the XML string, then parse a text decl if (fScanner->checkXMLDecl(true)) scanTextDecl(); } } else { // Create a reader over a memory stream over the entity value XMLReader* valueReader = fReaderMgr->createIntEntReader ( decl->getName() , inLiteral ? XMLReader::RefFrom_Literal : XMLReader::RefFrom_NonLiteral , XMLReader::Type_PE , decl->getValue() , decl->getValueLen() , false ); // // Trt to push the entity reader onto the reader manager stack, // where it will become the subsequent input. If it fails, that // means the entity is recursive, so issue an error. The reader // will have just been discarded, but we just keep going. // if (!fReaderMgr->pushReader(valueReader, decl)) fScanner->emitError(XMLErrs::RecursiveEntity, decl->getName()); } return true; } bool DTDScanner::getQuotedString(XMLBuffer& toFill) { // Reset the target buffer toFill.reset(); // Get the next char which must be a single or double quote XMLCh quoteCh; if (!fReaderMgr->skipIfQuote(quoteCh)) return false; XMLCh nextCh; // Get another char and see if it matches the starting quote char while ((nextCh=fReaderMgr->getNextChar())!=quoteCh) { // // We should never get either an end of file null char here. If we // do, just fail. It will be handled more gracefully in the higher // level code that called us. // if (!nextCh) return false; // Else add it to the buffer toFill.append(nextCh); } return true; } XMLAttDef* DTDScanner::scanAttDef(DTDElementDecl& parentElem, XMLBuffer& bufToUse) { // Check for PE ref or optional whitespace checkForPERef(false, true); // Get the name of the attribute if (!fReaderMgr->getName(bufToUse)) { fScanner->emitError(XMLErrs::ExpectedAttrName); return 0; } // // Look up this attribute in the parent element's attribute list. If // it already exists, then use the dummy. // DTDAttDef* decl = parentElem.getAttDef(bufToUse.getRawBuffer()); if (decl) { // It already exists, so put out a warning fScanner->emitError ( XMLErrs::AttListAlreadyExists , bufToUse.getRawBuffer() , parentElem.getFullName() ); // Use the dummy decl to parse into and set its name to the name we got if (!fDumAttDef) { fDumAttDef = new (fMemoryManager) DTDAttDef(fMemoryManager); fDumAttDef->setId(fNextAttrId++); } fDumAttDef->setName(bufToUse.getRawBuffer()); decl = fDumAttDef; } else { // // It does not already exist so create a new one, give it the next // available unique id, and add it // decl = new (fGrammarPoolMemoryManager) DTDAttDef ( bufToUse.getRawBuffer() , XMLAttDef::CData , XMLAttDef::Implied , fGrammarPoolMemoryManager ); decl->setId(fNextAttrId++); decl->setExternalAttDeclaration(isReadingExternalEntity()); parentElem.addAttDef(decl); } // Set a flag to indicate whether we are doing a dummy parse const bool isIgnored = (decl == fDumAttDef); // Space is required here, so check for PE ref, and require space if (!checkForPERef(false, true)) fScanner->emitError(XMLErrs::ExpectedWhitespace); // // Next has to be one of the attribute type strings. This tells us what // is to follow. // if (fReaderMgr->skippedString(XMLUni::fgCDATAString)) { decl->setType(XMLAttDef::CData); } else if (fReaderMgr->skippedString(XMLUni::fgIDString)) { if (!fReaderMgr->skippedString(XMLUni::fgRefString)) decl->setType(XMLAttDef::ID); else if (!fReaderMgr->skippedChar(chLatin_S)) decl->setType(XMLAttDef::IDRef); else decl->setType(XMLAttDef::IDRefs); } else if (fReaderMgr->skippedString(XMLUni::fgEntitString)) { if (fReaderMgr->skippedChar(chLatin_Y)) { decl->setType(XMLAttDef::Entity); } else if (fReaderMgr->skippedString(XMLUni::fgIESString)) { decl->setType(XMLAttDef::Entities); } else { fScanner->emitError ( XMLErrs::ExpectedAttributeType , decl->getFullName() , parentElem.getFullName() ); return 0; } } else if (fReaderMgr->skippedString(XMLUni::fgNmTokenString)) { if (fReaderMgr->skippedChar(chLatin_S)) decl->setType(XMLAttDef::NmTokens); else decl->setType(XMLAttDef::NmToken); } else if (fReaderMgr->skippedString(XMLUni::fgNotationString)) { // Check for PE ref and require space if (!checkForPERef(false, true)) fScanner->emitError(XMLErrs::ExpectedWhitespace); decl->setType(XMLAttDef::Notation); if (!scanEnumeration(*decl, bufToUse, true)) return 0; // Set the value as the enumeration for this decl decl->setEnumeration(bufToUse.getRawBuffer()); } else if (fReaderMgr->skippedChar(chOpenParen)) { decl->setType(XMLAttDef::Enumeration); if (!scanEnumeration(*decl, bufToUse, false)) return 0; // Set the value as the enumeration for this decl decl->setEnumeration(bufToUse.getRawBuffer()); } else { fScanner->emitError ( XMLErrs::ExpectedAttributeType , decl->getFullName() , parentElem.getFullName() ); return 0; } // Space is required here, so check for PE ref, and require space if (!checkForPERef(false, true)) fScanner->emitError(XMLErrs::ExpectedWhitespace); // And then scan for the optional default value declaration scanDefaultDecl(*decl); // If validating, then do a couple of validation constraints if (fScanner->getValidationScheme() == XMLScanner::Val_Always) { if (decl->getType() == XMLAttDef::ID) { if ((decl->getDefaultType() != XMLAttDef::Implied) && (decl->getDefaultType() != XMLAttDef::Required)) { fScanner->getValidator()->emitError(XMLValid::BadIDAttrDefType, decl->getFullName()); } } // if attdef is xml:space, check correct enumeration (default|preserve) const XMLCh fgXMLSpace[] = { chLatin_x, chLatin_m, chLatin_l, chColon, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chNull }; if (XMLString::equals(decl->getFullName(),fgXMLSpace)) { const XMLCh fgPreserve[] = { chLatin_p, chLatin_r, chLatin_e, chLatin_s, chLatin_e, chLatin_r, chLatin_v, chLatin_e, chNull }; const XMLCh fgDefault[] = { chLatin_d, chLatin_e, chLatin_f, chLatin_a, chLatin_u, chLatin_l, chLatin_t, chNull }; bool ok = false; if (decl->getType() == XMLAttDef::Enumeration) { BaseRefVectorOf* enumVector = XMLString::tokenizeString(decl->getEnumeration(), fMemoryManager); XMLSize_t size = enumVector->size(); ok = (size == 1 && (XMLString::equals(enumVector->elementAt(0), fgDefault) || XMLString::equals(enumVector->elementAt(0), fgPreserve))) || (size == 2 && (XMLString::equals(enumVector->elementAt(0), fgDefault) && XMLString::equals(enumVector->elementAt(1), fgPreserve))) || (size == 2 && (XMLString::equals(enumVector->elementAt(1), fgDefault) && XMLString::equals(enumVector->elementAt(0), fgPreserve))); delete enumVector; } if (!ok) fScanner->getValidator()->emitError(XMLValid::IllegalXMLSpace); } } // If we have a doc type handler, tell it about this attdef. if (fDocTypeHandler) fDocTypeHandler->attDef(parentElem, *decl, isIgnored); return decl; } void DTDScanner::scanAttListDecl() { // Space is required here, so check for a PE ref if (!checkForPERef(false, true)) { fScanner->emitError(XMLErrs::ExpectedWhitespace); fReaderMgr->skipPastChar(chCloseAngle); return; } // // Next should be the name of the element it belongs to, so get a buffer // and get the name into it. // XMLBufBid bbName(fBufMgr); if (!fReaderMgr->getName(bbName.getBuffer())) { fScanner->emitError(XMLErrs::ExpectedElementName); fReaderMgr->skipPastChar(chCloseAngle); return; } // // Find this element's declaration. If it has not been declared yet, // we will force one into the list, but not mark it as declared. // DTDElementDecl* elemDecl = (DTDElementDecl*) fDTDGrammar->getElemDecl(fEmptyNamespaceId, 0, bbName.getRawBuffer(), Grammar::TOP_LEVEL_SCOPE); if (!elemDecl) { // // Lets fault in a declaration and add it to the pool. We mark // it having been created because of an attlist. Later, if its // declared, this will be updated. // elemDecl = new (fGrammarPoolMemoryManager) DTDElementDecl ( bbName.getRawBuffer() , fEmptyNamespaceId , DTDElementDecl::Any , fGrammarPoolMemoryManager ); elemDecl->setCreateReason(XMLElementDecl::AttList); elemDecl->setExternalElemDeclaration(isReadingExternalEntity()); fDTDGrammar->putElemDecl((XMLElementDecl*) elemDecl); } // If we have a doc type handler, tell it the att list is starting if (fDocTypeHandler) fDocTypeHandler->startAttList(*elemDecl); // // Now we loop until we are done with all of the attributes in this // list. We need a buffer to use for local processing. // XMLBufBid bbTmp(fBufMgr); XMLBuffer& tmpBuf = bbTmp.getBuffer(); bool seenAnId = false; while (true) { // Get the next char out and see what it tells us to do const XMLCh nextCh = fReaderMgr->peekNextChar(); // Watch for EOF if (!nextCh) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); if (nextCh == chCloseAngle) { // We are done with this attribute list fReaderMgr->getNextChar(); break; } else if (fReaderMgr->getCurrentReader()->isWhitespace(nextCh)) { // // If advanced callbacks are enabled and we have a doc // type handler, then gather up the white space and call // back on the doctype handler. Otherwise, just skip // whitespace. // if (fDocTypeHandler) { fReaderMgr->getSpaces(tmpBuf); fDocTypeHandler->doctypeWhitespace ( tmpBuf.getRawBuffer() , tmpBuf.getLen() ); } else { fReaderMgr->skipPastSpaces(); } } else if (nextCh == chPercent) { // Eat the percent and expand the ref fReaderMgr->getNextChar(); expandPERef(false, false, true); } else { // // It must be an attribute name, so scan it. We let // it use our local buffer for its name scanning. // XMLAttDef* attDef = scanAttDef(*elemDecl, tmpBuf); if (!attDef) { fReaderMgr->skipPastChar(chCloseAngle); break; } // // If we are validating and its an ID type, then we have to // make sure that we have not seen an id attribute yet. Set // the flag to say that we've seen one now also. // if (fScanner->getValidationScheme() == XMLScanner::Val_Always) { if (attDef->getType() == XMLAttDef::ID) { if (seenAnId) fScanner->getValidator()->emitError(XMLValid::MultipleIdAttrs, elemDecl->getFullName()); seenAnId = true; } } } } // If we have a doc type handler, tell it the att list is ending if (fDocTypeHandler) fDocTypeHandler->endAttList(*elemDecl); } // // This method is called to scan the value of an attribute in content. This // involves some normalization and replacement of general entity and // character references. // // End of entity's must be dealt with here. During DTD scan, they can come // from external entities. During content, they can come from any entity. // We just eat the end of entity and continue with our scan until we come // to the closing quote. If an unterminated value causes us to go through // subsequent entities, that will cause errors back in the calling code, // but there's little we can do about it here. // bool DTDScanner::scanAttValue(const XMLCh* const attrName , XMLBuffer& toFill , const XMLAttDef::AttTypes type) { enum States { InWhitespace , InContent }; // Reset the target buffer toFill.reset(); // Get the next char which must be a single or double quote XMLCh quoteCh; if (!fReaderMgr->skipIfQuote(quoteCh)) return false; // // We have to get the current reader because we have to ignore closing // quotes until we hit the same reader again. // const XMLSize_t curReader = fReaderMgr->getCurrentReaderNum(); // // Loop until we get the attribute value. Note that we use a double // loop here to avoid the setup/teardown overhead of the exception // handler on every round. // XMLCh nextCh; XMLCh secondCh = 0; States curState = InContent; bool firstNonWS = false; bool gotLeadingSurrogate = false; bool escaped; while (true) { try { while(true) { nextCh = fReaderMgr->getNextChar(); if (!nextCh) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); // Check for our ending quote in the same entity if (nextCh == quoteCh) { if (curReader == fReaderMgr->getCurrentReaderNum()) return true; // Watch for spillover into a previous entity if (curReader > fReaderMgr->getCurrentReaderNum()) { fScanner->emitError(XMLErrs::PartialMarkupInEntity); return false; } } // // Check for an entity ref now, before we let it affect our // whitespace normalization logic below. We ignore the empty flag // in this one. // escaped = false; if (nextCh == chAmpersand) { if (scanEntityRef(nextCh, secondCh, escaped) != EntityExp_Returned) { gotLeadingSurrogate = false; continue; } } else if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { // Check for correct surrogate pairs if (gotLeadingSurrogate) fScanner->emitError(XMLErrs::Expected2ndSurrogateChar); else gotLeadingSurrogate = true; } else { if (gotLeadingSurrogate) { if ((nextCh < 0xDC00) || (nextCh > 0xDFFF)) fScanner->emitError(XMLErrs::Expected2ndSurrogateChar); } // Its got to at least be a valid XML character else if (!fReaderMgr->getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); fScanner->emitError ( XMLErrs::InvalidCharacterInAttrValue , attrName , tmpBuf ); } gotLeadingSurrogate = false; } // // If its not escaped, then make sure its not a < character, which // is not allowed in attribute values. // if (!escaped && (nextCh == chOpenAngle)) fScanner->emitError(XMLErrs::BracketInAttrValue, attrName); // // If the attribute is a CDATA type we do simple replacement of // tabs and new lines with spaces, if the character is not escaped // by way of a char ref. // // Otherwise, we do the standard non-CDATA normalization of // compressing whitespace to single spaces and getting rid of // leading and trailing whitespace. // if (type == XMLAttDef::CData) { if (!escaped) { if ((nextCh == 0x09) || (nextCh == 0x0A) || (nextCh == 0x0D)) nextCh = chSpace; } } else { if (curState == InWhitespace) { if (!fReaderMgr->getCurrentReader()->isWhitespace(nextCh)) { if (firstNonWS) toFill.append(chSpace); curState = InContent; firstNonWS = true; } else { continue; } } else if (curState == InContent) { if (fReaderMgr->getCurrentReader()->isWhitespace(nextCh)) { curState = InWhitespace; continue; } firstNonWS = true; } } // Else add it to the buffer toFill.append(nextCh); if (secondCh) { toFill.append(secondCh); secondCh=0; } } } catch(const EndOfEntityException&) { // Just eat it and continue. gotLeadingSurrogate = false; escaped = false; } } return true; } bool DTDScanner::scanCharRef(XMLCh& first, XMLCh& second) { bool gotOne = false; unsigned int value = 0; // // Set the radix. Its supposed to be a lower case x if hex. But, in // order to recover well, we check for an upper and put out an error // for that. // unsigned int radix = 10; if (fReaderMgr->skippedChar(chLatin_x)) { radix = 16; } else if (fReaderMgr->skippedChar(chLatin_X)) { fScanner->emitError(XMLErrs::HexRadixMustBeLowerCase); radix = 16; } while (true) { const XMLCh nextCh = fReaderMgr->peekNextChar(); // Watch for EOF if (!nextCh) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); // Break out on the terminating semicolon if (nextCh == chSemiColon) { fReaderMgr->getNextChar(); break; } // // Convert this char to a binary value, or bail out if its not // one. // unsigned int nextVal; if ((nextCh >= chDigit_0) && (nextCh <= chDigit_9)) nextVal = (unsigned int)(nextCh - chDigit_0); else if ((nextCh >= chLatin_A) && (nextCh <= chLatin_F)) nextVal= (unsigned int)(10 + (nextCh - chLatin_A)); else if ((nextCh >= chLatin_a) && (nextCh <= chLatin_f)) nextVal = (unsigned int)(10 + (nextCh - chLatin_a)); else { // // If we got at least a sigit, then do an unterminated ref // error. Else, do an expected a numerical ref thing. // if (gotOne) fScanner->emitError(XMLErrs::UnterminatedCharRef); else fScanner->emitError(XMLErrs::ExpectedNumericalCharRef); return false; } // // Make sure its valid for the radix. If not, then just eat the // digit and go on after issueing an error. Else, update the // running value with this new digit. // if (nextVal >= radix) { XMLCh tmpStr[2]; tmpStr[0] = nextCh; tmpStr[1] = chNull; fScanner->emitError(XMLErrs::BadDigitForRadix, tmpStr); } else { value = (value * radix) + nextVal; } // Indicate that we got at least one good digit gotOne = true; // Eat the char we just processed fReaderMgr->getNextChar(); } // Return the char (or chars) // And check if the character expanded is valid or not if (value >= 0x10000 && value <= 0x10FFFF) { value -= 0x10000; first = XMLCh((value >> 10) + 0xD800); second = XMLCh((value & 0x3FF) + 0xDC00); } else if (value <= 0xFFFD) { first = XMLCh(value); second = 0; if (!fReaderMgr->getCurrentReader()->isXMLChar(first) && !fReaderMgr->getCurrentReader()->isControlChar(first)) { // Character reference was not in the valid range fScanner->emitError(XMLErrs::InvalidCharacterRef); return false; } } else { // Character reference was not in the valid range fScanner->emitError(XMLErrs::InvalidCharacterRef); return false; } return true; } ContentSpecNode* DTDScanner::scanChildren(const DTDElementDecl& elemDecl, XMLBuffer& bufToUse, unsigned int& depth) { if (depth++ > CONTENTSPEC_DEPTH_LIMIT) { fScanner->emitError(XMLErrs::UnterminatedDOCTYPE); return 0; } // Check for a PE ref here, but don't require spaces checkForPERef(false, true); ValueStackOf* arrNestedDecl=NULL; // // We know that the caller just saw an opening parenthesis, so we need // to parse until we hit the end of it; if we find several parenthesis, // store them in an array to be processed later. // // We have to check for one up front, since it could be something like // (((a)*)) etc... // ContentSpecNode* curNode = 0; while(fReaderMgr->skippedChar(chOpenParen)) { // to check entity nesting const XMLSize_t curReader = fReaderMgr->getCurrentReaderNum(); if(arrNestedDecl==NULL) arrNestedDecl=new (fMemoryManager) ValueStackOf(5, fMemoryManager); arrNestedDecl->push(curReader); // Check for a PE ref here, but don't require spaces checkForPERef(false, true); } // We must find a leaf node here, either standalone or nested in the parenthesis if (!fReaderMgr->getName(bufToUse)) { fScanner->emitError(XMLErrs::ExpectedElementName); return 0; } // // Create a leaf node for it. If we can find the element id for // this element, then use it. Else, we have to fault in an element // decl, marked as created because of being in a content model. // XMLElementDecl* decl = fDTDGrammar->getElemDecl(fEmptyNamespaceId, 0, bufToUse.getRawBuffer(), Grammar::TOP_LEVEL_SCOPE); if (!decl) { decl = new (fGrammarPoolMemoryManager) DTDElementDecl ( bufToUse.getRawBuffer() , fEmptyNamespaceId , DTDElementDecl::Any , fGrammarPoolMemoryManager ); decl->setCreateReason(XMLElementDecl::InContentModel); decl->setExternalElemDeclaration(isReadingExternalEntity()); fDTDGrammar->putElemDecl(decl); } curNode = new (fGrammarPoolMemoryManager) ContentSpecNode ( decl->getElementName() , fGrammarPoolMemoryManager ); // Check for a PE ref here, but don't require spaces const bool gotSpaces = checkForPERef(false, true); // Check for a repetition character after the leaf XMLCh repCh = fReaderMgr->peekNextChar(); ContentSpecNode* tmpNode = makeRepNode(repCh, curNode, fGrammarPoolMemoryManager); if (tmpNode != curNode) { if (gotSpaces) { if (fScanner->emitErrorWillThrowException(XMLErrs::UnexpectedWhitespace)) { delete tmpNode; } fScanner->emitError(XMLErrs::UnexpectedWhitespace); } fReaderMgr->getNextChar(); curNode = tmpNode; } while(arrNestedDecl==NULL || !arrNestedDecl->empty()) { // Check for a PE ref here, but don't require spaces checkForPERef(false, true); // // Ok, the next character tells us what kind of content this particular // model this particular parentesized section is. Its either a choice if // we see ',', a sequence if we see '|', or a single leaf node if we see // a closing paren. // const XMLCh opCh = fReaderMgr->peekNextChar(); if ((opCh != chComma) && (opCh != chPipe) && (opCh != chCloseParen)) { // Not a legal char, so delete our node and return failure delete curNode; fScanner->emitError(XMLErrs::ExpectedSeqChoiceLeaf); return 0; } // // Create the head node of the correct type. We need this to remember // the top of the local tree. If it was a single subexpr, then just // set the head node to the current node. For the others, we'll build // the tree off the second child as we move across. // ContentSpecNode* headNode = 0; ContentSpecNode::NodeTypes curType = ContentSpecNode::UnknownType; if (opCh == chComma) { curType = ContentSpecNode::Sequence; headNode = new (fGrammarPoolMemoryManager) ContentSpecNode ( curType , curNode , 0 , true , true , fGrammarPoolMemoryManager ); curNode = headNode; } else if (opCh == chPipe) { curType = ContentSpecNode::Choice; headNode = new (fGrammarPoolMemoryManager) ContentSpecNode ( curType , curNode , 0 , true , true , fGrammarPoolMemoryManager ); curNode = headNode; } else { headNode = curNode; fReaderMgr->getNextChar(); } // // If it was a sequence or choice, we just loop until we get to the // end of our section, adding each new leaf or sub expression to the // right child of the current node, and making that new node the current // node. // if ((opCh == chComma) || (opCh == chPipe)) { ContentSpecNode* lastNode = 0; while (true) { // // The next thing must either be another | or , character followed // by another leaf or subexpression, or a closing parenthesis, or a // PE ref. // if (fReaderMgr->lookingAtChar(chPercent)) { checkForPERef(false, true); } else if (fReaderMgr->skippedSpace()) { // Just skip whitespace fReaderMgr->skipPastSpaces(); } else if (fReaderMgr->skippedChar(chCloseParen)) { // // We've hit the end of this section, so break out. But, we // need to see if we left a partial sequence of choice node // without a second node. If so, we have to undo that and // put its left child into the right node of the previous // node. // if ((curNode->getType() == ContentSpecNode::Choice) || (curNode->getType() == ContentSpecNode::Sequence)) { if (!curNode->getSecond() && lastNode) { ContentSpecNode* saveFirst = curNode->orphanFirst(); lastNode->setSecond(saveFirst); curNode = lastNode; } } break; } else if (fReaderMgr->skippedChar(opCh)) { // Check for a PE ref here, but don't require spaces checkForPERef(false, true); if (fReaderMgr->skippedChar(chOpenParen)) { const XMLSize_t curReader = fReaderMgr->getCurrentReaderNum(); // Recurse to handle this new guy ContentSpecNode* subNode; try { subNode = scanChildren(elemDecl, bufToUse, depth); } catch (const XMLErrs::Codes) { delete headNode; throw; } // If it failed, we are done, clean up here and return failure if (!subNode) { delete headNode; return 0; } if (curReader != fReaderMgr->getCurrentReaderNum() && fScanner->getValidationScheme() == XMLScanner::Val_Always) fScanner->getValidator()->emitError(XMLValid::PartialMarkupInPE); // Else patch it in and make it the new current ContentSpecNode* newCur = new (fGrammarPoolMemoryManager) ContentSpecNode ( curType , subNode , 0 , true , true , fGrammarPoolMemoryManager ); curNode->setSecond(newCur); lastNode = curNode; curNode = newCur; } else { // // Got to be a leaf node, so get a name. If we cannot get // one, then clean up and get outa here. // if (!fReaderMgr->getName(bufToUse)) { delete headNode; fScanner->emitError(XMLErrs::ExpectedElementName); return 0; } // // Create a leaf node for it. If we can find the element // id for this element, then use it. Else, we have to // fault in an element decl, marked as created because // of being in a content model. // XMLElementDecl* decl = fDTDGrammar->getElemDecl(fEmptyNamespaceId, 0, bufToUse.getRawBuffer(), Grammar::TOP_LEVEL_SCOPE); if (!decl) { decl = new (fGrammarPoolMemoryManager) DTDElementDecl ( bufToUse.getRawBuffer() , fEmptyNamespaceId , DTDElementDecl::Any , fGrammarPoolMemoryManager ); decl->setCreateReason(XMLElementDecl::InContentModel); decl->setExternalElemDeclaration(isReadingExternalEntity()); fDTDGrammar->putElemDecl(decl); } ContentSpecNode* tmpLeaf = new (fGrammarPoolMemoryManager) ContentSpecNode ( decl->getElementName() , fGrammarPoolMemoryManager ); // Check for a repetition character after the leaf const XMLCh repCh = fReaderMgr->peekNextChar(); ContentSpecNode* tmpLeaf2 = makeRepNode(repCh, tmpLeaf, fGrammarPoolMemoryManager); if (tmpLeaf != tmpLeaf2) fReaderMgr->getNextChar(); // // Create a new sequence or choice node, with the leaf // (or rep surrounding it) we just got as its first node. // Make the new node the second node of the current node, // and then make it the current node. // ContentSpecNode* newCur = new (fGrammarPoolMemoryManager) ContentSpecNode ( curType , tmpLeaf2 , 0 , true , true , fGrammarPoolMemoryManager ); curNode->setSecond(newCur); lastNode = curNode; curNode = newCur; } } else { // Cannot be valid delete headNode; // emitError may do a throw so need to clean-up first if (opCh == chComma) { fScanner->emitError(XMLErrs::ExpectedChoiceOrCloseParen); } else { fScanner->emitError ( XMLErrs::ExpectedSeqOrCloseParen , elemDecl.getFullName() ); } return 0; } } } // // We saw the terminating parenthesis so lets check for any repetition // character, and create a node for that, making the head node the child // of it. // const XMLCh repCh = fReaderMgr->peekNextChar(); curNode = makeRepNode(repCh, headNode, fGrammarPoolMemoryManager); if (curNode != headNode) fReaderMgr->getNextChar(); // prepare for recursion if(arrNestedDecl==NULL) break; else { // If that failed, no need to go further, return failure if (!curNode) return 0; const XMLSize_t curReader = arrNestedDecl->pop(); if (curReader != fReaderMgr->getCurrentReaderNum() && fScanner->getValidationScheme() == XMLScanner::Val_Always) fScanner->getValidator()->emitError(XMLValid::PartialMarkupInPE); if(arrNestedDecl->empty()) { delete arrNestedDecl; arrNestedDecl=NULL; } } } return curNode; } // // We get here after the '' It will calls the appropriate handler with the comment // text, if one is provided. A comment can be in either the document or // the DTD, so the fInDocument flag is used to know which handler to send // it to. // void DTDScanner::scanComment() { enum States { InText , OneDash , TwoDashes }; // Get a buffer for this XMLBufBid bbComment(fBufMgr); // // Get the comment text into a temp buffer. Be sure to use temp buffer // two here, since its to be used for stuff that is potentially longer // than just a name. // bool gotLeadingSurrogate = false; States curState = InText; while (true) { // Get the next character const XMLCh nextCh = fReaderMgr->getNextChar(); // Watch for an end of file if (!nextCh) { fScanner->emitError(XMLErrs::UnterminatedComment); ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); } // Check for correct surrogate pairs if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { if (gotLeadingSurrogate) fScanner->emitError(XMLErrs::Expected2ndSurrogateChar); else gotLeadingSurrogate = true; } else { if (gotLeadingSurrogate) { if ((nextCh < 0xDC00) || (nextCh > 0xDFFF)) fScanner->emitError(XMLErrs::Expected2ndSurrogateChar); } // Its got to at least be a valid XML character else if (!fReaderMgr->getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); fScanner->emitError(XMLErrs::InvalidCharacter, tmpBuf); } gotLeadingSurrogate = false; } if (curState == InText) { // If its a dash, go to OneDash state. Otherwise take as text if (nextCh == chDash) curState = OneDash; else bbComment.append(nextCh); } else if (curState == OneDash) { // // If its another dash, then we change to the two dashes states. // Otherwise, we have to put in the deficit dash and the new // character and go back to InText. // if (nextCh == chDash) { curState = TwoDashes; } else { bbComment.append(chDash); bbComment.append(nextCh); curState = InText; } } else if (curState == TwoDashes) { // The next character must be the closing bracket if (nextCh != chCloseAngle) { fScanner->emitError(XMLErrs::IllegalSequenceInComment); fReaderMgr->skipPastChar(chCloseAngle); return; } break; } } // If there is a doc type handler, then pass on the comment stuff if (fDocTypeHandler) fDocTypeHandler->doctypeComment(bbComment.getRawBuffer()); } bool DTDScanner::scanContentSpec(DTDElementDecl& toFill) { // // Check for for a couple of the predefined content type strings. If // its not one of these, its got to be a parenthesized reg ex type // expression. // if (fReaderMgr->skippedString(XMLUni::fgEmptyString)) { toFill.setModelType(DTDElementDecl::Empty); return true; } if (fReaderMgr->skippedString(XMLUni::fgAnyString)) { toFill.setModelType(DTDElementDecl::Any); return true; } // Its got to be a parenthesized regular expression if (!fReaderMgr->skippedChar(chOpenParen)) { fScanner->emitError ( XMLErrs::ExpectedContentSpecExpr , toFill.getFullName() ); return false; } // Get the current reader id, so we can test for partial markup const XMLSize_t curReader = fReaderMgr->getCurrentReaderNum(); // We could have a PE ref here, but don't require space checkForPERef(false, true); // // Now we look for a PCDATA string. If its PCDATA, then it must be a // MIXED model. Otherwise, it must be a regular list of children in // a regular expression perhaps. // bool status; if (fReaderMgr->skippedString(XMLUni::fgPCDATAString)) { // Set the model to mixed toFill.setModelType(DTDElementDecl::Mixed_Simple); status = scanMixed(toFill); // // If we are validating we have to check that there are no multiple // uses of any child elements. // if (fScanner->getValidationScheme() == XMLScanner::Val_Always) { if (((const MixedContentModel*)toFill.getContentModel())->hasDups()) fScanner->getValidator()->emitError(XMLValid::RepElemInMixed); } } else { // // We have to do a recursive scan of the content model. Create a // buffer for it to use, for efficiency. It returns the top ofthe // content spec node tree, which we set if successful. // toFill.setModelType(DTDElementDecl::Children); XMLBufBid bbTmp(fBufMgr); unsigned int depth = 0; ContentSpecNode* resNode = scanChildren(toFill, bbTmp.getBuffer(), depth); status = (resNode != 0); if (status) toFill.setContentSpec(resNode); } // Make sure we are on the same reader as where we started if (curReader != fReaderMgr->getCurrentReaderNum() && fScanner->getValidationScheme() == XMLScanner::Val_Always) fScanner->getValidator()->emitError(XMLValid::PartialMarkupInPE); return status; } void DTDScanner::scanDefaultDecl(DTDAttDef& toFill) { if (fReaderMgr->skippedString(XMLUni::fgRequiredString)) { toFill.setDefaultType(XMLAttDef::Required); return; } if (fReaderMgr->skippedString(XMLUni::fgImpliedString)) { toFill.setDefaultType(XMLAttDef::Implied); return; } if (fReaderMgr->skippedString(XMLUni::fgFixedString)) { // // There must be space before the fixed value. If there is not, then // emit an error but keep going. // if (!fReaderMgr->skippedSpace()) fScanner->emitError(XMLErrs::ExpectedWhitespace); else fReaderMgr->skipPastSpaces(); toFill.setDefaultType(XMLAttDef::Fixed); } else { toFill.setDefaultType(XMLAttDef::Default); } // // If we got here, its fixed or default, so we need to get a value. // If we don't, then emit an error but just set the default value to // an empty string and try to keep going. // // Check for PE ref or optional whitespace checkForPERef(false, true); XMLBufBid bbValue(fBufMgr); if (!scanAttValue(toFill.getFullName(), bbValue.getBuffer(), toFill.getType())) fScanner->emitError(XMLErrs::ExpectedDefAttrDecl); toFill.setValue(bbValue.getRawBuffer()); } // // This is called after seeing 'emitError(XMLErrs::ExpectedWhitespace); // Get a buffer for the element name and scan in the name XMLBufBid bbName(fBufMgr); if (!fReaderMgr->getName(bbName.getBuffer())) { fScanner->emitError(XMLErrs::ExpectedElementName); fReaderMgr->skipPastChar(chCloseAngle); return; } // Look this guy up in the element decl pool DTDElementDecl* decl = (DTDElementDecl*) fDTDGrammar->getElemDecl(fEmptyNamespaceId, 0, bbName.getRawBuffer(), Grammar::TOP_LEVEL_SCOPE); // // If it does not exist, then we need to create it. If it does and // its marked as declared, then that's an error, but we still need to // scan over the content model so use the dummy declaration that the // parsing code can fill in. // if (decl) { if (decl->isDeclared()) { if (fScanner->getValidationScheme() == XMLScanner::Val_Always) fScanner->getValidator()->emitError(XMLValid::ElementAlreadyExists, bbName.getRawBuffer()); if (!fDumElemDecl) fDumElemDecl = new (fMemoryManager) DTDElementDecl ( bbName.getRawBuffer() , fEmptyNamespaceId , DTDElementDecl::Any , fMemoryManager ); else fDumElemDecl->setElementName(bbName.getRawBuffer(),fEmptyNamespaceId); } } else { // // Create the new empty declaration to fill in and put it into // the decl pool. // decl = new (fGrammarPoolMemoryManager) DTDElementDecl ( bbName.getRawBuffer() , fEmptyNamespaceId , DTDElementDecl::Any , fGrammarPoolMemoryManager ); fDTDGrammar->putElemDecl(decl); } // Set a flag for whether we will ignore this one const bool isIgnored = (decl == fDumElemDecl); // Mark this one if being externally declared decl->setExternalElemDeclaration(isReadingExternalEntity()); // Mark this one as being declared decl->setCreateReason(XMLElementDecl::Declared); // Another check for a PE ref, with at least required whitespace if (!checkForPERef(false, true)) fScanner->emitError(XMLErrs::ExpectedWhitespace); // And now scan the content model for this guy. if (!scanContentSpec(*decl)) { fReaderMgr->skipPastChar(chCloseAngle); return; } // Another check for a PE ref, but we don't require whitespace here checkForPERef(false, true); // And we should have the ending angle bracket if (!fReaderMgr->skippedChar(chCloseAngle)) { fScanner->emitError(XMLErrs::UnterminatedElementDecl, bbName.getRawBuffer()); fReaderMgr->skipPastChar(chCloseAngle); } // // If we have a DTD handler tell it about the new element decl. We // tell it if its one that can be ignored, cause its an override of a // previously existing decl. If it is being ignored, only call back // if advanced callbacks are enabled. // if (fDocTypeHandler) fDocTypeHandler->elementDecl(*decl, isIgnored); } // // This method will process a general or parameter entity reference. The // entity name and entity text will be stored in the entity pool. The value // of the entity will be scanned for any other parameter entity or char // references which will be expanded. So the stored value can only have // general entity references when done. // void DTDScanner::scanEntityDecl() { // // Space is required here, but we cannot check for a PE Ref since // there could be a legal (no-ref) percent sign here. Since any // entity that ended here would be illegal, we just skip spaces // and then check for a percent. // if (!fReaderMgr->lookingAtSpace()) fScanner->emitError(XMLErrs::ExpectedWhitespace); else fReaderMgr->skipPastSpaces(); bool isPEDecl = fReaderMgr->skippedChar(chPercent); // // If a PE decl, then check if it is followed by a space; if it is so, // eat the percent and check for spaces or a PE ref on the other side of it. // Otherwise, it has to be an entity reference for a general entity. // if (isPEDecl) { if(!fReaderMgr->getCurrentReader()->isWhitespace(fReaderMgr->peekNextChar())) { isPEDecl=false; while (true) { if (!expandPERef(false, false, true, false)) fScanner->emitError(XMLErrs::ExpectedEntityRefName); // And skip any more spaces in the expanded value if (fReaderMgr->skippedSpace()) fReaderMgr->skipPastSpaces(); if (!fReaderMgr->skippedChar(chPercent)) break; } } else if (!checkForPERef(false, true)) fScanner->emitError(XMLErrs::ExpectedWhitespace); } // // Now lets get a name, which should be the name of the entity. We // have to get a buffer for this. // XMLBufBid bbName(fBufMgr); if (!fReaderMgr->getName(bbName.getBuffer())) { fScanner->emitError(XMLErrs::ExpectedPEName); fReaderMgr->skipPastChar(chCloseAngle); return; } // If namespaces are enabled, then no colons allowed if (fScanner->getDoNamespaces()) { if (XMLString::indexOf(bbName.getRawBuffer(), chColon) != -1) fScanner->emitError(XMLErrs::ColonNotLegalWithNS); } // // See if this entity already exists. If so, then the existing one // takes precendence. So we use the local dummy decl to parse into // and just ignore the results. // DTDEntityDecl* entityDecl; if (isPEDecl) entityDecl = fPEntityDeclPool->getByKey(bbName.getRawBuffer()); else entityDecl = fDTDGrammar->getEntityDecl(bbName.getRawBuffer()); if (entityDecl) { if (!fDumEntityDecl) fDumEntityDecl = new (fMemoryManager) DTDEntityDecl(fMemoryManager); fDumEntityDecl->setName(bbName.getRawBuffer()); entityDecl = fDumEntityDecl; } else { // Its not in existence already, then create an entity decl for it entityDecl = new (fGrammarPoolMemoryManager) DTDEntityDecl(bbName.getRawBuffer(), false, fGrammarPoolMemoryManager); // // Set the declaration location. The parameter indicates whether its // declared in the content/internal subset, so we know whether or not // its in the external subset. // entityDecl->setDeclaredInIntSubset(fInternalSubset); // Add it to the appropriate entity decl pool if (isPEDecl) fPEntityDeclPool->put(entityDecl); else fDTDGrammar->putEntityDecl(entityDecl); } // Set a flag that indicates whether we are ignoring this one const bool isIgnored = (entityDecl == fDumEntityDecl); // Set the PE flag on it entityDecl->setIsParameter(isPEDecl); // // Space is legal (required actually) here so check for a PE ref. If // we don't get our whitespace, then issue an error, but try to keep // going. // if (!checkForPERef(false, true)) fScanner->emitError(XMLErrs::ExpectedWhitespace); // save the hasNoDTD status for Entity Constraint Checking bool hasNoDTD = fScanner->getHasNoDTD(); if (hasNoDTD && isPEDecl) fScanner->setHasNoDTD(false); // According to the type call the value scanning method if (!scanEntityDef(*entityDecl, isPEDecl)) { fReaderMgr->skipPastChar(chCloseAngle); fScanner->setHasNoDTD(true); fScanner->emitError(XMLErrs::ExpectedEntityValue); return; } if (hasNoDTD) fScanner->setHasNoDTD(true); // Space is legal (but not required) here so check for a PE ref checkForPERef(false, true); // And then we have to have the closing angle bracket if (!fReaderMgr->skippedChar(chCloseAngle)) { fScanner->emitError(XMLErrs::UnterminatedEntityDecl, entityDecl->getName()); fReaderMgr->skipPastChar(chCloseAngle); } // // If we have a doc type handler, then call it. But only call it for // ignored elements if advanced callbacks are enabled. // if (fDocTypeHandler) fDocTypeHandler->entityDecl(*entityDecl, isPEDecl, isIgnored); } // // This method will scan a general/character entity ref. It will either // expand a char ref and return the value directly, or it will expand // a general entity and a reader for it onto the reader stack. // // The return value indicates whether the value was returned directly or // pushed as a reader or it failed. // // The escaped flag tells the caller whether the returnd parameter resulted // from a character reference, which escapes the character in some cases. It // only makes any difference if the return indicates the value was returned // directly. // // NOTE: This is only called when scanning attribute values, so we always // expand general entities. // DTDScanner::EntityExpRes DTDScanner::scanEntityRef(XMLCh& firstCh, XMLCh& secondCh, bool& escaped) { // Assume no escape and no second char escaped = false; secondCh = 0; // We have to insure its all done in a single entity const XMLSize_t curReader = fReaderMgr->getCurrentReaderNum(); // // If the next char is a pound, then its a character reference and we // need to expand it always. // if (fReaderMgr->skippedChar(chPound)) { // // Its a character reference, so scan it and get back the numeric // value it represents. If it fails, just return immediately. // if (!scanCharRef(firstCh, secondCh)) return EntityExp_Failed; if (curReader != fReaderMgr->getCurrentReaderNum()) fScanner->emitError(XMLErrs::PartialMarkupInEntity); // Its now escaped since it was a char ref escaped = true; return EntityExp_Returned; } // Get the name of the general entity XMLBufBid bbName(fBufMgr); if (!fReaderMgr->getName(bbName.getBuffer())) { fScanner->emitError(XMLErrs::ExpectedEntityRefName); return EntityExp_Failed; } // // Next char must be a semi-colon. But if its not, just emit // an error and try to continue. // if (!fReaderMgr->skippedChar(chSemiColon)) fScanner->emitError(XMLErrs::UnterminatedEntityRef, bbName.getRawBuffer()); // Make sure it was all in one entity reader if (curReader != fReaderMgr->getCurrentReaderNum()) fScanner->emitError(XMLErrs::PartialMarkupInEntity); // Look it up the name the general entity pool XMLEntityDecl* decl = fDTDGrammar->getEntityDecl(bbName.getRawBuffer()); // If it does not exist, then obviously an error if (!decl) { // XML 1.0 Section 4.1 if (fScanner->getStandalone() || fScanner->getHasNoDTD()) { fScanner->emitError(XMLErrs::EntityNotFound, bbName.getRawBuffer()); } else { if (fScanner->getValidationScheme() == XMLScanner::Val_Always) fScanner->getValidator()->emitError(XMLValid::VC_EntityNotFound, bbName.getRawBuffer()); } return EntityExp_Failed; } // // XML 1.0 Section 4.1 // If we are a standalone document, then it has to have been declared // in the internal subset. // if (fScanner->getStandalone() && !decl->getDeclaredInIntSubset()) fScanner->emitError(XMLErrs::IllegalRefInStandalone, bbName.getRawBuffer()); // // If its a special char reference, then its escaped and we can return // it directly. // if (decl->getIsSpecialChar()) { firstCh = decl->getValue()[0]; escaped = true; return EntityExp_Returned; } if (decl->isExternal()) { // If its unparsed, then its not valid here // XML 1.0 Section 4.4.4 the appearance of a reference to an unparsed entity is forbidden. if (decl->isUnparsed()) { fScanner->emitError(XMLErrs::NoUnparsedEntityRefs, bbName.getRawBuffer()); return EntityExp_Failed; } // We are in an attribute value, so not valid. // XML 1.0 Section 4.4.4 a reference to an external entity in an attribute value is forbidden. fScanner->emitError(XMLErrs::NoExtRefsInAttValue); // And now create a reader to read this entity InputSource* srcUsed; XMLReader* reader = fReaderMgr->createReader ( decl->getBaseURI() , decl->getSystemId() , decl->getPublicId() , false , XMLReader::RefFrom_NonLiteral , XMLReader::Type_General , XMLReader::Source_External , srcUsed , fScanner->getCalculateSrcOfs() , fScanner->getLowWaterMark() , fScanner->getDisableDefaultEntityResolution() ); // Put a janitor on the source so it gets cleaned up on exit Janitor janSrc(srcUsed); // // If the creation failed then throw an exception // if (!reader) ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Gen_CouldNotOpenExtEntity, srcUsed ? srcUsed->getSystemId() : decl->getSystemId(), fMemoryManager); // // Push the reader. If its a recursive expansion, then emit an error // and return an failure. // if (!fReaderMgr->pushReader(reader, decl)) { fScanner->emitError(XMLErrs::RecursiveEntity, decl->getName()); return EntityExp_Failed; } // If it starts with the XML string, then parse a text decl if (fScanner->checkXMLDecl(true)) scanTextDecl(); } else { // // Create a reader over a memory stream over the entity value // We force it to assume UTF-16 by passing in an encoding // string. This way it won't both trying to predecode the // first line, looking for an XML/TextDecl. // XMLReader* valueReader = fReaderMgr->createIntEntReader ( decl->getName() , XMLReader::RefFrom_NonLiteral , XMLReader::Type_General , decl->getValue() , decl->getValueLen() , false ); // // Trt to push the entity reader onto the reader manager stack, // where it will become the subsequent input. If it fails, that // means the entity is recursive, so issue an error. The reader // will have just been discarded, but we just keep going. // if (!fReaderMgr->pushReader(valueReader, decl)) fScanner->emitError(XMLErrs::RecursiveEntity, decl->getName()); } return EntityExp_Pushed; } // // This method will scan a quoted literal of an entity value. It has to // deal with replacement of PE references; however, since this is a DTD // scanner, all such entity literals are in entity decls and therefore // general entities are not expanded. // bool DTDScanner::scanEntityLiteral(XMLBuffer& toFill) { toFill.reset(); // Get the next char which must be a single or double quote XMLCh quoteCh; if (!fReaderMgr->skipIfQuote(quoteCh)) return false; // Get a buffer for pulling in entity names when we see GE refs XMLBufBid bbName(fBufMgr); XMLBuffer& nameBuf = bbName.getBuffer(); // Remember the current reader const XMLSize_t orgReader = fReaderMgr->getCurrentReaderNum(); // // Loop until we see the ending quote character, handling any references // in the process. // XMLCh nextCh; XMLCh secondCh = 0; bool gotLeadingSurrogate = false; while (true) { nextCh = fReaderMgr->getNextChar(); // // Watch specifically for EOF and issue a more meaningful error // if that occurs (since an unterminated quoted char can cause // this easily.) // if (!nextCh) { fScanner->emitError(XMLErrs::UnterminatedEntityLiteral); ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); } // // Break out on our terminating quote char when we are back in the // same reader. Otherwise, we might trigger on a nested quote char // in an expanded entity. // if ((nextCh == quoteCh) && (fReaderMgr->getCurrentReaderNum() == orgReader)) { break; } if (nextCh == chPercent) { // // Put the PE's value on the reader stack and then jump back // to the top to start processing it. The parameter indicates // that it should not scan the reference's content as an external // subset. // expandPERef(false, true, true); continue; } // // Ok, now that all the other special stuff is checked, we can // look for a general entity. In here, we cannot have a naked & // and will only expand numerical char refs or the intrinsic char // refs. Others will be left alone. // if (nextCh == chAmpersand) { // // Here, we only expand numeric char refs, but not any general // entities. However, the stupid XML spec requires that we check // and make sure it does refer to a general entity if its not // a char ref (i.e. no naked '&' chars.) // if (fReaderMgr->skippedChar(chPound)) { // If it failed, then just jump back to the top and try to pick up if (!scanCharRef(nextCh, secondCh)) { gotLeadingSurrogate = false; continue; } } else { if (!fReaderMgr->getName(nameBuf)) { fScanner->emitError(XMLErrs::ExpectedEntityRefName); } else { // // Since we are not expanding any of this, we have to // put the amp and name into the target buffer as data. // toFill.append(chAmpersand); toFill.append(nameBuf.getRawBuffer()); // Make sure we skipped a trailing semicolon if (!fReaderMgr->skippedChar(chSemiColon)) { fScanner->emitError ( XMLErrs::UnterminatedEntityRef , nameBuf.getRawBuffer() ); } // And make the new character the semicolon nextCh = chSemiColon; } // Either way here we reset the surrogate flag gotLeadingSurrogate = false; } } else if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { if (gotLeadingSurrogate) fScanner->emitError(XMLErrs::Expected2ndSurrogateChar); else gotLeadingSurrogate = true; } else { if (gotLeadingSurrogate) { if ((nextCh < 0xDC00) || (nextCh > 0xDFFF)) fScanner->emitError(XMLErrs::Expected2ndSurrogateChar); } else if (!fReaderMgr->getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); fScanner->emitError(XMLErrs::InvalidCharacter, tmpBuf); fReaderMgr->skipPastChar(quoteCh); return false; } gotLeadingSurrogate = false; } // Looks ok, so add it to the literal toFill.append(nextCh); if (secondCh) { toFill.append(secondCh); secondCh=0; } } // // If we got here and did not get back to the original reader level, // then we propogated some entity out of the literal, so issue an // error, but don't fail. // if (fReaderMgr->getCurrentReaderNum() != orgReader && fScanner->getValidationScheme() == XMLScanner::Val_Always) fScanner->getValidator()->emitError(XMLValid::PartialMarkupInPE); return true; } // // This method is called after the entity name has been scanned, and any // PE referenced following the name is handled. The passed decl will be // filled in with the info scanned. // bool DTDScanner::scanEntityDef(DTDEntityDecl& decl, const bool isPEDecl) { // Its got to be an entity literal if (fReaderMgr->lookingAtChar(chSingleQuote) || fReaderMgr->lookingAtChar(chDoubleQuote)) { // Get a buffer for the literal XMLBufBid bbValue(fBufMgr); if (!scanEntityLiteral(bbValue.getBuffer())) return false; // Set it on the entity decl decl.setValue(bbValue.getRawBuffer()); return true; } // // Its got to be an external entity, so there must be an external id. // Get buffers for them and scan an external id into them. // XMLBufBid bbPubId(fBufMgr); XMLBufBid bbSysId(fBufMgr); if (!scanId(bbPubId.getBuffer(), bbSysId.getBuffer(), IDType_External)) return false; decl.setIsExternal(true); ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr->getLastExtEntityInfo(lastInfo); // Fill in the id fields of the decl with the info we got const XMLCh* publicId = bbPubId.getRawBuffer(); const XMLCh* systemId = bbSysId.getRawBuffer(); decl.setPublicId((publicId && *publicId) ? publicId : 0); decl.setSystemId((systemId && *systemId) ? systemId : 0); decl.setBaseURI((lastInfo.systemId && *lastInfo.systemId) ? lastInfo.systemId : 0); // If its a PE decl, we are done bool gotSpaces = checkForPERef(false, true); if (isPEDecl) { // // Check for a common error here. NDATA is not allowed for PEs // so check for the NDATA string. If found give a nice meaningful // error and continue parsing to eat the NDATA text. // if (gotSpaces) { if (fReaderMgr->skippedString(XMLUni::fgNDATAString)) fScanner->emitError(XMLErrs::NDATANotValidForPE); } else { return true; } } // If looking at close angle now, we are done if (fReaderMgr->lookingAtChar(chCloseAngle)) return true; // Else we had to have seem the whitespace if (!gotSpaces) fScanner->emitError(XMLErrs::ExpectedWhitespace); // We now have to see a notation data string if (!fReaderMgr->skippedString(XMLUni::fgNDATAString)) fScanner->emitError(XMLErrs::ExpectedNDATA); // Space is required here, but try to go on if not if (!checkForPERef(false, true)) fScanner->emitError(XMLErrs::ExpectedWhitespace); // Get a name XMLBufBid bbName(fBufMgr); if (!fReaderMgr->getName(bbName.getBuffer())) { fScanner->emitError(XMLErrs::ExpectedNotationName); return false; } // Set the decl's notation name decl.setNotationName(bbName.getRawBuffer()); return true; } // // This method is called after an attribute decl name or a notation decl has // been scanned and then an opening parenthesis was see, indicating the list // of values. It scans the enumeration values and creates a single string // which has a single space between each value. // // The terminating close paren ends this scan. // bool DTDScanner::scanEnumeration( const DTDAttDef& attDef , XMLBuffer& toFill , const bool notation) { // Reset the passed buffer toFill.reset(); // Check for PE ref but don't require space checkForPERef(false, true); // If this is a notation, we need an opening paren if (notation) { if (!fReaderMgr->skippedChar(chOpenParen)) fScanner->emitError(XMLErrs::ExpectedOpenParen); } // We need a local buffer to use as well XMLBufBid bbTmp(fBufMgr); while (true) { // Space is allowed here for either type so check for PE ref checkForPERef(false, true); // And then get either a name or a name token bool success; if (notation) success = fReaderMgr->getName(bbTmp.getBuffer()); else success = fReaderMgr->getNameToken(bbTmp.getBuffer()); if (!success) { fScanner->emitError ( XMLErrs::ExpectedEnumValue , attDef.getFullName() ); return false; } // Append this value to the target value toFill.append(bbTmp.getRawBuffer(), bbTmp.getLen()); // Space is allowed here for either type so check for PE ref checkForPERef(false, true); // Check for the terminating paren if (fReaderMgr->skippedChar(chCloseParen)) break; // And append a space separator toFill.append(chSpace); // Check for the pipe character separator if (!fReaderMgr->skippedChar(chPipe)) { fScanner->emitError(XMLErrs::ExpectedEnumSepOrParen); return false; } } return true; } bool DTDScanner::scanEq() { fReaderMgr->skipPastSpaces(); if (fReaderMgr->skippedChar(chEqual)) { fReaderMgr->skipPastSpaces(); return true; } return false; } // // This method is called when an external entity reference is seen in the // DTD or an external DTD subset is encountered, and their contents pushed // onto the reader stack. This method will scan that contents. // void DTDScanner::scanExtSubsetDecl(const bool inIncludeSect, const bool isDTD) { // Indicate we are in the external subset now FlagJanitor janContentFlag(&fInternalSubset, false); bool bAcceptDecl = !inIncludeSect; // Get a buffer for whitespace XMLBufBid bbSpace(fBufMgr); // // If we have a doc type handler and we are not being called recursively // to handle an include section, tell it the ext subset starts // if (fDocTypeHandler && isDTD && !inIncludeSect) fDocTypeHandler->startExtSubset(); // // We have to play a trick here if the current entity we are parsing // is a PE. Because the spooling code will put out a whitespace before // and after an expanded PE if its being scanned outside the context of // a literal entity, this will confuse this external subset code. // // So, we see if that is what is happening and, if so, eat the single // space, a check for the isScanningPERefOutOfLiteral()) { if (fReaderMgr->skippedSpace()) { if (fScanner->checkXMLDecl(true)) { scanTextDecl(); bAcceptDecl = false; // Figure out how to do this // fReaderMgr->unGet(chSpace); } } } // Get the current reader number const XMLSize_t orgReader = fReaderMgr->getCurrentReaderNum(); // // Loop until we hit the end of the external subset entity. Note that // we use a double loop here in order to avoid the overhead of doing // the exception setup/teardown work on every loop. // bool inMarkup = false; bool inCharData = false; while (true) { bool bDoBreak=false; // workaround for Borland bug with 'break' in 'catch' try { while (true) { XMLCh nextCh; try { nextCh = fReaderMgr->peekNextChar(); } catch (XMLException& ex) { fScanner->emitError(XMLErrs::XMLException_Fatal, ex.getCode(), ex.getMessage(), NULL, NULL); nextCh = chNull; } if (!nextCh) { return; // nothing left } else if (nextCh == chOpenAngle) { // Get the reader we started this on // XML 1.0 P28a Well-formedness constraint: PE Between Declarations const XMLSize_t orgReader = fReaderMgr->getCurrentReaderNum(); bool wasInPE = (fReaderMgr->getCurrentReader()->getType() == XMLReader::Type_PE); // // Now scan the markup. Set the flag so that we will know that // we were in markup if an end of entity exception occurs. // fReaderMgr->getNextChar(); inMarkup = true; scanMarkupDecl(bAcceptDecl); inMarkup = false; // // And see if we got back to the same level. If not, then its // a partial markup error. // if (fReaderMgr->getCurrentReaderNum() != orgReader){ if (wasInPE) fScanner->emitError(XMLErrs::PEBetweenDecl); else if (fScanner->getValidationScheme() == XMLScanner::Val_Always) fScanner->getValidator()->emitError(XMLValid::PartialMarkupInPE); } } else if (fReaderMgr->getCurrentReader()->isWhitespace(nextCh)) { // // If we have a doc type handler, and advanced callbacks are // enabled, then gather up whitespace and call back. Otherwise // just skip whitespaces. // if (fDocTypeHandler) { inCharData = true; fReaderMgr->getSpaces(bbSpace.getBuffer()); inCharData = false; fDocTypeHandler->doctypeWhitespace ( bbSpace.getRawBuffer() , bbSpace.getLen() ); } else { // // If we hit an end of entity in the middle of white // space, that's fine. We'll just come back in here // again on the next round and skip some more. // fReaderMgr->skipPastSpaces(); } } else if (nextCh == chPercent) { // // Expand (and scan if external) the reference value. Tell // it to throw an end of entity exception at the end of the // entity. // fReaderMgr->getNextChar(); expandPERef(true, false, false, true); } else if (inIncludeSect && (nextCh == chCloseSquare)) { // // Its the end of a conditional include section. So scan it and // decrement the include depth counter. // fReaderMgr->getNextChar(); if (!fReaderMgr->skippedChar(chCloseSquare)) { fScanner->emitError(XMLErrs::ExpectedEndOfConditional); fReaderMgr->skipPastChar(chCloseAngle); } else if (!fReaderMgr->skippedChar(chCloseAngle)) { fScanner->emitError(XMLErrs::ExpectedEndOfConditional); fReaderMgr->skipPastChar(chCloseAngle); } return; } else { fReaderMgr->getNextChar(); if (!fReaderMgr->getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); fScanner->emitError(XMLErrs::InvalidCharacter, tmpBuf); } else { fScanner->emitError(XMLErrs::InvalidDocumentStructure); } // Try to get realigned static const XMLCh toSkip[] = { chPercent, chCloseSquare, chOpenAngle, chNull }; fReaderMgr->skipUntilInOrWS(toSkip); } bAcceptDecl = false; } } catch(const EndOfEntityException& toCatch) { // // If the external entity ended while we were in markup, then that's // a partial markup error. // if (inMarkup) { fScanner->emitError(XMLErrs::PartialMarkupInEntity); inMarkup = false; } // If we were in char data, then send what we got if (inCharData) { // Send what we got, then rethrow if (fDocTypeHandler) { fDocTypeHandler->doctypeWhitespace ( bbSpace.getRawBuffer() , bbSpace.getLen() ); } inCharData = false; } // // If the entity that just ended was the entity that we started // on, then this is the end of the external subset. // if (orgReader == toCatch.getReaderNum()) bDoBreak=true; } if(bDoBreak) break; } // If we have a doc type handler, tell it the ext subset ends if (fDocTypeHandler && isDTD && !inIncludeSect) fDocTypeHandler->endExtSubset(); } // // This method will scan for an id, either public or external. // // // [75] ExternalID ::= 'SYSTEM' S SystemLiteral // | 'PUBLIC' S PubidLiteral S SystemLiteral // [83] PublicID ::= 'PUBLIC' S PubidLiteral // bool DTDScanner::scanId( XMLBuffer& pubIdToFill , XMLBuffer& sysIdToFill , const IDTypes whatKind) { // Clean out both return buffers pubIdToFill.reset(); sysIdToFill.reset(); // // Check first for the system id first. If we find it, and system id // is one of the legal values, then lets try to scan it. // // 'SYSTEM' S SystemLiteral if (fReaderMgr->skippedString(XMLUni::fgSysIDString)) { // If they were looking for a public id, then we failed if (whatKind == IDType_Public) { fScanner->emitError(XMLErrs::ExpectedPublicId); return false; } // We must skip spaces bool skippedSomething; fReaderMgr->skipPastSpaces(skippedSomething); if (!skippedSomething) { fScanner->emitError(XMLErrs::ExpectedWhitespace); return false; } // Get the system literal value return scanSystemLiteral(sysIdToFill); } // Now scan for public id // 'PUBLIC' S PubidLiteral S SystemLiteral // or // 'PUBLIC' S PubidLiteral // If we don't have any public id string => Error if (!fReaderMgr->skippedString(XMLUni::fgPubIDString)) { fScanner->emitError(XMLErrs::ExpectedSystemOrPublicId); return false; } // // So following this we must have whitespace, a public literal, whitespace, // and a system literal. // bool skippedSomething; fReaderMgr->skipPastSpaces(skippedSomething); if (!skippedSomething) { fScanner->emitError(XMLErrs::ExpectedWhitespace); // // Just in case, if they just forgot the whitespace but the next char // is a single or double quote, then keep going. // const XMLCh chPeek = fReaderMgr->peekNextChar(); if ((chPeek != chDoubleQuote) && (chPeek != chSingleQuote)) return false; } if (!scanPublicLiteral(pubIdToFill)) return false; // If they wanted a public id, then this is all if (whatKind == IDType_Public) return true; // check if there is any space follows bool hasSpace; fReaderMgr->skipPastSpaces(hasSpace); // // In order to recover best here we need to see if // the next thing is a quote or not // const XMLCh chPeek = fReaderMgr->peekNextChar(); const bool bIsQuote = ((chPeek == chDoubleQuote) || (chPeek == chSingleQuote)); if (!hasSpace) { if (whatKind == IDType_External) { // // If its an external Id, then we need to see the system id. // So, emit the error. But, if the next char is a quote, don't // give up since its probably going to work. The user just // missed the separating space. Otherwise, fail. // fScanner->emitError(XMLErrs::ExpectedWhitespace); if (!bIsQuote) return false; } else { // // We can legally return here. But, if the next char is a quote, // then that's probably not what was desired, since its probably // just that space was forgotten and there really is a system // id to follow. // // So treat it like missing whitespace if so and keep going. // Else, just return success. // if (bIsQuote) fScanner->emitError(XMLErrs::ExpectedWhitespace); else return true; } } if (bIsQuote) { // there is a quote coming, scan the system literal if (!scanSystemLiteral(sysIdToFill)) return false; } else { // no quote, if expecting exteral id, this is an error if (whatKind == IDType_External) fScanner->emitError(XMLErrs::ExpectedQuotedString); } return true; } // // This method will scan the contents of an ignored section. It assumes that // we already are in the body, i.e. we've seen closing markup. // void DTDScanner::scanIgnoredSection() { // // Depth starts at one because we are already in one section and want // to parse until we hit its end. // unsigned long depth = 1; bool gotLeadingSurrogate = false; while (true) { const XMLCh nextCh = fReaderMgr->getNextChar(); if (!nextCh) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); if (nextCh == chOpenAngle) { if (fReaderMgr->skippedChar(chBang) && fReaderMgr->skippedChar(chOpenSquare)) { depth++; } } else if (nextCh == chCloseSquare) { if (fReaderMgr->skippedChar(chCloseSquare)) { while (fReaderMgr->skippedChar(chCloseSquare)) { // Do nothing, just skip them } if (fReaderMgr->skippedChar(chCloseAngle)) { depth--; if (!depth) break; } } } // Deal with surrogate pairs else if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { // Its a leading surrogate. If we already got one, then // issue an error, else set leading flag to make sure that // we look for a trailing next time. if (gotLeadingSurrogate) fScanner->emitError(XMLErrs::Expected2ndSurrogateChar); else gotLeadingSurrogate = true; } else { // If its a trailing surrogate, make sure that we are // prepared for that. Else, its just a regular char so make // sure that we were not expected a trailing surrogate. if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) { // Its trailing, so make sure we were expecting it if (!gotLeadingSurrogate) fScanner->emitError(XMLErrs::Unexpected2ndSurrogateChar); } else { // Its just a char, so make sure we were not expecting a // trailing surrogate. if (gotLeadingSurrogate) fScanner->emitError(XMLErrs::Expected2ndSurrogateChar); // Its got to at least be a valid XML character else if (!fReaderMgr->getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); fScanner->emitError(XMLErrs::InvalidCharacter, tmpBuf); } } gotLeadingSurrogate = false; } } } // // This method scans the entire internal subset. All we can have here is // decl markup, and PE references. The expanded PE references must contain // whole markup, so we don't have to worry about their content at this // level. We just scan them, expand them, push them, and parse their content // right there, via the expandERef() method. // bool DTDScanner::scanInternalSubset() { // Indicate we are in the internal subset now FlagJanitor janContentFlag(&fInternalSubset, true); // If we have a doc type handler, tell it the internal subset starts if (fDocTypeHandler) fDocTypeHandler->startIntSubset(); // Get a buffer for whitespace XMLBufBid bbSpace(fBufMgr); bool noErrors = true; while (true) { const XMLCh nextCh = fReaderMgr->peekNextChar(); // // If we get an end of file marker, just unget it and return a // failure status. The caller will then see the end of file and // faill out correctly. // if (!nextCh) return false; // Watch for the end of internal subset marker if (nextCh == chCloseSquare) { fReaderMgr->getNextChar(); break; } if (nextCh == chPercent) { // // Expand (and scan if external) the reference value. Tell // it to set the reader to cause an end of entity exception // when this reader dies, which is what the scanExtSubset // method wants (who is called to scan this.) // fReaderMgr->getNextChar(); expandPERef(true, false, false, true); } else if (nextCh == chOpenAngle) { // Remember this reader before we start the scan, for checking // XML 1.0 P28a Well-formedness constraint: PE Between Declarations const XMLSize_t orgReader = fReaderMgr->getCurrentReaderNum(); bool wasInPE = (fReaderMgr->getCurrentReader()->getType() == XMLReader::Type_PE); // And scan this markup fReaderMgr->getNextChar(); scanMarkupDecl(false); // If we did not get back to entry level, then partial markup if (fReaderMgr->getCurrentReaderNum() != orgReader) { if (wasInPE) fScanner->emitError(XMLErrs::PEBetweenDecl); else if (fScanner->getValidationScheme() == XMLScanner::Val_Always) fScanner->getValidator()->emitError(XMLValid::PartialMarkupInPE); } } else if (fReaderMgr->getCurrentReader()->isWhitespace(nextCh)) { // // IF we are doing advanced callbacks and have a doc type // handler, then get the whitespace and call the doc type // handler with it. Otherwise, just skip whitespace. // if (fDocTypeHandler) { fReaderMgr->getSpaces(bbSpace.getBuffer()); fDocTypeHandler->doctypeWhitespace ( bbSpace.getRawBuffer() , bbSpace.getLen() ); } else { fReaderMgr->skipPastSpaces(); } } else { // Not valid, so emit an error XMLCh tmpBuf[9]; XMLString::binToText ( fReaderMgr->getNextChar() , tmpBuf , 8 , 16 , fMemoryManager ); fScanner->emitError ( XMLErrs::InvalidCharacterInIntSubset , tmpBuf ); // // If an '>', then probably an abnormally terminated // internal subset so just return. // if (nextCh == chCloseAngle) { noErrors = false; break; } // // Otherwise, try to sync back up by scanning forward for // a reasonable start character. // static const XMLCh toSkip[] = { chPercent, chCloseSquare, chOpenAngle, chNull }; fReaderMgr->skipUntilInOrWS(toSkip); } } // If we have a doc type handler, tell it the internal subset ends if (fDocTypeHandler) fDocTypeHandler->endIntSubset(); return noErrors; } // // This method is called once we see a < in the input of an int/ext subset, // which indicates the start of some sort of markup. // void DTDScanner::scanMarkupDecl(const bool parseTextDecl) { // // We only have two valid first characters here. One is a ! which opens // some markup decl. The other is a ?, which could begin either a PI // or a text decl. If parseTextDecl is false, we cannot accept a text // decl. // const XMLCh nextCh = fReaderMgr->getNextChar(); if (nextCh == chBang) { if (fReaderMgr->skippedChar(chDash)) { if (fReaderMgr->skippedChar(chDash)) { scanComment(); } else { fScanner->emitError(XMLErrs::CommentsMustStartWith); fReaderMgr->skipPastChar(chCloseAngle); } } else if (fReaderMgr->skippedChar(chOpenSquare)) { // // Its a conditional section. This is only valid in the external // subset, so issue an error if we aren't there. // if (fInternalSubset) { fScanner->emitError(XMLErrs::ConditionalSectInIntSubset); fReaderMgr->skipPastChar(chCloseAngle); return; } // A PE ref can happen here, but space is not required checkForPERef(false, true); if (fReaderMgr->skippedString(XMLUni::fgIncludeString)) { checkForPERef(false, true); // Check for the following open square bracket if (!fReaderMgr->skippedChar(chOpenSquare)) fScanner->emitError(XMLErrs::ExpectedINCLUDEBracket); // Get the reader we started this on const XMLSize_t orgReader = fReaderMgr->getCurrentReaderNum(); checkForPERef(false, true); // // Recurse back to the ext subset call again, telling it its // in an include section. // scanExtSubsetDecl(true, false); // // And see if we got back to the same level. If not, then its // a partial markup error. // if (fReaderMgr->getCurrentReaderNum() != orgReader && fScanner->getValidationScheme() == XMLScanner::Val_Always) fScanner->getValidator()->emitError(XMLValid::PartialMarkupInPE); } else if (fReaderMgr->skippedString(XMLUni::fgIgnoreString)) { checkForPERef(false, true); // Check for the following open square bracket if (!fReaderMgr->skippedChar(chOpenSquare)) fScanner->emitError(XMLErrs::ExpectedINCLUDEBracket); // Get the reader we started this on const XMLSize_t orgReader = fReaderMgr->getCurrentReaderNum(); // And scan over the ignored part scanIgnoredSection(); // // And see if we got back to the same level. If not, then its // a partial markup error. // if (fReaderMgr->getCurrentReaderNum() != orgReader && fScanner->getValidationScheme() == XMLScanner::Val_Always) fScanner->getValidator()->emitError(XMLValid::PartialMarkupInPE); } else { fScanner->emitError(XMLErrs::ExpectedIncOrIgn); fReaderMgr->skipPastChar(chCloseAngle); } } else if (fReaderMgr->skippedString(XMLUni::fgAttListString)) { scanAttListDecl(); } else if (fReaderMgr->skippedString(XMLUni::fgElemString)) { scanElementDecl(); } else if (fReaderMgr->skippedString(XMLUni::fgEntityString)) { scanEntityDecl(); } else if (fReaderMgr->skippedString(XMLUni::fgNotationString)) { scanNotationDecl(); } else { fScanner->emitError(XMLErrs::ExpectedMarkupDecl); fReaderMgr->skipPastChar(chCloseAngle); } } else if (nextCh == chQuestion) { // It could be a PI or the XML declaration. Check for Decl if (fScanner->checkXMLDecl(false)) { // If we are not accepting text decls, its an error if (parseTextDecl) { scanTextDecl(); } else { // Emit the error and skip past this markup fScanner->emitError(XMLErrs::TextDeclNotLegalHere); fReaderMgr->skipPastChar(chCloseAngle); } } else { // It has to be a PI scanPI(); } } else { // Can't be valid so emit error and try to skip past end of this decl fScanner->emitError(XMLErrs::ExpectedMarkupDecl); fReaderMgr->skipPastChar(chCloseAngle); } } // // This method is called for a mixed model element's content mode. We've // already scanned past the '(PCDATA' part by the time we get here. So // everything else is element names separated by | characters until we // hit the end. The passed element decl's content model is filled in with // the information found. // bool DTDScanner::scanMixed(DTDElementDecl& toFill) { // // The terminating star is only required if there is something more // than (PCDATA). // bool starRequired = false; // Get a buffer to be used below to get element names XMLBufBid bbName(fBufMgr); XMLBuffer& nameBuf = bbName.getBuffer(); // // Create an initial content spec node. Its just a leaf node with a // PCDATA element id. This current node pointer will be pushed down the // tree as we go. // ContentSpecNode* curNode = new (fGrammarPoolMemoryManager) ContentSpecNode ( new (fGrammarPoolMemoryManager) QName ( XMLUni::fgZeroLenString , XMLUni::fgZeroLenString , XMLElementDecl::fgPCDataElemId , fGrammarPoolMemoryManager ) , false , fGrammarPoolMemoryManager ); // // Set the initial leaf as the temporary head. If we hit the first choice // node, it will be set up here. When done, this is the node that's set // as the content spec for the element. // ContentSpecNode* headNode = curNode; // Remember the original node so we can sense the first choice node ContentSpecNode* orgNode = curNode; // // We just loop around, getting the | character at the top and then // looking for the next element name. We keep up with the last node // and add each new one to its right node. // while (true) { // // First of all we check for some grunt work details of skipping // whitespace, expand PE refs, and catching invalid reps. // if (fReaderMgr->lookingAtChar(chPercent)) { // Expand it and continue checkForPERef(false, true); } else if (fReaderMgr->skippedChar(chAsterisk)) { // // Tell them they can't have reps in mixed model, but eat // it and keep going if we are allowed to. // if (fScanner->emitErrorWillThrowException(XMLErrs::NoRepInMixed)) { delete headNode; } fScanner->emitError(XMLErrs::NoRepInMixed); } else if (fReaderMgr->skippedSpace()) { // Spaces are ok at this point, just eat them and continue fReaderMgr->skipPastSpaces(); } else { if (!fReaderMgr->skippedChar(chPipe)) { // Has to be the closing paren now. if (!fReaderMgr->skippedChar(chCloseParen)) { delete headNode; fScanner->emitError(XMLErrs::UnterminatedContentModel, toFill.getElementName()->getLocalPart()); return false; } bool starSkipped = true; if (!fReaderMgr->skippedChar(chAsterisk)) { starSkipped = false; if (starRequired) { if (fScanner->emitErrorWillThrowException(XMLErrs::ExpectedAsterisk)) { delete headNode; } fScanner->emitError(XMLErrs::ExpectedAsterisk); } } // // Create a zero or more node and make the original head // node its first child. // if (starRequired || starSkipped) { headNode = new (fGrammarPoolMemoryManager) ContentSpecNode ( ContentSpecNode::ZeroOrMore , headNode , 0 , true , true , fGrammarPoolMemoryManager ); } // Store the head node as the content spec of the element. toFill.setContentSpec(headNode); break; } // Its more than just a PCDATA, so an ending star will be required now starRequired = true; // Space is legal here so check for a PE ref, but don't require space checkForPERef(false, true); // Get a name token if (!fReaderMgr->getName(nameBuf)) { delete headNode; fScanner->emitError(XMLErrs::ExpectedElementName); return false; } // // Create a leaf node for it. If we can find the element id for // this element, then use it. Else, we have to fault in an element // decl, marked as created because of being in a content model. // XMLElementDecl* decl = fDTDGrammar->getElemDecl(fEmptyNamespaceId, 0, nameBuf.getRawBuffer(), Grammar::TOP_LEVEL_SCOPE); if (!decl) { decl = new (fGrammarPoolMemoryManager) DTDElementDecl ( nameBuf.getRawBuffer() , fEmptyNamespaceId , DTDElementDecl::Any , fGrammarPoolMemoryManager ); decl->setCreateReason(XMLElementDecl::InContentModel); decl->setExternalElemDeclaration(isReadingExternalEntity()); fDTDGrammar->putElemDecl(decl); } // // If the current node is the original node, this is the first choice // node, so create an initial choice node with the current node and // the new element id. Store this as the head node. // // Otherwise, we have to steal the right node of the previous choice // and weave in another choice node there, which has the old choice // as its left and the new leaf as its right. // if (curNode == orgNode) { curNode = new (fGrammarPoolMemoryManager) ContentSpecNode ( ContentSpecNode::Choice , curNode , new (fGrammarPoolMemoryManager) ContentSpecNode ( decl->getElementName() , fGrammarPoolMemoryManager ) , true , true , fGrammarPoolMemoryManager ); // Remember the top node headNode = curNode; } else { ContentSpecNode* oldRight = curNode->orphanSecond(); curNode->setSecond ( new (fGrammarPoolMemoryManager) ContentSpecNode ( ContentSpecNode::Choice , oldRight , new (fGrammarPoolMemoryManager) ContentSpecNode ( decl->getElementName() , fGrammarPoolMemoryManager ) , true , true , fGrammarPoolMemoryManager ) ); // Make the new right node the current node curNode = curNode->getSecond(); } } } return true; } // // This method is called when we see a 'emitError(XMLErrs::ExpectedWhitespace); fReaderMgr->skipPastChar(chCloseAngle); return; } // // And now we get a name, which is the name of the notation. Get a // buffer for the name. // XMLBufBid bbName(fBufMgr); if (!fReaderMgr->getName(bbName.getBuffer())) { fScanner->emitError(XMLErrs::ExpectedNotationName); fReaderMgr->skipPastChar(chCloseAngle); return; } // If namespaces are enabled, then no colons allowed if (fScanner->getDoNamespaces()) { if (XMLString::indexOf(bbName.getRawBuffer(), chColon) != -1) fScanner->emitError(XMLErrs::ColonNotLegalWithNS); } // Space is required here so check for a PE ref, and require space if (!checkForPERef(false, true)) { fScanner->emitError(XMLErrs::ExpectedWhitespace); fReaderMgr->skipPastChar(chCloseAngle); return; } // // And scan an external or public id. We need buffers to use for both // of these. // XMLBufBid bbPubId(fBufMgr); XMLBufBid bbSysId(fBufMgr); if (!scanId(bbPubId.getBuffer(), bbSysId.getBuffer(), IDType_Either)) { fReaderMgr->skipPastChar(chCloseAngle); return; } // We can have an optional space or PE ref here checkForPERef(false, true); // // See if it already exists. If so, add it to the notatino decl pool. // Otherwise, if advanced callbacks are on, create a temp one and // call out for that one. // XMLNotationDecl* decl = fDTDGrammar->getNotationDecl(bbName.getRawBuffer()); bool isIgnoring = (decl != 0); if (isIgnoring) { fScanner->emitError(XMLErrs::NotationAlreadyExists, bbName.getRawBuffer()); } else { // Fill in a new notation declaration and add it to the pool const XMLCh* publicId = bbPubId.getRawBuffer(); const XMLCh* systemId = bbSysId.getRawBuffer(); ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr->getLastExtEntityInfo(lastInfo); decl = new (fGrammarPoolMemoryManager) XMLNotationDecl ( bbName.getRawBuffer() , (publicId && *publicId) ? publicId : 0 , (systemId && *systemId) ? systemId : 0 , (lastInfo.systemId && *lastInfo.systemId) ? lastInfo.systemId : 0 , fGrammarPoolMemoryManager ); fDTDGrammar->putNotationDecl(decl); } // // If we have a document type handler, then tell it about this. If we // are ignoring it, only call out if advanced callbacks are enabled. // if (fDocTypeHandler) { fDocTypeHandler->notationDecl ( *decl , isIgnoring ); } // And one more optional space or PE ref checkForPERef(false, true); // And skip the terminating bracket if (!fReaderMgr->skippedChar(chCloseAngle)) fScanner->emitError(XMLErrs::UnterminatedNotationDecl); } // // Scans a PI and calls the appropriate callbacks. A PI can happen in either // the document or the DTD, so it calls the appropriate handler according // to the fInDocument flag. // // At entry we have just scanned the lookingAtSpace()) { fScanner->emitError(XMLErrs::PINameExpected); fReaderMgr->skipPastSpaces(); } // Get a buffer for the PI name and scan it in XMLBufBid bbName(fBufMgr); if (!fReaderMgr->getName(bbName.getBuffer())) { fScanner->emitError(XMLErrs::PINameExpected); fReaderMgr->skipPastChar(chCloseAngle); return; } // Point the name pointer at the raw data namePtr = bbName.getRawBuffer(); // See if it issome form of 'xml' and emit a warning //if (!XMLString::compareIString(namePtr, XMLUni::fgXMLString)) if (bbName.getLen() == 3 && (((namePtr[0] == chLatin_x) || (namePtr[0] == chLatin_X)) && ((namePtr[1] == chLatin_m) || (namePtr[1] == chLatin_M)) && ((namePtr[2] == chLatin_l) || (namePtr[2] == chLatin_L)))) fScanner->emitError(XMLErrs::NoPIStartsWithXML); // If namespaces are enabled, then no colons allowed if (fScanner->getDoNamespaces()) { if (XMLString::indexOf(namePtr, chColon) != -1) fScanner->emitError(XMLErrs::ColonNotLegalWithNS); } // // If we don't hit a space next, then the PI has no target. If we do // then get out the target. Get a buffer for it as well // XMLBufBid bbTarget(fBufMgr); if (fReaderMgr->skippedSpace()) { // Skip any leading spaces fReaderMgr->skipPastSpaces(); bool gotLeadingSurrogate = false; // It does have a target, so lets move on to deal with that. while (1) { const XMLCh nextCh = fReaderMgr->getNextChar(); // Watch for an end of file, which is always bad here if (!nextCh) { fScanner->emitError(XMLErrs::UnterminatedPI); ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); } // Watch for potential terminating character if (nextCh == chQuestion) { // It must be followed by '>' to be a termination of the target if (fReaderMgr->skippedChar(chCloseAngle)) break; } // Check for correct surrogate pairs if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { if (gotLeadingSurrogate) fScanner->emitError(XMLErrs::Expected2ndSurrogateChar); else gotLeadingSurrogate = true; } else { if (gotLeadingSurrogate) { if ((nextCh < 0xDC00) || (nextCh > 0xDFFF)) fScanner->emitError(XMLErrs::Expected2ndSurrogateChar); } // Its got to at least be a valid XML character else if (!fReaderMgr->getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); fScanner->emitError(XMLErrs::InvalidCharacter, tmpBuf); } gotLeadingSurrogate = false; } bbTarget.append(nextCh); } } else { // No target, but make sure its terminated ok if (!fReaderMgr->skippedChar(chQuestion)) { fScanner->emitError(XMLErrs::UnterminatedPI); fReaderMgr->skipPastChar(chCloseAngle); return; } if (!fReaderMgr->skippedChar(chCloseAngle)) { fScanner->emitError(XMLErrs::UnterminatedPI); fReaderMgr->skipPastChar(chCloseAngle); return; } } // Point the target pointer at the raw data targetPtr = bbTarget.getRawBuffer(); // // If we have a handler, then call it. // if (fDocTypeHandler) { fDocTypeHandler->doctypePI ( namePtr , targetPtr ); } } // // This method scans a public literal. It must be quoted and all of its // characters must be valid public id characters. The quotes are discarded // and the results are returned. // bool DTDScanner::scanPublicLiteral(XMLBuffer& toFill) { toFill.reset(); // Get the next char which must be a single or double quote XMLCh quoteCh; if (!fReaderMgr->skipIfQuote(quoteCh)) { fScanner->emitError(XMLErrs::ExpectedQuotedString); return false; } while (true) { const XMLCh nextCh = fReaderMgr->getNextChar(); // Watch for EOF if (!nextCh) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); if (nextCh == quoteCh) break; // // If its not a valid public id char, then report it but keep going // since that's the best recovery scheme. // if (!fReaderMgr->getCurrentReader()->isPublicIdChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); fScanner->emitError(XMLErrs::InvalidPublicIdChar, tmpBuf); } toFill.append(nextCh); } return true; } // // This method handles scanning in a quoted system literal. It expects to // start on the open quote and returns after eating the ending quote. There // are not really any restrictions on the contents of system literals. // bool DTDScanner::scanSystemLiteral(XMLBuffer& toFill) { toFill.reset(); // Get the next char which must be a single or double quote XMLCh quoteCh; if (!fReaderMgr->skipIfQuote(quoteCh)) { fScanner->emitError(XMLErrs::ExpectedQuotedString); return false; } XMLCh nextCh; // Break out on terminating quote while ((nextCh=fReaderMgr->getNextChar())!=quoteCh) { // Watch for EOF if (!nextCh) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); toFill.append(nextCh); } return true; } // // This method is called to scan a text decl line, which can be the first // line in an external entity or external subset. // // On entry the ' // void DTDScanner::scanTextDecl() { // Skip any subsequent whitespace before the version string fReaderMgr->skipPastSpaces(); // Next should be the version string XMLBufBid bbVersion(fBufMgr); if (fReaderMgr->skippedString(XMLUni::fgVersionString)) { if (!scanEq()) { fScanner->emitError(XMLErrs::ExpectedEqSign); fReaderMgr->skipPastChar(chCloseAngle); return; } // // Followed by a single or double quoted version. Get a buffer for // the string. // if (!getQuotedString(bbVersion.getBuffer())) { fScanner->emitError(XMLErrs::BadXMLVersion); fReaderMgr->skipPastChar(chCloseAngle); return; } // If its not our supported version, issue an error but continue if (XMLString::equals(bbVersion.getRawBuffer(), XMLUni::fgVersion1_1)) { if (fScanner->getXMLVersion() != XMLReader::XMLV1_1) fScanner->emitError(XMLErrs::UnsupportedXMLVersion, bbVersion.getRawBuffer()); } else if (!XMLString::equals(bbVersion.getRawBuffer(), XMLUni::fgVersion1_0)) fScanner->emitError(XMLErrs::UnsupportedXMLVersion, bbVersion.getRawBuffer()); } // Ok, now we must have an encoding string XMLBufBid bbEncoding(fBufMgr); fReaderMgr->skipPastSpaces(); bool gotEncoding = false; if (fReaderMgr->skippedString(XMLUni::fgEncodingString)) { // There must be a equal sign next if (!scanEq()) { fScanner->emitError(XMLErrs::ExpectedEqSign); fReaderMgr->skipPastChar(chCloseAngle); return; } // Followed by a single or double quoted version string getQuotedString(bbEncoding.getBuffer()); if (bbEncoding.isEmpty() || !XMLString::isValidEncName(bbEncoding.getRawBuffer())) { fScanner->emitError(XMLErrs::BadXMLEncoding, bbEncoding.getRawBuffer()); fReaderMgr->skipPastChar(chCloseAngle); return; } // Indicate that we got an encoding gotEncoding = true; } // // Encoding declarations are required in the external entity // if there is a text declaration present // if (!gotEncoding) { fScanner->emitError(XMLErrs::EncodingRequired); fReaderMgr->skipPastChar(chCloseAngle); return; } fReaderMgr->skipPastSpaces(); if (!fReaderMgr->skippedChar(chQuestion)) { fScanner->emitError(XMLErrs::UnterminatedXMLDecl); fReaderMgr->skipPastChar(chCloseAngle); } else if (!fReaderMgr->skippedChar(chCloseAngle)) { fScanner->emitError(XMLErrs::UnterminatedXMLDecl); fReaderMgr->skipPastChar(chCloseAngle); } // // If we have a document type handler and advanced callbacks are on, // then call the TextDecl callback // if (fDocTypeHandler) { fDocTypeHandler->TextDecl ( bbVersion.getRawBuffer() , bbEncoding.getRawBuffer() ); } // // If we got an encoding string, then we have to call back on the reader // to tell it what the encoding is. // if (!bbEncoding.isEmpty()) { if (!fReaderMgr->getCurrentReader()->setEncoding(bbEncoding.getRawBuffer())) fScanner->emitError(XMLErrs::ContradictoryEncoding, bbEncoding.getRawBuffer()); } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/DTD/DTDAttDefList.cpp000644 000765 000024 00000012215 13241160333 024111 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DTDAttDefList.cpp 679359 2008-07-24 11:15:19Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // DTDAttDefList: Constructors and Destructor // --------------------------------------------------------------------------- DTDAttDefList::DTDAttDefList(RefHashTableOf* const listToUse, MemoryManager* const manager) : XMLAttDefList(manager) ,fEnum(0) ,fList(listToUse) ,fArray(0) ,fSize(0) ,fCount(0) { fEnum = new (getMemoryManager()) RefHashTableOfEnumerator(listToUse, false, manager); fArray = (DTDAttDef **)(manager->allocate( sizeof(DTDAttDef*) << 1)); fSize = 2; } DTDAttDefList::~DTDAttDefList() { delete fEnum; (getMemoryManager())->deallocate(fArray); } // --------------------------------------------------------------------------- // DTDAttDefList: Implementation of the virtual interface // --------------------------------------------------------------------------- bool DTDAttDefList::isEmpty() const { return fList->isEmpty(); } XMLAttDef* DTDAttDefList::findAttDef(const unsigned int , const XMLCh* const attName) { // We don't use the URI, so we just look up the name return fList->get(attName); } const XMLAttDef* DTDAttDefList::findAttDef( const unsigned int , const XMLCh* const attName) const { // We don't use the URI, so we just look up the name return fList->get(attName); } XMLAttDef* DTDAttDefList::findAttDef( const XMLCh* const , const XMLCh* const attName) { // We don't use the URI, so we just look up the name return fList->get(attName); } const XMLAttDef* DTDAttDefList::findAttDef( const XMLCh* const , const XMLCh* const attName) const { // We don't use the URI, so we just look up the name return fList->get(attName); } /** * return total number of attributes in this list */ XMLSize_t DTDAttDefList::getAttDefCount() const { return fCount; } /** * return attribute at the index-th position in the list. */ XMLAttDef &DTDAttDefList::getAttDef(XMLSize_t index) { if(index >= fCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::AttrList_BadIndex, getMemoryManager()); return *(fArray[index]); } /** * return attribute at the index-th position in the list. */ const XMLAttDef &DTDAttDefList::getAttDef(XMLSize_t index) const { if(index >= fCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::AttrList_BadIndex, getMemoryManager()); return *(fArray[index]); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(DTDAttDefList) void DTDAttDefList::serialize(XSerializeEngine& serEng) { XMLAttDefList::serialize(serEng); if (serEng.isStoring()) { /*** * * Serialize RefHashTableOf * ***/ XTemplateSerializer::storeObject(fList, serEng); serEng.writeSize (fCount); // do not serialize fEnum } else { /*** * * Deserialize RefHashTableOf * ***/ XTemplateSerializer::loadObject(&fList, 29, true, serEng); // assume empty so we can size fArray just right serEng.readSize (fSize); if (!fEnum && fList) { fEnum = new (getMemoryManager()) RefHashTableOfEnumerator(fList, false, getMemoryManager()); } if(fSize) { (getMemoryManager())->deallocate(fArray); fArray = (DTDAttDef **)((getMemoryManager())->allocate( sizeof(DTDAttDef*) * fSize)); fCount = 0; while(fEnum->hasMoreElements()) { fArray[fCount++] = &fEnum->nextElement(); } } } } DTDAttDefList::DTDAttDefList(MemoryManager* const manager) : XMLAttDefList(manager) ,fEnum(0) ,fList(0) ,fArray(0) ,fSize(0) ,fCount(0) { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/DTD/DocTypeHandler.hpp000644 000765 000024 00000007734 13241160333 024436 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DocTypeHandler.hpp 557282 2007-07-18 14:54:15Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOCTYPEHANDLER_HPP) #define XERCESC_INCLUDE_GUARD_DOCTYPEHANDLER_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // // This abstract class defines the document type handler API's which can be // used to process the DTD events generated by the DTDScanner as it scans the // internal and external subset. class VALIDATORS_EXPORT DocTypeHandler { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- DocTypeHandler() { } virtual ~DocTypeHandler() { } // ----------------------------------------------------------------------- // The document type handler virtual handler interface // ----------------------------------------------------------------------- virtual void attDef ( const DTDElementDecl& elemDecl , const DTDAttDef& attDef , const bool ignoring ) = 0; virtual void doctypeComment ( const XMLCh* const comment ) = 0; virtual void doctypeDecl ( const DTDElementDecl& elemDecl , const XMLCh* const publicId , const XMLCh* const systemId , const bool hasIntSubset , const bool hasExtSubset = false ) = 0; virtual void doctypePI ( const XMLCh* const target , const XMLCh* const data ) = 0; virtual void doctypeWhitespace ( const XMLCh* const chars , const XMLSize_t length ) = 0; virtual void elementDecl ( const DTDElementDecl& decl , const bool isIgnored ) = 0; virtual void endAttList ( const DTDElementDecl& elemDecl ) = 0; virtual void endIntSubset() = 0; virtual void endExtSubset() = 0; virtual void entityDecl ( const DTDEntityDecl& entityDecl , const bool isPEDecl , const bool isIgnored ) = 0; virtual void resetDocType() = 0; virtual void notationDecl ( const XMLNotationDecl& notDecl , const bool isIgnored ) = 0; virtual void startAttList ( const DTDElementDecl& elemDecl ) = 0; virtual void startIntSubset() = 0; virtual void startExtSubset() = 0; virtual void TextDecl ( const XMLCh* const versionStr , const XMLCh* const encodingStr ) = 0; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DocTypeHandler(const DocTypeHandler&); DocTypeHandler& operator=(const DocTypeHandler&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/DTD/XMLDTDDescriptionImpl.hpp000644 000765 000024 00000006635 13241160333 025612 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLDTDDescriptionImpl.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLDTDDESCRIPTIONIMPL_HPP) #define XERCESC_INCLUDE_GUARD_XMLDTDDESCRIPTIONIMPL_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLPARSER_EXPORT XMLDTDDescriptionImpl : public XMLDTDDescription { public : // ----------------------------------------------------------------------- /** @name constructor and destructor */ // ----------------------------------------------------------------------- //@{ XMLDTDDescriptionImpl( const XMLCh* const systemId , MemoryManager* const memMgr ); ~XMLDTDDescriptionImpl(); //@} // ----------------------------------------------------------------------- /** @name Implementation of GrammarDescription Interface */ // ----------------------------------------------------------------------- //@{ /** * getGrammarKey * */ virtual const XMLCh* getGrammarKey() const ; //@} // ----------------------------------------------------------------------- /** @name Implementation of DTDDescription Interface */ // ----------------------------------------------------------------------- //@{ /** * Getter * */ virtual const XMLCh* getRootName() const; virtual const XMLCh* getSystemId() const; /** * Setter * */ virtual void setRootName(const XMLCh* const); virtual void setSystemId(const XMLCh* const); //@} /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLDTDDescriptionImpl) XMLDTDDescriptionImpl(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager); private : // ----------------------------------------------------------------------- /** name Unimplemented copy constructor and operator= */ // ----------------------------------------------------------------------- //@{ XMLDTDDescriptionImpl(const XMLDTDDescriptionImpl& ); XMLDTDDescriptionImpl& operator=(const XMLDTDDescriptionImpl& ); //@} // ----------------------------------------------------------------------- // // fSystemId: // SYSTEM ID of the grammar // // fRootName: // root name of the grammar // // ----------------------------------------------------------------------- const XMLCh* fSystemId; const XMLCh* fRootName; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/DTD/DTDAttDef.cpp000644 000765 000024 00000006467 13241160333 023271 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DTDAttDef.cpp 679359 2008-07-24 11:15:19Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // DTDAttDef: Constructors and Destructor // --------------------------------------------------------------------------- DTDAttDef::DTDAttDef(MemoryManager* const manager) : XMLAttDef(XMLAttDef::CData, XMLAttDef::Implied, manager) , fElemId(XMLElementDecl::fgInvalidElemId) , fName(0) { } DTDAttDef::DTDAttDef(const XMLCh* const attName , const XMLAttDef::AttTypes type , const XMLAttDef::DefAttTypes defType , MemoryManager* const manager) : XMLAttDef(type, defType, manager) , fElemId(XMLElementDecl::fgInvalidElemId) , fName(0) { fName = XMLString::replicate(attName, getMemoryManager()); } DTDAttDef::DTDAttDef( const XMLCh* const attName , const XMLCh* const attValue , const XMLAttDef::AttTypes type , const XMLAttDef::DefAttTypes defType , const XMLCh* const enumValues , MemoryManager* const manager) : XMLAttDef(attValue, type, defType, enumValues, manager) , fElemId(XMLElementDecl::fgInvalidElemId) , fName(0) { fName = XMLString::replicate(attName, getMemoryManager()); } DTDAttDef::~DTDAttDef() { getMemoryManager()->deallocate(fName); //delete [] fName; } // --------------------------------------------------------------------------- // DTDAttDef: Setter methods // --------------------------------------------------------------------------- void DTDAttDef::setName(const XMLCh* const newName) { getMemoryManager()->deallocate(fName); //delete [] fName; fName = XMLString::replicate(newName, getMemoryManager()); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(DTDAttDef) void DTDAttDef::serialize(XSerializeEngine& serEng) { XMLAttDef::serialize(serEng); if (serEng.isStoring()) { serEng.writeSize (fElemId); serEng.writeString(fName); } else { serEng.readSize (fElemId); serEng.readString(fName); } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/DTD/DTDElementDecl.hpp000644 000765 000024 00000021672 13241160333 024303 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DTDElementDecl.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DTDELEMENTDECL_HPP) #define XERCESC_INCLUDE_GUARD_DTDELEMENTDECL_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class ContentSpecNode; class DTDAttDefList; // // This class is a derivative of the basic element decl. This one implements // the virtuals so that they work for a DTD. The big difference is that // they don't live in any URL in the DTD. The names are just stored as full // QNames, so they are not split out and element decls don't live within // URL namespaces or anything like that. // class VALIDATORS_EXPORT DTDElementDecl : public XMLElementDecl { public : // ----------------------------------------------------------------------- // Class specific types // // ModelTypes // Indicates the type of content model that an element has. This // indicates how the content model is represented and validated. // ----------------------------------------------------------------------- enum ModelTypes { Empty , Any , Mixed_Simple , Children , ModelTypes_Count }; // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- DTDElementDecl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); DTDElementDecl ( const XMLCh* const elemRawName , const unsigned int uriId , const ModelTypes modelType , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); DTDElementDecl ( QName* const elementName , const ModelTypes modelType = Any , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~DTDElementDecl(); // ----------------------------------------------------------------------- // The virtual element decl interface // ----------------------------------------------------------------------- virtual XMLAttDefList& getAttDefList() const; virtual CharDataOpts getCharDataOpts() const; virtual bool hasAttDefs() const; virtual const ContentSpecNode* getContentSpec() const; virtual ContentSpecNode* getContentSpec(); virtual void setContentSpec(ContentSpecNode* toAdopt); virtual XMLContentModel* getContentModel(); virtual void setContentModel(XMLContentModel* const newModelToAdopt); virtual const XMLCh* getFormattedContentModel () const; // ----------------------------------------------------------------------- // Support keyed collections // // This method allows objects of this type be placed into one of the // standard keyed collections. This method will return the full name of // the element, which will vary depending upon the type of the grammar. // ----------------------------------------------------------------------- const XMLCh* getKey() const; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- const DTDAttDef* getAttDef(const XMLCh* const attName) const; DTDAttDef* getAttDef(const XMLCh* const attName); ModelTypes getModelType() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void addAttDef(DTDAttDef* const toAdd); void setModelType(const DTDElementDecl::ModelTypes toSet); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(DTDElementDecl) virtual XMLElementDecl::objectType getObjectType() const; private : // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void faultInAttDefList() const; XMLContentModel* createChildModel() ; XMLContentModel* makeContentModel() ; XMLCh* formatContentModel () const ; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DTDElementDecl(const DTDElementDecl &); DTDElementDecl& operator = (const DTDElementDecl&); // ----------------------------------------------------------------------- // Private data members // // fAttDefs // The list of attributes that are defined for this element. Each // element is its own little 'namespace' for attributes, so each // element maintains its own list of owned attribute defs. It is // faulted in when an attribute is actually added. // // fAttList // We have to return a view of our att defs via the abstract view // that the scanner understands. It may or may not ever be asked // for so we fault it in as needed. // // fContentSpec // This is the content spec for the node. It contains the original // content spec that was read from the DTD, as a tree of nodes. This // one is always set up, and is used to build the fContentModel // version if we are validating. // // fModelType // The content model type of this element. This tells us what kind // of content model to create. // // fContentModel // The content model object for this element. It is stored here via // its abstract interface. // // fFormattedModel // This is a faulted in member. When the outside world asks for // our content model as a string, we format it and fault it into // this field (to avoid doing the formatted over and over.) // ----------------------------------------------------------------------- ModelTypes fModelType; RefHashTableOf* fAttDefs; DTDAttDefList* fAttList; ContentSpecNode* fContentSpec; XMLContentModel* fContentModel; XMLCh* fFormattedModel; }; // --------------------------------------------------------------------------- // DTDElementDecl: XMLElementDecl virtual interface implementation // --------------------------------------------------------------------------- inline ContentSpecNode* DTDElementDecl::getContentSpec() { return fContentSpec; } inline const ContentSpecNode* DTDElementDecl::getContentSpec() const { return fContentSpec; } inline XMLContentModel* DTDElementDecl::getContentModel() { if (!fContentModel) fContentModel = makeContentModel(); return fContentModel; } inline void DTDElementDecl::setContentModel(XMLContentModel* const newModelToAdopt) { delete fContentModel; fContentModel = newModelToAdopt; // reset formattedModel if (fFormattedModel) { getMemoryManager()->deallocate(fFormattedModel); fFormattedModel = 0; } } // --------------------------------------------------------------------------- // DTDElementDecl: Miscellaneous methods // --------------------------------------------------------------------------- inline const XMLCh* DTDElementDecl::getKey() const { return getFullName(); } // --------------------------------------------------------------------------- // DTDElementDecl: Getter methods // --------------------------------------------------------------------------- inline DTDElementDecl::ModelTypes DTDElementDecl::getModelType() const { return fModelType; } // --------------------------------------------------------------------------- // DTDElementDecl: Setter methods // --------------------------------------------------------------------------- inline void DTDElementDecl::setModelType(const DTDElementDecl::ModelTypes toSet) { fModelType = toSet; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/DTD/DTDEntityDecl.hpp000644 000765 000024 00000015362 13241160333 024165 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DTDEntityDecl.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DTDENTITYDECL_HPP) #define XERCESC_INCLUDE_GUARD_DTDENTITYDECL_HPP #include XERCES_CPP_NAMESPACE_BEGIN // // This is a derivative of the abstract version of an entity decl in the // framework directory. We just need to provide implementation of a couple // of methods. // class VALIDATORS_EXPORT DTDEntityDecl : public XMLEntityDecl { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- DTDEntityDecl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); DTDEntityDecl ( const XMLCh* const entName , const bool fromIntSubset = false , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); DTDEntityDecl ( const XMLCh* const entName , const XMLCh* const value , const bool fromIntSubset = false , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); DTDEntityDecl ( const XMLCh* const entName , const XMLCh value , const bool fromIntSubset = false , const bool specialChar = false ); ~DTDEntityDecl(); // ----------------------------------------------------------------------- // Implementation of the virtual XMLEntityDecl interface // ----------------------------------------------------------------------- virtual bool getDeclaredInIntSubset() const; virtual bool getIsParameter() const; virtual bool getIsSpecialChar() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setDeclaredInIntSubset(const bool newValue); void setIsParameter(const bool newValue); void setIsSpecialChar(const bool newValue); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(DTDEntityDecl) private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DTDEntityDecl(const DTDEntityDecl&); DTDEntityDecl& operator=(DTDEntityDecl&); // ----------------------------------------------------------------------- // Private data members // // fDeclaredInIntSubset // Indicates whether the entity was declared in the internal subset // or not. If not, it cannot be referred to from a standalone // document. // // fIsParameter // Indicates whether this is a parameter entity or a general entity. // // fIsSpecialChar // This indicates that its one of the special character entities, // e.g. lt or gt or amp. We need to know this because there are // places where only a numeric char ref or special char ref is valid // and all others are ignored or illegal. // ----------------------------------------------------------------------- bool fDeclaredInIntSubset; bool fIsParameter; bool fIsSpecialChar; }; // --------------------------------------------------------------------------- // DTDEntityDecl: Constructors and Destructor // --------------------------------------------------------------------------- inline DTDEntityDecl::DTDEntityDecl(MemoryManager* const manager) : XMLEntityDecl(manager) , fDeclaredInIntSubset(false) , fIsParameter(false) , fIsSpecialChar(false) { } inline DTDEntityDecl::DTDEntityDecl( const XMLCh* const entName , const bool fromIntSubset , MemoryManager* const manager) : XMLEntityDecl(entName, manager) , fDeclaredInIntSubset(fromIntSubset) , fIsParameter(false) , fIsSpecialChar(false) { } inline DTDEntityDecl::DTDEntityDecl( const XMLCh* const entName , const XMLCh* const value , const bool fromIntSubset , MemoryManager* const manager) : XMLEntityDecl(entName, value, manager) , fDeclaredInIntSubset(fromIntSubset) , fIsParameter(false) , fIsSpecialChar(false) { } inline DTDEntityDecl::DTDEntityDecl(const XMLCh* const entName , const XMLCh value , const bool fromIntSubset , const bool specialChar) : XMLEntityDecl(entName, value, XMLPlatformUtils::fgMemoryManager) , fDeclaredInIntSubset(fromIntSubset) , fIsParameter(false) , fIsSpecialChar(specialChar) { } inline DTDEntityDecl::~DTDEntityDecl() { } // --------------------------------------------------------------------------- // DTDEntityDecl: Getter methods // --------------------------------------------------------------------------- inline bool DTDEntityDecl::getDeclaredInIntSubset() const { return fDeclaredInIntSubset; } inline bool DTDEntityDecl::getIsParameter() const { return fIsParameter; } inline bool DTDEntityDecl::getIsSpecialChar() const { return fIsSpecialChar; } // --------------------------------------------------------------------------- // DTDEntityDecl: Setter methods // --------------------------------------------------------------------------- inline void DTDEntityDecl::setDeclaredInIntSubset(const bool newValue) { fDeclaredInIntSubset = newValue; } inline void DTDEntityDecl::setIsParameter(const bool newValue) { fIsParameter = newValue; } inline void DTDEntityDecl::setIsSpecialChar(const bool newValue) { fIsSpecialChar = newValue; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/DTD/DTDValidator.hpp000644 000765 000024 00000013001 13241160333 024032 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DTDValidator.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DTDVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_DTDVALIDATOR_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLMsgLoader; // // This is a derivative of the abstract validator interface. This class // implements a validator that supports standard XML 1.0 DTD semantics. // This class handles scanning the internal and external subsets of the // DTD, and provides the standard validation services against the DTD info // it found. // class VALIDATORS_EXPORT DTDValidator : public XMLValidator { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- DTDValidator(XMLErrorReporter* const errReporter = 0); virtual ~DTDValidator(); // ----------------------------------------------------------------------- // Implementation of the XMLValidator interface // ----------------------------------------------------------------------- virtual bool checkContent ( XMLElementDecl* const elemDecl , QName** const children , XMLSize_t childCount , XMLSize_t* indexFailingChild ); virtual void faultInAttr ( XMLAttr& toFill , const XMLAttDef& attDef ) const; virtual void preContentValidation(bool reuseGrammar, bool validateDefAttr = false); virtual void postParseValidation(); virtual void reset(); virtual bool requiresNamespaces() const; virtual void validateAttrValue ( const XMLAttDef* attDef , const XMLCh* const attrValue , bool preValidation = false , const XMLElementDecl* elemDecl = 0 ); virtual void validateElement ( const XMLElementDecl* elemDef ); virtual Grammar* getGrammar() const; virtual void setGrammar(Grammar* aGrammar); // ----------------------------------------------------------------------- // Virtual DTD handler interface. // ----------------------------------------------------------------------- virtual bool handlesDTD() const; // ----------------------------------------------------------------------- // Virtual Schema handler interface. handlesSchema() always return false. // ----------------------------------------------------------------------- virtual bool handlesSchema() const; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DTDValidator(const DTDValidator &); DTDValidator& operator = (const DTDValidator&); // ----------------------------------------------------------------------- // Helper // ----------------------------------------------------------------------- void checkTokenList(const XMLAttDef& attDef , bool toValidateNotation); // ----------------------------------------------------------------------- // Private data members // // fDTDGrammar // The DTD information stored. // // ----------------------------------------------------------------------- DTDGrammar* fDTDGrammar; }; // --------------------------------------------------------------------------- // Virtual interface // --------------------------------------------------------------------------- inline Grammar* DTDValidator::getGrammar() const { return fDTDGrammar; } inline void DTDValidator::setGrammar(Grammar* aGrammar) { fDTDGrammar = (DTDGrammar*) aGrammar; } inline void DTDValidator::validateElement (const XMLElementDecl*) { // no special DTD Element validation } // --------------------------------------------------------------------------- // DTDValidator: DTD handler interface // --------------------------------------------------------------------------- inline bool DTDValidator::handlesDTD() const { // We definitely want to handle DTD scanning return true; } // --------------------------------------------------------------------------- // DTDValidator: Schema handler interface // --------------------------------------------------------------------------- inline bool DTDValidator::handlesSchema() const { // No Schema scanning return false; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/DTD/XMLDTDDescriptionImpl.cpp000644 000765 000024 00000007353 13241160333 025603 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLDTDDescriptionImpl.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLDTDDescriptionImpl: constructor and destructor // --------------------------------------------------------------------------- XMLDTDDescriptionImpl::XMLDTDDescriptionImpl(const XMLCh* const systemId , MemoryManager* const memMgr ) :XMLDTDDescription(memMgr) ,fSystemId(0) ,fRootName(0) { if (systemId) fSystemId = XMLString::replicate(systemId, memMgr); } XMLDTDDescriptionImpl::~XMLDTDDescriptionImpl() { if (fSystemId) XMLGrammarDescription::getMemoryManager()->deallocate((void*)fSystemId); if (fRootName) XMLGrammarDescription::getMemoryManager()->deallocate((void*)fRootName); } const XMLCh* XMLDTDDescriptionImpl::getGrammarKey() const { return getSystemId(); } const XMLCh* XMLDTDDescriptionImpl::getRootName() const { return fRootName; } const XMLCh* XMLDTDDescriptionImpl::getSystemId() const { return fSystemId; } void XMLDTDDescriptionImpl::setRootName(const XMLCh* const rootName) { if (fRootName) { XMLGrammarDescription::getMemoryManager()->deallocate((void*)fRootName); fRootName = 0; } if (rootName) fRootName = XMLString::replicate(rootName, XMLGrammarDescription::getMemoryManager()); } void XMLDTDDescriptionImpl::setSystemId(const XMLCh* const systemId) { if (fSystemId) { XMLGrammarDescription::getMemoryManager()->deallocate((void*)fSystemId); fSystemId = 0; } if (systemId) fSystemId = XMLString::replicate(systemId, XMLGrammarDescription::getMemoryManager()); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(XMLDTDDescriptionImpl) void XMLDTDDescriptionImpl::serialize(XSerializeEngine& serEng) { XMLDTDDescription::serialize(serEng); if (serEng.isStoring()) { serEng.writeString(fSystemId); serEng.writeString(fRootName); } else { if (fSystemId) { XMLGrammarDescription::getMemoryManager()->deallocate((void*)fSystemId); } serEng.readString((XMLCh*&)fSystemId); //the original root name which came from the ctor needs deallocated if (fRootName) { XMLGrammarDescription::getMemoryManager()->deallocate((void*)fRootName); } serEng.readString((XMLCh*&)fRootName); } } XMLDTDDescriptionImpl::XMLDTDDescriptionImpl(MemoryManager* const memMgr) :XMLDTDDescription(memMgr) ,fSystemId(0) ,fRootName(0) { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/DTD/DTDAttDef.hpp000644 000765 000024 00000012102 13241160333 023255 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DTDAttDef.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DTDATTDEF_HPP) #define XERCESC_INCLUDE_GUARD_DTDATTDEF_HPP #include XERCES_CPP_NAMESPACE_BEGIN // // This class is a derivative of the core XMLAttDef class. This class adds // any DTD specific data members and provides DTD specific implementations // of any underlying attribute def virtual methods. // // In the DTD we don't do namespaces, so the attribute names are just the // QName literally from the DTD. This is what we return as the full name, // which is what is used to key these in any name keyed collections. // class VALIDATORS_EXPORT DTDAttDef : public XMLAttDef { public : // ----------------------------------------------------------------------- // Constructors and Destructors // ----------------------------------------------------------------------- DTDAttDef(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); DTDAttDef ( const XMLCh* const attName , const XMLAttDef::AttTypes type = CData , const XMLAttDef::DefAttTypes defType = Implied , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); DTDAttDef ( const XMLCh* const attName , const XMLCh* const attValue , const XMLAttDef::AttTypes type , const XMLAttDef::DefAttTypes defType , const XMLCh* const enumValues = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~DTDAttDef(); // ----------------------------------------------------------------------- // Implementation of the XMLAttDef interface // ----------------------------------------------------------------------- virtual const XMLCh* getFullName() const; //does nothing currently virtual void reset() {}; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- XMLSize_t getElemId() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setElemId(const XMLSize_t newId); void setName(const XMLCh* const newName); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(DTDAttDef) private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DTDAttDef(const DTDAttDef &); DTDAttDef& operator = (const DTDAttDef&); // ----------------------------------------------------------------------- // Private data members // // fElemId // This is the id of the element (the id is into the element decl // pool) of the element this attribute def said it belonged to. // This is used later to link back to the element, mostly for // validation purposes. // // fName // This is the name of the attribute. Since we don't do namespaces // in the DTD, its just the fully qualified name. // ----------------------------------------------------------------------- XMLSize_t fElemId; XMLCh* fName; }; // --------------------------------------------------------------------------- // DTDAttDef: Implementation of the XMLAttDef interface // --------------------------------------------------------------------------- inline const XMLCh* DTDAttDef::getFullName() const { return fName; } // --------------------------------------------------------------------------- // DTDAttDef: Getter methods // --------------------------------------------------------------------------- inline XMLSize_t DTDAttDef::getElemId() const { return fElemId; } // --------------------------------------------------------------------------- // DTDAttDef: Setter methods // --------------------------------------------------------------------------- inline void DTDAttDef::setElemId(const XMLSize_t newId) { fElemId = newId; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/DTD/DTDElementDecl.cpp000644 000765 000024 00000031156 13241160333 024274 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DTDElementDecl.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // DTDElementDecl: Constructors and Destructor // --------------------------------------------------------------------------- DTDElementDecl::DTDElementDecl(MemoryManager* const manager) : XMLElementDecl(manager) , fModelType(Any) , fAttDefs(0) , fAttList(0) , fContentSpec(0) , fContentModel(0) , fFormattedModel(0) { } DTDElementDecl::DTDElementDecl( const XMLCh* const elemRawName , const unsigned int uriId , const DTDElementDecl::ModelTypes type , MemoryManager* const manager) : XMLElementDecl(manager) , fModelType(type) , fAttDefs(0) , fAttList(0) , fContentSpec(0) , fContentModel(0) , fFormattedModel(0) { setElementName(elemRawName, uriId); } DTDElementDecl::DTDElementDecl( QName* const elementName , const DTDElementDecl::ModelTypes type , MemoryManager* const manager) : XMLElementDecl(manager) , fModelType(type) , fAttDefs(0) , fAttList(0) , fContentSpec(0) , fContentModel(0) , fFormattedModel(0) { setElementName(elementName); } DTDElementDecl::~DTDElementDecl() { delete fAttDefs; delete fAttList; delete fContentSpec; delete fContentModel; getMemoryManager()->deallocate(fFormattedModel);//delete [] fFormattedModel; } // --------------------------------------------------------------------------- // The virtual element decl interface // --------------------------------------------------------------------------- XMLAttDefList& DTDElementDecl::getAttDefList() const { if (!fAttList) { // If the att def list is not made yet, then fault it in too if (!fAttDefs) faultInAttDefList(); ((DTDElementDecl*)this)->fAttList = new (getMemoryManager()) DTDAttDefList(fAttDefs,getMemoryManager()); } return *fAttList; } XMLElementDecl::CharDataOpts DTDElementDecl::getCharDataOpts() const { XMLElementDecl::CharDataOpts retVal; switch(fModelType) { case Children : retVal = XMLElementDecl::SpacesOk; break; case Empty : retVal = XMLElementDecl::NoCharData; break; default : retVal = XMLElementDecl::AllCharData; break; } return retVal; } bool DTDElementDecl::hasAttDefs() const { // If the collection hasn't been faulted in, then no att defs if (!fAttDefs) return false; return !fAttDefs->isEmpty(); } void DTDElementDecl::setContentSpec(ContentSpecNode* toAdopt) { delete fContentSpec; fContentSpec = toAdopt; //reset Content Model setContentModel(0); } const XMLCh* DTDElementDecl::getFormattedContentModel() const { // // If its not already built, then call the protected virtual method // to allow the derived class to build it (since only it knows.) // Otherwise, just return the previously formatted methods. // // Since we are faulting this in, within a const getter, we have to // cast off the const-ness. // if (!fFormattedModel) ((DTDElementDecl*)this)->fFormattedModel = formatContentModel(); return fFormattedModel; } // --------------------------------------------------------------------------- // DTDElementDecl: Getter methods // --------------------------------------------------------------------------- const DTDAttDef* DTDElementDecl::getAttDef(const XMLCh* const attName) const { // If no list, then return a null if (!fAttDefs) return 0; return fAttDefs->get(attName); } DTDAttDef* DTDElementDecl::getAttDef(const XMLCh* const attName) { // If no list, then return a null if (!fAttDefs) return 0; return fAttDefs->get(attName); } // --------------------------------------------------------------------------- // DTDElementDecl: Implementation of the protected virtual interface // --------------------------------------------------------------------------- void DTDElementDecl::addAttDef(DTDAttDef* const toAdd) { // Fault in the att list if required if (!fAttDefs) faultInAttDefList(); // Tell this guy the element id of its parent (us) toAdd->setElemId(getId()); fAttDefs->put((void*)(toAdd->getFullName()), toAdd); // update and/or create fAttList if(!fAttList) ((DTDElementDecl*)this)->fAttList = new (getMemoryManager()) DTDAttDefList(fAttDefs,getMemoryManager()); fAttList->addAttDef(toAdd); } // --------------------------------------------------------------------------- // DTDElementDecl: Private helper methods // --------------------------------------------------------------------------- XMLCh* DTDElementDecl::formatContentModel() const { XMLCh* newValue = 0; if (fModelType == Any) { newValue = XMLString::replicate(XMLUni::fgAnyString, getMemoryManager()); } else if (fModelType == Empty) { newValue = XMLString::replicate(XMLUni::fgEmptyString, getMemoryManager()); } else { // // Use a temp XML buffer to format into. Content models could be // pretty long, but very few will be longer than one K. The buffer // will expand to handle the more pathological ones. // XMLBuffer bufFmt(1023, getMemoryManager()); getContentSpec()->formatSpec(bufFmt); newValue = XMLString::replicate(bufFmt.getRawBuffer(), getMemoryManager()); } return newValue; } XMLContentModel* DTDElementDecl::makeContentModel() { XMLContentModel* cmRet = 0; if (fModelType == Mixed_Simple) { // // Just create a mixel content model object. This type of // content model is optimized for mixed content validation. // cmRet = new (getMemoryManager()) MixedContentModel(true, this->getContentSpec(), false, getMemoryManager()); } else if (fModelType == Children) { // // This method will create an optimal model for the complexity // of the element's defined model. If its simple, it will create // a SimpleContentModel object. If its a simple list, it will // create a SimpleListContentModel object. If its complex, it // will create a DFAContentModel object. // cmRet = createChildModel(); } else { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_MustBeMixedOrChildren, getMemoryManager()); } return cmRet; } XMLContentModel* DTDElementDecl::createChildModel() { // Get the content spec node of the element ContentSpecNode* specNode = getContentSpec(); if(!specNode) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_UnknownCMSpecType, getMemoryManager()); // // Do a sanity check that the node does not have a PCDATA id. Since, // if it was, it should have already gotten taken by the Mixed model. // if (specNode->getElement()) { if (specNode->getElement()->getURI() == XMLElementDecl::fgPCDataElemId) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_NoPCDATAHere, getMemoryManager()); } // // According to the type of node, we will create the correct type of // content model. // if (specNode->getType() == ContentSpecNode::Leaf) { // Create a simple content model return new (getMemoryManager()) SimpleContentModel ( true , specNode->getElement() , 0 , ContentSpecNode::Leaf , getMemoryManager() ); } else if ((specNode->getType() == ContentSpecNode::Choice) || (specNode->getType() == ContentSpecNode::Sequence)) { // // Lets see if both of the children are leafs. If so, then it has to // be a simple content model // if ((specNode->getFirst()->getType() == ContentSpecNode::Leaf) && (specNode->getSecond()->getType() == ContentSpecNode::Leaf)) { return new (getMemoryManager()) SimpleContentModel ( true , specNode->getFirst()->getElement() , specNode->getSecond()->getElement() , specNode->getType() , getMemoryManager() ); } } else if ((specNode->getType() == ContentSpecNode::OneOrMore) || (specNode->getType() == ContentSpecNode::ZeroOrMore) || (specNode->getType() == ContentSpecNode::ZeroOrOne)) { // // Its a repetition, so see if its one child is a leaf. If so its a // repetition of a single element, so we can do a simple content // model for that. // if (specNode->getFirst()->getType() == ContentSpecNode::Leaf) { return new (getMemoryManager()) SimpleContentModel ( true , specNode->getFirst()->getElement() , 0 , specNode->getType() , getMemoryManager() ); } } else { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_UnknownCMSpecType, getMemoryManager()); } // Its not any simple type of content, so create a DFA based content model return new (getMemoryManager()) DFAContentModel ( true , this->getContentSpec() , getMemoryManager() ); } void DTDElementDecl::faultInAttDefList() const { // Use a hash modulus of 29 and tell it owns its elements ((DTDElementDecl*)this)->fAttDefs = new (getMemoryManager()) RefHashTableOf(29, true, getMemoryManager()); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(DTDElementDecl) void DTDElementDecl::serialize(XSerializeEngine& serEng) { XMLElementDecl::serialize(serEng); if (serEng.isStoring()) { serEng<<(int) fModelType; /*** * * Serialize RefHashTableOf * ***/ XTemplateSerializer::storeObject(fAttDefs, serEng); serEng<>i; fModelType=(ModelTypes)i; /*** * * Deserialize RefHashTableOf * ***/ XTemplateSerializer::loadObject(&fAttDefs, 29, true, serEng); serEng>>fAttList; serEng>>fContentSpec; /*** * don't deserialize * * XMLContentModel* fContentModel; * XMLCh* fFormattedModel; * ***/ fContentModel = 0; fFormattedModel = 0; } } XMLElementDecl::objectType DTDElementDecl::getObjectType() const { return DTD; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/DTD/DTDEntityDecl.cpp000644 000765 000024 00000003124 13241160333 024151 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DTDEntityDecl.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(DTDEntityDecl) void DTDEntityDecl::serialize(XSerializeEngine& serEng) { XMLEntityDecl::serialize(serEng); if (serEng.isStoring()) { serEng<>fDeclaredInIntSubset; serEng>>fIsParameter; serEng>>fIsSpecialChar; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/DTD/DTDValidator.cpp000644 000765 000024 00000053210 13241160333 024033 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DTDValidator.cpp 1517488 2013-08-26 10:33:26Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // DTDValidator: Constructors and Destructor // --------------------------------------------------------------------------- DTDValidator::DTDValidator(XMLErrorReporter* const errReporter) : XMLValidator(errReporter) , fDTDGrammar(0) { reset(); } DTDValidator::~DTDValidator() { } // --------------------------------------------------------------------------- // DTDValidator: Implementation of the XMLValidator interface // --------------------------------------------------------------------------- bool DTDValidator::checkContent(XMLElementDecl* const elemDecl , QName** const children , XMLSize_t childCount , XMLSize_t* indexFailingChild) { // // Look up the element id in our element decl pool. This will get us // the element decl in our own way of looking at them. // if (!elemDecl) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Val_InvalidElemId, getScanner()->getMemoryManager()); // // Get the content spec type of this element. This will tell us what // to do to validate it. // const DTDElementDecl::ModelTypes modelType = ((DTDElementDecl*) elemDecl)->getModelType(); if (modelType == DTDElementDecl::Empty) { // // We can do this one here. It cannot have any children. If it does // we return 0 as the index of the first bad child. // if (childCount) { *indexFailingChild=0; return false; } } else if (modelType == DTDElementDecl::Any) { // We pass no judgement on this one, anything goes } else if ((modelType == DTDElementDecl::Mixed_Simple) || (modelType == DTDElementDecl::Children)) { // Get the element's content model or fault it in const XMLContentModel* elemCM = elemDecl->getContentModel(); // Ask it to validate and return its return return elemCM->validateContent(children, childCount, getScanner()->getEmptyNamespaceId(), indexFailingChild, getScanner()->getMemoryManager()); } else { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_UnknownCMType, getScanner()->getMemoryManager()); } // Went ok, so return success return true; } void DTDValidator::faultInAttr(XMLAttr& toFill, const XMLAttDef& attDef) const { toFill.set(0, attDef.getFullName(), attDef.getValue(), attDef.getType()); } void DTDValidator::reset() { } bool DTDValidator::requiresNamespaces() const { // Namespaces are not supported for DTDs return false; } void DTDValidator::validateAttrValue(const XMLAttDef* attDef , const XMLCh* const attrValue , bool preValidation , const XMLElementDecl*) { // // Get quick refs to lost of of the stuff in the passed objects in // order to simplify the code below, which will reference them very // often. // const XMLAttDef::AttTypes type = attDef->getType(); const XMLAttDef::DefAttTypes defType = attDef->getDefaultType(); const XMLCh* const valueText = attDef->getValue(); const XMLCh* const fullName = attDef->getFullName(); const XMLCh* const enumList = attDef->getEnumeration(); const bool isExternal = attDef->isExternal(); // // If the default type is fixed, then make sure the passed value maps // to the fixed value. // If during preContentValidation, the value we are validating is the fixed value itself // so no need to compare. // Only need to do this for regular attribute value validation // if (defType == XMLAttDef::Fixed && !preValidation) { if (!XMLString::equals(attrValue, valueText)) emitError(XMLValid::NotSameAsFixedValue, fullName, attrValue, valueText); } // // If its a CDATA attribute, then we are done with any DTD level // validation else do the rest. // if (type == XMLAttDef::CData) return; // An empty string cannot be valid for any of the other types if (!attrValue[0]) { emitError(XMLValid::InvalidEmptyAttValue, fullName); return; } // See whether we are doing multiple values or not const bool multipleValues = ( (type == XMLAttDef::IDRefs) || (type == XMLAttDef::Entities) || (type == XMLAttDef::NmTokens) || (type == XMLAttDef::Notation) || (type == XMLAttDef::Enumeration) ); // And whether we must check for a first name char const bool firstNameChar = ( (type == XMLAttDef::ID) || (type == XMLAttDef::IDRef) || (type == XMLAttDef::IDRefs) || (type == XMLAttDef::Entity) || (type == XMLAttDef::Entities) || (type == XMLAttDef::Notation) ); // Whether it requires ref checking stuff const bool isARefType ( (type == XMLAttDef::ID) || (type == XMLAttDef::IDRef) || (type == XMLAttDef::IDRefs) ); // Some trigger flags to avoid issuing redundant errors and whatnot bool alreadyCapped = false; // // Make a copy of the text that we can mangle and get a pointer we can // move through the value // // Use a stack-based buffer, when possible... XMLCh tempBuffer[100]; XMLCh* pszTmpVal = 0; ArrayJanitor janTmpVal(0); if (XMLString::stringLen(attrValue) < sizeof(tempBuffer) / sizeof(tempBuffer[0])) { XMLString::copyString(tempBuffer, attrValue); pszTmpVal = tempBuffer; } else { janTmpVal.reset(XMLString::replicate(attrValue, getScanner()->getMemoryManager()), getScanner()->getMemoryManager()); pszTmpVal = janTmpVal.get(); } // if the type is an enumeration, normalize it, unless standalone = yes is specified // "The standalone document declaration MUST have the value "no" if any external markup declarations contain declarations of: // - ... // - attributes with tokenized types, where the attribute appears in the document with a value such that normalization will // produce a different value from that which would be produced in the absence of the declaration" if (multipleValues && (!isExternal || !getScanner()->getStandalone())) XMLString::collapseWS(pszTmpVal, getScanner()->getMemoryManager()); XMLCh* valPtr = pszTmpVal; bool doNamespace = getScanner()->getDoNamespaces(); while (true) { // // Make sure the first character is a valid first name char, i.e. // if its a Name value. For NmToken values we don't treat the first // char any differently. // if (firstNameChar) { // If its not, emit and error but try to keep going if (!getReaderMgr()->getCurrentReader()->isFirstNameChar(*valPtr)) emitError(XMLValid::AttrValNotName, valPtr, fullName); valPtr++; } // Make sure all the remaining chars are valid name chars while (*valPtr) { // // If we hit a whitespace, its either a break between two // or more values, or an error if we have a single value. // // // XML1.0-3rd // // [6] Names ::= Name (#x20 Name)* // [8] Nmtokens ::= Nmtoken (#x20 Nmtoken)* // // only and only ONE #x20 is allowed to be the delimiter // if (*valPtr==chSpace) { if (!multipleValues) { emitError(XMLValid::NoMultipleValues, fullName); return; } break; } // Now this attribute can be of type // ID, IDREF, IDREFS, ENTITY, ENTITIES, NOTATION, NMTOKEN, NMTOKENS, ENUMERATION // All these must be valid XMLName // If namespace is enabled, colon is not allowed in the first 6 if (doNamespace && *valPtr == chColon && firstNameChar) emitError(XMLValid::ColonNotValidWithNS); if (!getReaderMgr()->getCurrentReader()->isNameChar(*valPtr)) { emitError(XMLValid::AttrValNotName, valPtr, fullName); return; } valPtr++; } // // Cap it off at the current non-name char. If already capped, // then remember this. // if (!(*valPtr)) alreadyCapped = true; *valPtr = 0; // // If this type of attribute requires that we track reference // stuff, then handle that. // if (isARefType) { if ((type == XMLAttDef::ID) || (type == XMLAttDef::IDRef) || (type == XMLAttDef::IDRefs)) { XMLRefInfo* find = getScanner()->getIDRefList()->get(pszTmpVal); if (find) { if (find->getDeclared() && (type == XMLAttDef::ID)) emitError(XMLValid::ReusedIDValue, pszTmpVal); } else { find = new (getScanner()->getMemoryManager()) XMLRefInfo ( pszTmpVal , false , false , getScanner()->getMemoryManager() ); getScanner()->getIDRefList()->put((void*)find->getRefName(), find); } // // Mark it declared or used, which might be redundant in some cases // but not worth checking // if (type == XMLAttDef::ID) find->setDeclared(true); else { if (!preValidation) { find->setUsed(true); } } } } else if (!preValidation && ((type == XMLAttDef::Entity) || (type == XMLAttDef::Entities))) { // // If its refering to a entity, then look up the name in the // general entity pool. If not there, then its an error. If its // not an external unparsed entity, then its an error. // // In case of pre-validation, the above errors should be ignored. // const XMLEntityDecl* decl = fDTDGrammar->getEntityDecl(pszTmpVal); if (decl) { if (!decl->isUnparsed()) emitError(XMLValid::BadEntityRefAttr, pszTmpVal, fullName); } else { emitError ( XMLValid::UnknownEntityRefAttr , fullName , pszTmpVal ); } } else if ((type == XMLAttDef::Notation) || (type == XMLAttDef::Enumeration)) { // // Make sure that this value maps to one of the enumeration or // notation values in the enumList parameter. We don't have to // look it up in the notation pool (if a notation) because we // will look up the enumerated values themselves. If they are in // the notation pool (after the DTD is parsed), then obviously // this value will be legal since it matches one of them. // if (!XMLString::isInList(pszTmpVal, enumList)) emitError(XMLValid::DoesNotMatchEnumList, pszTmpVal, fullName); } // If not doing multiple values, then we are done if (!multipleValues) break; // // If we are at the end, then break out now, else move up to the // next char and update the base pointer. // if (alreadyCapped) break; valPtr++; pszTmpVal = valPtr; } } void DTDValidator::preContentValidation(bool #if defined(XERCES_DEBUG) reuseGrammar #endif ,bool validateDefAttr) { // // Lets enumerate all of the elements in the element decl pool // and put out an error for any that did not get declared. // We also check all of the attributes as well. // NameIdPoolEnumerator elemEnum = fDTDGrammar->getElemEnumerator(); fDTDGrammar->setValidated(true); while (elemEnum.hasMoreElements()) { const DTDElementDecl& curElem = elemEnum.nextElement(); const DTDElementDecl::CreateReasons reason = curElem.getCreateReason(); // // See if this element decl was ever marked as declared. If // not, then put out an error. In some cases its just // a warning, such as being referenced in a content model. // if (reason != XMLElementDecl::Declared) { if (reason == XMLElementDecl::AttList) { getScanner()->emitError ( XMLErrs::UndeclaredElemInAttList , curElem.getFullName() ); } else if (reason == XMLElementDecl::AsRootElem) { // It's ok that the root element is not declared in the DTD /* emitError ( XMLValid::UndeclaredElemInDocType , curElem.getFullName() );*/ } else if (reason == XMLElementDecl::InContentModel) { getScanner()->emitError ( XMLErrs::UndeclaredElemInCM , curElem.getFullName() ); } else { #if defined(XERCES_DEBUG) if(reuseGrammar && reason == XMLElementDecl::JustFaultIn){ } else ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::DTD_UnknownCreateReason, getScanner()->getMemoryManager()); #endif } } // // Check all of the attributes of the current element. // We check for: // // 1) Multiple ID attributes // 2) That all of the default values of attributes are // valid for their type. // 3) That for any notation types, that their lists // of possible values refer to declared notations. // // 4) XML1.0(3rd edition) // // Validity constraint: One Notation Per Element Type // An element type MUST NOT have more than one NOTATION attribute specified. // // Validity constraint: No Notation on Empty Element // For compatibility, an attribute of type NOTATION MUST NOT be declared on an element declared EMPTY. // // Validity constraint: No Duplicate Tokens // The notation names in a single NotationType attribute declaration, as well as // the NmTokens in a single Enumeration attribute declaration, MUST all be distinct. // XMLAttDefList& attDefList = curElem.getAttDefList(); bool seenId = false; bool seenNOTATION = false; bool elemEmpty = (curElem.getModelType() == DTDElementDecl::Empty); for(XMLSize_t i=0; i entEnum = fDTDGrammar->getEntityEnumerator(); while (entEnum.hasMoreElements()) { const DTDEntityDecl& curEntity = entEnum.nextElement(); if (!curEntity.getNotationName()) continue; // It has a notation name, so look it up if (!fDTDGrammar->getNotationDecl(curEntity.getNotationName())) { emitError ( XMLValid::NotationNotDeclared , curEntity.getNotationName() ); } } } void DTDValidator::postParseValidation() { // // At this time, there is nothing to do here. The scanner itself handles // ID/IDREF validation, since that is the same no matter what kind of // validator. // } // // We need to verify that all of its possible values // (in the enum list) // is distinct and // refer to valid notations if toValidateNotation is set on // void DTDValidator::checkTokenList(const XMLAttDef& curAttDef , bool toValidateNotation) { XMLCh* list = XMLString::replicate(curAttDef.getEnumeration(), getScanner()->getMemoryManager()); ArrayJanitor janList(list, getScanner()->getMemoryManager()); // // Search forward for a space or a null. If a null, // we are done. If a space, cap it and look it up. // bool breakFlag = false; XMLCh* listPtr = list; XMLCh* lastPtr = listPtr; while (true) { while (*listPtr && (*listPtr != chSpace)) listPtr++; // // If at the end, indicate we need to break after // this one. Else, cap it off here. // if (!*listPtr) breakFlag = true; else *listPtr++ = chNull; //distinction check //there should be no same token found in the remaining list if (XMLString::isInList(lastPtr, listPtr)) { emitError ( XMLValid::AttrDupToken , curAttDef.getFullName() , lastPtr ); } if (toValidateNotation && !fDTDGrammar->getNotationDecl(lastPtr)) { emitError ( XMLValid::UnknownNotRefAttr , curAttDef.getFullName() , lastPtr ); } // Break out if we hit the end last time if (breakFlag) break; // Else move upwards and try again lastPtr = listPtr; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/DTD/DTDGrammar.cpp000644 000765 000024 00000020550 13241160333 023475 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DTDGrammar.cpp 676911 2008-07-15 13:27:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // DTDGrammar: Static member data // --------------------------------------------------------------------------- NameIdPool* DTDGrammar::fDefaultEntities = 0; void XMLInitializer::initializeDTDGrammar() { DTDGrammar::fDefaultEntities = new NameIdPool(11, 12); // Add the default entity entries for the character refs that must // always be present. We indicate that they are from the internal // subset. They aren't really, but they have to look that way so // that they are still valid for use within a standalone document. // // We also mark them as special char entities, which allows them // to be used in places whether other non-numeric general entities // cannot. // if (DTDGrammar::fDefaultEntities) { DTDGrammar::fDefaultEntities->put(new DTDEntityDecl(XMLUni::fgAmp, chAmpersand, true, true)); DTDGrammar::fDefaultEntities->put(new DTDEntityDecl(XMLUni::fgLT, chOpenAngle, true, true)); DTDGrammar::fDefaultEntities->put(new DTDEntityDecl(XMLUni::fgGT, chCloseAngle, true, true)); DTDGrammar::fDefaultEntities->put(new DTDEntityDecl(XMLUni::fgQuot, chDoubleQuote, true, true)); DTDGrammar::fDefaultEntities->put(new DTDEntityDecl(XMLUni::fgApos, chSingleQuote, true, true)); } } void XMLInitializer::terminateDTDGrammar() { delete DTDGrammar::fDefaultEntities; DTDGrammar::fDefaultEntities = 0; } //--------------------------------------------------------------------------- // DTDGrammar: Constructors and Destructor // --------------------------------------------------------------------------- DTDGrammar::DTDGrammar(MemoryManager* const manager) : fMemoryManager(manager) , fElemDeclPool(0) , fElemNonDeclPool(0) , fEntityDeclPool(0) , fNotationDeclPool(0) , fGramDesc(0) , fValidated(false) { // // Init all the pool members. // // Investigate what the optimum values would be for the various // pools. // fElemDeclPool = new (fMemoryManager) NameIdPool(109, 128, fMemoryManager); // should not need this in the common situation where grammars // are built once and then read - NG //fElemNonDeclPool = new (fMemoryManager) NameIdPool(29, 128, fMemoryManager); fEntityDeclPool = new (fMemoryManager) NameIdPool(109, 128, fMemoryManager); fNotationDeclPool = new (fMemoryManager) NameIdPool(109, 128, fMemoryManager); //REVISIT: use grammarPool to create fGramDesc = new (fMemoryManager) XMLDTDDescriptionImpl(XMLUni::fgDTDEntityString, fMemoryManager); } DTDGrammar::~DTDGrammar() { delete fElemDeclPool; if(fElemNonDeclPool) { delete fElemNonDeclPool; } delete fEntityDeclPool; delete fNotationDeclPool; delete fGramDesc; } // ----------------------------------------------------------------------- // Virtual methods // ----------------------------------------------------------------------- XMLElementDecl* DTDGrammar::findOrAddElemDecl (const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const , const XMLCh* const qName , unsigned int scope , bool& wasAdded ) { // See it it exists DTDElementDecl* retVal = (DTDElementDecl*) getElemDecl(uriId, baseName, qName, scope); // if not, then add this in if (!retVal) { retVal = new (fMemoryManager) DTDElementDecl ( qName , uriId , DTDElementDecl::Any , fMemoryManager ); if(!fElemNonDeclPool) fElemNonDeclPool = new (fMemoryManager) NameIdPool(29, 128, fMemoryManager); const XMLSize_t elemId = fElemNonDeclPool->put(retVal); retVal->setId(elemId); wasAdded = true; } else { wasAdded = false; } return retVal; } XMLElementDecl* DTDGrammar::putElemDecl (const unsigned int uriId , const XMLCh* const , const XMLCh* const , const XMLCh* const qName , unsigned int , const bool notDeclared) { DTDElementDecl* retVal = new (fMemoryManager) DTDElementDecl ( qName , uriId , DTDElementDecl::Any , fMemoryManager ); if(notDeclared) { if(!fElemNonDeclPool) fElemNonDeclPool = new (fMemoryManager) NameIdPool(29, 128, fMemoryManager); retVal->setId(fElemNonDeclPool->put(retVal)); } else { retVal->setId(fElemDeclPool->put(retVal)); } return retVal; } void DTDGrammar::reset() { // // We need to reset all of the pools. // fElemDeclPool->removeAll(); // now that we have this, no point in deleting it... if(fElemNonDeclPool) fElemNonDeclPool->removeAll(); fNotationDeclPool->removeAll(); fEntityDeclPool->removeAll(); fValidated = false; } void DTDGrammar::setGrammarDescription( XMLGrammarDescription* gramDesc) { if ((!gramDesc) || (gramDesc->getGrammarType() != Grammar::DTDGrammarType)) return; if (fGramDesc) delete fGramDesc; //adopt the grammar Description fGramDesc = (XMLDTDDescription*) gramDesc; } XMLGrammarDescription* DTDGrammar::getGrammarDescription() const { return fGramDesc; } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(DTDGrammar) void DTDGrammar::serialize(XSerializeEngine& serEng) { Grammar::serialize(serEng); //don't serialize fDefaultEntities if (serEng.isStoring()) { /*** * * Serialize NameIdPool* fElemDeclPool; * Serialize NameIdPool* fEntityDeclPool; * Serialize NameIdPool* fNotationDeclPool; ***/ XTemplateSerializer::storeObject(fElemDeclPool, serEng); XTemplateSerializer::storeObject(fEntityDeclPool, serEng); XTemplateSerializer::storeObject(fNotationDeclPool, serEng); /*** * serialize() method shall be used to store object * which has been created in ctor ***/ fGramDesc->serialize(serEng); serEng<* fElemDeclPool; * Deserialize NameIdPool* fEntityDeclPool; * Deerialize NameIdPool* fNotationDeclPool; ***/ XTemplateSerializer::loadObject(&fElemDeclPool, 109, 128, serEng); fElemNonDeclPool = 0; XTemplateSerializer::loadObject(&fEntityDeclPool, 109, 128, serEng); XTemplateSerializer::loadObject(&fNotationDeclPool, 109, 128, serEng); /*** * serialize() method shall be used to load object * which has been created in ctor ***/ fGramDesc->serialize(serEng); serEng>>fValidated; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/DTD/DTDScanner.hpp000644 000765 000024 00000023073 13241160333 023510 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DTDScanner.hpp 1799527 2017-06-21 22:32:05Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_DTDSCANNER_HPP) #define XERCESC_INCLUDE_GUARD_DTDSCANNER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLScanner; /* * Default implementation of an XML DTD scanner. */ class DocTypeHandler; class VALIDATORS_EXPORT DTDScanner : public XMemory { public: // ----------------------------------------------------------------------- // Class specific types // // EntityExpRes // Returned from scanEntityRef() to indicate how the expanded text // was treated. // // IDTypes // Type of the ID // ----------------------------------------------------------------------- enum EntityExpRes { EntityExp_Failed , EntityExp_Pushed , EntityExp_Returned }; enum IDTypes { IDType_Public , IDType_External , IDType_Either }; // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- DTDScanner ( DTDGrammar* dtdGrammar , DocTypeHandler* const docTypeHandler , MemoryManager* const grammarPoolMemoryManager , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~DTDScanner(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- DocTypeHandler* getDocTypeHandler(); const DocTypeHandler* getDocTypeHandler() const; // ----------------------------------------------------------------------- // Setter methods // // setScannerInfo() is called by the scanner to tell the DTDScanner // about the stuff it needs to have access to. // ----------------------------------------------------------------------- void setScannerInfo ( XMLScanner* const owningScanner , ReaderMgr* const readerMgr , XMLBufferMgr* const bufMgr ); void setDocTypeHandler ( DocTypeHandler* const handlerToSet ); void scanExtSubsetDecl(const bool inIncludeSect, const bool isDTD); bool scanInternalSubset(); bool scanId ( XMLBuffer& pubIdToFill , XMLBuffer& sysIdToFill , const IDTypes whatKind ); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DTDScanner(const DTDScanner &); DTDScanner& operator = (const DTDScanner&); // ----------------------------------------------------------------------- // Private DTD scanning methods. These are all in XMLValidator2.cpp // ----------------------------------------------------------------------- bool checkForPERef ( const bool inLiteral , const bool inMarkup ); bool expandPERef ( const bool scanExternal , const bool inLiteral , const bool inMarkup , const bool throwEndOfExt = false ); bool getQuotedString(XMLBuffer& toFill); XMLAttDef* scanAttDef(DTDElementDecl& elemDecl, XMLBuffer& bufToUse); bool scanAttValue ( const XMLCh* const attrName , XMLBuffer& toFill , const XMLAttDef::AttTypes type ); void scanAttListDecl(); ContentSpecNode* scanChildren ( const DTDElementDecl& elemDecl , XMLBuffer& bufToUse , unsigned int& depth ); bool scanCharRef(XMLCh& toFill, XMLCh& second); void scanComment(); bool scanContentSpec(DTDElementDecl& toFill); void scanDefaultDecl(DTDAttDef& toFill); void scanElementDecl(); void scanEntityDecl(); bool scanEntityDef(); bool scanEntityLiteral(XMLBuffer& toFill); bool scanEntityDef(DTDEntityDecl& decl, const bool isPEDecl); EntityExpRes scanEntityRef(XMLCh& firstCh, XMLCh& secondCh, bool& escaped); bool scanEnumeration ( const DTDAttDef& attDef , XMLBuffer& toFill , const bool notation ); bool scanEq(); void scanIgnoredSection(); void scanMarkupDecl(const bool parseTextDecl); bool scanMixed(DTDElementDecl& toFill); void scanNotationDecl(); void scanPI(); bool scanPublicLiteral(XMLBuffer& toFill); bool scanSystemLiteral(XMLBuffer& toFill); void scanTextDecl(); bool isReadingExternalEntity(); // ----------------------------------------------------------------------- // Private data members // // fDocTypeHandler // This holds the optional doc type handler that can be installed // and used to call back for all markup events. It is DTD specific. // // fDumAttDef // fDumElemDecl // fDumEntityDecl // These are dummy objects into which mark decls are parsed when // they are just overrides of previously declared markup decls. In // such situations, the first one wins but we need to have somewhere // to parse them into. So these are lazily created and used as needed // when such markup decls are seen. // // fInternalSubset // This is used to track whether we are in the internal subset or not, // in which case we are in the external subset. // // fNextAttrId // Since att defs are per-element, we don't have a validator wide // attribute def pool. So we use a simpler data structure in each // element decl to store its att defs, and we use this simple counter // to apply a unique id to each new attribute. // // fDTDGrammar // The DTD information we scanned like element decl, attribute decl // are stored in this Grammar. // // fBufMgr // This is the buffer manager of the scanner. This is provided as a // convenience so that the DTDScanner doesn't have to create its own // buffer manager during the parse process. // // fReaderMgr // This is a pointer to the reader manager that is being used by the scanner. // // fScanner // The pointer to the scanner to which this DTDScanner belongs // // fPEntityDeclPool // This is a pool of EntityDecl objects, which contains all of the // parameter entities that are declared in the DTD subsets. // // fEmptyNamespaceId // The uri for all DTD decls // // fDocTypeReaderId // The original reader in the fReaderMgr - to be compared against the // current reader to decide whether we are processing an external/internal // declaration // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; MemoryManager* fGrammarPoolMemoryManager; DocTypeHandler* fDocTypeHandler; DTDAttDef* fDumAttDef; DTDElementDecl* fDumElemDecl; DTDEntityDecl* fDumEntityDecl; bool fInternalSubset; unsigned int fNextAttrId; DTDGrammar* fDTDGrammar; XMLBufferMgr* fBufMgr; ReaderMgr* fReaderMgr; XMLScanner* fScanner; NameIdPool* fPEntityDeclPool; unsigned int fEmptyNamespaceId; XMLSize_t fDocTypeReaderId; }; // --------------------------------------------------------------------------- // DTDScanner: Getter methods // --------------------------------------------------------------------------- inline DocTypeHandler* DTDScanner::getDocTypeHandler() { return fDocTypeHandler; } inline const DocTypeHandler* DTDScanner::getDocTypeHandler() const { return fDocTypeHandler; } // --------------------------------------------------------------------------- // DTDScanner: Setter methods // --------------------------------------------------------------------------- inline void DTDScanner::setDocTypeHandler(DocTypeHandler* const handlerToSet) { fDocTypeHandler = handlerToSet; } // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- inline bool DTDScanner::isReadingExternalEntity() { return (fDocTypeReaderId != fReaderMgr->getCurrentReaderNum()); } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/DTD/DTDAttDefList.hpp000644 000765 000024 00000012651 13241160333 024122 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DTDAttDefList.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DTDATTDEFLIST_HPP) #define XERCESC_INCLUDE_GUARD_DTDATTDEFLIST_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN // // This is a derivative of the framework abstract class which defines the // interface to a list of attribute defs that belong to a particular // element. The scanner needs to be able to get a list of the attributes // that an element supports, for use during the validation process and for // fixed/default attribute processing. // // Since each validator can store attributes differently, this abstract // interface allows each validator to provide an implementation of this // data structure that works best for it. // // For us, we just wrap the RefHashTableOf collection that the DTDElementDecl // class uses to store the attributes that belong to it. // // This clss does not adopt the hash table, it just references it. The // hash table is owned by the element decl it is a member of. // class VALIDATORS_EXPORT DTDAttDefList : public XMLAttDefList { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- DTDAttDefList ( RefHashTableOf* const listToUse, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~DTDAttDefList(); // ----------------------------------------------------------------------- // Implementation of the virtual interface // ----------------------------------------------------------------------- virtual bool isEmpty() const; virtual XMLAttDef* findAttDef ( const unsigned int uriID , const XMLCh* const attName ); virtual const XMLAttDef* findAttDef ( const unsigned int uriID , const XMLCh* const attName ) const; virtual XMLAttDef* findAttDef ( const XMLCh* const attURI , const XMLCh* const attName ); virtual const XMLAttDef* findAttDef ( const XMLCh* const attURI , const XMLCh* const attName ) const; /** * return total number of attributes in this list */ virtual XMLSize_t getAttDefCount() const ; /** * return attribute at the index-th position in the list. */ virtual XMLAttDef &getAttDef(XMLSize_t index) ; /** * return attribute at the index-th position in the list. */ virtual const XMLAttDef &getAttDef(XMLSize_t index) const ; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(DTDAttDefList) DTDAttDefList(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); private : void addAttDef(DTDAttDef *toAdd); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DTDAttDefList(const DTDAttDefList &); DTDAttDefList& operator = (const DTDAttDefList&); // ----------------------------------------------------------------------- // Private data members // // fEnum // This is an enerator for the list that we use to do the enumerator // type methods of this class. // // fList // The list of DTDAttDef objects that represent the attributes that // a particular element supports. // fArray // vector of pointers to the DTDAttDef objects contained in this list // fSize // size of fArray // fCount // number of DTDAttDef objects currently stored in this list // ----------------------------------------------------------------------- RefHashTableOfEnumerator* fEnum; RefHashTableOf* fList; DTDAttDef** fArray; XMLSize_t fSize; XMLSize_t fCount; friend class DTDElementDecl; }; inline void DTDAttDefList::addAttDef(DTDAttDef *toAdd) { if(fCount == fSize) { // need to grow fArray fSize <<= 1; DTDAttDef** newArray = (DTDAttDef **)((getMemoryManager())->allocate( sizeof(DTDAttDef*) * fSize )); memcpy(newArray, fArray, fCount * sizeof(DTDAttDef *)); (getMemoryManager())->deallocate(fArray); fArray = newArray; } fArray[fCount++] = toAdd; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/common/CMAny.cpp000644 000765 000024 00000007325 13241160333 023404 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: CMAny.cpp 677396 2008-07-16 19:36:20Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // CMUnaryOp: Constructors and Destructor // --------------------------------------------------------------------------- CMAny::CMAny( ContentSpecNode::NodeTypes type , unsigned int URI , unsigned int position , unsigned int maxStates , MemoryManager* const manager) : CMNode(type, maxStates, manager) , fURI(URI) , fPosition(position) { if ((type & 0x0f) != ContentSpecNode::Any && (type & 0x0f) != ContentSpecNode::Any_Other && (type & 0x0f) != ContentSpecNode::Any_NS) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::CM_NotValidSpecTypeForNode, "CMAny", manager); } // Leaf nodes are never nullable unless its an epsilon node fIsNullable=(fPosition == epsilonNode); } CMAny::~CMAny() { } // --------------------------------------------------------------------------- // Getter methods // --------------------------------------------------------------------------- unsigned int CMAny::getURI() const { return fURI; } unsigned int CMAny::getPosition() const { return fPosition; } // --------------------------------------------------------------------------- // Setter methods // --------------------------------------------------------------------------- void CMAny::setPosition(const unsigned int newPosition) { fPosition = newPosition; } // --------------------------------------------------------------------------- // Implementation of public CMNode virtual interface // --------------------------------------------------------------------------- void CMAny::orphanChild() { } // --------------------------------------------------------------------------- // Implementation of protected CMNode virtual interface // --------------------------------------------------------------------------- void CMAny::calcFirstPos(CMStateSet& toSet) const { // If we are an epsilon node, then the first pos is an empty set if (isNullable()) toSet.zeroBits(); else // Otherwise, its just the one bit of our position toSet.setBit(fPosition); } void CMAny::calcLastPos(CMStateSet& toSet) const { // If we are an epsilon node, then the last pos is an empty set if (isNullable()) toSet.zeroBits(); // Otherwise, its just the one bit of our position else toSet.setBit(fPosition); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/common/CMStateSet.hpp000644 000765 000024 00000055713 13241160333 024422 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: CMStateSet.hpp 1798777 2017-06-14 21:37:39Z rleigh $ */ #if !defined(XERCESC_INCLUDE_GUARD_CMSTATESET_HPP) #define XERCESC_INCLUDE_GUARD_CMSTATESET_HPP // DESCRIPTION: // // This class is a specialized bitset class for the content model code of // the validator. It assumes that its never called with two objects of // different bit counts, and that bit sets smaller than a threshold are far // and away the most common. So it can be a lot more optimized than a general // purpose utility bitset class // #include #include #include #include #include #if XERCES_HAVE_EMMINTRIN_H # include #endif XERCES_CPP_NAMESPACE_BEGIN class CMStateSetEnumerator; // This value must be 4 in order to use the SSE2 instruction set #define CMSTATE_CACHED_INT32_SIZE 4 // This value must be a multiple of 128 in order to use the SSE2 instruction set #define CMSTATE_BITFIELD_CHUNK 1024 #define CMSTATE_BITFIELD_INT32_SIZE (1024 / 32) struct CMDynamicBuffer { // fArraySize // This indicates the number of elements of the fBitArray vector // // fBitArray // A vector of arrays of XMLInt32; each array is allocated on demand // if a bit needs to be set in that range // // fMemoryManager // The memory manager used to allocate and deallocate memory // XMLSize_t fArraySize; XMLInt32** fBitArray; MemoryManager* fMemoryManager; }; class CMStateSet : public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- CMStateSet( const XMLSize_t bitCount , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) : fBitCount(bitCount) , fDynamicBuffer(0) { // // See if we need to allocate the byte array or whether we can live // within the cached bit high performance scheme. // if (fBitCount > (CMSTATE_CACHED_INT32_SIZE * 32)) { fDynamicBuffer = (CMDynamicBuffer*)manager->allocate(sizeof(CMDynamicBuffer)); fDynamicBuffer->fMemoryManager = manager; // allocate an array of vectors, each one containing CMSTATE_BITFIELD_CHUNK bits fDynamicBuffer->fArraySize = fBitCount / CMSTATE_BITFIELD_CHUNK; if (fBitCount % CMSTATE_BITFIELD_CHUNK) fDynamicBuffer->fArraySize++; fDynamicBuffer->fBitArray = (XMLInt32**) fDynamicBuffer->fMemoryManager->allocate(fDynamicBuffer->fArraySize*sizeof(XMLInt32*)); for(XMLSize_t index = 0; index < fDynamicBuffer->fArraySize; index++) fDynamicBuffer->fBitArray[index]=NULL; } else { for (XMLSize_t index = 0; index < CMSTATE_CACHED_INT32_SIZE; index++) fBits[index] = 0; } } CMStateSet(const CMStateSet& toCopy) : XMemory(toCopy) , fBitCount(toCopy.fBitCount) , fDynamicBuffer(0) { // // See if we need to allocate the byte array or whether we can live // within the cahced bit high performance scheme. // if (fBitCount > (CMSTATE_CACHED_INT32_SIZE * 32)) { fDynamicBuffer = (CMDynamicBuffer*) toCopy.fDynamicBuffer->fMemoryManager->allocate(sizeof(CMDynamicBuffer)); fDynamicBuffer->fMemoryManager = toCopy.fDynamicBuffer->fMemoryManager; fDynamicBuffer->fArraySize = fBitCount / CMSTATE_BITFIELD_CHUNK; if (fBitCount % CMSTATE_BITFIELD_CHUNK) fDynamicBuffer->fArraySize++; fDynamicBuffer->fBitArray = (XMLInt32**) fDynamicBuffer->fMemoryManager->allocate(fDynamicBuffer->fArraySize*sizeof(XMLInt32*)); for(XMLSize_t index = 0; index < fDynamicBuffer->fArraySize; index++) { if(toCopy.fDynamicBuffer->fBitArray[index]!=NULL) { allocateChunk(index); memcpy((void *) fDynamicBuffer->fBitArray[index], (const void *) toCopy.fDynamicBuffer->fBitArray[index], CMSTATE_BITFIELD_INT32_SIZE * sizeof(XMLInt32)); } else fDynamicBuffer->fBitArray[index]=NULL; } } else { memcpy((void *) fBits, (const void *) toCopy.fBits, CMSTATE_CACHED_INT32_SIZE * sizeof(XMLInt32)); } } ~CMStateSet() { if(fDynamicBuffer) { for(XMLSize_t index = 0; index < fDynamicBuffer->fArraySize; index++) if(fDynamicBuffer->fBitArray[index]!=NULL) deallocateChunk(index); fDynamicBuffer->fMemoryManager->deallocate(fDynamicBuffer->fBitArray); fDynamicBuffer->fMemoryManager->deallocate(fDynamicBuffer); } } // ----------------------------------------------------------------------- // Set manipulation methods // ----------------------------------------------------------------------- void operator|=(const CMStateSet& setToOr) { if(fDynamicBuffer==0) { #ifdef XERCES_HAVE_SSE2_INTRINSIC if(XMLPlatformUtils::fgSSE2ok) { __m128i xmm1 = _mm_loadu_si128(reinterpret_cast(fBits)); __m128i xmm2 = _mm_loadu_si128(reinterpret_cast(setToOr.fBits)); __m128i xmm3 = _mm_or_si128(xmm1, xmm2); // OR 4 32-bit words _mm_storeu_si128(reinterpret_cast<__m128i*>(fBits), xmm3); } else #endif { for (XMLSize_t index = 0; index < CMSTATE_CACHED_INT32_SIZE; index++) if(setToOr.fBits[index]) { if(fBits[index]) fBits[index] |= setToOr.fBits[index]; else fBits[index] = setToOr.fBits[index]; } } } else { for (XMLSize_t index = 0; index < fDynamicBuffer->fArraySize; index++) { XMLInt32 *& other = setToOr.fDynamicBuffer->fBitArray[index]; if(other!=NULL) { // if we haven't allocated the subvector yet, allocate it and copy if(fDynamicBuffer->fBitArray[index]==NULL) { allocateChunk(index); memcpy((void *) fDynamicBuffer->fBitArray[index], (const void *) other, CMSTATE_BITFIELD_INT32_SIZE * sizeof(XMLInt32)); } else { // otherwise, merge them XMLInt32*& mine = fDynamicBuffer->fBitArray[index]; #ifdef XERCES_HAVE_SSE2_INTRINSIC if(XMLPlatformUtils::fgSSE2ok) { for(XMLSize_t subIndex = 0; subIndex < CMSTATE_BITFIELD_INT32_SIZE; subIndex+=4) { __m128i xmm1 = _mm_load_si128(reinterpret_cast(&other[subIndex])); __m128i xmm2 = _mm_load_si128(reinterpret_cast(&mine[subIndex])); __m128i xmm3 = _mm_or_si128(xmm1, xmm2); // OR 4 32-bit words _mm_store_si128(reinterpret_cast<__m128i*>(&mine[subIndex]), xmm3); } } else #endif { for(XMLSize_t subIndex = 0; subIndex < CMSTATE_BITFIELD_INT32_SIZE; subIndex++) if(setToOr.fDynamicBuffer->fBitArray[index][subIndex]) { if(fDynamicBuffer->fBitArray[index][subIndex]) fDynamicBuffer->fBitArray[index][subIndex] |= setToOr.fDynamicBuffer->fBitArray[index][subIndex]; else fDynamicBuffer->fBitArray[index][subIndex] = setToOr.fDynamicBuffer->fBitArray[index][subIndex]; } } } } } } } bool operator==(const CMStateSet& setToCompare) const { if (fBitCount != setToCompare.fBitCount) return false; if(fDynamicBuffer==0) { for (XMLSize_t index = 0; index < CMSTATE_CACHED_INT32_SIZE; index++) { if (fBits[index] != setToCompare.fBits[index]) return false; } } else { for (XMLSize_t index = 0; index < fDynamicBuffer->fArraySize; index++) { XMLInt32 *& other = setToCompare.fDynamicBuffer->fBitArray[index], *& mine = fDynamicBuffer->fBitArray[index]; if(mine==NULL && other==NULL) continue; else if(mine==NULL || other==NULL) // the other should have been empty too return false; else { for(XMLSize_t subIndex = 0; subIndex < CMSTATE_BITFIELD_INT32_SIZE; subIndex++) if(mine[subIndex]!=other[subIndex]) return false; } } } return true; } CMStateSet& operator=(const CMStateSet& srcSet) { if (this == &srcSet) return *this; // They have to be the same size if (fBitCount != srcSet.fBitCount) { if(fDynamicBuffer) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Bitset_NotEqualSize, fDynamicBuffer->fMemoryManager); else ThrowXML(RuntimeException, XMLExcepts::Bitset_NotEqualSize); } if(fDynamicBuffer==0) { for (XMLSize_t index = 0; index < CMSTATE_CACHED_INT32_SIZE; index++) fBits[index] = srcSet.fBits[index]; } else { for (XMLSize_t index = 0; index < fDynamicBuffer->fArraySize; index++) if(srcSet.fDynamicBuffer->fBitArray[index]==NULL) { // delete this subentry if(fDynamicBuffer->fBitArray[index]!=NULL) deallocateChunk(index); } else { // if we haven't allocated the subvector yet, allocate it and copy if(fDynamicBuffer->fBitArray[index]==NULL) allocateChunk(index); memcpy((void *) fDynamicBuffer->fBitArray[index], (const void *) srcSet.fDynamicBuffer->fBitArray[index], CMSTATE_BITFIELD_INT32_SIZE * sizeof(XMLInt32)); } } return *this; } XMLSize_t getBitCountInRange(XMLSize_t start, XMLSize_t end) const { XMLSize_t count = 0; end /= 32; if(fDynamicBuffer==0) { if(end > CMSTATE_CACHED_INT32_SIZE) end = CMSTATE_CACHED_INT32_SIZE; for (XMLSize_t index = start / 32; index < end; index++) { if (fBits[index] != 0) for(int i=0;i<32;i++) { const XMLInt32 mask = 1UL << i; if(fBits[index] & mask) count++; } } } else { if(end > fDynamicBuffer->fArraySize) end = fDynamicBuffer->fArraySize; for (XMLSize_t index = start / 32; index < end; index++) { if(fDynamicBuffer->fBitArray[index]==NULL) continue; for(XMLSize_t subIndex=0;subIndex < CMSTATE_BITFIELD_INT32_SIZE; subIndex++) { if (fDynamicBuffer->fBitArray[index][subIndex] != 0) for(int i=0;i<32;i++) { const XMLInt32 mask = 1UL << i; if(fDynamicBuffer->fBitArray[index][subIndex] & mask) count++; } } } } return count; } bool getBit(const XMLSize_t bitToGet) const { if (bitToGet >= fBitCount) { if(fDynamicBuffer) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Bitset_BadIndex, fDynamicBuffer->fMemoryManager); else ThrowXML(ArrayIndexOutOfBoundsException, XMLExcepts::Bitset_BadIndex); } // And access the right bit and byte if(fDynamicBuffer==0) { const XMLInt32 mask = 1UL << (bitToGet % 32); const XMLSize_t byteOfs = bitToGet / 32; return (fBits[byteOfs]!=0 && (fBits[byteOfs] & mask) != 0); } else { const XMLSize_t vectorOfs = bitToGet / CMSTATE_BITFIELD_CHUNK; if(fDynamicBuffer->fBitArray[vectorOfs]==NULL) return false; const XMLInt32 mask = 1UL << (bitToGet % 32); const XMLSize_t byteOfs = (bitToGet % CMSTATE_BITFIELD_CHUNK) / 32; return (fDynamicBuffer->fBitArray[vectorOfs][byteOfs]!=0 && (fDynamicBuffer->fBitArray[vectorOfs][byteOfs] & mask) != 0); } } bool isEmpty() const { if(fDynamicBuffer==0) { for (XMLSize_t index = 0; index < CMSTATE_CACHED_INT32_SIZE; index++) { if (fBits[index] != 0) return false; } } else { for (XMLSize_t index = 0; index < fDynamicBuffer->fArraySize; index++) { if(fDynamicBuffer->fBitArray[index]==NULL) continue; for(XMLSize_t subIndex=0;subIndex < CMSTATE_BITFIELD_INT32_SIZE; subIndex++) { if (fDynamicBuffer->fBitArray[index][subIndex] != 0) return false; } } } return true; } void setBit(const XMLSize_t bitToSet) { if (bitToSet >= fBitCount) { if(fDynamicBuffer) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Bitset_BadIndex, fDynamicBuffer->fMemoryManager); else ThrowXML(ArrayIndexOutOfBoundsException, XMLExcepts::Bitset_BadIndex); } const XMLInt32 mask = 1UL << (bitToSet % 32); // And access the right bit and byte if(fDynamicBuffer==0) { const XMLSize_t byteOfs = bitToSet / 32; fBits[byteOfs] &= ~mask; fBits[byteOfs] |= mask; } else { const XMLSize_t vectorOfs = bitToSet / CMSTATE_BITFIELD_CHUNK; if(fDynamicBuffer->fBitArray[vectorOfs]==NULL) { allocateChunk(vectorOfs); for(XMLSize_t index=0;index < CMSTATE_BITFIELD_INT32_SIZE; index++) fDynamicBuffer->fBitArray[vectorOfs][index]=0; } const XMLSize_t byteOfs = (bitToSet % CMSTATE_BITFIELD_CHUNK) / 32; fDynamicBuffer->fBitArray[vectorOfs][byteOfs] &= ~mask; fDynamicBuffer->fBitArray[vectorOfs][byteOfs] |= mask; } } void zeroBits() { if(fDynamicBuffer==0) { for (XMLSize_t index = 0; index < CMSTATE_CACHED_INT32_SIZE; index++) fBits[index] = 0; } else { for (XMLSize_t index = 0; index < fDynamicBuffer->fArraySize; index++) // delete this subentry if(fDynamicBuffer->fBitArray[index]!=NULL) deallocateChunk(index); } } XMLSize_t hashCode() const { XMLSize_t hash = 0; if(fDynamicBuffer==0) { for (XMLSize_t index = 0; indexfArraySize; index++) { if(fDynamicBuffer->fBitArray[index]==NULL) // simulates the iteration on the missing bits for(XMLSize_t subIndex=0;subIndex < CMSTATE_BITFIELD_INT32_SIZE; subIndex++) hash *= 31; else for(XMLSize_t subIndex=0;subIndex < CMSTATE_BITFIELD_INT32_SIZE; subIndex++) hash = fDynamicBuffer->fBitArray[index][subIndex] + hash * 31; } } return hash; } private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- CMStateSet(); // ----------------------------------------------------------------------- // Helpers // ----------------------------------------------------------------------- void allocateChunk(const XMLSize_t index) { #ifdef XERCES_HAVE_SSE2_INTRINSIC if(XMLPlatformUtils::fgSSE2ok) fDynamicBuffer->fBitArray[index]=(XMLInt32*)_mm_malloc(CMSTATE_BITFIELD_INT32_SIZE * sizeof(XMLInt32), 16); else #endif fDynamicBuffer->fBitArray[index]=(XMLInt32*)fDynamicBuffer->fMemoryManager->allocate(CMSTATE_BITFIELD_INT32_SIZE * sizeof(XMLInt32)); } void deallocateChunk(const XMLSize_t index) { #ifdef XERCES_HAVE_SSE2_INTRINSIC if(XMLPlatformUtils::fgSSE2ok) _mm_free(fDynamicBuffer->fBitArray[index]); else #endif fDynamicBuffer->fMemoryManager->deallocate(fDynamicBuffer->fBitArray[index]); fDynamicBuffer->fBitArray[index]=NULL; } // ----------------------------------------------------------------------- // Private data members // // fBitCount // The count of bits that the outside world wants to support, // so its the max bit index plus one. // // fBits // When the bit count is less than a threshold (very common), these hold the bits. // Otherwise, the fDynamicBuffer member holds htem. // // fDynamicBuffer // If the bit count is greater than the threshold, then we allocate this structure to // store the bits, the length, and the memory manager to allocate/deallocate // the memory // // ----------------------------------------------------------------------- XMLSize_t fBitCount; XMLInt32 fBits[CMSTATE_CACHED_INT32_SIZE]; CMDynamicBuffer* fDynamicBuffer; friend class CMStateSetEnumerator; }; class CMStateSetEnumerator : public XMemory { public: CMStateSetEnumerator(const CMStateSet* toEnum, XMLSize_t start = 0) : fToEnum(toEnum), fIndexCount((XMLSize_t)-1), fLastValue(0) { // if a starting bit is specified, place fIndexCount at the beginning of the previous 32 bit area // so the findNext moves to the one where 'start' is located if(start > 32) fIndexCount = (start/32 - 1) * 32; findNext(); // if we found data, and fIndexCount is still pointing to the area where 'start' is located, erase the bits before 'start' if(hasMoreElements() && fIndexCount < start) { for(XMLSize_t i=0;i< (start - fIndexCount);i++) { XMLInt32 mask=1UL << i; if(fLastValue & mask) fLastValue &= ~mask; } // in case the 32 bit area contained only bits before 'start', advance if(fLastValue==0) findNext(); } } bool hasMoreElements() { return fLastValue!=0; } unsigned int nextElement() { for(int i=0;i<32;i++) { XMLInt32 mask=1UL << i; if(fLastValue & mask) { fLastValue &= ~mask; unsigned int retVal=(unsigned int)fIndexCount+i; if(fLastValue==0) findNext(); return retVal; } } return 0; } private: void findNext() { if(fToEnum->fDynamicBuffer==0) { XMLSize_t nOffset=((fIndexCount==(XMLSize_t)-1)?0:(fIndexCount/32)+1); for(XMLSize_t index=nOffset;indexfBits[index]!=0) { fIndexCount=index*32; fLastValue=fToEnum->fBits[index]; return; } } } else { XMLSize_t nOffset=((fIndexCount==(XMLSize_t)-1)?0:(fIndexCount/CMSTATE_BITFIELD_CHUNK)); XMLSize_t nSubOffset=((fIndexCount==(XMLSize_t)-1)?0:((fIndexCount % CMSTATE_BITFIELD_CHUNK) /32)+1); for (XMLSize_t index = nOffset; indexfDynamicBuffer->fArraySize; index++) { if(fToEnum->fDynamicBuffer->fBitArray[index]!=NULL) { for(XMLSize_t subIndex=nSubOffset;subIndex < CMSTATE_BITFIELD_INT32_SIZE; subIndex++) if(fToEnum->fDynamicBuffer->fBitArray[index][subIndex]!=0) { fIndexCount=index*CMSTATE_BITFIELD_CHUNK + subIndex*32; fLastValue=fToEnum->fDynamicBuffer->fBitArray[index][subIndex]; return; } } nSubOffset = 0; // next chunks will be processed from the beginning } } } const CMStateSet* fToEnum; XMLSize_t fIndexCount; XMLInt32 fLastValue; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/common/ContentLeafNameTypeVector.cpp000644 000765 000024 00000007334 13241160333 027465 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ContentLeafNameTypeVector.cpp 676911 2008-07-15 13:27:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // ContentLeafNameTypeVector: Constructors and Destructor // --------------------------------------------------------------------------- ContentLeafNameTypeVector::ContentLeafNameTypeVector ( MemoryManager* const manager ) : fMemoryManager(manager) , fLeafNames(0) , fLeafTypes(0) , fLeafCount(0) { } ContentLeafNameTypeVector::ContentLeafNameTypeVector ( QName** const names , ContentSpecNode::NodeTypes* const types , const XMLSize_t count , MemoryManager* const manager ) : fMemoryManager(manager) , fLeafNames(0) , fLeafTypes(0) , fLeafCount(0) { setValues(names, types, count); } /*** copy ctor ***/ ContentLeafNameTypeVector::ContentLeafNameTypeVector ( const ContentLeafNameTypeVector& toCopy ) : XMemory(toCopy) , fMemoryManager(toCopy.fMemoryManager) , fLeafNames(0) , fLeafTypes(0) , fLeafCount(0) { fLeafCount=toCopy.getLeafCount(); init(fLeafCount); for (XMLSize_t i=0; ifLeafCount; i++) { fLeafNames[i] = toCopy.getLeafNameAt(i); fLeafTypes[i] = toCopy.getLeafTypeAt(i); } } ContentLeafNameTypeVector::~ContentLeafNameTypeVector() { cleanUp(); } // --------------------------------------------------------------------------- // ContentSpecType: Setter methods // --------------------------------------------------------------------------- void ContentLeafNameTypeVector::setValues ( QName** const names , ContentSpecNode::NodeTypes* const types , const XMLSize_t count ) { cleanUp(); init(count); for (XMLSize_t i=0; i= fLeafCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Vector_BadIndex, fMemoryManager); return fLeafNames[pos]; } ContentSpecNode::NodeTypes ContentLeafNameTypeVector::getLeafTypeAt (const XMLSize_t pos) const { if (pos >= fLeafCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Vector_BadIndex, fMemoryManager); return fLeafTypes[pos]; } XMLSize_t ContentLeafNameTypeVector::getLeafCount() const { return fLeafCount; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/common/AllContentModel.hpp000644 000765 000024 00000014740 13241160333 025465 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: AllContentModel.hpp 901107 2010-01-20 08:45:02Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_ALLCONTENTMODEL_HPP) #define XERCESC_INCLUDE_GUARD_ALLCONTENTMODEL_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class ContentSpecNode; // // AllContentModel is a derivative of the abstract content model base // class that handles the special case of feature in schema. If a model // is , all non-optional children must appear // // So, all we have to do is to keep an array of the possible children and // validate by just looking up each child being validated by looking it up // in the list, and make sure all non-optional children appear. // class AllContentModel : public XMLContentModel { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- AllContentModel ( ContentSpecNode* const parentContentSpec , const bool isMixed , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~AllContentModel(); // ----------------------------------------------------------------------- // Implementation of the ContentModel virtual interface // ----------------------------------------------------------------------- virtual bool validateContent ( QName** const children , XMLSize_t childCount , unsigned int emptyNamespaceId , XMLSize_t* indexFailingChild , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) const; virtual bool validateContentSpecial ( QName** const children , XMLSize_t childCount , unsigned int emptyNamespaceId , GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool , XMLSize_t* indexFailingChild , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) const; virtual ContentLeafNameTypeVector* getContentLeafNameTypeVector() const ; virtual unsigned int getNextState(unsigned int currentState, XMLSize_t elementIndex) const; virtual bool handleRepetitions( const QName* const curElem, unsigned int curState, unsigned int currentLoop, unsigned int& nextState, unsigned int& nextLoop, XMLSize_t elementIndex, SubstitutionGroupComparator * comparator) const; virtual void checkUniqueParticleAttribution ( SchemaGrammar* const pGrammar , GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool , XMLValidator* const pValidator , unsigned int* const pContentSpecOrgURI , const XMLCh* pComplexTypeName = 0 ) ; private : // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void buildChildList ( ContentSpecNode* const curNode , ValueVectorOf& toFill , ValueVectorOf& toType ); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- AllContentModel(); AllContentModel(const AllContentModel&); AllContentModel& operator=(const AllContentModel&); // ----------------------------------------------------------------------- // Private data members // // fCount // The count of possible children in the fChildren member. // // fChildren // The list of possible children that we have to accept. This array // is allocated as large as needed in the constructor. // // fChildOptional // The corresponding list of optional state of each child in fChildren // True if the child is optional (i.e. minOccurs = 0). // // fNumRequired // The number of required children in (i.e. minOccurs = 1) // // fIsMixed // AllContentModel with mixed PCDATA. // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; XMLSize_t fCount; QName** fChildren; bool* fChildOptional; unsigned int fNumRequired; bool fIsMixed; bool fHasOptionalContent; }; inline ContentLeafNameTypeVector* AllContentModel::getContentLeafNameTypeVector() const { return 0; } inline unsigned int AllContentModel::getNextState(unsigned int, XMLSize_t) const { return XMLContentModel::gInvalidTrans; } inline bool AllContentModel::handleRepetitions( const QName* const /*curElem*/, unsigned int /*curState*/, unsigned int /*currentLoop*/, unsigned int& /*nextState*/, unsigned int& /*nextLoop*/, XMLSize_t /*elementIndex*/, SubstitutionGroupComparator * /*comparator*/) const { return true; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/common/SimpleContentModel.hpp000644 000765 000024 00000017233 13241160333 026206 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SimpleContentModel.hpp 901107 2010-01-20 08:45:02Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_SIMPLECONTENTMODEL_HPP) #define XERCESC_INCLUDE_GUARD_SIMPLECONTENTMODEL_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN // // SimpleContentModel is a derivative of the abstract content model base // class that handles a small set of simple content models that are just // way overkill to give the DFA treatment. // // DESCRIPTION: // // This guy handles the following scenarios: // // a // a? // a* // a+ // a,b // a|b // // These all involve a unary operation with one element type, or a binary // operation with two elements. These are very simple and can be checked // in a simple way without a DFA and without the overhead of setting up a // DFA for such a simple check. // // NOTE: Pass the XMLElementDecl::fgPCDataElemId value to represent a // PCData node. Pass XMLElementDecl::fgInvalidElemId for unused element // class SimpleContentModel : public XMLContentModel { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- SimpleContentModel ( const bool dtd , QName* const firstChild , QName* const secondChild , const ContentSpecNode::NodeTypes cmOp , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~SimpleContentModel(); // ----------------------------------------------------------------------- // Implementation of the ContentModel virtual interface // ----------------------------------------------------------------------- virtual bool validateContent ( QName** const children , XMLSize_t childCount , unsigned int emptyNamespaceId , XMLSize_t* indexFailingChild , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) const; virtual bool validateContentSpecial ( QName** const children , XMLSize_t childCount , unsigned int emptyNamespaceId , GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool , XMLSize_t* indexFailingChild , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) const; virtual ContentLeafNameTypeVector *getContentLeafNameTypeVector() const; virtual unsigned int getNextState(unsigned int currentState, XMLSize_t elementIndex) const; virtual bool handleRepetitions( const QName* const curElem, unsigned int curState, unsigned int currentLoop, unsigned int& nextState, unsigned int& nextLoop, XMLSize_t elementIndex, SubstitutionGroupComparator * comparator) const; virtual void checkUniqueParticleAttribution ( SchemaGrammar* const pGrammar , GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool , XMLValidator* const pValidator , unsigned int* const pContentSpecOrgURI , const XMLCh* pComplexTypeName = 0 ) ; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- SimpleContentModel(); SimpleContentModel(const SimpleContentModel&); SimpleContentModel& operator=(const SimpleContentModel&); // ----------------------------------------------------------------------- // Private data members // // fFirstChild // fSecondChild // The first (and optional second) child node. The // operation code tells us whether the second child is used or not. // // fOp // The operation that this object represents. Since this class only // does simple contents, there is only ever a single operation // involved (i.e. the children of the operation are always one or // two leafs.) // // fDTD // Boolean to allow DTDs to validate even with namespace support. */ // // ----------------------------------------------------------------------- QName* fFirstChild; QName* fSecondChild; ContentSpecNode::NodeTypes fOp; bool fDTD; MemoryManager* const fMemoryManager; }; // --------------------------------------------------------------------------- // SimpleContentModel: Constructors and Destructor // --------------------------------------------------------------------------- inline SimpleContentModel::SimpleContentModel ( const bool dtd , QName* const firstChild , QName* const secondChild , const ContentSpecNode::NodeTypes cmOp , MemoryManager* const manager ) : fFirstChild(0) , fSecondChild(0) , fOp(cmOp) , fDTD(dtd) , fMemoryManager(manager) { if (firstChild) fFirstChild = new (manager) QName(*firstChild); else fFirstChild = new (manager) QName(XMLUni::fgZeroLenString, XMLUni::fgZeroLenString, XMLElementDecl::fgInvalidElemId, manager); if (secondChild) fSecondChild = new (manager) QName(*secondChild); else fSecondChild = new (manager) QName(XMLUni::fgZeroLenString, XMLUni::fgZeroLenString, XMLElementDecl::fgInvalidElemId, manager); } inline SimpleContentModel::~SimpleContentModel() { delete fFirstChild; delete fSecondChild; } // --------------------------------------------------------------------------- // SimpleContentModel: Virtual methods // --------------------------------------------------------------------------- inline unsigned int SimpleContentModel::getNextState(unsigned int, XMLSize_t) const { return XMLContentModel::gInvalidTrans; } inline bool SimpleContentModel::handleRepetitions( const QName* const /*curElem*/, unsigned int /*curState*/, unsigned int /*currentLoop*/, unsigned int& /*nextState*/, unsigned int& /*nextLoop*/, XMLSize_t /*elementIndex*/, SubstitutionGroupComparator * /*comparator*/) const { return true; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/common/ContentSpecNode.hpp000644 000765 000024 00000031447 13241160333 025477 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ContentSpecNode.hpp 1092729 2011-04-15 14:56:36Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_CONTENTSPECNODE_HPP) #define XERCESC_INCLUDE_GUARD_CONTENTSPECNODE_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLBuffer; class Grammar; class XMLUTIL_EXPORT ContentSpecNode : public XSerializable, public XMemory { public : // ----------------------------------------------------------------------- // Class specific types // ----------------------------------------------------------------------- enum NodeTypes { Leaf = 0 , ZeroOrOne , ZeroOrMore , OneOrMore , Choice , Sequence , Any , Any_Other , Any_NS = 8 , All = 9 , Loop = 10 , Any_NS_Choice = 20 // 16 + 4 (Choice) , ModelGroupSequence = 21 // 16 + 5 (Sequence) , Any_Lax = 22 // 16 + 6 (Any) , Any_Other_Lax = 23 // 16 + 7 (Any_Other) , Any_NS_Lax = 24 // 16 + 8 (Any_NS) , ModelGroupChoice = 36 // 32 + 4 (Choice) , Any_Skip = 38 // 32 + 6 (Any) , Any_Other_Skip = 39 // 32 + 7 (Any_Other) , Any_NS_Skip = 40 // 32 + 8 (Any_NS) , UnknownType = -1 }; // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- ContentSpecNode(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ContentSpecNode ( QName* const toAdopt , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ContentSpecNode ( XMLElementDecl* const elemDecl , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ContentSpecNode ( QName* const toAdopt , const bool copyQName , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ContentSpecNode ( const NodeTypes type , ContentSpecNode* const firstToAdopt , ContentSpecNode* const secondToAdopt , const bool adoptFirst = true , const bool adoptSecond = true , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ContentSpecNode(const ContentSpecNode&); ~ContentSpecNode(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- QName* getElement(); const QName* getElement() const; XMLElementDecl* getElementDecl(); const XMLElementDecl* getElementDecl() const; ContentSpecNode* getFirst(); const ContentSpecNode* getFirst() const; ContentSpecNode* getSecond(); const ContentSpecNode* getSecond() const; NodeTypes getType() const; ContentSpecNode* orphanFirst(); ContentSpecNode* orphanSecond(); int getMinOccurs() const; int getMaxOccurs() const; bool isFirstAdopted() const; bool isSecondAdopted() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setElement(QName* const toAdopt); void setFirst(ContentSpecNode* const toAdopt); void setSecond(ContentSpecNode* const toAdopt); void setType(const NodeTypes type); void setMinOccurs(int min); void setMaxOccurs(int max); void setAdoptFirst(bool adoptFirst); void setAdoptSecond(bool adoptSecond); // ----------------------------------------------------------------------- // Miscellaneous // ----------------------------------------------------------------------- void formatSpec (XMLBuffer& bufToFill) const; bool hasAllContent(); int getMinTotalRange() const; int getMaxTotalRange() const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(ContentSpecNode) private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ContentSpecNode& operator=(const ContentSpecNode&); // ----------------------------------------------------------------------- // Helper functions // ----------------------------------------------------------------------- void deleteChildNode(ContentSpecNode* node); // ----------------------------------------------------------------------- // Private Data Members // // fElement // If the type is Leaf/Any*, then this is the qName of the element. If the URI // is fgPCDataElemId, then its a PCData node. Else, it is zero. // // fFirst // fSecond // The optional first and second nodes. The fType field indicates // which of these are valid. The validity constraints are: // // Leaf = Neither valid // ZeroOrOne, ZeroOrMore = First // Choice, Sequence, All = First and Second // Any* = Neither valid // // fType // The type of node. This controls how many of the child node fields // are used. // // fAdoptFirst // Indicate if this ContentSpecNode adopts the fFirst, and is responsible // for deleting it. // // fAdoptSecond // Indicate if this ContentSpecNode adopts the fSecond, and is responsible // for deleting it. // // fMinOccurs // Indicate the minimum times that this node can occur // // fMaxOccurs // Indicate the maximum times that this node can occur // -1 (Unbounded), default (1) // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; QName* fElement; XMLElementDecl* fElementDecl; ContentSpecNode* fFirst; ContentSpecNode* fSecond; NodeTypes fType; bool fAdoptFirst; bool fAdoptSecond; int fMinOccurs; int fMaxOccurs; }; // --------------------------------------------------------------------------- // ContentSpecNode: Constructors and Destructor // --------------------------------------------------------------------------- inline ContentSpecNode::ContentSpecNode(MemoryManager* const manager) : fMemoryManager(manager) , fElement(0) , fElementDecl(0) , fFirst(0) , fSecond(0) , fType(ContentSpecNode::Leaf) , fAdoptFirst(true) , fAdoptSecond(true) , fMinOccurs(1) , fMaxOccurs(1) { } inline ContentSpecNode::ContentSpecNode(QName* const element, MemoryManager* const manager) : fMemoryManager(manager) , fElement(0) , fElementDecl(0) , fFirst(0) , fSecond(0) , fType(ContentSpecNode::Leaf) , fAdoptFirst(true) , fAdoptSecond(true) , fMinOccurs(1) , fMaxOccurs(1) { if (element) fElement = new (fMemoryManager) QName(*element); } inline ContentSpecNode::ContentSpecNode(XMLElementDecl* const elemDecl, MemoryManager* const manager) : fMemoryManager(manager) , fElement(0) , fElementDecl(elemDecl) , fFirst(0) , fSecond(0) , fType(ContentSpecNode::Leaf) , fAdoptFirst(true) , fAdoptSecond(true) , fMinOccurs(1) , fMaxOccurs(1) { if (elemDecl) fElement = new (manager) QName(*(elemDecl->getElementName())); } inline ContentSpecNode::ContentSpecNode( QName* const element , const bool copyQName , MemoryManager* const manager) : fMemoryManager(manager) , fElement(0) , fElementDecl(0) , fFirst(0) , fSecond(0) , fType(ContentSpecNode::Leaf) , fAdoptFirst(true) , fAdoptSecond(true) , fMinOccurs(1) , fMaxOccurs(1) { if (copyQName) { if (element) fElement = new (fMemoryManager) QName(*element); } else { fElement = element; } } inline ContentSpecNode::ContentSpecNode(const NodeTypes type , ContentSpecNode* const firstAdopt , ContentSpecNode* const secondAdopt , const bool adoptFirst , const bool adoptSecond , MemoryManager* const manager) : fMemoryManager(manager) , fElement(0) , fElementDecl(0) , fFirst(firstAdopt) , fSecond(secondAdopt) , fType(type) , fAdoptFirst(adoptFirst) , fAdoptSecond(adoptSecond) , fMinOccurs(1) , fMaxOccurs(1) { } // --------------------------------------------------------------------------- // ContentSpecNode: Getter methods // --------------------------------------------------------------------------- inline QName* ContentSpecNode::getElement() { return fElement; } inline const QName* ContentSpecNode::getElement() const { return fElement; } inline XMLElementDecl* ContentSpecNode::getElementDecl() { return fElementDecl; } inline const XMLElementDecl* ContentSpecNode::getElementDecl() const { return fElementDecl; } inline ContentSpecNode* ContentSpecNode::getFirst() { return fFirst; } inline const ContentSpecNode* ContentSpecNode::getFirst() const { return fFirst; } inline ContentSpecNode* ContentSpecNode::getSecond() { return fSecond; } inline const ContentSpecNode* ContentSpecNode::getSecond() const { return fSecond; } inline ContentSpecNode::NodeTypes ContentSpecNode::getType() const { return fType; } inline ContentSpecNode* ContentSpecNode::orphanFirst() { ContentSpecNode* retNode = fFirst; fFirst = 0; return retNode; } inline ContentSpecNode* ContentSpecNode::orphanSecond() { ContentSpecNode* retNode = fSecond; fSecond = 0; return retNode; } inline int ContentSpecNode::getMinOccurs() const { return fMinOccurs; } inline int ContentSpecNode::getMaxOccurs() const { return fMaxOccurs; } inline bool ContentSpecNode::isFirstAdopted() const { return fAdoptFirst; } inline bool ContentSpecNode::isSecondAdopted() const { return fAdoptSecond; } // --------------------------------------------------------------------------- // ContentSpecType: Setter methods // --------------------------------------------------------------------------- inline void ContentSpecNode::setElement(QName* const element) { delete fElement; fElement = 0; if (element) fElement = new (fMemoryManager) QName(*element); } inline void ContentSpecNode::setFirst(ContentSpecNode* const toAdopt) { if (fAdoptFirst) delete fFirst; fFirst = toAdopt; } inline void ContentSpecNode::setSecond(ContentSpecNode* const toAdopt) { if (fAdoptSecond) delete fSecond; fSecond = toAdopt; } inline void ContentSpecNode::setType(const NodeTypes type) { fType = type; } inline void ContentSpecNode::setMinOccurs(int min) { fMinOccurs = min; } inline void ContentSpecNode::setMaxOccurs(int max) { fMaxOccurs = max; } inline void ContentSpecNode::setAdoptFirst(bool newState) { fAdoptFirst = newState; } inline void ContentSpecNode::setAdoptSecond(bool newState) { fAdoptSecond = newState; } // --------------------------------------------------------------------------- // ContentSpecNode: Miscellaneous // --------------------------------------------------------------------------- inline bool ContentSpecNode::hasAllContent() { if (fType == ContentSpecNode::ZeroOrOne) { return (fFirst->getType() == ContentSpecNode::All); } return (fType == ContentSpecNode::All); } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/common/CMBinaryOp.hpp000644 000765 000024 00000006254 13241160333 024405 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: CMBinaryOp.hpp 677396 2008-07-16 19:36:20Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_CMBINARYOP_HPP) #define XERCESC_INCLUDE_GUARD_CMBINARYOP_HPP #include XERCES_CPP_NAMESPACE_BEGIN class CMStateSet; class CMBinaryOp : public CMNode { public : // ----------------------------------------------------------------------- // Constructors // ----------------------------------------------------------------------- CMBinaryOp ( ContentSpecNode::NodeTypes type , CMNode* const leftToAdopt , CMNode* const rightToAdopt , unsigned int maxStates , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~CMBinaryOp(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- const CMNode* getLeft() const; CMNode* getLeft(); const CMNode* getRight() const; CMNode* getRight(); // ----------------------------------------------------------------------- // Implementation of the public CMNode virtual interface // ----------------------------------------------------------------------- virtual void orphanChild(); protected : // ----------------------------------------------------------------------- // Implementation of the protected CMNode virtual interface // ----------------------------------------------------------------------- void calcFirstPos(CMStateSet& toSet) const; void calcLastPos(CMStateSet& toSet) const; private : // ----------------------------------------------------------------------- // Private data members // // fLeftChild // fRightChild // These are the references to the two nodes that are on either side // of this binary operation. We own them both. // ----------------------------------------------------------------------- CMNode* fLeftChild; CMNode* fRightChild; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- CMBinaryOp(const CMBinaryOp&); CMBinaryOp& operator=(const CMBinaryOp&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/common/MixedContentModel.hpp000644 000765 000024 00000017304 13241160333 026022 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: MixedContentModel.hpp 901107 2010-01-20 08:45:02Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_MIXEDCONTENTMODEL_HPP) #define XERCESC_INCLUDE_GUARD_MIXEDCONTENTMODEL_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class ContentSpecNode; // // MixedContentModel is a derivative of the abstract content model base // class that handles the special case of mixed model elements. If an element // is mixed model, it has PCDATA as its first possible content, followed // by an alternation of the possible children. The children cannot have any // numeration or order, so it must look like this: // // // // So, all we have to do is to keep an array of the possible children and // validate by just looking up each child being validated by looking it up // in the list. // class MixedContentModel : public XMLContentModel { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- MixedContentModel ( const bool dtd , ContentSpecNode* const parentContentSpec , const bool ordered = false , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~MixedContentModel(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- bool hasDups() const; // ----------------------------------------------------------------------- // Implementation of the ContentModel virtual interface // ----------------------------------------------------------------------- virtual bool validateContent ( QName** const children , XMLSize_t childCount , unsigned int emptyNamespaceId , XMLSize_t* indexFailingChild , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) const; virtual bool validateContentSpecial ( QName** const children , XMLSize_t childCount , unsigned int emptyNamespaceId , GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool , XMLSize_t* indexFailingChild , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) const; virtual ContentLeafNameTypeVector* getContentLeafNameTypeVector() const ; virtual unsigned int getNextState(unsigned int currentState, XMLSize_t elementIndex) const; virtual bool handleRepetitions( const QName* const curElem, unsigned int curState, unsigned int currentLoop, unsigned int& nextState, unsigned int& nextLoop, XMLSize_t elementIndex, SubstitutionGroupComparator * comparator) const; virtual void checkUniqueParticleAttribution ( SchemaGrammar* const pGrammar , GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool , XMLValidator* const pValidator , unsigned int* const pContentSpecOrgURI , const XMLCh* pComplexTypeName = 0 ) ; private : // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void buildChildList ( ContentSpecNode* const curNode , ValueVectorOf& toFill , ValueVectorOf& toType ); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- MixedContentModel(); MixedContentModel(const MixedContentModel&); MixedContentModel& operator=(const MixedContentModel&); // ----------------------------------------------------------------------- // Private data members // // fCount // The count of possible children in the fChildren member. // // fChildren // The list of possible children that we have to accept. This array // is allocated as large as needed in the constructor. // // fChildTypes // The type of the children to support ANY. // // fOrdered // True if mixed content model is ordered. DTD mixed content models // are always unordered. // // fDTD // Boolean to allow DTDs to validate even with namespace support. // // ----------------------------------------------------------------------- XMLSize_t fCount; QName** fChildren; ContentSpecNode::NodeTypes* fChildTypes; bool fOrdered; bool fDTD; MemoryManager* fMemoryManager; }; inline ContentLeafNameTypeVector* MixedContentModel::getContentLeafNameTypeVector() const { return 0; } inline unsigned int MixedContentModel::getNextState(unsigned int, XMLSize_t) const { return XMLContentModel::gInvalidTrans; } inline bool MixedContentModel::handleRepetitions( const QName* const /*curElem*/, unsigned int /*curState*/, unsigned int /*currentLoop*/, unsigned int& /*nextState*/, unsigned int& /*nextLoop*/, XMLSize_t /*elementIndex*/, SubstitutionGroupComparator * /*comparator*/) const { return true; } inline void MixedContentModel::checkUniqueParticleAttribution ( SchemaGrammar* const , GrammarResolver* const , XMLStringPool* const , XMLValidator* const , unsigned int* const pContentSpecOrgURI , const XMLCh* /*pComplexTypeName*/ /*= 0*/ ) { // rename back unsigned int i = 0; for (i = 0; i < fCount; i++) { unsigned int orgURIIndex = fChildren[i]->getURI(); if ((orgURIIndex != XMLContentModel::gEOCFakeId) && (orgURIIndex != XMLElementDecl::fgInvalidElemId) && (orgURIIndex != XMLElementDecl::fgPCDataElemId)) fChildren[i]->setURI(pContentSpecOrgURI[orgURIIndex]); } // for mixed content model, it's only a sequence // UPA checking is not necessary } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/common/Grammar.hpp000644 000765 000024 00000014577 13241160333 024037 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Grammar.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_GRAMMAR_HPP) #define XERCESC_INCLUDE_GUARD_GRAMMAR_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLGrammarDescription; // // This abstract class specifies the interface for a Grammar // class VALIDATORS_EXPORT Grammar : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Class Specific Types // // DTDGrammarType - Indicate this Grammar is built from a DTD. // SchemaGrammarType - Indicate this Grammar is built from a Schema. // // TOP_LEVEL_SCOPE - outermost scope level (i.e. global) of a declaration. // For DTD, all element decls and attribute decls always // have TOP_LEVEL_SCOPE. For schema, it may vary if // it is inside a complex type. // // UNKNOWN_SCOPE - unknown scope level. None of the decls should have this. // // ----------------------------------------------------------------------- enum GrammarType { DTDGrammarType , SchemaGrammarType , UnKnown }; enum { // These are well-known values that must simply be larger // than any reasonable scope UNKNOWN_SCOPE = UINT_MAX - 0 , TOP_LEVEL_SCOPE = UINT_MAX - 1 }; // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- virtual ~Grammar(){}; // ----------------------------------------------------------------------- // Virtual Getter methods // ----------------------------------------------------------------------- virtual GrammarType getGrammarType() const =0; virtual const XMLCh* getTargetNamespace() const =0; virtual bool getValidated() const = 0; // Element Decl // this method should only be used while the grammar is being // constructed, not while it is being used // in a validation episode! virtual XMLElementDecl* findOrAddElemDecl ( const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const prefixName , const XMLCh* const qName , unsigned int scope , bool& wasAdded ) = 0; virtual XMLSize_t getElemId ( const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const qName , unsigned int scope ) const = 0; virtual const XMLElementDecl* getElemDecl ( const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const qName , unsigned int scope ) const = 0; virtual XMLElementDecl* getElemDecl ( const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const qName , unsigned int scope ) = 0; virtual const XMLElementDecl* getElemDecl ( const unsigned int elemId ) const = 0; virtual XMLElementDecl* getElemDecl ( const unsigned int elemId ) = 0; // Notation virtual const XMLNotationDecl* getNotationDecl ( const XMLCh* const notName ) const=0; virtual XMLNotationDecl* getNotationDecl ( const XMLCh* const notName )=0; // ----------------------------------------------------------------------- // Virtual Setter methods // ----------------------------------------------------------------------- virtual XMLElementDecl* putElemDecl ( const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const prefixName , const XMLCh* const qName , unsigned int scope , const bool notDeclared = false ) = 0; virtual XMLSize_t putElemDecl ( XMLElementDecl* const elemDecl , const bool notDeclared = false ) = 0; virtual XMLSize_t putNotationDecl ( XMLNotationDecl* const notationDecl ) const=0; virtual void setValidated(const bool newState) = 0; // ----------------------------------------------------------------------- // Virtual methods // ----------------------------------------------------------------------- virtual void reset()=0; virtual void setGrammarDescription( XMLGrammarDescription*) = 0; virtual XMLGrammarDescription* getGrammarDescription() const = 0; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(Grammar) static void storeGrammar(XSerializeEngine& serEng , Grammar* const grammar); static Grammar* loadGrammar(XSerializeEngine& serEng); protected : // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- Grammar(){}; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- Grammar(const Grammar&); Grammar& operator=(const Grammar&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/common/CMUnaryOp.hpp000644 000765 000024 00000006021 13241160333 024247 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: CMUnaryOp.hpp 677396 2008-07-16 19:36:20Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_CMUNARYOP_HPP) #define XERCESC_INCLUDE_GUARD_CMUNARYOP_HPP #include XERCES_CPP_NAMESPACE_BEGIN class CMStateSet; class CMUnaryOp : public CMNode { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- CMUnaryOp ( ContentSpecNode::NodeTypes type , CMNode* const nodeToAdopt , unsigned int maxStates , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~CMUnaryOp(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- const CMNode* getChild() const; CMNode* getChild(); // ----------------------------------------------------------------------- // Implementation of the public CMNode virtual interface // ----------------------------------------------------------------------- virtual void orphanChild(); protected : // ----------------------------------------------------------------------- // Implementation of the protected CMNode virtual interface // ----------------------------------------------------------------------- void calcFirstPos(CMStateSet& toSet) const; void calcLastPos(CMStateSet& toSet) const; private : // ----------------------------------------------------------------------- // Private data members // // fChild // This is the reference to the one child that we have for this // unary operation. We own it. // ----------------------------------------------------------------------- CMNode* fChild; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- CMUnaryOp(const CMUnaryOp&); CMUnaryOp& operator=(const CMUnaryOp&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/common/DFAContentModel.cpp000644 000765 000024 00000203013 13241160333 025333 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DFAContentModel.cpp 1805934 2017-08-23 16:05:11Z scantor $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN struct CMStateSetHasher { XMLSize_t getHashVal(const void *const key, XMLSize_t mod) { const CMStateSet* const pkey = (const CMStateSet*) key; return ((pkey->hashCode()) % mod); } bool equals(const void *const key1, const void *const key2) { const CMStateSet* const pkey1 = (const CMStateSet*) key1; const CMStateSet* const pkey2 = (const CMStateSet*) key2; return (*pkey1==*pkey2); } }; // --------------------------------------------------------------------------- // DFAContentModel: Constructors and Destructor // --------------------------------------------------------------------------- DFAContentModel::DFAContentModel( const bool dtd , ContentSpecNode* const elemContentSpec , MemoryManager* const manager) : fElemMap(0) , fElemMapType(0) , fElemMapSize(0) , fEmptyOk(false) , fEOCPos(0) , fFinalStateFlags(0) , fFollowList(0) , fHeadNode(0) , fLeafCount(0) , fLeafList(0) , fLeafListType(0) , fTransTable(0) , fTransTableSize(0) , fCountingStates(0) , fDTD(dtd) , fIsMixed(false) , fLeafNameTypeVector(0) , fMemoryManager(manager) { // And build the DFA data structures buildDFA(elemContentSpec); } DFAContentModel::DFAContentModel( const bool dtd , ContentSpecNode* const elemContentSpec , const bool isMixed , MemoryManager* const manager): fElemMap(0) , fElemMapType(0) , fElemMapSize(0) , fEmptyOk(false) , fEOCPos(0) , fFinalStateFlags(0) , fFollowList(0) , fHeadNode(0) , fLeafCount(0) , fLeafList(0) , fLeafListType(0) , fTransTable(0) , fTransTableSize(0) , fCountingStates(0) , fDTD(dtd) , fIsMixed(isMixed) , fLeafNameTypeVector(0) , fMemoryManager(manager) { // And build the DFA data structures buildDFA(elemContentSpec); } DFAContentModel::~DFAContentModel() { // // Clean up all the stuff that is not just temporary representation // data that was cleaned up after building the DFA. // fMemoryManager->deallocate(fFinalStateFlags); //delete [] fFinalStateFlags; unsigned int index; for (index = 0; index < fTransTableSize; index++) fMemoryManager->deallocate(fTransTable[index]); //delete [] fTransTable[index]; fMemoryManager->deallocate(fTransTable); //delete [] fTransTable; if(fCountingStates) { for (unsigned int j = 0; j < fTransTableSize; ++j) delete fCountingStates[j]; fMemoryManager->deallocate(fCountingStates); } for (index = 0; index < fLeafCount; index++) delete fElemMap[index]; fMemoryManager->deallocate(fElemMap); //delete [] fElemMap; fMemoryManager->deallocate(fElemMapType); //delete [] fElemMapType; fMemoryManager->deallocate(fLeafListType); //delete [] fLeafListType; delete fLeafNameTypeVector; } // --------------------------------------------------------------------------- // DFAContentModel: Implementation of the ContentModel virtual interface // --------------------------------------------------------------------------- bool DFAContentModel::validateContent( QName** const children , XMLSize_t childCount , unsigned int , XMLSize_t* indexFailingChild , MemoryManager* const) const { // // If there are no children, then either we fail on the 0th element // or we return success. It depends upon whether this content model // accepts empty content, which we determined earlier. // if (!childCount) { // success if(fEmptyOk) return true; *indexFailingChild=0; return false; } // // Lets loop through the children in the array and move our way // through the states. Note that we use the fElemMap array to map // an element index to a state index. // unsigned int curState = 0; unsigned int nextState = 0; unsigned int loopCount = 0; unsigned int childIndex = 0; for (; childIndex < childCount; childIndex++) { // Get the current element index out const QName* curElem = children[childIndex]; const XMLCh* curElemRawName = 0; if (fDTD) curElemRawName = curElem->getRawName(); // If this is text in a Schema mixed content model, skip it. if ( fIsMixed && ( curElem->getURI() == XMLElementDecl::fgPCDataElemId)) continue; // Look up this child in our element map unsigned int elemIndex = 0; for (; elemIndex < fElemMapSize; elemIndex++) { const QName* inElem = fElemMap[elemIndex]; if (fDTD) { if (XMLString::equals(inElem->getRawName(), curElemRawName)) { nextState = fTransTable[curState][elemIndex]; if (nextState != XMLContentModel::gInvalidTrans) break; } } else { ContentSpecNode::NodeTypes type = fElemMapType[elemIndex]; if (type == ContentSpecNode::Leaf) { if ((inElem->getURI() == curElem->getURI()) && (XMLString::equals(inElem->getLocalPart(), curElem->getLocalPart()))) { nextState = fTransTable[curState][elemIndex]; if (nextState != XMLContentModel::gInvalidTrans) break; } } else if ((type & 0x0f)== ContentSpecNode::Any) { nextState = fTransTable[curState][elemIndex]; if (nextState != XMLContentModel::gInvalidTrans) break; } else if ((type & 0x0f) == ContentSpecNode::Any_NS) { if (inElem->getURI() == curElem->getURI()) { nextState = fTransTable[curState][elemIndex]; if (nextState != XMLContentModel::gInvalidTrans) break; } } else if ((type & 0x0f) == ContentSpecNode::Any_Other) { // Here we assume that empty string has id 1. // unsigned int uriId = curElem->getURI(); if (uriId != 1 && uriId != inElem->getURI()) { nextState = fTransTable[curState][elemIndex]; if (nextState != XMLContentModel::gInvalidTrans) break; } } } }//for elemIndex // If "nextState" is -1, we found a match, but the transition is invalid if (nextState == XMLContentModel::gInvalidTrans) { *indexFailingChild=childIndex; return false; } // If we didn't find it, then obviously not valid if (elemIndex == fElemMapSize) { *indexFailingChild=childIndex; return false; } unsigned int nextLoop = 0; if(!handleRepetitions(curElem, curState, loopCount, nextState, nextLoop, elemIndex, 0)) { *indexFailingChild=childIndex; return false; } curState = nextState; loopCount = nextLoop; nextState = 0; }//for childIndex // // We transitioned all the way through the input list. However, that // does not mean that we ended in a final state. So check whether // our ending state is a final state. // if (!fFinalStateFlags[curState]) { *indexFailingChild=childIndex; return false; } // verify if we exited before the minOccurs was satisfied if (fCountingStates != 0) { Occurence* o = fCountingStates[curState]; if (o != 0 && loopCount < (unsigned int)o->minOccurs) { // not enough loops on the current state to be considered final. *indexFailingChild=childIndex; return false; } } //success return true; } bool DFAContentModel::validateContentSpecial(QName** const children , XMLSize_t childCount , unsigned int , GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool , XMLSize_t* indexFailingChild , MemoryManager* const) const { SubstitutionGroupComparator comparator(pGrammarResolver, pStringPool); if (childCount == 0) { if(fEmptyOk) return true; *indexFailingChild=0; return false; } // // Lets loop through the children in the array and move our way // through the states. Note that we use the fElemMap array to map // an element index to a state index. // unsigned int curState = 0; unsigned int loopCount = 0; unsigned int nextState = 0; unsigned int childIndex = 0; for (; childIndex < childCount; childIndex++) { // Get the current element index out QName* curElem = children[childIndex]; // If this is text in a Schema mixed content model, skip it. if ( fIsMixed && ( curElem->getURI() == XMLElementDecl::fgPCDataElemId)) continue; // Look up this child in our element map unsigned int elemIndex = 0; for (; elemIndex < fElemMapSize; elemIndex++) { QName* inElem = fElemMap[elemIndex]; ContentSpecNode::NodeTypes type = fElemMapType[elemIndex]; if (type == ContentSpecNode::Leaf) { if (comparator.isEquivalentTo(curElem, inElem) ) { nextState = fTransTable[curState][elemIndex]; if (nextState != XMLContentModel::gInvalidTrans) break; } } else if ((type & 0x0f)== ContentSpecNode::Any) { nextState = fTransTable[curState][elemIndex]; if (nextState != XMLContentModel::gInvalidTrans) break; } else if ((type & 0x0f) == ContentSpecNode::Any_NS) { if (inElem->getURI() == curElem->getURI()) { nextState = fTransTable[curState][elemIndex]; if (nextState != XMLContentModel::gInvalidTrans) break; } } else if ((type & 0x0f) == ContentSpecNode::Any_Other) { // Here we assume that empty string has id 1. // unsigned int uriId = curElem->getURI(); if (uriId != 1 && uriId != inElem->getURI()) { nextState = fTransTable[curState][elemIndex]; if (nextState != XMLContentModel::gInvalidTrans) break; } } }//for elemIndex // If "nextState" is -1, we found a match, but the transition is invalid if (nextState == XMLContentModel::gInvalidTrans) { *indexFailingChild=childIndex; return false; } // If we didn't find it, then obviously not valid if (elemIndex == fElemMapSize) { *indexFailingChild=childIndex; return false; } unsigned int nextLoop = 0; if(!handleRepetitions(curElem, curState, loopCount, nextState, nextLoop, elemIndex, &comparator)) { *indexFailingChild=childIndex; return false; } curState = nextState; loopCount = nextLoop; nextState = 0; }//for childIndex // // We transitioned all the way through the input list. However, that // does not mean that we ended in a final state. So check whether // our ending state is a final state. // if (!fFinalStateFlags[curState]) { *indexFailingChild=childIndex; return false; } // verify if we exited before the minOccurs was satisfied if (fCountingStates != 0) { Occurence* o = fCountingStates[curState]; if (o != 0) { if (loopCount < (unsigned int)o->minOccurs) { // not enough loops on the current state. *indexFailingChild=childIndex; return false; } } } //success return true; } bool DFAContentModel::handleRepetitions(const QName* const curElem, unsigned int curState, unsigned int currentLoop, unsigned int& nextState, unsigned int& nextLoop, XMLSize_t elemIndex, SubstitutionGroupComparator * comparator) const { nextLoop = 0; if (fCountingStates != 0) { nextLoop = currentLoop; Occurence* o = fCountingStates[curState]; if (o != 0) { if (curState == nextState) { if (++nextLoop > (unsigned int)o->maxOccurs && o->maxOccurs != -1) { // It's likely that we looped too many times on the current state // however it's possible that we actually matched another particle // which allows the same name. // // Consider: // // // // // // // and // // // // // // // In the DFA there will be two transitions from the current state which // allow "foo". Note that this is not a UPA violation. The ambiguity of which // transition to take is resolved by the current value of the counter. Since // we've already seen enough instances of the first "foo" perhaps there is // another element declaration or wildcard deeper in the element map which // matches. unsigned int tempNextState = 0; while (++elemIndex < fElemMapSize) { QName* inElem = fElemMap[elemIndex]; ContentSpecNode::NodeTypes type = fElemMapType[elemIndex]; if (type == ContentSpecNode::Leaf) { if(comparator!=0) { if (comparator->isEquivalentTo(curElem, inElem) ) { tempNextState = fTransTable[curState][elemIndex]; if (tempNextState != XMLContentModel::gInvalidTrans) break; } } else if (fDTD) { if (XMLString::equals(inElem->getRawName(), curElem->getRawName())) { tempNextState = fTransTable[curState][elemIndex]; if (tempNextState != XMLContentModel::gInvalidTrans) break; } } else { if ((inElem->getURI() == curElem->getURI()) && (XMLString::equals(inElem->getLocalPart(), curElem->getLocalPart()))) { tempNextState = fTransTable[curState][elemIndex]; if (tempNextState != XMLContentModel::gInvalidTrans) break; } } } else if ((type & 0x0f)== ContentSpecNode::Any) { tempNextState = fTransTable[curState][elemIndex]; if (tempNextState != XMLContentModel::gInvalidTrans) break; } else if ((type & 0x0f) == ContentSpecNode::Any_NS) { if (inElem->getURI() == curElem->getURI()) { tempNextState = fTransTable[curState][elemIndex]; if (tempNextState != XMLContentModel::gInvalidTrans) break; } } else if ((type & 0x0f) == ContentSpecNode::Any_Other) { // Here we assume that empty string has id 1. // unsigned int uriId = curElem->getURI(); if (uriId != 1 && uriId != inElem->getURI()) { tempNextState = fTransTable[curState][elemIndex]; if (tempNextState != XMLContentModel::gInvalidTrans) break; } } } // if we still can't find a match, report the error if (elemIndex == fElemMapSize) return false; // if we found a match, set the next state and reset the // counter if the next state is a counting state. nextState = tempNextState; Occurence* o = fCountingStates[nextState]; if (o != 0) { nextLoop = (elemIndex == XMLSize_t (o->elemIndex)) ? 1 : 0; } } } else if (nextLoop < (unsigned int)o->minOccurs) { // not enough loops on the current state. return false; } else { // Exiting a counting state. If we're entering a new // counting state, reset the counter. o = fCountingStates[nextState]; if (o != 0) { nextLoop = (elemIndex == XMLSize_t (o->elemIndex)) ? 1 : 0; } } } else { o = fCountingStates[nextState]; if (o != 0) { // Entering a new counting state. Reset the counter. // If we've already seen one instance of the looping // particle set the counter to 1, otherwise set it // to 0. nextLoop = (elemIndex == XMLSize_t (o->elemIndex)) ? 1 : 0; } } } return true; } // --------------------------------------------------------------------------- // DFAContentModel: Private helper methods // --------------------------------------------------------------------------- void DFAContentModel::buildDFA(ContentSpecNode* const curNode) { unsigned int index; // // The first step we need to take is to rewrite the content model using // our CMNode objects, and in the process get rid of any repetition short // cuts, converting them into '*' style repetitions or getting rid of // repetitions altogether. // // The conversions done are: // // x+ -> (x|x*) // x? -> (x|epsilon) // // This is a relatively complex scenario. What is happening is that we // create a top level binary node of which the special EOC value is set // as the right side node. The the left side is set to the rewritten // syntax tree. The source is the original content model info from the // decl pool. The rewrite is done by buildSyntaxTree() which recurses the // decl pool's content of the element and builds a new tree in the // process. // // Note that, during this operation, we set each non-epsilon leaf node's // DFA state position and count the number of such leafs, which is left // in the fLeafCount member. // fLeafCount=countLeafNodes(curNode); fEOCPos = fLeafCount++; // We need to build an array of references to the non-epsilon // leaf nodes. We will put them in the array according to their position values // fLeafList = (CMLeaf**) fMemoryManager->allocate(fLeafCount*sizeof(CMLeaf*)); //new CMLeaf*[fLeafCount]; fLeafListType = (ContentSpecNode::NodeTypes*) fMemoryManager->allocate ( fLeafCount * sizeof(ContentSpecNode::NodeTypes) ); //new ContentSpecNode::NodeTypes[fLeafCount]; // // And, moving onward... We now need to build the follow position sets // for all the nodes. So we allocate an array of pointers to state sets, // one for each leaf node (i.e. each significant DFA position.) // fFollowList = (CMStateSet**) fMemoryManager->allocate ( fLeafCount * sizeof(CMStateSet*) ); //new CMStateSet*[fLeafCount]; for (index = 0; index < fLeafCount; index++) fFollowList[index] = new (fMemoryManager) CMStateSet(fLeafCount, fMemoryManager); // The buildSyntaxTree function will recursively iterate over the ContentSpecNode // and build the CMNode hierarchy; it will also put every leaf node in the fLeafList // array, then calculate the first and last position sets of each node. This is // cached away in each of the nodes. // // Along the way we also set the leaf count in each node as the maximum // state count. They must know this in order to create their first/last // position sets. // unsigned int counter=0; CMNode* nodeOrgContent = buildSyntaxTree(curNode, counter); // // Check to see whether this content model can handle an empty content, // which is something we need to optimize by looking now before we // throw away the info that would tell us that. // // If the left node of the head (the top level of the original content) // is nullable, then its true. // fEmptyOk = nodeOrgContent->isNullable(); // // And handle specially the EOC node, which also must be numbered and // counted as a non-epsilon leaf node. It could not be handled in the // above tree build because it was created before all that started. We // save the EOC position since its used during the DFA building loop. // CMLeaf* nodeEOC = new (fMemoryManager) CMLeaf ( new (fMemoryManager) QName ( XMLUni::fgZeroLenString , XMLUni::fgZeroLenString , XMLContentModel::gEOCFakeId , fMemoryManager ) , fEOCPos , true , fLeafCount , fMemoryManager ); fHeadNode = new (fMemoryManager) CMBinaryOp ( ContentSpecNode::Sequence , nodeOrgContent , nodeEOC , fLeafCount , fMemoryManager ); // Put also the final EOC node in the leaf array fLeafList[counter] = new (fMemoryManager) CMLeaf ( nodeEOC->getElement() , nodeEOC->getPosition() , fLeafCount , fMemoryManager ); fLeafListType[counter] = ContentSpecNode::Leaf; // // Now handle our top level. We use our left child's last pos set and our // right child's first pos set, so get them now for convenience. // const CMStateSet& last = nodeOrgContent->getLastPos(); const CMStateSet& first = nodeEOC->getFirstPos(); // // Now, for every position which is in our left child's last set // add all of the states in our right child's first set to the // follow set for that position. // CMStateSetEnumerator enumLast(&last); while(enumLast.hasMoreElements()) { XMLSize_t index=enumLast.nextElement(); *fFollowList[index] |= first; } // // And finally the big push... Now we build the DFA using all the states // and the tree we've built up. First we set up the various data // structures we are going to use while we do this. // // First of all we need an array of unique element ids in our content // model. For each transition table entry, we need a set of contiguous // indices to represent the transitions for a particular input element. // So we need to a zero based range of indexes that map to element types. // This element map provides that mapping. // fElemMap = (QName**) fMemoryManager->allocate ( fLeafCount * sizeof(QName*) ); //new QName*[fLeafCount]; fElemMapType = (ContentSpecNode::NodeTypes*) fMemoryManager->allocate ( fLeafCount * sizeof(ContentSpecNode::NodeTypes) ); //new ContentSpecNode::NodeTypes[fLeafCount]; fElemMapSize = 0; Occurence** elemOccurenceMap=0; for (unsigned int outIndex = 0; outIndex < fLeafCount; outIndex++) { fElemMap[outIndex] = new (fMemoryManager) QName(fMemoryManager); if ( (fLeafListType[outIndex] & 0x0f) != ContentSpecNode::Leaf ) if (!fLeafNameTypeVector) fLeafNameTypeVector = new (fMemoryManager) ContentLeafNameTypeVector(fMemoryManager); // Get the current leaf's element index CMLeaf* leaf=fLeafList[outIndex]; const QName* element = leaf->getElement(); const XMLCh* elementRawName = 0; if (fDTD && element) elementRawName = element->getRawName(); // See if the current leaf node's element index is in the list unsigned int inIndex = 0; for (; inIndex < fElemMapSize; inIndex++) { const QName* inElem = fElemMap[inIndex]; if (fDTD) { if (XMLString::equals(inElem->getRawName(), elementRawName)) { break; } } else { if ((fElemMapType[inIndex] == fLeafListType[outIndex]) && (inElem->getURI() == element->getURI()) && (XMLString::equals(inElem->getLocalPart(), element->getLocalPart()))) { break; } } } // If it was not in the list, then add it and bump the map size if (inIndex == fElemMapSize) { fElemMap[fElemMapSize]->setValues(*element); if(leaf->isRepeatableLeaf()) { if (elemOccurenceMap == 0) { elemOccurenceMap = (Occurence**)fMemoryManager->allocate(fLeafCount*sizeof(Occurence*)); memset(elemOccurenceMap, 0, fLeafCount*sizeof(Occurence*)); } elemOccurenceMap[fElemMapSize] = new (fMemoryManager) Occurence(((CMRepeatingLeaf*)leaf)->getMinOccurs(), ((CMRepeatingLeaf*)leaf)->getMaxOccurs(), fElemMapSize); } fElemMapType[fElemMapSize] = fLeafListType[outIndex]; ++fElemMapSize; } } // set up the fLeafNameTypeVector object if there is one. if (fLeafNameTypeVector) { fLeafNameTypeVector->setValues(fElemMap, fElemMapType, fElemMapSize); } /*** * Optimization(Jan, 2001); We sort fLeafList according to * elemIndex which is *uniquely* associated to each leaf. * We are *assuming* that each element appears in at least one leaf. **/ // don't forget to delete it #ifdef OPTIMIZED_BUT_STILL_LINEAR_SEARCH int *fLeafSorter = (int*) fMemoryManager->allocate ( (fLeafCount + fElemMapSize) * sizeof(int) ); //new int[fLeafCount + fElemMapSize]; unsigned int fSortCount = 0; for (unsigned int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) { const QName* element = fElemMap[elemIndex]; const XMLCh* elementRawName = 0; if (fDTD && element) elementRawName = element->getRawName(); for (unsigned int leafIndex = 0; leafIndex < fLeafCount; leafIndex++) { const QName* leaf = fLeafList[leafIndex]->getElement(); if (fDTD) { if (XMLString::equals(leaf->getRawName(), elementRawName)) { fLeafSorter[fSortCount++] = leafIndex; } } else { if ((fElemMapType[elemIndex] == fLeafListType[leafIndex]) && (leaf->getURI() == element->getURI()) && (XMLString::equals(leaf->getLocalPart(), element->getLocalPart()))) { fLeafSorter[fSortCount++] = leafIndex; } } } fLeafSorter[fSortCount++] = -1; } #endif // instead of using a single array with -1 to separate elements, use a bidimensional map unsigned int** fLeafSorter = (unsigned int**)fMemoryManager->allocate(fElemMapSize * sizeof(unsigned int*)); unsigned int* tmpSorter = (unsigned int*)fMemoryManager->allocate(fLeafCount * sizeof(unsigned int)); for (unsigned int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) { const QName* element = fElemMap[elemIndex]; const XMLCh* elementRawName = 0; if (fDTD && element) elementRawName = element->getRawName(); unsigned int fSortCount=0; for (unsigned int leafIndex = 0; leafIndex < fLeafCount; leafIndex++) { const QName* leaf = fLeafList[leafIndex]->getElement(); if (fDTD) { if (XMLString::equals(leaf->getRawName(), elementRawName)) { tmpSorter[fSortCount++] = leafIndex; } } else { if ((fElemMapType[elemIndex] == fLeafListType[leafIndex]) && (leaf->getURI() == element->getURI()) && (XMLString::equals(leaf->getLocalPart(), element->getLocalPart()))) { tmpSorter[fSortCount++] = leafIndex; } } } fLeafSorter[elemIndex]=(unsigned int*)fMemoryManager->allocate((fSortCount+1) * sizeof(unsigned int)); fLeafSorter[elemIndex][0]=fSortCount; for (unsigned int index=0;indexdeallocate(tmpSorter); // // Next lets create some arrays, some that that hold transient info // during the DFA build and some that are permament. These are kind of // sticky since we cannot know how big they will get, but we don't want // to use any collection type classes because of performance. // // Basically they will probably be about fLeafCount*2 on average, but can // be as large as 2^(fLeafCount*2), worst case. So we start with // fLeafCount*4 as a middle ground. This will be very unlikely to ever // have to expand though, it if does, the overhead will be somewhat ugly. // unsigned int curArraySize = fLeafCount * 4; CMStateSet** statesToDo = (CMStateSet**) fMemoryManager->allocate ( curArraySize * sizeof(CMStateSet*) ); //new const CMStateSet*[curArraySize]; fFinalStateFlags = (bool*) fMemoryManager->allocate ( curArraySize * sizeof(bool) ); //new bool[curArraySize]; fTransTable = (unsigned int**) fMemoryManager->allocate ( curArraySize * sizeof(unsigned int*) ); //new unsigned int*[curArraySize]; // // Ok we start with the initial set as the first pos set of the head node // (which is the seq node that holds the content model and the EOC node.) // CMStateSet* setT = new (fMemoryManager) CMStateSet(fHeadNode->getFirstPos()); // // Note on memory leak: Bugzilla#2707: // =================================== // The CMBinary, pointed to by fHeadNode, shall be released by // deleted by itself. // // fLeafList[] maintains its **OWN** copy of CMLeaf to avoid double deletion // of CMLeaf. // delete fHeadNode; // // Init our two state flags. Basically the unmarked state counter is // always chasing the current state counter. When it catches up, that // means we made a pass through that did not add any new states to the // lists, at which time we are done. We could have used a expanding array // of flags which we used to mark off states as we complete them, but // this is easier though less readable maybe. // unsigned int unmarkedState = 0; unsigned int curState = 0; // // Init the first transition table entry, and put the initial state // into the states to do list, then bump the current state. // fTransTable[curState] = makeDefStateList(); statesToDo[curState] = setT; curState++; // // the stateTable is an auxiliary means to fast // identification of new state created (instead // of sequential loop statesToDo to find out), // while the role that statesToDo plays remain unchanged. // RefHashTableOf *stateTable = new (fMemoryManager) RefHashTableOf ( curArraySize , true , fMemoryManager ); //stateTable->put((CMStateSet*)setT, new (fMemoryManager) XMLInteger(0)); // // Ok, almost done with the algorithm from hell... We now enter the // loop where we go until the states done counter catches up with // the states to do counter. // CMStateSet* newSet = 0; while (unmarkedState < curState) { // // Get the next unmarked state out of the list of states to do. // And get the associated transition table entry. // setT = statesToDo[unmarkedState]; unsigned int* transEntry = fTransTable[unmarkedState]; // Mark this one final if it contains the EOC state fFinalStateFlags[unmarkedState] = setT->getBit(fEOCPos); // Bump up the unmarked state count, marking this state done unmarkedState++; #ifdef OPTIMIZED_BUT_STILL_LINEAR_SEARCH // Optimization(Jan, 2001) unsigned int sorterIndex = 0; // Optimization(Jan, 2001) #endif // Loop through each possible input symbol in the element map for (unsigned int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) { // // Build up a set of states which is the union of all of the // follow sets of DFA positions that are in the current state. If // we gave away the new set last time through then create a new // one. Otherwise, zero out the existing one. // if (!newSet) newSet = new (fMemoryManager) CMStateSet ( fLeafCount , fMemoryManager ); else newSet->zeroBits(); #ifdef OBSOLETED // unoptimized code for (unsigned int leafIndex = 0; leafIndex < fLeafCount; leafIndex++) { // If this leaf index (DFA position) is in the current set... if (setT->getBit(leafIndex)) { // // If this leaf is the current input symbol, then we want // to add its follow list to the set of states to transition // to from the current state. // const QName* leaf = fLeafList[leafIndex]->getElement(); const QName* element = fElemMap[elemIndex]; if (fDTD) { if (XMLString::equals(leaf->getRawName(), element->getRawName())) { *newSet |= *fFollowList[leafIndex]; } } else { if ((leaf->getURI() == element->getURI()) && (XMLString::equals(leaf->getLocalPart(), element->getLocalPart()))) { *newSet |= *fFollowList[leafIndex]; } } } } // for leafIndex #endif #ifdef OPTIMIZED_BUT_STILL_LINEAR_SEARCH // Optimization(Jan, 2001) int leafIndex = fLeafSorter[sorterIndex++]; while (leafIndex != -1) { // If this leaf index (DFA position) is in the current set... if (setT->getBit(leafIndex)) { // // If this leaf is the current input symbol, then we // want to add its follow list to the set of states to // transition to from the current state. // *newSet |= *fFollowList[leafIndex]; } leafIndex = fLeafSorter[sorterIndex++]; } // while (leafIndex != -1) #endif unsigned int* fLeafIndexes=fLeafSorter[elemIndex]; unsigned int fNumItems=fLeafIndexes[0]; if(fNumItems!=0) { // The algorithm requires finding the leaf that is present both in the bitfield of the current state, and in the // list of places where the currently tested item can appear. When this occurs, the follow list of this parent item // is added to the bitfield representing the next state. // Both the bitfield and the list of places are sorted, so we can analyze them in two ways; either iterating over the // parent items, testing the bitfield for the existence of the parent (N times a constant Tb), or by iterating over the // bitfield (restricted to the range of the sorted list of places), using a binary search to locate the leaf in the // sorted list of places (M times log(N) testing operations Ts) // Assuming that the time to test a bit is roughly the same of the time needed to compute the average of two integers, // plus a couple of comparisons and additions, we compare N agains M*log(N) to decide which algorithm should be faster given // the two sets if(fNumItems <= setT->getBitCountInRange(fLeafIndexes[1], fLeafIndexes[fNumItems])*log((float)fNumItems)) { for(unsigned int i=1; i<=fNumItems; ++i) if(setT->getBit(fLeafIndexes[i])) { // // If this leaf is the current input symbol, then we // want to add its follow list to the set of states to // transition to from the current state. // *newSet |= *fFollowList[ fLeafIndexes[i] ]; } } else { // Further optimization: given that the bitfield enumerator returns the numbers in order, // every time we raise the lower marker we know it will true also for the next bits, so // the next binary search will not start from 1 but from this index unsigned int lowIndex = 1; // Start the enumerator from the first index in the sorted list of places, // as nothing before that point will match CMStateSetEnumerator enumBits(setT, fLeafIndexes[1]); while(enumBits.hasMoreElements()) { unsigned int bitIndex=enumBits.nextElement(); // if this leaf is greater than the last index in the sorted list of places, // nothing can be found from now on, so get out of here if(bitIndex > fLeafIndexes[fNumItems]) break; // Check if this leaf index (DFA position) is in the current set // (using binary search: the indexes are sorted) unsigned int first=lowIndex,last=fNumItems,i; while(first<=last) { i=(first+last)/2; if(fLeafIndexes[i]>bitIndex) last=i-1; else if(fLeafIndexes[i]isEmpty()) { // // Search the 'states to do' list to see if this new // state set is already in there. // /*** unsigned int stateIndex = 0; for (; stateIndex < curState; stateIndex++) { if (*statesToDo[stateIndex] == *newSet) break; } ***/ XMLInteger *stateObj = stateTable->get(newSet); unsigned int stateIndex = (stateObj == 0 ? curState : stateObj->intValue()); // If we did not find it, then add it if (stateIndex == curState) { // // Put this new state into the states to do and init // a new entry at the same index in the transition // table. // statesToDo[curState] = newSet; fTransTable[curState] = makeDefStateList(); stateTable->put ( newSet , new (fMemoryManager) XMLInteger(curState) ); // We now have a new state to do so bump the count curState++; // // Null out the new set to indicate we adopted it. This // will cause the creation of a new set on the next time // around the loop. // newSet = 0; } // // Now set this state in the transition table's entry for this // element (using its index), with the DFA state we will move // to from the current state when we see this input element. // transEntry[elemIndex] = stateIndex; // Expand the arrays if we're full if (curState == curArraySize) { // // Yikes, we overflowed the initial array size, so we've // got to expand all of these arrays. So adjust up the // size by 50% and allocate new arrays. // const unsigned int newSize = (unsigned int)(curArraySize * 1.5); CMStateSet** newToDo = (CMStateSet**) fMemoryManager->allocate ( newSize * sizeof(CMStateSet*) ); //new const CMStateSet*[newSize]; bool* newFinalFlags = (bool*) fMemoryManager->allocate ( newSize * sizeof(bool) ); //new bool[newSize]; unsigned int** newTransTable = (unsigned int**) fMemoryManager->allocate ( newSize * sizeof(unsigned int*) ); //new unsigned int*[newSize]; // Copy over all of the existing content for (unsigned int expIndex = 0; expIndex < curArraySize; expIndex++) { newToDo[expIndex] = statesToDo[expIndex]; newFinalFlags[expIndex] = fFinalStateFlags[expIndex]; newTransTable[expIndex] = fTransTable[expIndex]; } // Clean up the old stuff fMemoryManager->deallocate(statesToDo); //delete [] statesToDo; fMemoryManager->deallocate(fFinalStateFlags); //delete [] fFinalStateFlags; fMemoryManager->deallocate(fTransTable); //delete [] fTransTable; // Store the new array size and pointers curArraySize = newSize; statesToDo = newToDo; fFinalStateFlags = newFinalFlags; fTransTable = newTransTable; } //if (curState == curArraySize) } //if (!newSet->isEmpty()) } // for elemIndex } //while // Store the current state count in the trans table size fTransTableSize = curState; // // Fill in the occurence information for each looping state // if we're using counters. // if (elemOccurenceMap != 0) { fCountingStates = (Occurence**)fMemoryManager->allocate(fTransTableSize*sizeof(Occurence*)); memset(fCountingStates, 0, fTransTableSize*sizeof(Occurence*)); for (unsigned int i = 0; i < fTransTableSize; ++i) { unsigned int * transitions = fTransTable[i]; for (unsigned int j = 0; j < fElemMapSize; ++j) { if (i == transitions[j]) { Occurence* old=elemOccurenceMap[j]; if(old!=0) fCountingStates[i] = new (fMemoryManager) Occurence(old->minOccurs, old->maxOccurs, old->elemIndex); break; } } } for (unsigned int j = 0; j < fLeafCount; ++j) { if(elemOccurenceMap[j]!=0) delete elemOccurenceMap[j]; } fMemoryManager->deallocate(elemOccurenceMap); } // If the last temp set was not stored, then clean it up if (newSet) delete newSet; // // Now we can clean up all of the temporary data that was needed during // DFA build. // for (index = 0; index < fLeafCount; index++) delete fFollowList[index]; fMemoryManager->deallocate(fFollowList); //delete [] fFollowList; // // removeAll() will delete all data, XMLInteger, // while the keys are to be deleted by the // deletion of statesToDo. // delete stateTable; for (index = 0; index < curState; index++) delete statesToDo[index]; fMemoryManager->deallocate(statesToDo); //delete [] statesToDo; for (index = 0; index < fLeafCount; index++) delete fLeafList[index]; fMemoryManager->deallocate(fLeafList); //delete [] fLeafList; #ifdef OPTIMIZED_BUT_STILL_LINEAR_SEARCH fMemoryManager->deallocate(fLeafSorter); //delete [] fLeafSorter; #endif for (index=0; index < fElemMapSize; index++) fMemoryManager->deallocate(fLeafSorter[index]); fMemoryManager->deallocate(fLeafSorter); } unsigned int DFAContentModel::countLeafNodes(ContentSpecNode* const curNode) { unsigned int count = 0; // Get the spec type of the passed node const ContentSpecNode::NodeTypes curType = curNode->getType(); if ((curType & 0x0f) == ContentSpecNode::Any || (curType & 0x0f) == ContentSpecNode::Any_Other || (curType & 0x0f) == ContentSpecNode::Any_NS || curType == ContentSpecNode::Leaf || curType == ContentSpecNode::Loop) { count++; } else { // // Its not a leaf, so we have to recurse its left and maybe right // nodes. Save both values before we recurse and trash the node. // ContentSpecNode* leftNode = curNode->getFirst(); ContentSpecNode* rightNode = curNode->getSecond(); // Detect if we have a deep tree that can be analyzed using a loop instead of recursion unsigned int nLoopCount=0; ContentSpecNode* cursor=curNode; while(cursor->getType()==ContentSpecNode::Sequence && cursor->getFirst() && cursor->getFirst()->getSecond()==rightNode) { nLoopCount++; cursor=cursor->getFirst(); } if(nLoopCount!=0) { count += countLeafNodes(cursor); for(unsigned int i=0;igetType(); if ((curType & 0x0f) == ContentSpecNode::Any || (curType & 0x0f) == ContentSpecNode::Any_Other || (curType & 0x0f) == ContentSpecNode::Any_NS) { retNode = new (fMemoryManager) CMAny ( curType , curNode->getElement()->getURI() , curIndex , fLeafCount , fMemoryManager ); fLeafList[curIndex] = new (fMemoryManager) CMLeaf ( new (fMemoryManager) QName ( XMLUni::fgZeroLenString , XMLUni::fgZeroLenString , curNode->getElement()->getURI() , fMemoryManager ) , curIndex , true , fLeafCount , fMemoryManager ); fLeafListType[curIndex] = curType; ++curIndex; } else if (curType == ContentSpecNode::Leaf) { // // Create a new leaf node, and pass it the current leaf count, which // is its DFA state position. Bump the leaf count after storing it. // This makes the positions zero based since we store first and then // increment. // retNode = new (fMemoryManager) CMLeaf ( curNode->getElement() , curIndex , fLeafCount , fMemoryManager ); fLeafList[curIndex] = new (fMemoryManager) CMLeaf ( curNode->getElement() , curIndex , fLeafCount , fMemoryManager ); fLeafListType[curIndex] = ContentSpecNode::Leaf; ++curIndex; } else if (curType == ContentSpecNode::Loop) { // // Create a new leaf node, and pass it the current leaf count, which // is its DFA state position. Bump the leaf count after storing it. // This makes the positions zero based since we store first and then // increment. // retNode = new (fMemoryManager) CMRepeatingLeaf ( curNode->getFirst()->getElement() , curNode->getMinOccurs() , curNode->getMaxOccurs() , curIndex , fLeafCount , fMemoryManager ); fLeafList[curIndex] = new (fMemoryManager) CMRepeatingLeaf ( curNode->getFirst()->getElement() , curNode->getMinOccurs() , curNode->getMaxOccurs() , curIndex , fLeafCount , fMemoryManager ); fLeafListType[curIndex] = curNode->getFirst()->getType(); ++curIndex; } else { // // Its not a leaf, so we have to recurse its left and maybe right // nodes. Save both values before we recurse and trash the node. // ContentSpecNode* leftNode = curNode->getFirst(); ContentSpecNode* rightNode = curNode->getSecond(); // Detect if we have a deep tree that can be analyzed using a loop instead of recursion unsigned int nLoopCount=0; ContentSpecNode* cursor=curNode; while(cursor->getType()==ContentSpecNode::Sequence && cursor->getFirst() && cursor->getFirst()->getSecond()==rightNode) { nLoopCount++; cursor=cursor->getFirst(); } if(nLoopCount!=0) { retNode = buildSyntaxTree(cursor, curIndex); for(unsigned int i=0;igetLastPos(); const CMStateSet& first = newRight->getFirstPos(); // // Now, for every position which is in our left child's last set // add all of the states in our right child's first set to the // follow set for that position. // CMStateSetEnumerator enumLast(&last); while(enumLast.hasMoreElements()) { XMLSize_t index=enumLast.nextElement(); *fFollowList[index] |= first; } retNode = new (fMemoryManager) CMBinaryOp ( ContentSpecNode::Sequence , retNode , newRight , fLeafCount , fMemoryManager ); } return retNode; } if (((curType & 0x0f) == ContentSpecNode::Choice) || ((curType & 0x0f) == ContentSpecNode::Sequence)) { // // Recurse on both children, and return a binary op node with the // two created sub nodes as its children. The node type is the // same type as the source. // CMNode* newLeft = buildSyntaxTree(leftNode, curIndex); CMNode* newRight = buildSyntaxTree(rightNode, curIndex); if(((curType & 0x0f) == ContentSpecNode::Sequence)) { // // Now handle our level. We use our left child's last pos set and our // right child's first pos set, so get them now for convenience. // const CMStateSet& last = newLeft->getLastPos(); const CMStateSet& first = newRight->getFirstPos(); // // Now, for every position which is in our left child's last set // add all of the states in our right child's first set to the // follow set for that position. // CMStateSetEnumerator enumLast(&last); while(enumLast.hasMoreElements()) { XMLSize_t index=enumLast.nextElement(); *fFollowList[index] |= first; } } retNode = new (fMemoryManager) CMBinaryOp ( curType , newLeft , newRight , fLeafCount , fMemoryManager ); } else if (curType == ContentSpecNode::ZeroOrMore || curType == ContentSpecNode::ZeroOrOne || curType == ContentSpecNode::OneOrMore) { CMNode* newChild = buildSyntaxTree(leftNode, curIndex); if (curType == ContentSpecNode::ZeroOrMore || curType == ContentSpecNode::OneOrMore) { // // Now handle our level. We use our own first and last position // sets, so get them up front. // const CMStateSet& first = newChild->getFirstPos(); const CMStateSet& last = newChild->getLastPos(); // // For every position which is in our last position set, add all // of our first position states to the follow set for that // position. // CMStateSetEnumerator enumLast(&last); while(enumLast.hasMoreElements()) { XMLSize_t index=enumLast.nextElement(); *fFollowList[index] |= first; } } // This one is fine as is, just change to our form retNode = new (fMemoryManager) CMUnaryOp ( curType , newChild , fLeafCount , fMemoryManager ); } else { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_UnknownCMSpecType, fMemoryManager); } } // fault in the first and last pos, then delete it children retNode->getFirstPos(); retNode->getLastPos(); retNode->orphanChild(); return retNode; } // // gInvalidTrans is used to represent bad transitions in the transition table // entry for each state. So each entry is initialized to that value. This // method creates a new entry and initializes it. // unsigned int* DFAContentModel::makeDefStateList() const { unsigned int* retArray = (unsigned int*) fMemoryManager->allocate ( fElemMapSize * sizeof(unsigned int) ); //new unsigned int[fElemMapSize]; for (unsigned int index = 0; index < fElemMapSize; index++) retArray[index] = XMLContentModel::gInvalidTrans; return retArray; } ContentLeafNameTypeVector* DFAContentModel::getContentLeafNameTypeVector() const { //later change it to return the data member return fLeafNameTypeVector; } void DFAContentModel::checkUniqueParticleAttribution (SchemaGrammar* const pGrammar, GrammarResolver* const pGrammarResolver, XMLStringPool* const pStringPool, XMLValidator* const pValidator, unsigned int* const pContentSpecOrgURI, const XMLCh* pComplexTypeName /*= 0*/) { SubstitutionGroupComparator comparator(pGrammarResolver, pStringPool); unsigned int i, j, k; // Rename the URI back for (i = 0; i < fElemMapSize; i++) { unsigned int orgURIIndex = fElemMap[i]->getURI(); if ((orgURIIndex != XMLContentModel::gEOCFakeId) && (orgURIIndex != XMLContentModel::gEpsilonFakeId) && (orgURIIndex != XMLElementDecl::fgInvalidElemId) && (orgURIIndex != XMLElementDecl::fgPCDataElemId)) { fElemMap[i]->setURI(pContentSpecOrgURI[orgURIIndex]); } } // Unique Particle Attribution // Store the conflict results between any two elements in fElemMap // 0 - not yet tested, 1 - conflict, (-1) - no conflict signed char** conflictTable = (signed char**) fMemoryManager->allocate ( fElemMapSize * sizeof(signed char*) ); // initialize the conflict table for (j = 0; j < fElemMapSize; j++) { conflictTable[j] = (signed char*) fMemoryManager->allocate ( fElemMapSize * sizeof(signed char) ); memset(conflictTable[j], 0, fElemMapSize*sizeof(signed char)); } // for each state, check whether it has overlap transitions for (i = 0; i < fTransTableSize; i++) { for (j = 0; j < fElemMapSize; j++) { for (k = j+1; k < fElemMapSize; k++) { if (fTransTable[i][j] != XMLContentModel::gInvalidTrans && fTransTable[i][k] != XMLContentModel::gInvalidTrans && conflictTable[j][k] == 0) { // If this is text in a Schema mixed content model, skip it. if ( fIsMixed && (( fElemMap[j]->getURI() == XMLElementDecl::fgPCDataElemId) || ( fElemMap[k]->getURI() == XMLElementDecl::fgPCDataElemId))) continue; if (XercesElementWildcard::conflict(pGrammar, fElemMapType[j], fElemMap[j], fElemMapType[k], fElemMap[k], &comparator)) { if (fCountingStates != 0) { Occurence* o = fCountingStates[i]; // If "i" is a counting state and exactly one of the transitions // loops back to "i" then the two particles do not overlap if // minOccurs == maxOccurs. if (o != 0 && ((fTransTable[i][j] == i) ^ (fTransTable[i][k] == i)) && o->minOccurs == o->maxOccurs) { conflictTable[j][k] = -1; continue; } } conflictTable[j][k] = 1; XMLBuffer buf1(1023, fMemoryManager); if (((fElemMapType[j] & 0x0f) == ContentSpecNode::Any) || ((fElemMapType[j] & 0x0f) == ContentSpecNode::Any_NS)) buf1.set(SchemaSymbols::fgATTVAL_TWOPOUNDANY); else if ((fElemMapType[j] & 0x0f) == ContentSpecNode::Any_Other) buf1.set(SchemaSymbols::fgATTVAL_TWOPOUNDOTHER); else buf1.set(fElemMap[j]->getRawName()); XMLBuffer buf2(1023, fMemoryManager); if (((fElemMapType[k] & 0x0f) == ContentSpecNode::Any) || ((fElemMapType[k] & 0x0f) == ContentSpecNode::Any_NS)) buf2.set(SchemaSymbols::fgATTVAL_TWOPOUNDANY); else if ((fElemMapType[k] & 0x0f) == ContentSpecNode::Any_Other) buf2.set(SchemaSymbols::fgATTVAL_TWOPOUNDOTHER); else buf2.set(fElemMap[k]->getRawName()); pValidator->emitError(XMLValid::UniqueParticleAttributionFail, pComplexTypeName, buf1.getRawBuffer(), buf2.getRawBuffer()); } else conflictTable[j][k] = -1; } } } } for (i = 0; i < fElemMapSize; i++) fMemoryManager->deallocate(conflictTable[i]); fMemoryManager->deallocate(conflictTable); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/common/GrammarResolver.cpp000644 000765 000024 00000034264 13241160333 025547 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id $ */ #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // GrammarResolver: Constructor and Destructor // --------------------------------------------------------------------------- GrammarResolver::GrammarResolver(XMLGrammarPool* const gramPool , MemoryManager* const manager) :fCacheGrammar(false) ,fUseCachedGrammar(false) ,fGrammarPoolFromExternalApplication(true) ,fStringPool(0) ,fGrammarBucket(0) ,fGrammarFromPool(0) ,fDataTypeReg(0) ,fMemoryManager(manager) ,fGrammarPool(gramPool) ,fXSModel(0) ,fGrammarPoolXSModel(0) ,fGrammarsToAddToXSModel(0) { fGrammarBucket = new (manager) RefHashTableOf(29, true, manager); /*** * Grammars in this set are not owned */ fGrammarFromPool = new (manager) RefHashTableOf(29, false, manager); if (!gramPool) { /*** * We need to instantiate a default grammar pool object so that * all grammars and grammar components could be created through * the Factory methods */ fGrammarPool = new (manager) XMLGrammarPoolImpl(manager); fGrammarPoolFromExternalApplication=false; } fStringPool = fGrammarPool->getURIStringPool(); // REVISIT: size fGrammarsToAddToXSModel = new (manager) ValueVectorOf (29, manager); } GrammarResolver::~GrammarResolver() { delete fGrammarBucket; delete fGrammarFromPool; if (fDataTypeReg) delete fDataTypeReg; /*** * delete the grammar pool iff it is created by this resolver */ if (!fGrammarPoolFromExternalApplication) delete fGrammarPool; if (fXSModel) delete fXSModel; // don't delete fGrammarPoolXSModel! we don't own it! delete fGrammarsToAddToXSModel; } // --------------------------------------------------------------------------- // GrammarResolver: Getter methods // --------------------------------------------------------------------------- DatatypeValidator* GrammarResolver::getDatatypeValidator(const XMLCh* const uriStr, const XMLCh* const localPartStr) { DatatypeValidator* dv = 0; if (XMLString::equals(uriStr, SchemaSymbols::fgURI_SCHEMAFORSCHEMA)) { if (!fDataTypeReg) { fDataTypeReg = new (fMemoryManager) DatatypeValidatorFactory(fMemoryManager); } dv = fDataTypeReg->getDatatypeValidator(localPartStr); } else { Grammar* grammar = getGrammar(uriStr); if (grammar && grammar->getGrammarType() == Grammar::SchemaGrammarType) { XMLBuffer nameBuf(128, fMemoryManager); nameBuf.set(uriStr); nameBuf.append(chComma); nameBuf.append(localPartStr); dv = ((SchemaGrammar*) grammar)->getDatatypeRegistry()->getDatatypeValidator(nameBuf.getRawBuffer()); } } return dv; } Grammar* GrammarResolver::getGrammar( const XMLCh* const namespaceKey) { if (!namespaceKey) return 0; Grammar* grammar = fGrammarBucket->get(namespaceKey); if (grammar) return grammar; if (fUseCachedGrammar) { grammar = fGrammarFromPool->get(namespaceKey); if (grammar) { return grammar; } else { XMLSchemaDescription* gramDesc = fGrammarPool->createSchemaDescription(namespaceKey); Janitor janName(gramDesc); grammar = fGrammarPool->retrieveGrammar(gramDesc); if (grammar) { fGrammarFromPool->put((void*) grammar->getGrammarDescription()->getGrammarKey(), grammar); } return grammar; } } return 0; } Grammar* GrammarResolver::getGrammar( XMLGrammarDescription* const gramDesc) { if (!gramDesc) return 0; Grammar* grammar = fGrammarBucket->get(gramDesc->getGrammarKey()); if (grammar) return grammar; if (fUseCachedGrammar) { grammar = fGrammarFromPool->get(gramDesc->getGrammarKey()); if (grammar) { return grammar; } else { grammar = fGrammarPool->retrieveGrammar(gramDesc); if (grammar) { fGrammarFromPool->put((void*) grammar->getGrammarDescription()->getGrammarKey(), grammar); } return grammar; } } return 0; } RefHashTableOfEnumerator GrammarResolver::getGrammarEnumerator() const { return RefHashTableOfEnumerator(fGrammarBucket, false, fMemoryManager); } RefHashTableOfEnumerator GrammarResolver::getReferencedGrammarEnumerator() const { return RefHashTableOfEnumerator(fGrammarFromPool, false, fMemoryManager); } RefHashTableOfEnumerator GrammarResolver::getCachedGrammarEnumerator() const { return fGrammarPool->getGrammarEnumerator(); } bool GrammarResolver::containsNameSpace( const XMLCh* const nameSpaceKey ) { if (!nameSpaceKey) return false; if (fGrammarBucket->containsKey(nameSpaceKey)) return true; if (fUseCachedGrammar) { if (fGrammarFromPool->containsKey(nameSpaceKey)) return true; // Lastly, need to check in fGrammarPool XMLSchemaDescription* gramDesc = fGrammarPool->createSchemaDescription(nameSpaceKey); Janitor janName(gramDesc); Grammar* grammar = fGrammarPool->retrieveGrammar(gramDesc); if (grammar) return true; } return false; } void GrammarResolver::putGrammar(Grammar* const grammarToAdopt) { if (!grammarToAdopt) return; /*** * the grammar will be either in the grammarpool, or in the grammarbucket */ if (!fCacheGrammar || !fGrammarPool->cacheGrammar(grammarToAdopt)) { // either we aren't caching or the grammar pool doesn't want it // so we need to look after it fGrammarBucket->put( (void*) grammarToAdopt->getGrammarDescription()->getGrammarKey(), grammarToAdopt ); if (grammarToAdopt->getGrammarType() == Grammar::SchemaGrammarType) { fGrammarsToAddToXSModel->addElement((SchemaGrammar*) grammarToAdopt); } } } // --------------------------------------------------------------------------- // GrammarResolver: methods // --------------------------------------------------------------------------- void GrammarResolver::reset() { fGrammarBucket->removeAll(); fGrammarsToAddToXSModel->removeAllElements(); delete fXSModel; fXSModel = 0; } void GrammarResolver::resetCachedGrammar() { //REVISIT: if the pool is locked this will fail... should throw an exception? fGrammarPool->clear(); // Even though fXSModel and fGrammarPoolXSModel will be invalid don't touch // them here as getXSModel will handle this. //to clear all other references to the grammars just deleted from fGrammarPool fGrammarFromPool->removeAll(); } void GrammarResolver::cacheGrammars() { RefHashTableOfEnumerator grammarEnum(fGrammarBucket, false, fMemoryManager); ValueVectorOf keys(8, fMemoryManager); unsigned int keyCount = 0; // Build key set while (grammarEnum.hasMoreElements()) { XMLCh* grammarKey = (XMLCh*) grammarEnum.nextElementKey(); keys.addElement(grammarKey); keyCount++; } // PSVI: assume everything will be added, if caching fails add grammar back // into vector fGrammarsToAddToXSModel->removeAllElements(); // Cache for (unsigned int i = 0; i < keyCount; i++) { XMLCh* grammarKey = keys.elementAt(i); /*** * It is up to the GrammarPool implementation to handle duplicated grammar */ Grammar* grammar = fGrammarBucket->get(grammarKey); if(fGrammarPool->cacheGrammar(grammar)) { // only orphan grammar if grammar pool accepts caching of it fGrammarBucket->orphanKey(grammarKey); } else if (grammar->getGrammarType() == Grammar::SchemaGrammarType) { // add it back to list of grammars not in grammar pool fGrammarsToAddToXSModel->addElement((SchemaGrammar*) grammar); } } } // --------------------------------------------------------------------------- // GrammarResolver: Setter methods // --------------------------------------------------------------------------- void GrammarResolver::cacheGrammarFromParse(const bool aValue) { reset(); fCacheGrammar = aValue; } Grammar* GrammarResolver::orphanGrammar(const XMLCh* const nameSpaceKey) { if (fCacheGrammar) { Grammar* grammar = fGrammarPool->orphanGrammar(nameSpaceKey); if (grammar) { if (fGrammarFromPool->containsKey(nameSpaceKey)) fGrammarFromPool->removeKey(nameSpaceKey); } // Check to see if it's in fGrammarBucket, since // we put it there if the grammar pool refused to // cache it. else if (fGrammarBucket->containsKey(nameSpaceKey)) { grammar = fGrammarBucket->orphanKey(nameSpaceKey); } return grammar; } else { return fGrammarBucket->orphanKey(nameSpaceKey); } } XSModel *GrammarResolver::getXSModel() { XSModel* xsModel; if (fCacheGrammar || fUseCachedGrammar) { // We know if the grammarpool changed thru caching, orphaning and erasing // but NOT by other mechanisms such as lockPool() or unlockPool() so it // is safest to always get it. The grammarPool XSModel will only be // regenerated if something changed. bool XSModelWasChanged; // The grammarpool will always return an xsmodel, even if it is just // the schema for schema xsmodel... xsModel = fGrammarPool->getXSModel(XSModelWasChanged); if (XSModelWasChanged) { // we know the grammarpool XSModel has changed or this is the // first call to getXSModel if (!fGrammarPoolXSModel && (fGrammarsToAddToXSModel->size() == 0) && !fXSModel) { fGrammarPoolXSModel = xsModel; return fGrammarPoolXSModel; } else { fGrammarPoolXSModel = xsModel; // We had previously augmented the grammar pool XSModel // with our our grammars or we would like to upate it now // so we have to regenerate the XSModel fGrammarsToAddToXSModel->removeAllElements(); RefHashTableOfEnumerator grammarEnum(fGrammarBucket, false, fMemoryManager); while (grammarEnum.hasMoreElements()) { Grammar& grammar = (Grammar&) grammarEnum.nextElement(); if (grammar.getGrammarType() == Grammar::SchemaGrammarType) fGrammarsToAddToXSModel->addElement((SchemaGrammar*)&grammar); } delete fXSModel; if (fGrammarsToAddToXSModel->size()) { fXSModel = new (fMemoryManager) XSModel(fGrammarPoolXSModel, this, fMemoryManager); fGrammarsToAddToXSModel->removeAllElements(); return fXSModel; } fXSModel = 0; return fGrammarPoolXSModel; } } else { // we know that the grammar pool XSModel is the same as before if (fGrammarsToAddToXSModel->size()) { // we need to update our fXSModel with the new grammars if (fXSModel) { xsModel = new (fMemoryManager) XSModel(fXSModel, this, fMemoryManager); fXSModel = xsModel; } else { fXSModel = new (fMemoryManager) XSModel(fGrammarPoolXSModel, this, fMemoryManager); } fGrammarsToAddToXSModel->removeAllElements(); return fXSModel; } // Nothing has changed! if (fXSModel) { return fXSModel; } else if (fGrammarPoolXSModel) { return fGrammarPoolXSModel; } fXSModel = new (fMemoryManager) XSModel(0, this, fMemoryManager); return fXSModel; } } // Not Caching... if (fGrammarsToAddToXSModel->size()) { xsModel = new (fMemoryManager) XSModel(fXSModel, this, fMemoryManager); fGrammarsToAddToXSModel->removeAllElements(); fXSModel = xsModel; } else if (!fXSModel) { // create a new model only if we didn't have one already fXSModel = new (fMemoryManager) XSModel(0, this, fMemoryManager); } return fXSModel; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/common/CMNode.hpp000644 000765 000024 00000013770 13241160333 023550 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: CMNode.hpp 677430 2008-07-16 21:05:31Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_CMNODE_HPP) #define XERCESC_INCLUDE_GUARD_CMNODE_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class CMNode : public XMemory { public : enum { // Special value to indicate a nullable node epsilonNode = UINT_MAX - 1 }; // ----------------------------------------------------------------------- // Constructors and Destructors // ----------------------------------------------------------------------- CMNode ( const ContentSpecNode::NodeTypes type , unsigned int maxStates , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~CMNode(); // ----------------------------------------------------------------------- // Virtual methods to be provided derived node classes // ----------------------------------------------------------------------- virtual void orphanChild() = 0; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- ContentSpecNode::NodeTypes getType() const; const CMStateSet& getFirstPos(); const CMStateSet& getLastPos(); bool isNullable() const; protected : // ----------------------------------------------------------------------- // Protected, abstract methods // ----------------------------------------------------------------------- virtual void calcFirstPos(CMStateSet& toUpdate) const = 0; virtual void calcLastPos(CMStateSet& toUpdate) const = 0; // ----------------------------------------------------------------------- // Protected data members // // fMemoryManager // Pluggable memory manager for dynamic allocation/deallocation. // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- CMNode(); CMNode(const CMNode&); CMNode& operator=(const CMNode&); // ----------------------------------------------------------------------- // Private data members // // fType // The type of node. This indicates whether its a leaf or an // operation. // // fFirstPos // The set of NFA states that represent the entry states of this // node in the DFA. // // fLastPos // The set of NFA states that represent the final states of this // node in the DFA. // // fMaxStates // The maximum number of states that the NFA has, which means the // max number of NFA states that have to be traced in the state // sets during the building of the DFA. Its unfortunate that it // has to be stored redundantly, but we need to fault in the // state set members and they have to be sized to this size. // // fIsNullable // Whether the node can be empty // ----------------------------------------------------------------------- ContentSpecNode::NodeTypes fType; CMStateSet* fFirstPos; CMStateSet* fLastPos; unsigned int fMaxStates; protected: bool fIsNullable; }; // --------------------------------------------------------------------------- // CMNode: Constructors and Destructors // --------------------------------------------------------------------------- inline CMNode::CMNode(const ContentSpecNode::NodeTypes type , unsigned int maxStates , MemoryManager* const manager) : fMemoryManager(manager) , fType(type) , fFirstPos(0) , fLastPos(0) , fMaxStates(maxStates) , fIsNullable(false) { } inline CMNode::~CMNode() { // Clean up any position sets that got created delete fFirstPos; delete fLastPos; } // --------------------------------------------------------------------------- // CMNode: Getter methods // --------------------------------------------------------------------------- inline ContentSpecNode::NodeTypes CMNode::getType() const { return fType; } inline const CMStateSet& CMNode::getFirstPos() { // // Fault in the state set if needed. Since we can't use mutable members // cast off the const'ness. // if (!fFirstPos) { fFirstPos = new (fMemoryManager) CMStateSet(fMaxStates, fMemoryManager); calcFirstPos(*fFirstPos); } return *fFirstPos; } inline const CMStateSet& CMNode::getLastPos() { // // Fault in the state set if needed. Since we can't use mutable members // cast off the const'ness. // if (!fLastPos) { fLastPos = new (fMemoryManager) CMStateSet(fMaxStates, fMemoryManager); calcLastPos(*fLastPos); } return *fLastPos; } inline bool CMNode::isNullable() const { return fIsNullable; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/common/CMBinaryOp.cpp000644 000765 000024 00000011676 13241160333 024404 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: CMBinaryOp.cpp 677396 2008-07-16 19:36:20Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // CMBinaryOp: Constructors // --------------------------------------------------------------------------- CMBinaryOp::CMBinaryOp( ContentSpecNode::NodeTypes type , CMNode* const leftToAdopt , CMNode* const rightToAdopt , unsigned int maxStates , MemoryManager* const manager) : CMNode(type, maxStates, manager) , fLeftChild(leftToAdopt) , fRightChild(rightToAdopt) { // Insure that its one of the types we require if (((type & 0x0f) != ContentSpecNode::Choice) && ((type & 0x0f) != ContentSpecNode::Sequence)) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_BinOpHadUnaryType, manager); } // // If its an alternation, then if either child is nullable then // this node is nullable. If its a concatenation, then both of // them have to be nullable. // if ((type & 0x0f) == ContentSpecNode::Choice) fIsNullable=(fLeftChild->isNullable() || fRightChild->isNullable()); else fIsNullable=(fLeftChild->isNullable() && fRightChild->isNullable()); } CMBinaryOp::~CMBinaryOp() { delete fLeftChild; delete fRightChild; } // --------------------------------------------------------------------------- // CMBinaryOp: Getter methods // --------------------------------------------------------------------------- const CMNode* CMBinaryOp::getLeft() const { return fLeftChild; } CMNode* CMBinaryOp::getLeft() { return fLeftChild; } const CMNode* CMBinaryOp::getRight() const { return fRightChild; } CMNode* CMBinaryOp::getRight() { return fRightChild; } // --------------------------------------------------------------------------- // CMBinaryOp: Implementation of the public CMNode virtual interface // --------------------------------------------------------------------------- void CMBinaryOp::orphanChild() { delete fLeftChild; fLeftChild=0; delete fRightChild; fRightChild=0; } // --------------------------------------------------------------------------- // CMBinaryOp: Implementation of the protected CMNode virtual interface // --------------------------------------------------------------------------- void CMBinaryOp::calcFirstPos(CMStateSet& toSet) const { if ((getType() & 0x0f) == ContentSpecNode::Choice) { // Its the the union of the first positions of our children. toSet = fLeftChild->getFirstPos(); toSet |= fRightChild->getFirstPos(); } else if ((getType() & 0x0f) == ContentSpecNode::Sequence) { // // If our left child is nullable, then its the union of our // children's first positions. Else is our left child's first // positions. // toSet = fLeftChild->getFirstPos(); if (fLeftChild->isNullable()) toSet |= fRightChild->getFirstPos(); } } void CMBinaryOp::calcLastPos(CMStateSet& toSet) const { if ((getType() & 0x0f) == ContentSpecNode::Choice) { // Its the the union of the first positions of our children. toSet = fLeftChild->getLastPos(); toSet |= fRightChild->getLastPos(); } else if ((getType() & 0x0f) == ContentSpecNode::Sequence) { // // If our right child is nullable, then its the union of our // children's last positions. Else is our right child's last // positions. // toSet = fRightChild->getLastPos(); if (fRightChild->isNullable()) toSet |= fLeftChild->getLastPos(); } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/common/MixedContentModel.cpp000644 000765 000024 00000037324 13241160333 026021 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: MixedContentModel.cpp 676911 2008-07-15 13:27:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // MixedContentModel: Constructors and Destructor // --------------------------------------------------------------------------- MixedContentModel::MixedContentModel(const bool dtd , ContentSpecNode* const parentContentSpec , const bool ordered , MemoryManager* const manager) : fCount(0) , fChildren(0) , fChildTypes(0) , fOrdered(ordered) , fDTD(dtd) , fMemoryManager(manager) { // // Create a vector of unsigned ints that will be filled in with the // ids of the child nodes. It will be expanded as needed but we give // it an initial capacity of 64 which should be more than enough for // 99% of the scenarios. // ValueVectorOf children(64, fMemoryManager); ValueVectorOf childTypes(64, fMemoryManager); // // Get the parent element's content spec. This is the head of the tree // of nodes that describes the content model. We will iterate this // tree. // ContentSpecNode* curNode = parentContentSpec; if (!curNode) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_NoParentCSN, fMemoryManager); // And now call the private recursive method that iterates the tree buildChildList(curNode, children, childTypes); // // And now we know how many elements we need in our member list. So // fill them in. // fCount = children.size(); fChildren = (QName**) fMemoryManager->allocate(fCount * sizeof(QName*)); //new QName*[fCount]; fChildTypes = (ContentSpecNode::NodeTypes*) fMemoryManager->allocate ( fCount * sizeof(ContentSpecNode::NodeTypes) ); //new ContentSpecNode::NodeTypes[fCount]; for (XMLSize_t index = 0; index < fCount; index++) { fChildren[index] = new (fMemoryManager) QName(*children.elementAt(index)); fChildTypes[index] = childTypes.elementAt(index); } } MixedContentModel::~MixedContentModel() { for (XMLSize_t index = 0; index < fCount; index++) { delete fChildren[index]; } fMemoryManager->deallocate(fChildren); //delete [] fChildren; fMemoryManager->deallocate(fChildTypes); //delete [] fChildTypes; } // --------------------------------------------------------------------------- // MixedContentModel: Getter methods // --------------------------------------------------------------------------- bool MixedContentModel::hasDups() const { // Can't have dups if only one child if (fCount == 1) return false; for (XMLSize_t index = 0; index < fCount; index++) { const QName* curVal = fChildren[index]; for (XMLSize_t iIndex = 0; iIndex < fCount; iIndex++) { if (iIndex == index) continue; if (fDTD) { if (XMLString::equals(curVal->getRawName(), fChildren[iIndex]->getRawName())) { return true; } } else { if ((curVal->getURI() == fChildren[iIndex]->getURI()) && (XMLString::equals(curVal->getLocalPart(), fChildren[iIndex]->getLocalPart()))) { return true; } } } } return false; } // --------------------------------------------------------------------------- // MixedContentModel: Implementation of the ContentModel virtual interface // --------------------------------------------------------------------------- // //Under the XML Schema mixed model, //the order and number of child elements appearing in an instance //must agree with //the order and number of child elements specified in the model. // bool MixedContentModel::validateContent( QName** const children , XMLSize_t childCount , unsigned int , XMLSize_t* indexFailingChild , MemoryManager* const) const { // must match order if (fOrdered) { unsigned int inIndex = 0; for (unsigned int outIndex = 0; outIndex < childCount; outIndex++) { // Get the current child out of the source index const QName* curChild = children[outIndex]; // If its PCDATA, then we just accept that if (curChild->getURI() == XMLElementDecl::fgPCDataElemId) continue; ContentSpecNode::NodeTypes type = fChildTypes[inIndex]; const QName* inChild = fChildren[inIndex]; if (type == ContentSpecNode::Leaf) { if (fDTD) { if (!XMLString::equals(inChild->getRawName(), curChild->getRawName())) { *indexFailingChild=outIndex; return false; } } else { if ((inChild->getURI() != curChild->getURI()) || (!XMLString::equals(inChild->getLocalPart(), curChild->getLocalPart()))) { *indexFailingChild=outIndex; return false; } } } else if (type == ContentSpecNode::Any) { } else if (type == ContentSpecNode::Any_NS) { if (inChild->getURI() != curChild->getURI()) { *indexFailingChild=outIndex; return false; } } else if (type == ContentSpecNode::Any_Other) { // Here we assume that empty string has id 1. // unsigned int uriId = curChild->getURI(); if (uriId == 1 || uriId == inChild->getURI()) { *indexFailingChild=outIndex; return false; } } // advance index inIndex++; } } // can appear in any order else { for (unsigned int outIndex = 0; outIndex < childCount; outIndex++) { // Get the current child out of the source index const QName* curChild = children[outIndex]; // If its PCDATA, then we just accept that if (curChild->getURI() == XMLElementDecl::fgPCDataElemId) continue; // And try to find it in our list unsigned int inIndex = 0; for (; inIndex < fCount; inIndex++) { ContentSpecNode::NodeTypes type = fChildTypes[inIndex]; const QName* inChild = fChildren[inIndex]; if (type == ContentSpecNode::Leaf) { if (fDTD) { if (XMLString::equals(inChild->getRawName(), curChild->getRawName())) { break; } } else { if ((inChild->getURI() == curChild->getURI()) && (XMLString::equals(inChild->getLocalPart(), curChild->getLocalPart()))) { break; } } } else if (type == ContentSpecNode::Any) { break; } else if (type == ContentSpecNode::Any_NS) { if (inChild->getURI() == curChild->getURI()) break; } else if (type == ContentSpecNode::Any_Other) { // Here we assume that empty string has id 1. // unsigned int uriId = curChild->getURI(); if (uriId != 1 && uriId != inChild->getURI()) break; } // REVISIT: What about checking for multiple ANY matches? // The content model ambiguity *could* be checked // by the caller before constructing the mixed // content model. } // We did not find this one, so the validation failed if (inIndex == fCount) { *indexFailingChild=outIndex; return false; } } } // Everything seems to be in order, so return success return true; } bool MixedContentModel::validateContentSpecial(QName** const children , XMLSize_t childCount , unsigned int , GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool , XMLSize_t* indexFailingChild , MemoryManager* const) const { SubstitutionGroupComparator comparator(pGrammarResolver, pStringPool); // must match order if (fOrdered) { unsigned int inIndex = 0; for (unsigned int outIndex = 0; outIndex < childCount; outIndex++) { // Get the current child out of the source index QName* curChild = children[outIndex]; // If its PCDATA, then we just accept that if (curChild->getURI() == XMLElementDecl::fgPCDataElemId) continue; ContentSpecNode::NodeTypes type = fChildTypes[inIndex]; QName* inChild = fChildren[inIndex]; if (type == ContentSpecNode::Leaf) { if ( !comparator.isEquivalentTo(curChild, inChild)) { *indexFailingChild=outIndex; return false; } } else if (type == ContentSpecNode::Any) { } else if (type == ContentSpecNode::Any_NS) { if (inChild->getURI() != curChild->getURI()) { *indexFailingChild=outIndex; return false; } } else if (type == ContentSpecNode::Any_Other) { // Here we assume that empty string has id 1. // unsigned int uriId = curChild->getURI(); if (uriId == 1 || uriId == inChild->getURI()) { *indexFailingChild=outIndex; return false; } } // advance index inIndex++; } } // can appear in any order else { for (unsigned int outIndex = 0; outIndex < childCount; outIndex++) { // Get the current child out of the source index QName* curChild = children[outIndex]; // If its PCDATA, then we just accept that if (curChild->getURI() == XMLElementDecl::fgPCDataElemId) continue; // And try to find it in our list unsigned int inIndex = 0; for (; inIndex < fCount; inIndex++) { ContentSpecNode::NodeTypes type = fChildTypes[inIndex]; QName* inChild = fChildren[inIndex]; if (type == ContentSpecNode::Leaf) { if ( comparator.isEquivalentTo(curChild, inChild)) break; } else if (type == ContentSpecNode::Any) { break; } else if (type == ContentSpecNode::Any_NS) { if (inChild->getURI() == curChild->getURI()) break; } else if (type == ContentSpecNode::Any_Other) { // Here we assume that empty string has id 1. // unsigned int uriId = curChild->getURI(); if (uriId != 1 && uriId != inChild->getURI()) break; } // REVISIT: What about checking for multiple ANY matches? // The content model ambiguity *could* be checked // by the caller before constructing the mixed // content model. } // We did not find this one, so the validation failed if (inIndex == fCount) { *indexFailingChild=outIndex; return false; } } } // Everything seems to be in order, so return success return true; } // --------------------------------------------------------------------------- // MixedContentModel: Private helper methods // --------------------------------------------------------------------------- void MixedContentModel::buildChildList( ContentSpecNode* const curNode , ValueVectorOf& toFill , ValueVectorOf& toType) { // Get the type of spec node our current node is const ContentSpecNode::NodeTypes curType = curNode->getType(); // If its a leaf, then store its id in the target list if ((curType == ContentSpecNode::Leaf) || (curType == ContentSpecNode::Any) || (curType == ContentSpecNode::Any_Other) || (curType == ContentSpecNode::Any_NS) ) { toFill.addElement(curNode->getElement()); toType.addElement(curType); return; } // Get both the child node pointers ContentSpecNode* leftNode = curNode->getFirst(); ContentSpecNode* rightNode = curNode->getSecond(); // And recurse according to the type of node if (((curType & 0x0f) == ContentSpecNode::Choice) || ((curType & 0x0f) == ContentSpecNode::Sequence)) { // Recurse on the left and right nodes buildChildList(leftNode, toFill, toType); // The last node of a choice or sequence has a null right if (rightNode) buildChildList(rightNode, toFill, toType); } else if ((curType == ContentSpecNode::OneOrMore) || (curType == ContentSpecNode::ZeroOrOne) || (curType == ContentSpecNode::ZeroOrMore)) { // Just do the left node on this one buildChildList(leftNode, toFill, toType); } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/common/Grammar.cpp000644 000765 000024 00000004250 13241160333 024015 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Grammar.cpp 471747 2006-11-06 14:31:56Z amassari $ */ #include //since we need to dynamically created each and every derivatives //during deserialization by XSerializeEngine>>Derivative, we got //to include all hpp #include #include #include XERCES_CPP_NAMESPACE_BEGIN /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_NOCREATE(Grammar) void Grammar::serialize(XSerializeEngine&) { //no data } void Grammar::storeGrammar(XSerializeEngine& serEng , Grammar* const grammar) { if (grammar) { serEng<<(int) grammar->getGrammarType(); serEng<>type; switch((GrammarType)type) { case DTDGrammarType: DTDGrammar* dtdGrammar; serEng>>dtdGrammar; return dtdGrammar; case SchemaGrammarType: SchemaGrammar* schemaGrammar; serEng>>schemaGrammar; return schemaGrammar; case UnKnown: return 0; default: //we treat this same as UnKnown return 0; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/common/CMUnaryOp.cpp000644 000765 000024 00000006406 13241160332 024250 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: CMUnaryOp.cpp 677396 2008-07-16 19:36:20Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // CMUnaryOp: Constructors and Destructor // --------------------------------------------------------------------------- CMUnaryOp::CMUnaryOp( ContentSpecNode::NodeTypes type , CMNode* const nodeToAdopt , unsigned int maxStates , MemoryManager* const manager) : CMNode(type, maxStates, manager) , fChild(nodeToAdopt) { // Insure that its one of the types we require if ((type != ContentSpecNode::ZeroOrOne) && (type != ContentSpecNode::ZeroOrMore) && (type != ContentSpecNode::OneOrMore)) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_UnaryOpHadBinType, manager); } if (type == ContentSpecNode::OneOrMore) fIsNullable=fChild->isNullable(); else fIsNullable=true; } CMUnaryOp::~CMUnaryOp() { delete fChild; } // --------------------------------------------------------------------------- // CMUnaryOp: Getter methods // --------------------------------------------------------------------------- const CMNode* CMUnaryOp::getChild() const { return fChild; } CMNode* CMUnaryOp::getChild() { return fChild; } // --------------------------------------------------------------------------- // CMUnaryOp: Implementation of the public CMNode virtual interface // --------------------------------------------------------------------------- void CMUnaryOp::orphanChild() { delete fChild; fChild=0; } // --------------------------------------------------------------------------- // CMUnaryOp: Implementation of the protected CMNode virtual interface // --------------------------------------------------------------------------- void CMUnaryOp::calcFirstPos(CMStateSet& toSet) const { // Its just based on our child node's first pos toSet = fChild->getFirstPos(); } void CMUnaryOp::calcLastPos(CMStateSet& toSet) const { // Its just based on our child node's last pos toSet = fChild->getLastPos(); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/common/GrammarResolver.hpp000644 000765 000024 00000020321 13241160333 025541 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: GrammarResolver.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_GRAMMARRESOLVER_HPP) #define XERCESC_INCLUDE_GUARD_GRAMMARRESOLVER_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class DatatypeValidator; class DatatypeValidatorFactory; class XMLGrammarDescription; /** * This class embodies the representation of a Grammar pool Resolver. * This class is called from the validator. * */ class VALIDATORS_EXPORT GrammarResolver : public XMemory { public: /** @name Constructor and Destructor */ //@{ /** * * Default Constructor */ GrammarResolver( XMLGrammarPool* const gramPool , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Destructor */ ~GrammarResolver(); //@} /** @name Getter methods */ //@{ /** * Retrieve the DatatypeValidator * * @param uriStr the namespace URI * @param typeName the type name * @return the DatatypeValidator associated with namespace & type name */ DatatypeValidator* getDatatypeValidator(const XMLCh* const uriStr, const XMLCh* const typeName); /** * Retrieve the DatatypeValidatorFactory used for built-in schema types * * @return the DatatypeValidator associated with namespace for XMLSchema */ DatatypeValidatorFactory* getBuiltinDatatypeValidatorFactory(); /** * Retrieve the grammar that is associated with the specified namespace key * * @param gramDesc grammar description for the grammar * @return Grammar abstraction associated with the grammar description */ Grammar* getGrammar( XMLGrammarDescription* const gramDesc ) ; /** * Retrieve the grammar that is associated with the specified namespace key * * @param namespaceKey Namespace key into Grammar pool * @return Grammar abstraction associated with the NameSpace key. */ Grammar* getGrammar( const XMLCh* const namespaceKey ) ; /** * Get an enumeration of Grammar in the Grammar pool * * @return enumeration of Grammar in Grammar pool */ RefHashTableOfEnumerator getGrammarEnumerator() const; /** * Get an enumeration of the referenced Grammars * * @return enumeration of referenced Grammars */ RefHashTableOfEnumerator getReferencedGrammarEnumerator() const; /** * Get an enumeration of the cached Grammars in the Grammar pool * * @return enumeration of the cached Grammars in Grammar pool */ RefHashTableOfEnumerator getCachedGrammarEnumerator() const; /** * Get a string pool of schema grammar element/attribute names/prefixes * (used by TraverseSchema) * * @return a string pool of schema grammar element/attribute names/prefixes */ XMLStringPool* getStringPool(); /** * Is the specified Namespace key in Grammar pool? * * @param nameSpaceKey Namespace key * @return True if Namespace key association is in the Grammar pool. */ bool containsNameSpace( const XMLCh* const nameSpaceKey ); inline XMLGrammarPool* getGrammarPool() const; inline MemoryManager* getGrammarPoolMemoryManager() const; //@} /** @name Setter methods */ //@{ /** * Set the 'Grammar caching' flag */ void cacheGrammarFromParse(const bool newState); /** * Set the 'Use cached grammar' flag */ void useCachedGrammarInParse(const bool newState); //@} /** @name GrammarResolver methods */ //@{ /** * Add the Grammar with Namespace Key associated to the Grammar Pool. * The Grammar will be owned by the Grammar Pool. * * @param grammarToAdopt Grammar abstraction used by validator. */ void putGrammar(Grammar* const grammarToAdopt ); /** * Returns the Grammar with Namespace Key associated from the Grammar Pool * The Key entry is removed from the table (grammar is not deleted if * adopted - now owned by caller). * * @param nameSpaceKey Key to associate with Grammar abstraction */ Grammar* orphanGrammar(const XMLCh* const nameSpaceKey); /** * Cache the grammars in fGrammarBucket to fCachedGrammarRegistry. * If a grammar with the same key is already cached, an exception is * thrown and none of the grammars will be cached. */ void cacheGrammars(); /** * Reset internal Namespace/Grammar registry. */ void reset(); void resetCachedGrammar(); /** * Returns an XSModel, either from the GrammarPool or by creating one */ XSModel* getXSModel(); ValueVectorOf* getGrammarsToAddToXSModel(); //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- GrammarResolver(const GrammarResolver&); GrammarResolver& operator=(const GrammarResolver&); // ----------------------------------------------------------------------- // Private data members // // fStringPool The string pool used by TraverseSchema to store // element/attribute names and prefixes. // Always owned by Grammar pool implementation // // fGrammarBucket The parsed Grammar Pool, if no caching option. // // fGrammarFromPool Referenced Grammar Set, not owned // // fGrammarPool The Grammar Set either plugged or created. // // fDataTypeReg DatatypeValidatorFactory registry // // fMemoryManager Pluggable memory manager for dynamic memory // allocation/deallocation // ----------------------------------------------------------------------- bool fCacheGrammar; bool fUseCachedGrammar; bool fGrammarPoolFromExternalApplication; XMLStringPool* fStringPool; RefHashTableOf* fGrammarBucket; RefHashTableOf* fGrammarFromPool; DatatypeValidatorFactory* fDataTypeReg; MemoryManager* fMemoryManager; XMLGrammarPool* fGrammarPool; XSModel* fXSModel; XSModel* fGrammarPoolXSModel; ValueVectorOf* fGrammarsToAddToXSModel; }; inline XMLStringPool* GrammarResolver::getStringPool() { return fStringPool; } inline void GrammarResolver::useCachedGrammarInParse(const bool aValue) { fUseCachedGrammar = aValue; } inline XMLGrammarPool* GrammarResolver::getGrammarPool() const { return fGrammarPool; } inline MemoryManager* GrammarResolver::getGrammarPoolMemoryManager() const { return fGrammarPool->getMemoryManager(); } inline ValueVectorOf* GrammarResolver::getGrammarsToAddToXSModel() { return fGrammarsToAddToXSModel; } inline DatatypeValidatorFactory* GrammarResolver::getBuiltinDatatypeValidatorFactory() { return fDataTypeReg; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/common/DFAContentModel.hpp000644 000765 000024 00000025042 13241160333 025344 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DFAContentModel.hpp 677705 2008-07-17 20:15:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DFACONTENTMODEL_HPP) #define XERCESC_INCLUDE_GUARD_DFACONTENTMODEL_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class ContentSpecNode; class CMLeaf; class CMRepeatingLeaf; class CMNode; class CMStateSet; // // DFAContentModel is the heavy weight derivative of ContentModel that does // all of the non-trivial element content validation. This guy does the full // bore regular expression to DFA conversion to create a DFA that it then // uses in its validation algorithm. // // NOTE: Upstream work insures that this guy will never see a content model // with PCDATA in it. Any model with PCDATA is 'mixed' and is handled // via the MixedContentModel class, since mixed models are very // constrained in form and easily handled via a special case. This // also makes our life much easier here. // class DFAContentModel : public XMLContentModel { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- DFAContentModel ( const bool dtd , ContentSpecNode* const elemContentSpec , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); DFAContentModel ( const bool dtd , ContentSpecNode* const elemContentSpec , const bool isMixed , MemoryManager* const manager ); virtual ~DFAContentModel(); // ----------------------------------------------------------------------- // Implementation of the virtual content model interface // ----------------------------------------------------------------------- virtual bool validateContent ( QName** const children , XMLSize_t childCount , unsigned int emptyNamespaceId , XMLSize_t* indexFailingChild , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) const; virtual bool validateContentSpecial ( QName** const children , XMLSize_t childCount , unsigned int emptyNamespaceId , GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool , XMLSize_t* indexFailingChild , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) const; virtual void checkUniqueParticleAttribution ( SchemaGrammar* const pGrammar , GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool , XMLValidator* const pValidator , unsigned int* const pContentSpecOrgURI , const XMLCh* pComplexTypeName = 0 ) ; virtual ContentLeafNameTypeVector* getContentLeafNameTypeVector() const ; virtual unsigned int getNextState(unsigned int currentState, XMLSize_t elementIndex) const; virtual bool handleRepetitions( const QName* const curElem, unsigned int curState, unsigned int currentLoop, unsigned int& nextState, unsigned int& nextLoop, XMLSize_t elementIndex, SubstitutionGroupComparator * comparator) const; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DFAContentModel(); DFAContentModel(const DFAContentModel&); DFAContentModel& operator=(const DFAContentModel&); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void buildDFA(ContentSpecNode* const curNode); CMNode* buildSyntaxTree(ContentSpecNode* const curNode, unsigned int& curIndex); unsigned int* makeDefStateList() const; unsigned int countLeafNodes(ContentSpecNode* const curNode); class Occurence : public XMemory { public: Occurence(int minOcc, int maxOcc, int eltIndex); int minOccurs; int maxOccurs; int elemIndex; }; // ----------------------------------------------------------------------- // Private data members // // fElemMap // fElemMapSize // This is the map of unique input symbol elements to indices into // each state's per-input symbol transition table entry. This is part // of the built DFA information that must be kept around to do the // actual validation. // // fElemMapType // This is a map of whether the element map contains information // related to ANY models. // // fEmptyOk // This is an optimization. While building the transition table we // can see whether this content model would approve of an empty // content (which could happen if everything was optional.) So we // set this flag and short circuit that check, which would otherwise // be ugly and time consuming if we tried to determine it at each // validation call. // // fEOCPos // The NFA position of the special EOC (end of content) node. This // is saved away since its used during the DFA build. // // fFinalStateFlags // This is an array of booleans, one per state (there are // fTransTableSize states in the DFA) that indicates whether that // state is a final state. // // fFollowList // The list of follow positions for each NFA position (i.e. for each // non-epsilon leaf node.) This is only used during the building of // the DFA, and is let go afterwards. // // fHeadNode // This is the head node of our intermediate representation. It is // only non-null during the building of the DFA (just so that it // does not have to be passed all around.) Once the DFA is built, // this is no longer required so its deleted. // // fLeafCount // The count of leaf nodes. This is an important number that set some // limits on the sizes of data structures in the DFA process. // // fLeafList // An array of non-epsilon leaf nodes, which is used during the DFA // build operation, then dropped. These are just references to nodes // pointed to by fHeadNode, so we don't have to clean them up, just // the actually leaf list array itself needs cleanup. // // fLeafListType // Array mapping ANY types to the leaf list. // // fTransTable // fTransTableSize // This is the transition table that is the main by product of all // of the effort here. It is an array of arrays of ints. The first // dimension is the number of states we end up with in the DFA. The // second dimensions is the number of unique elements in the content // model (fElemMapSize). Each entry in the second dimension indicates // the new state given that input for the first dimension's start // state. // // The fElemMap array handles mapping from element indexes to // positions in the second dimension of the transition table. // // fTransTableSize is the number of valid entries in the transition // table, and in the other related tables such as fFinalStateFlags. // // fCountingStates // This is the table holding the minOccurs/maxOccurs for elements // that can be repeated a finite number of times. // // fDTD // Boolean to allow DTDs to validate even with namespace support. // // fIsMixed // DFA ContentModel with mixed PCDATA. // ----------------------------------------------------------------------- QName** fElemMap; ContentSpecNode::NodeTypes* fElemMapType; unsigned int fElemMapSize; bool fEmptyOk; unsigned int fEOCPos; bool* fFinalStateFlags; CMStateSet** fFollowList; CMNode* fHeadNode; unsigned int fLeafCount; CMLeaf** fLeafList; ContentSpecNode::NodeTypes* fLeafListType; unsigned int** fTransTable; unsigned int fTransTableSize; Occurence** fCountingStates; bool fDTD; bool fIsMixed; ContentLeafNameTypeVector * fLeafNameTypeVector; MemoryManager* fMemoryManager; }; inline unsigned int DFAContentModel::getNextState(unsigned int currentState, XMLSize_t elementIndex) const { if (currentState == XMLContentModel::gInvalidTrans) { return XMLContentModel::gInvalidTrans; } if (currentState >= fTransTableSize || elementIndex >= fElemMapSize) { ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Array_BadIndex, fMemoryManager); } return fTransTable[currentState][elementIndex]; } inline DFAContentModel::Occurence::Occurence(int minOcc, int maxOcc, int eltIndex) { minOccurs = minOcc; maxOccurs = maxOcc; elemIndex = eltIndex; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/common/CMAny.hpp000644 000765 000024 00000007102 13241160333 023402 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: CMAny.hpp 677396 2008-07-16 19:36:20Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_CMANY_HPP) #define XERCESC_INCLUDE_GUARD_CMANY_HPP #include XERCES_CPP_NAMESPACE_BEGIN class CMStateSet; class CMAny : public CMNode { public : // ----------------------------------------------------------------------- // Constructors // ----------------------------------------------------------------------- CMAny ( ContentSpecNode::NodeTypes type , unsigned int URI , unsigned int position , unsigned int maxStates , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~CMAny(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- unsigned int getURI() const; unsigned int getPosition() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setPosition(const unsigned int newPosition); // ----------------------------------------------------------------------- // Implementation of the public CMNode virtual interface // ----------------------------------------------------------------------- virtual void orphanChild(); protected : // ----------------------------------------------------------------------- // Implementation of the protected CMNode virtual interface // ----------------------------------------------------------------------- void calcFirstPos(CMStateSet& toSet) const; void calcLastPos(CMStateSet& toSet) const; private : // ----------------------------------------------------------------------- // Private data members // // fURI; // URI of the any content model. This value is set if the type is // of the following: // XMLContentSpec.CONTENTSPECNODE_ANY, // XMLContentSpec.CONTENTSPECNODE_ANY_OTHER. // // fPosition // Part of the algorithm to convert a regex directly to a DFA // numbers each leaf sequentially. If its -1, that means its an // epsilon node. Zero and greater are non-epsilon positions. // ----------------------------------------------------------------------- unsigned int fURI; unsigned int fPosition; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- CMAny(const CMAny&); CMAny& operator=(const CMAny&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/common/ContentLeafNameTypeVector.hpp000644 000765 000024 00000010613 13241160333 027464 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ContentLeafNameTypeVector.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_CONTENTLEAFNAMETYPEVECTOR_HPP) #define XERCESC_INCLUDE_GUARD_CONTENTLEAFNAMETYPEVECTOR_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLPARSER_EXPORT ContentLeafNameTypeVector : public XMemory { public : // ----------------------------------------------------------------------- // Class specific types // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- ContentLeafNameTypeVector ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ContentLeafNameTypeVector ( QName** const qName , ContentSpecNode::NodeTypes* const types , const XMLSize_t count , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~ContentLeafNameTypeVector(); ContentLeafNameTypeVector(const ContentLeafNameTypeVector&); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- QName* getLeafNameAt(const XMLSize_t pos) const; ContentSpecNode::NodeTypes getLeafTypeAt(const XMLSize_t pos) const; XMLSize_t getLeafCount() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setValues ( QName** const qName , ContentSpecNode::NodeTypes* const types , const XMLSize_t count ); // ----------------------------------------------------------------------- // Miscellaneous // ----------------------------------------------------------------------- private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ContentLeafNameTypeVector& operator=(const ContentLeafNameTypeVector&); // ----------------------------------------------------------------------- // helper methods // ----------------------------------------------------------------------- void cleanUp(); void init(const XMLSize_t size); // ----------------------------------------------------------------------- // Private Data Members // // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; QName** fLeafNames; ContentSpecNode::NodeTypes *fLeafTypes; XMLSize_t fLeafCount; }; inline void ContentLeafNameTypeVector::cleanUp() { fMemoryManager->deallocate(fLeafNames); //delete [] fLeafNames; fMemoryManager->deallocate(fLeafTypes); //delete [] fLeafTypes; } inline void ContentLeafNameTypeVector::init(const XMLSize_t size) { fLeafNames = (QName**) fMemoryManager->allocate(size * sizeof(QName*));//new QName*[size]; fLeafTypes = (ContentSpecNode::NodeTypes *) fMemoryManager->allocate ( size * sizeof(ContentSpecNode::NodeTypes) ); //new ContentSpecNode::NodeTypes [size]; fLeafCount = size; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/common/AllContentModel.cpp000644 000765 000024 00000034036 13241160333 025460 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: AllContentModel.cpp 676911 2008-07-15 13:27:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // AllContentModel: Constructors and Destructor // --------------------------------------------------------------------------- AllContentModel::AllContentModel( ContentSpecNode* const parentContentSpec , const bool isMixed , MemoryManager* const manager) : fMemoryManager(manager) , fCount(0) , fChildren(0) , fChildOptional(0) , fNumRequired(0) , fIsMixed(isMixed) , fHasOptionalContent(false) { // // Create a vector of unsigned ints that will be filled in with the // ids of the child nodes. It will be expanded as needed but we give // it an initial capacity of 64 which should be more than enough for // 99% of the scenarios. // ValueVectorOf children(64, fMemoryManager); ValueVectorOf childOptional(64, fMemoryManager); // // Get the parent element's content spec. This is the head of the tree // of nodes that describes the content model. We will iterate this // tree. // ContentSpecNode* curNode = parentContentSpec; if (!curNode) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_NoParentCSN, fMemoryManager); // And now call the private recursive method that iterates the tree if (curNode->getType() == ContentSpecNode::All && curNode->getMinOccurs() == 0) { fHasOptionalContent = true; } buildChildList(curNode, children, childOptional); // // And now we know how many elements we need in our member list. So // fill them in. // fCount = children.size(); fChildren = (QName**) fMemoryManager->allocate(fCount * sizeof(QName*)); //new QName*[fCount]; fChildOptional = (bool*) fMemoryManager->allocate(fCount * sizeof(bool)); //new bool[fCount]; for (unsigned int index = 0; index < fCount; index++) { fChildren[index] = new (fMemoryManager) QName(*(children.elementAt(index))); fChildOptional[index] = childOptional.elementAt(index); } } AllContentModel::~AllContentModel() { for (XMLSize_t index = 0; index < fCount; index++) delete fChildren[index]; fMemoryManager->deallocate(fChildren); //delete [] fChildren; fMemoryManager->deallocate(fChildOptional); //delete [] fChildOptional; } // --------------------------------------------------------------------------- // AllContentModel: Implementation of the ContentModel virtual interface // --------------------------------------------------------------------------- // //Under the XML Schema mixed model, //the order and number of child elements appearing in an instance //must agree with //the order and number of child elements specified in the model. // bool AllContentModel::validateContent( QName** const children , XMLSize_t childCount , unsigned int , XMLSize_t* indexFailingChild , MemoryManager* const manager) const { // If had minOccurs of zero and there are // no children to validate, trivially validate if (childCount == 0 && (fHasOptionalContent || !fNumRequired)) return true; // keep track of the required element seen XMLSize_t numRequiredSeen = 0; if(childCount > 0) { // Check for duplicate element bool* elementSeen = (bool*) manager->allocate(fCount*sizeof(bool)); //new bool[fCount]; const ArrayJanitor jan(elementSeen, manager); // initialize the array for (XMLSize_t i = 0; i < fCount; i++) elementSeen[i] = false; for (XMLSize_t outIndex = 0; outIndex < childCount; outIndex++) { // Get the current child out of the source index const QName* curChild = children[outIndex]; // If it's PCDATA, then we just accept that if (fIsMixed && curChild->getURI() == XMLElementDecl::fgPCDataElemId) continue; // And try to find it in our list XMLSize_t inIndex = 0; for (; inIndex < fCount; inIndex++) { const QName* inChild = fChildren[inIndex]; if ((inChild->getURI() == curChild->getURI()) && (XMLString::equals(inChild->getLocalPart(), curChild->getLocalPart()))) { // found it // If this element was seen already, indicate an error was // found at the duplicate index. if (elementSeen[inIndex]) { *indexFailingChild=outIndex; return false; } else elementSeen[inIndex] = true; if (!fChildOptional[inIndex]) numRequiredSeen++; break; } } // We did not find this one, so the validation failed if (inIndex == fCount) { *indexFailingChild=outIndex; return false; } } } // Were all the required elements of the encountered? if (numRequiredSeen != fNumRequired) { *indexFailingChild=childCount; return false; } // Everything seems to be ok, so return success return true; } bool AllContentModel::validateContentSpecial(QName** const children , XMLSize_t childCount , unsigned int , GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool , XMLSize_t* indexFailingChild , MemoryManager* const manager) const { // If had minOccurs of zero and there are // no children to validate, trivially validate if (childCount == 0 && (fHasOptionalContent || !fNumRequired)) return true; // keep track of the required element seen XMLSize_t numRequiredSeen = 0; if(childCount > 0) { SubstitutionGroupComparator comparator(pGrammarResolver, pStringPool); // Check for duplicate element bool* elementSeen = (bool*) manager->allocate(fCount*sizeof(bool)); //new bool[fCount]; const ArrayJanitor jan(elementSeen, manager); // initialize the array for (XMLSize_t i = 0; i < fCount; i++) elementSeen[i] = false; for (XMLSize_t outIndex = 0; outIndex < childCount; outIndex++) { // Get the current child out of the source index QName* const curChild = children[outIndex]; // If it's PCDATA, then we just accept that if (fIsMixed && curChild->getURI() == XMLElementDecl::fgPCDataElemId) continue; // And try to find it in our list XMLSize_t inIndex = 0; for (; inIndex < fCount; inIndex++) { QName* const inChild = fChildren[inIndex]; if ( comparator.isEquivalentTo(curChild, inChild)) { // match // If this element was seen already, indicate an error was // found at the duplicate index. if (elementSeen[inIndex]) { *indexFailingChild=outIndex; return false; } else elementSeen[inIndex] = true; if (!fChildOptional[inIndex]) numRequiredSeen++; break; } } // We did not find this one, so the validation failed if (inIndex == fCount) { *indexFailingChild=outIndex; return false; } } } // Were all the required elements of the encountered? if (numRequiredSeen != fNumRequired) { *indexFailingChild=childCount; return false; } // Everything seems to be ok, so return success return true; } void AllContentModel::checkUniqueParticleAttribution ( SchemaGrammar* const pGrammar , GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool , XMLValidator* const pValidator , unsigned int* const pContentSpecOrgURI , const XMLCh* pComplexTypeName /*= 0*/ ) { SubstitutionGroupComparator comparator(pGrammarResolver, pStringPool); XMLSize_t i, j; // rename back for (i = 0; i < fCount; i++) { unsigned int orgURIIndex = fChildren[i]->getURI(); fChildren[i]->setURI(pContentSpecOrgURI[orgURIIndex]); } // check whether there is conflict between any two leaves for (i = 0; i < fCount; i++) { for (j = i+1; j < fCount; j++) { // If this is text in a Schema mixed content model, skip it. if ( fIsMixed && (( fChildren[i]->getURI() == XMLElementDecl::fgPCDataElemId) || ( fChildren[j]->getURI() == XMLElementDecl::fgPCDataElemId))) continue; if (XercesElementWildcard::conflict(pGrammar, ContentSpecNode::Leaf, fChildren[i], ContentSpecNode::Leaf, fChildren[j], &comparator)) { pValidator->emitError(XMLValid::UniqueParticleAttributionFail, pComplexTypeName, fChildren[i]->getRawName(), fChildren[j]->getRawName()); } } } } // --------------------------------------------------------------------------- // AllContentModel: Private helper methods // --------------------------------------------------------------------------- void AllContentModel::buildChildList(ContentSpecNode* const curNode , ValueVectorOf& toFill , ValueVectorOf& toOptional) { // Get the type of spec node our current node is const ContentSpecNode::NodeTypes curType = curNode->getType(); if (curType == ContentSpecNode::All) { // Get both the child node pointers ContentSpecNode* leftNode = curNode->getFirst(); ContentSpecNode* rightNode = curNode->getSecond(); // Recurse on the left and right nodes buildChildList(leftNode, toFill, toOptional); if(rightNode) buildChildList(rightNode, toFill, toOptional); } else if (curType == ContentSpecNode::Leaf) { // At leaf, add the element to list of elements permitted in the all toFill.addElement(curNode->getElement()); toOptional.addElement(false); fNumRequired++; } else if (curType == ContentSpecNode::ZeroOrOne) { // At ZERO_OR_ONE node, subtree must be an element // that was specified with minOccurs=0, maxOccurs=1 ContentSpecNode* leftNode = curNode->getFirst(); if (leftNode->getType() != ContentSpecNode::Leaf) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_UnknownCMSpecType, fMemoryManager); toFill.addElement(leftNode->getElement()); toOptional.addElement(true); } // only allow ZeroOrMore when it's the father of a Loop else if (curType == ContentSpecNode::ZeroOrMore && curNode->getFirst()!=0 && curNode->getFirst()->getType()==ContentSpecNode::Loop) { ContentSpecNode* leftNode = curNode->getFirst(); buildChildList(leftNode, toFill, toOptional); } else if (curType == ContentSpecNode::Loop) { // At leaf, add the element to list of elements permitted in the all int i; for(i=0;igetMinOccurs();i++) { toFill.addElement(curNode->getElement()); toOptional.addElement(false); fNumRequired++; } if(curNode->getMaxOccurs()!=-1) for(i=0;i<(curNode->getMaxOccurs() - curNode->getMinOccurs());i++) { toFill.addElement(curNode->getElement()); toOptional.addElement(true); } } else ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_UnknownCMSpecType, fMemoryManager); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/common/SimpleContentModel.cpp000644 000765 000024 00000045370 13241160333 026204 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SimpleContentModel.cpp 799211 2009-07-30 09:06:43Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // SimpleContentModel: Implementation of the ContentModel virtual interface // --------------------------------------------------------------------------- // // This method is called to validate our content. For this one, its just a // pretty simple 'bull your way through it' test according to what kind of // operation it is for. // bool SimpleContentModel::validateContent(QName** const children , XMLSize_t childCount , unsigned int , XMLSize_t* indexFailingChild , MemoryManager* const) const { // // According to the type of operation, we do the correct type of // content check. // XMLSize_t index; switch(fOp & 0x0f) { case ContentSpecNode::Leaf : // // There can only be one child and it has to be of the // element type we stored. // if (!childCount) { *indexFailingChild=0; return false; } // If the 0th child is not the right kind, report an error at 0 if (fDTD) { if (!XMLString::equals(children[0]->getRawName(), fFirstChild->getRawName())) { *indexFailingChild=0; return false; } } else { if ((children[0]->getURI() != fFirstChild->getURI()) || !XMLString::equals(children[0]->getLocalPart(), fFirstChild->getLocalPart())) { *indexFailingChild=0; return false; } } if (childCount > 1) { *indexFailingChild=1; return false; } break; case ContentSpecNode::ZeroOrOne : // // If the child count is greater than one, then obviously // bad. Otherwise, if its one, then the one child must be // of the type we stored. // if (childCount == 1) { if (fDTD) { if (!XMLString::equals(children[0]->getRawName(), fFirstChild->getRawName())) { *indexFailingChild=0; return false; } } else { if ((children[0]->getURI() != fFirstChild->getURI()) || (!XMLString::equals(children[0]->getLocalPart(), fFirstChild->getLocalPart()))) { *indexFailingChild=0; return false; } } } if (childCount > 1) { *indexFailingChild=1; return false; } break; case ContentSpecNode::ZeroOrMore : // // If the child count is zero, that's fine. If its more than // zero, then make sure that all children are of the element // type that we stored. // if (childCount > 0) { if (fDTD) { for (index = 0; index < childCount; index++) { if (!XMLString::equals(children[index]->getRawName(), fFirstChild->getRawName())) { *indexFailingChild=index; return false; } } } else { for (index = 0; index < childCount; index++) { if ((children[index]->getURI() != fFirstChild->getURI()) || !XMLString::equals(children[index]->getLocalPart(), fFirstChild->getLocalPart())) { *indexFailingChild=index; return false; } } } } break; case ContentSpecNode::OneOrMore : // // If the child count is zero, that's an error. If its more // than zero, then make sure that all children are of the // element type that we stored. // if (childCount == 0) { *indexFailingChild=0; return false; } if (fDTD) { for (index = 0; index < childCount; index++) { if (!XMLString::equals(children[index]->getRawName(), fFirstChild->getRawName())) { *indexFailingChild=index; return false; } } } else { for (index = 0; index < childCount; index++) { if ((children[index]->getURI() != fFirstChild->getURI()) || !XMLString::equals(children[index]->getLocalPart(), fFirstChild->getLocalPart())) { *indexFailingChild=index; return false; } } } break; case ContentSpecNode::Choice : // // There can only be one child, and it must be one of the // two types we stored. // if (!childCount) { *indexFailingChild=0; return false; } if (fDTD) { if (!XMLString::equals(children[0]->getRawName(), fFirstChild->getRawName()) && !XMLString::equals(children[0]->getRawName(), fSecondChild->getRawName())) { *indexFailingChild=0; return false; } } else { if (((children[0]->getURI() != fFirstChild->getURI()) || !XMLString::equals(children[0]->getLocalPart(), fFirstChild->getLocalPart())) && ((children[0]->getURI() != fSecondChild->getURI()) || !XMLString::equals(children[0]->getLocalPart(), fSecondChild->getLocalPart()))) { *indexFailingChild=0; return false; } } if (childCount > 1) { *indexFailingChild=1; return false; } break; case ContentSpecNode::Sequence : // // There must be two children and they must be the two values // we stored, in the stored order. So first check the obvious // problem of an empty content, which would never be valid // in this content mode. // if (!childCount) { *indexFailingChild=0; return false; } // test first child if (fDTD) { if (!XMLString::equals(children[0]->getRawName(), fFirstChild->getRawName())) { *indexFailingChild=0; return false; } } else { if ((children[0]->getURI() != fFirstChild->getURI()) || !XMLString::equals(children[0]->getLocalPart(), fFirstChild->getLocalPart())) { *indexFailingChild=0; return false; } } // test second child, if present if( childCount == 1) { // missing second child *indexFailingChild=1; return false; } else { if (fDTD) { if (!XMLString::equals(children[1]->getRawName(), fSecondChild->getRawName())) { *indexFailingChild=1; return false; } } else { if ((children[1]->getURI() != fSecondChild->getURI()) || !XMLString::equals(children[1]->getLocalPart(), fSecondChild->getLocalPart())) { *indexFailingChild=1; return false; } } if (childCount > 2) { *indexFailingChild=2; return false; } } break; default : ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_UnknownCMSpecType, fMemoryManager); break; } return true; } bool SimpleContentModel::validateContentSpecial(QName** const children , XMLSize_t childCount , unsigned int , GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool , XMLSize_t* indexFailingChild , MemoryManager* const) const { SubstitutionGroupComparator comparator(pGrammarResolver, pStringPool); // // According to the type of operation, we do the correct type of // content check. // unsigned int index; switch(fOp & 0x0f) { case ContentSpecNode::Leaf : // // There can only be one child and it has to be of the // element type we stored. // if (!childCount) { *indexFailingChild=0; return false; } if ((children[0]->getURI() != fFirstChild->getURI()) || !XMLString::equals(children[0]->getLocalPart(), fFirstChild->getLocalPart())) { if (!comparator.isEquivalentTo(children[0], fFirstChild)) { *indexFailingChild=0; return false; } } if (childCount > 1) { *indexFailingChild=1; return false; } break; case ContentSpecNode::ZeroOrOne : // // If the child count is greater than one, then obviously // bad. Otherwise, if its one, then the one child must be // of the type we stored. // if ((childCount == 1) && ((children[0]->getURI() != fFirstChild->getURI()) || !XMLString::equals(children[0]->getLocalPart(), fFirstChild->getLocalPart()))) { if(!comparator.isEquivalentTo(children[0], fFirstChild)) { *indexFailingChild=0; return false; } } if (childCount > 1) { *indexFailingChild=1; return false; } break; case ContentSpecNode::ZeroOrMore : // // If the child count is zero, that's fine. If its more than // zero, then make sure that all children are of the element // type that we stored. // if (childCount > 0) { for (index = 0; index < childCount; index++) { if ((children[index]->getURI() != fFirstChild->getURI()) || !XMLString::equals(children[index]->getLocalPart(), fFirstChild->getLocalPart())) { if (!comparator.isEquivalentTo(children[index], fFirstChild)) { *indexFailingChild=index; return false; } } } } break; case ContentSpecNode::OneOrMore : // // If the child count is zero, that's an error. If its more // than zero, then make sure that all children are of the // element type that we stored. // if (childCount == 0) { *indexFailingChild=0; return false; } for (index = 0; index < childCount; index++) { if ((children[index]->getURI() != fFirstChild->getURI()) || !XMLString::equals(children[index]->getLocalPart(), fFirstChild->getLocalPart())) { if (!comparator.isEquivalentTo(children[index], fFirstChild)) { *indexFailingChild=index; return false; } } } break; case ContentSpecNode::Choice : // // There can only be one child, and it must be one of the // two types we stored. // if (!childCount) { *indexFailingChild=0; return false; } if (((children[0]->getURI() != fFirstChild->getURI()) || !XMLString::equals(children[0]->getLocalPart(), fFirstChild->getLocalPart())) && ((children[0]->getURI() != fSecondChild->getURI()) || !XMLString::equals(children[0]->getLocalPart(), fSecondChild->getLocalPart()))) { if (!comparator.isEquivalentTo(children[0], fFirstChild) && !comparator.isEquivalentTo(children[0], fSecondChild) ) { *indexFailingChild=0; return false; } } if (childCount > 1) { *indexFailingChild=1; return false; } break; case ContentSpecNode::Sequence : // // There must be two children and they must be the two values // we stored, in the stored order. So first check the obvious // problem of an empty content, which would never be valid // in this content mode. // if (!childCount) { *indexFailingChild=0; return false; } // test first child if ((children[0]->getURI() != fFirstChild->getURI()) || !XMLString::equals(children[0]->getLocalPart(), fFirstChild->getLocalPart())) { if(!comparator.isEquivalentTo(children[0], fFirstChild)) { *indexFailingChild=0; return false; } } // test second child, if present if( childCount == 1) { // missing second child *indexFailingChild=1; return false; } else { if ((children[1]->getURI() != fSecondChild->getURI()) || !XMLString::equals(children[1]->getLocalPart(), fSecondChild->getLocalPart())) { if (!comparator.isEquivalentTo(children[1], fSecondChild)) { *indexFailingChild=1; return false; } } if (childCount > 2) { *indexFailingChild=2; return false; } } break; default : ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_UnknownCMSpecType, fMemoryManager); break; } return true; } ContentLeafNameTypeVector* SimpleContentModel::getContentLeafNameTypeVector() const { return 0; } void SimpleContentModel::checkUniqueParticleAttribution ( SchemaGrammar* const pGrammar , GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool , XMLValidator* const pValidator , unsigned int* const pContentSpecOrgURI , const XMLCh* pComplexTypeName /*= 0*/ ) { // rename back unsigned int orgURIIndex = 0; orgURIIndex = fFirstChild->getURI(); if ((orgURIIndex != XMLContentModel::gEOCFakeId) && (orgURIIndex != XMLElementDecl::fgInvalidElemId) && (orgURIIndex != XMLElementDecl::fgPCDataElemId)) fFirstChild->setURI(pContentSpecOrgURI[orgURIIndex]); orgURIIndex = fSecondChild->getURI(); if ((orgURIIndex != XMLContentModel::gEOCFakeId) && (orgURIIndex != XMLElementDecl::fgInvalidElemId) && (orgURIIndex != XMLElementDecl::fgPCDataElemId)) fSecondChild->setURI(pContentSpecOrgURI[orgURIIndex]); // only possible violation is when it's a choice if ((fOp & 0x0f) == ContentSpecNode::Choice) { SubstitutionGroupComparator comparator(pGrammarResolver, pStringPool); if (XercesElementWildcard::conflict(pGrammar, ContentSpecNode::Leaf, fFirstChild, ContentSpecNode::Leaf, fSecondChild, &comparator)) pValidator->emitError(XMLValid::UniqueParticleAttributionFail, pComplexTypeName, fFirstChild->getRawName(), fSecondChild->getRawName()); } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/common/CMRepeatingLeaf.hpp000644 000765 000024 00000011402 13241160333 025357 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: CMRepeatingLeaf.hpp 677396 2008-07-16 19:36:20Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_CMREPEATINGLEAF_HPP) #define XERCESC_INCLUDE_GUARD_CMREPEATINGLEAF_HPP #include XERCES_CPP_NAMESPACE_BEGIN // // A compound content model leaf node which carries occurence information. // class CMRepeatingLeaf : public CMLeaf { public : // ----------------------------------------------------------------------- // Constructors // ----------------------------------------------------------------------- CMRepeatingLeaf ( QName* const element , int minOccurs , int maxOccurs , unsigned int position , unsigned int maxStates , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); CMRepeatingLeaf ( QName* const element , int minOccurs , int maxOccurs , unsigned int position , bool adopt , unsigned int maxStates , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- int getMinOccurs() const; int getMaxOccurs() const; virtual bool isRepeatableLeaf() const; private : // ----------------------------------------------------------------------- // Private data members // // fMinOccurs // fMaxOccurs // The cardinality of the repeating leaf // // ----------------------------------------------------------------------- int fMinOccurs; int fMaxOccurs; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- CMRepeatingLeaf(const CMRepeatingLeaf&); CMRepeatingLeaf& operator=(const CMRepeatingLeaf&); }; // ----------------------------------------------------------------------- // Constructors // ----------------------------------------------------------------------- inline CMRepeatingLeaf::CMRepeatingLeaf( QName* const element , int minOccurs , int maxOccurs , unsigned int position , unsigned int maxStates , MemoryManager* const manager) : CMLeaf(element, position, maxStates, manager) , fMinOccurs(minOccurs) , fMaxOccurs(maxOccurs) { } inline CMRepeatingLeaf::CMRepeatingLeaf( QName* const element , int minOccurs , int maxOccurs , unsigned int position , bool adopt , unsigned int maxStates , MemoryManager* const manager) : CMLeaf(element, position, adopt, maxStates, manager) , fMinOccurs(minOccurs) , fMaxOccurs(maxOccurs) { } // --------------------------------------------------------------------------- // Getter methods // --------------------------------------------------------------------------- inline int CMRepeatingLeaf::getMinOccurs() const { return fMinOccurs; } inline int CMRepeatingLeaf::getMaxOccurs() const { return fMaxOccurs; } inline bool CMRepeatingLeaf::isRepeatableLeaf() const { return true; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/common/ContentSpecNode.cpp000644 000765 000024 00000027146 13241160333 025473 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ContentSpecNode.cpp 1449139 2013-02-22 17:11:10Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // ContentSpecNode: Copy Constructor // // Note: this copy constructor has dependency on various get*() methods // and shall be placed after those method's declaration. // aka inline function compilation error on AIX 4.2, xlC 3 r ev.1 // --------------------------------------------------------------------------- ContentSpecNode::ContentSpecNode(const ContentSpecNode& toCopy) : XSerializable(toCopy) , XMemory(toCopy) , fMemoryManager(toCopy.fMemoryManager) , fElement(0) , fElementDecl(toCopy.fElementDecl) , fFirst(0) , fSecond(0) , fType(toCopy.fType) , fAdoptFirst(true) , fAdoptSecond(true) , fMinOccurs(toCopy.fMinOccurs) , fMaxOccurs(toCopy.fMaxOccurs) { const QName* tempElement = toCopy.getElement(); if (tempElement) fElement = new (fMemoryManager) QName(*tempElement); const ContentSpecNode *tmp = toCopy.getFirst(); if (tmp) fFirst = new (fMemoryManager) ContentSpecNode(*tmp); tmp = toCopy.getSecond(); if (tmp) fSecond = new (fMemoryManager) ContentSpecNode(*tmp); } ContentSpecNode::~ContentSpecNode() { // Delete our children, avoiding recursive cleanup if (fAdoptFirst && fFirst) { deleteChildNode(fFirst); } if (fAdoptSecond && fSecond) { deleteChildNode(fSecond); } delete fElement; } void ContentSpecNode::deleteChildNode(ContentSpecNode* node) { ValueStackOf toBeDeleted(10, fMemoryManager); toBeDeleted.push(node); while(!toBeDeleted.empty()) { ContentSpecNode* node = toBeDeleted.pop(); if(node==0) continue; if(node->isFirstAdopted()) toBeDeleted.push(node->orphanFirst()); if(node->isSecondAdopted()) toBeDeleted.push(node->orphanSecond()); delete node; } } class formatNodeHolder { public: formatNodeHolder(const ContentSpecNode* n, const ContentSpecNode::NodeTypes p, XMLCh c) : node(n), parentType(p), character(c) {} formatNodeHolder& operator =(const formatNodeHolder* other) { node=other->node; parentType=other->parentType; character=other->character; return *this; } const ContentSpecNode* node; ContentSpecNode::NodeTypes parentType; XMLCh character; }; // --------------------------------------------------------------------------- // Local methods // --------------------------------------------------------------------------- static void formatNode( const ContentSpecNode* const curNode , XMLBuffer& bufToFill , MemoryManager* const memMgr) { if (!curNode) return; ValueStackOf toBeProcessed(10, memMgr); toBeProcessed.push(formatNodeHolder(curNode, ContentSpecNode::UnknownType, 0)); while(!toBeProcessed.empty()) { formatNodeHolder item=toBeProcessed.pop(); if(item.character!=0) { bufToFill.append(item.character); continue; } const ContentSpecNode* curNode = item.node; if(!curNode) continue; const ContentSpecNode::NodeTypes parentType = item.parentType; const ContentSpecNode* first = curNode->getFirst(); const ContentSpecNode* second = curNode->getSecond(); const ContentSpecNode::NodeTypes curType = curNode->getType(); // Get the type of the first node const ContentSpecNode::NodeTypes firstType = first ? first->getType() : ContentSpecNode::Leaf; // Calculate the parens flag for the rep nodes bool doRepParens = false; if (((firstType != ContentSpecNode::Leaf) && (parentType != ContentSpecNode::UnknownType)) || ((firstType == ContentSpecNode::Leaf) && (parentType == ContentSpecNode::UnknownType))) { doRepParens = true; } // Now handle our type switch(curType & 0x0f) { case ContentSpecNode::Leaf : if (curNode->getElement()->getURI() == XMLElementDecl::fgPCDataElemId) bufToFill.append(XMLElementDecl::fgPCDataElemName); else { bufToFill.append(curNode->getElement()->getRawName()); // show the + and * modifiers also when we have a non-infinite number of repetitions if(curNode->getMinOccurs()==0 && (curNode->getMaxOccurs()==-1 || curNode->getMaxOccurs()>1)) bufToFill.append(chAsterisk); else if(curNode->getMinOccurs()==0 && curNode->getMaxOccurs()==1) bufToFill.append(chQuestion); else if(curNode->getMinOccurs()==1 && (curNode->getMaxOccurs()==-1 || curNode->getMaxOccurs()>1)) bufToFill.append(chPlus); } break; case ContentSpecNode::ZeroOrOne : if (doRepParens) bufToFill.append(chOpenParen); toBeProcessed.push(formatNodeHolder(0, ContentSpecNode::UnknownType, chQuestion)); if (doRepParens) toBeProcessed.push(formatNodeHolder(0, ContentSpecNode::UnknownType, chCloseParen)); toBeProcessed.push(formatNodeHolder(first, curType, 0)); break; case ContentSpecNode::ZeroOrMore : if (doRepParens) bufToFill.append(chOpenParen); toBeProcessed.push(formatNodeHolder(0, ContentSpecNode::UnknownType, chAsterisk)); if (doRepParens) toBeProcessed.push(formatNodeHolder(0, ContentSpecNode::UnknownType, chCloseParen)); toBeProcessed.push(formatNodeHolder(first, curType, 0)); break; case ContentSpecNode::OneOrMore : if (doRepParens) bufToFill.append(chOpenParen); toBeProcessed.push(formatNodeHolder(0, ContentSpecNode::UnknownType, chPlus)); if (doRepParens) toBeProcessed.push(formatNodeHolder(0, ContentSpecNode::UnknownType, chCloseParen)); toBeProcessed.push(formatNodeHolder(first, curType, 0)); break; case ContentSpecNode::Choice : if ((parentType & 0x0f) != (curType & 0x0f)) bufToFill.append(chOpenParen); if ((parentType & 0x0f) != (curType & 0x0f)) toBeProcessed.push(formatNodeHolder(0, ContentSpecNode::UnknownType, chCloseParen)); if(second!=NULL) { toBeProcessed.push(formatNodeHolder(second, curType, 0)); toBeProcessed.push(formatNodeHolder(0, ContentSpecNode::UnknownType, chPipe)); } toBeProcessed.push(formatNodeHolder(first, curType, 0)); break; case ContentSpecNode::Sequence : if ((parentType & 0x0f) != (curType & 0x0f)) bufToFill.append(chOpenParen); if ((parentType & 0x0f) != (curType & 0x0f)) toBeProcessed.push(formatNodeHolder(0, ContentSpecNode::UnknownType, chCloseParen)); if(second!=NULL) { toBeProcessed.push(formatNodeHolder(second, curType, 0)); toBeProcessed.push(formatNodeHolder(0, ContentSpecNode::UnknownType, chComma)); } toBeProcessed.push(formatNodeHolder(first, curType, 0)); break; case ContentSpecNode::All : if ((parentType & 0x0f) != (curType & 0x0f)) { bufToFill.append(chLatin_A); bufToFill.append(chLatin_l); bufToFill.append(chLatin_l); bufToFill.append(chOpenParen); } if ((parentType & 0x0f) != (curType & 0x0f)) toBeProcessed.push(formatNodeHolder(0, ContentSpecNode::UnknownType, chCloseParen)); toBeProcessed.push(formatNodeHolder(second, curType, 0)); toBeProcessed.push(formatNodeHolder(0, ContentSpecNode::UnknownType, chComma)); toBeProcessed.push(formatNodeHolder(first, curType, 0)); break; } } } // --------------------------------------------------------------------------- // ContentSpecNode: Miscellaneous // --------------------------------------------------------------------------- void ContentSpecNode::formatSpec(XMLBuffer& bufToFill) const { // Clean out the buffer first bufToFill.reset(); if (fType == ContentSpecNode::Leaf) bufToFill.append(chOpenParen); formatNode ( this , bufToFill , fMemoryManager ); if (fType == ContentSpecNode::Leaf) bufToFill.append(chCloseParen); } int ContentSpecNode::getMinTotalRange() const { int min = fMinOccurs; if ((fType & 0x0f) == ContentSpecNode::Sequence || fType == ContentSpecNode::All || (fType & 0x0f) == ContentSpecNode::Choice) { int minFirst = fFirst->getMinTotalRange(); if (fSecond) { int minSecond = fSecond->getMinTotalRange(); if ((fType & 0x0f) == ContentSpecNode::Choice) { min = min * ((minFirst < minSecond)? minFirst : minSecond); } else { min = min * (minFirst + minSecond); } } else min = min * minFirst; } return min; } int ContentSpecNode::getMaxTotalRange() const { int max = fMaxOccurs; if (max == SchemaSymbols::XSD_UNBOUNDED) { return SchemaSymbols::XSD_UNBOUNDED; } if ((fType & 0x0f) == ContentSpecNode::Sequence || fType == ContentSpecNode::All || (fType & 0x0f) == ContentSpecNode::Choice) { int maxFirst = fFirst->getMaxTotalRange(); if (maxFirst == SchemaSymbols::XSD_UNBOUNDED) { return SchemaSymbols::XSD_UNBOUNDED; } if (fSecond) { int maxSecond = fSecond->getMaxTotalRange(); if (maxSecond == SchemaSymbols::XSD_UNBOUNDED) { return SchemaSymbols::XSD_UNBOUNDED; } else { if ((fType & 0x0f) == ContentSpecNode::Choice) { max = max * ((maxFirst > maxSecond) ? maxFirst : maxSecond); } else { max = max * (maxFirst + maxSecond); } } } else { max = max * maxFirst; } } return max; } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(ContentSpecNode) void ContentSpecNode::serialize(XSerializeEngine& serEng) { /*** * Since fElement, fFirst, fSecond are NOT created by the default * constructor, we need to create them dynamically. ***/ if (serEng.isStoring()) { serEng<>fElement; fElementDecl = XMLElementDecl::loadElementDecl(serEng); serEng>>fFirst; serEng>>fSecond; int type; serEng>>type; fType = (NodeTypes)type; serEng>>fAdoptFirst; serEng>>fAdoptSecond; serEng>>fMinOccurs; serEng>>fMaxOccurs; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/common/CMLeaf.hpp000644 000765 000024 00000017313 13241160333 023527 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: CMLeaf.hpp 677396 2008-07-16 19:36:20Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_CMLEAF_HPP) #define XERCESC_INCLUDE_GUARD_CMLEAF_HPP #include XERCES_CPP_NAMESPACE_BEGIN // // This class represents a leaf in the content spec node tree of an // element's content model. It just has an element qname and a position value, // the latter of which is used during the building of a DFA. // class CMLeaf : public CMNode { public : // ----------------------------------------------------------------------- // Constructors // ----------------------------------------------------------------------- CMLeaf ( QName* const element , unsigned int position , unsigned int maxStates , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); CMLeaf ( QName* const element , unsigned int position , bool adopt , unsigned int maxStates , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~CMLeaf(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- QName* getElement(); const QName* getElement() const; unsigned int getPosition() const; virtual bool isRepeatableLeaf() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setPosition(const unsigned int newPosition); // ----------------------------------------------------------------------- // Implementation of public CMNode virtual interface // ----------------------------------------------------------------------- virtual void orphanChild(); protected : // ----------------------------------------------------------------------- // Implementation of protected CMNode virtual interface // ----------------------------------------------------------------------- void calcFirstPos(CMStateSet& toSet) const; void calcLastPos(CMStateSet& toSet) const; private : // ----------------------------------------------------------------------- // Private data members // // fElement // This is the element that this leaf represents. // // fPosition // Part of the algorithm to convert a regex directly to a DFA // numbers each leaf sequentially. If its -1, that means its an // epsilon node. All others are non-epsilon positions. // // fAdopt // This node is responsible for the storage of the fElement QName. // ----------------------------------------------------------------------- QName* fElement; unsigned int fPosition; bool fAdopt; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- CMLeaf(const CMLeaf&); CMLeaf& operator=(const CMLeaf&); }; // ----------------------------------------------------------------------- // Constructors // ----------------------------------------------------------------------- inline CMLeaf::CMLeaf( QName* const element , unsigned int position , unsigned int maxStates , MemoryManager* const manager) : CMNode(ContentSpecNode::Leaf, maxStates, manager) , fElement(0) , fPosition(position) , fAdopt(false) { if (!element) { fElement = new (fMemoryManager) QName ( XMLUni::fgZeroLenString , XMLUni::fgZeroLenString , XMLElementDecl::fgInvalidElemId , fMemoryManager ); // We have to be responsible for this QName - override default fAdopt fAdopt = true; } else { fElement = element; } // Leaf nodes are never nullable unless its an epsilon node fIsNullable=(fPosition == epsilonNode); } inline CMLeaf::CMLeaf( QName* const element , unsigned int position , bool adopt , unsigned int maxStates , MemoryManager* const manager) : CMNode(ContentSpecNode::Leaf, maxStates, manager) , fElement(0) , fPosition(position) , fAdopt(adopt) { if (!element) { fElement = new (fMemoryManager) QName ( XMLUni::fgZeroLenString , XMLUni::fgZeroLenString , XMLElementDecl::fgInvalidElemId , fMemoryManager ); // We have to be responsible for this QName - override adopt parameter fAdopt = true; } else { fElement = element; } // Leaf nodes are never nullable unless its an epsilon node fIsNullable=(fPosition == epsilonNode); } inline CMLeaf::~CMLeaf() { if (fAdopt) delete fElement; } // --------------------------------------------------------------------------- // Getter methods // --------------------------------------------------------------------------- inline QName* CMLeaf::getElement() { return fElement; } inline const QName* CMLeaf::getElement() const { return fElement; } inline unsigned int CMLeaf::getPosition() const { return fPosition; } inline bool CMLeaf::isRepeatableLeaf() const { return false; } // --------------------------------------------------------------------------- // Setter methods // --------------------------------------------------------------------------- inline void CMLeaf::setPosition(const unsigned int newPosition) { fPosition = newPosition; } // --------------------------------------------------------------------------- // Implementation of public CMNode virtual interface // --------------------------------------------------------------------------- inline void CMLeaf::orphanChild() { } // --------------------------------------------------------------------------- // Implementation of protected CMNode virtual interface // --------------------------------------------------------------------------- inline void CMLeaf::calcFirstPos(CMStateSet& toSet) const { // If we are an epsilon node, then the first pos is an empty set if (isNullable()) { toSet.zeroBits(); return; } // Otherwise, its just the one bit of our position toSet.setBit(fPosition); } inline void CMLeaf::calcLastPos(CMStateSet& toSet) const { // If we are an epsilon node, then the last pos is an empty set if (isNullable()) { toSet.zeroBits(); return; } // Otherwise, its just the one bit of our position toSet.setBit(fPosition); } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/schema/XSDDOMParser.cpp000644 000765 000024 00000045051 13241160332 024555 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: XSDDOMParser.cpp 729944 2008-12-29 17:03:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSDDOMParser: Constructors and Destructor // --------------------------------------------------------------------------- XSDDOMParser::XSDDOMParser( XMLValidator* const valToAdopt , MemoryManager* const manager , XMLGrammarPool* const gramPool): XercesDOMParser(valToAdopt, manager, gramPool) , fSawFatal(false) , fAnnotationDepth(-1) , fInnerAnnotationDepth(-1) , fDepth(-1) , fUserErrorReporter(0) , fUserEntityHandler(0) , fURIs(0) , fAnnotationBuf(1023, manager) { fURIs = new (manager) ValueVectorOf(16, manager); fXSDErrorReporter.setErrorReporter(this); setValidationScheme(XercesDOMParser::Val_Never); setDoNamespaces(true); } XSDDOMParser::~XSDDOMParser() { delete fURIs; } // --------------------------------------------------------------------------- // XSDDOMParser: Helper methods // --------------------------------------------------------------------------- DOMElement* XSDDOMParser::createElementNSNode(const XMLCh *namespaceURI, const XMLCh *qualifiedName) { ReaderMgr::LastExtEntityInfo lastInfo; ((ReaderMgr*) fScanner->getLocator())->getLastExtEntityInfo(lastInfo); return getDocument()->createElementNS(namespaceURI, qualifiedName, lastInfo.lineNumber, lastInfo.colNumber); } void XSDDOMParser::startAnnotation( const XMLElementDecl& elemDecl , const RefVectorOf& attrList , const XMLSize_t attrCount) { fAnnotationBuf.append(chOpenAngle); fAnnotationBuf.append(elemDecl.getFullName()); fAnnotationBuf.append(chSpace); // attributes are a bit of a pain. To get this right, we have to keep track // of the namespaces we've seen declared, then examine the namespace context // for other namespaces so that we can also include them. // optimized for simplicity and the case that not many // namespaces are declared on this annotation... fURIs->removeAllElements(); for (XMLSize_t i=0; i < attrCount; i++) { const XMLAttr* oneAttrib = attrList.elementAt(i); const XMLCh* attrValue = oneAttrib->getValue(); if (XMLString::equals(oneAttrib->getName(), XMLUni::fgXMLNSString)) fURIs->addElement(fScanner->getPrefixId(XMLUni::fgZeroLenString)); else if (!XMLString::compareNString(oneAttrib->getQName(), XMLUni::fgXMLNSColonString, 6)) fURIs->addElement(fScanner->getPrefixId(oneAttrib->getName())); fAnnotationBuf.append(oneAttrib->getQName()); fAnnotationBuf.append(chEqual); fAnnotationBuf.append(chDoubleQuote); fAnnotationBuf.append(attrValue); fAnnotationBuf.append(chDoubleQuote); fAnnotationBuf.append(chSpace); } // now we have to look through currently in-scope namespaces to see what // wasn't declared here ValueVectorOf* namespaceContext = fScanner->getNamespaceContext(); for (XMLSize_t j=0; j < namespaceContext->size(); j++) { unsigned int prefId = namespaceContext->elementAt(j)->fPrefId; if (!fURIs->containsElement(prefId)) { const XMLCh* prefix = fScanner->getPrefixForId(prefId); if (XMLString::equals(prefix, XMLUni::fgZeroLenString)) { fAnnotationBuf.append(XMLUni::fgXMLNSString); } else { fAnnotationBuf.append(XMLUni::fgXMLNSColonString); fAnnotationBuf.append(prefix); } fAnnotationBuf.append(chEqual); fAnnotationBuf.append(chDoubleQuote); fAnnotationBuf.append(fScanner->getURIText(namespaceContext->elementAt(j)->fURIId)); fAnnotationBuf.append(chDoubleQuote); fAnnotationBuf.append(chSpace); fURIs->addElement(prefId); } } fAnnotationBuf.append(chCloseAngle); fAnnotationBuf.append(chLF); } void XSDDOMParser::startAnnotationElement( const XMLElementDecl& elemDecl , const RefVectorOf& attrList , const XMLSize_t attrCount) { fAnnotationBuf.append(chOpenAngle); fAnnotationBuf.append(elemDecl.getFullName()); //fAnnotationBuf.append(chSpace); for(XMLSize_t i=0; i < attrCount; i++) { const XMLAttr* oneAttr = attrList.elementAt(i); fAnnotationBuf.append(chSpace); fAnnotationBuf.append(oneAttr ->getQName()); fAnnotationBuf.append(chEqual); fAnnotationBuf.append(chDoubleQuote); fAnnotationBuf.append(oneAttr->getValue()); fAnnotationBuf.append(chDoubleQuote); } fAnnotationBuf.append(chCloseAngle); } void XSDDOMParser::endAnnotationElement( const XMLElementDecl& elemDecl , bool complete) { if (complete) { fAnnotationBuf.append(chLF); fAnnotationBuf.append(chOpenAngle); fAnnotationBuf.append(chForwardSlash); fAnnotationBuf.append(elemDecl.getFullName()); fAnnotationBuf.append(chCloseAngle); // note that this is always called after endElement on 's // child and before endElement on annotation. // hence, we must make this the child of the current // parent's only child. DOMTextImpl *node = (DOMTextImpl *)fDocument->createTextNode(fAnnotationBuf.getRawBuffer()); fCurrentNode->appendChild(node); fAnnotationBuf.reset(); } else //capturing character calls { fAnnotationBuf.append(chOpenAngle); fAnnotationBuf.append(chForwardSlash); fAnnotationBuf.append(elemDecl.getFullName()); fAnnotationBuf.append(chCloseAngle); } } // --------------------------------------------------------------------------- // XSDDOMParser: Setter methods // --------------------------------------------------------------------------- void XSDDOMParser::setUserErrorReporter(XMLErrorReporter* const errorReporter) { fUserErrorReporter = errorReporter; fScanner->setErrorReporter(this); } void XSDDOMParser::setUserEntityHandler(XMLEntityHandler* const entityHandler) { fUserEntityHandler = entityHandler; fScanner->setEntityHandler(this); } // --------------------------------------------------------------------------- // XSDDOMParser: Implementation of the XMLDocumentHandler interface // --------------------------------------------------------------------------- void XSDDOMParser::startElement( const XMLElementDecl& elemDecl , const unsigned int urlId , const XMLCh* const elemPrefix , const RefVectorOf& attrList , const XMLSize_t attrCount , const bool isEmpty , const bool isRoot) { fDepth++; // while it is true that non-whitespace character data // may only occur in appInfo or documentation // elements, it's certainly legal for comments and PI's to // occur as children of annotation; we need // to account for these here. if (fAnnotationDepth == -1) { if (XMLString::equals(elemDecl.getBaseName(), SchemaSymbols::fgELT_ANNOTATION) && XMLString::equals(getURIText(urlId), SchemaSymbols::fgURI_SCHEMAFORSCHEMA)) { fAnnotationDepth = fDepth; startAnnotation(elemDecl, attrList, attrCount); } } else if (fDepth == fAnnotationDepth+1) { fInnerAnnotationDepth = fDepth; startAnnotationElement(elemDecl, attrList, attrCount); } else { startAnnotationElement(elemDecl, attrList, attrCount); if(isEmpty) endElement(elemDecl, urlId, isRoot, elemPrefix); // avoid falling through; don't call startElement in this case return; } DOMElement *elem; if (urlId != fScanner->getEmptyNamespaceId()) //TagName has a prefix { if (elemPrefix && *elemPrefix) { XMLBufBid elemQName(&fBufMgr); elemQName.set(elemPrefix); elemQName.append(chColon); elemQName.append(elemDecl.getBaseName()); elem = createElementNSNode( fScanner->getURIText(urlId), elemQName.getRawBuffer()); } else { elem = createElementNSNode( fScanner->getURIText(urlId), elemDecl.getBaseName()); } } else { elem = createElementNSNode(0, elemDecl.getBaseName()); } DOMElementImpl *elemImpl = (DOMElementImpl *) elem; for (XMLSize_t index = 0; index < attrCount; ++index) { const XMLAttr* oneAttrib = attrList.elementAt(index); unsigned int attrURIId = oneAttrib->getURIId(); const XMLCh* namespaceURI = 0; //for xmlns=... if (XMLString::equals(oneAttrib->getName(), XMLUni::fgXMLNSString)) attrURIId = fScanner->getXMLNSNamespaceId(); //TagName has a prefix if (attrURIId != fScanner->getEmptyNamespaceId()) namespaceURI = fScanner->getURIText(attrURIId); //get namespaceURI // revisit. Optimize to init the named node map to the // right size up front. DOMAttrImpl *attr = (DOMAttrImpl *) fDocument->createAttributeNS(namespaceURI, oneAttrib->getQName()); attr->setValue(oneAttrib -> getValue()); DOMNode* remAttr = elemImpl->setAttributeNodeNS(attr); if (remAttr) remAttr->release(); // Attributes of type ID. If this is one, add it to the hashtable of IDs // that is constructed for use by GetElementByID(). if (oneAttrib->getType()==XMLAttDef::ID) { if (fDocument->fNodeIDMap == 0) fDocument->fNodeIDMap = new (fDocument) DOMNodeIDMap(500, fDocument); fDocument->fNodeIDMap->add(attr); attr->fNode.isIdAttr(true); } attr->setSpecified(oneAttrib->getSpecified()); } // set up the default attributes if (elemDecl.hasAttDefs()) { XMLAttDefList* defAttrs = &elemDecl.getAttDefList(); XMLAttDef* attr = 0; DOMAttrImpl * insertAttr = 0; for (XMLSize_t i=0; igetAttDefCount(); i++) { attr = &defAttrs->getAttDef(i); const XMLAttDef::DefAttTypes defType = attr->getDefaultType(); if ((defType == XMLAttDef::Default) || (defType == XMLAttDef::Fixed)) { // DOM Level 2 wants all namespace declaration attributes // to be bound to "http://www.w3.org/2000/xmlns/" // So as long as the XML parser doesn't do it, it needs to // done here. const XMLCh* qualifiedName = attr->getFullName(); XMLBufBid bbPrefixQName(&fBufMgr); XMLBuffer& prefixBuf = bbPrefixQName.getBuffer(); int colonPos = -1; unsigned int uriId = fScanner->resolveQName(qualifiedName, prefixBuf, ElemStack::Mode_Attribute, colonPos); const XMLCh* namespaceURI = 0; if (XMLString::equals(qualifiedName, XMLUni::fgXMLNSString)) uriId = fScanner->getXMLNSNamespaceId(); //TagName has a prefix if (uriId != fScanner->getEmptyNamespaceId()) namespaceURI = fScanner->getURIText(uriId); insertAttr = (DOMAttrImpl *) fDocument->createAttributeNS( namespaceURI, qualifiedName); DOMAttr* remAttr = elemImpl->setDefaultAttributeNodeNS(insertAttr); if (remAttr) remAttr->release(); if (attr->getValue() != 0) { insertAttr->setValue(attr->getValue()); insertAttr->setSpecified(false); } } insertAttr = 0; attr->reset(); } } fCurrentParent->appendChild(elem); fCurrentParent = elem; fCurrentNode = elem; fWithinElement = true; // If an empty element, do end right now (no endElement() will be called) if (isEmpty) endElement(elemDecl, urlId, isRoot, elemPrefix); } void XSDDOMParser::endElement( const XMLElementDecl& elemDecl , const unsigned int , const bool , const XMLCh* const) { if(fAnnotationDepth > -1) { if (fInnerAnnotationDepth == fDepth) { fInnerAnnotationDepth = -1; endAnnotationElement(elemDecl, false); } else if (fAnnotationDepth == fDepth) { fAnnotationDepth = -1; endAnnotationElement(elemDecl, true); } else { // inside a child of annotation endAnnotationElement(elemDecl, false); fDepth--; return; } } fDepth--; fCurrentNode = fCurrentParent; fCurrentParent = fCurrentNode->getParentNode (); // If we've hit the end of content, clear the flag. // if (fCurrentParent == fDocument) fWithinElement = false; } void XSDDOMParser::docCharacters( const XMLCh* const chars , const XMLSize_t length , const bool cdataSection) { // Ignore chars outside of content if (!fWithinElement) return; if (fInnerAnnotationDepth == -1) { if (!((ReaderMgr*) fScanner->getReaderMgr())->getCurrentReader()->isAllSpaces(chars, length)) { ReaderMgr::LastExtEntityInfo lastInfo; fScanner->getReaderMgr()->getLastExtEntityInfo(lastInfo); fXSLocator.setValues(lastInfo.systemId, lastInfo.publicId, lastInfo.lineNumber, lastInfo.colNumber); fXSDErrorReporter.emitError(XMLValid::NonWSContent, XMLUni::fgValidityDomain, &fXSLocator); } } // when it's within either of the 2 annotation subelements, characters are // allowed and we need to store them. else if (cdataSection == true) { fAnnotationBuf.append(XMLUni::fgCDataStart); fAnnotationBuf.append(chars, length); fAnnotationBuf.append(XMLUni::fgCDataEnd); } else { for(unsigned int i = 0; i < length; i++ ) { if(chars[i] == chAmpersand) { fAnnotationBuf.append(chAmpersand); fAnnotationBuf.append(XMLUni::fgAmp); fAnnotationBuf.append(chSemiColon); } else if (chars[i] == chOpenAngle) { fAnnotationBuf.append(chAmpersand); fAnnotationBuf.append(XMLUni::fgLT); fAnnotationBuf.append(chSemiColon); } else { fAnnotationBuf.append(chars[i]); } } } } void XSDDOMParser::docComment(const XMLCh* const comment) { if (fAnnotationDepth > -1) { fAnnotationBuf.append(XMLUni::fgCommentString); fAnnotationBuf.append(comment); fAnnotationBuf.append(chDash); fAnnotationBuf.append(chDash); fAnnotationBuf.append(chCloseAngle); } } void XSDDOMParser::startEntityReference(const XMLEntityDecl&) { } void XSDDOMParser::endEntityReference(const XMLEntityDecl&) { } void XSDDOMParser::ignorableWhitespace( const XMLCh* const chars , const XMLSize_t length , const bool) { // Ignore chars before the root element if (!fWithinElement || !fIncludeIgnorableWhitespace) return; if (fAnnotationDepth > -1) fAnnotationBuf.append(chars, length); } // --------------------------------------------------------------------------- // XSDDOMParser: Implementation of the XMLErrorReporter interface // --------------------------------------------------------------------------- void XSDDOMParser::error(const unsigned int code , const XMLCh* const msgDomain , const XMLErrorReporter::ErrTypes errType , const XMLCh* const errorText , const XMLCh* const systemId , const XMLCh* const publicId , const XMLFileLoc lineNum , const XMLFileLoc colNum) { if (errType >= XMLErrorReporter::ErrType_Fatal) fSawFatal = true; if (fUserErrorReporter) fUserErrorReporter->error(code, msgDomain, errType, errorText, systemId, publicId, lineNum, colNum); } InputSource* XSDDOMParser::resolveEntity(XMLResourceIdentifier* resourceIdentifier) { if (fUserEntityHandler) return fUserEntityHandler->resolveEntity(resourceIdentifier); return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/schema/SchemaAttDef.cpp000644 000765 000024 00000013420 13241160332 024665 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SchemaAttDef.cpp 679359 2008-07-24 11:15:19Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // SchemaAttDef: Implementation of the XMLAttDef interface // --------------------------------------------------------------------------- const XMLCh* SchemaAttDef::getFullName() const { return fAttName->getRawName(); } // --------------------------------------------------------------------------- // SchemaAttDef: Constructors and Destructor // --------------------------------------------------------------------------- SchemaAttDef::SchemaAttDef(MemoryManager* const manager) : XMLAttDef(XMLAttDef::CData, XMLAttDef::Implied, manager) , fElemId(XMLElementDecl::fgInvalidElemId) , fPSVIScope(PSVIDefs::SCP_ABSENT) , fAttName(0) , fDatatypeValidator(0) , fNamespaceList(0) , fBaseAttDecl(0) { } SchemaAttDef::SchemaAttDef( const XMLCh* const prefix , const XMLCh* const localPart , const int uriId , const XMLAttDef::AttTypes type , const XMLAttDef::DefAttTypes defType , MemoryManager* const manager) : XMLAttDef(type, defType, manager) , fElemId(XMLElementDecl::fgInvalidElemId) , fPSVIScope(PSVIDefs::SCP_ABSENT) , fDatatypeValidator(0) , fNamespaceList(0) , fBaseAttDecl(0) { fAttName = new (manager) QName(prefix, localPart, uriId, manager); } SchemaAttDef::SchemaAttDef( const XMLCh* const prefix , const XMLCh* const localPart , const int uriId , const XMLCh* const attValue , const XMLAttDef::AttTypes type , const XMLAttDef::DefAttTypes defType , const XMLCh* const enumValues , MemoryManager* const manager) : XMLAttDef(attValue, type, defType, enumValues, manager) , fElemId(XMLElementDecl::fgInvalidElemId) , fPSVIScope(PSVIDefs::SCP_ABSENT) , fDatatypeValidator(0) , fNamespaceList(0) , fBaseAttDecl(0) { fAttName = new (manager) QName(prefix, localPart, uriId, manager); } SchemaAttDef::SchemaAttDef(const SchemaAttDef* other) : XMLAttDef(other->getValue(), other->getType(), other->getDefaultType(), other->getEnumeration(), other->getMemoryManager()) , fElemId(XMLElementDecl::fgInvalidElemId) , fPSVIScope(other->fPSVIScope) , fAttName(0) , fDatatypeValidator(other->fDatatypeValidator) , fNamespaceList(0) , fBaseAttDecl(other->fBaseAttDecl) { QName* otherName = other->getAttName(); fAttName = new (getMemoryManager()) QName(otherName->getPrefix(), otherName->getLocalPart(), otherName->getURI(), getMemoryManager()); if (other->fNamespaceList && other->fNamespaceList->size()) { fNamespaceList = new (getMemoryManager()) ValueVectorOf(*(other->fNamespaceList)); } } SchemaAttDef::~SchemaAttDef() { delete fAttName; delete fNamespaceList; } // --------------------------------------------------------------------------- // SchemaAttDef: Setter methods // --------------------------------------------------------------------------- void SchemaAttDef::setAttName(const XMLCh* const prefix , const XMLCh* const localPart , const int uriId ) { fAttName->setName(prefix, localPart, uriId); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(SchemaAttDef) void SchemaAttDef::serialize(XSerializeEngine& serEng) { XMLAttDef::serialize(serEng); if (serEng.isStoring()) { serEng.writeSize (fElemId); serEng<<(int)fPSVIScope; serEng< ***/ XTemplateSerializer::storeObject(fNamespaceList, serEng); serEng<>i; fPSVIScope = (PSVIDefs::PSVIScope)i; serEng>>fAttName; fDatatypeValidator = DatatypeValidator::loadDV(serEng); /*** * Deserialize ValueVectorOf ***/ XTemplateSerializer::loadObject(&fNamespaceList, 8, false, serEng); serEng>>fBaseAttDecl; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/schema/XUtil.cpp000644 000765 000024 00000007560 13241160332 023452 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XUtil.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // Finds and returns the first child element node. DOMElement* XUtil::getFirstChildElement(const DOMNode* const parent) { // search for node DOMNode* child = parent->getFirstChild(); while (child != 0) { if (child->getNodeType() == DOMNode::ELEMENT_NODE) return (DOMElement*)child; child = child->getNextSibling(); } // not found return 0; } // Finds and returns the first child node with the given name. DOMElement* XUtil::getFirstChildElementNS(const DOMNode* const parent , const XMLCh** const elemNames , const XMLCh* const uriStr , unsigned int length) { // search for node DOMNode* child = parent->getFirstChild(); while (child != 0) { if (child->getNodeType() == DOMNode::ELEMENT_NODE) { for (unsigned int i = 0; i < length; i++) { if (XMLString::equals(child->getNamespaceURI(), uriStr) && XMLString::equals(child->getLocalName(), elemNames[i])) return (DOMElement*)child; } } child = child->getNextSibling(); } // not found return 0; } // Finds and returns the last child element node. DOMElement* XUtil::getNextSiblingElement(const DOMNode* const node) { // search for node DOMNode* sibling = node->getNextSibling(); while (sibling != 0) { if (sibling->getNodeType() == DOMNode::ELEMENT_NODE) return (DOMElement*)sibling; sibling = sibling->getNextSibling(); } // not found return 0; } // Finds and returns the next sibling element node with the give name. DOMElement* XUtil::getNextSiblingElementNS(const DOMNode* const node , const XMLCh** const elemNames , const XMLCh* const uriStr , unsigned int length) { // search for node DOMNode* sibling = node->getNextSibling(); while (sibling != 0) { if (sibling->getNodeType() == DOMNode::ELEMENT_NODE) { for (unsigned int i = 0; i < length; i++) { if (XMLString::equals(sibling->getNamespaceURI(), uriStr) && XMLString::equals(sibling->getLocalName(), elemNames[i])) return (DOMElement*)sibling; } } sibling = sibling->getNextSibling(); } // not found return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/schema/XSDErrorReporter.cpp000644 000765 000024 00000016023 13241160332 025572 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local static data // --------------------------------------------------------------------------- static XMLMsgLoader* gErrMsgLoader = 0; static XMLMsgLoader* gValidMsgLoader = 0; void XMLInitializer::initializeXSDErrorReporter() { gErrMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgXMLErrDomain); if (!gErrMsgLoader) XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain); gValidMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgValidityDomain); if (!gValidMsgLoader) XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain); } void XMLInitializer::terminateXSDErrorReporter() { delete gErrMsgLoader; gErrMsgLoader = 0; delete gValidMsgLoader; gValidMsgLoader = 0; } // --------------------------------------------------------------------------- // XSDErrorReporter: Constructors and Destructor // --------------------------------------------------------------------------- XSDErrorReporter::XSDErrorReporter(XMLErrorReporter* const errorReporter) : fExitOnFirstFatal(false) , fErrorReporter(errorReporter) { } // --------------------------------------------------------------------------- // XSDErrorReporter: Error reporting // --------------------------------------------------------------------------- void XSDErrorReporter::emitError(const unsigned int toEmit, const XMLCh* const msgDomain, const Locator* const aLocator) { // Bump the error count if it is not a warning // if (XMLErrs::errorType(toEmit) != XMLErrorReporter::ErrType_Warning) // incrementErrorCount(); // // Load the message into alocal and replace any tokens found in // the text. // const XMLSize_t msgSize = 1023; XMLCh errText[msgSize + 1]; XMLMsgLoader* msgLoader = gErrMsgLoader; XMLErrorReporter::ErrTypes errType = XMLErrs::errorType((XMLErrs::Codes) toEmit); if (XMLString::equals(msgDomain, XMLUni::fgValidityDomain)) { errType = XMLValid::errorType((XMLValid::Codes) toEmit); msgLoader = gValidMsgLoader; } if (!msgLoader->loadMsg(toEmit, errText, msgSize)) { // Should probably load a default message here } if (fErrorReporter) fErrorReporter->error(toEmit, msgDomain, errType, errText, aLocator->getSystemId(), aLocator->getPublicId(), aLocator->getLineNumber(), aLocator->getColumnNumber()); // Bail out if its fatal an we are to give up on the first fatal error if (errType == XMLErrorReporter::ErrType_Fatal && fExitOnFirstFatal) throw (XMLErrs::Codes) toEmit; } void XSDErrorReporter::emitError(const unsigned int toEmit, const XMLCh* const msgDomain, const Locator* const aLocator, const XMLCh* const text1, const XMLCh* const text2, const XMLCh* const text3, const XMLCh* const text4, MemoryManager* const manager) { // Bump the error count if it is not a warning // if (XMLErrs::errorType(toEmit) != XMLErrorReporter::ErrType_Warning) // incrementErrorCount(); // // Load the message into alocal and replace any tokens found in // the text. // const XMLSize_t maxChars = 2047; XMLCh errText[maxChars + 1]; XMLMsgLoader* msgLoader = gErrMsgLoader; XMLErrorReporter::ErrTypes errType = XMLErrs::errorType((XMLErrs::Codes) toEmit); if (XMLString::equals(msgDomain, XMLUni::fgValidityDomain)) { errType = XMLValid::errorType((XMLValid::Codes) toEmit); msgLoader = gValidMsgLoader; } if (!msgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4, manager)) { // Should probably load a default message here } if (fErrorReporter) fErrorReporter->error(toEmit, msgDomain, errType, errText, aLocator->getSystemId(), aLocator->getPublicId(), aLocator->getLineNumber(), aLocator->getColumnNumber()); // Bail out if its fatal an we are to give up on the first fatal error if (errType == XMLErrorReporter::ErrType_Fatal && fExitOnFirstFatal) throw (XMLErrs::Codes) toEmit; } void XSDErrorReporter::emitError(const XMLException& except, const Locator* const aLocator) { const XMLCh* const errText = except.getMessage(); const unsigned int toEmit = except.getCode(); //Before the code was modified to call this routine it used to use //the XMLErrs::DisplayErrorMessage error message, which is just {'0'} //and that error message has errType of Error. So to be consistent //with previous behaviour set the errType to be Error instead of //getting the error type off of the exception. //XMLErrorReporter::ErrTypes errType = XMLErrs::errorType((XMLErrs::Codes) toEmit); XMLErrorReporter::ErrTypes errType = XMLErrorReporter::ErrType_Error; if (fErrorReporter) fErrorReporter->error(toEmit, XMLUni::fgExceptDomain, errType, errText, aLocator->getSystemId(), aLocator->getPublicId(), aLocator->getLineNumber(), aLocator->getColumnNumber()); // Bail out if its fatal an we are to give up on the first fatal error //if (errType == XMLErrorReporter::ErrType_Fatal && fExitOnFirstFatal) // throw (XMLErrs::Codes) toEmit; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/schema/XSDLocator.hpp000644 000765 000024 00000010331 13241160332 024362 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSDLocator.hpp 672273 2008-06-27 13:57:00Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSDLOCATOR_HPP) #define XERCESC_INCLUDE_GUARD_XSDLOCATOR_HPP /** * A Locator implementation */ #include #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT XSDLocator: public XMemory, public Locator { public: /** @name Constructors and Destructor */ //@{ /** Default constructor */ XSDLocator(); /** Destructor */ virtual ~XSDLocator() { } //@} /** @name The locator interface */ //@{ /** * Return the public identifier for the current document event. *

This will be the public identifier * @return A string containing the public identifier, or * null if none is available. * @see #getSystemId */ virtual const XMLCh* getPublicId() const; /** * Return the system identifier for the current document event. * *

If the system identifier is a URL, the parser must resolve it * fully before passing it to the application.

* * @return A string containing the system identifier, or null * if none is available. * @see #getPublicId */ virtual const XMLCh* getSystemId() const; /** * Return the line number where the current document event ends. * Note that this is the line position of the first character * after the text associated with the document event. * @return The line number, or 0 if none is available. * @see #getColumnNumber */ virtual XMLFileLoc getLineNumber() const; /** * Return the column number where the current document event ends. * Note that this is the column number of the first * character after the text associated with the document * event. The first column in a line is position 1. * @return The column number, or 0 if none is available. * @see #getLineNumber */ virtual XMLFileLoc getColumnNumber() const; //@} // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setValues(const XMLCh* const systemId, const XMLCh* const publicId, const XMLFileLoc lineNo, const XMLFileLoc columnNo); private : // ----------------------------------------------------------------------- // Unimplemented constructors and destructor // ----------------------------------------------------------------------- XSDLocator(const XSDLocator&); XSDLocator& operator=(const XSDLocator&); // ----------------------------------------------------------------------- // Private data members // ----------------------------------------------------------------------- XMLFileLoc fLineNo; XMLFileLoc fColumnNo; const XMLCh* fSystemId; const XMLCh* fPublicId; }; // --------------------------------------------------------------------------- // XSDLocator: Getter methods // --------------------------------------------------------------------------- inline XMLFileLoc XSDLocator::getLineNumber() const { return fLineNo; } inline XMLFileLoc XSDLocator::getColumnNumber() const { return fColumnNo; } inline const XMLCh* XSDLocator::getPublicId() const { return fPublicId; } inline const XMLCh* XSDLocator::getSystemId() const { return fSystemId; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/schema/NamespaceScope.cpp000644 000765 000024 00000024132 13241160332 025265 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: NamespaceScope.cpp 729944 2008-12-29 17:03:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // NamespaceScope: Constructors and Destructor // --------------------------------------------------------------------------- NamespaceScope::NamespaceScope(MemoryManager* const manager /*= XMLPlatformUtils::fgMemoryManager*/) : fEmptyNamespaceId(0) , fStackCapacity(8) , fStackTop(0) , fPrefixPool(109, manager) , fStack(0) , fMemoryManager(manager) { // Do an initial allocation of the stack and zero it out fStack = (StackElem**) fMemoryManager->allocate ( fStackCapacity * sizeof(StackElem*) );//new StackElem*[fStackCapacity]; memset(fStack, 0, fStackCapacity * sizeof(StackElem*)); } NamespaceScope::NamespaceScope(const NamespaceScope* const initialize, MemoryManager* const manager /*= XMLPlatformUtils::fgMemoryManager*/) : fEmptyNamespaceId(0) , fStackCapacity(8) , fStackTop(0) , fPrefixPool(109, manager) , fStack(0) , fMemoryManager(manager) { // Do an initial allocation of the stack and zero it out fStack = (StackElem**) fMemoryManager->allocate ( fStackCapacity * sizeof(StackElem*) );//new StackElem*[fStackCapacity]; memset(fStack, 0, fStackCapacity * sizeof(StackElem*)); if(initialize) { reset(initialize->fEmptyNamespaceId); // copy the existing bindings for (unsigned int index = initialize->fStackTop; index > 0; index--) { // Get a convenience pointer to the current element StackElem* curRow = initialize->fStack[index-1]; // If no prefixes mapped at this level, then go the next one if (!curRow->fMapCount) continue; for (unsigned int mapIndex = 0; mapIndex < curRow->fMapCount; mapIndex++) { // go from the id to the prefix const XMLCh* prefix = initialize->fPrefixPool.getValueForId(curRow->fMap[mapIndex].fPrefId); // if the prefix is not already known, add it if(getNamespaceForPrefix(prefix)==fEmptyNamespaceId) addPrefix(prefix, curRow->fMap[mapIndex].fURIId); } } } } NamespaceScope::~NamespaceScope() { // // Start working from the bottom of the stack and clear it out as we // go up. Once we hit an uninitialized one, we can break out. // for (unsigned int stackInd = 0; stackInd < fStackCapacity; stackInd++) { // If this entry has been set, then lets clean it up if (!fStack[stackInd]) break; // Delete the row for this entry, then delete the row structure fMemoryManager->deallocate(fStack[stackInd]->fMap);//delete [] fStack[stackInd]->fMap; delete fStack[stackInd]; } // Delete the stack array itself now fMemoryManager->deallocate(fStack);//delete [] fStack; } // --------------------------------------------------------------------------- // NamespaceScope: Stack access // --------------------------------------------------------------------------- unsigned int NamespaceScope::increaseDepth() { // See if we need to expand the stack if (fStackTop == fStackCapacity) expandStack(); // If this element has not been initialized yet, then initialize it if (!fStack[fStackTop]) { fStack[fStackTop] = new (fMemoryManager) StackElem; fStack[fStackTop]->fMapCapacity = 0; fStack[fStackTop]->fMap = 0; } // Set up the new top row fStack[fStackTop]->fMapCount = 0; // Bump the top of stack fStackTop++; return fStackTop-1; } unsigned int NamespaceScope::decreaseDepth() { if (!fStackTop) ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::ElemStack_StackUnderflow, fMemoryManager); fStackTop--; return fStackTop; } // --------------------------------------------------------------------------- // NamespaceScope: Prefix map methods // --------------------------------------------------------------------------- void NamespaceScope::addPrefix(const XMLCh* const prefixToAdd, const unsigned int uriId) { if (!fStackTop) ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::ElemStack_EmptyStack, fMemoryManager); // Get a convenience pointer to the stack top row StackElem* curRow = fStack[fStackTop - 1]; // Map the prefix to its unique id const unsigned int prefId = fPrefixPool.addOrFind(prefixToAdd); // Search the map at this level for the passed prefix for (unsigned int mapIndex = 0; mapIndex < curRow->fMapCount; mapIndex++) { if (curRow->fMap[mapIndex].fPrefId == prefId) { curRow->fMap[mapIndex].fURIId = uriId; return; } } // // Add a new element to the prefix map for this element. If its full, // then expand it out. // if (curRow->fMapCount == curRow->fMapCapacity) expandMap(curRow); // // And now add a new element for this prefix. // curRow->fMap[curRow->fMapCount].fPrefId = prefId; curRow->fMap[curRow->fMapCount].fURIId = uriId; // Bump the map count now curRow->fMapCount++; } unsigned int NamespaceScope::getNamespaceForPrefix(const XMLCh* const prefixToMap) const { // // Map the prefix to its unique id, from the prefix string pool. If its // not a valid prefix, then its a failure. // unsigned int prefixId = fPrefixPool.getId(prefixToMap); if (!prefixId){ return fEmptyNamespaceId; } // // Start at the stack top and work backwards until we come to some // element that mapped this prefix. // for (unsigned int index = fStackTop; index > 0; index--) { // Get a convenience pointer to the current element StackElem* curRow = fStack[index-1]; // If no prefixes mapped at this level, then go the next one if (!curRow->fMapCount) continue; // Search the map at this level for the passed prefix for (unsigned int mapIndex = 0; mapIndex < curRow->fMapCount; mapIndex++) { if (curRow->fMap[mapIndex].fPrefId == prefixId) return curRow->fMap[mapIndex].fURIId; } } return fEmptyNamespaceId; } // --------------------------------------------------------------------------- // NamespaceScope: Miscellaneous methods // --------------------------------------------------------------------------- void NamespaceScope::reset(const unsigned int emptyId) { // Flush the prefix pool and put back in the standard prefixes fPrefixPool.flushAll(); // Reset the stack top to clear the stack fStackTop = 0; // And store the new special URI ids fEmptyNamespaceId = emptyId; // add the first storage increaseDepth(); } // --------------------------------------------------------------------------- // Namespace: Private helpers // --------------------------------------------------------------------------- void NamespaceScope::expandMap(StackElem* const toExpand) { // For convenience get the old map size const unsigned int oldCap = toExpand->fMapCapacity; // // Expand the capacity by 25%, or initialize it to 16 if its currently // empty. Then allocate a new temp buffer. // const unsigned int newCapacity = oldCap ? (unsigned int)(oldCap * 1.25) : 16; PrefMapElem* newMap = (PrefMapElem*) fMemoryManager->allocate ( newCapacity * sizeof(PrefMapElem) );//new PrefMapElem[newCapacity]; // // Copy over the old stuff. We DON'T have to zero out the new stuff // since this is a by value map and the current map index controls what // is relevant. // memcpy(newMap, toExpand->fMap, oldCap * sizeof(PrefMapElem)); // Delete the old map and store the new stuff fMemoryManager->deallocate(toExpand->fMap);//delete [] toExpand->fMap; toExpand->fMap = newMap; toExpand->fMapCapacity = newCapacity; } void NamespaceScope::expandStack() { // Expand the capacity by 25% and allocate a new buffer const unsigned int newCapacity = (unsigned int)(fStackCapacity * 1.25); StackElem** newStack = (StackElem**) fMemoryManager->allocate ( newCapacity * sizeof(StackElem*) );//new StackElem*[newCapacity]; // Copy over the old stuff memcpy(newStack, fStack, fStackCapacity * sizeof(StackElem*)); // // And zero out the new stuff. Though we use a stack top, we reuse old // stack contents so we need to know if elements have been initially // allocated or not as we push new stuff onto the stack. // memset ( &newStack[fStackCapacity] , 0 , (newCapacity - fStackCapacity) * sizeof(StackElem*) ); // Delete the old array and update our members fMemoryManager->deallocate(fStack);//delete [] fStack; fStack = newStack; fStackCapacity = newCapacity; } XERCES_CPP_NAMESPACE_END /** * End of file NamespaceScope.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/000755 000765 000024 00000000000 13345765734 023550 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/validators/schema/SubstitutionGroupComparator.cpp000644 000765 000024 00000017072 13241160332 030165 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SubstitutionGroupComparator.cpp 794273 2009-07-15 14:13:07Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN bool SubstitutionGroupComparator::isEquivalentTo(const QName* const anElement , const QName* const exemplar) { if (!anElement && !exemplar) return true; if ((!anElement && exemplar) || (anElement && !exemplar)) return false; if (XMLString::equals(anElement->getLocalPart(), exemplar->getLocalPart()) && (anElement->getURI() == exemplar->getURI())) return true; // they're the same! if (!fGrammarResolver || !fStringPool ) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::SubGrpComparator_NGR, anElement->getMemoryManager()); } unsigned int uriId = anElement->getURI(); if (uriId == XMLContentModel::gEOCFakeId || uriId == XMLContentModel::gEpsilonFakeId || uriId == XMLElementDecl::fgPCDataElemId || uriId == XMLElementDecl::fgInvalidElemId) return false; const XMLCh* uri = fStringPool->getValueForId(uriId); const XMLCh* localpart = anElement->getLocalPart(); // In addition to simply trying to find a chain between anElement and exemplar, // we need to make sure that no steps in the chain are blocked. // That is, at every step, we need to make sure that the element // being substituted for will permit being substituted // for, and whether the type of the element will permit derivations in // instance documents of this sort. if (!uri) return false; SchemaGrammar *sGrammar = (SchemaGrammar*) fGrammarResolver->getGrammar(uri); if (!sGrammar || sGrammar->getGrammarType() == Grammar::DTDGrammarType) return false; SchemaElementDecl* anElementDecl = (SchemaElementDecl*) sGrammar->getElemDecl(uriId, localpart, 0, Grammar::TOP_LEVEL_SCOPE); if (!anElementDecl) return false; SchemaElementDecl* pElemDecl = anElementDecl->getSubstitutionGroupElem(); bool foundIt = false; while (pElemDecl) //(substitutionGroupFullName) { if (XMLString::equals(pElemDecl->getBaseName(), exemplar->getLocalPart()) && (pElemDecl->getURI() == exemplar->getURI())) { // time to check for block value on element if((pElemDecl->getBlockSet() & SchemaSymbols::XSD_SUBSTITUTION) != 0) return false; foundIt = true; break; } pElemDecl = pElemDecl->getSubstitutionGroupElem(); }//while if (!foundIt) return false; // this will contain anElement's complexType information. ComplexTypeInfo *aComplexType = anElementDecl->getComplexTypeInfo(); int exemplarBlockSet = pElemDecl->getBlockSet(); if(!aComplexType) { // check on simpleType case DatatypeValidator *anElementDV = anElementDecl->getDatatypeValidator(); DatatypeValidator *exemplarDV = pElemDecl->getDatatypeValidator(); return((anElementDV == 0) || ((anElementDV == exemplarDV) || ((exemplarBlockSet & SchemaSymbols::XSD_RESTRICTION) == 0))); } // 2.3 The set of all {derivation method}s involved in the derivation of D's {type definition} from C's {type definition} does not intersect with the union of the blocking constraint, C's {prohibited substitutions} (if C is complex, otherwise the empty set) and the {prohibited substitutions} (respectively the empty set) of any intermediate {type definition}s in the derivation of D's {type definition} from C's {type definition}. // prepare the combination of {derivation method} and // {disallowed substitution} int devMethod = 0; int blockConstraint = exemplarBlockSet; ComplexTypeInfo *exemplarComplexType = pElemDecl->getComplexTypeInfo(); ComplexTypeInfo *tempType = aComplexType;; while (tempType != 0 && tempType != exemplarComplexType) { devMethod |= tempType->getDerivedBy(); tempType = tempType->getBaseComplexTypeInfo(); if (tempType) { blockConstraint |= tempType->getBlockSet(); } } if (tempType != exemplarComplexType) { return false; } if ((devMethod & blockConstraint) != 0) { return false; } return true; } bool SubstitutionGroupComparator::isAllowedByWildcard(SchemaGrammar* const pGrammar, QName* const element, unsigned int wuri, bool wother) { // whether the uri is allowed directly by the wildcard unsigned int uriId = element->getURI(); // Here we assume that empty string has id 1. // if ((!wother && uriId == wuri) || (wother && uriId != 1 && uriId != wuri && uriId != XMLContentModel::gEOCFakeId && uriId != XMLContentModel::gEpsilonFakeId && uriId != XMLElementDecl::fgPCDataElemId && uriId != XMLElementDecl::fgInvalidElemId)) { return true; } // get all elements that can substitute the current element RefHash2KeysTableOf* theValidSubstitutionGroups = pGrammar->getValidSubstitutionGroups(); if (!theValidSubstitutionGroups) return false; ValueVectorOf* subsElements = theValidSubstitutionGroups->get(element->getLocalPart(), uriId); if (!subsElements) return false; // then check whether there exists one element that is allowed by the wildcard XMLSize_t size = subsElements->size(); for (XMLSize_t i = 0; i < size; i++) { unsigned int subUriId = subsElements->elementAt(i)->getElementName()->getURI(); // Here we assume that empty string has id 1. // if ((!wother && subUriId == wuri) || (wother && subUriId != 1 && subUriId != wuri && subUriId != XMLContentModel::gEOCFakeId && subUriId != XMLContentModel::gEpsilonFakeId && subUriId != XMLElementDecl::fgPCDataElemId && subUriId != XMLElementDecl::fgInvalidElemId)) { return true; } } return false; } XERCES_CPP_NAMESPACE_END /** * End of file SubstitutionGroupComparator.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/ComplexTypeInfo.hpp000644 000765 000024 00000040101 13241160332 025463 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ComplexTypeInfo.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_COMPLEXTYPEINFO_HPP) #define XERCESC_INCLUDE_GUARD_COMPLEXTYPEINFO_HPP /** * The class act as a place holder to store complex type information. * * The class is intended for internal use. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Forward Declarations // --------------------------------------------------------------------------- class DatatypeValidator; class ContentSpecNode; class SchemaAttDefList; class SchemaElementDecl; class XSDLocator; class VALIDATORS_EXPORT ComplexTypeInfo : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Public Constructors/Destructor // ----------------------------------------------------------------------- ComplexTypeInfo(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~ComplexTypeInfo(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- bool getAbstract() const; bool getAdoptContentSpec() const; bool containsAttWithTypeId() const; bool getPreprocessed() const; int getDerivedBy() const; int getBlockSet() const; int getFinalSet() const; unsigned int getScopeDefined() const; unsigned int getElementId() const; int getContentType() const; XMLSize_t elementCount() const; XMLCh* getTypeName() const; DatatypeValidator* getBaseDatatypeValidator() const; DatatypeValidator* getDatatypeValidator() const; ComplexTypeInfo* getBaseComplexTypeInfo() const; ContentSpecNode* getContentSpec() const; const SchemaAttDef* getAttWildCard() const; SchemaAttDef* getAttWildCard(); const SchemaAttDef* getAttDef(const XMLCh* const baseName, const int uriId) const; SchemaAttDef* getAttDef(const XMLCh* const baseName, const int uriId); XMLAttDefList& getAttDefList() const; const SchemaElementDecl* elementAt(const XMLSize_t index) const; SchemaElementDecl* elementAt(const XMLSize_t index); XMLContentModel* getContentModel(const bool checkUPA = false); const XMLCh* getFormattedContentModel () const; XSDLocator* getLocator() const; const XMLCh* getTypeLocalName() const; const XMLCh* getTypeUri() const; /** * returns true if this type is anonymous **/ bool getAnonymous() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setAbstract(const bool isAbstract); void setAdoptContentSpec(const bool toAdopt); void setAttWithTypeId(const bool value); void setPreprocessed(const bool aValue = true); void setDerivedBy(const int derivedBy); void setBlockSet(const int blockSet); void setFinalSet(const int finalSet); void setScopeDefined(const unsigned int scopeDefined); void setElementId(const unsigned int elemId); void setTypeName(const XMLCh* const typeName); void setContentType(const int contentType); void setBaseDatatypeValidator(DatatypeValidator* const baseValidator); void setDatatypeValidator(DatatypeValidator* const validator); void setBaseComplexTypeInfo(ComplexTypeInfo* const typeInfo); void setContentSpec(ContentSpecNode* const toAdopt); void setAttWildCard(SchemaAttDef* const toAdopt); void addAttDef(SchemaAttDef* const toAdd); void addElement(SchemaElementDecl* const toAdd); void setLocator(XSDLocator* const aLocator); /** * sets this type to be anonymous **/ void setAnonymous(); // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- bool hasAttDefs() const; bool contains(const XMLCh* const attName); void checkUniqueParticleAttribution ( SchemaGrammar* const pGrammar , GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool , XMLValidator* const pValidator ) ; /** * Return a singleton that represents 'anyType' * * @param emptyNSId the uri id of the empty namespace */ static ComplexTypeInfo* getAnyType(unsigned int emptyNSId); /** * Notification that lazy data has been deleted */ static void reinitAnyType(); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(ComplexTypeInfo) private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ComplexTypeInfo(const ComplexTypeInfo& elemInfo); ComplexTypeInfo& operator= (const ComplexTypeInfo& other); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void faultInAttDefList() const; bool useRepeatingLeafNodes(ContentSpecNode* particle); XMLContentModel* makeContentModel(bool checkUPA = false); XMLCh* formatContentModel () const ; ContentSpecNode* expandContentModel(ContentSpecNode* const curNode, int minOccurs, int maxOccurs, bool bAllowCompactSyntax); ContentSpecNode* convertContentSpecTree(ContentSpecNode* const curNode, bool checkUPA, bool bAllowCompactSyntax); void resizeContentSpecOrgURI(); // ----------------------------------------------------------------------- // Private data members // ----------------------------------------------------------------------- bool fAnonymous; bool fAbstract; bool fAdoptContentSpec; bool fAttWithTypeId; bool fPreprocessed; int fDerivedBy; int fBlockSet; int fFinalSet; unsigned int fScopeDefined; int fContentType; unsigned int fElementId; unsigned int fUniqueURI; unsigned int fContentSpecOrgURISize; XMLCh* fTypeName; XMLCh* fTypeLocalName; XMLCh* fTypeUri; DatatypeValidator* fBaseDatatypeValidator; DatatypeValidator* fDatatypeValidator; ComplexTypeInfo* fBaseComplexTypeInfo; ContentSpecNode* fContentSpec; SchemaAttDef* fAttWildCard; SchemaAttDefList* fAttList; RefVectorOf* fElements; RefHash2KeysTableOf* fAttDefs; XMLContentModel* fContentModel; XMLCh* fFormattedModel; unsigned int* fContentSpecOrgURI; XSDLocator* fLocator; MemoryManager* fMemoryManager; static ComplexTypeInfo* fAnyType; friend class XMLInitializer; }; // --------------------------------------------------------------------------- // ComplexTypeInfo: Getter methods // --------------------------------------------------------------------------- inline bool ComplexTypeInfo::getAbstract() const { return fAbstract; } inline bool ComplexTypeInfo::getAdoptContentSpec() const { return fAdoptContentSpec; } inline bool ComplexTypeInfo::containsAttWithTypeId() const { return fAttWithTypeId; } inline bool ComplexTypeInfo::getPreprocessed() const { return fPreprocessed; } inline int ComplexTypeInfo::getDerivedBy() const { return fDerivedBy; } inline int ComplexTypeInfo::getBlockSet() const { return fBlockSet; } inline int ComplexTypeInfo::getFinalSet() const { return fFinalSet; } inline unsigned int ComplexTypeInfo::getScopeDefined() const { return fScopeDefined; } inline unsigned int ComplexTypeInfo::getElementId() const { return fElementId; } inline int ComplexTypeInfo::getContentType() const { return fContentType; } inline XMLSize_t ComplexTypeInfo::elementCount() const { if (fElements) { return fElements->size(); } return 0; } inline XMLCh* ComplexTypeInfo::getTypeName() const { return fTypeName; } inline DatatypeValidator* ComplexTypeInfo::getBaseDatatypeValidator() const { return fBaseDatatypeValidator; } inline DatatypeValidator* ComplexTypeInfo::getDatatypeValidator() const { return fDatatypeValidator; } inline ComplexTypeInfo* ComplexTypeInfo::getBaseComplexTypeInfo() const { return fBaseComplexTypeInfo; } inline ContentSpecNode* ComplexTypeInfo::getContentSpec() const { return fContentSpec; } inline const SchemaAttDef* ComplexTypeInfo::getAttWildCard() const { return fAttWildCard; } inline SchemaAttDef* ComplexTypeInfo::getAttWildCard() { return fAttWildCard; } inline const SchemaAttDef* ComplexTypeInfo::getAttDef(const XMLCh* const baseName, const int uriId) const { return fAttDefs->get(baseName, uriId); } inline SchemaAttDef* ComplexTypeInfo::getAttDef(const XMLCh* const baseName, const int uriId) { return fAttDefs->get(baseName, uriId); } inline SchemaElementDecl* ComplexTypeInfo::elementAt(const XMLSize_t index) { if (!fElements) { return 0; // REVISIT - need to throw an exception } return fElements->elementAt(index); } inline const SchemaElementDecl* ComplexTypeInfo::elementAt(const XMLSize_t index) const { if (!fElements) { return 0; // REVISIT - need to throw an exception } return fElements->elementAt(index); } inline XMLContentModel* ComplexTypeInfo::getContentModel(const bool checkUPA) { if (!fContentModel && fContentSpec) fContentModel = makeContentModel(checkUPA); return fContentModel; } inline XSDLocator* ComplexTypeInfo::getLocator() const { return fLocator; } inline bool ComplexTypeInfo::getAnonymous() const { return fAnonymous; } inline const XMLCh* ComplexTypeInfo::getTypeLocalName() const { return fTypeLocalName; } inline const XMLCh* ComplexTypeInfo::getTypeUri() const { return fTypeUri; } // --------------------------------------------------------------------------- // ComplexTypeInfo: Setter methods // --------------------------------------------------------------------------- inline void ComplexTypeInfo::setAbstract(const bool isAbstract) { fAbstract = isAbstract; } inline void ComplexTypeInfo::setAdoptContentSpec(const bool toAdopt) { fAdoptContentSpec = toAdopt; } inline void ComplexTypeInfo::setAttWithTypeId(const bool value) { fAttWithTypeId = value; } inline void ComplexTypeInfo::setPreprocessed(const bool aValue) { fPreprocessed = aValue; } inline void ComplexTypeInfo::setDerivedBy(const int derivedBy) { fDerivedBy = derivedBy; } inline void ComplexTypeInfo::setBlockSet(const int blockSet) { fBlockSet = blockSet; } inline void ComplexTypeInfo::setFinalSet(const int finalSet) { fFinalSet = finalSet; } inline void ComplexTypeInfo::setScopeDefined(const unsigned int scopeDefined) { fScopeDefined = scopeDefined; } inline void ComplexTypeInfo::setElementId(const unsigned int elemId) { fElementId = elemId; } inline void ComplexTypeInfo::setContentType(const int contentType) { fContentType = contentType; } inline void ComplexTypeInfo::setTypeName(const XMLCh* const typeName) { fMemoryManager->deallocate(fTypeName);//delete [] fTypeName; fMemoryManager->deallocate(fTypeLocalName);//delete [] fTypeLocalName; fMemoryManager->deallocate(fTypeUri);//delete [] fTypeUri; if (typeName) { fTypeName = XMLString::replicate(typeName, fMemoryManager); int index = XMLString::indexOf(fTypeName, chComma); XMLSize_t length = XMLString::stringLen(fTypeName); fTypeLocalName = (XMLCh*) fMemoryManager->allocate ( (length - index + 1) * sizeof(XMLCh) ); //new XMLCh[length - index + 1]; XMLString::subString(fTypeLocalName, fTypeName, index + 1, length, fMemoryManager); fTypeUri = (XMLCh*) fMemoryManager->allocate ( (index + 1) * sizeof(XMLCh) ); //new XMLCh[index + 1]; XMLString::subString(fTypeUri, fTypeName, 0, index, fMemoryManager); } else { fTypeName = fTypeLocalName = fTypeUri = 0; } } inline void ComplexTypeInfo::setBaseDatatypeValidator(DatatypeValidator* const validator) { fBaseDatatypeValidator = validator; } inline void ComplexTypeInfo::setDatatypeValidator(DatatypeValidator* const validator) { fDatatypeValidator = validator; } inline void ComplexTypeInfo::setBaseComplexTypeInfo(ComplexTypeInfo* const typeInfo) { fBaseComplexTypeInfo = typeInfo; } inline void ComplexTypeInfo::addElement(SchemaElementDecl* const elem) { if (!fElements) { fElements = new (fMemoryManager) RefVectorOf(8, false, fMemoryManager); } else if (fElements->containsElement(elem)) { return; } fElements->addElement(elem); } inline void ComplexTypeInfo::setAttWildCard(SchemaAttDef* const toAdopt) { if (fAttWildCard) { delete fAttWildCard; } fAttWildCard = toAdopt; } inline void ComplexTypeInfo::setAnonymous() { fAnonymous = true; } // --------------------------------------------------------------------------- // ComplexTypeInfo: Helper methods // --------------------------------------------------------------------------- inline bool ComplexTypeInfo::hasAttDefs() const { return !fAttDefs->isEmpty(); } inline bool ComplexTypeInfo::contains(const XMLCh* const attName) { RefHash2KeysTableOfEnumerator enumDefs(fAttDefs, false, fMemoryManager); while (enumDefs.hasMoreElements()) { if (XMLString::equals(attName, enumDefs.nextElement().getAttName()->getLocalPart())) { return true; } } return false; } XERCES_CPP_NAMESPACE_END #endif /** * End of file ComplexTypeInfo.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/XercesAttGroupInfo.cpp000644 000765 000024 00000011440 13241160332 026130 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XercesAttGroupInfo.cpp 676911 2008-07-15 13:27:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XercesAttGroupInfo: Constructors and Destructor // --------------------------------------------------------------------------- XercesAttGroupInfo::XercesAttGroupInfo(MemoryManager* const manager) : fTypeWithId(false) , fNameId(0) , fNamespaceId(0) , fAttributes(0) , fAnyAttributes(0) , fCompleteWildCard(0) , fMemoryManager(manager) { } XercesAttGroupInfo::XercesAttGroupInfo(unsigned int attGroupNameId, unsigned int attGroupNamespaceId, MemoryManager* const manager) : fTypeWithId(false) , fNameId(attGroupNameId) , fNamespaceId(attGroupNamespaceId) , fAttributes(0) , fAnyAttributes(0) , fCompleteWildCard(0) , fMemoryManager(manager) { } XercesAttGroupInfo::~XercesAttGroupInfo() { delete fAttributes; delete fAnyAttributes; delete fCompleteWildCard; } bool XercesAttGroupInfo::containsAttribute(const XMLCh* const name, const unsigned int uri) { if (fAttributes) { XMLSize_t attCount = fAttributes->size(); if (attCount) { for (XMLSize_t i=0; i < attCount; i++) { QName* attName = fAttributes->elementAt(i)->getAttName(); if (attName->getURI() == uri && XMLString::equals(attName->getLocalPart(),name)) { return true; } } } } return false; } // --------------------------------------------------------------------------- // XercesAttGroupInfo: Getter methods // --------------------------------------------------------------------------- const SchemaAttDef* XercesAttGroupInfo::getAttDef(const XMLCh* const baseName, const int uriId) const { // If no list, then return a null if (!fAttributes) return 0; XMLSize_t attSize = fAttributes->size(); for (XMLSize_t i=0; ielementAt(i); QName* attName = attDef->getAttName(); if (uriId == (int) attName->getURI() && XMLString::equals(baseName, attName->getLocalPart())) { return attDef; } } return 0; } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(XercesAttGroupInfo) void XercesAttGroupInfo::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng<* fAttributes; * ***/ XTemplateSerializer::storeObject(fAttributes, serEng); /*** * * Serialize RefVectorOf* fAnyAttributes; * ***/ XTemplateSerializer::storeObject(fAnyAttributes, serEng); serEng<>fTypeWithId; serEng>>fNameId; serEng>>fNamespaceId; /*** * * Deserialize RefVectorOf* fAttributes; * ***/ XTemplateSerializer::loadObject(&fAttributes, 4, true, serEng); /*** * * Deserialize RefVectorOf* fAnyAttributes; * ***/ XTemplateSerializer::loadObject(&fAnyAttributes, 2, true, serEng); serEng>>fCompleteWildCard; } } XERCES_CPP_NAMESPACE_END /** * End of file XercesAttGroupInfo.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/GeneralAttributeCheck.cpp000644 000765 000024 00000102117 13241160332 026576 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local const data // --------------------------------------------------------------------------- static const XMLCh fgValueZero[] = { chDigit_0, chNull }; static const XMLCh fgValueOne[] = { chDigit_1, chNull }; static const XMLCh fgUnbounded[] = { chLatin_u, chLatin_n, chLatin_b, chLatin_o, chLatin_u, chLatin_n, chLatin_d, chLatin_e, chLatin_d, chNull }; // --------------------------------------------------------------------------- // Static member data initialization // --------------------------------------------------------------------------- ValueHashTableOf* GeneralAttributeCheck::fAttMap = 0; ValueHashTableOf* GeneralAttributeCheck::fFacetsMap = 0; DatatypeValidator* GeneralAttributeCheck::fNonNegIntDV = 0; DatatypeValidator* GeneralAttributeCheck::fBooleanDV = 0; DatatypeValidator* GeneralAttributeCheck::fAnyURIDV = 0; void XMLInitializer::initializeGeneralAttributeCheck() { GeneralAttributeCheck::initialize (); } void XMLInitializer::terminateGeneralAttributeCheck() { delete GeneralAttributeCheck::fFacetsMap; delete GeneralAttributeCheck::fAttMap; GeneralAttributeCheck::fAttMap = 0; GeneralAttributeCheck::fFacetsMap = 0; GeneralAttributeCheck::fNonNegIntDV = 0; GeneralAttributeCheck::fBooleanDV = 0; GeneralAttributeCheck::fAnyURIDV = 0; } void GeneralAttributeCheck::initialize() { // Set up validators. // DatatypeValidatorFactory dvFactory; fNonNegIntDV = dvFactory.getDatatypeValidator(SchemaSymbols::fgDT_NONNEGATIVEINTEGER); fBooleanDV = dvFactory.getDatatypeValidator(SchemaSymbols::fgDT_BOOLEAN); fAnyURIDV = dvFactory.getDatatypeValidator(SchemaSymbols::fgDT_ANYURI); // TODO - add remaining valdiators // Map attributes. // fAttMap = new ValueHashTableOf(A_Count); fAttMap->put((void*)SchemaSymbols::fgATT_ABSTRACT, A_Abstract); fAttMap->put((void*)SchemaSymbols::fgATT_ATTRIBUTEFORMDEFAULT, A_AttributeFormDefault); fAttMap->put((void*)SchemaSymbols::fgATT_BASE, A_Base); fAttMap->put((void*)SchemaSymbols::fgATT_BLOCK, A_Block); fAttMap->put((void*)SchemaSymbols::fgATT_BLOCKDEFAULT, A_BlockDefault); fAttMap->put((void*)SchemaSymbols::fgATT_DEFAULT, A_Default); fAttMap->put((void*)SchemaSymbols::fgATT_ELEMENTFORMDEFAULT, A_ElementFormDefault); fAttMap->put((void*)SchemaSymbols::fgATT_FINAL, A_Final); fAttMap->put((void*)SchemaSymbols::fgATT_FINALDEFAULT, A_FinalDefault); fAttMap->put((void*)SchemaSymbols::fgATT_FIXED, A_Fixed); fAttMap->put((void*)SchemaSymbols::fgATT_FORM, A_Form); fAttMap->put((void*)SchemaSymbols::fgATT_ID, A_ID); fAttMap->put((void*)SchemaSymbols::fgATT_ITEMTYPE, A_ItemType); fAttMap->put((void*)SchemaSymbols::fgATT_MAXOCCURS, A_MaxOccurs); fAttMap->put((void*)SchemaSymbols::fgATT_MEMBERTYPES, A_MemberTypes); fAttMap->put((void*)SchemaSymbols::fgATT_MINOCCURS, A_MinOccurs); fAttMap->put((void*)SchemaSymbols::fgATT_MIXED, A_Mixed); fAttMap->put((void*)SchemaSymbols::fgATT_NAME, A_Name); fAttMap->put((void*)SchemaSymbols::fgATT_NAMESPACE, A_Namespace); fAttMap->put((void*)SchemaSymbols::fgATT_NILLABLE, A_Nillable); fAttMap->put((void*)SchemaSymbols::fgATT_PROCESSCONTENTS, A_ProcessContents); fAttMap->put((void*)SchemaSymbols::fgATT_PUBLIC, A_Public); fAttMap->put((void*)SchemaSymbols::fgATT_REF, A_Ref); fAttMap->put((void*)SchemaSymbols::fgATT_REFER, A_Refer); fAttMap->put((void*)SchemaSymbols::fgATT_SCHEMALOCATION, A_SchemaLocation); fAttMap->put((void*)SchemaSymbols::fgATT_SOURCE, A_Source); fAttMap->put((void*)SchemaSymbols::fgATT_SUBSTITUTIONGROUP, A_SubstitutionGroup); fAttMap->put((void*)SchemaSymbols::fgATT_SYSTEM, A_System); fAttMap->put((void*)SchemaSymbols::fgATT_TARGETNAMESPACE, A_TargetNamespace); fAttMap->put((void*)SchemaSymbols::fgATT_TYPE, A_Type); fAttMap->put((void*)SchemaSymbols::fgATT_USE, A_Use); fAttMap->put((void*)SchemaSymbols::fgATT_VALUE, A_Value); fAttMap->put((void*)SchemaSymbols::fgATT_VERSION, A_Version); fAttMap->put((void*)SchemaSymbols::fgATT_XPATH, A_XPath); fFacetsMap = new ValueHashTableOf(13); fFacetsMap->put((void*) SchemaSymbols::fgELT_MINEXCLUSIVE, E_MinExclusive); fFacetsMap->put((void*) SchemaSymbols::fgELT_MININCLUSIVE, E_MinInclusive); fFacetsMap->put((void*) SchemaSymbols::fgELT_MAXEXCLUSIVE, E_MaxExclusive); fFacetsMap->put((void*) SchemaSymbols::fgELT_MAXINCLUSIVE, E_MaxInclusive); fFacetsMap->put((void*) SchemaSymbols::fgELT_TOTALDIGITS, E_TotalDigits); fFacetsMap->put((void*) SchemaSymbols::fgELT_FRACTIONDIGITS, E_FractionDigits); fFacetsMap->put((void*) SchemaSymbols::fgELT_LENGTH, E_Length); fFacetsMap->put((void*) SchemaSymbols::fgELT_MINLENGTH, E_MinLength); fFacetsMap->put((void*) SchemaSymbols::fgELT_MAXLENGTH, E_MaxLength); fFacetsMap->put((void*) SchemaSymbols::fgELT_ENUMERATION, E_Enumeration); fFacetsMap->put((void*) SchemaSymbols::fgELT_WHITESPACE, E_WhiteSpace); fFacetsMap->put((void*) SchemaSymbols::fgELT_PATTERN, E_Pattern); } // --------------------------------------------------------------------------- // GeneralAttributeCheck: Constructors and Destructor // --------------------------------------------------------------------------- GeneralAttributeCheck::GeneralAttributeCheck(MemoryManager* const manager) : fMemoryManager(manager) , fIDValidator(manager) { } GeneralAttributeCheck::~GeneralAttributeCheck() { } // --------------------------------------------------------------------------- // GeneralAttributeCheck: Validation methods // --------------------------------------------------------------------------- void GeneralAttributeCheck::checkAttributes(const DOMElement* const elem, const unsigned short elemContext, TraverseSchema* const schema, const bool isTopLevel, ValueVectorOf* const nonXSAttList) { if (nonXSAttList) nonXSAttList->removeAllElements(); if (elem == 0 || !fAttMap || elemContext>=E_Count) return; const XMLCh* elemName = elem->getLocalName(); if (!XMLString::equals(SchemaSymbols::fgURI_SCHEMAFORSCHEMA, elem->getNamespaceURI())) { schema->reportSchemaError ( elem , XMLUni::fgXMLErrDomain , XMLErrs::ELTSchemaNS , elemName ); } DOMNamedNodeMap* eltAttrs = elem->getAttributes(); const XMLSize_t attrCount = eltAttrs->getLength(); XMLByte attList[A_Count]; memset(attList, 0, sizeof(attList)); for (XMLSize_t i = 0; i < attrCount; i++) { DOMNode* attribute = eltAttrs->item(i); const XMLCh* attName = attribute->getNodeName(); // skip namespace declarations if (XMLString::equals(attName, XMLUni::fgXMLNSString) || XMLString::startsWith(attName, XMLUni::fgXMLNSColonString)) continue; // Bypass attributes that start with xml // add this to the list of "non-schema" attributes if ((*attName == chLatin_X || *attName == chLatin_x) && (*(attName+1) == chLatin_M || *(attName+1) == chLatin_m) && (*(attName+2) == chLatin_L || *(attName+2) == chLatin_l)) { if (nonXSAttList) nonXSAttList->addElement(attribute); continue; } // for attributes with namespace prefix const XMLCh* attrURI = attribute->getNamespaceURI(); if (attrURI != 0 && *attrURI) { // attributes with schema namespace are not allowed // and not allowed on "documentation" and "appInfo" if (XMLString::equals(attrURI, SchemaSymbols::fgURI_SCHEMAFORSCHEMA) || XMLString::equals(elemName, SchemaSymbols::fgELT_APPINFO) || XMLString::equals(elemName, SchemaSymbols::fgELT_DOCUMENTATION)) { schema->reportSchemaError(elem, XMLUni::fgXMLErrDomain, isTopLevel?XMLErrs::AttributeDisallowedGlobal:XMLErrs::AttributeDisallowedLocal, attName, elemName); } else if (nonXSAttList) { nonXSAttList->addElement(attribute); } continue; } int attNameId = A_Invalid; attName = attribute->getLocalName(); bool bContinue=false; // workaround for Borland bug with 'continue' in 'catch' try { attNameId= fAttMap->get(attName, fMemoryManager); } catch(const OutOfMemoryException&) { throw; } catch(...) { schema->reportSchemaError(elem, XMLUni::fgXMLErrDomain, isTopLevel?XMLErrs::AttributeDisallowedGlobal:XMLErrs::AttributeDisallowedLocal, attName, elemName); bContinue=true; } if(bContinue) continue; if (fgElemAttTable[elemContext][attNameId] & Att_Mask) { attList[attNameId] = 1; validate ( elem , attName , attribute->getNodeValue() , fgElemAttTable[elemContext][attNameId] & DV_Mask , schema ); } else { schema->reportSchemaError(elem, XMLUni::fgXMLErrDomain, isTopLevel?XMLErrs::AttributeDisallowedGlobal:XMLErrs::AttributeDisallowedLocal, attName, elemName); } } // ------------------------------------------------------------------ // Check for required attributes // ------------------------------------------------------------------ for (unsigned int j=0; j < A_Count; j++) { if ((fgElemAttTable[elemContext][j] & Att_Required) && attList[j] == 0) { schema->reportSchemaError(elem, XMLUni::fgXMLErrDomain, isTopLevel?XMLErrs::AttributeRequiredGlobal:XMLErrs::AttributeRequiredLocal, fAttNames[j], elemName); } } } void GeneralAttributeCheck::validate(const DOMElement* const elem, const XMLCh* const attName, const XMLCh* const attValue, const short dvIndex, TraverseSchema* const schema) { bool isInvalid = false; DatatypeValidator* dv = 0; ValidationContext* fValidationContext = schema->fSchemaInfo->getValidationContext(); switch (dvIndex) { case DV_Form: if (!XMLString::equals(attValue, SchemaSymbols::fgATTVAL_QUALIFIED) && !XMLString::equals(attValue, SchemaSymbols::fgATTVAL_UNQUALIFIED)) { isInvalid = true; } break; case DV_MaxOccurs: // maxOccurs = (nonNegativeInteger | unbounded) if (!XMLString::equals(attValue, fgUnbounded)) { dv = fNonNegIntDV; } break; case DV_MaxOccurs1: if (!XMLString::equals(attValue, fgValueOne)) { isInvalid = true; } break; case DV_MinOccurs1: if (!XMLString::equals(attValue, fgValueZero) && !XMLString::equals(attValue, fgValueOne)) { isInvalid = true; } break; case DV_ProcessContents: if (!XMLString::equals(attValue, SchemaSymbols::fgATTVAL_SKIP) && !XMLString::equals(attValue, SchemaSymbols::fgATTVAL_LAX) && !XMLString::equals(attValue, SchemaSymbols::fgATTVAL_STRICT)) { isInvalid = true; } break; case DV_Use: if (!XMLString::equals(attValue, SchemaSymbols::fgATTVAL_OPTIONAL) && !XMLString::equals(attValue, SchemaSymbols::fgATTVAL_PROHIBITED) && !XMLString::equals(attValue, SchemaSymbols::fgATTVAL_REQUIRED)) { isInvalid = true; } break; case DV_WhiteSpace: if (!XMLString::equals(attValue, SchemaSymbols::fgWS_PRESERVE) && !XMLString::equals(attValue, SchemaSymbols::fgWS_REPLACE) && !XMLString::equals(attValue, SchemaSymbols::fgWS_COLLAPSE)) { isInvalid = true; } break; case DV_Boolean: dv = fBooleanDV; break; case DV_NonNegInt: dv = fNonNegIntDV; break; case DV_AnyURI: dv = fAnyURIDV; break; case DV_ID: if (fValidationContext) { dv = &fIDValidator; } break; } if (dv) { try { dv->validate(attValue, fValidationContext, fMemoryManager); } catch(const XMLException& excep) { schema->reportSchemaError(elem, excep); } catch(const OutOfMemoryException&) { throw; } catch(...) { isInvalid = true; } } if (isInvalid) { schema->reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidAttValue, attValue, attName); } } // --------------------------------------------------------------------------- // Conditional methods for building the table // --------------------------------------------------------------------------- // // This code will set up the character flags table. Its defined out since // this table is now written out and hard coded (at the bottom of this // file) into the code itself. This code is retained in case there is // any need to recreate it later. // #if defined(NEED_TO_GEN_ELEM_ATT_MAP_TABLE) #include void GeneralAttributeCheck::initCharFlagTable() { unsigned short attList[E_Count][A_Count]; for (unsigned int i=0; i < E_Count; i++) { for (unsigned int j=0; j < A_Count; j++) { attList[i][j] = 0; } } // // Write it out to a temp file to be read back into this source later. // FILE* outFl = fopen("ea_table.out", "wt+"); fprintf(outFl, "unsigned short GeneralAttributeCheck::fgElemAttTable[GeneralAttributeCheck::E_Count][GeneralAttributeCheck::A_Count] =\n{\n {"); //"all" attList[E_All][A_ID] = Att_Optional | DV_ID; attList[E_All][A_MaxOccurs] = Att_Optional | DV_MaxOccurs1; attList[E_All][A_MinOccurs] = Att_Optional | DV_MinOccurs1; // "annotation" attList[E_Annotation][A_ID] = Att_Optional | DV_ID; // "any" attList[E_Any][A_ID] = Att_Optional | DV_ID; attList[E_Any][A_MaxOccurs] = Att_Optional | DV_MaxOccurs; attList[E_Any][A_MinOccurs] = Att_Optional | DV_NonNegInt; attList[E_Any][A_Namespace] = Att_Optional; attList[E_Any][A_ProcessContents] = Att_Optional | DV_ProcessContents; // "anyAttribute" attList[E_AnyAttribute][A_ID] = Att_Optional | DV_ID; attList[E_AnyAttribute][A_Namespace] = Att_Optional; attList[E_AnyAttribute][A_ProcessContents] = Att_Optional | DV_ProcessContents; // "appinfo" attList[E_Appinfo][A_Source]= Att_Optional | DV_AnyURI; // attribute - global" attList[E_AttributeGlobal][A_Default] = Att_Optional; attList[E_AttributeGlobal][A_Fixed] = Att_Optional; attList[E_AttributeGlobal][A_ID] = Att_Optional | DV_ID; attList[E_AttributeGlobal][A_Name] = Att_Required; attList[E_AttributeGlobal][A_Type] = Att_Optional; // "attribute - local" attList[E_AttributeLocal][A_Default] = Att_Optional; attList[E_AttributeLocal][A_Fixed] = Att_Optional; attList[E_AttributeLocal][A_Form]= Att_Optional | DV_Form; attList[E_AttributeLocal][A_ID] = Att_Optional | DV_ID; attList[E_AttributeLocal][A_Name] = Att_Required; attList[E_AttributeLocal][A_Type] = Att_Optional; attList[E_AttributeLocal][A_Use] = Att_Optional | DV_Use; // "attribute - ref" attList[E_AttributeRef][A_Default] = Att_Optional; attList[E_AttributeRef][A_Fixed] = Att_Optional; attList[E_AttributeRef][A_ID] = Att_Optional | DV_ID; attList[E_AttributeRef][A_Ref]= Att_Required; attList[E_AttributeRef][A_Use] = Att_Optional | DV_Use; // "attributeGroup - global" attList[E_AttributeGroupGlobal][A_ID] = Att_Optional | DV_ID; attList[E_AttributeGroupGlobal][A_Name] = Att_Required; // "attributeGroup - ref" attList[E_AttributeGroupRef][A_ID] = Att_Optional | DV_ID; attList[E_AttributeGroupRef][A_Ref]= Att_Required; // "choice" attList[E_Choice][A_ID] = Att_Optional | DV_ID; attList[E_Choice][A_MaxOccurs] = Att_Optional | DV_MaxOccurs; attList[E_Choice][A_MinOccurs] = Att_Optional | DV_NonNegInt; // "complexContent" attList[E_ComplexContent][A_ID] = Att_Optional | DV_ID; attList[E_ComplexContent][A_Mixed] = Att_Optional | DV_Boolean; // "complexType - global" attList[E_ComplexTypeGlobal][A_Abstract] = Att_Optional | DV_Boolean; attList[E_ComplexTypeGlobal][A_Block] = Att_Optional; attList[E_ComplexTypeGlobal][A_Final] = Att_Optional; attList[E_ComplexTypeGlobal][A_ID] = Att_Optional | DV_ID; attList[E_ComplexTypeGlobal][A_Mixed] = Att_Optional | DV_Boolean; attList[E_ComplexTypeGlobal][A_Name] = Att_Required; // "complexType - local" attList[E_ComplexTypeLocal][A_ID] = Att_Optional | DV_ID; attList[E_ComplexTypeLocal][A_Mixed] = Att_Optional | DV_Boolean; // "documentation" attList[E_Documentation][A_Source] = Att_Optional | DV_AnyURI; // "element - global" attList[E_ElementGlobal][A_Abstract] = Att_Optional | DV_Boolean; attList[E_ElementGlobal][A_Block] = Att_Optional; attList[E_ElementGlobal][A_Default] = Att_Optional; attList[E_ElementGlobal][A_Final] = Att_Optional; attList[E_ElementGlobal][A_Fixed] = Att_Optional; attList[E_ElementGlobal][A_ID] = Att_Optional | DV_ID; attList[E_ElementGlobal][A_Name] = Att_Required; attList[E_ElementGlobal][A_Nillable] = Att_Optional | DV_Boolean; attList[E_ElementGlobal][A_SubstitutionGroup] = Att_Optional; attList[E_ElementGlobal][A_Type] = Att_Optional; // "element - local" attList[E_ElementLocal][A_Block]= Att_Optional; attList[E_ElementLocal][A_Default] = Att_Optional; attList[E_ElementLocal][A_Fixed] = Att_Optional; attList[E_ElementLocal][A_Form] = Att_Optional | DV_Form; attList[E_ElementLocal][A_ID] = Att_Optional | DV_ID; attList[E_ElementLocal][A_MaxOccurs] = Att_Optional | DV_MaxOccurs; attList[E_ElementLocal][A_MinOccurs] = Att_Optional | DV_NonNegInt; attList[E_ElementLocal][A_Name] = Att_Required; attList[E_ElementLocal][A_Nillable] = Att_Optional | DV_Boolean; attList[E_ElementLocal][A_Type] = Att_Optional; //"element - ref" attList[E_ElementRef][A_ID] = Att_Optional | DV_ID; attList[E_ElementRef][A_MaxOccurs] = Att_Optional | DV_MaxOccurs; attList[E_ElementRef][A_MinOccurs] = Att_Optional | DV_NonNegInt; attList[E_ElementRef][A_Ref] = Att_Required; // "enumeration" attList[E_Enumeration][A_ID] = Att_Optional | DV_ID; attList[E_Enumeration][A_Value] = Att_Optional; // "extension" attList[E_Extension][A_Base] = Att_Required; attList[E_Extension][A_ID] = Att_Optional | DV_ID; //"field" attList[E_Field][A_ID] = Att_Optional | DV_ID; attList[E_Field][A_XPath] = Att_Required; // "fractionDigits" attList[E_FractionDigits][A_ID] = Att_Optional | DV_ID; attList[E_FractionDigits][A_Value] = Att_Optional | DV_NonNegInt; attList[E_FractionDigits][A_Fixed] = Att_Optional | DV_Boolean; // "group - global" attList[E_GroupGlobal][A_ID] = Att_Optional | DV_ID; attList[E_GroupGlobal][A_Name] = Att_Required; // "group - ref" attList[E_GroupRef][A_ID] = Att_Optional | DV_ID; attList[E_GroupRef][A_MaxOccurs] = Att_Optional | DV_MaxOccurs; attList[E_GroupRef][A_MinOccurs] = Att_Optional | DV_NonNegInt; attList[E_GroupRef][A_Ref] = Att_Required; // "import" attList[E_Import][A_ID] = Att_Optional | DV_ID; attList[E_Import][A_Namespace] = Att_Optional; attList[E_Import][A_SchemaLocation] = Att_Optional; // "include" attList[E_Include][A_ID] = Att_Optional | DV_ID; attList[E_Include][A_SchemaLocation] = Att_Required; // "key" attList[E_Key][A_ID] = Att_Optional | DV_ID; attList[E_Key][A_Name] = Att_Required; // "keyref" attList[E_KeyRef][A_ID] = Att_Optional | DV_ID; attList[E_KeyRef][A_Name] = Att_Required; attList[E_KeyRef][A_Refer] = Att_Required; // "length" attList[E_Length][A_ID] = Att_Optional | DV_ID; attList[E_Length][A_Value] = Att_Optional | DV_NonNegInt; attList[E_Length][A_Fixed] = Att_Optional | DV_Boolean; // "list" attList[E_List][A_ID] = Att_Optional | DV_ID; attList[E_List][A_ItemType] = Att_Optional; // "maxExclusive" attList[E_MaxExclusive][A_ID] = Att_Optional | DV_ID; attList[E_MaxExclusive][A_Value] = Att_Optional; attList[E_MaxExclusive][A_Fixed] = Att_Optional | DV_Boolean; // "maxInclusive" attList[E_MaxInclusive][A_ID] = Att_Optional | DV_ID; attList[E_MaxInclusive][A_Value] = Att_Optional; attList[E_MaxInclusive][A_Fixed] = Att_Optional | DV_Boolean; // "maxLength" attList[E_MaxLength][A_ID] = Att_Optional | DV_ID; attList[E_MaxLength][A_Value] = Att_Optional | DV_NonNegInt; attList[E_MaxLength][A_Fixed] = Att_Optional | DV_Boolean; // "minExclusive" attList[E_MinExclusive][A_ID] = Att_Optional | DV_ID; attList[E_MinExclusive][A_Value] = Att_Optional; attList[E_MinExclusive][A_Fixed] = Att_Optional | DV_Boolean; // "minInclusive" attList[E_MinInclusive][A_ID] = Att_Optional | DV_ID; attList[E_MinInclusive][A_Value] = Att_Optional; attList[E_MinInclusive][A_Fixed] = Att_Optional | DV_Boolean; // "minLength" attList[E_MinLength][A_ID] = Att_Optional | DV_ID; attList[E_MinLength][A_Value] = Att_Optional | DV_NonNegInt; attList[E_MinLength][A_Fixed] = Att_Optional | DV_Boolean; // "notation" attList[E_Notation][A_ID] = Att_Optional | DV_ID; attList[E_Notation][A_Name] = Att_Required; attList[E_Notation][A_Public] = Att_Optional; attList[E_Notation][A_System] = Att_Optional | DV_AnyURI; // "pattern" attList[E_Pattern][A_ID] = Att_Optional; attList[E_Pattern][A_Value] = Att_Optional; // "redefine" attList[E_Redefine][A_ID] = Att_Optional | DV_ID; attList[E_Redefine][A_SchemaLocation] = Att_Required; // "restriction" attList[E_Restriction][A_Base] = Att_Optional; attList[E_Restriction][A_ID] = Att_Optional | DV_ID; // "schema" attList[E_Schema][A_AttributeFormDefault] = Att_Optional | DV_Form; attList[E_Schema][A_BlockDefault] = Att_Optional; attList[E_Schema][A_ElementFormDefault] = Att_Optional | DV_Form; attList[E_Schema][A_FinalDefault] = Att_Optional; attList[E_Schema][A_ID] = Att_Optional | DV_ID; attList[E_Schema][A_TargetNamespace] = Att_Optional; attList[E_Schema][A_Version] = Att_Optional; // "selector" attList[E_Selector][A_ID] = Att_Optional | DV_ID; attList[E_Selector][A_XPath] = Att_Required; // "sequence" attList[E_Sequence][A_ID] = Att_Optional | DV_ID; attList[E_Sequence][A_MaxOccurs] = Att_Optional | DV_MaxOccurs; attList[E_Sequence][A_MinOccurs] = Att_Optional | DV_NonNegInt; // "simpleContent" attList[E_SimpleContent][A_ID] = Att_Optional | DV_ID; // "simpleType - global" attList[E_SimpleTypeGlobal][A_Final] = Att_Optional; attList[E_SimpleTypeGlobal][A_ID] = Att_Optional | DV_ID; attList[E_SimpleTypeGlobal][A_Name] = Att_Required; // "simpleType - local" attList[E_SimpleTypeLocal][A_Final] = Att_Optional; attList[E_SimpleTypeLocal][A_ID] = Att_Optional | DV_ID; // "totalDigits" attList[E_TotalDigits][A_ID] = Att_Optional | DV_ID; attList[E_TotalDigits][A_Value] = Att_Optional | DV_NonNegInt; attList[E_TotalDigits][A_Fixed] = Att_Optional | DV_Boolean; // "union" attList[E_Union][A_ID] = Att_Optional | DV_ID; attList[E_Union][A_MemberTypes] = Att_Optional; // "unique" attList[E_Unique][A_ID] = Att_Optional | DV_ID; attList[E_Unique][A_Name] = Att_Required; // "whitespace" attList[E_WhiteSpace][A_ID] = Att_Optional | DV_ID; attList[E_WhiteSpace][A_Value] = Att_Optional | DV_WhiteSpace; attList[E_WhiteSpace][A_Fixed] = Att_Optional | DV_Boolean; for (unsigned int j=0; j < E_Count; j++) { for (unsigned int index = 0; index < A_Count-1; index++) { fprintf(outFl, " %d,", attList[j][index]); } fprintf(outFl, " %d", attList[j][A_Count - 1]); if (j + 1 == E_Count) fprintf(outFl, "}\n};"); else fprintf(outFl, "},\n {"); } fclose(outFl); } #endif unsigned short GeneralAttributeCheck::fgElemAttTable[GeneralAttributeCheck::E_Count][GeneralAttributeCheck::A_Count] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 258, 0, 514, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 130, 0, 10, 0, 0, 2, 0, 1026, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 2, 0, 1026, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 34, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 66, 34, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2050, 0, 0, 0}, { 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2050, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 130, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 18, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 34, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0}, { 18, 0, 0, 2, 0, 2, 0, 2, 0, 2, 0, 34, 0, 0, 0, 0, 0, 1, 0, 18, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0}, { 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 66, 34, 0, 130, 0, 10, 0, 1, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 130, 0, 10, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 130, 0, 10, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 66, 0, 0, 2, 0, 66, 0, 2, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 130, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 34, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4098, 0, 0} }; const XMLCh* GeneralAttributeCheck::fAttNames[GeneralAttributeCheck::A_Count] = { SchemaSymbols::fgATT_ABSTRACT, SchemaSymbols::fgATT_ATTRIBUTEFORMDEFAULT, SchemaSymbols::fgATT_BASE, SchemaSymbols::fgATT_BLOCK, SchemaSymbols::fgATT_BLOCKDEFAULT, SchemaSymbols::fgATT_DEFAULT, SchemaSymbols::fgATT_ELEMENTFORMDEFAULT, SchemaSymbols::fgATT_FINAL, SchemaSymbols::fgATT_FINALDEFAULT, SchemaSymbols::fgATT_FIXED, SchemaSymbols::fgATT_FORM, SchemaSymbols::fgATT_ID, SchemaSymbols::fgATT_ITEMTYPE, SchemaSymbols::fgATT_MAXOCCURS, SchemaSymbols::fgATT_MEMBERTYPES, SchemaSymbols::fgATT_MINOCCURS, SchemaSymbols::fgATT_MIXED, SchemaSymbols::fgATT_NAME, SchemaSymbols::fgATT_NAMESPACE, SchemaSymbols::fgATT_NILLABLE, SchemaSymbols::fgATT_PROCESSCONTENTS, SchemaSymbols::fgATT_PUBLIC, SchemaSymbols::fgATT_REF, SchemaSymbols::fgATT_REFER, SchemaSymbols::fgATT_SCHEMALOCATION, SchemaSymbols::fgATT_SOURCE, SchemaSymbols::fgATT_SUBSTITUTIONGROUP, SchemaSymbols::fgATT_SYSTEM, SchemaSymbols::fgATT_TARGETNAMESPACE, SchemaSymbols::fgATT_TYPE, SchemaSymbols::fgATT_USE, SchemaSymbols::fgATT_VALUE, SchemaSymbols::fgATT_VERSION, SchemaSymbols::fgATT_XPATH, }; XERCES_CPP_NAMESPACE_END /** * End of file GeneralAttributeCheck.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/SchemaGrammar.hpp000644 000765 000024 00000050215 13241160332 025114 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SchemaGrammar.hpp 924841 2010-03-18 14:57:13Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_SCHEMAGRAMMAR_HPP) #define XERCESC_INCLUDE_GUARD_SCHEMAGRAMMAR_HPP #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // // This class stores the Schema information // NOTE: Schemas are not namespace aware, so we just use regular NameIdPool // data structures to store element and attribute decls. They are all set // to be in the global namespace and the full QName is used as the base name // of the decl. This means that all the URI parameters below are expected // to be null pointers (and anything else will cause an exception.) // // --------------------------------------------------------------------------- // Forward Declarations // --------------------------------------------------------------------------- class ComplexTypeInfo; class XercesGroupInfo; class XercesAttGroupInfo; class XSAnnotation; // --------------------------------------------------------------------------- // typedef declaration // --------------------------------------------------------------------------- typedef ValueVectorOf ElemVector; class VALIDATORS_EXPORT SchemaGrammar : public Grammar { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- SchemaGrammar(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); virtual ~SchemaGrammar(); // ----------------------------------------------------------------------- // Implementation of Virtual Interface // ----------------------------------------------------------------------- virtual Grammar::GrammarType getGrammarType() const; virtual const XMLCh* getTargetNamespace() const; // this method should only be used while the grammar is being // constructed, not while it is being used // in a validation episode! virtual XMLElementDecl* findOrAddElemDecl ( const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const prefixName , const XMLCh* const qName , unsigned int scope , bool& wasAdded ) ; virtual XMLSize_t getElemId ( const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const qName , unsigned int scope ) const ; virtual const XMLElementDecl* getElemDecl ( const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const qName , unsigned int scope ) const ; virtual XMLElementDecl* getElemDecl ( const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const qName , unsigned int scope ); virtual const XMLElementDecl* getElemDecl ( const unsigned int elemId ) const; virtual XMLElementDecl* getElemDecl ( const unsigned int elemId ); virtual const XMLNotationDecl* getNotationDecl ( const XMLCh* const notName ) const; virtual XMLNotationDecl* getNotationDecl ( const XMLCh* const notName ); virtual bool getValidated() const; virtual XMLElementDecl* putElemDecl ( const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const prefixName , const XMLCh* const qName , unsigned int scope , const bool notDeclared = false ); virtual XMLSize_t putElemDecl ( XMLElementDecl* const elemDecl , const bool notDeclared = false ) ; virtual XMLSize_t putNotationDecl ( XMLNotationDecl* const notationDecl ) const; virtual void setValidated(const bool newState); virtual void reset(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- RefHash3KeysIdPoolEnumerator getElemEnumerator() const; NameIdPoolEnumerator getNotationEnumerator() const; RefHashTableOf* getAttributeDeclRegistry() const; RefHashTableOf* getComplexTypeRegistry() const; RefHashTableOf* getGroupInfoRegistry() const; RefHashTableOf* getAttGroupInfoRegistry() const; DatatypeValidatorFactory* getDatatypeRegistry(); RefHash2KeysTableOf* getValidSubstitutionGroups() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setTargetNamespace(const XMLCh* const targetNamespace); void setAttributeDeclRegistry(RefHashTableOf* const attReg); void setComplexTypeRegistry(RefHashTableOf* const other); void setGroupInfoRegistry(RefHashTableOf* const other); void setAttGroupInfoRegistry(RefHashTableOf* const other); void setValidSubstitutionGroups(RefHash2KeysTableOf* const); virtual void setGrammarDescription( XMLGrammarDescription*); virtual XMLGrammarDescription* getGrammarDescription() const; // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- XMLSize_t putGroupElemDecl ( XMLElementDecl* const elemDecl ) const; // ----------------------------------------------------------------------- // Annotation management methods // ----------------------------------------------------------------------- /** * Add annotation to the list of annotations for a given key */ void putAnnotation(void* key, XSAnnotation* const annotation); /** * Add global annotation * * Note: XSAnnotation acts as a linked list */ void addAnnotation(XSAnnotation* const annotation); /** * Retrieve the annotation that is associated with the specified key * * @param key represents a schema component object (i.e. SchemaGrammar) * @return XSAnnotation associated with the key object */ XSAnnotation* getAnnotation(const void* const key); /** * Retrieve the annotation that is associated with the specified key * * @param key represents a schema component object (i.e. SchemaGrammar) * @return XSAnnotation associated with the key object */ const XSAnnotation* getAnnotation(const void* const key) const; /** * Get global annotation */ XSAnnotation* getAnnotation(); const XSAnnotation* getAnnotation() const; /** * Get annotation hash table, to enumerate through them */ RefHashTableOf* getAnnotations(); const RefHashTableOf* getAnnotations() const; /** * Get/set scope count. */ unsigned int getScopeCount () const; void setScopeCount (unsigned int); /** * Get/set anonymous type count. */ unsigned int getAnonTypeCount () const; void setAnonTypeCount (unsigned int); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(SchemaGrammar) private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- SchemaGrammar(const SchemaGrammar&); SchemaGrammar& operator=(const SchemaGrammar&); // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- void cleanUp(); // ----------------------------------------------------------------------- // Private data members // // fElemDeclPool // This is the element decl pool. It contains all of the elements // declared in the Schema (and their associated attributes.) // // fElemNonDeclPool // This is the element decl pool that is is populated as new elements // are seen in the XML document (not declared in the Schema), and they // are given default characteristics. // // fGroupElemDeclPool // This is the element decl pool for elements in a group that are // referenced in different scope. It contains all of the elements // declared in the Schema (and their associated attributes.) // // fNotationDeclPool // This is a pool of NotationDecl objects, which contains all of the // notations declared in the Schema. // // fTargetNamespace // Target name space for this grammar. // // fAttributeDeclRegistry // Global attribute declarations // // fComplexTypeRegistry // Stores complexType declaration info // // fGroupInfoRegistry // Stores global declaration info // // fAttGroupInfoRegistry // Stores global declaration info // // fDatatypeRegistry // Datatype validator factory // // fValidSubstitutionGroups // Valid list of elements that can substitute a given element // // fIDRefList // List of ids of schema declarations extracted during schema grammar // traversal // // fValidated // Indicates if the content of the Grammar has been pre-validated // or not (UPA checking, etc.). When using a cached grammar, no need // for pre content validation. // // fGramDesc: adopted // // ----------------------------------------------------------------------- XMLCh* fTargetNamespace; RefHash3KeysIdPool* fElemDeclPool; RefHash3KeysIdPool* fElemNonDeclPool; RefHash3KeysIdPool* fGroupElemDeclPool; NameIdPool* fNotationDeclPool; RefHashTableOf* fAttributeDeclRegistry; RefHashTableOf* fComplexTypeRegistry; RefHashTableOf* fGroupInfoRegistry; RefHashTableOf* fAttGroupInfoRegistry; RefHash2KeysTableOf* fValidSubstitutionGroups; MemoryManager* fMemoryManager; XMLSchemaDescription* fGramDesc; RefHashTableOf* fAnnotations; bool fValidated; DatatypeValidatorFactory fDatatypeRegistry; unsigned int fScopeCount; unsigned int fAnonTypeCount; }; // --------------------------------------------------------------------------- // SchemaGrammar: Getter methods // --------------------------------------------------------------------------- inline RefHash3KeysIdPoolEnumerator SchemaGrammar::getElemEnumerator() const { return RefHash3KeysIdPoolEnumerator(fElemDeclPool, false, fMemoryManager); } inline NameIdPoolEnumerator SchemaGrammar::getNotationEnumerator() const { return NameIdPoolEnumerator(fNotationDeclPool, fMemoryManager); } inline RefHashTableOf* SchemaGrammar::getAttributeDeclRegistry() const { return fAttributeDeclRegistry; } inline RefHashTableOf* SchemaGrammar::getComplexTypeRegistry() const { return fComplexTypeRegistry; } inline RefHashTableOf* SchemaGrammar::getGroupInfoRegistry() const { return fGroupInfoRegistry; } inline RefHashTableOf* SchemaGrammar::getAttGroupInfoRegistry() const { return fAttGroupInfoRegistry; } inline DatatypeValidatorFactory* SchemaGrammar::getDatatypeRegistry() { return &fDatatypeRegistry; } inline RefHash2KeysTableOf* SchemaGrammar::getValidSubstitutionGroups() const { return fValidSubstitutionGroups; } inline XMLGrammarDescription* SchemaGrammar::getGrammarDescription() const { return fGramDesc; } inline XSAnnotation* SchemaGrammar::getAnnotation(const void* const key) { return fAnnotations->get(key); } inline const XSAnnotation* SchemaGrammar::getAnnotation(const void* const key) const { return fAnnotations->get(key); } inline XSAnnotation* SchemaGrammar::getAnnotation() { return fAnnotations->get(this); } inline const XSAnnotation* SchemaGrammar::getAnnotation() const { return fAnnotations->get(this); } inline RefHashTableOf* SchemaGrammar::getAnnotations() { return fAnnotations; } inline const RefHashTableOf* SchemaGrammar::getAnnotations() const { return fAnnotations; } // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- inline void SchemaGrammar::setTargetNamespace(const XMLCh* const targetNamespace) { if (fTargetNamespace) fMemoryManager->deallocate(fTargetNamespace);//delete [] fTargetNamespace; fTargetNamespace = XMLString::replicate(targetNamespace, fMemoryManager); } inline void SchemaGrammar::setAttributeDeclRegistry(RefHashTableOf* const attReg) { fAttributeDeclRegistry = attReg; } inline void SchemaGrammar::setComplexTypeRegistry(RefHashTableOf* const other) { fComplexTypeRegistry = other; } inline void SchemaGrammar::setGroupInfoRegistry(RefHashTableOf* const other) { fGroupInfoRegistry = other; } inline void SchemaGrammar::setAttGroupInfoRegistry(RefHashTableOf* const other) { fAttGroupInfoRegistry = other; } inline void SchemaGrammar::setValidSubstitutionGroups(RefHash2KeysTableOf* const other) { fValidSubstitutionGroups = other; } // --------------------------------------------------------------------------- // SchemaGrammar: Virtual methods // --------------------------------------------------------------------------- inline Grammar::GrammarType SchemaGrammar::getGrammarType() const { return Grammar::SchemaGrammarType; } inline const XMLCh* SchemaGrammar::getTargetNamespace() const { return fTargetNamespace; } // Element Decl inline XMLSize_t SchemaGrammar::getElemId (const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const , unsigned int scope ) const { // // In this case, we don't return zero to mean 'not found', so we have to // map it to the official not found value if we don't find it. // const SchemaElementDecl* decl = fElemDeclPool->getByKey(baseName, uriId, scope); if (!decl) { decl = fGroupElemDeclPool->getByKey(baseName, uriId, scope); if (!decl) return XMLElementDecl::fgInvalidElemId; } return decl->getId(); } inline const XMLElementDecl* SchemaGrammar::getElemDecl( const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const , unsigned int scope ) const { const SchemaElementDecl* decl = fElemDeclPool->getByKey(baseName, uriId, scope); if (!decl) { decl = fGroupElemDeclPool->getByKey(baseName, uriId, scope); if (!decl && fElemNonDeclPool) decl = fElemNonDeclPool->getByKey(baseName, uriId, scope); } return decl; } inline XMLElementDecl* SchemaGrammar::getElemDecl (const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const , unsigned int scope ) { SchemaElementDecl* decl = fElemDeclPool->getByKey(baseName, uriId, scope); if (!decl) { decl = fGroupElemDeclPool->getByKey(baseName, uriId, scope); if (!decl && fElemNonDeclPool) decl = fElemNonDeclPool->getByKey(baseName, uriId, scope); } return decl; } inline const XMLElementDecl* SchemaGrammar::getElemDecl(const unsigned int elemId) const { // Look up this element decl by id const SchemaElementDecl* decl = fElemDeclPool->getById(elemId); if (!decl) decl = fGroupElemDeclPool->getById(elemId); return decl; } inline XMLElementDecl* SchemaGrammar::getElemDecl(const unsigned int elemId) { // Look up this element decl by id SchemaElementDecl* decl = fElemDeclPool->getById(elemId); if (!decl) decl = fGroupElemDeclPool->getById(elemId); return decl; } inline XMLSize_t SchemaGrammar::putElemDecl(XMLElementDecl* const elemDecl, const bool notDeclared) { if (notDeclared) { if(!fElemNonDeclPool) fElemNonDeclPool = new (fMemoryManager) RefHash3KeysIdPool(29, true, 128, fMemoryManager); return fElemNonDeclPool->put(elemDecl->getBaseName(), elemDecl->getURI(), ((SchemaElementDecl* )elemDecl)->getEnclosingScope(), (SchemaElementDecl*) elemDecl); } return fElemDeclPool->put(elemDecl->getBaseName(), elemDecl->getURI(), ((SchemaElementDecl* )elemDecl)->getEnclosingScope(), (SchemaElementDecl*) elemDecl); } inline XMLSize_t SchemaGrammar::putGroupElemDecl (XMLElementDecl* const elemDecl) const { return fGroupElemDeclPool->put(elemDecl->getBaseName(), elemDecl->getURI(), ((SchemaElementDecl* )elemDecl)->getEnclosingScope(), (SchemaElementDecl*) elemDecl); } // Notation Decl inline const XMLNotationDecl* SchemaGrammar::getNotationDecl(const XMLCh* const notName) const { return fNotationDeclPool->getByKey(notName); } inline XMLNotationDecl* SchemaGrammar::getNotationDecl(const XMLCh* const notName) { return fNotationDeclPool->getByKey(notName); } inline XMLSize_t SchemaGrammar::putNotationDecl(XMLNotationDecl* const notationDecl) const { return fNotationDeclPool->put(notationDecl); } inline bool SchemaGrammar::getValidated() const { return fValidated; } inline void SchemaGrammar::setValidated(const bool newState) { fValidated = newState; } inline unsigned int SchemaGrammar::getScopeCount () const { return fScopeCount; } inline void SchemaGrammar::setScopeCount (unsigned int scopeCount) { fScopeCount = scopeCount; } inline unsigned int SchemaGrammar::getAnonTypeCount () const { return fAnonTypeCount; } inline void SchemaGrammar::setAnonTypeCount (unsigned int count) { fAnonTypeCount = count; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/schema/SchemaAttDefList.hpp000644 000765 000024 00000014207 13241160332 025532 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SchemaAttDefList.hpp 673679 2008-07-03 13:50:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_SCHEMAATTDEFLIST_HPP) #define XERCESC_INCLUDE_GUARD_SCHEMAATTDEFLIST_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN // // This is a derivative of the framework abstract class which defines the // interface to a list of attribute defs that belong to a particular // element. The scanner needs to be able to get a list of the attributes // that an element supports, for use during the validation process and for // fixed/default attribute processing. // // For us, we just wrap the RefHash2KeysTableOf collection that the SchemaElementDecl // class uses to store the attributes that belong to it. // // This class does not adopt the hash table, it just references it. The // hash table is owned by the element decl it is a member of. // class VALIDATORS_EXPORT SchemaAttDefList : public XMLAttDefList { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- SchemaAttDefList ( RefHash2KeysTableOf* const listToUse, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~SchemaAttDefList(); // ----------------------------------------------------------------------- // Implementation of the virtual interface // ----------------------------------------------------------------------- virtual bool isEmpty() const; virtual XMLAttDef* findAttDef ( const unsigned int uriID , const XMLCh* const attName ); virtual const XMLAttDef* findAttDef ( const unsigned int uriID , const XMLCh* const attName ) const; virtual XMLAttDef* findAttDef ( const XMLCh* const attURI , const XMLCh* const attName ); virtual const XMLAttDef* findAttDef ( const XMLCh* const attURI , const XMLCh* const attName ) const; XMLAttDef* findAttDefLocalPart ( const unsigned int uriID , const XMLCh* const attLocalPart ); const XMLAttDef* findAttDefLocalPart ( const unsigned int uriID , const XMLCh* const attLocalPart ) const; /** * return total number of attributes in this list */ virtual XMLSize_t getAttDefCount() const ; /** * return attribute at the index-th position in the list. */ virtual XMLAttDef &getAttDef(XMLSize_t index) ; /** * return attribute at the index-th position in the list. */ virtual const XMLAttDef &getAttDef(XMLSize_t index) const ; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(SchemaAttDefList) SchemaAttDefList(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- SchemaAttDefList(const SchemaAttDefList&); SchemaAttDefList& operator=(const SchemaAttDefList&); void addAttDef(SchemaAttDef *toAdd); // ----------------------------------------------------------------------- // Private data members // // fEnum // This is an enumerator for the list that we use to do the enumerator // type methods of this class. // // fList // The list of SchemaAttDef objects that represent the attributes that // a particular element supports. // fArray // vector of pointers to the DTDAttDef objects contained in this list // fSize // size of fArray // fCount // number of DTDAttDef objects currently stored in this list // ----------------------------------------------------------------------- RefHash2KeysTableOfEnumerator* fEnum; RefHash2KeysTableOf* fList; SchemaAttDef** fArray; XMLSize_t fSize; XMLSize_t fCount; friend class ComplexTypeInfo; }; inline void SchemaAttDefList::addAttDef(SchemaAttDef *toAdd) { if(fCount == fSize) { // need to grow fArray fSize <<= 1; SchemaAttDef** newArray = (SchemaAttDef **)((getMemoryManager())->allocate( sizeof(SchemaAttDef*) * fSize )); memcpy(newArray, fArray, fCount * sizeof(SchemaAttDef *)); (getMemoryManager())->deallocate(fArray); fArray = newArray; } fArray[fCount++] = toAdd; } inline XMLAttDef* SchemaAttDefList::findAttDefLocalPart(const unsigned int uriID , const XMLCh* const attLocalPart) { return fList->get((void*)attLocalPart, uriID); } inline const XMLAttDef* SchemaAttDefList::findAttDefLocalPart(const unsigned int uriID , const XMLCh* const attLocalPart) const { return fList->get((void*)attLocalPart, uriID); } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/schema/XercesElementWildcard.cpp000644 000765 000024 00000011160 13241160332 026611 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XercesElementWildcard.cpp 671133 2008-06-24 11:22:29Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local methods // --------------------------------------------------------------------------- /** * XercesElementWildcard is used to check whether two element declarations conflict */ /** * Check whether two element declarations conflict */ bool XercesElementWildcard::conflict(SchemaGrammar* const pGrammar, ContentSpecNode::NodeTypes type1, QName* q1, ContentSpecNode::NodeTypes type2, QName* q2, SubstitutionGroupComparator* comparator) { if (type1 == ContentSpecNode::Leaf && type2 == ContentSpecNode::Leaf) { if (comparator->isEquivalentTo(q1, q2) || comparator->isEquivalentTo(q2, q1)) return true; } else if (type1 == ContentSpecNode::Leaf) { return uriInWildcard(pGrammar, q1, q2->getURI(), type2, comparator); } else if (type2 == ContentSpecNode::Leaf) { return uriInWildcard(pGrammar, q2, q1->getURI(), type1, comparator); } else { return wildcardIntersect(type1, q1->getURI(), type2, q2->getURI()); } return false; } bool XercesElementWildcard::uriInWildcard(SchemaGrammar* const pGrammar, QName* qname, unsigned int wildcard, ContentSpecNode::NodeTypes wtype, SubstitutionGroupComparator* comparator) { if ((wtype & 0x0f)== ContentSpecNode::Any) { return true; } else if ((wtype & 0x0f)== ContentSpecNode::Any_NS) { // substitution of "uri" satisfies "wtype:wildcard" return comparator->isAllowedByWildcard(pGrammar, qname, wildcard, false); } else if ((wtype & 0x0f)== ContentSpecNode::Any_Other) { // substitution of "uri" satisfies "wtype:wildcard" return comparator->isAllowedByWildcard(pGrammar, qname, wildcard, true); } return false; } bool XercesElementWildcard::wildcardIntersect(ContentSpecNode::NodeTypes t1, unsigned int w1, ContentSpecNode::NodeTypes t2, unsigned int w2) { if (((t1 & 0x0f) == ContentSpecNode::Any) || ((t2 & 0x0f) == ContentSpecNode::Any)) { // if either one is "##any", then intersects return true; } else if (((t1 & 0x0f) == ContentSpecNode::Any_NS) && ((t2 & 0x0f) == ContentSpecNode::Any_NS)) { // if both are "some_namespace" and equal, then intersects return w1 == w2; } else if (((t1 & 0x0f) == ContentSpecNode::Any_Other) && ((t2 & 0x0f) == ContentSpecNode::Any_Other)) { // if both are "##other", then intersects return true; } // Below we assume that empty string has id 1. // else if (((t1 & 0x0f) == ContentSpecNode::Any_NS) && ((t2 & 0x0f) == ContentSpecNode::Any_Other)) { return w1 != w2 && w1 != 1; } else if (((t1 & 0x0f) == ContentSpecNode::Any_Other) && ((t2 & 0x0f) == ContentSpecNode::Any_NS)) { return w1 != w2 && w2 != 1; } return false; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/schema/XMLSchemaDescriptionImpl.hpp000644 000765 000024 00000012455 13241160332 027220 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLSchemaDescriptionImpl.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLSCHEMADESCRIPTIONIMPL_HPP) #define XERCESC_INCLUDE_GUARD_XMLSCHEMADESCRIPTIONIMPL_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLAttDefs; class XMLPARSER_EXPORT XMLSchemaDescriptionImpl : public XMLSchemaDescription { public : // ----------------------------------------------------------------------- /** @name constructor and destructor */ // ----------------------------------------------------------------------- //@{ XMLSchemaDescriptionImpl( const XMLCh* const targetNamespace , MemoryManager* const memMgr ); ~XMLSchemaDescriptionImpl(); //@} // ----------------------------------------------------------------------- /** @name Implementation of GrammarDescription Interface */ // ----------------------------------------------------------------------- //@{ /** * getGrammarKey * */ virtual const XMLCh* getGrammarKey() const; //@} // ----------------------------------------------------------------------- /** @name Implementation of SchemaDescription Interface */ // ----------------------------------------------------------------------- //@{ /** * getContextType * */ virtual ContextType getContextType() const; /** * getTargetNamespace * */ virtual const XMLCh* getTargetNamespace() const; /** * getLocationHints * */ virtual const RefArrayVectorOf* getLocationHints() const; /** * getTriggeringComponent * */ virtual const QName* getTriggeringComponent() const; /** * getenclosingElementName * */ virtual const QName* getEnclosingElementName() const; /** * getAttributes * */ virtual const XMLAttDef* getAttributes() const; /** * setContextType * */ virtual void setContextType(ContextType); /** * setTargetNamespace * */ virtual void setTargetNamespace(const XMLCh* const); /** * setLocationHints * */ virtual void setLocationHints(const XMLCh* const); /** * setTriggeringComponent * */ virtual void setTriggeringComponent(QName* const); /** * getenclosingElementName * */ virtual void setEnclosingElementName(QName* const); /** * setAttributes * */ virtual void setAttributes(XMLAttDef* const); //@} /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLSchemaDescriptionImpl) XMLSchemaDescriptionImpl(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager); private : // ----------------------------------------------------------------------- /** name Unimplemented copy constructor and operator= */ // ----------------------------------------------------------------------- //@{ XMLSchemaDescriptionImpl(const XMLSchemaDescriptionImpl& ); XMLSchemaDescriptionImpl& operator=(const XMLSchemaDescriptionImpl& ); //@} // ----------------------------------------------------------------------- // Private data members // // All data member in this implementation are owned to out survive // parser. Except for fNamespace which is replicated upon set, the // rest shall be created by the embedded memoryManager. // // fContextType // // fNamespace owned // // fLocationHints owned // // fTriggeringComponent owned // // fEnclosingElementName owned // // fAttributes referenced // // ----------------------------------------------------------------------- XMLSchemaDescription::ContextType fContextType; const XMLCh* fNamespace; RefArrayVectorOf* fLocationHints; const QName* fTriggeringComponent; const QName* fEnclosingElementName; const XMLAttDef* fAttributes; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/schema/XercesGroupInfo.hpp000644 000765 000024 00000014642 13241160332 025473 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XercesGroupInfo.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XERCESGROUPINFO_HPP) #define XERCESC_INCLUDE_GUARD_XERCESGROUPINFO_HPP /** * The class act as a place holder to store group information. * * The class is intended for internal use. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Forward Declarations // --------------------------------------------------------------------------- class ContentSpecNode; class XSDLocator; class VALIDATORS_EXPORT XercesGroupInfo : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Public Constructors/Destructor // ----------------------------------------------------------------------- XercesGroupInfo ( unsigned int groupNameId , unsigned int groupNamespaceId , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~XercesGroupInfo(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- bool getCheckElementConsistency() const; unsigned int getScope() const; XMLSize_t elementCount() const; ContentSpecNode* getContentSpec() const; SchemaElementDecl* elementAt(const XMLSize_t index); const SchemaElementDecl* elementAt(const XMLSize_t index) const; XSDLocator* getLocator() const; XercesGroupInfo* getBaseGroup() const; unsigned int getNameId() const; unsigned int getNamespaceId() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setScope(const unsigned int other); void setContentSpec(ContentSpecNode* const other); void addElement(SchemaElementDecl* const toAdd); void setLocator(XSDLocator* const aLocator); void setBaseGroup(XercesGroupInfo* const baseGroup); void setCheckElementConsistency(const bool aValue); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XercesGroupInfo) XercesGroupInfo(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XercesGroupInfo(const XercesGroupInfo& elemInfo); XercesGroupInfo& operator= (const XercesGroupInfo& other); // ----------------------------------------------------------------------- // Private data members // ----------------------------------------------------------------------- bool fCheckElementConsistency; unsigned int fScope; unsigned int fNameId; unsigned int fNamespaceId; ContentSpecNode* fContentSpec; RefVectorOf* fElements; XercesGroupInfo* fBaseGroup; // redefine by restriction XSDLocator* fLocator; }; // --------------------------------------------------------------------------- // XercesGroupInfo: Getter methods // --------------------------------------------------------------------------- inline unsigned int XercesGroupInfo::getScope() const { return fScope; } inline XMLSize_t XercesGroupInfo::elementCount() const { return fElements->size(); } inline ContentSpecNode* XercesGroupInfo::getContentSpec() const { return fContentSpec; } inline SchemaElementDecl* XercesGroupInfo::elementAt(const XMLSize_t index) { return fElements->elementAt(index); } inline const SchemaElementDecl* XercesGroupInfo::elementAt(const XMLSize_t index) const { return fElements->elementAt(index); } inline XSDLocator* XercesGroupInfo::getLocator() const { return fLocator; } inline XercesGroupInfo* XercesGroupInfo::getBaseGroup() const { return fBaseGroup; } inline bool XercesGroupInfo::getCheckElementConsistency() const { return fCheckElementConsistency; } inline unsigned int XercesGroupInfo::getNameId() const { return fNameId; } inline unsigned int XercesGroupInfo::getNamespaceId() const { return fNamespaceId; } // --------------------------------------------------------------------------- // XercesGroupInfo: Setter methods // ---------------------------------------------------------------------------} inline void XercesGroupInfo::setScope(const unsigned int other) { fScope = other; } inline void XercesGroupInfo::setContentSpec(ContentSpecNode* const other) { fContentSpec = other; } inline void XercesGroupInfo::addElement(SchemaElementDecl* const elem) { if (!fElements->containsElement(elem)) fElements->addElement(elem); } inline void XercesGroupInfo::setBaseGroup(XercesGroupInfo* const baseGroup) { fBaseGroup = baseGroup; } inline void XercesGroupInfo::setCheckElementConsistency(const bool aValue) { fCheckElementConsistency = aValue; } XERCES_CPP_NAMESPACE_END #endif /** * End of file XercesGroupInfo.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/SchemaInfo.cpp000644 000765 000024 00000020301 13241160332 024405 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SchemaInfo.cpp 924841 2010-03-18 14:57:13Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // SchemaInfo: Constructors and Destructor // --------------------------------------------------------------------------- SchemaInfo::SchemaInfo(const unsigned short elemAttrDefaultQualified, const int blockDefault, const int finalDefault, const int targetNSURI, const NamespaceScope* const currNamespaceScope, const XMLCh* const schemaURL, const XMLCh* const targetNSURIString, const DOMElement* const root, XMLScanner* xmlScanner, MemoryManager* const manager) : fAdoptInclude(false) , fProcessed(false) , fElemAttrDefaultQualified(elemAttrDefaultQualified) , fBlockDefault(blockDefault) , fFinalDefault(finalDefault) , fTargetNSURI(targetNSURI) , fNamespaceScope(0) , fSchemaRootElement(root) , fIncludeInfoList(0) , fImportedInfoList(0) , fImportingInfoList(0) , fFailedRedefineList(0) , fRecursingAnonTypes(0) , fRecursingTypeNames(0) , fNonXSAttList(0) , fValidationContext(0) , fMemoryManager(manager) { fImportingInfoList = new (fMemoryManager) RefVectorOf(4, false, fMemoryManager); memset( fTopLevelComponents, 0, sizeof(fTopLevelComponents[0]) * C_Count); memset( fLastTopLevelComponent, 0, sizeof(fLastTopLevelComponent[0]) * C_Count); fNonXSAttList = new (fMemoryManager) ValueVectorOf(2, fMemoryManager); fValidationContext = new (fMemoryManager) ValidationContextImpl(fMemoryManager); fNamespaceScope = new (fMemoryManager) NamespaceScope(currNamespaceScope, fMemoryManager); fCurrentSchemaURL = XMLString::replicate(schemaURL, fMemoryManager); fTargetNSURIString = XMLString::replicate(targetNSURIString, fMemoryManager); fValidationContext->setScanner (xmlScanner); fValidationContext->setNamespaceScope(fNamespaceScope); } SchemaInfo::~SchemaInfo() { fMemoryManager->deallocate(fCurrentSchemaURL);//delete [] fCurrentSchemaURL; fMemoryManager->deallocate(fTargetNSURIString); delete fImportedInfoList; if (fAdoptInclude) delete fIncludeInfoList; delete fImportingInfoList; delete fFailedRedefineList; delete fRecursingAnonTypes; delete fRecursingTypeNames; for (unsigned int i = 0; i < C_Count; i++) { delete fTopLevelComponents[i]; } delete fNonXSAttList; delete fValidationContext; delete fNamespaceScope; } // --------------------------------------------------------------------------- // SchemaInfo: // --------------------------------------------------------------------------- DOMElement* SchemaInfo::getTopLevelComponent(const unsigned short compCategory, const XMLCh* const compName, const XMLCh* const name, SchemaInfo** enclosingSchema) { if (fSchemaRootElement == 0) return 0; SchemaInfo* currentInfo = this; DOMElement* child = getTopLevelComponent(compCategory, compName, name); if (child == 0) { XMLSize_t listSize = (fIncludeInfoList) ? fIncludeInfoList->size() : 0; for (XMLSize_t i=0; i < listSize; i++) { currentInfo = fIncludeInfoList->elementAt(i); if (currentInfo == this) continue; child = currentInfo->getTopLevelComponent(compCategory, compName, name); if (child != 0) { *enclosingSchema = currentInfo; break; } } } return child; } DOMElement* SchemaInfo::getTopLevelComponent(const unsigned short compCategory, const XMLCh* const compName, const XMLCh* const name) { if (fSchemaRootElement == 0 || compCategory >= C_Count) return 0; DOMElement* child = XUtil::getFirstChildElement(fSchemaRootElement); if (!child) return 0; RefHashTableOf* compList = fTopLevelComponents[compCategory]; if (fTopLevelComponents[compCategory] == 0) { compList= new (fMemoryManager) RefHashTableOf(17, false, fMemoryManager); fTopLevelComponents[compCategory] = compList; } else { DOMElement* cachedChild = compList->get(name); if(cachedChild) return cachedChild; child = fLastTopLevelComponent[compCategory]; } DOMElement* redefParent = (DOMElement*) child->getParentNode(); // Parent is not "redefine" if (!XMLString::equals(redefParent->getLocalName(),SchemaSymbols::fgELT_REDEFINE)) redefParent = 0; while (child != 0) { fLastTopLevelComponent[compCategory]=child; if (XMLString::equals(child->getLocalName(), compName)) { const XMLCh* cName=child->getAttribute(SchemaSymbols::fgATT_NAME); compList->put((void*)cName, child); if (XMLString::equals(cName, name)) return child; } else if (XMLString::equals(child->getLocalName(),SchemaSymbols::fgELT_REDEFINE) && (!fFailedRedefineList || !fFailedRedefineList->containsElement(child))) { // if redefine DOMElement* redefineChild = XUtil::getFirstChildElement(child); while (redefineChild != 0) { fLastTopLevelComponent[compCategory]=redefineChild; if ((!fFailedRedefineList || !fFailedRedefineList->containsElement(redefineChild)) && XMLString::equals(redefineChild->getLocalName(), compName)) { const XMLCh* rName=redefineChild->getAttribute(SchemaSymbols::fgATT_NAME); compList->put((void*)rName, redefineChild); if (XMLString::equals(rName, name)) return redefineChild; } redefineChild = XUtil::getNextSiblingElement(redefineChild); } } child = XUtil::getNextSiblingElement(child); if (child == 0 && redefParent) { child = XUtil::getNextSiblingElement(redefParent); redefParent = 0; } } return child; } void SchemaInfo::updateImportingInfo(SchemaInfo* const importingInfo) { if (!fImportingInfoList->containsElement(importingInfo)) { fImportingInfoList->addElement(importingInfo); } XMLSize_t listSize = importingInfo->fImportingInfoList->size(); for (XMLSize_t i=0; i < listSize; i++) { SchemaInfo* tmpInfo = importingInfo->fImportingInfoList->elementAt(i); if (tmpInfo != this && !fImportingInfoList->containsElement(tmpInfo)) { fImportingInfoList->addElement(tmpInfo); } } } XERCES_CPP_NAMESPACE_END /** * End of file SchemaInfo.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/SchemaValidator.hpp000644 000765 000024 00000044272 13241160332 025461 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SchemaValidator.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_SCHEMAVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_SCHEMAVALIDATOR_HPP #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class GrammarResolver; class DatatypeValidator; class SchemaElementDecl; // // This is a derivative of the abstract validator interface. This class // implements a validator that supports standard XML Schema semantics. // This class handles scanning the of the schema, and provides // the standard validation services against the Schema info it found. // class VALIDATORS_EXPORT SchemaValidator : public XMLValidator { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- SchemaValidator ( XMLErrorReporter* const errReporter = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~SchemaValidator(); // ----------------------------------------------------------------------- // Implementation of the XMLValidator interface // ----------------------------------------------------------------------- virtual bool checkContent ( XMLElementDecl* const elemDecl , QName** const children , XMLSize_t childCount , XMLSize_t* indexFailingChild ); virtual void faultInAttr ( XMLAttr& toFill , const XMLAttDef& attDef ) const; virtual void preContentValidation(bool reuseGrammar, bool validateDefAttr = false); virtual void postParseValidation(); virtual void reset(); virtual bool requiresNamespaces() const; virtual void validateAttrValue ( const XMLAttDef* attDef , const XMLCh* const attrValue , bool preValidation = false , const XMLElementDecl* elemDecl = 0 ); virtual void validateElement ( const XMLElementDecl* elemDef ); virtual Grammar* getGrammar() const; virtual void setGrammar(Grammar* aGrammar); // ----------------------------------------------------------------------- // Virtual DTD handler interface. // ----------------------------------------------------------------------- virtual bool handlesDTD() const; // ----------------------------------------------------------------------- // Virtual Schema handler interface. handlesSchema() always return false. // ----------------------------------------------------------------------- virtual bool handlesSchema() const; // ----------------------------------------------------------------------- // Schema Validator methods // ----------------------------------------------------------------------- void normalizeWhiteSpace(DatatypeValidator* dV, const XMLCh* const value, XMLBuffer& toFill, bool bStandalone = false); // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setGrammarResolver(GrammarResolver* grammarResolver); void setXsiType(const XMLCh* const prefix , const XMLCh* const localPart , const unsigned int uriId); void setNillable(bool isNil); void resetNillable(); void setErrorReporter(XMLErrorReporter* const errorReporter); void setExitOnFirstFatal(const bool newValue); void setDatatypeBuffer(const XMLCh* const value); void clearDatatypeBuffer(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- ComplexTypeInfo* getCurrentTypeInfo() const; DatatypeValidator *getCurrentDatatypeValidator() const; DatatypeValidator *getMostRecentAttrValidator() const; bool getErrorOccurred() const; bool getIsElemSpecified() const; bool getIsXsiTypeSet() const; const XMLCh* getNormalizedValue() const; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- SchemaValidator(const SchemaValidator&); SchemaValidator& operator=(const SchemaValidator&); // ----------------------------------------------------------------------- // Element Consistency Checking methods // ----------------------------------------------------------------------- void checkRefElementConsistency(SchemaGrammar* const currentGrammar, const ComplexTypeInfo* const curTypeInfo, const XercesGroupInfo* const curGroup = 0); // ----------------------------------------------------------------------- // Particle Derivation Checking methods // ----------------------------------------------------------------------- void checkParticleDerivation(SchemaGrammar* const currentGrammar, const ComplexTypeInfo* const typeInfo); void checkParticleDerivationOk(SchemaGrammar* const currentGrammar, ContentSpecNode* const curNode, const int derivedScope, ContentSpecNode* const baseNode, const int baseScope, const ComplexTypeInfo* const baseInfo = 0, const bool toCheckOccurrence = true); ContentSpecNode* checkForPointlessOccurrences(ContentSpecNode* const specNode, const ContentSpecNode::NodeTypes nodeType, ValueVectorOf* const nodes); void gatherChildren(const ContentSpecNode::NodeTypes parentNodeType, ContentSpecNode* const specNode, ValueVectorOf* const nodes); bool isOccurrenceRangeOK(const int min1, const int max1, const int min2, const int max2); void checkNSCompat(const ContentSpecNode* const derivedSpecNode, const ContentSpecNode* const baseSpecNode, const bool toCheckOccurence); bool wildcardEltAllowsNamespace(const ContentSpecNode* const baseSpecNode, const unsigned int derivedURI); void checkNameAndTypeOK(SchemaGrammar* const currentGrammar, const ContentSpecNode* const derivedSpecNode, const int derivedScope, const ContentSpecNode* const baseSpecNode, const int baseScope, const ComplexTypeInfo* const baseInfo = 0); SchemaElementDecl* findElement(const int scope, const unsigned int uriIndex, const XMLCh* const name, SchemaGrammar* const grammar, const ComplexTypeInfo* const typeInfo = 0); void checkICRestriction(const SchemaElementDecl* const derivedElemDecl, const SchemaElementDecl* const baseElemDecl, const XMLCh* const derivedElemName, const XMLCh* const baseElemName); void checkTypesOK(const SchemaElementDecl* const derivedElemDecl, const SchemaElementDecl* const baseElemDecl, const XMLCh* const derivedElemName); void checkRecurseAsIfGroup(SchemaGrammar* const currentGrammar, ContentSpecNode* const derivedSpecNode, const int derivedScope, const ContentSpecNode* const baseSpecNode, const int baseScope, ValueVectorOf* const nodes, const ComplexTypeInfo* const baseInfo); void checkRecurse(SchemaGrammar* const currentGrammar, const ContentSpecNode* const derivedSpecNode, const int derivedScope, ValueVectorOf* const derivedNodes, const ContentSpecNode* const baseSpecNode, const int baseScope, ValueVectorOf* const baseNodes, const ComplexTypeInfo* const baseInfo, const bool toLax = false); void checkNSSubset(const ContentSpecNode* const derivedSpecNode, const ContentSpecNode* const baseSpecNode); bool checkNSSubsetChoiceRoot(const ContentSpecNode* const derivedSpecNode, const ContentSpecNode* const baseSpecNode); bool checkNSSubsetChoice(const ContentSpecNode* const derivedSpecNode, const ContentSpecNode* const baseSpecNode); bool isWildCardEltSubset(const ContentSpecNode* const derivedSpecNode, const ContentSpecNode* const baseSpecNode); void checkNSRecurseCheckCardinality(SchemaGrammar* const currentGrammar, const ContentSpecNode* const derivedSpecNode, ValueVectorOf* const derivedNodes, const int derivedScope, ContentSpecNode* const baseSpecNode, const bool toCheckOccurence); void checkRecurseUnordered(SchemaGrammar* const currentGrammar, const ContentSpecNode* const derivedSpecNode, ValueVectorOf* const derivedNodes, const int derivedScope, ContentSpecNode* const baseSpecNode, ValueVectorOf* const baseNodes, const int baseScope, const ComplexTypeInfo* const baseInfo); void checkMapAndSum(SchemaGrammar* const currentGrammar, const ContentSpecNode* const derivedSpecNode, ValueVectorOf* const derivedNodes, const int derivedScope, ContentSpecNode* const baseSpecNode, ValueVectorOf* const baseNodes, const int baseScope, const ComplexTypeInfo* const baseInfo); ContentSpecNode* getNonUnaryGroup(ContentSpecNode* const pNode); // ----------------------------------------------------------------------- // Private data members // // ----------------------------------------------------------------------- // The following comes from or set by the Scanner // fSchemaGrammar // The current schema grammar used by the validator // // fGrammarResolver // All the schema grammar stored // // fXsiType // Store the Schema Type Attribute Value if schema type is specified // // fNil // Indicates if a nil value is acceptable // fNilFound // Indicates if Nillable has been set // ----------------------------------------------------------------------- // The following used internally in the validator // // fCurrentDatatypeValidator // The validator used for validating the content of elements // with simple types // // fDatatypeBuffer // Buffer for simple type element string content // // fTrailing // Previous chunk had a trailing space // // fSeenNonWhiteSpace // Seen a non-whitespace character in the previous chunk // // fSeenId // Indicate if an attribute of ID type has been seen already, reset per element. // // fSchemaErrorReporter // Report schema process errors // // fTypeStack // Stack of complex type declarations. // // fMostRecentAttrValidator // DatatypeValidator that validated attribute most recently processed // // fErrorOccurred // whether an error occurred in the most recent operation // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; SchemaGrammar* fSchemaGrammar; GrammarResolver* fGrammarResolver; QName* fXsiType; bool fNil; bool fNilFound; DatatypeValidator* fCurrentDatatypeValidator; XMLBuffer* fNotationBuf; XMLBuffer fDatatypeBuffer; bool fTrailing; bool fSeenNonWhiteSpace; bool fSeenId; XSDErrorReporter fSchemaErrorReporter; ValueStackOf* fTypeStack; DatatypeValidator * fMostRecentAttrValidator; bool fErrorOccurred; bool fElemIsSpecified; }; // --------------------------------------------------------------------------- // SchemaValidator: Setter methods // --------------------------------------------------------------------------- inline void SchemaValidator::setGrammarResolver(GrammarResolver* grammarResolver) { fGrammarResolver = grammarResolver; } inline void SchemaValidator::setXsiType(const XMLCh* const prefix , const XMLCh* const localPart , const unsigned int uriId) { delete fXsiType; fXsiType = new (fMemoryManager) QName(prefix, localPart, uriId, fMemoryManager); } inline void SchemaValidator::setNillable(bool isNil) { fNil = isNil; fNilFound = true; } inline void SchemaValidator::resetNillable() { fNil = false; fNilFound = false; } inline void SchemaValidator::setExitOnFirstFatal(const bool newValue) { fSchemaErrorReporter.setExitOnFirstFatal(newValue); } inline void SchemaValidator::setDatatypeBuffer(const XMLCh* const value) { fDatatypeBuffer.append(value); } inline void SchemaValidator::clearDatatypeBuffer() { fDatatypeBuffer.reset(); } // --------------------------------------------------------------------------- // SchemaValidator: Getter methods // --------------------------------------------------------------------------- inline ComplexTypeInfo* SchemaValidator::getCurrentTypeInfo() const { if (fTypeStack->empty()) return 0; return fTypeStack->peek(); } inline DatatypeValidator * SchemaValidator::getCurrentDatatypeValidator() const { return fCurrentDatatypeValidator; } inline DatatypeValidator *SchemaValidator::getMostRecentAttrValidator() const { return fMostRecentAttrValidator; } // --------------------------------------------------------------------------- // Virtual interface // --------------------------------------------------------------------------- inline Grammar* SchemaValidator::getGrammar() const { return fSchemaGrammar; } inline void SchemaValidator::setGrammar(Grammar* aGrammar) { fSchemaGrammar = (SchemaGrammar*) aGrammar; } inline void SchemaValidator::setErrorReporter(XMLErrorReporter* const errorReporter) { XMLValidator::setErrorReporter(errorReporter); fSchemaErrorReporter.setErrorReporter(errorReporter); } // --------------------------------------------------------------------------- // SchemaValidator: DTD handler interface // --------------------------------------------------------------------------- inline bool SchemaValidator::handlesDTD() const { // No DTD scanning return false; } // --------------------------------------------------------------------------- // SchemaValidator: Schema handler interface // --------------------------------------------------------------------------- inline bool SchemaValidator::handlesSchema() const { return true; } // --------------------------------------------------------------------------- // SchemaValidator: Particle derivation checking // --------------------------------------------------------------------------- inline bool SchemaValidator::isOccurrenceRangeOK(const int min1, const int max1, const int min2, const int max2) { if (min1 >= min2 && (max2 == SchemaSymbols::XSD_UNBOUNDED || (max1 != SchemaSymbols::XSD_UNBOUNDED && max1 <= max2))) { return true; } return false; } inline bool SchemaValidator::getErrorOccurred() const { return fErrorOccurred; } inline bool SchemaValidator::getIsElemSpecified() const { return fElemIsSpecified; } inline const XMLCh* SchemaValidator::getNormalizedValue() const { return fDatatypeBuffer.getRawBuffer(); } inline bool SchemaValidator::getIsXsiTypeSet() const { return (fXsiType!=0); } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/schema/SchemaSymbols.hpp000644 000765 000024 00000022170 13241160332 025155 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SchemaSymbols.hpp 802804 2009-08-10 14:21:48Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_SCHEMASYMBOLS_HPP) #define XERCESC_INCLUDE_GUARD_SCHEMASYMBOLS_HPP #include XERCES_CPP_NAMESPACE_BEGIN /* * Collection of symbols used to parse a Schema Grammar */ class VALIDATORS_EXPORT SchemaSymbols { public : // ----------------------------------------------------------------------- // Constant data // ----------------------------------------------------------------------- static const XMLCh fgURI_XSI[]; static const XMLCh fgURI_SCHEMAFORSCHEMA[]; // deprecated (typo) static const XMLCh fgXSI_SCHEMALOCACTION[]; // deprecated (typo) static const XMLCh fgXSI_NONAMESPACESCHEMALOCACTION[]; static const XMLCh fgXSI_SCHEMALOCATION[]; static const XMLCh fgXSI_NONAMESPACESCHEMALOCATION[]; static const XMLCh fgXSI_TYPE[]; static const XMLCh fgELT_ALL[]; static const XMLCh fgELT_ANNOTATION[]; static const XMLCh fgELT_ANY[]; static const XMLCh fgELT_WILDCARD[]; static const XMLCh fgELT_ANYATTRIBUTE[]; static const XMLCh fgELT_APPINFO[]; static const XMLCh fgELT_ATTRIBUTE[]; static const XMLCh fgELT_ATTRIBUTEGROUP[]; static const XMLCh fgELT_CHOICE[]; static const XMLCh fgELT_COMPLEXTYPE[]; static const XMLCh fgELT_CONTENT[]; static const XMLCh fgELT_DOCUMENTATION[]; static const XMLCh fgELT_DURATION[]; static const XMLCh fgELT_ELEMENT[]; static const XMLCh fgELT_ENCODING[]; static const XMLCh fgELT_ENUMERATION[]; static const XMLCh fgELT_FIELD[]; static const XMLCh fgELT_WHITESPACE[]; static const XMLCh fgELT_GROUP[]; static const XMLCh fgELT_IMPORT[]; static const XMLCh fgELT_INCLUDE[]; static const XMLCh fgELT_REDEFINE[]; static const XMLCh fgELT_KEY[]; static const XMLCh fgELT_KEYREF[]; static const XMLCh fgELT_LENGTH[]; static const XMLCh fgELT_MAXEXCLUSIVE[]; static const XMLCh fgELT_MAXINCLUSIVE[]; static const XMLCh fgELT_MAXLENGTH[]; static const XMLCh fgELT_MINEXCLUSIVE[]; static const XMLCh fgELT_MININCLUSIVE[]; static const XMLCh fgELT_MINLENGTH[]; static const XMLCh fgELT_NOTATION[]; static const XMLCh fgELT_PATTERN[]; static const XMLCh fgELT_PERIOD[]; static const XMLCh fgELT_TOTALDIGITS[]; static const XMLCh fgELT_FRACTIONDIGITS[]; static const XMLCh fgELT_SCHEMA[]; static const XMLCh fgELT_SELECTOR[]; static const XMLCh fgELT_SEQUENCE[]; static const XMLCh fgELT_SIMPLETYPE[]; static const XMLCh fgELT_UNION[]; static const XMLCh fgELT_LIST[]; static const XMLCh fgELT_UNIQUE[]; static const XMLCh fgELT_COMPLEXCONTENT[]; static const XMLCh fgELT_SIMPLECONTENT[]; static const XMLCh fgELT_RESTRICTION[]; static const XMLCh fgELT_EXTENSION[]; static const XMLCh fgATT_ABSTRACT[]; static const XMLCh fgATT_ATTRIBUTEFORMDEFAULT[]; static const XMLCh fgATT_BASE[]; static const XMLCh fgATT_ITEMTYPE[]; static const XMLCh fgATT_MEMBERTYPES[]; static const XMLCh fgATT_BLOCK[]; static const XMLCh fgATT_BLOCKDEFAULT[]; static const XMLCh fgATT_DEFAULT[]; static const XMLCh fgATT_ELEMENTFORMDEFAULT[]; static const XMLCh fgATT_SUBSTITUTIONGROUP[]; static const XMLCh fgATT_FINAL[]; static const XMLCh fgATT_FINALDEFAULT[]; static const XMLCh fgATT_FIXED[]; static const XMLCh fgATT_FORM[]; static const XMLCh fgATT_ID[]; static const XMLCh fgATT_MAXOCCURS[]; static const XMLCh fgATT_MINOCCURS[]; static const XMLCh fgATT_NAME[]; static const XMLCh fgATT_NAMESPACE[]; static const XMLCh fgATT_NILL[]; static const XMLCh fgATT_NILLABLE[]; static const XMLCh fgATT_PROCESSCONTENTS[]; static const XMLCh fgATT_REF[]; static const XMLCh fgATT_REFER[]; static const XMLCh fgATT_SCHEMALOCATION[]; static const XMLCh fgATT_SOURCE[]; static const XMLCh fgATT_SYSTEM[]; static const XMLCh fgATT_PUBLIC[]; static const XMLCh fgATT_TARGETNAMESPACE[]; static const XMLCh fgATT_TYPE[]; static const XMLCh fgATT_USE[]; static const XMLCh fgATT_VALUE[]; static const XMLCh fgATT_MIXED[]; static const XMLCh fgATT_VERSION[]; static const XMLCh fgATT_XPATH[]; static const XMLCh fgATTVAL_TWOPOUNDANY[]; static const XMLCh fgATTVAL_TWOPOUNDLOCAL[]; static const XMLCh fgATTVAL_TWOPOUNDOTHER[]; static const XMLCh fgATTVAL_TWOPOUNDTRAGETNAMESPACE[]; static const XMLCh fgATTVAL_POUNDALL[]; static const XMLCh fgATTVAL_BASE64[]; static const XMLCh fgATTVAL_BOOLEAN[]; static const XMLCh fgATTVAL_DEFAULT[]; static const XMLCh fgATTVAL_ELEMENTONLY[]; static const XMLCh fgATTVAL_EMPTY[]; static const XMLCh fgATTVAL_EXTENSION[]; static const XMLCh fgATTVAL_FALSE[]; static const XMLCh fgATTVAL_FIXED[]; static const XMLCh fgATTVAL_HEX[]; static const XMLCh fgATTVAL_ID[]; static const XMLCh fgATTVAL_LAX[]; static const XMLCh fgATTVAL_MAXLENGTH[]; static const XMLCh fgATTVAL_MINLENGTH[]; static const XMLCh fgATTVAL_MIXED[]; static const XMLCh fgATTVAL_NCNAME[]; static const XMLCh fgATTVAL_OPTIONAL[]; static const XMLCh fgATTVAL_PROHIBITED[]; static const XMLCh fgATTVAL_QNAME[]; static const XMLCh fgATTVAL_QUALIFIED[]; static const XMLCh fgATTVAL_REQUIRED[]; static const XMLCh fgATTVAL_RESTRICTION[]; static const XMLCh fgATTVAL_SKIP[]; static const XMLCh fgATTVAL_STRICT[]; static const XMLCh fgATTVAL_STRING[]; static const XMLCh fgATTVAL_TEXTONLY[]; static const XMLCh fgATTVAL_TIMEDURATION[]; static const XMLCh fgATTVAL_TRUE[]; static const XMLCh fgATTVAL_UNQUALIFIED[]; static const XMLCh fgATTVAL_URI[]; static const XMLCh fgATTVAL_URIREFERENCE[]; static const XMLCh fgATTVAL_SUBSTITUTIONGROUP[]; static const XMLCh fgATTVAL_SUBSTITUTION[]; static const XMLCh fgATTVAL_ANYTYPE[]; static const XMLCh fgWS_PRESERVE[]; static const XMLCh fgWS_COLLAPSE[]; static const XMLCh fgWS_REPLACE[]; static const XMLCh fgDT_STRING[]; static const XMLCh fgDT_TOKEN[]; static const XMLCh fgDT_LANGUAGE[]; static const XMLCh fgDT_NAME[]; static const XMLCh fgDT_NCNAME[]; static const XMLCh fgDT_INTEGER[]; static const XMLCh fgDT_DECIMAL[]; static const XMLCh fgDT_BOOLEAN[]; static const XMLCh fgDT_NONPOSITIVEINTEGER[]; static const XMLCh fgDT_NEGATIVEINTEGER[]; static const XMLCh fgDT_LONG[]; static const XMLCh fgDT_INT[]; static const XMLCh fgDT_SHORT[]; static const XMLCh fgDT_BYTE[]; static const XMLCh fgDT_NONNEGATIVEINTEGER[]; static const XMLCh fgDT_ULONG[]; static const XMLCh fgDT_UINT[]; static const XMLCh fgDT_USHORT[]; static const XMLCh fgDT_UBYTE[]; static const XMLCh fgDT_POSITIVEINTEGER[]; //datetime static const XMLCh fgDT_DATETIME[]; static const XMLCh fgDT_DATE[]; static const XMLCh fgDT_TIME[]; static const XMLCh fgDT_DURATION[]; static const XMLCh fgDT_DAY[]; static const XMLCh fgDT_MONTH[]; static const XMLCh fgDT_MONTHDAY[]; static const XMLCh fgDT_YEAR[]; static const XMLCh fgDT_YEARMONTH[]; static const XMLCh fgDT_BASE64BINARY[]; static const XMLCh fgDT_HEXBINARY[]; static const XMLCh fgDT_FLOAT[]; static const XMLCh fgDT_DOUBLE[]; static const XMLCh fgDT_URIREFERENCE[]; static const XMLCh fgDT_ANYURI[]; static const XMLCh fgDT_QNAME[]; static const XMLCh fgDT_NORMALIZEDSTRING[]; static const XMLCh fgDT_ANYSIMPLETYPE[]; static const XMLCh fgRegEx_XOption[]; static const XMLCh fgRedefIdentifier[]; static const int fgINT_MIN_VALUE; static const int fgINT_MAX_VALUE; enum { XSD_EMPTYSET = 0, XSD_SUBSTITUTION = 1, XSD_EXTENSION = 2, XSD_RESTRICTION = 4, XSD_LIST = 8, XSD_UNION = 16, XSD_ENUMERATION = 32 }; // group orders enum { XSD_CHOICE = 0, XSD_SEQUENCE= 1, XSD_ALL = 2 }; enum { XSD_UNBOUNDED = -1, XSD_NILLABLE = 1, XSD_ABSTRACT = 2, XSD_FIXED = 4 }; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- SchemaSymbols(); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file SchemaSymbols.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/TraverseSchema.hpp000644 000765 000024 00000120047 13241160332 025322 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: TraverseSchema.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_TRAVERSESCHEMA_HPP) #define XERCESC_INCLUDE_GUARD_TRAVERSESCHEMA_HPP /** * Instances of this class get delegated to Traverse the Schema and * to populate the SchemaGrammar internal representation. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Forward Declarations // --------------------------------------------------------------------------- class GrammarResolver; class XMLEntityHandler; class XMLScanner; class DatatypeValidator; class DatatypeValidatorFactory; class QName; class ComplexTypeInfo; class XMLAttDef; class NamespaceScope; class SchemaAttDef; class InputSource; class XercesGroupInfo; class XercesAttGroupInfo; class IdentityConstraint; class XSDLocator; class XSDDOMParser; class XMLErrorReporter; class VALIDATORS_EXPORT TraverseSchema : public XMemory { public: // ----------------------------------------------------------------------- // Public Constructors/Destructor // ----------------------------------------------------------------------- TraverseSchema ( DOMElement* const schemaRoot , XMLStringPool* const uriStringPool , SchemaGrammar* const schemaGrammar , GrammarResolver* const grammarResolver , RefHash2KeysTableOf* cachedSchemaInfoList , RefHash2KeysTableOf* schemaInfoList , XMLScanner* const xmlScanner , const XMLCh* const schemaURL , XMLEntityHandler* const entityHandler , XMLErrorReporter* const errorReporter , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager , bool multipleImport = false ); ~TraverseSchema(); private: // This enumeration is defined here for compatibility with the CodeWarrior // compiler, which apparently doesn't like to accept default parameter // arguments that it hasn't yet seen. The Not_All_Context argument is // used in the declaration of checkMinMax, below. // // Flags indicate any special restrictions on minOccurs and maxOccurs // relating to "all". // Not_All_Context - not processing an // All_Element - processing an in an // Group_Ref_With_All - processing reference that contained // All_Group - processing an group itself enum { Not_All_Context = 0 , All_Element = 1 , Group_Ref_With_All = 2 , All_Group = 4 }; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- TraverseSchema(const TraverseSchema&); TraverseSchema& operator=(const TraverseSchema&); // ----------------------------------------------------------------------- // Init/CleanUp methods // ----------------------------------------------------------------------- void init(); void cleanUp(); // ----------------------------------------------------------------------- // Traversal methods // ----------------------------------------------------------------------- /** * Traverse the Schema DOM tree */ void doTraverseSchema(const DOMElement* const schemaRoot); void preprocessSchema(DOMElement* const schemaRoot, const XMLCh* const schemaURL, bool multipleImport = false); void traverseSchemaHeader(const DOMElement* const schemaRoot); XSAnnotation* traverseAnnotationDecl(const DOMElement* const childElem, ValueVectorOf* const nonXSAttList, const bool topLevel = false); void traverseInclude(const DOMElement* const childElem); void traverseImport(const DOMElement* const childElem); void traverseRedefine(const DOMElement* const childElem); void traverseAttributeDecl(const DOMElement* const childElem, ComplexTypeInfo* const typeInfo, const bool topLevel = false); void traverseSimpleContentDecl(const XMLCh* const typeName, const XMLCh* const qualifiedName, const DOMElement* const contentDecl, ComplexTypeInfo* const typeInfo, Janitor* const janAnnot); void traverseComplexContentDecl(const XMLCh* const typeName, const DOMElement* const contentDecl, ComplexTypeInfo* const typeInfo, const bool isMixed, Janitor* const janAnnot); DatatypeValidator* traverseSimpleTypeDecl(const DOMElement* const childElem, const bool topLevel = true, int baseRefContext = SchemaSymbols::XSD_EMPTYSET); int traverseComplexTypeDecl(const DOMElement* const childElem, const bool topLevel = true, const XMLCh* const recursingTypeName = 0); DatatypeValidator* traverseByList(const DOMElement* const rootElem, const DOMElement* const contentElem, const XMLCh* const typeName, const XMLCh* const qualifiedName, const int finalSet, Janitor* const janAnnot); DatatypeValidator* traverseByRestriction(const DOMElement* const rootElem, const DOMElement* const contentElem, const XMLCh* const typeName, const XMLCh* const qualifiedName, const int finalSet, Janitor* const janAnnot); DatatypeValidator* traverseByUnion(const DOMElement* const rootElem, const DOMElement* const contentElem, const XMLCh* const typeName, const XMLCh* const qualifiedName, const int finalSet, int baseRefContext, Janitor* const janAnnot); SchemaElementDecl* traverseElementDecl(const DOMElement* const childElem, const bool topLevel = false); const XMLCh* traverseNotationDecl(const DOMElement* const childElem); const XMLCh* traverseNotationDecl(const DOMElement* const childElem, const XMLCh* const name, const XMLCh* const uriStr); ContentSpecNode* traverseChoiceSequence(const DOMElement* const elemDecl, const int modelGroupType, bool& hasChildren); ContentSpecNode* traverseAny(const DOMElement* const anyDecl); ContentSpecNode* traverseAll(const DOMElement* const allElem, bool& hasChildren); XercesGroupInfo* traverseGroupDecl(const DOMElement* const childElem, const bool topLevel = true); XercesAttGroupInfo* traverseAttributeGroupDecl(const DOMElement* const elem, ComplexTypeInfo* const typeInfo, const bool topLevel = false); XercesAttGroupInfo* traverseAttributeGroupDeclNS(const DOMElement* const elem, const XMLCh* const uriStr, const XMLCh* const name); SchemaAttDef* traverseAnyAttribute(const DOMElement* const elem); void traverseKey(const DOMElement* const icElem, SchemaElementDecl* const elemDecl); void traverseUnique(const DOMElement* const icElem, SchemaElementDecl* const elemDecl); void traverseKeyRef(const DOMElement* const icElem, SchemaElementDecl* const elemDecl); bool traverseIdentityConstraint(IdentityConstraint* const ic, const DOMElement* const icElem); // ----------------------------------------------------------------------- // Error Reporting methods // ----------------------------------------------------------------------- void reportSchemaError(const XSDLocator* const aLocator, const XMLCh* const msgDomain, const int errorCode); void reportSchemaError(const XSDLocator* const aLocator, const XMLCh* const msgDomain, const int errorCode, const XMLCh* const text1, const XMLCh* const text2 = 0, const XMLCh* const text3 = 0, const XMLCh* const text4 = 0); void reportSchemaError(const DOMElement* const elem, const XMLCh* const msgDomain, const int errorCode); void reportSchemaError(const DOMElement* const elem, const XMLCh* const msgDomain, const int errorCode, const XMLCh* const text1, const XMLCh* const text2 = 0, const XMLCh* const text3 = 0, const XMLCh* const text4 = 0); void reportSchemaError(const DOMElement* const elem, const XMLException& except); // ----------------------------------------------------------------------- // Private Helper methods // ----------------------------------------------------------------------- /** * Keep track of the xs:import found */ bool isImportingNS(const int namespaceURI); void addImportedNS(const int namespaceURI); /** * Retrieved the Namespace mapping from the schema element */ bool retrieveNamespaceMapping(const DOMElement* const elem); /** * Loop through the children, and traverse the corresponding schema type * type declaration (simpleType, complexType, import, ....) */ void processChildren(const DOMElement* const root); void preprocessChildren(const DOMElement* const root); void preprocessImport(const DOMElement* const elemNode); void preprocessInclude(const DOMElement* const elemNode); void preprocessRedefine(const DOMElement* const elemNode); /** * Parameters: * rootElem - top element for a given type declaration * contentElem - content must be annotation? or some other simple content * isEmpty: - true if (annotation?, smth_else), false if (annotation?) * processAnnot - default is true, false if reprocessing a complex type * since we have already processed the annotation. * * Check for Annotation if it is present, traverse it. If a sibling is * found and it is not an annotation return it, otherwise return 0. * Used by traverseSimpleTypeDecl. */ DOMElement* checkContent(const DOMElement* const rootElem, DOMElement* const contentElem, const bool isEmpty, bool processAnnot = true); /** * Parameters: * contentElem - content element to check * * Check for identity constraints content. */ const DOMElement* checkIdentityConstraintContent(const DOMElement* const contentElem); DatatypeValidator* getDatatypeValidator(const XMLCh* const uriStr, const XMLCh* const localPartStr); /** * Process simpleType content of a list|restriction|union * Return a dataype validator if valid type, otherwise 0. */ DatatypeValidator* checkForSimpleTypeValidator(const DOMElement* const content, int baseRefContext = SchemaSymbols::XSD_EMPTYSET); /** * Process complexType content of an element * Return a ComplexTypeInfo if valid type, otherwise 0. */ ComplexTypeInfo* checkForComplexTypeInfo(const DOMElement* const content); /** * Return DatatypeValidator available for the baseTypeStr. */ DatatypeValidator* findDTValidator(const DOMElement* const elem, const XMLCh* const derivedTypeName, const XMLCh* const baseTypeName, const int baseRefContext); const XMLCh* resolvePrefixToURI(const DOMElement* const elem, const XMLCh* const prefix); /** * Return the prefix for a given rawname string * * Function allocated, caller managed (facm) - pointer to be deleted by * caller. */ const XMLCh* getPrefix(const XMLCh* const rawName); /** * Return the local for a given rawname string * * caller allocated, caller managed (cacm) */ const XMLCh* getLocalPart(const XMLCh* const rawName); /** * Process a 'ref' of an Element declaration */ SchemaElementDecl* processElementDeclRef(const DOMElement* const elem, const XMLCh* const refName); void processElemDeclAttrs(const DOMElement* const elem, SchemaElementDecl* const elemDecl, const XMLCh*& valConstraint, bool isTopLevel = false); void processElemDeclIC(DOMElement* const elem, SchemaElementDecl* const elemDecl); bool checkElemDeclValueConstraint(const DOMElement* const elem, SchemaElementDecl* const elemDecl, const XMLCh* const valConstraint, ComplexTypeInfo* const typeInfo, DatatypeValidator* const validator); /** * Process a 'ref' of an Attribute declaration */ void processAttributeDeclRef(const DOMElement* const elem, ComplexTypeInfo* const typeInfo, const XMLCh* const refName, const XMLCh* const useVal, const XMLCh* const defaultVal, const XMLCh* const fixedVal); /** * Process a 'ref' on a group */ XercesGroupInfo* processGroupRef(const DOMElement* const elem, const XMLCh* const refName); /** * Process a 'ref' on a attributeGroup */ XercesAttGroupInfo* processAttributeGroupRef(const DOMElement* const elem, const XMLCh* const refName, ComplexTypeInfo* const typeInfo); /** * Parse block & final items */ int parseBlockSet(const DOMElement* const elem, const int blockType, const bool isRoot = false); int parseFinalSet(const DOMElement* const elem, const int finalType, const bool isRoot = false); /** * Return true if a name is an identity constraint, otherwise false */ bool isIdentityConstraintName(const XMLCh* const constraintName); /** * If 'typeStr' belongs to a different schema, return that schema URI, * otherwise return 0; */ const XMLCh* checkTypeFromAnotherSchema(const DOMElement* const elem, const XMLCh* const typeStr); /** * Return the datatype validator for a given element type attribute if * the type is a simple type */ DatatypeValidator* getElementTypeValidator(const DOMElement* const elem, const XMLCh* const typeStr, bool& noErrorDetected, const XMLCh* const otherSchemaURI); /** * Return the complexType info for a given element type attribute if * the type is a complex type */ ComplexTypeInfo* getElementComplexTypeInfo(const DOMElement* const elem, const XMLCh* const typeStr, const XMLCh* const otherSchemaURI); /** * Return global schema element declaration for a given element name */ SchemaElementDecl* getGlobalElemDecl(const DOMElement* const elem, const XMLCh* const name); /** * Check validity constraint of a substitutionGroup attribute in * an element declaration */ bool isSubstitutionGroupValid(const DOMElement* const elem, const SchemaElementDecl* const elemDecl, const ComplexTypeInfo* const typeInfo, const DatatypeValidator* const validator, const XMLCh* const elemName, const bool toEmit = true); bool isSubstitutionGroupCircular(SchemaElementDecl* const elemDecl, SchemaElementDecl* const subsElemDecl); void processSubstitutionGroup(const DOMElement* const elem, SchemaElementDecl* const elemDecl, ComplexTypeInfo*& typeInfo, DatatypeValidator*& validator, const XMLCh* const subsElemQName); /** * Create a 'SchemaElementDecl' object and add it to SchemaGrammar */ SchemaElementDecl* createSchemaElementDecl(const DOMElement* const elem, const XMLCh* const name, bool& isDuplicate, const XMLCh*& valConstraint, const bool topLevel); /** * Return the value of a given attribute name from an element node */ const XMLCh* getElementAttValue(const DOMElement* const elem, const XMLCh* const attName, const DatatypeValidator::ValidatorType attType = DatatypeValidator::UnKnown); /* return minOccurs */ int checkMinMax(ContentSpecNode* const specNode, const DOMElement* const elem, const int allContext = Not_All_Context); /** * Process complex content for a complexType */ void processComplexContent(const DOMElement* const elem, const XMLCh* const typeName, const DOMElement* const childElem, ComplexTypeInfo* const typeInfo, const XMLCh* const baseLocalPart, const bool isMixed, const bool isBaseAnyType = false); /** * Process "base" information for a complexType */ void processBaseTypeInfo(const DOMElement* const elem, const XMLCh* const baseName, const XMLCh* const localPart, const XMLCh* const uriStr, ComplexTypeInfo* const typeInfo); /** * Check if base is from another schema */ bool isBaseFromAnotherSchema(const XMLCh* const baseURI); /** * Get complexType infp from another schema */ ComplexTypeInfo* getTypeInfoFromNS(const DOMElement* const elem, const XMLCh* const uriStr, const XMLCh* const localPart); DatatypeValidator* getAttrDatatypeValidatorNS(const DOMElement* const elem, const XMLCh* localPart, const XMLCh* typeURI); /** * Returns true if a DOM Element is an attribute or attribute group */ bool isAttrOrAttrGroup(const DOMElement* const elem); /** * Process attributes of a complex type */ void processAttributes(const DOMElement* const elem, const DOMElement* const attElem, ComplexTypeInfo* const typeInfo, const bool isBaseAnyType = false); /** * Generate a name for an anonymous type */ const XMLCh* genAnonTypeName(const XMLCh* const prefix); void defaultComplexTypeInfo(ComplexTypeInfo* const typeInfo); /** * Resolve a schema location attribute value to an input source. * Caller to delete the returned object. */ InputSource* resolveSchemaLocation ( const XMLCh* const loc , const XMLResourceIdentifier::ResourceIdentifierType resourceIdentitiferType , const XMLCh* const nameSpace=0 ); void restoreSchemaInfo(SchemaInfo* const toRestore, SchemaInfo::ListType const aListType = SchemaInfo::INCLUDE, const unsigned int saveScope = Grammar::TOP_LEVEL_SCOPE); void popCurrentTypeNameStack(); /** * Check whether a mixed content is emptiable or not. * Needed to validate element constraint values (defualt, fixed) */ bool emptiableParticle(const ContentSpecNode* const specNode); void checkFixedFacet(const DOMElement* const, const XMLCh* const, const DatatypeValidator* const, unsigned int&); void buildValidSubstitutionListF(const DOMElement* const elem, SchemaElementDecl* const, SchemaElementDecl* const); void buildValidSubstitutionListB(const DOMElement* const elem, SchemaElementDecl* const, SchemaElementDecl* const); void checkEnumerationRequiredNotation(const DOMElement* const elem, const XMLCh* const name, const XMLCh* const typeStr); void processElements(const DOMElement* const elem, ComplexTypeInfo* const baseTypeInfo, ComplexTypeInfo* const newTypeInfo); void processElements(const DOMElement* const elem, XercesGroupInfo* const fromGroup, ComplexTypeInfo* const typeInfo); void copyGroupElements(const DOMElement* const elem, XercesGroupInfo* const fromGroup, XercesGroupInfo* const toGroup, ComplexTypeInfo* const typeInfo); void copyAttGroupAttributes(const DOMElement* const elem, XercesAttGroupInfo* const fromAttGroup, XercesAttGroupInfo* const toAttGroup, ComplexTypeInfo* const typeInfo); void checkForEmptyTargetNamespace(const DOMElement* const elem); /** * Attribute wild card intersection. * * Note: * The first parameter will be the result of the intersection, so * we need to make sure that first parameter is a copy of the * actual attribute definition we need to intersect with. * * What we need to wory about is: type, defaultType, namespace, * and URI. All remaining data members should be the same. */ void attWildCardIntersection(SchemaAttDef* const resultWildCart, const SchemaAttDef* const toCompareWildCard); /** * Attribute wild card union. * * Note: * The first parameter will be the result of the union, so * we need to make sure that first parameter is a copy of the * actual attribute definition we need to intersect with. * * What we need to wory about is: type, defaultType, namespace, * and URI. All remaining data members should be the same. */ void attWildCardUnion(SchemaAttDef* const resultWildCart, const SchemaAttDef* const toCompareWildCard); void copyWildCardData(const SchemaAttDef* const srcWildCard, SchemaAttDef* const destWildCard); /** * Check that the attributes of a type derived by restriction satisfy * the constraints of derivation valid restriction */ void checkAttDerivationOK(const DOMElement* const elem, const ComplexTypeInfo* const baseTypeInfo, const ComplexTypeInfo* const childTypeInfo); void checkAttDerivationOK(const DOMElement* const elem, const XercesAttGroupInfo* const baseAttGrpInfo, const XercesAttGroupInfo* const childAttGrpInfo); /** * Check whether a namespace value is valid with respect to wildcard * constraint */ bool wildcardAllowsNamespace(const SchemaAttDef* const baseAttWildCard, const unsigned int nameURI); /** * Check whether a namespace constraint is an intensional subset of * another namespace constraint */ bool isWildCardSubset(const SchemaAttDef* const baseAttWildCard, const SchemaAttDef* const childAttWildCard); bool openRedefinedSchema(const DOMElement* const redefineElem); /** * The purpose of this method is twofold: * 1. To find and appropriately modify all information items * in redefinedSchema with names that are redefined by children of * redefineElem. * 2. To make sure the redefine element represented by * redefineElem is valid as far as content goes and with regard to * properly referencing components to be redefined. * * No traversing is done here! * This method also takes actions to find and, if necessary, modify * the names of elements in 's in the schema that's being * redefined. */ void renameRedefinedComponents(const DOMElement* const redefineElem, SchemaInfo* const redefiningSchemaInfo, SchemaInfo* const redefinedSchemaInfo); /** * This method returns true if the redefine component is valid, and if * it was possible to revise it correctly. */ bool validateRedefineNameChange(const DOMElement* const redefineChildElem, const XMLCh* const redefineChildElemName, const XMLCh* const redefineChildDeclName, const int redefineNameCounter, SchemaInfo* const redefiningSchemaInfo); /** * This function looks among the children of 'redefineChildElem' for a * component of type 'redefineChildComponentName'. If it finds one, it * evaluates whether its ref attribute contains a reference to * 'refChildTypeName'. If it does, it returns 1 + the value returned by * calls to itself on all other children. In all other cases it returns * 0 plus the sum of the values returned by calls to itself on * redefineChildElem's children. It also resets the value of ref so that * it will refer to the renamed type from the schema being redefined. */ int changeRedefineGroup(const DOMElement* const redefineChildElem, const XMLCh* const redefineChildComponentName, const XMLCh* const redefineChildTypeName, const int redefineNameCounter); /** This simple function looks for the first occurrence of a * 'redefineChildTypeName' item in the redefined schema and appropriately * changes the value of its name. If it turns out that what we're looking * for is in a though, then we just rename it--and it's * reference--to be the same. */ void fixRedefinedSchema(const DOMElement* const elem, SchemaInfo* const redefinedSchemaInfo, const XMLCh* const redefineChildComponentName, const XMLCh* const redefineChildTypeName, const int redefineNameCounter); void getRedefineNewTypeName(const XMLCh* const oldTypeName, const int redefineCounter, XMLBuffer& newTypeName); /** * This purpose of this method is threefold: * 1. To extract the schema information of included/redefined schema. * 2. Rename redefined components. * 3. Process components of included/redefined schemas */ void preprocessRedefineInclude(SchemaInfo* const currSchemaInfo); /** * Update the list of valid substitution groups in the case of circular * import. */ void updateCircularSubstitutionList(SchemaInfo* const aSchemaInfo); void processKeyRefFor(SchemaInfo* const aSchemaInfo, ValueVectorOf* const infoList); void processAttValue(const XMLCh* const attVal, XMLBuffer& aBuf); // routine to generate synthetic annotations XSAnnotation* generateSyntheticAnnotation(const DOMElement* const elem , ValueVectorOf* nonXSAttList); // routine to validate annotations void validateAnnotations(); // ----------------------------------------------------------------------- // Private constants // ----------------------------------------------------------------------- enum { ES_Block , C_Block , S_Final , EC_Final , ECS_Final }; enum ExceptionCodes { NoException = 0, InvalidComplexTypeInfo = 1, RecursingElement = 2 }; enum { Elem_Def_Qualified = 1, Attr_Def_Qualified = 2 }; // ----------------------------------------------------------------------- // Private data members // ----------------------------------------------------------------------- bool fFullConstraintChecking; int fTargetNSURI; int fEmptyNamespaceURI; unsigned int fCurrentScope; unsigned int fScopeCount; unsigned int fAnonXSTypeCount; XMLSize_t fCircularCheckIndex; const XMLCh* fTargetNSURIString; DatatypeValidatorFactory* fDatatypeRegistry; GrammarResolver* fGrammarResolver; SchemaGrammar* fSchemaGrammar; XMLEntityHandler* fEntityHandler; XMLErrorReporter* fErrorReporter; XMLStringPool* fURIStringPool; XMLStringPool* fStringPool; XMLBuffer fBuffer; XMLScanner* fScanner; RefHashTableOf* fAttributeDeclRegistry; RefHashTableOf* fComplexTypeRegistry; RefHashTableOf* fGroupRegistry; RefHashTableOf* fAttGroupRegistry; RefHashTableOf* fIC_ElementsNS; RefHashTableOf* fPreprocessedNodes; SchemaInfo* fSchemaInfo; XercesGroupInfo* fCurrentGroupInfo; XercesAttGroupInfo* fCurrentAttGroupInfo; ComplexTypeInfo* fCurrentComplexType; ValueVectorOf* fCurrentTypeNameStack; ValueVectorOf* fCurrentGroupStack; ValueVectorOf* fIC_Elements; ValueVectorOf* fDeclStack; ValueVectorOf** fGlobalDeclarations; ValueVectorOf* fNonXSAttList; ValueVectorOf* fImportedNSList; RefHashTableOf, PtrHasher>* fIC_NodeListNS; RefHash2KeysTableOf* fNotationRegistry; RefHash2KeysTableOf* fRedefineComponents; RefHash2KeysTableOf* fIdentityConstraintNames; RefHash2KeysTableOf* fValidSubstitutionGroups; RefHash2KeysTableOf* fSchemaInfoList; RefHash2KeysTableOf* fCachedSchemaInfoList; XSDDOMParser* fParser; XSDErrorReporter fXSDErrorReporter; XSDLocator* fLocator; MemoryManager* fMemoryManager; MemoryManager* fGrammarPoolMemoryManager; XSAnnotation* fAnnotation; GeneralAttributeCheck fAttributeCheck; friend class GeneralAttributeCheck; friend class NamespaceScopeManager; }; // --------------------------------------------------------------------------- // TraverseSchema: Helper methods // --------------------------------------------------------------------------- inline const XMLCh* TraverseSchema::getPrefix(const XMLCh* const rawName) { int colonIndex = XMLString::indexOf(rawName, chColon); if (colonIndex == -1 || colonIndex == 0) { return XMLUni::fgZeroLenString; } fBuffer.set(rawName, colonIndex); return fStringPool->getValueForId(fStringPool->addOrFind(fBuffer.getRawBuffer())); } inline const XMLCh* TraverseSchema::getLocalPart(const XMLCh* const rawName) { int colonIndex = XMLString::indexOf(rawName, chColon); XMLSize_t rawNameLen = XMLString::stringLen(rawName); if (XMLSize_t(colonIndex + 1) == rawNameLen) { return XMLUni::fgZeroLenString; } if (colonIndex == -1) { fBuffer.set(rawName, rawNameLen); } else { fBuffer.set(rawName + colonIndex + 1, rawNameLen - colonIndex - 1); } return fStringPool->getValueForId(fStringPool->addOrFind(fBuffer.getRawBuffer())); } inline void TraverseSchema::checkForEmptyTargetNamespace(const DOMElement* const elem) { const XMLCh* targetNS = getElementAttValue(elem, SchemaSymbols::fgATT_TARGETNAMESPACE); if (targetNS && !*targetNS) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidTargetNSValue); } } inline bool TraverseSchema::isBaseFromAnotherSchema(const XMLCh* const baseURI) { if (!XMLString::equals(baseURI,fTargetNSURIString) && !XMLString::equals(baseURI, SchemaSymbols::fgURI_SCHEMAFORSCHEMA) && (baseURI && *baseURI)) { //REVISIT, !!!! a hack: for schema that has no //target namespace, e.g. personal-schema.xml return true; } return false; } inline bool TraverseSchema::isAttrOrAttrGroup(const DOMElement* const elem) { const XMLCh* elementName = elem->getLocalName(); if (XMLString::equals(elementName, SchemaSymbols::fgELT_ATTRIBUTE) || XMLString::equals(elementName, SchemaSymbols::fgELT_ATTRIBUTEGROUP) || XMLString::equals(elementName, SchemaSymbols::fgELT_ANYATTRIBUTE)) { return true; } return false; } inline const XMLCh* TraverseSchema::genAnonTypeName(const XMLCh* const prefix) { XMLCh anonCountStr[16]; // a count of 15 digits should be enough XMLString::sizeToText(fAnonXSTypeCount++, anonCountStr, 15, 10, fMemoryManager); fBuffer.set(prefix); fBuffer.append(anonCountStr); return fStringPool->getValueForId(fStringPool->addOrFind(fBuffer.getRawBuffer())); } inline void TraverseSchema::popCurrentTypeNameStack() { XMLSize_t stackSize = fCurrentTypeNameStack->size(); if (stackSize != 0) { fCurrentTypeNameStack->removeElementAt(stackSize - 1); } } inline void TraverseSchema::copyWildCardData(const SchemaAttDef* const srcWildCard, SchemaAttDef* const destWildCard) { destWildCard->getAttName()->setURI(srcWildCard->getAttName()->getURI()); destWildCard->setType(srcWildCard->getType()); destWildCard->setDefaultType(srcWildCard->getDefaultType()); } inline void TraverseSchema::getRedefineNewTypeName(const XMLCh* const oldTypeName, const int redefineCounter, XMLBuffer& newTypeName) { newTypeName.set(oldTypeName); for (int i=0; i < redefineCounter; i++) { newTypeName.append(SchemaSymbols::fgRedefIdentifier); } } inline bool TraverseSchema::isImportingNS(const int namespaceURI) { if (!fImportedNSList) return false; return (fImportedNSList->containsElement(namespaceURI)); } inline void TraverseSchema::addImportedNS(const int namespaceURI) { if (!fImportedNSList) { fImportedNSList = new (fMemoryManager) ValueVectorOf(4, fMemoryManager); } if (!fImportedNSList->containsElement(namespaceURI)) fImportedNSList->addElement(namespaceURI); } XERCES_CPP_NAMESPACE_END #endif /** * End of file TraverseSchema.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/SchemaElementDecl.cpp000644 000765 000024 00000020017 13241160332 025677 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SchemaElementDecl.cpp 609971 2008-01-08 13:30:47Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // SchemaElementDecl: Constructors and Destructor // --------------------------------------------------------------------------- SchemaElementDecl::SchemaElementDecl(MemoryManager* const manager) : XMLElementDecl(manager) , fModelType(Any) , fPSVIScope(PSVIDefs::SCP_ABSENT) , fEnclosingScope(Grammar::TOP_LEVEL_SCOPE) , fFinalSet(0) , fBlockSet(0) , fMiscFlags(0) , fDefaultValue(0) , fComplexTypeInfo(0) , fAttDefs(0) , fIdentityConstraints(0) , fAttWildCard(0) , fSubstitutionGroupElem(0) , fDatatypeValidator(0) { } SchemaElementDecl::SchemaElementDecl(const XMLCh* const prefix , const XMLCh* const localPart , const int uriId , const SchemaElementDecl::ModelTypes type , const unsigned int enclosingScope , MemoryManager* const manager) : XMLElementDecl(manager) , fModelType(type) , fPSVIScope(PSVIDefs::SCP_ABSENT) , fEnclosingScope(enclosingScope) , fFinalSet(0) , fBlockSet(0) , fMiscFlags(0) , fDefaultValue(0) , fComplexTypeInfo(0) , fAttDefs(0) , fIdentityConstraints(0) , fAttWildCard(0) , fSubstitutionGroupElem(0) , fDatatypeValidator(0) { setElementName(prefix, localPart, uriId); } SchemaElementDecl::SchemaElementDecl(const QName* const elementName , const SchemaElementDecl::ModelTypes type , const unsigned int enclosingScope , MemoryManager* const manager) : XMLElementDecl(manager) , fModelType(type) , fPSVIScope(PSVIDefs::SCP_ABSENT) , fEnclosingScope(enclosingScope) , fFinalSet(0) , fBlockSet(0) , fMiscFlags(0) , fDefaultValue(0) , fComplexTypeInfo(0) , fAttDefs(0) , fIdentityConstraints(0) , fAttWildCard(0) , fSubstitutionGroupElem(0) , fDatatypeValidator(0) { setElementName(elementName); } SchemaElementDecl::~SchemaElementDecl() { getMemoryManager()->deallocate(fDefaultValue);//delete [] fDefaultValue; delete fAttDefs; delete fIdentityConstraints; delete fAttWildCard; } // --------------------------------------------------------------------------- // SchemaElementDecl: XMLElementDecl virtual interface implementation // --------------------------------------------------------------------------- XMLAttDefList& SchemaElementDecl::getAttDefList() const { if (!fComplexTypeInfo) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::DV_InvalidOperation, getMemoryManager()); } return fComplexTypeInfo->getAttDefList(); } XMLElementDecl::CharDataOpts SchemaElementDecl::getCharDataOpts() const { SchemaElementDecl::ModelTypes modelType = fModelType; if (fComplexTypeInfo) { modelType = (SchemaElementDecl::ModelTypes) fComplexTypeInfo->getContentType(); } XMLElementDecl::CharDataOpts retVal; switch(modelType) { case Children : case ElementOnlyEmpty : retVal = XMLElementDecl::SpacesOk; break; case Empty : retVal = XMLElementDecl::NoCharData; break; default : retVal = XMLElementDecl::AllCharData; break; } return retVal; } bool SchemaElementDecl::hasAttDefs() const { if (fComplexTypeInfo) { return fComplexTypeInfo->hasAttDefs(); } // If the collection hasn't been faulted in, then no att defs return false; } const XMLCh* SchemaElementDecl::getFormattedContentModel() const { if (fComplexTypeInfo) { return fComplexTypeInfo->getFormattedContentModel(); } return 0; } // --------------------------------------------------------------------------- // SchemaElementDecl: Getter methods // --------------------------------------------------------------------------- const SchemaAttDef* SchemaElementDecl::getAttDef(const XMLCh* const baseName, const int uriId) const { if (fComplexTypeInfo) { return fComplexTypeInfo->getAttDef(baseName, uriId); } // If no complex type, then return a null return 0; } SchemaAttDef* SchemaElementDecl::getAttDef(const XMLCh* const baseName, const int uriId) { if (fComplexTypeInfo) { return fComplexTypeInfo->getAttDef(baseName, uriId); } // If no complex type, then return a null return 0; } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(SchemaElementDecl) void SchemaElementDecl::serialize(XSerializeEngine& serEng) { XMLElementDecl::serialize(serEng); if (serEng.isStoring()) { serEng<<(int)fModelType; serEng<<(int)fPSVIScope; serEng<* fAttDefs; ***/ XTemplateSerializer::storeObject(fAttDefs, serEng); /*** * Serialize RefVectorOf* fIdentityConstraints; ***/ XTemplateSerializer::storeObject(fIdentityConstraints, serEng); serEng<>i; fModelType = (ModelTypes)i; serEng>>i; fPSVIScope = (PSVIDefs::PSVIScope)i; serEng>>fEnclosingScope; serEng>>fFinalSet; serEng>>fBlockSet; serEng>>fMiscFlags; serEng.readString(fDefaultValue); serEng>>fComplexTypeInfo; /*** * DeSerialize RefHash2KeysTableOf* fAttDefs; ***/ XTemplateSerializer::loadObject(&fAttDefs, 29, true, serEng); /*** * DeSerialize RefVectorOf* fIdentityConstraints; ***/ XTemplateSerializer::loadObject(&fIdentityConstraints, 16, true, serEng); serEng>>fAttWildCard; serEng>>fSubstitutionGroupElem; fDatatypeValidator = DatatypeValidator::loadDV(serEng); } } XMLElementDecl::objectType SchemaElementDecl::getObjectType() const { return Schema; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/schema/SchemaGrammar.cpp000644 000765 000024 00000027400 13241160332 025107 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SchemaGrammar.cpp 924841 2010-03-18 14:57:13Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN typedef JanitorMemFunCall CleanupType; // --------------------------------------------------------------------------- // SchemaGrammar: Constructors and Destructor // --------------------------------------------------------------------------- SchemaGrammar::SchemaGrammar(MemoryManager* const manager) : fTargetNamespace(0) , fElemDeclPool(0) , fElemNonDeclPool(0) , fGroupElemDeclPool(0) , fNotationDeclPool(0) , fAttributeDeclRegistry(0) , fComplexTypeRegistry(0) , fGroupInfoRegistry(0) , fAttGroupInfoRegistry(0) , fValidSubstitutionGroups(0) , fMemoryManager(manager) , fGramDesc(0) , fAnnotations(0) , fValidated(false) , fDatatypeRegistry(manager) , fScopeCount (0) , fAnonTypeCount (0) { CleanupType cleanup(this, &SchemaGrammar::cleanUp); // // Init all the pool members. // // Investigate what the optimum values would be for the various // pools. // fElemDeclPool = new (fMemoryManager) RefHash3KeysIdPool(109, true, 128, fMemoryManager); try { // should not be necessary now that grammars, once built, // are read-only // fElemNonDeclPool = new (fMemoryManager) RefHash3KeysIdPool(29, true, 128, fMemoryManager); fGroupElemDeclPool = new (fMemoryManager) RefHash3KeysIdPool(109, false, 128, fMemoryManager); fNotationDeclPool = new (fMemoryManager) NameIdPool(109, 128, fMemoryManager); //REVISIT: use grammarPool to create fGramDesc = new (fMemoryManager) XMLSchemaDescriptionImpl(XMLUni::fgXMLNSURIName, fMemoryManager); // Create annotation table fAnnotations = new (fMemoryManager) RefHashTableOf ( 29, true, fMemoryManager ); // // Call our own reset method. This lets us have the pool setup stuff // done in just one place (because this stame setup stuff has to be // done every time we are reset.) // reset(); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } SchemaGrammar::~SchemaGrammar() { cleanUp(); } // ----------------------------------------------------------------------- // Virtual methods // ----------------------------------------------------------------------- XMLElementDecl* SchemaGrammar::findOrAddElemDecl (const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const prefixName , const XMLCh* const qName , unsigned int scope , bool& wasAdded ) { // See it it exists SchemaElementDecl* retVal = (SchemaElementDecl*) getElemDecl(uriId, baseName, qName, scope); // if not, then add this in if (!retVal) { retVal = new (fMemoryManager) SchemaElementDecl ( prefixName , baseName , uriId , SchemaElementDecl::Any , Grammar::TOP_LEVEL_SCOPE , fMemoryManager ); if(!fElemNonDeclPool) fElemNonDeclPool = new (fMemoryManager) RefHash3KeysIdPool(29, true, 128, fMemoryManager); const XMLSize_t elemId = fElemNonDeclPool->put((void*)retVal->getBaseName(), uriId, scope, retVal); retVal->setId(elemId); wasAdded = true; } else { wasAdded = false; } return retVal; } XMLElementDecl* SchemaGrammar::putElemDecl (const unsigned int uriId , const XMLCh* const baseName , const XMLCh* const prefixName , const XMLCh* const , unsigned int scope , const bool notDeclared) { SchemaElementDecl* retVal = new (fMemoryManager) SchemaElementDecl ( prefixName , baseName , uriId , SchemaElementDecl::Any , Grammar::TOP_LEVEL_SCOPE , fMemoryManager ); if(notDeclared) { if(!fElemNonDeclPool) fElemNonDeclPool = new (fMemoryManager) RefHash3KeysIdPool(29, true, 128, fMemoryManager); retVal->setId(fElemNonDeclPool->put((void*)retVal->getBaseName(), uriId, scope, retVal)); } else { retVal->setId(fElemDeclPool->put((void*)retVal->getBaseName(), uriId, scope, retVal)); } return retVal; } void SchemaGrammar::reset() { // // We need to reset all of the pools. // fElemDeclPool->removeAll(); if(fElemNonDeclPool) fElemNonDeclPool->removeAll(); fGroupElemDeclPool->removeAll(); fNotationDeclPool->removeAll(); fAnnotations->removeAll(); fValidated = false; } void SchemaGrammar::cleanUp() { delete fElemDeclPool; if(fElemNonDeclPool) delete fElemNonDeclPool; delete fGroupElemDeclPool; delete fNotationDeclPool; fMemoryManager->deallocate(fTargetNamespace);//delete [] fTargetNamespace; delete fAttributeDeclRegistry; delete fComplexTypeRegistry; delete fGroupInfoRegistry; delete fAttGroupInfoRegistry; delete fValidSubstitutionGroups; delete fGramDesc; delete fAnnotations; } void SchemaGrammar::setGrammarDescription(XMLGrammarDescription* gramDesc) { if ((!gramDesc) || (gramDesc->getGrammarType() != Grammar::SchemaGrammarType)) return; if (fGramDesc) delete fGramDesc; //adopt the grammar Description fGramDesc = (XMLSchemaDescription*) gramDesc; } // --------------------------------------------------------------------------- // SchemaGrammar: Helper methods // --------------------------------------------------------------------------- void SchemaGrammar::putAnnotation(void* key, XSAnnotation* const annotation) { fAnnotations->put(key, annotation); } void SchemaGrammar::addAnnotation(XSAnnotation* const annotation) { XSAnnotation* lAnnot = fAnnotations->get(this); if (lAnnot) lAnnot->setNext(annotation); else fAnnotations->put(this, annotation); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(SchemaGrammar) void SchemaGrammar::serialize(XSerializeEngine& serEng) { /*** * don't serialize fElemNonDeclPool ***/ Grammar::serialize(serEng); if (serEng.isStoring()) { //serialize DatatypeValidatorFactory first fDatatypeRegistry.serialize(serEng); /*** * * Serialize RefHash3KeysIdPool* fElemDeclPool; * Serialize RefHash3KeysIdPool* fGroupElemDeclPool; * ***/ XTemplateSerializer::storeObject(fElemDeclPool, serEng); XTemplateSerializer::storeObject(fGroupElemDeclPool, serEng); /*** * Serialize NameIdPool* fNotationDeclPool; ***/ XTemplateSerializer::storeObject(fNotationDeclPool, serEng); /*** * * Serialize RefHashTableOf* fAttributeDeclRegistry; * Serialize RefHashTableOf* fComplexTypeRegistry; * Serialize RefHashTableOf* fGroupInfoRegistry; * Serialize RefHashTableOf* fAttGroupInfoRegistry; * Serialize RefHashTableOf* fIDRefList; * ***/ XTemplateSerializer::storeObject(fAttributeDeclRegistry, serEng); XTemplateSerializer::storeObject(fComplexTypeRegistry, serEng); XTemplateSerializer::storeObject(fGroupInfoRegistry, serEng); XTemplateSerializer::storeObject(fAttGroupInfoRegistry, serEng); /*** * Serialize RefHash2KeysTableOf* fValidSubstitutionGroups; ***/ XTemplateSerializer::storeObject(fValidSubstitutionGroups, serEng); /*** * Serialize RefHashTableOf* fAnnotations; ***/ XTemplateSerializer::storeObject(fAnnotations, serEng); serEng.writeString(fTargetNamespace); serEng<serialize(serEng); } else { fDatatypeRegistry.serialize(serEng); /*** * * Deserialize RefHash3KeysIdPool* fElemDeclPool; * Deserialize RefHash3KeysIdPool* fGroupElemDeclPool; * ***/ XTemplateSerializer::loadObject(&fElemDeclPool, 109, true, 128, serEng); XTemplateSerializer::loadObject(&fGroupElemDeclPool, 109, true, 128, serEng); /*** * Deserialize NameIdPool* fNotationDeclPool; ***/ XTemplateSerializer::loadObject(&fNotationDeclPool, 109, 128, serEng); /*** * * Deserialize RefHashTableOf* fAttributeDeclRegistry; * Deserialize RefHashTableOf* fComplexTypeRegistry; * Deserialize RefHashTableOf* fGroupInfoRegistry; * Deserialize RefHashTableOf* fAttGroupInfoRegistry; * Deserialize RefHashTableOf* fIDRefList; * ***/ XTemplateSerializer::loadObject(&fAttributeDeclRegistry, 29, true, serEng); XTemplateSerializer::loadObject(&fComplexTypeRegistry, 29, true, serEng); XTemplateSerializer::loadObject(&fGroupInfoRegistry, 13, true, serEng); XTemplateSerializer::loadObject(&fAttGroupInfoRegistry, 13, true, serEng); /*** * Deserialize RefHash2KeysTableOf* fValidSubstitutionGroups; ***/ XTemplateSerializer::loadObject(&fValidSubstitutionGroups, 29, true, serEng); /*** * Deserialize RefHashTableOf* fAnnotations; ***/ XTemplateSerializer::loadObject(&fAnnotations, 29, true, serEng); serEng.readString(fTargetNamespace); serEng>>fValidated; /*** * serialize() method shall be used to load object * which has been created in ctor ***/ fGramDesc->serialize(serEng); } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/schema/SchemaAttDefList.cpp000644 000765 000024 00000013542 13241160332 025526 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SchemaAttDefList.cpp 679359 2008-07-24 11:15:19Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // SchemaAttDefList: Constructors and Destructor // --------------------------------------------------------------------------- SchemaAttDefList::SchemaAttDefList(RefHash2KeysTableOf* const listToUse, MemoryManager* const manager) : XMLAttDefList(manager) ,fEnum(0) ,fList(listToUse) ,fArray(0) ,fSize(0) ,fCount(0) { fEnum = new (getMemoryManager()) RefHash2KeysTableOfEnumerator(listToUse, false, getMemoryManager()); fArray = (SchemaAttDef **)((getMemoryManager())->allocate( sizeof(SchemaAttDef*) << 1)); fSize = 2; } SchemaAttDefList::~SchemaAttDefList() { delete fEnum; (getMemoryManager())->deallocate(fArray); } // --------------------------------------------------------------------------- // SchemaAttDefList: Implementation of the virtual interface // --------------------------------------------------------------------------- bool SchemaAttDefList::isEmpty() const { return fList->isEmpty(); } XMLAttDef* SchemaAttDefList::findAttDef(const unsigned int uriID , const XMLCh* const attName) { const int colonInd = XMLString::indexOf(attName, chColon); // An index of 0 is really an error, but the QName class doesn't check for // that case either... const XMLCh* const localPart = colonInd >= 0 ? attName + colonInd + 1 : attName; return fList->get((void*)localPart, uriID); } const XMLAttDef* SchemaAttDefList::findAttDef( const unsigned int uriID , const XMLCh* const attName) const { const int colonInd = XMLString::indexOf(attName, chColon); // An index of 0 is really an error, but the QName class doesn't check for // that case either... const XMLCh* const localPart = colonInd >= 0 ? attName + colonInd + 1 : attName; return fList->get((void*)localPart, uriID); } XMLAttDef* SchemaAttDefList::findAttDef( const XMLCh* const , const XMLCh* const) { //need numeric URI id to locate the attribute, that's how it was stored ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Pool_InvalidId, getMemoryManager()); return 0; } const XMLAttDef* SchemaAttDefList::findAttDef( const XMLCh* const , const XMLCh* const) const { //need numeric URI id to locate the attribute, that's how it was stored ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Pool_InvalidId, getMemoryManager()); return 0; } /** * return total number of attributes in this list */ XMLSize_t SchemaAttDefList::getAttDefCount() const { return fCount; } /** * return attribute at the index-th position in the list. */ XMLAttDef &SchemaAttDefList::getAttDef(XMLSize_t index) { if(index >= fCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::AttrList_BadIndex, getMemoryManager()); return *(fArray[index]); } /** * return attribute at the index-th position in the list. */ const XMLAttDef &SchemaAttDefList::getAttDef(XMLSize_t index) const { if(index >= fCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::AttrList_BadIndex, getMemoryManager()); return *(fArray[index]); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(SchemaAttDefList) void SchemaAttDefList::serialize(XSerializeEngine& serEng) { XMLAttDefList::serialize(serEng); if (serEng.isStoring()) { /*** * * Serialize RefHash2KeysTableOf * ***/ XTemplateSerializer::storeObject(fList, serEng); serEng.writeSize (fCount); // do not serialize fEnum } else { /*** * * Deserialize RefHash2KeysTableOf * ***/ XTemplateSerializer::loadObject(&fList, 29, true, serEng); // assume empty so we can size fArray just right serEng.readSize (fSize); if (!fEnum && fList) { fEnum = new (getMemoryManager()) RefHash2KeysTableOfEnumerator(fList, false, getMemoryManager()); } if(fSize) { (getMemoryManager())->deallocate(fArray); fArray = (SchemaAttDef **)((getMemoryManager())->allocate( sizeof(SchemaAttDef*) * fSize)); fCount = 0; while(fEnum->hasMoreElements()) { fArray[fCount++] = &fEnum->nextElement(); } } } } SchemaAttDefList::SchemaAttDefList(MemoryManager* const manager) : XMLAttDefList(manager) ,fEnum(0) ,fList(0) ,fArray(0) ,fSize(0) ,fCount(0) { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/schema/XercesElementWildcard.hpp000644 000765 000024 00000006223 13241160332 026622 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XercesElementWildcard.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XERCESELEMENTWILDCARD_HPP) #define XERCESC_INCLUDE_GUARD_XERCESELEMENTWILDCARD_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Forward declarations // --------------------------------------------------------------------------- class SchemaGrammar; class VALIDATORS_EXPORT XercesElementWildcard { public : // ----------------------------------------------------------------------- // Class static methods // ----------------------------------------------------------------------- /* * check whether two elements are in conflict */ static bool conflict(SchemaGrammar* const pGrammar, ContentSpecNode::NodeTypes type1, QName* q1, ContentSpecNode::NodeTypes type2, QName* q2, SubstitutionGroupComparator* comparator); private: // ----------------------------------------------------------------------- // private helper methods // ----------------------------------------------------------------------- static bool uriInWildcard(SchemaGrammar* const pGrammar, QName* qname, unsigned int wildcard, ContentSpecNode::NodeTypes wtype, SubstitutionGroupComparator* comparator); static bool wildcardIntersect(ContentSpecNode::NodeTypes t1, unsigned int w1, ContentSpecNode::NodeTypes t2, unsigned int w2); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XercesElementWildcard(); ~XercesElementWildcard(); }; XERCES_CPP_NAMESPACE_END #endif // XERCESELEMENTWILDCARD_HPP xerces-c-3.2.2/src/xercesc/validators/schema/XMLSchemaDescriptionImpl.cpp000644 000765 000024 00000014520 13241160332 027206 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLSchemaDescriptionImpl.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLSchemaDescriptionImpl: constructor and destructor // --------------------------------------------------------------------------- XMLSchemaDescriptionImpl::XMLSchemaDescriptionImpl(const XMLCh* const targetNamespace , MemoryManager* const memMgr) :XMLSchemaDescription(memMgr) ,fContextType(CONTEXT_UNKNOWN) ,fNamespace(0) ,fLocationHints(0) ,fTriggeringComponent(0) ,fEnclosingElementName(0) ,fAttributes(0) { if (targetNamespace) fNamespace = XMLString::replicate(targetNamespace, memMgr); fLocationHints = new (memMgr) RefArrayVectorOf(4, true, memMgr); /*** fAttributes ***/ } XMLSchemaDescriptionImpl::~XMLSchemaDescriptionImpl() { if (fNamespace) XMLGrammarDescription::getMemoryManager()->deallocate((void*)fNamespace); if (fLocationHints) delete fLocationHints; if (fTriggeringComponent) delete fTriggeringComponent; if (fEnclosingElementName) delete fEnclosingElementName; } const XMLCh* XMLSchemaDescriptionImpl::getGrammarKey() const { return getTargetNamespace(); } XMLSchemaDescription::ContextType XMLSchemaDescriptionImpl::getContextType() const { return fContextType; } const XMLCh* XMLSchemaDescriptionImpl::getTargetNamespace() const { return fNamespace; } const RefArrayVectorOf* XMLSchemaDescriptionImpl::getLocationHints() const { return fLocationHints; } const QName* XMLSchemaDescriptionImpl::getTriggeringComponent() const { return fTriggeringComponent; } const QName* XMLSchemaDescriptionImpl::getEnclosingElementName() const { return fEnclosingElementName; } const XMLAttDef* XMLSchemaDescriptionImpl::getAttributes() const { return fAttributes; } void XMLSchemaDescriptionImpl::setContextType(ContextType type) { fContextType = type; } void XMLSchemaDescriptionImpl::setTargetNamespace(const XMLCh* const newNamespace) { if (fNamespace) { XMLGrammarDescription::getMemoryManager()->deallocate((void*)fNamespace); fNamespace = 0; } fNamespace = XMLString::replicate(newNamespace, XMLGrammarDescription::getMemoryManager()); } void XMLSchemaDescriptionImpl::setLocationHints(const XMLCh* const hint) { fLocationHints->addElement(XMLString::replicate(hint, XMLGrammarDescription::getMemoryManager())); } void XMLSchemaDescriptionImpl::setTriggeringComponent(QName* const trigComponent) { if ( fTriggeringComponent) { delete fTriggeringComponent; fTriggeringComponent = 0; } fTriggeringComponent = new (trigComponent->getMemoryManager()) QName(*trigComponent); } void XMLSchemaDescriptionImpl::setEnclosingElementName(QName* const encElement) { if (fEnclosingElementName) { delete fEnclosingElementName; fEnclosingElementName = 0; } fEnclosingElementName = new (encElement->getMemoryManager()) QName(*encElement); } void XMLSchemaDescriptionImpl::setAttributes(XMLAttDef* const attDefs) { // XMLAttDef is part of the grammar that this description refers to // so we reference to it instead of adopting/owning/cloning. fAttributes = attDefs; } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(XMLSchemaDescriptionImpl) void XMLSchemaDescriptionImpl::serialize(XSerializeEngine& serEng) { XMLSchemaDescription::serialize(serEng); if (serEng.isStoring()) { serEng<<(int)fContextType; serEng.writeString(fNamespace); /*** * * Serialize RefArrayVectorOf* fLocationHints; * ***/ XTemplateSerializer::storeObject(fLocationHints, serEng); QName* tempQName = (QName*)fTriggeringComponent; serEng<>i; fContextType = (ContextType)i; //the original fNamespace which came from the ctor needs deallocated if (fNamespace) { XMLGrammarDescription::getMemoryManager()->deallocate((void*)fNamespace); } serEng.readString((XMLCh*&)fNamespace); /*** * * Deserialize RefArrayVectorOf fLocationHints * ***/ XTemplateSerializer::loadObject(&fLocationHints, 4, true, serEng); QName* tempQName; serEng>>tempQName; fTriggeringComponent = tempQName; serEng>>tempQName; fEnclosingElementName = tempQName; XMLAttDef* tempAttDef; serEng>>tempAttDef; fAttributes=tempAttDef; } } XMLSchemaDescriptionImpl::XMLSchemaDescriptionImpl(MemoryManager* const memMgr) :XMLSchemaDescription(memMgr) ,fContextType(CONTEXT_UNKNOWN) ,fNamespace(0) ,fLocationHints(0) ,fTriggeringComponent(0) ,fEnclosingElementName(0) ,fAttributes(0) { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/schema/XercesGroupInfo.cpp000644 000765 000024 00000007563 13241160332 025472 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XercesGroupInfo.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XercesGroupInfo: Constructors and Destructor // --------------------------------------------------------------------------- XercesGroupInfo::XercesGroupInfo(MemoryManager* const manager) : fCheckElementConsistency(true) , fScope(Grammar::TOP_LEVEL_SCOPE) , fNameId(0) , fNamespaceId(0) , fContentSpec(0) , fElements(0) , fBaseGroup(0) , fLocator(0) { fElements = new (manager) RefVectorOf(4, false, manager); } XercesGroupInfo::XercesGroupInfo(unsigned int groupNameId, unsigned int groupNamespaceId, MemoryManager* const manager) : fCheckElementConsistency(true) , fScope(Grammar::TOP_LEVEL_SCOPE) , fNameId(groupNameId) , fNamespaceId(groupNamespaceId) , fContentSpec(0) , fElements(0) , fBaseGroup(0) , fLocator(0) { fElements = new (manager) RefVectorOf(4, false, manager); } XercesGroupInfo::~XercesGroupInfo() { delete fElements; delete fContentSpec; delete fLocator; } // --------------------------------------------------------------------------- // XercesGroupInfo: Constructors and Destructor // --------------------------------------------------------------------------- void XercesGroupInfo::setLocator(XSDLocator* const aLocator) { if (fLocator) delete fLocator; fLocator = aLocator; } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(XercesGroupInfo) void XercesGroupInfo::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng<* fElements; * ***/ XTemplateSerializer::storeObject(fElements, serEng); serEng<>fCheckElementConsistency; serEng>>fScope; serEng>>fNameId; serEng>>fNamespaceId; serEng>>fContentSpec; /*** * * Deserialize RefVectorOf* fElements; * ***/ XTemplateSerializer::loadObject(&fElements, 4, false, serEng); serEng>>fBaseGroup; //don't serialize XSDLocator* fLocator; fLocator = 0; } } XERCES_CPP_NAMESPACE_END /** * End of file XercesGroupInfo.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/SchemaInfo.hpp000644 000765 000024 00000035252 13241160332 024425 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SchemaInfo.hpp 924841 2010-03-18 14:57:13Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_SCHEMAINFO_HPP) #define XERCESC_INCLUDE_GUARD_SCHEMAINFO_HPP /** When in a , type definitions being used (and indeed * refs to 's and 's) may refer to info * items either in the schema being redefined, in the , * or else in the schema doing the redefining. Because of this * latter we have to be prepared sometimes to look for our type * definitions outside the schema stored in fSchemaRootElement. * This simple class does this; it's just a linked list that * lets us look at the 's on the queue; note also that this * should provide us with a mechanism to handle nested 's. * It's also a handy way of saving schema info when importing/including. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Forward Declarations // --------------------------------------------------------------------------- class XMLScanner; class ValidationContext; class NamespaceScope; class VALIDATORS_EXPORT SchemaInfo : public XMemory { public: enum ListType { // Redefine is treated as an include IMPORT = 1, INCLUDE = 2 }; enum { C_ComplexType, C_SimpleType, C_Group, C_Attribute, C_AttributeGroup, C_Element, C_Notation, C_Count }; // ----------------------------------------------------------------------- // Constructor/Destructor // ----------------------------------------------------------------------- SchemaInfo(const unsigned short fElemAttrDefaultQualified, const int blockDefault, const int finalDefault, const int targetNSURI, const NamespaceScope* const currNamespaceScope, const XMLCh* const schemaURL, const XMLCh* const targetNSURIString, const DOMElement* const root, XMLScanner* xmlScanner, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~SchemaInfo(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- XMLCh* getCurrentSchemaURL() const; const XMLCh* getTargetNSURIString() const; const DOMElement* getRoot() const; bool getProcessed() const; int getBlockDefault() const; int getFinalDefault() const; int getTargetNSURI() const; NamespaceScope* getNamespaceScope() const; unsigned short getElemAttrDefaultQualified() const; BaseRefVectorEnumerator getImportingListEnumerator() const; ValueVectorOf* getRecursingAnonTypes() const; ValueVectorOf* getRecursingTypeNames() const; ValueVectorOf* getNonXSAttList() const; ValidationContext* getValidationContext() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setProcessed(const bool aValue = true); void setBlockDefault(const int aValue); void setFinalDefault(const int aValue); void setElemAttrDefaultQualified(const unsigned short aValue); void resetRoot (); // ----------------------------------------------------------------------- // Access methods // ----------------------------------------------------------------------- void addSchemaInfo(SchemaInfo* const toAdd, const ListType aListType); bool containsInfo(const SchemaInfo* const toCheck, const ListType aListType) const; SchemaInfo* getImportInfo(const unsigned int namespaceURI) const; DOMElement* getTopLevelComponent(const unsigned short compCategory, const XMLCh* const compName, const XMLCh* const name); DOMElement* getTopLevelComponent(const unsigned short compCategory, const XMLCh* const compName, const XMLCh* const name, SchemaInfo** enclosingSchema); void updateImportingInfo(SchemaInfo* const importingInfo); bool circularImportExist(const unsigned int nameSpaceURI); bool isFailedRedefine(const DOMElement* const anElem); void addFailedRedefine(const DOMElement* const anElem); void addRecursingType(const DOMElement* const elem, const XMLCh* const name); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- SchemaInfo(const SchemaInfo&); SchemaInfo& operator=(const SchemaInfo&); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void clearTopLevelComponents(); // ----------------------------------------------------------------------- // Private data members // ----------------------------------------------------------------------- bool fAdoptInclude; bool fProcessed; unsigned short fElemAttrDefaultQualified; int fBlockDefault; int fFinalDefault; int fTargetNSURI; NamespaceScope* fNamespaceScope; XMLCh* fCurrentSchemaURL; XMLCh* fTargetNSURIString; const DOMElement* fSchemaRootElement; RefVectorOf* fIncludeInfoList; RefVectorOf* fImportedInfoList; RefVectorOf* fImportingInfoList; ValueVectorOf* fFailedRedefineList; ValueVectorOf* fRecursingAnonTypes; ValueVectorOf* fRecursingTypeNames; RefHashTableOf* fTopLevelComponents[C_Count]; DOMElement* fLastTopLevelComponent[C_Count]; ValueVectorOf* fNonXSAttList; ValidationContext* fValidationContext; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // SchemaInfo: Getter methods // --------------------------------------------------------------------------- inline unsigned short SchemaInfo::getElemAttrDefaultQualified() const { return fElemAttrDefaultQualified; } inline bool SchemaInfo::getProcessed() const { return fProcessed; } inline int SchemaInfo::getBlockDefault() const { return fBlockDefault; } inline int SchemaInfo::getFinalDefault() const { return fFinalDefault; } inline NamespaceScope* SchemaInfo::getNamespaceScope() const { return fNamespaceScope; } inline XMLCh* SchemaInfo::getCurrentSchemaURL() const { return fCurrentSchemaURL; } inline const XMLCh* SchemaInfo::getTargetNSURIString() const { return fTargetNSURIString; } inline const DOMElement* SchemaInfo::getRoot() const { return fSchemaRootElement; } inline int SchemaInfo::getTargetNSURI() const { return fTargetNSURI; } inline BaseRefVectorEnumerator SchemaInfo::getImportingListEnumerator() const { return BaseRefVectorEnumerator(fImportingInfoList); } inline ValueVectorOf* SchemaInfo::getRecursingAnonTypes() const { return fRecursingAnonTypes; } inline ValueVectorOf* SchemaInfo::getRecursingTypeNames() const { return fRecursingTypeNames; } inline ValueVectorOf* SchemaInfo::getNonXSAttList() const { return fNonXSAttList; } // --------------------------------------------------------------------------- // Setter methods // --------------------------------------------------------------------------- inline void SchemaInfo::setBlockDefault(const int aValue) { fBlockDefault = aValue; } inline void SchemaInfo::setFinalDefault(const int aValue) { fFinalDefault = aValue; } inline void SchemaInfo::setElemAttrDefaultQualified(const unsigned short aValue) { fElemAttrDefaultQualified = aValue; } inline void SchemaInfo::setProcessed(const bool aValue) { fProcessed = aValue; /* if (fProcessed && fIncludeInfoList) { unsigned int includeListLen = fIncludeInfoList->size()); for (unsigned int i = 0; i < includeListLen; i++) { fIncludeInfoList->elementAt(i)->clearTopLevelComponents(); } }*/ } inline void SchemaInfo::resetRoot () { fSchemaRootElement = 0; } // --------------------------------------------------------------------------- // SchemaInfo: Access methods // --------------------------------------------------------------------------- inline void SchemaInfo::addSchemaInfo(SchemaInfo* const toAdd, const ListType aListType) { if (aListType == IMPORT) { if (!fImportedInfoList) fImportedInfoList = new (fMemoryManager) RefVectorOf(4, false, fMemoryManager); if (!fImportedInfoList->containsElement(toAdd)) { fImportedInfoList->addElement(toAdd); toAdd->updateImportingInfo(this); } } else { if (!fIncludeInfoList) { fIncludeInfoList = new (fMemoryManager) RefVectorOf(8, false, fMemoryManager); fAdoptInclude = true; } if (!fIncludeInfoList->containsElement(toAdd)) { fIncludeInfoList->addElement(toAdd); //code was originally: //toAdd->fIncludeInfoList = fIncludeInfoList; //however for handling multiple imports this was causing //to schemaInfo's to have the same fIncludeInfoList which they //both owned so when it was deleted it crashed. if (toAdd->fIncludeInfoList) { if (toAdd->fIncludeInfoList != fIncludeInfoList) { XMLSize_t size = toAdd->fIncludeInfoList->size(); for (XMLSize_t i=0; icontainsElement(toAdd->fIncludeInfoList->elementAt(i))) { fIncludeInfoList->addElement(toAdd->fIncludeInfoList->elementAt(i)); } } size = fIncludeInfoList->size(); for (XMLSize_t j=0; jfIncludeInfoList->containsElement(fIncludeInfoList->elementAt(j))) { toAdd->fIncludeInfoList->addElement(fIncludeInfoList->elementAt(j)); } } } } else { toAdd->fIncludeInfoList = fIncludeInfoList; } } } } inline SchemaInfo* SchemaInfo::getImportInfo(const unsigned int namespaceURI) const { XMLSize_t importSize = (fImportedInfoList) ? fImportedInfoList->size() : 0; SchemaInfo* currInfo = 0; for (XMLSize_t i=0; i < importSize; i++) { currInfo = fImportedInfoList->elementAt(i); if (currInfo->getTargetNSURI() == (int) namespaceURI) return currInfo; } return 0; } inline ValidationContext* SchemaInfo::getValidationContext() const { return fValidationContext; } inline bool SchemaInfo::containsInfo(const SchemaInfo* const toCheck, const ListType aListType) const { if ((aListType == INCLUDE) && fIncludeInfoList) { return fIncludeInfoList->containsElement(toCheck); } else if ((aListType == IMPORT) && fImportedInfoList) { return fImportedInfoList->containsElement(toCheck); } return false; } inline bool SchemaInfo::circularImportExist(const unsigned int namespaceURI) { XMLSize_t importSize = fImportingInfoList->size(); for (XMLSize_t i=0; i < importSize; i++) { if (fImportingInfoList->elementAt(i)->getTargetNSURI() == (int) namespaceURI) { return true; } } return false; } inline bool SchemaInfo::isFailedRedefine(const DOMElement* const anElem) { if (fFailedRedefineList) return (fFailedRedefineList->containsElement(anElem)); return false; } inline void SchemaInfo::addFailedRedefine(const DOMElement* const anElem) { if (!fFailedRedefineList) { fFailedRedefineList = new (fMemoryManager) ValueVectorOf(4, fMemoryManager); } fFailedRedefineList->addElement(anElem); } inline void SchemaInfo::addRecursingType(const DOMElement* const elem, const XMLCh* const name) { if (!fRecursingAnonTypes) { fRecursingAnonTypes = new (fMemoryManager) ValueVectorOf(8, fMemoryManager); fRecursingTypeNames = new (fMemoryManager) ValueVectorOf(8, fMemoryManager); } fRecursingAnonTypes->addElement(elem); fRecursingTypeNames->addElement(name); } inline void SchemaInfo::clearTopLevelComponents() { for (unsigned int i = 0; i < C_Count; i++) { delete fTopLevelComponents[i]; fTopLevelComponents[i] = 0; fLastTopLevelComponent[i] = 0; } } XERCES_CPP_NAMESPACE_END #endif /** * End of file SchemaInfo.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/PSVIDefs.hpp000644 000765 000024 00000002344 13241160332 023770 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: PSVIDefs.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_PSVIDEFS_HPP) #define XERCESC_INCLUDE_GUARD_PSVIDEFS_HPP XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT PSVIDefs { public: enum PSVIScope { SCP_ABSENT // declared in group/attribute group , SCP_GLOBAL // global declaration or ref , SCP_LOCAL // local declaration }; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/schema/SchemaSymbols.cpp000644 000765 000024 00000070601 13241160332 025152 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SchemaSymbols.cpp 802804 2009-08-10 14:21:48Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // SchemaSymbols: Static data // --------------------------------------------------------------------------- const XMLCh SchemaSymbols::fgURI_XSI[] = { chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash, chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_w, chDigit_3, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash, chDigit_2, chDigit_0, chDigit_0, chDigit_1, chForwardSlash, chLatin_X, chLatin_M, chLatin_L, chLatin_S, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chDash, chLatin_i, chLatin_n, chLatin_s, chLatin_t, chLatin_a, chLatin_n, chLatin_c, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgURI_SCHEMAFORSCHEMA[] = { chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash, chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_w, chDigit_3, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash, chDigit_2, chDigit_0, chDigit_0, chDigit_1, chForwardSlash, chLatin_X, chLatin_M, chLatin_L, chLatin_S, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chNull }; // deprecated (typo) const XMLCh SchemaSymbols::fgXSI_SCHEMALOCACTION[] = { chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_L, chLatin_o, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; // deprecated (typo) const XMLCh SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION[] = { chLatin_n, chLatin_o, chLatin_N, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chLatin_S, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_L, chLatin_o, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgXSI_SCHEMALOCATION[] = { chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_L, chLatin_o, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCATION[] = { chLatin_n, chLatin_o, chLatin_N, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chLatin_S, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_L, chLatin_o, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgXSI_TYPE[] = { chLatin_t, chLatin_y, chLatin_p, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgELT_ALL[] = { chLatin_a, chLatin_l, chLatin_l, chNull }; const XMLCh SchemaSymbols::fgELT_ANNOTATION[] = { chLatin_a, chLatin_n, chLatin_n, chLatin_o, chLatin_t, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgELT_ANY[] = { chLatin_a, chLatin_n, chLatin_y, chNull }; const XMLCh SchemaSymbols::fgELT_WILDCARD[] = { chLatin_a, chLatin_n, chLatin_y, chNull }; const XMLCh SchemaSymbols::fgELT_ANYATTRIBUTE[] = { chLatin_a, chLatin_n, chLatin_y, chLatin_A, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgELT_APPINFO[] = { chLatin_a, chLatin_p, chLatin_p, chLatin_i, chLatin_n, chLatin_f, chLatin_o, chNull }; const XMLCh SchemaSymbols::fgELT_ATTRIBUTE[] = { chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgELT_ATTRIBUTEGROUP[] = { chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chLatin_G, chLatin_r, chLatin_o, chLatin_u, chLatin_p, chNull }; const XMLCh SchemaSymbols::fgELT_CHOICE[] = { chLatin_c, chLatin_h, chLatin_o, chLatin_i, chLatin_c, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgELT_COMPLEXTYPE[] = { chLatin_c, chLatin_o, chLatin_m, chLatin_p, chLatin_l, chLatin_e, chLatin_x, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgELT_CONTENT[] = { chLatin_c, chLatin_o, chLatin_n, chLatin_t, chLatin_e, chLatin_n, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgELT_DOCUMENTATION[] = { chLatin_d, chLatin_o, chLatin_c, chLatin_u, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgELT_DURATION[] = { chLatin_d, chLatin_u, chLatin_r, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgELT_ELEMENT[] = { chLatin_e, chLatin_l, chLatin_e, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgELT_ENCODING[] = { chLatin_e, chLatin_n, chLatin_c, chLatin_o, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chNull }; const XMLCh SchemaSymbols::fgELT_ENUMERATION[] = { chLatin_e, chLatin_n, chLatin_u, chLatin_m, chLatin_e, chLatin_r, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgELT_FIELD[] = { chLatin_f, chLatin_i, chLatin_e, chLatin_l, chLatin_d, chNull }; const XMLCh SchemaSymbols::fgELT_WHITESPACE[] = { chLatin_w, chLatin_h, chLatin_i, chLatin_t, chLatin_e, chLatin_S, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgELT_GROUP[] = { chLatin_g, chLatin_r, chLatin_o, chLatin_u, chLatin_p, chNull }; const XMLCh SchemaSymbols::fgELT_IMPORT[] = { chLatin_i, chLatin_m, chLatin_p, chLatin_o, chLatin_r, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgELT_INCLUDE[] = { chLatin_i, chLatin_n, chLatin_c, chLatin_l, chLatin_u, chLatin_d, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgELT_REDEFINE[] = { chLatin_r, chLatin_e, chLatin_d, chLatin_e, chLatin_f, chLatin_i, chLatin_n, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgELT_KEY[] = { chLatin_k, chLatin_e, chLatin_y, chNull }; const XMLCh SchemaSymbols::fgELT_KEYREF[] = { chLatin_k, chLatin_e, chLatin_y, chLatin_r, chLatin_e, chLatin_f, chNull }; const XMLCh SchemaSymbols::fgELT_LENGTH[] = { chLatin_l, chLatin_e, chLatin_n, chLatin_g, chLatin_t, chLatin_h, chNull }; const XMLCh SchemaSymbols::fgELT_MAXEXCLUSIVE[] = { chLatin_m, chLatin_a, chLatin_x, chLatin_E, chLatin_x, chLatin_c, chLatin_l, chLatin_u, chLatin_s, chLatin_i, chLatin_v, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgELT_MAXINCLUSIVE[] = { chLatin_m, chLatin_a, chLatin_x, chLatin_I, chLatin_n, chLatin_c, chLatin_l, chLatin_u, chLatin_s, chLatin_i, chLatin_v, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgELT_MAXLENGTH[] = { chLatin_m, chLatin_a, chLatin_x, chLatin_L, chLatin_e, chLatin_n, chLatin_g, chLatin_t, chLatin_h, chNull }; const XMLCh SchemaSymbols::fgELT_MINEXCLUSIVE[] = { chLatin_m, chLatin_i, chLatin_n, chLatin_E, chLatin_x, chLatin_c, chLatin_l, chLatin_u, chLatin_s, chLatin_i, chLatin_v, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgELT_MININCLUSIVE[] = { chLatin_m, chLatin_i, chLatin_n, chLatin_I, chLatin_n, chLatin_c, chLatin_l, chLatin_u, chLatin_s, chLatin_i, chLatin_v, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgELT_MINLENGTH[] = { chLatin_m, chLatin_i, chLatin_n, chLatin_L, chLatin_e, chLatin_n, chLatin_g, chLatin_t, chLatin_h, chNull }; const XMLCh SchemaSymbols::fgELT_NOTATION[] = { chLatin_n, chLatin_o, chLatin_t, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgELT_PATTERN[] = { chLatin_p, chLatin_a, chLatin_t, chLatin_t, chLatin_e, chLatin_r, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgELT_PERIOD[] = { chLatin_p, chLatin_e, chLatin_r, chLatin_i, chLatin_o, chLatin_d, chNull }; const XMLCh SchemaSymbols::fgELT_TOTALDIGITS[] = { chLatin_t, chLatin_o, chLatin_t, chLatin_a, chLatin_l, chLatin_D, chLatin_i, chLatin_g, chLatin_i, chLatin_t, chLatin_s, chNull }; const XMLCh SchemaSymbols::fgELT_FRACTIONDIGITS[] = { chLatin_f, chLatin_r, chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_D, chLatin_i, chLatin_g, chLatin_i, chLatin_t, chLatin_s, chNull }; const XMLCh SchemaSymbols::fgELT_SCHEMA[] = { chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chNull }; const XMLCh SchemaSymbols::fgELT_SELECTOR[] = { chLatin_s, chLatin_e, chLatin_l, chLatin_e, chLatin_c, chLatin_t, chLatin_o, chLatin_r, chNull }; const XMLCh SchemaSymbols::fgELT_SEQUENCE[] = { chLatin_s, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_n, chLatin_c, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgELT_SIMPLETYPE[] = { chLatin_s, chLatin_i, chLatin_m, chLatin_p, chLatin_l, chLatin_e, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgELT_UNION[] = { chLatin_u, chLatin_n, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgELT_LIST[] = { chLatin_l, chLatin_i, chLatin_s, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgELT_UNIQUE[] = { chLatin_u, chLatin_n, chLatin_i, chLatin_q, chLatin_u, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgELT_COMPLEXCONTENT[] = { chLatin_c, chLatin_o, chLatin_m, chLatin_p, chLatin_l, chLatin_e, chLatin_x, chLatin_C, chLatin_o, chLatin_n, chLatin_t, chLatin_e, chLatin_n, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgELT_SIMPLECONTENT[] = { chLatin_s, chLatin_i, chLatin_m, chLatin_p, chLatin_l, chLatin_e, chLatin_C, chLatin_o, chLatin_n, chLatin_t, chLatin_e, chLatin_n, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgELT_RESTRICTION[] = { chLatin_r, chLatin_e, chLatin_s, chLatin_t, chLatin_r, chLatin_i, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgELT_EXTENSION[] = { chLatin_e, chLatin_x, chLatin_t, chLatin_e, chLatin_n, chLatin_s, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgATT_ABSTRACT[] = { chLatin_a, chLatin_b, chLatin_s, chLatin_t, chLatin_r, chLatin_a, chLatin_c, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgATT_ATTRIBUTEFORMDEFAULT[] = { chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chLatin_F, chLatin_o, chLatin_r, chLatin_m, chLatin_D, chLatin_e, chLatin_f, chLatin_a, chLatin_u, chLatin_l, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgATT_BASE[] = { chLatin_b, chLatin_a, chLatin_s, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgATT_ITEMTYPE[] = { chLatin_i, chLatin_t, chLatin_e, chLatin_m, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgATT_MEMBERTYPES[] = { chLatin_m, chLatin_e, chLatin_m, chLatin_b, chLatin_e, chLatin_r, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chLatin_s, chNull }; const XMLCh SchemaSymbols::fgATT_BLOCK[] = { chLatin_b, chLatin_l, chLatin_o, chLatin_c, chLatin_k, chNull }; const XMLCh SchemaSymbols::fgATT_BLOCKDEFAULT[] = { chLatin_b, chLatin_l, chLatin_o, chLatin_c, chLatin_k, chLatin_D, chLatin_e, chLatin_f, chLatin_a, chLatin_u, chLatin_l, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgATT_DEFAULT[] = { chLatin_d, chLatin_e, chLatin_f, chLatin_a, chLatin_u, chLatin_l, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgATT_ELEMENTFORMDEFAULT[] = { chLatin_e, chLatin_l, chLatin_e, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chLatin_F, chLatin_o, chLatin_r, chLatin_m, chLatin_D, chLatin_e, chLatin_f, chLatin_a, chLatin_u, chLatin_l, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgATT_SUBSTITUTIONGROUP[] = { chLatin_s, chLatin_u, chLatin_b, chLatin_s, chLatin_t, chLatin_i, chLatin_t, chLatin_u, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_G, chLatin_r, chLatin_o, chLatin_u, chLatin_p, chNull }; const XMLCh SchemaSymbols::fgATT_FINAL[] = { chLatin_f, chLatin_i, chLatin_n, chLatin_a, chLatin_l, chNull }; const XMLCh SchemaSymbols::fgATT_FINALDEFAULT[] = { chLatin_f, chLatin_i, chLatin_n, chLatin_a, chLatin_l, chLatin_D, chLatin_e, chLatin_f, chLatin_a, chLatin_u, chLatin_l, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgATT_FIXED[] = { chLatin_f, chLatin_i, chLatin_x, chLatin_e, chLatin_d, chNull }; const XMLCh SchemaSymbols::fgATT_FORM[] = { chLatin_f, chLatin_o, chLatin_r, chLatin_m, chNull }; const XMLCh SchemaSymbols::fgATT_ID[] = { chLatin_i, chLatin_d, chNull }; const XMLCh SchemaSymbols::fgATT_MAXOCCURS[] = { chLatin_m, chLatin_a, chLatin_x, chLatin_O, chLatin_c, chLatin_c, chLatin_u, chLatin_r, chLatin_s, chNull }; const XMLCh SchemaSymbols::fgATT_MINOCCURS[] = { chLatin_m, chLatin_i, chLatin_n, chLatin_O, chLatin_c, chLatin_c, chLatin_u, chLatin_r, chLatin_s, chNull }; const XMLCh SchemaSymbols::fgATT_NAME[] = { chLatin_n, chLatin_a, chLatin_m, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgATT_NAMESPACE[] = { chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgATT_NILL[] = { chLatin_n, chLatin_i, chLatin_l, chNull }; const XMLCh SchemaSymbols::fgATT_NILLABLE[] = { chLatin_n, chLatin_i, chLatin_l, chLatin_l, chLatin_a, chLatin_b, chLatin_l, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgATT_PROCESSCONTENTS[] = { chLatin_p, chLatin_r, chLatin_o, chLatin_c, chLatin_e, chLatin_s, chLatin_s, chLatin_C, chLatin_o, chLatin_n, chLatin_t, chLatin_e, chLatin_n, chLatin_t, chLatin_s, chNull }; const XMLCh SchemaSymbols::fgATT_REF[] = { chLatin_r, chLatin_e, chLatin_f, chNull }; const XMLCh SchemaSymbols::fgATT_REFER[] = { chLatin_r, chLatin_e, chLatin_f, chLatin_e, chLatin_r, chNull }; const XMLCh SchemaSymbols::fgATT_SCHEMALOCATION[] = { chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_L, chLatin_o, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgATT_SOURCE[] = { chLatin_s, chLatin_o, chLatin_u, chLatin_r, chLatin_c, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgATT_SYSTEM[] = { chLatin_s, chLatin_y, chLatin_s, chLatin_t, chLatin_e, chLatin_m, chNull }; const XMLCh SchemaSymbols::fgATT_PUBLIC[] = { chLatin_p, chLatin_u, chLatin_b, chLatin_l, chLatin_i, chLatin_c, chNull }; const XMLCh SchemaSymbols::fgATT_TARGETNAMESPACE[] = { chLatin_t, chLatin_a, chLatin_r, chLatin_g, chLatin_e, chLatin_t, chLatin_N, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgATT_TYPE[] = { chLatin_t, chLatin_y, chLatin_p, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgATT_USE[] = { chLatin_u, chLatin_s, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgATT_VALUE[] = { chLatin_v, chLatin_a, chLatin_l, chLatin_u, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgATT_MIXED[] = { chLatin_m, chLatin_i, chLatin_x, chLatin_e, chLatin_d, chNull }; const XMLCh SchemaSymbols::fgATT_VERSION[] = { chLatin_v, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgATT_XPATH[] = { chLatin_x, chLatin_p, chLatin_a, chLatin_t, chLatin_h, chNull }; const XMLCh SchemaSymbols::fgATTVAL_TWOPOUNDANY[] = { chPound, chPound, chLatin_a, chLatin_n, chLatin_y, chNull }; const XMLCh SchemaSymbols::fgATTVAL_TWOPOUNDLOCAL[] = { chPound, chPound, chLatin_l, chLatin_o, chLatin_c, chLatin_a, chLatin_l, chNull }; const XMLCh SchemaSymbols::fgATTVAL_TWOPOUNDOTHER[] = { chPound, chPound, chLatin_o, chLatin_t, chLatin_h, chLatin_e, chLatin_r, chNull }; const XMLCh SchemaSymbols::fgATTVAL_TWOPOUNDTRAGETNAMESPACE[] = { chPound, chPound, chLatin_t, chLatin_a, chLatin_r, chLatin_g, chLatin_e, chLatin_t, chLatin_N, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgATTVAL_POUNDALL[] = { chPound, chLatin_a, chLatin_l, chLatin_l, chNull }; const XMLCh SchemaSymbols::fgATTVAL_BASE64[] = { chLatin_b, chLatin_a, chLatin_s, chLatin_e, chDigit_6, chDigit_4, chNull }; const XMLCh SchemaSymbols::fgATTVAL_BOOLEAN[] = { chLatin_b, chLatin_o, chLatin_o, chLatin_l, chLatin_e, chLatin_a, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgATTVAL_DEFAULT[] = { chLatin_d, chLatin_e, chLatin_f, chLatin_a, chLatin_u, chLatin_l, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgATTVAL_ELEMENTONLY[] = { chLatin_e, chLatin_l, chLatin_e, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chLatin_O, chLatin_n, chLatin_l, chLatin_y, chNull }; const XMLCh SchemaSymbols::fgATTVAL_EMPTY[] = { chLatin_e, chLatin_m, chLatin_p, chLatin_t, chLatin_y, chNull }; const XMLCh SchemaSymbols::fgATTVAL_EXTENSION[] = { chLatin_e, chLatin_x, chLatin_t, chLatin_e, chLatin_n, chLatin_s, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgATTVAL_FALSE[] = { chLatin_f, chLatin_a, chLatin_l, chLatin_s, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgATTVAL_FIXED[] = { chLatin_f, chLatin_i, chLatin_x, chLatin_e, chLatin_d, chNull }; const XMLCh SchemaSymbols::fgATTVAL_HEX[] = { chLatin_h, chLatin_e, chLatin_x, chNull }; const XMLCh SchemaSymbols::fgATTVAL_ID[] = { chLatin_I, chLatin_D, chNull }; const XMLCh SchemaSymbols::fgATTVAL_LAX[] = { chLatin_l, chLatin_a, chLatin_x, chNull }; const XMLCh SchemaSymbols::fgATTVAL_MAXLENGTH[] = { chLatin_m, chLatin_a, chLatin_x, chLatin_L, chLatin_e, chLatin_n, chLatin_g, chLatin_t, chLatin_h, chNull }; const XMLCh SchemaSymbols::fgATTVAL_MINLENGTH[] = { chLatin_m, chLatin_i, chLatin_n, chLatin_L, chLatin_e, chLatin_n, chLatin_g, chLatin_t, chLatin_h, chNull }; const XMLCh SchemaSymbols::fgATTVAL_MIXED[] = { chLatin_m, chLatin_i, chLatin_x, chLatin_e, chLatin_d, chNull }; const XMLCh SchemaSymbols::fgATTVAL_NCNAME[] = { chLatin_N, chLatin_C, chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgATTVAL_OPTIONAL[] = { chLatin_o, chLatin_p, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_a, chLatin_l, chNull }; const XMLCh SchemaSymbols::fgATTVAL_PROHIBITED[] = { chLatin_p, chLatin_r, chLatin_o, chLatin_h, chLatin_i, chLatin_b, chLatin_i, chLatin_t, chLatin_e, chLatin_d, chNull }; const XMLCh SchemaSymbols::fgATTVAL_QNAME[] = { chLatin_Q, chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgATTVAL_QUALIFIED[] = { chLatin_q, chLatin_u, chLatin_a, chLatin_l, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chNull }; const XMLCh SchemaSymbols::fgATTVAL_REQUIRED[] = { chLatin_r, chLatin_e, chLatin_q, chLatin_u, chLatin_i, chLatin_r, chLatin_e, chLatin_d, chNull }; const XMLCh SchemaSymbols::fgATTVAL_RESTRICTION[] = { chLatin_r, chLatin_e, chLatin_s, chLatin_t, chLatin_r, chLatin_i, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgATTVAL_SKIP[] = { chLatin_s, chLatin_k, chLatin_i, chLatin_p, chNull }; const XMLCh SchemaSymbols::fgATTVAL_STRICT[] = { chLatin_s, chLatin_t, chLatin_r, chLatin_i, chLatin_c, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgATTVAL_STRING[] = { chLatin_s, chLatin_t, chLatin_r, chLatin_i, chLatin_n, chLatin_g, chNull }; const XMLCh SchemaSymbols::fgATTVAL_TEXTONLY[] = { chLatin_t, chLatin_e, chLatin_x, chLatin_t, chLatin_O, chLatin_n, chLatin_l, chLatin_y, chNull }; const XMLCh SchemaSymbols::fgATTVAL_TIMEDURATION[] = { chLatin_t, chLatin_i, chLatin_m, chLatin_e, chLatin_D, chLatin_u, chLatin_r, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgATTVAL_TRUE[] = { chLatin_t, chLatin_r, chLatin_u, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgATTVAL_UNQUALIFIED[] = { chLatin_u, chLatin_n, chLatin_q, chLatin_u, chLatin_a, chLatin_l, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chNull }; const XMLCh SchemaSymbols::fgATTVAL_URI[] = { chLatin_u, chLatin_r, chLatin_i, chNull }; const XMLCh SchemaSymbols::fgATTVAL_URIREFERENCE[] = { chLatin_u, chLatin_r, chLatin_i, chLatin_R, chLatin_e, chLatin_f, chLatin_e, chLatin_r, chLatin_e, chLatin_n, chLatin_c, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgATTVAL_SUBSTITUTIONGROUP[] = { chLatin_s, chLatin_u, chLatin_b, chLatin_s, chLatin_t, chLatin_i, chLatin_t, chLatin_u, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_G, chLatin_r, chLatin_o, chLatin_u, chLatin_p, chNull }; const XMLCh SchemaSymbols::fgATTVAL_SUBSTITUTION[] = { chLatin_s, chLatin_u, chLatin_b, chLatin_s, chLatin_t, chLatin_i, chLatin_t, chLatin_u, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgATTVAL_ANYTYPE[] = { chLatin_a, chLatin_n, chLatin_y, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgWS_PRESERVE[] = { chLatin_p, chLatin_r, chLatin_e, chLatin_s, chLatin_e, chLatin_r, chLatin_v, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgWS_COLLAPSE[] = { chLatin_c, chLatin_o, chLatin_l, chLatin_l, chLatin_a, chLatin_p, chLatin_s, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgWS_REPLACE[] = { chLatin_r, chLatin_e, chLatin_p, chLatin_l, chLatin_a, chLatin_c, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgDT_STRING[] = { chLatin_s, chLatin_t, chLatin_r, chLatin_i, chLatin_n, chLatin_g, chNull }; const XMLCh SchemaSymbols::fgDT_TOKEN[] = { chLatin_t, chLatin_o, chLatin_k, chLatin_e, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgDT_LANGUAGE[] = { chLatin_l, chLatin_a, chLatin_n, chLatin_g, chLatin_u, chLatin_a, chLatin_g, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgDT_NAME[] = { chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgDT_NCNAME[] = { chLatin_N, chLatin_C, chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgDT_INTEGER[] = { chLatin_i, chLatin_n, chLatin_t, chLatin_e, chLatin_g, chLatin_e, chLatin_r, chNull }; const XMLCh SchemaSymbols::fgDT_DECIMAL[] = { chLatin_d, chLatin_e, chLatin_c, chLatin_i, chLatin_m, chLatin_a, chLatin_l, chNull }; const XMLCh SchemaSymbols::fgDT_BOOLEAN[] = { chLatin_b, chLatin_o, chLatin_o, chLatin_l, chLatin_e, chLatin_a, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgDT_NONPOSITIVEINTEGER[] = { chLatin_n, chLatin_o, chLatin_n, chLatin_P, chLatin_o, chLatin_s, chLatin_i, chLatin_t, chLatin_i, chLatin_v, chLatin_e, chLatin_I, chLatin_n, chLatin_t, chLatin_e, chLatin_g, chLatin_e, chLatin_r, chNull }; const XMLCh SchemaSymbols::fgDT_NEGATIVEINTEGER[] = { chLatin_n, chLatin_e, chLatin_g, chLatin_a, chLatin_t, chLatin_i, chLatin_v, chLatin_e, chLatin_I, chLatin_n, chLatin_t, chLatin_e, chLatin_g, chLatin_e, chLatin_r, chNull }; const XMLCh SchemaSymbols::fgDT_LONG[] = { chLatin_l, chLatin_o, chLatin_n, chLatin_g, chNull }; const XMLCh SchemaSymbols::fgDT_INT[] = { chLatin_i, chLatin_n, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgDT_SHORT[] = { chLatin_s, chLatin_h, chLatin_o, chLatin_r, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgDT_BYTE[] = { chLatin_b, chLatin_y, chLatin_t, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgDT_NONNEGATIVEINTEGER[] = { chLatin_n, chLatin_o, chLatin_n, chLatin_N, chLatin_e, chLatin_g, chLatin_a, chLatin_t, chLatin_i, chLatin_v, chLatin_e, chLatin_I, chLatin_n, chLatin_t, chLatin_e, chLatin_g, chLatin_e, chLatin_r, chNull }; const XMLCh SchemaSymbols::fgDT_ULONG[] = { chLatin_u, chLatin_n, chLatin_s, chLatin_i, chLatin_g, chLatin_n, chLatin_e, chLatin_d, chLatin_L, chLatin_o, chLatin_n, chLatin_g, chNull }; const XMLCh SchemaSymbols::fgDT_UINT[] = { chLatin_u, chLatin_n, chLatin_s, chLatin_i, chLatin_g, chLatin_n, chLatin_e, chLatin_d, chLatin_I, chLatin_n, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgDT_USHORT[] = { chLatin_u, chLatin_n, chLatin_s, chLatin_i, chLatin_g, chLatin_n, chLatin_e, chLatin_d, chLatin_S, chLatin_h, chLatin_o, chLatin_r, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgDT_UBYTE[] = { chLatin_u, chLatin_n, chLatin_s, chLatin_i, chLatin_g, chLatin_n, chLatin_e, chLatin_d, chLatin_B, chLatin_y, chLatin_t, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgDT_POSITIVEINTEGER[] = { chLatin_p, chLatin_o, chLatin_s, chLatin_i, chLatin_t, chLatin_i, chLatin_v, chLatin_e, chLatin_I, chLatin_n, chLatin_t, chLatin_e, chLatin_g, chLatin_e, chLatin_r, chNull }; const XMLCh SchemaSymbols::fgDT_DATETIME[] = { chLatin_d, chLatin_a, chLatin_t, chLatin_e, chLatin_T, chLatin_i, chLatin_m, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgDT_DATE[] = { chLatin_d, chLatin_a, chLatin_t, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgDT_TIME[] = { chLatin_t, chLatin_i, chLatin_m, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgDT_DURATION[] = { chLatin_d, chLatin_u, chLatin_r, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh SchemaSymbols::fgDT_DAY[] = { chLatin_g, chLatin_D, chLatin_a, chLatin_y, chNull }; const XMLCh SchemaSymbols::fgDT_MONTH[] = { chLatin_g, chLatin_M, chLatin_o, chLatin_n, chLatin_t, chLatin_h, chNull }; const XMLCh SchemaSymbols::fgDT_MONTHDAY[] = { chLatin_g, chLatin_M, chLatin_o, chLatin_n, chLatin_t, chLatin_h, chLatin_D, chLatin_a, chLatin_y, chNull }; const XMLCh SchemaSymbols::fgDT_YEAR[] = { chLatin_g, chLatin_Y, chLatin_e, chLatin_a, chLatin_r, chNull }; const XMLCh SchemaSymbols::fgDT_YEARMONTH[] = { chLatin_g, chLatin_Y, chLatin_e, chLatin_a, chLatin_r, chLatin_M, chLatin_o, chLatin_n, chLatin_t, chLatin_h, chNull }; const XMLCh SchemaSymbols::fgDT_BASE64BINARY[] = { chLatin_b, chLatin_a, chLatin_s, chLatin_e, chDigit_6, chDigit_4, chLatin_B, chLatin_i, chLatin_n, chLatin_a, chLatin_r, chLatin_y, chNull }; const XMLCh SchemaSymbols::fgDT_HEXBINARY[] = { chLatin_h, chLatin_e, chLatin_x, chLatin_B, chLatin_i, chLatin_n, chLatin_a, chLatin_r, chLatin_y, chNull }; const XMLCh SchemaSymbols::fgDT_FLOAT[] = { chLatin_f, chLatin_l, chLatin_o, chLatin_a, chLatin_t, chNull }; const XMLCh SchemaSymbols::fgDT_DOUBLE[] = { chLatin_d, chLatin_o, chLatin_u, chLatin_b, chLatin_l, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgDT_URIREFERENCE[] = { chLatin_u, chLatin_r, chLatin_i, chLatin_R, chLatin_e, chLatin_f, chLatin_e, chLatin_r, chLatin_e, chLatin_n, chLatin_c, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgDT_ANYURI[] = { chLatin_a, chLatin_n, chLatin_y, chLatin_U, chLatin_R, chLatin_I, chNull }; const XMLCh SchemaSymbols::fgDT_QNAME[] = { chLatin_Q, chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgDT_NORMALIZEDSTRING[] = { chLatin_n, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_l, chLatin_i, chLatin_z, chLatin_e, chLatin_d, chLatin_S, chLatin_t, chLatin_r, chLatin_i, chLatin_n, chLatin_g, chNull }; const XMLCh SchemaSymbols::fgDT_ANYSIMPLETYPE[] = { chLatin_a, chLatin_n, chLatin_y, chLatin_S, chLatin_i, chLatin_m, chLatin_p, chLatin_l, chLatin_e, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chNull }; const XMLCh SchemaSymbols::fgRegEx_XOption[] = { chLatin_X, chNull }; const XMLCh SchemaSymbols::fgRedefIdentifier[] = { chUnderscore, chLatin_r, chLatin_d, chLatin_f, chLatin_n, chNull }; const int SchemaSymbols::fgINT_MIN_VALUE = 0x80000000; const int SchemaSymbols::fgINT_MAX_VALUE = 0x7fffffff; XERCES_CPP_NAMESPACE_END /** * End of file SchemaSymbols.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/SchemaValidator.cpp000644 000765 000024 00000242770 13241160332 025457 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SchemaValidator.cpp 806488 2009-08-21 10:36:58Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // SchemaValidator: Constructors and Destructor // --------------------------------------------------------------------------- SchemaValidator::SchemaValidator( XMLErrorReporter* const errReporter , MemoryManager* const manager) : XMLValidator(errReporter) , fMemoryManager(manager) , fSchemaGrammar(0) , fGrammarResolver(0) , fXsiType(0) , fNil(false) , fNilFound(false) , fCurrentDatatypeValidator(0) , fNotationBuf(0) , fDatatypeBuffer(1023, manager) , fTrailing(false) , fSeenNonWhiteSpace(false) , fSeenId(false) , fTypeStack(0) , fMostRecentAttrValidator(0) , fErrorOccurred(false) , fElemIsSpecified(false) { fTypeStack = new (fMemoryManager) ValueStackOf(8, fMemoryManager); } SchemaValidator::~SchemaValidator() { delete fXsiType; delete fTypeStack; if (fNotationBuf) delete fNotationBuf; } // --------------------------------------------------------------------------- // SchemaValidator: Implementation of the XMLValidator interface // --------------------------------------------------------------------------- bool SchemaValidator::checkContent (XMLElementDecl* const elemDecl , QName** const children , XMLSize_t childCount , XMLSize_t* indexFailingChild) { fErrorOccurred = false; fElemIsSpecified = false; // // Look up the element id in our element decl pool. This will get us // the element decl in our own way of looking at them. // if (!elemDecl) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Val_InvalidElemId, fMemoryManager); // // Get the content spec type of this element. This will tell us what // to do to validate it. // // the top of the type stack always knows best... ComplexTypeInfo* currType = fTypeStack->pop(); const SchemaElementDecl::ModelTypes modelType = (currType) ? (SchemaElementDecl::ModelTypes)(currType->getContentType()) : ((SchemaElementDecl*)elemDecl)->getModelType(); if (modelType == SchemaElementDecl::Empty || modelType == SchemaElementDecl::ElementOnlyEmpty) { // // We can do this one here. It cannot have any children. If it does // we return 0 as the index of the first bad child. // if (childCount) { fErrorOccurred = true; *indexFailingChild=0; return false; } } else if ((modelType == SchemaElementDecl::Mixed_Simple) || (modelType == SchemaElementDecl::Mixed_Complex) || (modelType == SchemaElementDecl::Children)) { // if nillable, it's an error to have value // XML Schema REC: Validation Rule: Element Locally Valid (Element) // 3.2.1 The element information item must have no // character or element information item [children]. // if (fNil) { if (childCount > 0 || !XMLString::equals(fDatatypeBuffer.getRawBuffer(), XMLUni::fgZeroLenString)) { emitError(XMLValid::NilAttrNotEmpty, elemDecl->getFullName()); fErrorOccurred = true; } } else { // Get the element's content model or fault it in XMLContentModel* elemCM = (currType) ? currType->getContentModel() : ((SchemaElementDecl*)elemDecl)->getContentModel(); // Ask it to validate and return its return unsigned int emptyNS = getScanner()->getEmptyNamespaceId(); bool result = elemCM->validateContent(children, childCount, emptyNS, indexFailingChild, getScanner()->getMemoryManager()); if (!result) { result = elemCM->validateContentSpecial(children , childCount , emptyNS , fGrammarResolver , fGrammarResolver->getStringPool() , indexFailingChild , getScanner()->getMemoryManager()); } if(!result) { fErrorOccurred = true; } return result; } } else if (modelType == SchemaElementDecl::Simple || modelType == SchemaElementDecl::Any) { // Normally for SchemaElementDecl::Any, We pass no judgement on it and anything goes // but if there is a fXsiTypeValidator, we need to use it for validation if (modelType == SchemaElementDecl::Simple && childCount > 0) { emitError(XMLValid::SimpleTypeHasChild, elemDecl->getFullName()); fErrorOccurred = true; } else { XMLCh* value = fDatatypeBuffer.getRawBuffer(); XMLCh* elemDefaultValue = ((SchemaElementDecl*) elemDecl)->getDefaultValue(); if (fNil) { if ((!XMLString::equals(value, XMLUni::fgZeroLenString)) || elemDefaultValue) { emitError(XMLValid::NilAttrNotEmpty, elemDecl->getFullName()); fErrorOccurred = true; } } else if (fCurrentDatatypeValidator) { DatatypeValidator::ValidatorType eleDefDVType = fCurrentDatatypeValidator->getType(); bool validateCanonical = false; if (eleDefDVType == DatatypeValidator::NOTATION) { // if notation, need to bind URI to notation first if (!fNotationBuf) fNotationBuf = new (fMemoryManager) XMLBuffer(1023, fMemoryManager); // Make sure that this value maps to one of the // notation values in the enumList parameter. We don't have to // look it up in the notation pool (if a notation) because we // will look up the enumerated values themselves. If they are in // the notation pool (after the Grammar is parsed), then obviously // this value will be legal since it matches one of them. int colonPos = -1; unsigned int uriId = getScanner()->resolveQName(value, *fNotationBuf, ElemStack::Mode_Element, colonPos); const XMLCh* uriText = getScanner()->getURIText(uriId); if (uriText && *uriText) { fNotationBuf->set(uriText); fNotationBuf->append(chColon); fNotationBuf->append(&value[colonPos + 1]); value = fNotationBuf->getRawBuffer(); } } if (elemDefaultValue) { if (XMLString::equals(value, XMLUni::fgZeroLenString)) { fElemIsSpecified = true; // if this element didn't specified any value // use default value if (getScanner()->getDocHandler()) getScanner()->getDocHandler()->docCharacters(elemDefaultValue, XMLString::stringLen(elemDefaultValue), false); // Normally for default value, it has been validated already during TraverseSchema // But if there was a xsi:type and this validator is fXsiTypeValidator, // need to validate again // we determine this if the current content dataype validator // is neither the one in the element nor the one in the current // complex type (if any) if ((fCurrentDatatypeValidator != ((SchemaElementDecl*)elemDecl)->getDatatypeValidator()) && (!fTypeStack->peek() || (fCurrentDatatypeValidator != fTypeStack->peek()->getDatatypeValidator()))) { value = elemDefaultValue; validateCanonical = true; } else value = 0; } else { // this element has specified some value // if the flag is FIXED, then this value must be same as default value if ((((SchemaElementDecl*)elemDecl)->getMiscFlags() & SchemaSymbols::XSD_FIXED) != 0) { if (fCurrentDatatypeValidator->compare(value, elemDefaultValue, fMemoryManager) != 0 ) { emitError(XMLValid::FixedDifferentFromActual, elemDecl->getFullName()); fErrorOccurred = true; } } } } if ((!fErrorOccurred) && value) { try { fCurrentDatatypeValidator->validate(value, getScanner()->getValidationContext(), fMemoryManager); if (validateCanonical) { XMLCh* canonical = (XMLCh*) fCurrentDatatypeValidator->getCanonicalRepresentation(value, fMemoryManager); ArrayJanitor tempCanonical(canonical, fMemoryManager); fCurrentDatatypeValidator->validate(canonical, getScanner()->getValidationContext(), fMemoryManager); } } catch (XMLException& idve) { emitError (XMLValid::DatatypeError, idve.getCode(), idve.getMessage()); fErrorOccurred = true; } catch(const OutOfMemoryException&) { throw; } catch (...) { emitError(XMLValid::GenericError); throw; } } } else if (modelType == SchemaElementDecl::Simple) { emitError(XMLValid::NoDatatypeValidatorForSimpleType, elemDecl->getFullName()); fErrorOccurred = true; } // modelType is any else if (elemDefaultValue) { if (XMLString::equals(value, XMLUni::fgZeroLenString)) { fElemIsSpecified = true; // if this element didn't specified any value // use default value if (getScanner()->getDocHandler()) { getScanner()->getDocHandler()->docCharacters(elemDefaultValue, XMLString::stringLen(elemDefaultValue), false); } } } } } else { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_UnknownCMType, fMemoryManager); } // must rely on scanner to clear fDatatypeBuffer // since it may need to query its contents after this method completes fNil = false; fNilFound = false; fTrailing=false; fSeenNonWhiteSpace = false; fCurrentDatatypeValidator = 0; // Went ok, so return success return true; } void SchemaValidator::faultInAttr (XMLAttr& toFill, const XMLAttDef& attDef) const { // // At this level, we cannot set the URI id. So we just set it to zero // and leave it at that. The scanner, who called us, will look at the // prefix we stored (if any), resolve it, and store the URL id if any. // SchemaAttDef* schemaAttDef = (SchemaAttDef*) &attDef; QName* attName = schemaAttDef->getAttName(); toFill.set ( attName->getURI() , attName->getLocalPart() , attName->getPrefix() , schemaAttDef->getValue() , schemaAttDef->getType() ); } void SchemaValidator::reset() { fTrailing = false; fSeenNonWhiteSpace = false; fSeenId = false; fTypeStack->removeAllElements(); delete fXsiType; fXsiType = 0; fCurrentDatatypeValidator = 0; fNil = false; fNilFound = false; fDatatypeBuffer.reset(); fErrorOccurred = false; } bool SchemaValidator::requiresNamespaces() const { return true; } void SchemaValidator::validateAttrValue (const XMLAttDef* attDef , const XMLCh* const attrValue , bool preValidation , const XMLElementDecl* elemDecl) { fErrorOccurred = false; //turn on IdRefList checking getScanner()->getValidationContext()->toCheckIdRefList(true); // // Get quick refs to lot of the stuff in the passed objects in // order to simplify the code below, which will reference them very // often. // XMLAttDef::AttTypes type = attDef->getType(); const XMLAttDef::DefAttTypes defType = attDef->getDefaultType(); // // If the default type is fixed, then make sure the passed value maps // to the fixed value. // // If during preContentValidation, the value we are validating is the fixed value itself // so no need to compare. // Only need to do this for regular attribute value validation // if ((defType == XMLAttDef::Fixed || defType == XMLAttDef::Required_And_Fixed) && !preValidation) { const XMLCh* const valueText = attDef->getValue(); if (!XMLString::equals(attrValue, valueText)) { emitError(XMLValid::NotSameAsFixedValue, attDef->getFullName(), attrValue, valueText); fErrorOccurred = true; } } // An empty string cannot be valid for non_CDATA any of the other types if (!attrValue[0] && type != XMLAttDef::Simple) { emitError(XMLValid::InvalidEmptyAttValue, attDef->getFullName()); // accords with original DOMTypeInfo implementation, but this does not feel right. fMostRecentAttrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_ANYSIMPLETYPE); fErrorOccurred = true; return; } DatatypeValidator* attDefDV = ((SchemaAttDef*) attDef)->getDatatypeValidator(); if (!attDefDV) { emitError(XMLValid::NoDatatypeValidatorForAttribute, attDef->getFullName()); fErrorOccurred = true; } else { DatatypeValidator::ValidatorType attDefDVType = attDefDV->getType(); ValidationContext *context = getScanner()->getValidationContext(); try { // first, if notation, need to bind URI to notation first if (attDefDVType == DatatypeValidator::NOTATION) { // // Make sure that this value maps to one of the // notation values in the enumList parameter. We don't have to // look it up in the notation pool (if a notation) because we // will look up the enumerated values themselves. If they are in // the notation pool (after the Grammar is parsed), then obviously // this value will be legal since it matches one of them. // XMLBuffer notationBuf(1023, fMemoryManager); int colonPos = -1; unsigned int uriId = getScanner()->resolveQName(attrValue, notationBuf, ElemStack::Mode_Element, colonPos); const XMLCh* uriText = getScanner()->getURIText(uriId); if (uriText && *uriText) { notationBuf.set(uriText); notationBuf.append(chColon); notationBuf.append(&attrValue[colonPos + 1]); } else { notationBuf.set(attrValue); } attDefDV->validate(notationBuf.getRawBuffer() , context , fMemoryManager); } else { attDefDV->validate(attrValue , context , fMemoryManager); } } catch (XMLException& idve) { fErrorOccurred = true; emitError (XMLValid::DatatypeError, idve.getCode(), idve.getMessage()); } catch(const OutOfMemoryException&) { throw; } catch (...) { emitError(XMLValid::GenericError); fMostRecentAttrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_ANYSIMPLETYPE); fErrorOccurred = true; throw; } fMostRecentAttrValidator = attDefDV; // now we can look for ID's, entities, ... // set up the entitydeclpool in ENTITYDatatypeValidator // and the idreflist in ID/IDREFDatatypeValidator // indicate if this attribute is of type ID bool thisIsAnId = false; if (attDefDVType == DatatypeValidator::List) { DatatypeValidator* itemDTV = ((ListDatatypeValidator*)attDefDV)->getItemTypeDTV(); DatatypeValidator::ValidatorType itemDTVType = itemDTV->getType(); if (itemDTVType == DatatypeValidator::ID) { thisIsAnId = true; } else if (itemDTVType == DatatypeValidator::IDREF) { // if in prevalidatoin, do not add attDef to IDREFList if (preValidation) //todo: when to setIdRefList back to non-null getScanner()->getValidationContext()->toCheckIdRefList(false); } } else if (attDefDVType == DatatypeValidator::Union) { DatatypeValidator *memberDTV = context->getValidatingMemberType(); // actual type for DOMTypeInfo is memberDTV fMostRecentAttrValidator = memberDTV; // no member datatype validator if there was an error if(memberDTV) { DatatypeValidator::ValidatorType memberDTVType = memberDTV->getType(); if (memberDTVType == DatatypeValidator::ID) { thisIsAnId = true; } else if (memberDTVType == DatatypeValidator::IDREF) { // if in prevalidatoin, do not add attDef to IDREFList if (preValidation) getScanner()->getValidationContext()->toCheckIdRefList(false); } } } else if (attDefDVType == DatatypeValidator::ID) { thisIsAnId = true; } else if (attDefDVType == DatatypeValidator::IDREF) { // if in prevalidation, do not add attDef to IDREFList if (preValidation) getScanner()->getValidationContext()->toCheckIdRefList(false); } if (thisIsAnId) { if (fSeenId) { emitError ( XMLValid::MultipleIdAttrs , elemDecl->getFullName() ); fErrorOccurred = true; } else fSeenId = true; } } if(fErrorOccurred) { fMostRecentAttrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_ANYSIMPLETYPE); } fTrailing = false; fSeenNonWhiteSpace = false; } void SchemaValidator::validateElement(const XMLElementDecl* elemDef) { ComplexTypeInfo* elemTypeInfo = ((SchemaElementDecl*)elemDef)->getComplexTypeInfo(); fTypeStack->push(elemTypeInfo); fCurrentDatatypeValidator = (elemTypeInfo) ? elemTypeInfo->getDatatypeValidator() : ((SchemaElementDecl*)elemDef)->getDatatypeValidator(); fErrorOccurred = false; if (fXsiType) { // handle "xsi:type" right here DatatypeValidator *xsiTypeDV = 0; unsigned int uri = fXsiType->getURI(); const XMLCh* localPart = fXsiType->getLocalPart(); if (uri != XMLElementDecl::fgInvalidElemId && uri != XMLElementDecl::fgPCDataElemId && uri != XMLContentModel::gEpsilonFakeId && uri != XMLContentModel::gEOCFakeId) { // retrieve Grammar for the uri const XMLCh* uriStr = getScanner()->getURIText(uri); SchemaGrammar* sGrammar = (SchemaGrammar*) fGrammarResolver->getGrammar(uriStr); if (!sGrammar) { // Check built-in simple types if (XMLString::equals(uriStr, SchemaSymbols::fgURI_SCHEMAFORSCHEMA)) { xsiTypeDV = fGrammarResolver->getDatatypeValidator(uriStr, localPart); if (!xsiTypeDV) { emitError(XMLValid::BadXsiType, fXsiType->getRawName()); fErrorOccurred = true; } else { if (elemTypeInfo || (fCurrentDatatypeValidator && !fCurrentDatatypeValidator->isSubstitutableBy(xsiTypeDV))) { // the type is not derived from ancestor emitError(XMLValid::NonDerivedXsiType, fXsiType->getRawName(), elemDef->getFullName()); fErrorOccurred = true; } else if(fCurrentDatatypeValidator != xsiTypeDV) { // the type is derived from ancestor if ((((SchemaElementDecl*)elemDef)->getBlockSet() & SchemaSymbols::XSD_RESTRICTION) != 0) { emitError(XMLValid::ElemNoSubforBlock, elemDef->getFullName()); fErrorOccurred = true; } if (elemDef->hasAttDefs()) { // if we have an attribute but xsi:type's type is simple, we have a problem... emitError(XMLValid::NonDerivedXsiType, fXsiType->getRawName(), elemDef->getFullName()); fErrorOccurred = true; } } fCurrentDatatypeValidator = xsiTypeDV; } } else { // Grammar not found emitError(XMLValid::GrammarNotFound, uriStr); fErrorOccurred = true; } } else if (sGrammar->getGrammarType() != Grammar::SchemaGrammarType) { emitError(XMLValid::GrammarNotFound, uriStr); fErrorOccurred = true; } else { // retrieve complexType registry and DatatypeValidator registry RefHashTableOf* complexTypeRegistry = sGrammar->getComplexTypeRegistry(); if (!complexTypeRegistry) { emitError(XMLValid::BadXsiType, fXsiType->getRawName()); fErrorOccurred = true; } else { // retrieve the typeInfo specified in xsi:type XMLBuffer aBuffer(1023, fMemoryManager); aBuffer.set(uriStr); aBuffer.append(chComma); aBuffer.append(localPart); ComplexTypeInfo* typeInfo = complexTypeRegistry->get(aBuffer.getRawBuffer()); if (typeInfo) { // typeInfo is found if (typeInfo->getAbstract()) { emitError(XMLValid::NoAbstractInXsiType, aBuffer.getRawBuffer()); fErrorOccurred = true; } else { if (elemTypeInfo) { ComplexTypeInfo* tempType = typeInfo; while (tempType) { if (tempType == elemTypeInfo) break; tempType = tempType->getBaseComplexTypeInfo(); } if (!tempType) { emitError(XMLValid::NonDerivedXsiType, fXsiType->getRawName(), elemDef->getFullName()); fErrorOccurred = true; } else if(elemTypeInfo != typeInfo) { // perform the check on the entire inheritance chain ComplexTypeInfo* tempType = typeInfo; while (tempType) { if (tempType == elemTypeInfo) break; int derivationMethod = tempType->getDerivedBy(); if ((((SchemaElementDecl*)elemDef)->getBlockSet() & derivationMethod) != 0) { emitError(XMLValid::ElemNoSubforBlock, elemDef->getFullName()); fErrorOccurred = true; } if ((elemTypeInfo->getBlockSet() & derivationMethod) != 0) { emitError(XMLValid::TypeNoSubforBlock, elemTypeInfo->getTypeName()); fErrorOccurred = true; } tempType = tempType->getBaseComplexTypeInfo(); } } } else { // if the original type is a simple type, check derivation ok. if (fCurrentDatatypeValidator && !fCurrentDatatypeValidator->isSubstitutableBy(typeInfo->getDatatypeValidator())) { // the type is not derived from ancestor emitError(XMLValid::NonDerivedXsiType, fXsiType->getRawName(), elemDef->getFullName()); fErrorOccurred = true; } } if (!fErrorOccurred) { fTypeStack->pop(); fTypeStack->push(typeInfo); fCurrentDatatypeValidator = typeInfo->getDatatypeValidator(); } } } else { // typeInfo not found xsiTypeDV = fGrammarResolver->getDatatypeValidator(uriStr, localPart); if (!xsiTypeDV) { emitError(XMLValid::BadXsiType, fXsiType->getRawName()); fErrorOccurred = true; } else { if (fCurrentDatatypeValidator && !fCurrentDatatypeValidator->isSubstitutableBy(xsiTypeDV)) { // the type is not derived from ancestor emitError(XMLValid::NonDerivedXsiType, fXsiType->getRawName(), elemDef->getFullName()); fErrorOccurred = true; } else if(fCurrentDatatypeValidator != xsiTypeDV) { DatatypeValidator::ValidatorType derivedType=xsiTypeDV->getType(); if((derivedType == DatatypeValidator::List || derivedType == DatatypeValidator::Union) && fCurrentDatatypeValidator==0) { // the substitution is always allowed if the type is list or union and the base type was xs:anySimpleType } else { // the type is derived from ancestor if ((((SchemaElementDecl*)elemDef)->getBlockSet() & SchemaSymbols::XSD_RESTRICTION) != 0) { emitError(XMLValid::ElemNoSubforBlock, elemDef->getFullName()); fErrorOccurred = true; } if (elemDef->hasAttDefs()) { // if we have an attribute but xsi:type's type is simple, we have a problem... emitError(XMLValid::NonDerivedXsiType, fXsiType->getRawName(), elemDef->getFullName()); fErrorOccurred = true; } } } fCurrentDatatypeValidator = xsiTypeDV; } } } } } delete fXsiType; fXsiType = 0; } else { // // xsi:type was not specified... // If the corresponding type is abstract, detect an error // if (elemTypeInfo && elemTypeInfo->getAbstract()) { emitError(XMLValid::NoUseAbstractType, elemDef->getFullName()); fErrorOccurred = true; } } // // Check whether this element is abstract. If so, an error // int miscFlags = ((SchemaElementDecl*)elemDef)->getMiscFlags(); if ((miscFlags & SchemaSymbols::XSD_ABSTRACT) != 0) { emitError(XMLValid::NoDirectUseAbstractElement, elemDef->getFullName()); fErrorOccurred = true; } // // Check whether this element allows Nillable // if (fNilFound && (miscFlags & SchemaSymbols::XSD_NILLABLE) == 0 ) { fNil = false; fNilFound = false; emitError(XMLValid::NillNotAllowed, elemDef->getFullName()); fErrorOccurred = true; } fDatatypeBuffer.reset(); fTrailing = false; fSeenNonWhiteSpace = false; fSeenId = false; } void SchemaValidator::preContentValidation(bool, bool validateDefAttr) { // Lets go through all the grammar in the GrammarResolver // and validate those that has not been validated yet // // Lets enumerate all of the elements in the element decl pool // and put out an error for any that did not get declared. // We also check all of the attributes as well. // // And enumerate all the complextype info in the grammar // and do Unique Particle Attribution Checking RefHashTableOfEnumerator grammarEnum = fGrammarResolver->getGrammarEnumerator(); while (grammarEnum.hasMoreElements()) { SchemaGrammar& sGrammar = (SchemaGrammar&) grammarEnum.nextElement(); if (sGrammar.getGrammarType() != Grammar::SchemaGrammarType || sGrammar.getValidated()) continue; sGrammar.setValidated(true); RefHash3KeysIdPoolEnumerator elemEnum = sGrammar.getElemEnumerator(); while (elemEnum.hasMoreElements()) { SchemaElementDecl& curElem = elemEnum.nextElement(); // First check if declared or not // // See if this element decl was ever marked as declared. If // not, then put out an error. In some cases its just // a warning, such as being referenced in a content model. // const SchemaElementDecl::CreateReasons reason = curElem.getCreateReason(); if (reason != XMLElementDecl::Declared) { if (reason == XMLElementDecl::AttList) { getScanner()->emitError ( XMLErrs::UndeclaredElemInAttList , curElem.getFullName() ); } else if (reason == XMLElementDecl::AsRootElem) { emitError ( XMLValid::UndeclaredElemInDocType , curElem.getFullName() ); } else if (reason == XMLElementDecl::InContentModel) { getScanner()->emitError ( XMLErrs::UndeclaredElemInCM , curElem.getFullName() ); } else { } } // // Then check all of the attributes of the current element. // We check for: // // 1) Multiple ID attributes // 2) That all of the default values of attributes are // valid for their type. // 3) That for any notation types, that their lists // of possible values refer to declared notations. // if (curElem.hasAttDefs()) { XMLAttDefList& attDefList = curElem.getAttDefList(); bool seenId = false; for(XMLSize_t i=0; i janList(list, fMemoryManager); // // Search forward for a space or a null. If a null, // we are done. If a space, cap it and look it up. // bool breakFlag = false; XMLCh* listPtr = list; XMLCh* lastPtr = listPtr; while (true) { while (*listPtr && (*listPtr != chSpace)) listPtr++; // // If at the end, indicate we need to break after // this one. Else, cap it off here. // if (!*listPtr) breakFlag = true; else *listPtr = chNull; if (!sGrammar.getNotationDecl(lastPtr)) { emitError ( XMLValid::UnknownNotRefAttr , curAttDef.getFullName() , lastPtr ); } // Break out if we hit the end last time if (breakFlag) break; // Else move upwards and try again listPtr++; lastPtr = listPtr; } } // If it has a default/fixed value, then validate it if (validateDefAttr && curAttDef.getValue()) { validateAttrValue ( &curAttDef , curAttDef.getValue() , true , &curElem ); } } } } // For each complex type info, check the Unique Particle Attribution if (getScanner()->getValidationSchemaFullChecking()) { RefHashTableOf* complexTypeRegistry = sGrammar.getComplexTypeRegistry(); RefHashTableOfEnumerator complexTypeEnum(complexTypeRegistry, false, fMemoryManager); while (complexTypeEnum.hasMoreElements()) { ComplexTypeInfo& curTypeInfo = complexTypeEnum.nextElement(); curTypeInfo.checkUniqueParticleAttribution(&sGrammar, fGrammarResolver, fGrammarResolver->getStringPool(), this); checkParticleDerivation(&sGrammar, &curTypeInfo); checkRefElementConsistency(&sGrammar, &curTypeInfo); } RefHashTableOf* groupInfoRegistry = sGrammar.getGroupInfoRegistry(); RefHashTableOfEnumerator groupEnum(groupInfoRegistry, false, fMemoryManager); while (groupEnum.hasMoreElements()) { XercesGroupInfo& curGroup = groupEnum.nextElement(); XercesGroupInfo* baseGroup = curGroup.getBaseGroup(); if (baseGroup) { try { checkParticleDerivationOk(&sGrammar, curGroup.getContentSpec(), curGroup.getScope(), baseGroup->getContentSpec(), baseGroup->getScope()); } catch (const XMLException& excep) { fSchemaErrorReporter.emitError(excep, curGroup.getLocator()); } } if (curGroup.getCheckElementConsistency()) checkRefElementConsistency(&sGrammar, 0, &curGroup); } } } } void SchemaValidator::postParseValidation() { // // At this time, there is nothing to do here. The scanner itself handles // ID/IDREF validation, since that is the same no matter what kind of // validator. // } // --------------------------------------------------------------------------- // SchemaValidator: Validator method // --------------------------------------------------------------------------- // Do Schema Normalization depends on the WhiteSpace Facet // preserve : No normalization is done // replace : All occurrences of #x9 (tab), #xA (linefeed) and #xD (carriage return) // are replaced with #x20 (space). // collapse : Subsequent to the replacements specified above under replace, // contiguous sequences of #x20s are collapsed to a single #x20, // and initial and/or final #x20s are deleted. // void SchemaValidator::normalizeWhiteSpace(DatatypeValidator* dV, const XMLCh* const value, XMLBuffer& toFill, bool bStandalone /*= false*/) { toFill.reset(); //empty string if (!*value) return; if(bStandalone) fTrailing = fSeenNonWhiteSpace = false; short wsFacet = dV->getWSFacet(); // Loop through the chars of the source value and normalize it // according to the whitespace facet XMLCh nextCh; const XMLCh* srcPtr = value; XMLReader* fCurReader = getReaderMgr()->getCurrentReader(); if (wsFacet == DatatypeValidator::REPLACE) { while (*srcPtr) { nextCh = *srcPtr++; if (fCurReader->isWhitespace(nextCh)) nextCh = chSpace; // Add this char to the target buffer toFill.append(nextCh); } } else // COLLAPSE { enum States { InWhitespace , InContent }; States curState = fTrailing ? InWhitespace : InContent; while (*srcPtr) { nextCh = *srcPtr++; if (curState == InContent) { if (fCurReader->isWhitespace(nextCh)) { curState = InWhitespace; continue; } fSeenNonWhiteSpace = true; } else if (curState == InWhitespace) { if (fCurReader->isWhitespace(nextCh)) continue; if (fSeenNonWhiteSpace) toFill.append(chSpace); curState = InContent; fSeenNonWhiteSpace = true; } // Add this char to the target buffer toFill.append(nextCh); } if (fCurReader->isWhitespace(*(srcPtr-1))) fTrailing = true; else fTrailing = false; } if(bStandalone) fTrailing = fSeenNonWhiteSpace = false; } // --------------------------------------------------------------------------- // SchemaValidator: Particle Derivation Checking // --------------------------------------------------------------------------- void SchemaValidator::checkRefElementConsistency(SchemaGrammar* const currentGrammar, const ComplexTypeInfo* const curTypeInfo, const XercesGroupInfo* const curGroup) { XMLSize_t elemCount = (curTypeInfo) ? curTypeInfo->elementCount() : curGroup->elementCount(); int elemScope = (curTypeInfo) ? curTypeInfo->getScopeDefined() : curGroup->getScope(); XSDLocator* typeInfoLocator = (curTypeInfo) ? curTypeInfo->getLocator() : curGroup->getLocator(); for (XMLSize_t i=0; i < elemCount; i++) { const SchemaElementDecl* elemDecl = (curTypeInfo) ? curTypeInfo->elementAt(i) : curGroup->elementAt(i); if (elemDecl->isGlobalDecl()) { unsigned int elemURI = elemDecl->getURI(); const XMLCh* elemName = elemDecl->getBaseName(); const SchemaElementDecl* other = (SchemaElementDecl*) currentGrammar->getElemDecl(elemURI, elemName, 0, elemScope); if (other && (elemDecl->getComplexTypeInfo() != other->getComplexTypeInfo() || elemDecl->getDatatypeValidator() != other->getDatatypeValidator())) { fSchemaErrorReporter.emitError(XMLErrs::DuplicateElementDeclaration, XMLUni::fgXMLErrDomain, typeInfoLocator, elemName, 0, 0, 0, fMemoryManager); continue; } RefHash2KeysTableOf* validSubsGroups = currentGrammar->getValidSubstitutionGroups(); ValueVectorOf* subsElements = validSubsGroups->get(elemName, elemURI); if (subsElements) { XMLSize_t subsElemSize = subsElements->size(); for (XMLSize_t j=0; j < subsElemSize; j++) { SchemaElementDecl* subsElem = subsElements->elementAt(j); const XMLCh* subsElemName = subsElem->getBaseName(); other = (SchemaElementDecl*) currentGrammar->getElemDecl(subsElem->getURI(), subsElemName, 0, elemScope); if (other && (subsElem->getComplexTypeInfo() != other->getComplexTypeInfo() || subsElem->getDatatypeValidator() != other->getDatatypeValidator())) { fSchemaErrorReporter.emitError(XMLErrs::DuplicateElementDeclaration, XMLUni::fgXMLErrDomain, typeInfoLocator, elemName, 0, 0, 0, fMemoryManager); } } } } } } // --------------------------------------------------------------------------- // SchemaValidator: Particle Derivation Checking // --------------------------------------------------------------------------- void SchemaValidator::checkParticleDerivation(SchemaGrammar* const currentGrammar, const ComplexTypeInfo* const curTypeInfo) { ComplexTypeInfo* baseTypeInfo = 0; ContentSpecNode* curSpecNode = 0; if (curTypeInfo->getDerivedBy() == SchemaSymbols::XSD_RESTRICTION && ((baseTypeInfo = curTypeInfo->getBaseComplexTypeInfo()) != 0) && ((curSpecNode = curTypeInfo->getContentSpec()) != 0)) { try { checkParticleDerivationOk(currentGrammar, curSpecNode, curTypeInfo->getScopeDefined(), baseTypeInfo->getContentSpec(), baseTypeInfo->getScopeDefined(), baseTypeInfo); } catch (const XMLException& excep) { fSchemaErrorReporter.emitError(excep, curTypeInfo->getLocator()); } } } ContentSpecNode* SchemaValidator::getNonUnaryGroup(ContentSpecNode* const pNode) { int pNodeType = (pNode->getType() & 0x0f); if (pNodeType == ContentSpecNode::Leaf || pNodeType == ContentSpecNode::Any || pNodeType == ContentSpecNode::Any_Other || pNodeType == ContentSpecNode::Any_NS) return pNode; if (pNode->getMinOccurs() == 1 && pNode->getMaxOccurs() == 1 && pNode->getFirst() && !pNode->getSecond()) return getNonUnaryGroup(pNode->getFirst()); return pNode; } void SchemaValidator::checkParticleDerivationOk(SchemaGrammar* const aGrammar, ContentSpecNode* const curNode, const int derivedScope, ContentSpecNode* const baseNode, const int baseScope, const ComplexTypeInfo* const baseInfo, const bool toCheckOccurence) { // Check for pointless occurrences of all, choice, sequence. The result is // the contentspec which is not pointless. If the result is a non-pointless // group, Vector is filled in with the children of interest if (curNode && !baseNode) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_EmptyBase, fMemoryManager); if (!curNode) return; ContentSpecNode* curSpecNode = getNonUnaryGroup(curNode); ContentSpecNode* baseSpecNode = getNonUnaryGroup(baseNode); ValueVectorOf curVector(8, fMemoryManager); ValueVectorOf baseVector(8, fMemoryManager); ContentSpecNode::NodeTypes curNodeType = curSpecNode->getType(); ContentSpecNode::NodeTypes baseNodeType = baseSpecNode->getType(); if ((curNodeType & 0x0f) == ContentSpecNode::Sequence || (curNodeType & 0x0f) == ContentSpecNode::Choice || curNodeType == ContentSpecNode::All) { curSpecNode = checkForPointlessOccurrences(curSpecNode, curNodeType, &curVector); } if ((baseNodeType & 0x0f) == ContentSpecNode::Sequence || (baseNodeType & 0x0f) == ContentSpecNode::Choice || baseNodeType == ContentSpecNode::All) { baseSpecNode = checkForPointlessOccurrences(baseSpecNode, baseNodeType, &baseVector); } curNodeType = curSpecNode->getType(); baseNodeType = baseSpecNode->getType(); switch (curNodeType & 0x0f) { case ContentSpecNode::Leaf: { switch (baseNodeType & 0x0f) { case ContentSpecNode::Leaf: { checkNameAndTypeOK(aGrammar, curSpecNode, derivedScope, baseSpecNode, baseScope, baseInfo); return; } case ContentSpecNode::Any: case ContentSpecNode::Any_Other: case ContentSpecNode::Any_NS: { checkNSCompat(curSpecNode, baseSpecNode, toCheckOccurence); return; } case ContentSpecNode::Choice: case ContentSpecNode::Sequence: case ContentSpecNode::All: { checkRecurseAsIfGroup(aGrammar, curSpecNode, derivedScope, baseSpecNode, baseScope, &baseVector, baseInfo); return; } default: { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_InvalidContentType, fMemoryManager); } } } case ContentSpecNode::Any: case ContentSpecNode::Any_Other: case ContentSpecNode::Any_NS: { switch (baseNodeType & 0x0f) { case ContentSpecNode::Any: case ContentSpecNode::Any_Other: case ContentSpecNode::Any_NS: { checkNSSubset(curSpecNode, baseSpecNode); return; } case ContentSpecNode::Choice: case ContentSpecNode::Sequence: case ContentSpecNode::All: case ContentSpecNode::Leaf: { if (baseNodeType == ContentSpecNode::Any_NS_Choice) { if (checkNSSubsetChoiceRoot(curSpecNode, baseSpecNode)) { return; } } ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_ForbiddenRes1, fMemoryManager); } default: { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_InvalidContentType, fMemoryManager); } } } case ContentSpecNode::All: { switch (baseNodeType & 0x0f) { case ContentSpecNode::Any: case ContentSpecNode::Any_Other: case ContentSpecNode::Any_NS: { checkNSRecurseCheckCardinality(aGrammar, curSpecNode, &curVector, derivedScope, baseSpecNode, toCheckOccurence); return; } case ContentSpecNode::All: { checkRecurse(aGrammar, curSpecNode, derivedScope, &curVector, baseSpecNode, baseScope, &baseVector, baseInfo); return; } case ContentSpecNode::Choice: case ContentSpecNode::Sequence: case ContentSpecNode::Leaf: { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_ForbiddenRes2, fMemoryManager); } default: { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_InvalidContentType, fMemoryManager); } } } case ContentSpecNode::Choice: { switch (baseNodeType & 0x0f) { case ContentSpecNode::Any: case ContentSpecNode::Any_Other: case ContentSpecNode::Any_NS: { checkNSRecurseCheckCardinality(aGrammar, curSpecNode, &curVector, derivedScope, baseSpecNode, toCheckOccurence); return; } case ContentSpecNode::Choice: { checkRecurse(aGrammar, curSpecNode, derivedScope, &curVector, baseSpecNode, baseScope, &baseVector, baseInfo, true); return; } case ContentSpecNode::All: case ContentSpecNode::Sequence: case ContentSpecNode::Leaf: { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_ForbiddenRes3, fMemoryManager); } default: { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_InvalidContentType, fMemoryManager); } } } case ContentSpecNode::Sequence: { switch (baseNodeType & 0x0f) { case ContentSpecNode::Any: case ContentSpecNode::Any_Other: case ContentSpecNode::Any_NS: { checkNSRecurseCheckCardinality(aGrammar, curSpecNode, &curVector, derivedScope, baseSpecNode, toCheckOccurence); return; } case ContentSpecNode::All: { checkRecurseUnordered(aGrammar, curSpecNode, &curVector, derivedScope, baseSpecNode, &baseVector, baseScope, baseInfo); return; } case ContentSpecNode::Sequence: { checkRecurse(aGrammar, curSpecNode, derivedScope, &curVector, baseSpecNode, baseScope, &baseVector, baseInfo); return; } case ContentSpecNode::Choice: { checkMapAndSum(aGrammar, curSpecNode, &curVector, derivedScope, baseSpecNode, &baseVector, baseScope, baseInfo); return; } case ContentSpecNode::Leaf: { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_ForbiddenRes4, fMemoryManager); } default: { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_InvalidContentType, fMemoryManager); } } } } } ContentSpecNode* SchemaValidator::checkForPointlessOccurrences(ContentSpecNode* const specNode, const ContentSpecNode::NodeTypes nodeType, ValueVectorOf* const nodes) { ContentSpecNode* rightNode = specNode->getSecond(); int min = specNode->getMinOccurs(); int max = specNode->getMaxOccurs(); if (!rightNode) { gatherChildren(nodeType, specNode->getFirst(), nodes); if (nodes->size() == 1 && min == 1 && max == 1) { return nodes->elementAt(0); } return specNode; } gatherChildren(nodeType, specNode->getFirst(), nodes); gatherChildren(nodeType, rightNode, nodes); return specNode; } void SchemaValidator::gatherChildren(const ContentSpecNode::NodeTypes parentNodeType, ContentSpecNode* const specNode, ValueVectorOf* const nodes) { if (!specNode) { return; } int min = specNode->getMinOccurs(); int max = specNode->getMaxOccurs(); ContentSpecNode::NodeTypes nodeType = specNode->getType(); ContentSpecNode* rightNode = specNode->getSecond(); if (nodeType == ContentSpecNode::Leaf || (nodeType & 0x0f) == ContentSpecNode::Any || (nodeType & 0x0f) == ContentSpecNode::Any_NS || (nodeType & 0x0f) == ContentSpecNode::Any_Other) { nodes->addElement(specNode); } else if (min !=1 || max != 1) { nodes->addElement(specNode); } else if (!rightNode) { gatherChildren(nodeType, specNode->getFirst(), nodes); } else if ((parentNodeType & 0x0f) == (nodeType & 0x0f)) { gatherChildren(nodeType, specNode->getFirst(), nodes); gatherChildren(nodeType, rightNode, nodes); } else { nodes->addElement(specNode); } } void SchemaValidator::checkNSCompat(const ContentSpecNode* const derivedSpecNode, const ContentSpecNode* const baseSpecNode, const bool toCheckOccurence) { // check Occurrence ranges if (toCheckOccurence && !isOccurrenceRangeOK(derivedSpecNode->getMinOccurs(), derivedSpecNode->getMaxOccurs(), baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_OccurRangeE, derivedSpecNode->getElement()->getLocalPart(), fMemoryManager); } // check wildcard subset if (!wildcardEltAllowsNamespace(baseSpecNode, derivedSpecNode->getElement()->getURI())) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_NSCompat1, derivedSpecNode->getElement()->getLocalPart(), fMemoryManager); } } bool SchemaValidator::wildcardEltAllowsNamespace(const ContentSpecNode* const baseSpecNode, const unsigned int derivedURI) { ContentSpecNode::NodeTypes nodeType = baseSpecNode->getType(); if ((nodeType & 0x0f) == ContentSpecNode::Any) { return true; } unsigned int baseURI = baseSpecNode->getElement()->getURI(); if ((nodeType & 0x0f) == ContentSpecNode::Any_NS) { if (derivedURI == baseURI) { return true; } } else { // must be ANY_OTHER if (derivedURI != baseURI && derivedURI != getScanner()->getEmptyNamespaceId()) { return true; } } return false; } void SchemaValidator::checkNameAndTypeOK(SchemaGrammar* const currentGrammar, const ContentSpecNode* const derivedSpecNode, const int derivedScope, const ContentSpecNode* const baseSpecNode, const int baseScope, const ComplexTypeInfo* const baseInfo) { if (derivedSpecNode->getMaxOccurs() == 0) return; unsigned int derivedURI = derivedSpecNode->getElement()->getURI(); // case of mixed complex types with attributes only if (derivedURI == XMLElementDecl::fgPCDataElemId) { return; } SchemaGrammar* dGrammar = currentGrammar; if (derivedURI != getScanner()->getEmptyNamespaceId()) { const XMLCh* dURI = fGrammarResolver->getStringPool()->getValueForId(derivedURI); dGrammar= (SchemaGrammar*) fGrammarResolver->getGrammar(dURI); } if (!dGrammar) { //something is wrong return; } const XMLCh* derivedName = derivedSpecNode->getElement()->getLocalPart(); SchemaElementDecl* derivedElemDecl = findElement(derivedScope, derivedURI, derivedName, dGrammar); if (!derivedElemDecl) { return; } const XMLCh* baseName = baseSpecNode->getElement()->getLocalPart(); unsigned int baseURI = baseSpecNode->getElement()->getURI(); bool subsGroup = false; if (!XMLString::equals(derivedName, baseName) || derivedURI != baseURI) { // Check if derived is substitutable for base. // SchemaElementDecl* e = derivedElemDecl->getSubstitutionGroupElem (); for (; e != 0; e = e->getSubstitutionGroupElem ()) { if (XMLString::equals(e->getBaseName (), baseName) && e->getURI () == baseURI) { break; } } if (e == 0) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_NameTypeOK1, fMemoryManager); } subsGroup = true; } if (!isOccurrenceRangeOK(derivedSpecNode->getMinOccurs(), derivedSpecNode->getMaxOccurs(), baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_OccurRangeE, derivedName, fMemoryManager); } // Find the schema grammar for the base element using the base type as // a reference if it is available (it is unavailable if we are checking // element group restriction which happens in redefine). // SchemaGrammar* bGrammar = dGrammar; if (baseInfo) { const XMLCh* baseTypeURI = baseInfo->getTypeUri (); if (baseTypeURI != 0 && *baseTypeURI != 0) // Non-empty namespace. bGrammar= (SchemaGrammar*) fGrammarResolver->getGrammar(baseTypeURI); if (!bGrammar) { //something is wrong return; } } SchemaElementDecl* baseElemDecl = findElement(baseScope, baseURI, baseName, bGrammar, baseInfo); if (!baseElemDecl) { return; } int derivedFlags = derivedElemDecl->getMiscFlags(); int baseFlags = baseElemDecl->getMiscFlags(); if (((baseFlags & SchemaSymbols::XSD_NILLABLE) == 0) && ((derivedFlags & SchemaSymbols::XSD_NILLABLE) != 0)) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_NameTypeOK2, derivedName, fMemoryManager); } const XMLCh* derivedDefVal = derivedElemDecl->getDefaultValue(); const XMLCh* baseDefVal = baseElemDecl->getDefaultValue(); if (baseDefVal && (baseFlags & SchemaSymbols::XSD_FIXED) != 0 && ((derivedFlags & SchemaSymbols::XSD_FIXED) == 0 || !XMLString::equals(derivedDefVal, baseDefVal))) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_NameTypeOK3, derivedName, fMemoryManager); } int derivedBlockSet = derivedElemDecl->getBlockSet(); int baseBlockSet = baseElemDecl->getBlockSet(); if ((derivedBlockSet & baseBlockSet) != baseBlockSet) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_NameTypeOK4, derivedName, fMemoryManager); } // check identity constraints checkICRestriction(derivedElemDecl, baseElemDecl, derivedName, baseName); // check that the derived element's type is derived from the base's. if (!subsGroup) checkTypesOK(derivedElemDecl, baseElemDecl, derivedName); } SchemaElementDecl* SchemaValidator::findElement(const int scope, const unsigned int uriIndex, const XMLCh* const name, SchemaGrammar* const grammar, const ComplexTypeInfo* const typeInfo) { // check for element at given scope first SchemaElementDecl* elemDecl = (SchemaElementDecl*) grammar->getElemDecl(uriIndex, name, 0, scope); // if not found, check at global scope if (!elemDecl) { elemDecl = (SchemaElementDecl*) grammar->getElemDecl(uriIndex, name, 0, Grammar::TOP_LEVEL_SCOPE); // if still not found, and base is specified, look it up there if (!elemDecl && typeInfo) { const ComplexTypeInfo* baseInfo = typeInfo; while (baseInfo) { elemDecl = (SchemaElementDecl*) grammar->getElemDecl(uriIndex, name, 0, baseInfo->getScopeDefined()); if (elemDecl) { break; } baseInfo = baseInfo->getBaseComplexTypeInfo(); } } } return elemDecl; } void SchemaValidator::checkICRestriction(const SchemaElementDecl* const derivedElemDecl, const SchemaElementDecl* const baseElemDecl, const XMLCh* const derivedElemName, const XMLCh* const baseElemName) { // REVIST - need to get more clarification XMLSize_t derivedICCount = derivedElemDecl->getIdentityConstraintCount(); XMLSize_t baseICCount = baseElemDecl->getIdentityConstraintCount(); if (derivedICCount > baseICCount) { ThrowXMLwithMemMgr2(RuntimeException, XMLExcepts::PD_NameTypeOK6, derivedElemName, baseElemName, fMemoryManager); } for (XMLSize_t i=0; i < derivedICCount; i++) { bool found = false; IdentityConstraint* ic= derivedElemDecl->getIdentityConstraintAt(i); for (XMLSize_t j=0; j < baseICCount; j++) { if (*ic == *(baseElemDecl->getIdentityConstraintAt(j))) { found = true; break; } } if (!found) { ThrowXMLwithMemMgr2(RuntimeException, XMLExcepts::PD_NameTypeOK7, derivedElemName, baseElemName, fMemoryManager); } } } void SchemaValidator::checkTypesOK(const SchemaElementDecl* const derivedElemDecl, const SchemaElementDecl* const baseElemDecl, const XMLCh* const derivedElemName) { SchemaElementDecl::ModelTypes baseType = baseElemDecl->getModelType(); if (baseType == SchemaElementDecl::Any) { return; } ComplexTypeInfo* rInfo = derivedElemDecl->getComplexTypeInfo(); ComplexTypeInfo* bInfo = baseElemDecl->getComplexTypeInfo(); if (derivedElemDecl->getModelType() == SchemaElementDecl::Simple) { if (baseType != SchemaElementDecl::Simple) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_NameTypeOK5, derivedElemName, fMemoryManager); } if (!rInfo) { DatatypeValidator* bDV = baseElemDecl->getDatatypeValidator(); if (bInfo || bDV == 0 || !bDV->isSubstitutableBy(derivedElemDecl->getDatatypeValidator())) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_NameTypeOK5, derivedElemName, fMemoryManager); } return; } } if (rInfo == bInfo) return; for (; rInfo && rInfo != bInfo; rInfo = rInfo->getBaseComplexTypeInfo()) { if (rInfo->getDerivedBy() != SchemaSymbols::XSD_RESTRICTION) { rInfo = 0; break; } } if (!rInfo) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_NameTypeOK5, derivedElemName, fMemoryManager); } } void SchemaValidator::checkRecurseAsIfGroup(SchemaGrammar* const currentGrammar, ContentSpecNode* const derivedSpecNodeIn, const int derivedScope, const ContentSpecNode* const baseSpecNode, const int baseScope, ValueVectorOf* const baseNodes, const ComplexTypeInfo* const baseInfo) { ContentSpecNode::NodeTypes baseType = baseSpecNode->getType(); bool toLax = false; //Treat the element as if it were in a group of the same variety as base ContentSpecNode derivedGroupNode(baseType, derivedSpecNodeIn, 0, false, true, fMemoryManager); const ContentSpecNode* const derivedSpecNode = &derivedGroupNode; if ((baseSpecNode->getType() & 0x0f) == ContentSpecNode::Choice) { toLax = true; } // Instead of calling this routine, inline it // checkRecurse(currentGrammar, &derivedGroupNode, derivedScope, &derivedNodes, // baseSpecNode, baseScope, baseNodes, baseInfo, toLax); if (!isOccurrenceRangeOK(derivedSpecNode->getMinOccurs(), derivedSpecNode->getMaxOccurs(), baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_Recurse1, fMemoryManager); } // check for mapping of children XMLExcepts::Codes codeToThrow = XMLExcepts::NoError; XMLSize_t count2= baseNodes->size(); XMLSize_t current = 0; { bool matched = false; for (XMLSize_t j = current; j < count2; j++) { ContentSpecNode* baseNode = baseNodes->elementAt(j); current++; bool bDoBreak=false; // workaround for Borland bug with 'break' in 'catch' try { checkParticleDerivationOk(currentGrammar, derivedSpecNodeIn, derivedScope, baseNode, baseScope, baseInfo); matched = true; break; } catch(const XMLException&) { if (!toLax && baseNode->getMinTotalRange()) { bDoBreak=true; } } if(bDoBreak) break; } // did not find a match if (!matched) { codeToThrow = XMLExcepts::PD_Recurse2; } } // Now, see if there are some elements in the base we didn't match up // in case of Sequence or All if (!toLax && codeToThrow == XMLExcepts::NoError) { for (XMLSize_t j = current; j < count2; j++) { if (baseNodes->elementAt(j)->getMinTotalRange() * baseSpecNode->getMinOccurs()) { //!emptiable codeToThrow = XMLExcepts::PD_Recurse2; break; } } } if (codeToThrow != XMLExcepts::NoError) { ThrowXMLwithMemMgr(RuntimeException, codeToThrow, fMemoryManager); } } void SchemaValidator::checkRecurse(SchemaGrammar* const currentGrammar, const ContentSpecNode* const derivedSpecNode, const int derivedScope, ValueVectorOf* const derivedNodes, const ContentSpecNode* const baseSpecNode, const int baseScope, ValueVectorOf* const baseNodes, const ComplexTypeInfo* const baseInfo, const bool toLax) { if (!isOccurrenceRangeOK(derivedSpecNode->getMinOccurs(), derivedSpecNode->getMaxOccurs(), baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_Recurse1, fMemoryManager); } // check for mapping of children XMLExcepts::Codes codeToThrow = XMLExcepts::NoError; XMLSize_t count1= derivedNodes->size(); XMLSize_t count2= baseNodes->size(); XMLSize_t current = 0; for (XMLSize_t i=0; ielementAt(j); current++; bool bDoBreak=false; // workaround for Borland bug with 'break' in 'catch' try { checkParticleDerivationOk(currentGrammar, derivedNodes->elementAt(i), derivedScope, baseNode, baseScope, baseInfo); matched = true; break; } catch(const XMLException&) { if (!toLax && baseNode->getMinTotalRange()) { bDoBreak=true; } } if(bDoBreak) break; } // did not find a match if (!matched) { codeToThrow = XMLExcepts::PD_Recurse2; break; } } // Now, see if there are some elements in the base we didn't match up // in case of Sequence or All if (!toLax && codeToThrow == XMLExcepts::NoError) { for (XMLSize_t j = current; j < count2; j++) { if (baseNodes->elementAt(j)->getMinTotalRange()) { //!emptiable codeToThrow = XMLExcepts::PD_Recurse2; break; } } } if (codeToThrow != XMLExcepts::NoError) { ThrowXMLwithMemMgr(RuntimeException, codeToThrow, fMemoryManager); } } void SchemaValidator::checkNSSubset(const ContentSpecNode* const derivedSpecNode, const ContentSpecNode* const baseSpecNode) { // check Occurrence ranges if (!isOccurrenceRangeOK(derivedSpecNode->getMinOccurs(), derivedSpecNode->getMaxOccurs(), baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_NSSubset1, fMemoryManager); } if (!isWildCardEltSubset(derivedSpecNode, baseSpecNode)) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_NSSubset2, fMemoryManager); } } bool SchemaValidator::checkNSSubsetChoiceRoot(const ContentSpecNode* const derivedSpecNode, const ContentSpecNode* const baseSpecNode) { bool found = false; if (baseSpecNode->getType() == ContentSpecNode::Any_NS_Choice) { const ContentSpecNode* first = baseSpecNode->getFirst(); const ContentSpecNode* second = baseSpecNode->getSecond(); if (first) { found = checkNSSubsetChoiceRoot(derivedSpecNode, first); if (found) return true; } if (second) { found = checkNSSubsetChoiceRoot(derivedSpecNode, second); if (found) return true; } } else { // should be Any_NS found = checkNSSubsetChoice(derivedSpecNode, baseSpecNode); } return found; } bool SchemaValidator::checkNSSubsetChoice(const ContentSpecNode* const derivedSpecNode, const ContentSpecNode* const baseSpecNode) { // check Occurrence ranges if (!isOccurrenceRangeOK(derivedSpecNode->getMinOccurs(), derivedSpecNode->getMaxOccurs(), baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) { return false; } if (!isWildCardEltSubset(derivedSpecNode, baseSpecNode)) { return false; } return true; } bool SchemaValidator::isWildCardEltSubset(const ContentSpecNode* const derivedSpecNode, const ContentSpecNode* const baseSpecNode) { ContentSpecNode::NodeTypes baseType = baseSpecNode->getType(); if ((baseType & 0x0f) == ContentSpecNode::Any) { return true; } ContentSpecNode::NodeTypes derivedType = derivedSpecNode->getType(); unsigned int baseURI = baseSpecNode->getElement()->getURI(); unsigned int derivedURI = derivedSpecNode->getElement()->getURI(); // Below we assume that empty string has id 1. // if (((derivedType & 0x0f) == ContentSpecNode::Any_Other) && ((baseType & 0x0f) == ContentSpecNode::Any_Other) && (baseURI == derivedURI || baseURI == 1)) { return true; } if ((derivedType & 0x0f) == ContentSpecNode::Any_NS) { if (((baseType & 0x0f) == ContentSpecNode::Any_NS) && baseURI == derivedURI) { return true; } if (((baseType & 0x0f) == ContentSpecNode::Any_Other) && (derivedURI == 1 || baseURI != derivedURI)) { return true; } } return false; } void SchemaValidator::checkNSRecurseCheckCardinality(SchemaGrammar* const currentGrammar, const ContentSpecNode* const derivedSpecNode, ValueVectorOf* const derivedNodes, const int derivedScope, ContentSpecNode* const baseSpecNode, const bool toCheckOccurence) { // Implement total range check int derivedMin = derivedSpecNode->getMinTotalRange(); int derivedMax = derivedSpecNode->getMaxTotalRange(); // check Occurrence ranges if (toCheckOccurence && !isOccurrenceRangeOK(derivedMin, derivedMax, baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_NSRecurseCheckCardinality1, fMemoryManager); } // Check that each member of the group is a valid restriction of the wildcard XMLSize_t nodesCount = derivedNodes->size(); for (XMLSize_t i = 0; i < nodesCount; i++) { checkParticleDerivationOk(currentGrammar, derivedNodes->elementAt(i), derivedScope, baseSpecNode, -1, 0, false); } } void SchemaValidator::checkRecurseUnordered(SchemaGrammar* const currentGrammar, const ContentSpecNode* const derivedSpecNode, ValueVectorOf* const derivedNodes, const int derivedScope, ContentSpecNode* const baseSpecNode, ValueVectorOf* const baseNodes, const int baseScope, const ComplexTypeInfo* const baseInfo) { // check Occurrence ranges if (!isOccurrenceRangeOK(derivedSpecNode->getMinOccurs(), derivedSpecNode->getMaxOccurs(), baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_Recurse1, fMemoryManager); } XMLExcepts::Codes codeToThrow = XMLExcepts::NoError; XMLSize_t derivedCount= derivedNodes->size(); XMLSize_t baseCount = baseNodes->size(); bool* foundIt = (bool*) fMemoryManager->allocate ( baseCount * sizeof(bool) );//new bool[baseCount]; ArrayJanitor janFoundIt(foundIt, fMemoryManager); for (XMLSize_t k=0; k < baseCount; k++) { foundIt[k] = false; } // check for mapping of children for (XMLSize_t i = 0; i < derivedCount; i++) { ContentSpecNode* derivedNode = derivedNodes->elementAt(i); bool matched = false; for (XMLSize_t j = 0; j < baseCount; j++) { try { checkParticleDerivationOk(currentGrammar, derivedNode, derivedScope, baseNodes->elementAt(j), baseScope, baseInfo); if (foundIt[j]) { break; } foundIt[j] = true; matched = true; break; } catch (const XMLException&) { } } // didn't find a match. if (!matched) { codeToThrow = XMLExcepts::PD_RecurseUnordered; break; } } // For all unmapped particles in base, check to see it it's emptiable or not if (codeToThrow == XMLExcepts::NoError) { for (XMLSize_t j=0; j < baseCount; j++) { if (!foundIt[j] && baseNodes->elementAt(j)->getMinTotalRange()) { codeToThrow = XMLExcepts::PD_RecurseUnordered; break; } } } if (codeToThrow != XMLExcepts::NoError) { ThrowXMLwithMemMgr(RuntimeException, codeToThrow, fMemoryManager); } } void SchemaValidator::checkMapAndSum(SchemaGrammar* const currentGrammar, const ContentSpecNode* const derivedSpecNode, ValueVectorOf* const derivedNodes, const int derivedScope, ContentSpecNode* const baseSpecNode, ValueVectorOf* const baseNodes, const int baseScope, const ComplexTypeInfo* const baseInfo) { // check Occurrence ranges XMLSize_t derivedCount = derivedNodes->size(); XMLSize_t baseCount = baseNodes->size(); int derivedMin = derivedSpecNode->getMinOccurs() * (unsigned int)derivedCount; int derivedMax = derivedSpecNode->getMaxOccurs(); if (derivedMax != SchemaSymbols::XSD_UNBOUNDED) { derivedMax *= (unsigned int)derivedCount; } if (!isOccurrenceRangeOK(derivedMin, derivedMax, baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_Recurse1, fMemoryManager); } // check for mapping of children for (XMLSize_t i = 0; i < derivedCount; i++) { ContentSpecNode* derivedNode = derivedNodes->elementAt(i); bool matched = false; for (XMLSize_t j = 0; j < baseCount && !matched; j++) { try { checkParticleDerivationOk(currentGrammar, derivedNode, derivedScope, baseNodes->elementAt(j), baseScope, baseInfo); matched = true; } catch (const XMLException&) { } } // didn't find a match. if (!matched) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_MapAndSum, fMemoryManager); } } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/schema/TraverseSchema.cpp000644 000765 000024 00001277125 13241160332 025330 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: TraverseSchema.cpp 1141163 2011-06-29 16:50:25Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // TraverseSchema: Local declaration // --------------------------------------------------------------------------- // This helper class will handle the parsing of namespace prefixes for a given DOMElement, and its winding back class NamespaceScopeManager { public: NamespaceScopeManager(const DOMElement* const node, SchemaInfo* info, TraverseSchema* traverser) { fScopeAdded=node?traverser->retrieveNamespaceMapping(node):false; fSchemaInfo=info; } ~NamespaceScopeManager() { if(fScopeAdded) fSchemaInfo->getNamespaceScope()->decreaseDepth(); } protected: bool fScopeAdded; SchemaInfo* fSchemaInfo; }; // --------------------------------------------------------------------------- // TraverseSchema: Static member data // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // TraverseSchema: Local const data // --------------------------------------------------------------------------- static const XMLCh fgAnonSNamePrefix[] = { chUnderscore, chUnderscore, chLatin_A, chLatin_n, chLatin_o, chLatin_n, chLatin_S, chNull }; static const XMLCh fgAnonCNamePrefix[] = { chUnderscore, chUnderscore, chLatin_A, chLatin_n, chLatin_o, chLatin_n, chLatin_C, chNull }; static const XMLCh fgUnbounded[] = { chLatin_u, chLatin_n, chLatin_b, chLatin_o, chLatin_u, chLatin_n, chLatin_d, chLatin_e, chLatin_d, chNull }; static const XMLCh fgValueOne[] = { chDigit_1, chNull }; static const XMLCh fgValueZero[] = { chDigit_0, chNull }; static const XMLCh* fgIdentityConstraints[] = { SchemaSymbols::fgELT_UNIQUE, SchemaSymbols::fgELT_KEY, SchemaSymbols::fgELT_KEYREF }; static const XMLCh fgSynthetic_Annotation[] = { chLatin_S, chLatin_y, chLatin_n, chLatin_t, chLatin_h, chLatin_e, chLatin_t , chLatin_i, chLatin_c, chUnderscore , chLatin_A, chLatin_n, chLatin_n, chLatin_o, chLatin_t, chLatin_a, chLatin_t , chLatin_i, chLatin_o, chLatin_n, chNull }; // Flags for global declaration enum { ENUM_ELT_SIMPLETYPE, ENUM_ELT_COMPLEXTYPE, ENUM_ELT_ELEMENT, ENUM_ELT_ATTRIBUTE, ENUM_ELT_ATTRIBUTEGROUP, ENUM_ELT_GROUP, ENUM_ELT_SIZE }; typedef JanitorMemFunCall CleanupType; // --------------------------------------------------------------------------- // TraverseSchema: Constructors and Destructor // --------------------------------------------------------------------------- TraverseSchema::TraverseSchema( DOMElement* const schemaRoot , XMLStringPool* const uriStringPool , SchemaGrammar* const schemaGrammar , GrammarResolver* const grammarResolver , RefHash2KeysTableOf* cachedSchemaInfoList , RefHash2KeysTableOf* schemaInfoList , XMLScanner* const xmlScanner , const XMLCh* const schemaURL , XMLEntityHandler* const entityHandler , XMLErrorReporter* const errorReporter , MemoryManager* const manager , bool multipleImport) : fFullConstraintChecking(false) , fTargetNSURI(-1) , fEmptyNamespaceURI(-1) , fCurrentScope(Grammar::TOP_LEVEL_SCOPE) , fScopeCount(schemaGrammar->getScopeCount ()) , fAnonXSTypeCount(schemaGrammar->getAnonTypeCount ()) , fCircularCheckIndex(0) , fTargetNSURIString(0) , fDatatypeRegistry(0) , fGrammarResolver(grammarResolver) , fSchemaGrammar(schemaGrammar) , fEntityHandler(entityHandler) , fErrorReporter(errorReporter) , fURIStringPool(uriStringPool) , fStringPool(0) , fBuffer(1023, manager) , fScanner(xmlScanner) , fAttributeDeclRegistry(0) , fComplexTypeRegistry(0) , fGroupRegistry(0) , fAttGroupRegistry(0) , fIC_ElementsNS(0) , fPreprocessedNodes(0) , fSchemaInfo(0) , fCurrentGroupInfo(0) , fCurrentAttGroupInfo(0) , fCurrentComplexType(0) , fCurrentTypeNameStack(0) , fCurrentGroupStack(0) , fIC_Elements(0) , fDeclStack(0) , fGlobalDeclarations(0) , fNonXSAttList(0) , fImportedNSList(0) , fIC_NodeListNS(0) , fNotationRegistry(0) , fRedefineComponents(0) , fIdentityConstraintNames(0) , fValidSubstitutionGroups(0) , fSchemaInfoList(schemaInfoList) , fCachedSchemaInfoList (cachedSchemaInfoList) , fParser(0) , fLocator(0) , fMemoryManager(manager) , fGrammarPoolMemoryManager(fGrammarResolver->getGrammarPoolMemoryManager()) , fAnnotation(0) , fAttributeCheck(manager) { CleanupType cleanup(this, &TraverseSchema::cleanUp); try { if (fGrammarResolver && schemaRoot && fURIStringPool) { init(); if (multipleImport) { // If we are working on an existing schema, do some // intitialization that is otherwise done by preprocessSchema. // fComplexTypeRegistry = fSchemaGrammar->getComplexTypeRegistry(); fGroupRegistry = fSchemaGrammar->getGroupInfoRegistry(); fAttGroupRegistry = fSchemaGrammar->getAttGroupInfoRegistry(); fAttributeDeclRegistry = fSchemaGrammar->getAttributeDeclRegistry(); fValidSubstitutionGroups = fSchemaGrammar->getValidSubstitutionGroups(); } preprocessSchema(schemaRoot, schemaURL, multipleImport); doTraverseSchema(schemaRoot); // Store the scope and anon type counts in case we need to add // more to this grammar (multi-import case). schemaGrammar and // fSchemaGrammar should be the same here. // fSchemaGrammar->setScopeCount (fScopeCount); fSchemaGrammar->setAnonTypeCount (fAnonXSTypeCount); } } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } TraverseSchema::~TraverseSchema() { cleanUp(); } // --------------------------------------------------------------------------- // TraverseSchema: Traversal methods // --------------------------------------------------------------------------- void TraverseSchema::doTraverseSchema(const DOMElement* const schemaRoot) { // process children nodes processChildren(schemaRoot); // Handle identity constraints - keyref if (fIC_ElementsNS && fIC_ElementsNS->containsKey(fTargetNSURIString)) { fIC_Elements = fIC_ElementsNS->get(fTargetNSURIString); XMLSize_t icListSize = fIC_Elements->size(); for (XMLSize_t i=0; i < icListSize; i++) { SchemaElementDecl* curElem = fIC_Elements->elementAt(i); ValueVectorOf* icNodes = fIC_NodeListNS->get(curElem); XMLSize_t icNodesSize = icNodes->size(); for (XMLSize_t j = 0; j < icNodesSize; j++) { traverseKeyRef(icNodes->elementAt(j), curElem); } } } if (fScanner->getValidateAnnotations() && !fSchemaGrammar->getAnnotations()->isEmpty()) { validateAnnotations(); } fSchemaInfo->setProcessed(); } void TraverseSchema::preprocessSchema(DOMElement* const schemaRoot, const XMLCh* const schemaURL, bool multipleImport) { if (!multipleImport) { // Make sure namespace binding is defaulted const XMLCh* rootPrefix = schemaRoot->getPrefix(); if (rootPrefix == 0 || !*rootPrefix) { const XMLCh* xmlnsStr = schemaRoot->getAttribute(XMLUni::fgXMLNSString); if (!xmlnsStr || !*xmlnsStr) { schemaRoot->setAttribute(XMLUni::fgXMLNSString, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); } } // Set schemaGrammar data and add it to GrammarResolver // For complex type registry, attribute decl registry , group/attGroup // and namespace mapping, needs to check whether the passed in // Grammar was a newly instantiated one. fComplexTypeRegistry = fSchemaGrammar->getComplexTypeRegistry(); if (fComplexTypeRegistry == 0 ) { fComplexTypeRegistry = new (fGrammarPoolMemoryManager) RefHashTableOf(29, fGrammarPoolMemoryManager); fSchemaGrammar->setComplexTypeRegistry(fComplexTypeRegistry); } fGroupRegistry = fSchemaGrammar->getGroupInfoRegistry(); if (fGroupRegistry == 0 ) { fGroupRegistry = new (fGrammarPoolMemoryManager) RefHashTableOf(13, fGrammarPoolMemoryManager); fSchemaGrammar->setGroupInfoRegistry(fGroupRegistry); } fAttGroupRegistry = fSchemaGrammar->getAttGroupInfoRegistry(); if (fAttGroupRegistry == 0 ) { fAttGroupRegistry = new (fGrammarPoolMemoryManager) RefHashTableOf(13, fGrammarPoolMemoryManager); fSchemaGrammar->setAttGroupInfoRegistry(fAttGroupRegistry); } fAttributeDeclRegistry = fSchemaGrammar->getAttributeDeclRegistry(); if (fAttributeDeclRegistry == 0) { fAttributeDeclRegistry = new (fGrammarPoolMemoryManager) RefHashTableOf(29, fGrammarPoolMemoryManager); fSchemaGrammar->setAttributeDeclRegistry(fAttributeDeclRegistry); } fValidSubstitutionGroups = fSchemaGrammar->getValidSubstitutionGroups(); if (!fValidSubstitutionGroups) { fValidSubstitutionGroups = new (fGrammarPoolMemoryManager) RefHash2KeysTableOf(29, fGrammarPoolMemoryManager); fSchemaGrammar->setValidSubstitutionGroups(fValidSubstitutionGroups); } //Retrieve the targetnamespace URI information const XMLCh* targetNSURIStr = schemaRoot->getAttribute(SchemaSymbols::fgATT_TARGETNAMESPACE); fSchemaGrammar->setTargetNamespace(targetNSURIStr); fCurrentScope = Grammar::TOP_LEVEL_SCOPE; fTargetNSURIString = fSchemaGrammar->getTargetNamespace(); fTargetNSURI = fURIStringPool->addOrFind(fTargetNSURIString); XMLSchemaDescription* gramDesc = (XMLSchemaDescription*) fSchemaGrammar->getGrammarDescription(); gramDesc->setTargetNamespace(fTargetNSURIString); fGrammarResolver->putGrammar(fSchemaGrammar); } else { fCurrentScope = Grammar::TOP_LEVEL_SCOPE; fTargetNSURIString = fSchemaGrammar->getTargetNamespace(); fTargetNSURI = fURIStringPool->addOrFind(fTargetNSURIString); } SchemaInfo* currInfo = new (fMemoryManager) SchemaInfo(0, 0, 0, fTargetNSURI, 0, schemaURL, fTargetNSURIString, schemaRoot, fScanner, fGrammarPoolMemoryManager); currInfo->getNamespaceScope()->reset(fEmptyNamespaceURI); // Add mapping for the xml prefix currInfo->getNamespaceScope()->addPrefix(XMLUni::fgXMLString, fURIStringPool->addOrFind(XMLUni::fgXMLURIName)); if (fSchemaInfo) fSchemaInfo->addSchemaInfo(currInfo, SchemaInfo::IMPORT); addImportedNS(currInfo->getTargetNSURI()); fSchemaInfo = currInfo; fSchemaInfoList->put((void*) fSchemaInfo->getCurrentSchemaURL(), fSchemaInfo->getTargetNSURI(), fSchemaInfo); fSchemaInfo->addSchemaInfo(fSchemaInfo, SchemaInfo::INCLUDE); traverseSchemaHeader(schemaRoot); // preprocess chidren preprocessChildren(schemaRoot); } void TraverseSchema::traverseSchemaHeader(const DOMElement* const schemaRoot) { // Make sure that the root element is if (!XMLString::equals(schemaRoot->getLocalName(), SchemaSymbols::fgELT_SCHEMA)) { reportSchemaError(schemaRoot, XMLUni::fgXMLErrDomain, XMLErrs::InvalidXMLSchemaRoot); } // Make sure that the targetNamespace value is not empty string checkForEmptyTargetNamespace(schemaRoot); // ----------------------------------------------------------------------- // Check Attributes // ----------------------------------------------------------------------- fAttributeCheck.checkAttributes( schemaRoot, GeneralAttributeCheck::E_Schema, this , true, fSchemaInfo->getNonXSAttList() ); retrieveNamespaceMapping(schemaRoot); // Add mapping for the default namespace if ((!fTargetNSURIString || !*fTargetNSURIString) && schemaRoot->getAttributeNode(XMLUni::fgXMLNSString)==NULL) fSchemaInfo->getNamespaceScope()->addPrefix(XMLUni::fgZeroLenString, fEmptyNamespaceURI); unsigned short elemAttrDefaultQualified = 0; if (XMLString::equals(schemaRoot->getAttribute(SchemaSymbols::fgATT_ELEMENTFORMDEFAULT), SchemaSymbols::fgATTVAL_QUALIFIED)) { elemAttrDefaultQualified |= Elem_Def_Qualified; } if (XMLString::equals(schemaRoot->getAttribute(SchemaSymbols::fgATT_ATTRIBUTEFORMDEFAULT), SchemaSymbols::fgATTVAL_QUALIFIED)) { elemAttrDefaultQualified |= Attr_Def_Qualified; } fSchemaInfo->setElemAttrDefaultQualified(elemAttrDefaultQualified); fSchemaInfo->setBlockDefault(parseBlockSet(schemaRoot, ES_Block, true)); fSchemaInfo->setFinalDefault(parseFinalSet(schemaRoot, ECS_Final, true)); } XSAnnotation* TraverseSchema::traverseAnnotationDecl(const DOMElement* const annotationElem, ValueVectorOf* const nonXSAttList, const bool topLevel) { NamespaceScopeManager nsMgr(annotationElem, fSchemaInfo, this); // ----------------------------------------------------------------------- // Check Attributes // ----------------------------------------------------------------------- fAttributeCheck.checkAttributes( annotationElem, GeneralAttributeCheck::E_Annotation, this, topLevel ); const XMLCh* contents = 0; DOMElement* child = XUtil::getFirstChildElement(annotationElem); if (child) { for (; child != 0; child = XUtil::getNextSiblingElement(child)) { const XMLCh* name = child->getLocalName(); if (XMLString::equals(name, SchemaSymbols::fgELT_APPINFO)) { DOMNode* textContent = child->getFirstChild(); if (textContent && textContent->getNodeType() == DOMNode::TEXT_NODE) contents = ((DOMText*) textContent)->getData(); fAttributeCheck.checkAttributes(child, GeneralAttributeCheck::E_Appinfo, this); } else if (XMLString::equals(name, SchemaSymbols::fgELT_DOCUMENTATION)) { DOMNode* textContent = child->getFirstChild(); if (textContent && textContent->getNodeType() == DOMNode::TEXT_NODE) contents = ((DOMText*) textContent)->getData(); fAttributeCheck.checkAttributes(child, GeneralAttributeCheck::E_Documentation, this); } else { reportSchemaError(child, XMLUni::fgXMLErrDomain, XMLErrs::InvalidAnnotationContent); } } } else { // If the Annotation has no children, get the text directly DOMNode* textContent = annotationElem->getFirstChild(); if (textContent && textContent->getNodeType() == DOMNode::TEXT_NODE) contents = ((DOMText*) textContent)->getData(); } if (contents && !fScanner->getIgnoreAnnotations()) { XSAnnotation* theAnnotation = 0; XMLSize_t nonXSAttSize = nonXSAttList->size(); if (nonXSAttSize) { int annotTokenStart = XMLString::patternMatch( contents, SchemaSymbols::fgELT_ANNOTATION); if (annotTokenStart == -1) // something is wrong return 0; // set annotation element fBuffer.set(contents, annotTokenStart + 10); for (XMLSize_t i=0; ielementAt(i); if (!XMLString::equals( annotationElem->getAttributeNS( attNode->getNamespaceURI(), attNode->getLocalName()) , XMLUni::fgZeroLenString) ) { continue; } fBuffer.append(chSpace); fBuffer.append(attNode->getNodeName()); fBuffer.append(chEqual); fBuffer.append(chDoubleQuote); processAttValue(attNode->getNodeValue(), fBuffer); fBuffer.append(chDoubleQuote); } // add remaining annotation content fBuffer.append(contents + annotTokenStart + 10); theAnnotation = new (fGrammarPoolMemoryManager) XSAnnotation(fBuffer.getRawBuffer(), fGrammarPoolMemoryManager); } else { theAnnotation = new (fGrammarPoolMemoryManager) XSAnnotation(contents, fGrammarPoolMemoryManager); } /*** * set line, col and systemId info ***/ theAnnotation->setLineCol( ((XSDElementNSImpl*)annotationElem)->getLineNo() , ((XSDElementNSImpl*)annotationElem)->getColumnNo() ); theAnnotation->setSystemId(fSchemaInfo->getCurrentSchemaURL()); return theAnnotation; } return 0; } /** * Traverse include * * * Content: (annotation?) * */ void TraverseSchema::preprocessInclude(const DOMElement* const elem) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); // ----------------------------------------------------------------------- // Check attributes // ----------------------------------------------------------------------- fAttributeCheck.checkAttributes( elem, GeneralAttributeCheck::E_Include, this, true, fNonXSAttList); // ----------------------------------------------------------------------- // First, handle any ANNOTATION declaration // ----------------------------------------------------------------------- if (checkContent(elem, XUtil::getFirstChildElement(elem), true) != 0) reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::OnlyAnnotationExpected); if (fAnnotation) fSchemaGrammar->addAnnotation(fAnnotation); else if (fScanner->getGenerateSyntheticAnnotations() && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(elem, fNonXSAttList); fSchemaGrammar->addAnnotation(fAnnotation); } // ----------------------------------------------------------------------- // Get 'schemaLocation' attribute // ----------------------------------------------------------------------- const XMLCh* schemaLocation = getElementAttValue(elem, SchemaSymbols::fgATT_SCHEMALOCATION, DatatypeValidator::AnyURI); if (!schemaLocation || !*schemaLocation) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::DeclarationNoSchemaLocation, SchemaSymbols::fgELT_INCLUDE); return; } // ------------------------------------------------------------------ // Resolve schema location // ------------------------------------------------------------------ fLocator->setValues(fSchemaInfo->getCurrentSchemaURL(), 0, ((XSDElementNSImpl*) elem)->getLineNo(), ((XSDElementNSImpl*) elem)->getColumnNo()); InputSource* srcToFill = resolveSchemaLocation(schemaLocation, XMLResourceIdentifier::SchemaInclude); Janitor janSrc(srcToFill); // Nothing to do if (!srcToFill) { return; } const XMLCh* includeURL = srcToFill->getSystemId(); SchemaInfo* includeSchemaInfo = fCachedSchemaInfoList->get(includeURL, fTargetNSURI); if (!includeSchemaInfo && fSchemaInfoList != fCachedSchemaInfoList) includeSchemaInfo = fSchemaInfoList->get(includeURL, fTargetNSURI); if (includeSchemaInfo) { fSchemaInfo->addSchemaInfo(includeSchemaInfo, SchemaInfo::INCLUDE); return; } // ------------------------------------------------------------------ // Parse input source // ------------------------------------------------------------------ if (!fParser) fParser = new (fGrammarPoolMemoryManager) XSDDOMParser(0, fGrammarPoolMemoryManager, 0); fParser->setValidationScheme(XercesDOMParser::Val_Never); fParser->setDoNamespaces(true); fParser->setUserEntityHandler(fEntityHandler); fParser->setUserErrorReporter(fErrorReporter); // Should just issue warning if the schema is not found bool flag = srcToFill->getIssueFatalErrorIfNotFound(); srcToFill->setIssueFatalErrorIfNotFound(false); fParser->parse(*srcToFill); // Reset the InputSource srcToFill->setIssueFatalErrorIfNotFound(flag); if (fParser->getSawFatal() && fScanner->getExitOnFirstFatal()) reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::SchemaScanFatalError); // ------------------------------------------------------------------ // Get root element // ------------------------------------------------------------------ DOMDocument* document = fParser->getDocument(); if (document) { DOMElement* root = document->getDocumentElement(); if (root) { const XMLCh* targetNSURIString = root->getAttribute(SchemaSymbols::fgATT_TARGETNAMESPACE); // check to see if targetNameSpace is right if (*targetNSURIString && !XMLString::equals(targetNSURIString,fTargetNSURIString)){ reportSchemaError(root, XMLUni::fgXMLErrDomain, XMLErrs::IncludeNamespaceDifference, schemaLocation, targetNSURIString); return; } // if targetNamespace is empty, change it to includ'g schema // targetNamespace if (!*targetNSURIString && root->getAttributeNode(XMLUni::fgXMLNSString) == 0 && fTargetNSURI != fEmptyNamespaceURI) { root->setAttribute(XMLUni::fgXMLNSString, fTargetNSURIString); } // -------------------------------------------------------- // Update schema information with included schema // -------------------------------------------------------- SchemaInfo* saveInfo = fSchemaInfo; fSchemaInfo = new (fMemoryManager) SchemaInfo(0, 0, 0, fTargetNSURI, 0, includeURL, fTargetNSURIString, root, fScanner, fGrammarPoolMemoryManager); fSchemaInfo->getNamespaceScope()->reset(fEmptyNamespaceURI); // Add mapping for the xml prefix fSchemaInfo->getNamespaceScope()->addPrefix(XMLUni::fgXMLString, fURIStringPool->addOrFind(XMLUni::fgXMLURIName)); fSchemaInfoList->put((void*) fSchemaInfo->getCurrentSchemaURL(), fSchemaInfo->getTargetNSURI(), fSchemaInfo); fPreprocessedNodes->put((void*) elem, fSchemaInfo); saveInfo->addSchemaInfo(fSchemaInfo, SchemaInfo::INCLUDE); traverseSchemaHeader(root); preprocessChildren(root); fSchemaInfo = saveInfo; } } } void TraverseSchema::traverseInclude(const DOMElement* const elem) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); SchemaInfo* includeInfo = fPreprocessedNodes->get(elem); if (includeInfo) { SchemaInfo* saveInfo = fSchemaInfo; fSchemaInfo = includeInfo; processChildren(includeInfo->getRoot()); fSchemaInfo = saveInfo; } } /** * Traverse import * * * Content: (annotation?) * */ void TraverseSchema::preprocessImport(const DOMElement* const elem) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); // ----------------------------------------------------------------------- // Check attributes // ----------------------------------------------------------------------- fAttributeCheck.checkAttributes( elem, GeneralAttributeCheck::E_Import, this, true, fNonXSAttList); // ----------------------------------------------------------------------- // First, handle any ANNOTATION declaration // ----------------------------------------------------------------------- if (checkContent(elem, XUtil::getFirstChildElement(elem), true) != 0) reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::OnlyAnnotationExpected); if (fAnnotation) fSchemaGrammar->addAnnotation(fAnnotation); else if (fScanner->getGenerateSyntheticAnnotations() && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(elem, fNonXSAttList); fSchemaGrammar->addAnnotation(fAnnotation); } // ----------------------------------------------------------------------- // Handle 'namespace' attribute // ----------------------------------------------------------------------- const XMLCh* nameSpace = getElementAttValue(elem, SchemaSymbols::fgATT_NAMESPACE, DatatypeValidator::AnyURI); const XMLCh* nameSpaceValue = nameSpace ? nameSpace : XMLUni::fgZeroLenString; if (XMLString::equals(nameSpaceValue, fTargetNSURIString)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::Import_1_1); return; } if (!*nameSpaceValue && fTargetNSURI == fEmptyNamespaceURI) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::Import_1_2); return; } // ------------------------------------------------------------------ // Get 'schemaLocation' attribute // ------------------------------------------------------------------ const XMLCh* schemaLocation = getElementAttValue(elem, SchemaSymbols::fgATT_SCHEMALOCATION, DatatypeValidator::AnyURI); // ------------------------------------------------------------------ // Resolve namespace to a grammar // ------------------------------------------------------------------ Grammar* aGrammar = 0; { XMLSchemaDescription* gramDesc =fGrammarResolver->getGrammarPool()->createSchemaDescription(nameSpaceValue); Janitor janName(gramDesc); gramDesc->setContextType(XMLSchemaDescription::CONTEXT_IMPORT); gramDesc->setLocationHints(schemaLocation); aGrammar = fGrammarResolver->getGrammar(gramDesc); } bool grammarFound = (aGrammar && (aGrammar->getGrammarType() == Grammar::SchemaGrammarType)); if (grammarFound) { addImportedNS(fURIStringPool->addOrFind(nameSpaceValue)); } // a bare doesn't load anything if(!schemaLocation && !nameSpace) return; // ------------------------------------------------------------------ // Resolve schema location // ------------------------------------------------------------------ fLocator->setValues(fSchemaInfo->getCurrentSchemaURL(), 0, ((XSDElementNSImpl*) elem)->getLineNo(), ((XSDElementNSImpl*) elem)->getColumnNo()); InputSource* srcToFill = resolveSchemaLocation(schemaLocation, XMLResourceIdentifier::SchemaImport, nameSpace); // Nothing to do if (!srcToFill) { if (!grammarFound) { addImportedNS(fURIStringPool->addOrFind(nameSpaceValue)); } return; } Janitor janSrc(srcToFill); const XMLCh* importURL = srcToFill->getSystemId(); unsigned int nameSpaceId = nameSpace ? fURIStringPool->addOrFind(nameSpace) : fEmptyNamespaceURI; SchemaInfo* importSchemaInfo = fCachedSchemaInfoList->get(importURL, nameSpaceId); if (!importSchemaInfo && fSchemaInfoList != fCachedSchemaInfoList) importSchemaInfo = fSchemaInfoList->get(importURL, nameSpaceId); if (importSchemaInfo) { fSchemaInfo->addSchemaInfo(importSchemaInfo, SchemaInfo::IMPORT); addImportedNS(importSchemaInfo->getTargetNSURI()); return; } if (grammarFound) { if (!fScanner->getHandleMultipleImports()) return; } // ------------------------------------------------------------------ // Parse input source // ------------------------------------------------------------------ if (!fParser) fParser = new (fGrammarPoolMemoryManager) XSDDOMParser(0, fGrammarPoolMemoryManager, 0); fParser->setValidationScheme(XercesDOMParser::Val_Never); fParser->setDoNamespaces(true); fParser->setUserEntityHandler(fEntityHandler); fParser->setUserErrorReporter(fErrorReporter); // Should just issue warning if the schema is not found bool flag = srcToFill->getIssueFatalErrorIfNotFound(); srcToFill->setIssueFatalErrorIfNotFound(false); fParser->parse(*srcToFill) ; // Reset the InputSource srcToFill->setIssueFatalErrorIfNotFound(flag); if (fParser->getSawFatal() && fScanner->getExitOnFirstFatal()) reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::SchemaScanFatalError); // ------------------------------------------------------------------ // Get root element // ------------------------------------------------------------------ DOMDocument* document = fParser->getDocument(); if (document) { DOMElement* root = document->getDocumentElement(); if (!root) { return; } const XMLCh* targetNSURIString = root->getAttribute(SchemaSymbols::fgATT_TARGETNAMESPACE); if (!XMLString::equals(targetNSURIString, nameSpaceValue)) { reportSchemaError(root, XMLUni::fgXMLErrDomain, XMLErrs::ImportNamespaceDifference, schemaLocation, targetNSURIString, nameSpaceValue); } else { // -------------------------------------------------------- // Preprocess new schema // -------------------------------------------------------- SchemaInfo* saveInfo = fSchemaInfo; fSchemaGrammar->setScopeCount (fScopeCount); fSchemaGrammar->setAnonTypeCount (fAnonXSTypeCount); if (grammarFound) { fSchemaGrammar = (SchemaGrammar*) aGrammar; } else { fSchemaGrammar = new (fGrammarPoolMemoryManager) SchemaGrammar(fGrammarPoolMemoryManager); } fScopeCount = fSchemaGrammar->getScopeCount (); fAnonXSTypeCount = fSchemaGrammar->getAnonTypeCount (); XMLSchemaDescription* gramDesc = (XMLSchemaDescription*) fSchemaGrammar->getGrammarDescription(); gramDesc->setContextType(XMLSchemaDescription::CONTEXT_IMPORT); gramDesc->setLocationHints(importURL); preprocessSchema(root, importURL, grammarFound); fPreprocessedNodes->put((void*) elem, fSchemaInfo); // -------------------------------------------------------- // Restore old schema information // -------------------------------------------------------- restoreSchemaInfo(saveInfo, SchemaInfo::IMPORT); } } } void TraverseSchema::traverseImport(const DOMElement* const elem) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); SchemaInfo* importInfo = fPreprocessedNodes->get(elem); if (importInfo) { // -------------------------------------------------------- // Traverse new schema // -------------------------------------------------------- SchemaInfo* saveInfo = fSchemaInfo; restoreSchemaInfo(importInfo, SchemaInfo::IMPORT); doTraverseSchema(importInfo->getRoot()); // -------------------------------------------------------- // Restore old schema information // -------------------------------------------------------- restoreSchemaInfo(saveInfo, SchemaInfo::IMPORT); } } /** * Traverse redefine declaration * * * schemaLocation = uriReference * {any attributes with non-schema namespace . . .}> * Content: (annotation | ( * attributeGroup | complexType | group | simpleType))* * */ void TraverseSchema::preprocessRedefine(const DOMElement* const redefineElem) { NamespaceScopeManager nsMgr(redefineElem, fSchemaInfo, this); // ----------------------------------------------------------------------- // Check attributes // ----------------------------------------------------------------------- fAttributeCheck.checkAttributes( redefineElem, GeneralAttributeCheck::E_Redefine, this, true ); // First, we look through the children of redefineElem. Each one will // correspond to an element of the redefined schema that we need to // redefine. To do this, we rename the element of the redefined schema, // and rework the base or ref tag of the kid we're working on to refer to // the renamed group or derive the renamed type. Once we've done this, we // actually go through the schema being redefined and convert it to a // grammar. Only then do we run through redefineDecl's kids and put them // in the grammar. SchemaInfo* redefiningInfo = fSchemaInfo; if (!openRedefinedSchema(redefineElem)) { redefiningInfo->addFailedRedefine(redefineElem); return; } if (!fRedefineComponents) { fRedefineComponents = new (fMemoryManager) RefHash2KeysTableOf(13, (bool) false, fMemoryManager); } SchemaInfo* redefinedInfo = fSchemaInfo; renameRedefinedComponents(redefineElem, redefiningInfo, redefinedInfo); // Now we have to preprocess our nicely-renamed schemas. if (fPreprocessedNodes->containsKey(redefineElem)) { fSchemaInfo = redefinedInfo; preprocessChildren(fSchemaInfo->getRoot()); } fSchemaInfo = redefiningInfo; } void TraverseSchema::traverseRedefine(const DOMElement* const redefineElem) { NamespaceScopeManager nsMgr(redefineElem, fSchemaInfo, this); SchemaInfo* saveInfo = fSchemaInfo; SchemaInfo* redefinedInfo = fPreprocessedNodes->get(redefineElem); if (redefinedInfo) { // Now we have to march through our nicely-renamed schemas. When // we do these traversals other 's may perhaps be // encountered; we leave recursion to sort this out. fSchemaInfo = redefinedInfo; processChildren(fSchemaInfo->getRoot()); fSchemaInfo = saveInfo; // Now traverse our own processChildren(redefineElem); } } /** * Traverse the Choice, Sequence declaration * * */ ContentSpecNode* TraverseSchema::traverseChoiceSequence(const DOMElement* const elem, const int modelGroupType, bool& hasChildren) { hasChildren = false; NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); // ----------------------------------------------------------------------- // Check attributes // ----------------------------------------------------------------------- fAttributeCheck.checkAttributes( elem, GeneralAttributeCheck::E_Sequence, this, false, fNonXSAttList ); // ----------------------------------------------------------------------- // Process contents // ----------------------------------------------------------------------- DOMElement* child = checkContent(elem, XUtil::getFirstChildElement(elem), true); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(elem, fNonXSAttList); } Janitor janAnnot(fAnnotation); Janitor left(0); Janitor right(0); bool hadContent = false; Janitor contentSpecNode(0); for (; child != 0; child = XUtil::getNextSiblingElement(child)) { hasChildren = true; contentSpecNode.release(); bool seeParticle = false; bool wasAny = false; const XMLCh* childName = child->getLocalName(); if (XMLString::equals(childName, SchemaSymbols::fgELT_ELEMENT)) { SchemaElementDecl* elemDecl = traverseElementDecl(child); if (!elemDecl ) continue; contentSpecNode.reset(new (fGrammarPoolMemoryManager) ContentSpecNode ( elemDecl , fGrammarPoolMemoryManager )); seeParticle = true; } else if (XMLString::equals(childName, SchemaSymbols::fgELT_GROUP)) { XercesGroupInfo* grpInfo = traverseGroupDecl(child, false); if (!grpInfo) { continue; } ContentSpecNode* grpContentSpecNode = grpInfo->getContentSpec(); if (!grpContentSpecNode) { continue; } if (grpContentSpecNode->hasAllContent()) { reportSchemaError(child, XMLUni::fgXMLErrDomain, XMLErrs::AllContentLimited); continue; } contentSpecNode.reset(new (fGrammarPoolMemoryManager) ContentSpecNode(*grpContentSpecNode)); seeParticle = true; } else if (XMLString::equals(childName, SchemaSymbols::fgELT_CHOICE)) { bool hasChild; contentSpecNode.reset(traverseChoiceSequence(child,ContentSpecNode::Choice, hasChild)); seeParticle = true; } else if (XMLString::equals(childName, SchemaSymbols::fgELT_SEQUENCE)) { bool hasChild; contentSpecNode.reset(traverseChoiceSequence(child,ContentSpecNode::Sequence, hasChild)); seeParticle = true; } else if (XMLString::equals(childName, SchemaSymbols::fgELT_ANY)) { contentSpecNode.reset(traverseAny(child)); seeParticle = true; wasAny = true; } else { reportSchemaError(child, XMLUni::fgValidityDomain, XMLValid::GroupContentRestricted, childName, ((ContentSpecNode::NodeTypes) modelGroupType) == ContentSpecNode::Choice?SchemaSymbols::fgELT_CHOICE:SchemaSymbols::fgELT_SEQUENCE); } if (seeParticle) { checkMinMax(contentSpecNode.get(), child, Not_All_Context); if (wasAny && contentSpecNode.get()->getMaxOccurs() == 0) { contentSpecNode.reset(0); } } if (contentSpecNode.get()) { hadContent = true; } if (left.get() == 0) { left.reset(contentSpecNode.release()); } else if (right.get() == 0) { right.reset(contentSpecNode.release()); } else { ContentSpecNode* newNode = new (fGrammarPoolMemoryManager) ContentSpecNode ( (ContentSpecNode::NodeTypes) modelGroupType , left.get() , right.get() , true , true , fGrammarPoolMemoryManager ); left.release(); right.release(); left.reset(newNode); right.reset(contentSpecNode.release()); } } contentSpecNode.release(); if (hadContent) { ContentSpecNode* newNode = new (fGrammarPoolMemoryManager) ContentSpecNode ( ((ContentSpecNode::NodeTypes) modelGroupType) == ContentSpecNode::Choice ? ContentSpecNode::ModelGroupChoice : ContentSpecNode::ModelGroupSequence , left.get() , right.get() , true , true , fGrammarPoolMemoryManager ); left.release(); left.reset(newNode); if (!janAnnot.isDataNull()) fSchemaGrammar->putAnnotation(left.get(), janAnnot.release()); } right.release(); return left.release(); } /** * Traverse SimpleType declaration: * * Content: (annotation? , ((list | restriction | union))) * * * traverse || */ DatatypeValidator* TraverseSchema::traverseSimpleTypeDecl(const DOMElement* const childElem, const bool topLevel, int baseRefContext) { NamespaceScopeManager nsMgr(childElem, fSchemaInfo, this); // ------------------------------------------------------------------ // Process contents // ------------------------------------------------------------------ const XMLCh* name = getElementAttValue(childElem,SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName); bool nameEmpty = (!name || !*name); if (topLevel && nameEmpty) { reportSchemaError(childElem, XMLUni::fgXMLErrDomain, XMLErrs::NoNameGlobalElement, SchemaSymbols::fgELT_SIMPLETYPE); return 0; } else if(!topLevel && !nameEmpty) { reportSchemaError(childElem, XMLUni::fgXMLErrDomain, XMLErrs::AttributeDisallowedLocal, SchemaSymbols::fgATT_NAME, childElem->getLocalName()); return 0; } if (nameEmpty) { // anonymous simpleType name = genAnonTypeName(fgAnonSNamePrefix); } else if (!XMLChar1_0::isValidNCName(name, XMLString::stringLen(name)) ) { reportSchemaError(childElem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidDeclarationName, SchemaSymbols::fgELT_SIMPLETYPE, name); return 0; } fBuffer.set(fTargetNSURIString); fBuffer.append(chComma); fBuffer.append(name); unsigned int fullTypeNameId = fStringPool->addOrFind(fBuffer.getRawBuffer()); const XMLCh* fullName = fStringPool->getValueForId(fullTypeNameId); //check if we have already traversed the same simpleType decl DatatypeValidator* dv = fDatatypeRegistry->getDatatypeValidator(fullName); if (!dv) { // ------------------------------------------------------------------- // Check attributes // ------------------------------------------------------------------- unsigned short scope = (topLevel) ? GeneralAttributeCheck::E_SimpleTypeGlobal : GeneralAttributeCheck::E_SimpleTypeLocal; fAttributeCheck.checkAttributes( childElem, scope, this, topLevel, fNonXSAttList ); // Circular constraint checking if (fCurrentTypeNameStack->containsElement(fullTypeNameId)) { reportSchemaError(childElem, XMLUni::fgXMLErrDomain, XMLErrs::NoCircularDefinition, name); return 0; } fCurrentTypeNameStack->addElement(fullTypeNameId); // Get 'final' values int finalSet = parseFinalSet(childElem, S_Final); // annotation?,(list|restriction|union) DOMElement* content= checkContent( childElem, XUtil::getFirstChildElement(childElem), false); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(childElem, fNonXSAttList); } Janitor janAnnot(fAnnotation); if (content == 0) { reportSchemaError(childElem, XMLUni::fgXMLErrDomain, XMLErrs::EmptySimpleTypeContent); popCurrentTypeNameStack(); return 0; } const XMLCh* varietyName = content->getLocalName(); // Remark: some code will be repeated in list|restriction| union but it // is cleaner that way if (XMLString::equals(varietyName, SchemaSymbols::fgELT_LIST)) { //traverse List if ((baseRefContext & SchemaSymbols::XSD_LIST) != 0) { reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::AtomicItemType); popCurrentTypeNameStack(); return 0; } dv = traverseByList(childElem, content, name, fullName, finalSet, &janAnnot); } else if (XMLString::equals(varietyName, SchemaSymbols::fgELT_RESTRICTION)) { //traverse Restriction dv = traverseByRestriction(childElem, content, name, fullName, finalSet, &janAnnot); } else if (XMLString::equals(varietyName, SchemaSymbols::fgELT_UNION)) { //traverse union dv = traverseByUnion(childElem, content, name, fullName, finalSet, baseRefContext, &janAnnot); } else { reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::FeatureUnsupported, varietyName); popCurrentTypeNameStack(); } if (dv) { if (nameEmpty) dv->setAnonymous(); if (!janAnnot.isDataNull()) fSchemaGrammar->putAnnotation(dv, janAnnot.release()); } } return dv; } /** * Traverse ComplexType Declaration - CR Implementation. * * * Content: (annotation? , (simpleContent | complexContent | * ( (group | all | choice | sequence)? , * ( (attribute | attributeGroup)* , anyAttribute?)))) * */ int TraverseSchema::traverseComplexTypeDecl(const DOMElement* const elem, const bool topLevel, const XMLCh* const recursingTypeName) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); // Get the attributes of the complexType const XMLCh* name = getElementAttValue(elem, SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName); bool isAnonymous = false; if (!name || !*name) { if (topLevel) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::TopLevelNoNameComplexType); return -1; } if (recursingTypeName) name = recursingTypeName; else { name = genAnonTypeName(fgAnonCNamePrefix); isAnonymous = true; } } if (!XMLChar1_0::isValidNCName(name, XMLString::stringLen(name)) ) { //REVISIT - Should we return or continue and save type with wrong name? reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidDeclarationName, SchemaSymbols::fgELT_COMPLEXTYPE, name); return -1; } // ------------------------------------------------------------------ // Check if the type has already been registered // ------------------------------------------------------------------ fBuffer.set(fTargetNSURIString); fBuffer.append(chComma); fBuffer.append(name); int typeNameIndex = fStringPool->addOrFind(fBuffer.getRawBuffer()); const XMLCh* fullName = fStringPool->getValueForId(typeNameIndex); ComplexTypeInfo* typeInfo = 0; if (topLevel || recursingTypeName) { typeInfo = fComplexTypeRegistry->get(fullName); if (typeInfo && !typeInfo->getPreprocessed()) { return typeNameIndex; } } // ----------------------------------------------------------------------- // Check Attributes // ----------------------------------------------------------------------- bool preProcessFlag = (typeInfo) ? typeInfo->getPreprocessed() : false; if (!preProcessFlag) { fAttributeCheck.checkAttributes( elem, (topLevel) ? GeneralAttributeCheck::E_ComplexTypeGlobal : GeneralAttributeCheck::E_ComplexTypeLocal , this, topLevel, fNonXSAttList ); } // ----------------------------------------------------------------------- // Create a new instance // ----------------------------------------------------------------------- XMLSize_t previousCircularCheckIndex = fCircularCheckIndex; unsigned int previousScope = fCurrentScope; if (preProcessFlag) { fCurrentScope = typeInfo->getScopeDefined(); typeInfo->setPreprocessed(false); } else { // ------------------------------------------------------------------ // Register the type // ------------------------------------------------------------------ typeInfo = new (fGrammarPoolMemoryManager) ComplexTypeInfo(fGrammarPoolMemoryManager); if(isAnonymous) { typeInfo->setAnonymous(); } fCurrentScope = fScopeCount++; fComplexTypeRegistry->put((void*) fullName, typeInfo); typeInfo->setTypeName(fullName); typeInfo->setScopeDefined(fCurrentScope); if (fFullConstraintChecking) { XSDLocator* aLocator = new (fGrammarPoolMemoryManager) XSDLocator(); aLocator->setValues(fStringPool->getValueForId(fStringPool->addOrFind(fSchemaInfo->getCurrentSchemaURL())), 0, ((XSDElementNSImpl*) elem)->getLineNo(), ((XSDElementNSImpl*) elem)->getColumnNo()); typeInfo->setLocator(aLocator); } } fCurrentTypeNameStack->addElement(typeNameIndex); ComplexTypeInfo* saveTypeInfo = fCurrentComplexType; fCurrentComplexType = typeInfo; // ------------------------------------------------------------------ // First, handle any ANNOTATION declaration and get next child // ------------------------------------------------------------------ DOMElement* child = checkContent(elem, XUtil::getFirstChildElement(elem), true, !preProcessFlag); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(elem, fNonXSAttList); } Janitor janAnnot(fAnnotation); // ------------------------------------------------------------------ // Process the content of the complex type declaration // ------------------------------------------------------------------ try { const XMLCh* mixedVal = getElementAttValue(elem,SchemaSymbols::fgATT_MIXED, DatatypeValidator::Boolean); bool isMixed = false; if ((mixedVal && *mixedVal) && (XMLString::equals(SchemaSymbols::fgATTVAL_TRUE, mixedVal) || XMLString::equals(fgValueOne, mixedVal))) { isMixed = true; } if (child == 0) { // EMPTY complexType with complexContent processComplexContent(elem, name, child, typeInfo, 0, isMixed); } else { const XMLCh* childName = child->getLocalName(); if (XMLString::equals(childName, SchemaSymbols::fgELT_SIMPLECONTENT)) { // SIMPLE CONTENT element traverseSimpleContentDecl(name, fullName, child, typeInfo, &janAnnot); if (XUtil::getNextSiblingElement(child) != 0) { reportSchemaError(child, XMLUni::fgXMLErrDomain, XMLErrs::InvalidChildFollowingSimpleContent); } } else if (XMLString::equals(childName, SchemaSymbols::fgELT_COMPLEXCONTENT)) { // COMPLEX CONTENT element traverseComplexContentDecl(name, child, typeInfo, isMixed, &janAnnot); if (XUtil::getNextSiblingElement(child) != 0) { reportSchemaError(child, XMLUni::fgXMLErrDomain, XMLErrs::InvalidChildFollowingConplexContent); } } else if (fCurrentGroupInfo) { typeInfo->setPreprocessed(true); } else { // We must have .... // GROUP, ALL, SEQUENCE or CHOICE, followed by optional attributes // Note that it's possible that only attributes are specified. processComplexContent(elem, name, child, typeInfo, 0, isMixed); } } } catch(const TraverseSchema::ExceptionCodes aCode) { if (aCode == TraverseSchema::InvalidComplexTypeInfo) defaultComplexTypeInfo(typeInfo); else if (aCode == TraverseSchema::RecursingElement) typeInfo->setPreprocessed(); } // ------------------------------------------------------------------ // Finish the setup of the typeInfo // ------------------------------------------------------------------ if (!preProcessFlag) { const XMLCh* abstractAttVal = getElementAttValue(elem, SchemaSymbols::fgATT_ABSTRACT, DatatypeValidator::Boolean); int blockSet = parseBlockSet(elem, C_Block); int finalSet = parseFinalSet(elem, EC_Final); typeInfo->setBlockSet(blockSet); typeInfo->setFinalSet(finalSet); if ((abstractAttVal && *abstractAttVal) && (XMLString::equals(abstractAttVal, SchemaSymbols::fgATTVAL_TRUE) || XMLString::equals(abstractAttVal, fgValueOne))) { typeInfo->setAbstract(true); } else { typeInfo->setAbstract(false); } } // Store Annotation if (!janAnnot.isDataNull()) fSchemaGrammar->putAnnotation(typeInfo, janAnnot.release()); // ------------------------------------------------------------------ // Before exiting, restore the scope, mainly for nested anonymous types // ------------------------------------------------------------------ popCurrentTypeNameStack(); fCircularCheckIndex = previousCircularCheckIndex; fCurrentScope = previousScope; fCurrentComplexType = saveTypeInfo; return typeNameIndex; } /** * Traverse Group Declaration. * * * Content: (annotation? , (all | choice | sequence)?) * * */ XercesGroupInfo* TraverseSchema::traverseGroupDecl(const DOMElement* const elem, const bool topLevel) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); const XMLCh* name = getElementAttValue(elem, SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName); const XMLCh* ref = getElementAttValue(elem, SchemaSymbols::fgATT_REF, DatatypeValidator::QName); bool nameEmpty = (!name || !*name); bool refEmpty = (!ref || !*ref); if (nameEmpty && topLevel) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::NoNameGlobalElement, SchemaSymbols::fgELT_GROUP); return 0; } if (nameEmpty && refEmpty) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::NoNameRefGroup); return 0; } // ------------------------------------------------------------------ // Check attributes // ------------------------------------------------------------------ unsigned short scope = (topLevel) ? GeneralAttributeCheck::E_GroupGlobal : GeneralAttributeCheck::E_GroupRef; fAttributeCheck.checkAttributes(elem, scope, this, topLevel, fNonXSAttList); // ------------------------------------------------------------------ // Handle "ref=" // ------------------------------------------------------------------ if (!topLevel) { if (refEmpty) { return 0; } return processGroupRef(elem, ref); } // name must be a valid NCName if (!XMLChar1_0::isValidNCName(name, XMLString::stringLen(name))) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidDeclarationName, SchemaSymbols::fgELT_GROUP, name); return 0; } fBuffer.set(fTargetNSURIString); fBuffer.append(chComma); fBuffer.append(name); unsigned int nameIndex = fStringPool->addOrFind(fBuffer.getRawBuffer()); const XMLCh* fullName = fStringPool->getValueForId(nameIndex); XercesGroupInfo* groupInfo = fGroupRegistry->get(fullName); if (groupInfo) { return groupInfo; } // ------------------------------------------------------------------ // Check for annotations // ------------------------------------------------------------------ DOMElement* content = checkContent(elem, XUtil::getFirstChildElement(elem), true); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(elem, fNonXSAttList); } Janitor janAnnot(fAnnotation); // ------------------------------------------------------------------ // Process contents of global groups // ------------------------------------------------------------------ unsigned int saveScope = fCurrentScope; Janitor specNode(0); XercesGroupInfo* saveGroupInfo = fCurrentGroupInfo; Janitor newGroupInfoJan(new (fGrammarPoolMemoryManager) XercesGroupInfo( fStringPool->addOrFind(name), fTargetNSURI, fGrammarPoolMemoryManager)); fCurrentGroupStack->addElement(nameIndex); XercesGroupInfo* const newGroupInfo = newGroupInfoJan.get(); fCurrentGroupInfo = newGroupInfo; fCurrentScope = fScopeCount++; fCurrentGroupInfo->setScope(fCurrentScope); if (content == 0) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::GroupContentError, name); } else { if (content->getAttributeNode(SchemaSymbols::fgATT_MINOCCURS) != 0 || content->getAttributeNode(SchemaSymbols::fgATT_MAXOCCURS) != 0) { reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::MinMaxOnGroupChild); } bool illegalChild = false; const XMLCh* childName = content->getLocalName(); bool hasChild; if (XMLString::equals(childName, SchemaSymbols::fgELT_SEQUENCE)) { specNode.reset(traverseChoiceSequence(content, ContentSpecNode::Sequence, hasChild)); } else if (XMLString::equals(childName, SchemaSymbols::fgELT_CHOICE)) { specNode.reset(traverseChoiceSequence(content, ContentSpecNode::Choice, hasChild)); } else if (XMLString::equals(childName, SchemaSymbols::fgELT_ALL)) { specNode.reset(traverseAll(content, hasChild)); } else { illegalChild = true; } if (illegalChild || XUtil::getNextSiblingElement(content) != 0) { reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::GroupContentError, name); } // copy local elements to complex type if it exists if (fCurrentComplexType) processElements(elem, fCurrentGroupInfo, fCurrentComplexType); } // ------------------------------------------------------------------ // Set groupInfo and pop group name from stack // ------------------------------------------------------------------ XMLSize_t stackSize = fCurrentGroupStack->size(); if (stackSize != 0) { fCurrentGroupStack->removeElementAt(stackSize - 1); } fCurrentGroupInfo->setContentSpec(specNode.release()); fGroupRegistry->put((void*) fullName, fCurrentGroupInfo); newGroupInfoJan.release(); fCurrentGroupInfo = saveGroupInfo; fCurrentScope = saveScope; // Store Annotation if (!janAnnot.isDataNull()) { fSchemaGrammar->putAnnotation(newGroupInfo, janAnnot.release()); } if (fFullConstraintChecking) { XSDLocator* aLocator = new (fGrammarPoolMemoryManager) XSDLocator(); newGroupInfo->setLocator(aLocator); aLocator->setValues(fStringPool->getValueForId(fStringPool->addOrFind(fSchemaInfo->getCurrentSchemaURL())), 0, ((XSDElementNSImpl*) elem)->getLineNo(), ((XSDElementNSImpl*) elem)->getColumnNo()); if (fRedefineComponents && fRedefineComponents->get(SchemaSymbols::fgELT_GROUP, nameIndex)) { fBuffer.set(fullName); fBuffer.append(SchemaSymbols::fgRedefIdentifier); unsigned int rdfNameIndex = fStringPool->addOrFind(fBuffer.getRawBuffer()); if (fCurrentGroupStack->containsElement(rdfNameIndex)) { reportSchemaError(aLocator, XMLUni::fgXMLErrDomain, XMLErrs::NoCircularDefinition, name); } else { XercesGroupInfo* baseGroup = fGroupRegistry->get(fBuffer.getRawBuffer()); if (baseGroup) { newGroupInfo->setBaseGroup(baseGroup); } else { fBuffer.set(name); fBuffer.append(SchemaSymbols::fgRedefIdentifier); SchemaInfo* saveInfo = fSchemaInfo; DOMElement* groupElem = fSchemaInfo->getTopLevelComponent(SchemaInfo::C_Group, SchemaSymbols::fgELT_GROUP, fBuffer.getRawBuffer(), &fSchemaInfo); if (groupElem != 0) { baseGroup = traverseGroupDecl(groupElem); newGroupInfo->setBaseGroup(baseGroup); fSchemaInfo = saveInfo; } else { reportSchemaError(aLocator, XMLUni::fgXMLErrDomain, XMLErrs::DeclarationNotFound, SchemaSymbols::fgELT_GROUP, fTargetNSURIString, fBuffer.getRawBuffer()); } } } } } return newGroupInfo; } /** * Traverse attributeGroup Declaration. * * * Content: (annotation? , (attribute|attributeGroup)*, anyAttribute?) * * */ XercesAttGroupInfo* TraverseSchema::traverseAttributeGroupDecl(const DOMElement* const elem, ComplexTypeInfo* const typeInfo, const bool topLevel) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); const XMLCh* name = getElementAttValue(elem, SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName); const XMLCh* ref = getElementAttValue(elem, SchemaSymbols::fgATT_REF, DatatypeValidator::QName); bool nameEmpty = (!name || !*name) ? true : false; bool refEmpty = (!ref || !*ref) ? true : false; if (nameEmpty && topLevel) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::NoNameGlobalElement, SchemaSymbols::fgELT_ATTRIBUTEGROUP); return 0; } if (nameEmpty && refEmpty) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::NoNameRefAttGroup); return 0; } // ------------------------------------------------------------------ // Check attributes // ------------------------------------------------------------------ unsigned short scope = (topLevel) ? GeneralAttributeCheck::E_AttributeGroupGlobal : GeneralAttributeCheck::E_AttributeGroupRef; fAttributeCheck.checkAttributes(elem, scope, this, topLevel, fNonXSAttList); // ------------------------------------------------------------------ // Handle "ref=" // ------------------------------------------------------------------ XercesAttGroupInfo* attGroupInfo; Janitor janAttGroupInfo(0); if (!topLevel) { if (refEmpty) { return 0; } attGroupInfo = processAttributeGroupRef(elem, ref, typeInfo); } else { // name must be a valid NCName if (!XMLChar1_0::isValidNCName(name, XMLString::stringLen(name))) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidDeclarationName, SchemaSymbols::fgELT_ATTRIBUTEGROUP, name); return 0; } // Check for annotations DOMElement* content = checkContent(elem, XUtil::getFirstChildElement(elem), true); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(elem, fNonXSAttList); } Janitor janAnnot(fAnnotation); // Process contents of global attributeGroups XercesAttGroupInfo* saveAttGroupInfo = fCurrentAttGroupInfo; janAttGroupInfo.reset(new (fGrammarPoolMemoryManager) XercesAttGroupInfo( fStringPool->addOrFind(name), fTargetNSURI, fGrammarPoolMemoryManager)); fDeclStack->addElement(elem); fCurrentAttGroupInfo = janAttGroupInfo.get(); for (; content !=0; content = XUtil::getNextSiblingElement(content)) { if (XMLString::equals(content->getLocalName(), SchemaSymbols::fgELT_ATTRIBUTE)) { traverseAttributeDecl(content, typeInfo); } else if (XMLString::equals(content->getLocalName(), SchemaSymbols::fgELT_ATTRIBUTEGROUP)) { traverseAttributeGroupDecl(content, typeInfo); } else { break; } } if (content != 0) { if (XMLString::equals(content->getLocalName(), SchemaSymbols::fgELT_ANYATTRIBUTE)) { SchemaAttDef* anyAtt = traverseAnyAttribute(content); if (anyAtt) { fCurrentAttGroupInfo->addAnyAttDef(anyAtt); } if (XUtil::getNextSiblingElement(content) != 0) { reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::AttGroupContentError, name); } } else { reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::AttGroupContentError, name); } } // Pop declaration fDeclStack->removeElementAt(fDeclStack->size() - 1); fAttGroupRegistry->put((void*) fStringPool->getValueForId(fStringPool->addOrFind(name)), janAttGroupInfo.get()); // Restore old attGroupInfo attGroupInfo = janAttGroupInfo.release(); fCurrentAttGroupInfo = saveAttGroupInfo; // Check Attribute Derivation Restriction OK fBuffer.set(fTargetNSURIString); fBuffer.append(chComma); fBuffer.append(name); unsigned int nameIndex = fStringPool->addOrFind(fBuffer.getRawBuffer()); if (fRedefineComponents && fRedefineComponents->get(SchemaSymbols::fgELT_ATTRIBUTEGROUP, nameIndex)) { fBuffer.set(name); fBuffer.append(SchemaSymbols::fgRedefIdentifier); XercesAttGroupInfo* baseAttGroupInfo = fAttGroupRegistry->get(fBuffer.getRawBuffer()); if (baseAttGroupInfo) checkAttDerivationOK(elem, baseAttGroupInfo, attGroupInfo); } // Store annotation if (!janAnnot.isDataNull()) fSchemaGrammar->putAnnotation(attGroupInfo, janAnnot.release()); } // calculate complete wildcard if necessary if (attGroupInfo) { XMLSize_t anyAttCount = attGroupInfo->anyAttributeCount(); if (anyAttCount && !attGroupInfo->getCompleteWildCard()) { SchemaAttDef* attGroupWildCard = new (fGrammarPoolMemoryManager) SchemaAttDef(attGroupInfo->anyAttributeAt(0)); for (XMLSize_t k= 1; k < anyAttCount; k++) attWildCardIntersection(attGroupWildCard, attGroupInfo->anyAttributeAt(k)); attGroupInfo->setCompleteWildCard(attGroupWildCard); } } return attGroupInfo; } inline XercesAttGroupInfo* TraverseSchema::traverseAttributeGroupDeclNS(const DOMElement* const elem, const XMLCh* const uriStr, const XMLCh* const name) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); // ------------------------------------------------------------------ // Get grammar information // ------------------------------------------------------------------ Grammar* aGrammar = fGrammarResolver->getGrammar(uriStr); if (!aGrammar || aGrammar->getGrammarType() != Grammar::SchemaGrammarType) { reportSchemaError(elem, XMLUni::fgValidityDomain, XMLValid::GrammarNotFound, uriStr); return 0; } XercesAttGroupInfo* attGroupInfo = ((SchemaGrammar*)aGrammar)->getAttGroupInfoRegistry()->get(name); return attGroupInfo; } /** * Traverse Any declaration * * * Content: (annotation?) * */ ContentSpecNode* TraverseSchema::traverseAny(const DOMElement* const elem) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); // ----------------------------------------------------------------------- // Check Attributes // ----------------------------------------------------------------------- fAttributeCheck.checkAttributes( elem, GeneralAttributeCheck::E_Any, this, false, fNonXSAttList ); // ------------------------------------------------------------------ // First, handle any ANNOTATION declaration // ------------------------------------------------------------------ if (checkContent(elem, XUtil::getFirstChildElement(elem), true) != 0) reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::OnlyAnnotationExpected); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(elem, fNonXSAttList); } Janitor janAnnot(fAnnotation); // ------------------------------------------------------------------ // Get attributes // ------------------------------------------------------------------ const XMLCh* const processContents = getElementAttValue(elem, SchemaSymbols::fgATT_PROCESSCONTENTS); const XMLCh* const nameSpace = getElementAttValue(elem, SchemaSymbols::fgATT_NAMESPACE); // ------------------------------------------------------------------ // Set default node type based on 'processContents' value // ------------------------------------------------------------------ ContentSpecNode::NodeTypes anyType = ContentSpecNode::Any; ContentSpecNode::NodeTypes anyLocalType = ContentSpecNode::Any_NS; ContentSpecNode::NodeTypes anyOtherType = ContentSpecNode::Any_Other; if ((processContents && *processContents) && !XMLString::equals(processContents, SchemaSymbols::fgATTVAL_STRICT)) { if (XMLString::equals(processContents, SchemaSymbols::fgATTVAL_LAX)) { anyType = ContentSpecNode::Any_Lax; anyOtherType = ContentSpecNode::Any_Other_Lax; anyLocalType = ContentSpecNode::Any_NS_Lax; } else if (XMLString::equals(processContents, SchemaSymbols::fgATTVAL_SKIP)) { anyType = ContentSpecNode::Any_Skip; anyOtherType = ContentSpecNode::Any_Other_Skip; anyLocalType = ContentSpecNode::Any_NS_Skip; } } // ------------------------------------------------------------------ // Process 'namespace' attribute // ------------------------------------------------------------------ ContentSpecNode* retSpecNode = 0; if ((!nameSpace || !*nameSpace) || XMLString::equals(nameSpace, SchemaSymbols::fgATTVAL_TWOPOUNDANY)) { retSpecNode = new (fGrammarPoolMemoryManager) ContentSpecNode ( new (fGrammarPoolMemoryManager) QName ( XMLUni::fgZeroLenString , XMLUni::fgZeroLenString , fEmptyNamespaceURI , fGrammarPoolMemoryManager ) , false , fGrammarPoolMemoryManager ); retSpecNode->setType(anyType); } else if (XMLString::equals(nameSpace, SchemaSymbols::fgATTVAL_TWOPOUNDOTHER)) { retSpecNode = new (fGrammarPoolMemoryManager) ContentSpecNode ( new (fGrammarPoolMemoryManager) QName ( XMLUni::fgZeroLenString , XMLUni::fgZeroLenString , fTargetNSURI, fGrammarPoolMemoryManager ) , false , fGrammarPoolMemoryManager ); retSpecNode->setType(anyOtherType); } else { XMLStringTokenizer nameSpaceTokens(nameSpace, fMemoryManager); ValueVectorOf uriList(8, fGrammarPoolMemoryManager); Janitor firstNode(0); Janitor secondNode(0); DatatypeValidator* anyURIDV = fDatatypeRegistry->getDatatypeValidator(SchemaSymbols::fgDT_ANYURI); while (nameSpaceTokens.hasMoreTokens()) { const XMLCh* tokenElem = nameSpaceTokens.nextToken(); int uriIndex = fEmptyNamespaceURI; if (!XMLString::equals(tokenElem,SchemaSymbols::fgATTVAL_TWOPOUNDLOCAL)) { // not ##local if (XMLString::equals(tokenElem,SchemaSymbols::fgATTVAL_TWOPOUNDTRAGETNAMESPACE)) { uriIndex = fTargetNSURI; } else { try { anyURIDV->validate(tokenElem , fSchemaInfo->getValidationContext() , fMemoryManager); } catch(const XMLException& excep) { reportSchemaError(elem, excep); } uriIndex = fURIStringPool->addOrFind(tokenElem); } } if (uriList.containsElement(uriIndex)) { continue; } uriList.addElement(uriIndex); firstNode.release(); firstNode.reset( new (fGrammarPoolMemoryManager) ContentSpecNode ( new (fGrammarPoolMemoryManager) QName ( XMLUni::fgZeroLenString , XMLUni::fgZeroLenString , uriIndex, fGrammarPoolMemoryManager ) , false , fGrammarPoolMemoryManager )); firstNode.get()->setType(anyLocalType); if (secondNode.get() == 0) { secondNode.reset(firstNode.release()); } else { ContentSpecNode* newNode = new (fGrammarPoolMemoryManager) ContentSpecNode ( ContentSpecNode::Any_NS_Choice , secondNode.get() , firstNode.get() , true , true , fGrammarPoolMemoryManager ); secondNode.release(); secondNode.reset(newNode); firstNode.release(); } } firstNode.release(); retSpecNode = secondNode.release(); } // Store annotation if (retSpecNode && !janAnnot.isDataNull()) fSchemaGrammar->putAnnotation(retSpecNode, janAnnot.release()); return retSpecNode; } /** * Traverse all * * * Content: (annotation?, element*) * */ ContentSpecNode* TraverseSchema::traverseAll(const DOMElement* const elem, bool& hasChildren) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); hasChildren = false; // ----------------------------------------------------------------------- // Check attributes // ----------------------------------------------------------------------- fAttributeCheck.checkAttributes( elem, GeneralAttributeCheck::E_All, this, false, fNonXSAttList ); // ----------------------------------------------------------------------- // Process contents // ----------------------------------------------------------------------- DOMElement* child = checkContent(elem, XUtil::getFirstChildElement(elem), true); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(elem, fNonXSAttList); } Janitor janAnnot(fAnnotation); if (child == 0) { return 0; } Janitor left(0); Janitor right(0); Janitor contentSpecNode(0); bool hadContent = false; for (; child != 0; child = XUtil::getNextSiblingElement(child)) { hasChildren = true; contentSpecNode.release(); const XMLCh* childName = child->getLocalName(); if (XMLString::equals(childName, SchemaSymbols::fgELT_ELEMENT)) { SchemaElementDecl* elemDecl = traverseElementDecl(child); if (!elemDecl) continue; contentSpecNode.reset(new (fGrammarPoolMemoryManager) ContentSpecNode ( elemDecl , fGrammarPoolMemoryManager )); checkMinMax(contentSpecNode.get(), child, All_Element); } else { reportSchemaError(child, XMLUni::fgXMLErrDomain, XMLErrs::AllContentError, childName); continue; } hadContent = true; if (!left.get()) { left.reset(contentSpecNode.release()); } else if (!right.get()) { right.reset(contentSpecNode.release()); } else { ContentSpecNode* newNode = new (fGrammarPoolMemoryManager) ContentSpecNode ( ContentSpecNode::All , left.get() , right.get() , true , true , fGrammarPoolMemoryManager ); left.release(); left.reset(newNode); right.release(); right.reset(contentSpecNode.release()); } } contentSpecNode.release(); if (hadContent) { ContentSpecNode* newNode = new (fGrammarPoolMemoryManager) ContentSpecNode ( ContentSpecNode::All , left.get() , right.get() , true , true , fGrammarPoolMemoryManager ); left.release(); left.reset(newNode); if (!janAnnot.isDataNull()) fSchemaGrammar->putAnnotation(left.get(), janAnnot.release()); } right.release(); return left.release(); } /** * Traverses Schema attribute declaration. * * * Content: (annotation? , simpleType?) * * * @param elem: the declaration of the attribute under consideration * * @param typeInfo: Contains the complex type info of the element to which * the attribute declaration is attached. * */ void TraverseSchema::traverseAttributeDecl(const DOMElement* const elem, ComplexTypeInfo* const typeInfo, const bool topLevel) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); const XMLCh* name = getElementAttValue(elem, SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName); const XMLCh* ref = getElementAttValue(elem, SchemaSymbols::fgATT_REF, DatatypeValidator::QName); bool nameEmpty = (!name || !*name); bool refEmpty = (!ref || !*ref); if (nameEmpty && refEmpty) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::NoNameRefAttribute); return; } if (topLevel && nameEmpty) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::TopLevelNoNameAttribute); return; } // ------------------------------------------------------------------ // Check attributes // ------------------------------------------------------------------ unsigned short scope = (topLevel) ? GeneralAttributeCheck::E_AttributeGlobal : (refEmpty) ? GeneralAttributeCheck::E_AttributeLocal : GeneralAttributeCheck::E_AttributeRef; fAttributeCheck.checkAttributes(elem, scope, this, topLevel, fNonXSAttList); const XMLCh* defaultVal = getElementAttValue(elem, SchemaSymbols::fgATT_DEFAULT); const XMLCh* fixedVal = getElementAttValue(elem, SchemaSymbols::fgATT_FIXED); const XMLCh* useVal = getElementAttValue(elem, SchemaSymbols::fgATT_USE); const XMLCh* attForm = getElementAttValue(elem, SchemaSymbols::fgATT_FORM); const XMLCh* dvType = getElementAttValue(elem, SchemaSymbols::fgATT_TYPE, DatatypeValidator::QName); DOMElement* simpleType = checkContent(elem, XUtil::getFirstChildElement(elem), true); Janitor janAnnot(fAnnotation); bool badContent = false; while (simpleType != 0) { const XMLCh* contentName = simpleType->getLocalName(); if (XMLString::equals(SchemaSymbols::fgELT_SIMPLETYPE, contentName)) { if (XUtil::getNextSiblingElement(simpleType) != 0) { badContent = true; } break; } badContent = true; simpleType = XUtil::getNextSiblingElement(simpleType); } if (badContent) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidAttributeContent, (name) ? name : ref); } if (defaultVal) { if (fixedVal) { fixedVal = 0; reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::AttributeDefaultFixedValue, (name) ? name : ref); } if ((useVal && *useVal) && !XMLString::equals(useVal, SchemaSymbols::fgATTVAL_OPTIONAL)) { useVal = 0; reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::NotOptionalDefaultAttValue, (name) ? name : ref); } } // processing ref if (!refEmpty && !topLevel) { // Check ref representation OK - 3.2.3::3.2 if (attForm || dvType || (simpleType != 0)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::AttributeRefContentError, (name) ? name : ref); } processAttributeDeclRef(elem, typeInfo, ref, useVal, defaultVal, fixedVal); return; } if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(elem, fNonXSAttList); janAnnot.reset(fAnnotation); } // processing 'name' if (!XMLChar1_0::isValidNCName(name, XMLString::stringLen(name)) || XMLString::equals(name, XMLUni::fgXMLNSString)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidDeclarationName, SchemaSymbols::fgELT_ATTRIBUTE, name); return; } // Check for duplicate declaration const XMLCh* qualified = SchemaSymbols::fgATTVAL_QUALIFIED; int uriIndex = fEmptyNamespaceURI; if ((fTargetNSURIString && *fTargetNSURIString) && (topLevel || XMLString::equals(attForm, qualified) || ((fSchemaInfo->getElemAttrDefaultQualified() & Attr_Def_Qualified) && (!attForm || !*attForm)))) { uriIndex = fTargetNSURI; } // make sure that attribute namespace is not xsi uri if (XMLString::equals(fTargetNSURIString, SchemaSymbols::fgURI_XSI)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidAttTNS, name); return; } if (typeInfo && typeInfo->getAttDef(name, uriIndex) != 0) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateAttribute, name); return; } else if (fCurrentAttGroupInfo && fCurrentAttGroupInfo->containsAttribute(name, uriIndex)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateAttribute, name); return; } DatatypeValidator* dv = 0; XMLAttDef::AttTypes attType = XMLAttDef::Simple; SchemaInfo* saveInfo = fSchemaInfo; if (simpleType != 0) { if (dvType && *dvType) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::AttributeWithTypeAndSimpleType, name); } dv = traverseSimpleTypeDecl(simpleType, false); } else if (!dvType || !*dvType) { dv = fDatatypeRegistry->getDatatypeValidator(SchemaSymbols::fgDT_ANYSIMPLETYPE); } else { checkEnumerationRequiredNotation(elem, name, dvType); const XMLCh* localPart = getLocalPart(dvType); const XMLCh* prefix = getPrefix(dvType); const XMLCh* typeURI = resolvePrefixToURI(elem, prefix); DatatypeValidator* dvBack = 0; if (XMLString::equals(typeURI, SchemaSymbols::fgURI_SCHEMAFORSCHEMA)) { dv = fDatatypeRegistry->getDatatypeValidator(localPart); dvBack = dv; } else { //isn't of the schema for schemas namespace... dv = getAttrDatatypeValidatorNS(elem, localPart, typeURI); dvBack = dv; while(dv != 0 && !XMLString::equals(dv->getTypeUri(), SchemaSymbols::fgURI_SCHEMAFORSCHEMA)) { dv = dv->getBaseValidator(); } if(dv) localPart = dv->getTypeLocalName(); } if(dv) { if (XMLString::equals(localPart,XMLUni::fgIDString)) { attType = XMLAttDef::ID; } else if (XMLString::equals(localPart,XMLUni::fgIDRefString)) { attType = XMLAttDef::IDRef; } else if (XMLString::equals(localPart,XMLUni::fgIDRefsString)) { attType = XMLAttDef::IDRefs; } else if (XMLString::equals(localPart,XMLUni::fgEntityString)) { attType = XMLAttDef::Entity; } else if (XMLString::equals(localPart,XMLUni::fgEntitiesString)) { attType = XMLAttDef::Entities; } else if (XMLString::equals(localPart,XMLUni::fgNmTokenString)) { attType = XMLAttDef::NmToken; } else if (XMLString::equals(localPart,XMLUni::fgNmTokensString)) { attType = XMLAttDef::NmTokens; } else if (XMLString::equals(localPart,XMLUni::fgNotationString)) { attType = XMLAttDef::Notation; } else { attType = XMLAttDef::Simple; } } else attType = XMLAttDef::Simple; dv = dvBack; if (!dv) { reportSchemaError ( elem , XMLUni::fgXMLErrDomain , XMLErrs::AttributeSimpleTypeNotFound , typeURI , localPart , name ); } } // restore schema information, if necessary fSchemaInfo = saveInfo; bool required = false; bool prohibited = false; if (useVal && *useVal) { if (XMLString::equals(useVal, SchemaSymbols::fgATTVAL_REQUIRED)) { required = true; } else if (XMLString::equals(useVal, SchemaSymbols::fgATTVAL_PROHIBITED)) { prohibited = true; } } // validate fixed/default values const XMLCh* valueToCheck = defaultVal ? defaultVal : fixedVal; bool ofTypeID = (dv && dv->getType() == DatatypeValidator::ID); if (attType == XMLAttDef::Simple && dv && valueToCheck) { short wsFacet = dv->getWSFacet(); if((wsFacet == DatatypeValidator::REPLACE && !XMLString::isWSReplaced(valueToCheck)) || (wsFacet == DatatypeValidator::COLLAPSE && !XMLString::isWSCollapsed(valueToCheck))) { XMLCh* normalizedValue=XMLString::replicate(valueToCheck, fMemoryManager); ArrayJanitor tempURIName(normalizedValue, fMemoryManager); if(wsFacet == DatatypeValidator::REPLACE) XMLString::replaceWS(normalizedValue, fMemoryManager); else if(wsFacet == DatatypeValidator::COLLAPSE) XMLString::collapseWS(normalizedValue, fMemoryManager); valueToCheck=fStringPool->getValueForId(fStringPool->addOrFind(normalizedValue)); } try { dv->validate(valueToCheck , fSchemaInfo->getValidationContext() , fMemoryManager); } catch (const XMLException& excep) { reportSchemaError(elem, excep); } catch(const OutOfMemoryException&) { throw; } catch(...) { reportSchemaError(elem, XMLUni::fgValidityDomain, XMLValid::DatatypeValidationFailure, valueToCheck); } } else if((attType == XMLAttDef::NmTokens || attType==XMLAttDef::IDRefs || attType==XMLAttDef::Entities) && valueToCheck && !XMLString::isWSCollapsed(valueToCheck)) { XMLCh* normalizedValue=XMLString::replicate(valueToCheck, fMemoryManager); ArrayJanitor tempURIName(normalizedValue, fMemoryManager); XMLString::collapseWS(normalizedValue, fMemoryManager); valueToCheck=fStringPool->getValueForId(fStringPool->addOrFind(normalizedValue)); } if (ofTypeID && valueToCheck) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::AttDeclPropCorrect3, name); } // check for multiple attributes with type derived from ID if (!topLevel && ofTypeID) { if (fCurrentAttGroupInfo) { if (fCurrentAttGroupInfo->containsTypeWithId()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::AttGrpPropCorrect3, name); return; } fCurrentAttGroupInfo->setTypeWithId(true); } else { if (typeInfo->containsAttWithTypeId()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::AttDeclPropCorrect5, name); return; } typeInfo->setAttWithTypeId(true); } } // create SchemaAttDef SchemaAttDef* attDef = new (fGrammarPoolMemoryManager) SchemaAttDef ( XMLUni::fgZeroLenString , name , uriIndex , attType , XMLAttDef::Implied , fGrammarPoolMemoryManager ); attDef->setDatatypeValidator(dv); if (prohibited) { attDef->setDefaultType(XMLAttDef::Prohibited); } else if (required) { if (fixedVal) { attDef->setDefaultType(XMLAttDef::Required_And_Fixed); } else { attDef->setDefaultType(XMLAttDef::Required); } } else { if (fixedVal) { attDef->setDefaultType(XMLAttDef::Fixed); } else if (defaultVal) { attDef->setDefaultType(XMLAttDef::Default); } } if (valueToCheck) { attDef->setValue(valueToCheck); } if (!janAnnot.isDataNull()) fSchemaGrammar->putAnnotation(attDef, janAnnot.release()); if (topLevel) { fAttributeDeclRegistry->put((void*) fStringPool->getValueForId(fStringPool->addOrFind(name)), attDef); attDef->setPSVIScope(PSVIDefs::SCP_GLOBAL); } else { if (typeInfo) { typeInfo->addAttDef(attDef); if (!fCurrentAttGroupInfo) attDef->setPSVIScope(PSVIDefs::SCP_LOCAL); } if (fCurrentAttGroupInfo) { fCurrentAttGroupInfo->addAttDef(attDef, (typeInfo != 0)); } } } /** * Traverses Schema element declaration. * * * * @param elem: the declaration of the element under consideration */ SchemaElementDecl* TraverseSchema::traverseElementDecl(const DOMElement* const elem, const bool topLevel) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); // if local element and ref attribute exists if (!topLevel) { const XMLCh* refName = getElementAttValue(elem, SchemaSymbols::fgATT_REF, DatatypeValidator::QName); if (refName) return processElementDeclRef(elem, refName); } // check for empty name const XMLCh* name = getElementAttValue(elem, SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName); if (!name || !*name) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::NoNameRefElement); return 0; } // make sure that name is a valid NCName if (!XMLChar1_0::isValidNCName(name, XMLString::stringLen(name))) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidDeclarationName, SchemaSymbols::fgELT_ELEMENT, name); return 0; } // if element already exists, just return --- revisit, it should not happen if (topLevel) { SchemaElementDecl* retDecl = (SchemaElementDecl*) fSchemaGrammar->getElemDecl(fTargetNSURI, name, 0, Grammar::TOP_LEVEL_SCOPE); if (retDecl) return retDecl; } // Check attributes unsigned short scope = (topLevel) ? GeneralAttributeCheck::E_ElementGlobal : GeneralAttributeCheck::E_ElementLocal; fAttributeCheck.checkAttributes(elem, scope, this, topLevel, fNonXSAttList); // check annotation const DOMElement* content = checkContent(elem, XUtil::getFirstChildElement(elem), true); // Put annotations on all elements for the situation where there is a group of // elements and not all have annotations. //if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) if (!fAnnotation && fScanner->getGenerateSyntheticAnnotations()) { fAnnotation = generateSyntheticAnnotation(elem, fNonXSAttList); } Janitor janAnnot(fAnnotation); // Create element decl bool isDuplicate = false; const XMLCh* valueConstraint = 0; SchemaElementDecl* elemDecl = createSchemaElementDecl(elem, name, isDuplicate, valueConstraint, topLevel); if (!isDuplicate) { fSchemaGrammar->putElemDecl(elemDecl); if (valueConstraint) elemDecl->setDefaultValue(valueConstraint); if (!janAnnot.isDataNull()) fSchemaGrammar->putAnnotation(elemDecl, janAnnot.release()); if (fCurrentComplexType && elemDecl->getEnclosingScope() == fCurrentComplexType->getScopeDefined()) { fCurrentComplexType->addElement(elemDecl); elemDecl->setPSVIScope(PSVIDefs::SCP_LOCAL); } if (fCurrentGroupInfo && elemDecl->getEnclosingScope() == fCurrentGroupInfo->getScope()) { fCurrentGroupInfo->addElement(elemDecl); elemDecl->setPSVIScope(PSVIDefs::SCP_ABSENT); } } else { if (fAnnotation) { XSAnnotation* xsAnnot = fSchemaGrammar->getAnnotation(elemDecl); if (!xsAnnot) { fSchemaGrammar->putAnnotation(elemDecl, janAnnot.release()); } else { xsAnnot->setNext(janAnnot.release()); } } } // Process children bool anonymousType = false; ComplexTypeInfo* typeInfo = 0; DatatypeValidator* validator = 0; if (content != 0) { const XMLCh* contentName = content->getLocalName(); if (XMLString::equals(contentName, SchemaSymbols::fgELT_COMPLEXTYPE)) { const XMLCh* temp = content->getAttribute(SchemaSymbols::fgATT_NAME); if (temp && *temp) { // REVISIT - we are bypassing the complex type declaration. reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::AnonComplexTypeWithName, name); } else { typeInfo = checkForComplexTypeInfo(content); if (typeInfo) { validator = typeInfo->getDatatypeValidator(); if (!isDuplicate) { //Recursing element if (typeInfo->getPreprocessed()) { const XMLCh* typeInfoName = typeInfo->getTypeName(); fSchemaInfo->addRecursingType(content, typeInfoName + XMLString::indexOf(typeInfoName, chComma) + 1); } } } } anonymousType = true; content = XUtil::getNextSiblingElement(content); } else if (XMLString::equals(contentName, SchemaSymbols::fgELT_SIMPLETYPE)) { const XMLCh* temp = content->getAttribute(SchemaSymbols::fgATT_NAME); if (temp && *temp) // REVISIT - we are bypassing the simple type declaration. reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::AnonSimpleTypeWithName, name); else validator = checkForSimpleTypeValidator(content); anonymousType = true; content = XUtil::getNextSiblingElement(content); } // Check for identity constraints if (content != 0) { content = checkIdentityConstraintContent(content); if (content != 0) reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::InvalidElementContent); } } // Handle 'type' attribute const XMLCh* typeStr = getElementAttValue(elem, SchemaSymbols::fgATT_TYPE, DatatypeValidator::QName); if (typeStr) { if (anonymousType) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::ElementWithTypeAndAnonType, name); } else if (*typeStr) { const XMLCh* typeLocalPart = getLocalPart(typeStr); const XMLCh* typePrefix = getPrefix(typeStr); const XMLCh* typeURI = resolvePrefixToURI(elem, typePrefix); if (!XMLString::equals(typeURI, SchemaSymbols::fgURI_SCHEMAFORSCHEMA) || !XMLString::equals(typeLocalPart, SchemaSymbols::fgATTVAL_ANYTYPE)) { checkEnumerationRequiredNotation(elem, name, typeStr); bool noErrorFound = true; const XMLCh* anotherSchemaURI = checkTypeFromAnotherSchema(elem, typeStr); // get complex type info typeInfo = getElementComplexTypeInfo(elem, typeStr, anotherSchemaURI); // get simple type validtor - if not a complex type if (typeInfo) validator = typeInfo->getDatatypeValidator(); else validator = getElementTypeValidator(elem, typeStr, noErrorFound, anotherSchemaURI); } } } // check for duplicate elements with different types. if (isDuplicate) { DatatypeValidator* eltDV = elemDecl->getDatatypeValidator(); ComplexTypeInfo* eltTypeInfo = elemDecl->getComplexTypeInfo(); if ( (eltTypeInfo != typeInfo) || (eltDV != validator)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateElementDeclaration, name); } } // Set element declararion type information else { elemDecl->setDatatypeValidator(validator); elemDecl->setComplexTypeInfo(typeInfo); if (validator) elemDecl->setModelType(SchemaElementDecl::Simple); else if (typeInfo) elemDecl->setModelType((SchemaElementDecl::ModelTypes)typeInfo->getContentType()); if (topLevel) { // Handle the substitutionGroup const XMLCh* subsGroupName = getElementAttValue(elem, SchemaSymbols::fgATT_SUBSTITUTIONGROUP, DatatypeValidator::QName); if (subsGroupName && *subsGroupName) processSubstitutionGroup(elem, elemDecl, typeInfo, validator, subsGroupName); } // process identity constraints DOMElement* ic = XUtil::getFirstChildElementNS( elem, fgIdentityConstraints, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, 3); if (ic) processElemDeclIC(ic, elemDecl); } if (!typeInfo && !validator) { if (!isDuplicate) { elemDecl->setModelType(SchemaElementDecl::Any); elemDecl->setAttWildCard( new (fGrammarPoolMemoryManager) SchemaAttDef( XMLUni::fgZeroLenString, XMLUni::fgZeroLenString, fEmptyNamespaceURI, XMLAttDef::Any_Any, XMLAttDef::ProcessContents_Lax, fGrammarPoolMemoryManager ) ); } } else if (valueConstraint) { if (!checkElemDeclValueConstraint(elem, elemDecl, valueConstraint, typeInfo, validator) && !isDuplicate) { int miscFlags = elemDecl->getMiscFlags(); miscFlags &= ~ SchemaSymbols::XSD_FIXED; elemDecl->setDefaultValue(0); elemDecl->setMiscFlags(miscFlags); } } return elemDecl; } /** * Traverses Schema notation declaration. * * * Content: (annotation?) * * * @param elem: the declaration of the element under consideration */ const XMLCh* TraverseSchema::traverseNotationDecl(const DOMElement* const elem) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); // ----------------------------------------------------------------------- // Check attributes // ----------------------------------------------------------------------- fAttributeCheck.checkAttributes( elem, GeneralAttributeCheck::E_Notation, this, true, fNonXSAttList ); // ----------------------------------------------------------------------- // Process notation attributes/elements // ----------------------------------------------------------------------- const XMLCh* name = getElementAttValue(elem, SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName); bool nameEmpty = (!name || !*name) ? true : false; if (nameEmpty) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::NoNameGlobalElement, SchemaSymbols::fgELT_NOTATION); return 0; } if (!XMLChar1_0::isValidNCName(name, XMLString::stringLen(name))) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidDeclarationName, SchemaSymbols::fgELT_NOTATION, name); return 0; } if (fNotationRegistry->containsKey(name, fTargetNSURI)) { return name; } if (checkContent(elem, XUtil::getFirstChildElement(elem), true) != 0) reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::OnlyAnnotationExpected); const XMLCh* publicId = getElementAttValue(elem, SchemaSymbols::fgATT_PUBLIC); const XMLCh* systemId = getElementAttValue(elem, SchemaSymbols::fgATT_SYSTEM, DatatypeValidator::AnyURI); fNotationRegistry->put((void*) fStringPool->getValueForId(fStringPool->addOrFind(name)), fTargetNSURI, 0); // for PSVI we need to store the notational decl XMLNotationDecl* decl = new (fGrammarPoolMemoryManager) XMLNotationDecl ( name, publicId, systemId, 0, fGrammarPoolMemoryManager ); decl->setNameSpaceId(fTargetNSURI); fSchemaGrammar->putNotationDecl(decl); if (fAnnotation) fSchemaGrammar->putAnnotation(decl, fAnnotation); else if (fScanner->getGenerateSyntheticAnnotations() && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(elem, fNonXSAttList); fSchemaGrammar->putAnnotation(decl, fAnnotation); } return name; } const XMLCh* TraverseSchema::traverseNotationDecl(const DOMElement* const elem, const XMLCh* const name, const XMLCh* const uriStr) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); unsigned int uriId = fURIStringPool->addOrFind(uriStr); SchemaInfo* saveInfo = fSchemaInfo; if (fTargetNSURI != (int) uriId) { // Make sure that we have an explicit import statement. // Clause 4 of Schema Representation Constraint: // http://www.w3.org/TR/xmlschema-1/#src-resolve unsigned int uriId = fURIStringPool->addOrFind(uriStr); if (!isImportingNS(uriId)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidNSReference, uriStr); return 0; } Grammar* grammar = fGrammarResolver->getGrammar(uriStr); if (grammar == 0 || grammar->getGrammarType() != Grammar::SchemaGrammarType) { reportSchemaError(elem, XMLUni::fgValidityDomain, XMLValid::GrammarNotFound, uriStr); return 0; } SchemaInfo* impInfo = fSchemaInfo->getImportInfo(uriId); if (!impInfo || impInfo->getProcessed()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::TypeNotFound, uriStr, name); return 0; } fSchemaInfo = impInfo; fTargetNSURI = fSchemaInfo->getTargetNSURI(); } DOMElement* notationElem = fSchemaInfo->getTopLevelComponent(SchemaInfo::C_Notation, SchemaSymbols::fgELT_NOTATION, name, &fSchemaInfo); if (notationElem == 0) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::Notation_DeclNotFound, uriStr, name); return 0; } const XMLCh* notationName = traverseNotationDecl(notationElem); fSchemaInfo = saveInfo; fTargetNSURI = fSchemaInfo->getTargetNSURI(); return notationName; } /** * Traverses Schema list simple type declaration. * * * Content: (annotation?, simpleType?) * * */ DatatypeValidator* TraverseSchema::traverseByList(const DOMElement* const rootElem, const DOMElement* const contentElem, const XMLCh* const typeName, const XMLCh* const qualifiedName, const int finalSet, Janitor* const janAnnot) { NamespaceScopeManager nsMgr(contentElem, fSchemaInfo, this); DatatypeValidator* baseValidator = 0; const XMLCh* baseTypeName = getElementAttValue(contentElem, SchemaSymbols::fgATT_ITEMTYPE, DatatypeValidator::QName); fAttributeCheck.checkAttributes( contentElem, GeneralAttributeCheck::E_List, this, false, fNonXSAttList ); const DOMElement* tempEl = XUtil::getNextSiblingElement(contentElem); if (tempEl != 0) { reportSchemaError(contentElem, XMLUni::fgXMLErrDomain, XMLErrs::SimpleTypeContentError, tempEl->getLocalName()); } DOMElement* content = 0; if (!baseTypeName || !*baseTypeName) { // must 'see' content = checkContent(rootElem, XUtil::getFirstChildElement(contentElem), false); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(contentElem, fNonXSAttList); } if (fAnnotation) { if (janAnnot->isDataNull()) janAnnot->reset(fAnnotation); else janAnnot->get()->setNext(fAnnotation); } if (!content) { reportSchemaError(contentElem, XMLUni::fgXMLErrDomain, XMLErrs::ExpectedSimpleTypeInList, typeName); popCurrentTypeNameStack(); return 0; } if (XMLString::equals(content->getLocalName(), SchemaSymbols::fgELT_SIMPLETYPE)) { baseValidator = checkForSimpleTypeValidator(content, SchemaSymbols::XSD_LIST); } else { reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::ListUnionRestrictionError, typeName); popCurrentTypeNameStack(); return 0; } content = XUtil::getNextSiblingElement(content); } else { // base was provided - get proper validator baseValidator = findDTValidator(contentElem, typeName, baseTypeName, SchemaSymbols::XSD_LIST); content = checkContent(rootElem, XUtil::getFirstChildElement(contentElem), true); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(contentElem, fNonXSAttList); } if (fAnnotation) { if (janAnnot->isDataNull()) janAnnot->reset(fAnnotation); else janAnnot->get()->setNext(fAnnotation); } } DatatypeValidator* newDV = 0; if (baseValidator) { if (!baseValidator->isAtomic()) { reportSchemaError(contentElem, XMLUni::fgXMLErrDomain, XMLErrs::AtomicItemType, baseTypeName); } else { // 'content' should be empty // If an annotation was encountered we have already traversed it in // checkContent in the case of a base provided (only allowed child is // an annotation). if (content != 0) { // report an error and continue reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::SimpleTypeDerivationByListError, typeName); } // create & register validator for "generated" type try { newDV = fDatatypeRegistry->createDatatypeValidator( qualifiedName, baseValidator, 0, 0, true, finalSet, true, fGrammarPoolMemoryManager); } catch (const XMLException& excep) { reportSchemaError(contentElem, excep); } catch(const OutOfMemoryException&) { throw; } catch(...) { reportSchemaError(contentElem, XMLUni::fgXMLErrDomain, XMLErrs::DatatypeValidatorCreationError, typeName); } } } popCurrentTypeNameStack(); return newDV; } /** * Traverses Schema restriction simple type declaration. * * * Content: (annotation?, (simpleType?, * (minExclusive | minInclusive | maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength | maxLength | enumeration | whiteSpace | pattern)*)) * * */ DatatypeValidator* TraverseSchema::traverseByRestriction(const DOMElement* const rootElem, const DOMElement* const contentElem, const XMLCh* const typeName, const XMLCh* const qualifiedName, const int finalSet, Janitor* const janAnnot) { NamespaceScopeManager nsMgr(contentElem, fSchemaInfo, this); DatatypeValidator* baseValidator = 0; DatatypeValidator* newDV = 0; const XMLCh* baseTypeName = getElementAttValue(contentElem, SchemaSymbols::fgATT_BASE, DatatypeValidator::QName); fAttributeCheck.checkAttributes( contentElem, GeneralAttributeCheck::E_Restriction, this, false, fNonXSAttList ); const DOMElement* tempEl = XUtil::getNextSiblingElement(contentElem); if (tempEl != 0) { reportSchemaError(contentElem, XMLUni::fgXMLErrDomain, XMLErrs::SimpleTypeContentError, tempEl->getLocalName()); } DOMElement* content = 0; if (!baseTypeName || !*baseTypeName) { // must 'see' content = checkContent(rootElem, XUtil::getFirstChildElement(contentElem), false); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(contentElem, fNonXSAttList); } if (fAnnotation) { if (janAnnot->isDataNull()) janAnnot->reset(fAnnotation); else janAnnot->get()->setNext(fAnnotation); } if (content == 0) { reportSchemaError(contentElem, XMLUni::fgXMLErrDomain, XMLErrs::ExpectedSimpleTypeInRestriction); popCurrentTypeNameStack(); return 0; } if (XMLString::equals(content->getLocalName(), SchemaSymbols::fgELT_SIMPLETYPE)) { baseValidator = checkForSimpleTypeValidator(content); } else { reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::ListUnionRestrictionError, typeName); popCurrentTypeNameStack(); return 0; } // Check for facets content = XUtil::getNextSiblingElement(content); } else { // base was provided - get proper validator baseValidator = findDTValidator(contentElem, typeName, baseTypeName, SchemaSymbols::XSD_RESTRICTION); content = checkContent(rootElem, XUtil::getFirstChildElement(contentElem), true); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(contentElem, fNonXSAttList); } if (fAnnotation) { if (janAnnot->isDataNull()) janAnnot->reset(fAnnotation); else janAnnot->get()->setNext(fAnnotation); } } if (baseValidator) { // Get facets if any existing typedef RefHashTableOf KVRefHash; Janitor janFacets(0); //RefHashTableOf* facets = 0; typedef RefArrayVectorOf XMLChRefArray; Janitor enums(0); //RefArrayVectorOf* enums = 0; XMLBuffer pattern(128, fGrammarPoolMemoryManager); Janitor janEnumAnnot(0); Janitor janPatternAnnot(0); XMLCh fixedFlagStr[16]; unsigned int fixedFlag = 0; unsigned short scope = 0; bool isFirstPattern = true; bool sawPattern = false; while (content != 0) { if (content->getNodeType() == DOMNode::ELEMENT_NODE) { NamespaceScopeManager nsMgr(content, fSchemaInfo, this); const XMLCh* facetName = content->getLocalName(); bool bContinue=false; // workaround for Borland bug with 'continue' in 'catch' try { scope = fAttributeCheck.getFacetId(facetName, fMemoryManager); } catch(const OutOfMemoryException&) { throw; } catch (...) { reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::InvalidFacetName, facetName); content = XUtil::getNextSiblingElement(content); bContinue=true; } if(bContinue) continue; fAttributeCheck.checkAttributes( content, scope, this, false, fNonXSAttList ); if (checkContent(rootElem, XUtil::getFirstChildElement(content), true) != 0) reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::OnlyAnnotationExpected); const XMLCh* attValue = content->getAttribute(SchemaSymbols::fgATT_VALUE); if (janFacets.get() == 0) { janFacets.reset(new (fGrammarPoolMemoryManager) RefHashTableOf(29, true, fGrammarPoolMemoryManager)); } if (XMLString::equals(facetName, SchemaSymbols::fgELT_ENUMERATION)) { if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(content, fNonXSAttList); } if (fAnnotation) { if (janEnumAnnot.isDataNull()) janEnumAnnot.reset(fAnnotation); else janEnumAnnot.get()->setNext(fAnnotation); } // REVISIT // if validator is a notation datatype validator, we need // to get the qualified name first before adding it to the // enum buffer if (!enums.get()) { enums.reset(new (fGrammarPoolMemoryManager) RefArrayVectorOf(8, true, fGrammarPoolMemoryManager)); } if (baseValidator->getType() == DatatypeValidator::NOTATION) { const XMLCh* localPart = getLocalPart(attValue); const XMLCh* prefix = getPrefix(attValue); const XMLCh* uriStr = (prefix && *prefix) ? resolvePrefixToURI(content, prefix) : fTargetNSURIString; unsigned int uriId = fURIStringPool->addOrFind(uriStr); if (!fNotationRegistry->containsKey(localPart, uriId)) { traverseNotationDecl(content, localPart, uriStr); } if (uriStr && *uriStr) { fBuffer.set(uriStr); fBuffer.append(chColon); fBuffer.append(localPart); enums.get()->addElement(XMLString::replicate(fBuffer.getRawBuffer(), fGrammarPoolMemoryManager)); } else { enums.get()->addElement(XMLString::replicate(localPart, fGrammarPoolMemoryManager)); } } else if (baseValidator->getType() == DatatypeValidator::QName) { // We need the URI string for the prefix to determine // if that matches the value in the instance document. // Code was just comparing the string of prefix:localname // and if the schema and instance document had different // prefixes with the same URI string then we were giving an error. const XMLCh* prefix = getPrefix(attValue); const XMLCh* uriStr = (prefix && *prefix) ? resolvePrefixToURI(content, prefix) : fTargetNSURIString; enums.get()->addElement(XMLString::replicate(attValue, fGrammarPoolMemoryManager)); enums.get()->addElement(XMLString::replicate(uriStr, fGrammarPoolMemoryManager)); } else { enums.get()->addElement(XMLString::replicate(attValue, fGrammarPoolMemoryManager)); } } else if (XMLString::equals(facetName, SchemaSymbols::fgELT_PATTERN)) { if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(content, fNonXSAttList); } if (fAnnotation) { if (janPatternAnnot.isDataNull()) janPatternAnnot.reset(fAnnotation); else janPatternAnnot.get()->setNext(fAnnotation); } sawPattern = true; if (isFirstPattern) { // fBuffer.isEmpty() - overhead call isFirstPattern = false; pattern.set(attValue); } else { //datatypes: 5.2.4 pattern pattern.append(chPipe); pattern.append(attValue); } } else { if (janFacets.get()->containsKey(facetName)) { if (fAnnotation) delete fAnnotation; reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateFacet, facetName); } else { if (XMLString::equals(facetName, SchemaSymbols::fgELT_WHITESPACE) && baseValidator->getType() != DatatypeValidator::String && !XMLString::equals(attValue, SchemaSymbols::fgWS_COLLAPSE)) { if (fAnnotation) delete fAnnotation; reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::WS_CollapseExpected, attValue); } else { const XMLCh* facetStr = fStringPool->getValueForId(fStringPool->addOrFind(facetName)); KVStringPair* kv = new (fGrammarPoolMemoryManager) KVStringPair(facetStr, attValue, fGrammarPoolMemoryManager); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(content, fNonXSAttList); } if (fAnnotation) fSchemaGrammar->putAnnotation(kv, fAnnotation); janFacets.get()->put((void*) facetStr, kv); checkFixedFacet(content, facetStr, baseValidator, fixedFlag); } } } } content = XUtil::getNextSiblingElement(content); } // end while if (sawPattern) { KVStringPair* kv = new (fGrammarPoolMemoryManager) KVStringPair(SchemaSymbols::fgELT_PATTERN, pattern.getRawBuffer(), pattern.getLen(), fGrammarPoolMemoryManager); if (!janPatternAnnot.isDataNull()) fSchemaGrammar->putAnnotation(kv, janPatternAnnot.release()); janFacets.get()->put((void*) SchemaSymbols::fgELT_PATTERN, kv); } if (fixedFlag) { XMLString::binToText(fixedFlag, fixedFlagStr, 15, 10, fGrammarPoolMemoryManager); janFacets.get()->put((void*) SchemaSymbols::fgATT_FIXED, new (fGrammarPoolMemoryManager) KVStringPair(SchemaSymbols::fgATT_FIXED, fixedFlagStr, fGrammarPoolMemoryManager)); } if (enums.get() && !janEnumAnnot.isDataNull()) fSchemaGrammar->putAnnotation(enums.get(), janEnumAnnot.release()); try { newDV = fDatatypeRegistry->createDatatypeValidator(qualifiedName, baseValidator, janFacets.release(), enums.release(), false, finalSet, true, fGrammarPoolMemoryManager); } catch (const XMLException& excep) { reportSchemaError(contentElem, excep); } catch(const OutOfMemoryException&) { throw; } catch(...) { reportSchemaError(contentElem, XMLUni::fgXMLErrDomain, XMLErrs::DatatypeValidatorCreationError, typeName); } } popCurrentTypeNameStack(); return newDV; } /** * Traverses Schema union simple type declaration. * * * Content: (annotation?, simpleType*) * * */ DatatypeValidator* TraverseSchema::traverseByUnion(const DOMElement* const rootElem, const DOMElement* const contentElem, const XMLCh* const typeName, const XMLCh* const qualifiedName, const int finalSet, int baseRefContext, Janitor* const janAnnot) { NamespaceScopeManager nsMgr(contentElem, fSchemaInfo, this); fAttributeCheck.checkAttributes( contentElem, GeneralAttributeCheck::E_Union, this, false, fNonXSAttList ); const DOMElement* tempEl = XUtil::getNextSiblingElement(contentElem); if (tempEl != 0) { reportSchemaError(contentElem, XMLUni::fgXMLErrDomain, XMLErrs::SimpleTypeContentError, tempEl->getLocalName()); } const XMLCh* baseTypeName = getElementAttValue(contentElem, SchemaSymbols::fgATT_MEMBERTYPES); DatatypeValidator* baseValidator = 0; RefVectorOf* validators = new (fGrammarPoolMemoryManager) RefVectorOf(4, false, fGrammarPoolMemoryManager); Janitor > janValidators(validators); DOMElement* content = 0; if (baseTypeName && *baseTypeName) { //base was provided - get proper validator. XMLStringTokenizer unionMembers(baseTypeName, fGrammarPoolMemoryManager); int tokCount = unionMembers.countTokens(); for (int i = 0; i < tokCount; i++) { const XMLCh* memberTypeName = unionMembers.nextToken(); baseValidator = findDTValidator(contentElem, typeName, memberTypeName, SchemaSymbols::XSD_UNION); if (baseValidator == 0) { popCurrentTypeNameStack(); return 0; } validators->addElement(baseValidator); } content = checkContent(rootElem, XUtil::getFirstChildElement(contentElem), true); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(contentElem, fNonXSAttList); } if (fAnnotation) { if (janAnnot->isDataNull()) janAnnot->reset(fAnnotation); else janAnnot->get()->setNext(fAnnotation); } } else { // must 'see' content = checkContent(rootElem, XUtil::getFirstChildElement(contentElem), false); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(contentElem, fNonXSAttList); } if (fAnnotation) { if (janAnnot->isDataNull()) janAnnot->reset(fAnnotation); else janAnnot->get()->setNext(fAnnotation); } if (content == 0) { reportSchemaError(contentElem, XMLUni::fgXMLErrDomain, XMLErrs::ExpectedSimpleTypeInUnion, typeName); popCurrentTypeNameStack(); return 0; } if (!XMLString::equals(content->getLocalName(), SchemaSymbols::fgELT_SIMPLETYPE)) { reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::ListUnionRestrictionError, typeName); popCurrentTypeNameStack(); return 0; } } // process union content of simpleType children if any while (content != 0) { if (XMLString::equals(content->getLocalName(), SchemaSymbols::fgELT_SIMPLETYPE)) { baseValidator = checkForSimpleTypeValidator(content, baseRefContext | SchemaSymbols::XSD_UNION); if (baseValidator == 0) { popCurrentTypeNameStack(); return 0; } validators->addElement(baseValidator); } else { // REVISIT - should we break. For now, we will continue and move to // the next sibling reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::ListUnionRestrictionError, typeName); } content = XUtil::getNextSiblingElement(content); } // end while DatatypeValidator* newDV = 0; janValidators.orphan(); try { newDV = fDatatypeRegistry->createDatatypeValidator(qualifiedName, validators, finalSet, true, fGrammarPoolMemoryManager); } catch (const XMLException& excep) { reportSchemaError(contentElem, excep); } catch(const OutOfMemoryException&) { throw; } catch(...) { reportSchemaError(contentElem, XMLUni::fgXMLErrDomain, XMLErrs::DatatypeValidatorCreationError, typeName); } popCurrentTypeNameStack(); return newDV; } /** * Traverse SimpleContent Declaration * * * * Content: (annotation? , (restriction | extension)) * * * * * Content: (annotation?, (simpleType?, (minExclusive | minInclusive * | maxExclusive | maxInclusive | totalDigits | fractionDigits * | length | minLength | maxLength | enumeration | pattern * | whiteSpace)*)?, ((attribute | attributeGroup)* , anyAttribute?)) * * * * Content: (annotation? , ((attribute | attributeGroup)* , anyAttribute?)) * * */ void TraverseSchema::traverseSimpleContentDecl(const XMLCh* const typeName, const XMLCh* const qualifiedName, const DOMElement* const contentDecl, ComplexTypeInfo* const typeInfo, Janitor* const janAnnot) { NamespaceScopeManager nsMgr(contentDecl, fSchemaInfo, this); // ----------------------------------------------------------------------- // Check Attributes // ----------------------------------------------------------------------- bool preProcessFlag = typeInfo->getPreprocessed(); if (!preProcessFlag) { fAttributeCheck.checkAttributes( contentDecl, GeneralAttributeCheck::E_SimpleContent , this, false, fNonXSAttList ); } // ----------------------------------------------------------------------- // Set the content type to be simple, and initialize content spec handle // ----------------------------------------------------------------------- typeInfo->setContentType(SchemaElementDecl::Simple); // ----------------------------------------------------------------------- // Process annotation if any // ----------------------------------------------------------------------- DOMElement* simpleContent = checkContent(contentDecl, XUtil::getFirstChildElement(contentDecl), false, !preProcessFlag); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(contentDecl, fNonXSAttList); } if (fAnnotation) { if (janAnnot->isDataNull()) janAnnot->reset(fAnnotation); else janAnnot->get()->setNext(fAnnotation); } // If there are no children, return if (simpleContent == 0) { reportSchemaError(contentDecl, XMLUni::fgXMLErrDomain, XMLErrs::EmptySimpleTypeContent); throw TraverseSchema::InvalidComplexTypeInfo; } NamespaceScopeManager nsMgr2(simpleContent, fSchemaInfo, this); // ----------------------------------------------------------------------- // The content should be either "restriction" or "extension" // ----------------------------------------------------------------------- if (!preProcessFlag) { const XMLCh* const contentName = simpleContent->getLocalName(); if (XMLString::equals(contentName, SchemaSymbols::fgATTVAL_RESTRICTION)) { fAttributeCheck.checkAttributes( simpleContent, GeneralAttributeCheck::E_Restriction , this, false, fNonXSAttList ); typeInfo->setDerivedBy(SchemaSymbols::XSD_RESTRICTION); } else if (XMLString::equals(contentName, SchemaSymbols::fgATTVAL_EXTENSION)) { fAttributeCheck.checkAttributes( simpleContent, GeneralAttributeCheck::E_Extension , this, false, fNonXSAttList ); typeInfo->setDerivedBy(SchemaSymbols::XSD_EXTENSION); } else { reportSchemaError(simpleContent, XMLUni::fgXMLErrDomain, XMLErrs::InvalidSimpleContent); throw TraverseSchema::InvalidComplexTypeInfo; } } //Skip over any annotations in the restriction or extension elements DOMElement* content = checkContent(simpleContent, XUtil::getFirstChildElement(simpleContent), true, !preProcessFlag); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(simpleContent, fNonXSAttList); } if (fAnnotation) { if (janAnnot->isDataNull()) janAnnot->reset(fAnnotation); else janAnnot->get()->setNext(fAnnotation); } // ----------------------------------------------------------------------- // Handle the base type name // ----------------------------------------------------------------------- const XMLCh* baseName = getElementAttValue(simpleContent, SchemaSymbols::fgATT_BASE, DatatypeValidator::QName); if (!baseName || !*baseName) { reportSchemaError(simpleContent, XMLUni::fgXMLErrDomain, XMLErrs::UnspecifiedBase); throw TraverseSchema::InvalidComplexTypeInfo; } const XMLCh* prefix = getPrefix(baseName); const XMLCh* localPart = getLocalPart(baseName); const XMLCh* uri = resolvePrefixToURI(simpleContent, prefix); // check for 'anyType' if (XMLString::equals(uri, SchemaSymbols::fgURI_SCHEMAFORSCHEMA) && XMLString::equals(localPart, SchemaSymbols::fgATTVAL_ANYTYPE)) { reportSchemaError(simpleContent, XMLUni::fgXMLErrDomain, XMLErrs::InvalidSimpleContentBase, baseName); throw TraverseSchema::InvalidComplexTypeInfo; } processBaseTypeInfo(simpleContent, baseName, localPart, uri, typeInfo); ComplexTypeInfo* baseTypeInfo = typeInfo->getBaseComplexTypeInfo(); DatatypeValidator* baseValidator = typeInfo->getBaseDatatypeValidator(); if (baseValidator != 0 && baseTypeInfo == 0) { // check that the simpleType does not preclude derivation by extension if ((baseValidator->getFinalSet() & SchemaSymbols::XSD_EXTENSION) == typeInfo->getDerivedBy()) { reportSchemaError(simpleContent, XMLUni::fgXMLErrDomain, XMLErrs::DisallowedSimpleTypeExtension, baseName, typeName); throw TraverseSchema::InvalidComplexTypeInfo; } //Schema Spec: 5.11: Complex Type Definition Properties Correct: 2 if (typeInfo->getDerivedBy() == SchemaSymbols::XSD_RESTRICTION) { reportSchemaError(simpleContent, XMLUni::fgXMLErrDomain, XMLErrs::InvalidComplexTypeBase, baseName); throw TraverseSchema::InvalidComplexTypeInfo; } } // check that the base isn't a complex type with complex content // and that derivation method is not included in 'final' bool simpleTypeRequired = false; if (baseTypeInfo) { if (baseTypeInfo->getContentType() != SchemaElementDecl::Simple) { // Schema Errata: E1-27 if (typeInfo->getDerivedBy() == SchemaSymbols::XSD_RESTRICTION && ((baseTypeInfo->getContentType() == SchemaElementDecl::Mixed_Simple || baseTypeInfo->getContentType() == SchemaElementDecl::Mixed_Complex) && emptiableParticle(baseTypeInfo->getContentSpec()))) { simpleTypeRequired = true; } else { reportSchemaError(simpleContent, XMLUni::fgXMLErrDomain, XMLErrs::InvalidSimpleContentBase, baseName); throw TraverseSchema::InvalidComplexTypeInfo; } } if ((baseTypeInfo->getFinalSet() & typeInfo->getDerivedBy()) != 0) { reportSchemaError(simpleContent, XMLUni::fgXMLErrDomain, XMLErrs::ForbiddenDerivation, baseName); throw TraverseSchema::InvalidComplexTypeInfo; } } // ----------------------------------------------------------------------- // Process the content of the derivation // ----------------------------------------------------------------------- if (typeInfo->getDerivedBy() == SchemaSymbols::XSD_RESTRICTION) { if(baseTypeInfo) typeInfo->setBaseDatatypeValidator(baseTypeInfo->getDatatypeValidator()); if (content != 0) { // --------------------------------------------------------------- // There may be a simple type definition in the restriction // element. The data type validator will be based on it, if // specified // --------------------------------------------------------------- if (XMLString::equals(content->getLocalName(), SchemaSymbols::fgELT_SIMPLETYPE)) { DatatypeValidator* simpleTypeDV = traverseSimpleTypeDecl(content, false); if (simpleTypeDV) { // Check that the simpleType validator is validly derived // from base DatatypeValidator* baseDV = typeInfo->getBaseDatatypeValidator(); if (baseDV && !baseDV->isSubstitutableBy(simpleTypeDV)) { reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::InvalidContentRestriction); throw TraverseSchema::InvalidComplexTypeInfo; } typeInfo->setBaseDatatypeValidator(simpleTypeDV); content = XUtil::getNextSiblingElement(content); } else { throw TraverseSchema::InvalidComplexTypeInfo; } } // Schema Errata E1-27 // Complex Type Definition Restriction OK: 2.2 else if (simpleTypeRequired) { reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::CT_SimpleTypeChildRequired); throw TraverseSchema::InvalidComplexTypeInfo; } // --------------------------------------------------------------- // Build up the facet info // --------------------------------------------------------------- RefHashTableOf* facets = 0; RefArrayVectorOf* enums = 0; XMLBuffer pattern(128, fGrammarPoolMemoryManager); XMLCh fixedFlagStr[16]; unsigned int fixedFlag = 0; unsigned short scope = 0; bool isFirstPattern = true; while (content != 0) { const XMLCh* facetName = content->getLocalName(); bool bDoBreak=false; // workaround for Borland bug with 'break' in 'catch' // if not a valid facet, break from the loop try { scope = fAttributeCheck.getFacetId(facetName, fMemoryManager); } catch(const OutOfMemoryException&) { throw; } catch(...) { bDoBreak=true; } if(bDoBreak) break; if (content->getNodeType() == DOMNode::ELEMENT_NODE) { fAttributeCheck.checkAttributes(content, scope, this); const XMLCh* attValue = content->getAttribute(SchemaSymbols::fgATT_VALUE); if (facets == 0) { facets = new (fGrammarPoolMemoryManager) RefHashTableOf(29, true, fGrammarPoolMemoryManager); } if (XMLString::equals(facetName, SchemaSymbols::fgELT_ENUMERATION)) { if (!enums) { enums = new (fGrammarPoolMemoryManager) RefArrayVectorOf(8, true, fGrammarPoolMemoryManager); } enums->addElement(XMLString::replicate(attValue, fGrammarPoolMemoryManager)); } else if (XMLString::equals(facetName, SchemaSymbols::fgELT_PATTERN)) { if (isFirstPattern) { // fBuffer.isEmpty() - overhead call isFirstPattern = false; pattern.set(attValue); } else { //datatypes: 5.2.4 pattern pattern.append(chPipe); pattern.append(attValue); } } else { if (facets->containsKey(facetName)) { reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateFacet, facetName); } else { const XMLCh* facetNameStr = fStringPool->getValueForId(fStringPool->addOrFind(facetName)); facets->put((void*) facetNameStr, new (fGrammarPoolMemoryManager) KVStringPair(facetNameStr, attValue, fGrammarPoolMemoryManager)); checkFixedFacet(content, facetNameStr, typeInfo->getBaseDatatypeValidator(), fixedFlag); } } } content = XUtil::getNextSiblingElement(content); } if (facets) { if (!pattern.isEmpty()) { facets->put ( (void*) SchemaSymbols::fgELT_PATTERN, new (fGrammarPoolMemoryManager) KVStringPair ( SchemaSymbols::fgELT_PATTERN , pattern.getRawBuffer() , pattern.getLen() , fGrammarPoolMemoryManager ) ); } if (fixedFlag) { XMLString::binToText(fixedFlag, fixedFlagStr, 15, 10, fGrammarPoolMemoryManager); facets->put((void*) SchemaSymbols::fgATT_FIXED, new (fGrammarPoolMemoryManager) KVStringPair(SchemaSymbols::fgATT_FIXED, fixedFlagStr, fGrammarPoolMemoryManager)); } try { DatatypeValidator* simpleDV = fDatatypeRegistry->createDatatypeValidator ( qualifiedName, typeInfo->getBaseDatatypeValidator(), facets, enums, false, 0, true, fGrammarPoolMemoryManager ); simpleDV->setAnonymous(); typeInfo->setDatatypeValidator(simpleDV); } catch (const XMLException& excep) { reportSchemaError(simpleContent, excep); } catch(const OutOfMemoryException&) { throw; } catch(...) { reportSchemaError(simpleContent, XMLUni::fgXMLErrDomain, XMLErrs::DatatypeValidatorCreationError, typeName); } } else { typeInfo->setDatatypeValidator(typeInfo->getBaseDatatypeValidator()); } } else { // Schema Errata E1-27 // Complex Type Definition Restriction OK: 2.2 if (simpleTypeRequired) { reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::CT_SimpleTypeChildRequired); throw TraverseSchema::InvalidComplexTypeInfo; } typeInfo->setDatatypeValidator(typeInfo->getBaseDatatypeValidator()); } } // end RESTRICTION else { // EXTENSION ComplexTypeInfo* baseTypeInfo = typeInfo->getBaseComplexTypeInfo(); if (baseTypeInfo!= 0) { typeInfo->setBaseDatatypeValidator(baseTypeInfo->getDatatypeValidator()); } typeInfo->setDatatypeValidator(typeInfo->getBaseDatatypeValidator()); } // ----------------------------------------------------------------------- // Process attributes if any // ----------------------------------------------------------------------- processAttributes(simpleContent, content, typeInfo); if (XUtil::getNextSiblingElement(simpleContent) != 0) { reportSchemaError(simpleContent, XMLUni::fgXMLErrDomain, XMLErrs::InvalidChildInSimpleContent); } } // End of function traverseSimpleContentDecl /** * Traverse complexContent Declaration * * * * Content: (annotation? , (restriction | extension)) * * * * * Content: (annotation? , (group | all | choice | sequence)?, * ((attribute | attributeGroup)* , anyAttribute?)) * * * * Content: (annotation? , (group | all | choice | sequence)?, * ((attribute | attributeGroup)* , anyAttribute?)) * */ void TraverseSchema::traverseComplexContentDecl(const XMLCh* const typeName, const DOMElement* const contentDecl, ComplexTypeInfo* const typeInfo, const bool isMixed, Janitor* const janAnnot) { NamespaceScopeManager nsMgr(contentDecl, fSchemaInfo, this); // ----------------------------------------------------------------------- // Check attributes // ----------------------------------------------------------------------- bool preProcessFlag = typeInfo->getPreprocessed(); if (!preProcessFlag) { fAttributeCheck.checkAttributes( contentDecl, GeneralAttributeCheck::E_ComplexContent , this, false, fNonXSAttList ); } // ----------------------------------------------------------------------- // Determine whether the content is mixed, or element-only // Setting here overrides any setting on the complex type decl // ----------------------------------------------------------------------- const XMLCh* const mixed = getElementAttValue(contentDecl, SchemaSymbols::fgATT_MIXED, DatatypeValidator::Boolean); bool mixedContent = isMixed; if (mixed) { if (XMLString::equals(mixed, SchemaSymbols::fgATTVAL_TRUE) || XMLString::equals(mixed, fgValueOne)) { mixedContent = true; } else if (XMLString::equals(mixed, SchemaSymbols::fgATTVAL_FALSE) || XMLString::equals(mixed, fgValueZero)) { mixedContent = false; } } // ----------------------------------------------------------------------- // Since the type must have complex content, set the simple type validators // to null // ----------------------------------------------------------------------- typeInfo->setDatatypeValidator(0); typeInfo->setBaseDatatypeValidator(0); DOMElement* complexContent = checkContent(contentDecl,XUtil::getFirstChildElement(contentDecl),false, !preProcessFlag); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(contentDecl, fNonXSAttList); } if (fAnnotation) { if (janAnnot->isDataNull()) janAnnot->reset(fAnnotation); else janAnnot->get()->setNext(fAnnotation); } // If there are no children, return if (complexContent == 0) { throw TraverseSchema::InvalidComplexTypeInfo; } NamespaceScopeManager nsMgr2(complexContent, fSchemaInfo, this); // ----------------------------------------------------------------------- // The content should be either "restriction" or "extension" // ----------------------------------------------------------------------- const XMLCh* const complexContentName = complexContent->getLocalName(); if (XMLString::equals(complexContentName, SchemaSymbols::fgELT_RESTRICTION)) { typeInfo->setDerivedBy(SchemaSymbols::XSD_RESTRICTION); } else if (XMLString::equals(complexContentName, SchemaSymbols::fgELT_EXTENSION)) { typeInfo->setDerivedBy(SchemaSymbols::XSD_EXTENSION); } else { reportSchemaError(complexContent, XMLUni::fgXMLErrDomain, XMLErrs::InvalidComplexContent); throw TraverseSchema::InvalidComplexTypeInfo; } // ----------------------------------------------------------------------- // Handle the base type name // ----------------------------------------------------------------------- const XMLCh* baseName = getElementAttValue(complexContent, SchemaSymbols::fgATT_BASE, DatatypeValidator::QName); if (!baseName || !*baseName) { reportSchemaError(complexContent, XMLUni::fgXMLErrDomain, XMLErrs::UnspecifiedBase); throw TraverseSchema::InvalidComplexTypeInfo; } const XMLCh* prefix = getPrefix(baseName); const XMLCh* localPart = getLocalPart(baseName); const XMLCh* uri = resolvePrefixToURI(complexContent, prefix); bool isBaseAnyType = false; // ------------------------------------------------------------- // check if the base is "anyType" // ------------------------------------------------------------- if (XMLString::equals(uri, SchemaSymbols::fgURI_SCHEMAFORSCHEMA) && XMLString::equals(localPart, SchemaSymbols::fgATTVAL_ANYTYPE)) { isBaseAnyType = true; } else { processBaseTypeInfo(complexContent, baseName, localPart, uri, typeInfo); //Check that the base is a complex type if (typeInfo->getBaseComplexTypeInfo() == 0) { reportSchemaError(complexContent, XMLUni::fgXMLErrDomain, XMLErrs::BaseNotComplexType); throw TraverseSchema::InvalidComplexTypeInfo; } } if (fCurrentGroupInfo) // defer processing until later throw TraverseSchema::RecursingElement; // ----------------------------------------------------------------------- // Process the content of the derivation // ----------------------------------------------------------------------- //Skip over any annotations in the restriction or extension elements DOMElement* content = checkContent(complexContent, XUtil::getFirstChildElement(complexContent), true); if (fAnnotation) { if (janAnnot->isDataNull()) janAnnot->reset(fAnnotation); else janAnnot->get()->setNext(fAnnotation); } processComplexContent(complexContent, typeName, content, typeInfo, localPart, mixedContent, isBaseAnyType); if (XUtil::getNextSiblingElement(complexContent) != 0) { reportSchemaError(complexContent, XMLUni::fgXMLErrDomain, XMLErrs::InvalidChildInComplexContent); } } /** * * processContents = (lax | skip | strict) : strict * Content: (annotation?) * */ SchemaAttDef* TraverseSchema::traverseAnyAttribute(const DOMElement* const elem) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); // ----------------------------------------------------------------------- // Check Attributes // ----------------------------------------------------------------------- fAttributeCheck.checkAttributes( elem, GeneralAttributeCheck::E_AnyAttribute, this, false, fNonXSAttList ); // ------------------------------------------------------------------ // First, handle any ANNOTATION declaration // ------------------------------------------------------------------ if (checkContent(elem, XUtil::getFirstChildElement(elem), true) != 0) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::AnyAttributeContentError); } if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(elem, fNonXSAttList); } Janitor janAnnot(fAnnotation); // ------------------------------------------------------------------ // Get attributes // ------------------------------------------------------------------ const XMLCh* const processContents = getElementAttValue(elem, SchemaSymbols::fgATT_PROCESSCONTENTS); const XMLCh* const nameSpace = getElementAttValue(elem, SchemaSymbols::fgATT_NAMESPACE); // ------------------------------------------------------------------ // Set default att type based on 'processContents' value // ------------------------------------------------------------------ XMLAttDef::DefAttTypes attDefType = XMLAttDef::ProcessContents_Strict; if ((!processContents || !*processContents) || XMLString::equals(processContents, SchemaSymbols::fgATTVAL_STRICT)) { // Do nothing - defaulted already } else if (XMLString::equals(processContents, SchemaSymbols::fgATTVAL_SKIP)) { attDefType = XMLAttDef::ProcessContents_Skip; } else if (XMLString::equals(processContents, SchemaSymbols::fgATTVAL_LAX)) { attDefType = XMLAttDef::ProcessContents_Lax; } // ------------------------------------------------------------------ // Process 'namespace' attribute // ------------------------------------------------------------------ int uriIndex = fEmptyNamespaceURI; XMLAttDef::AttTypes attType = XMLAttDef::Any_Any; ValueVectorOf namespaceList(8, fGrammarPoolMemoryManager); if ((!nameSpace || !*nameSpace) || XMLString::equals(nameSpace, SchemaSymbols::fgATTVAL_TWOPOUNDANY)) { // Do nothing - defaulted already } else if (XMLString::equals(nameSpace, SchemaSymbols::fgATTVAL_TWOPOUNDOTHER)) { attType = XMLAttDef::Any_Other; uriIndex = fTargetNSURI; } else { XMLStringTokenizer tokenizer(nameSpace, fGrammarPoolMemoryManager); DatatypeValidator* anyURIDV = fDatatypeRegistry->getDatatypeValidator(SchemaSymbols::fgDT_ANYURI); attType = XMLAttDef::Any_List; while (tokenizer.hasMoreTokens()) { const XMLCh* token = tokenizer.nextToken(); if (XMLString::equals(token, SchemaSymbols::fgATTVAL_TWOPOUNDLOCAL)) { uriIndex = fEmptyNamespaceURI; } else if (XMLString::equals(token, SchemaSymbols::fgATTVAL_TWOPOUNDTRAGETNAMESPACE)) { uriIndex = fTargetNSURI; } else { try { anyURIDV->validate(token , fSchemaInfo->getValidationContext() , fMemoryManager); } catch(const XMLException& excep) { reportSchemaError(elem, excep); } uriIndex = fURIStringPool->addOrFind(token); } if (!namespaceList.containsElement(uriIndex)) { namespaceList.addElement(uriIndex); } } uriIndex = fEmptyNamespaceURI; } // ------------------------------------------------------------------ // Create wildcard attribute // ------------------------------------------------------------------ SchemaAttDef* attDef = new (fGrammarPoolMemoryManager) SchemaAttDef(XMLUni::fgZeroLenString, XMLUni::fgZeroLenString, uriIndex, attType, attDefType, fGrammarPoolMemoryManager); if (!janAnnot.isDataNull()) fSchemaGrammar->putAnnotation(attDef, janAnnot.release()); if (namespaceList.size()) { attDef->setNamespaceList(&namespaceList); } return attDef; } /** * */ void TraverseSchema::traverseKey(const DOMElement* const icElem, SchemaElementDecl* const elemDecl) { NamespaceScopeManager nsMgr(icElem, fSchemaInfo, this); // ----------------------------------------------------------------------- // Check Attributes // ----------------------------------------------------------------------- fAttributeCheck.checkAttributes( icElem, GeneralAttributeCheck::E_Key, this, false, fNonXSAttList ); // ----------------------------------------------------------------------- // Create identity constraint // ----------------------------------------------------------------------- const XMLCh* name = getElementAttValue(icElem, SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName); if (!XMLChar1_0::isValidNCName(name, XMLString::stringLen(name))) { reportSchemaError(icElem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidDeclarationName, SchemaSymbols::fgELT_KEY, name); return; } if (!fIdentityConstraintNames) { fIdentityConstraintNames = new (fMemoryManager) RefHash2KeysTableOf(29, (bool) false, fMemoryManager); } else if (fIdentityConstraintNames->containsKey(name, fTargetNSURI)) { reportSchemaError(icElem, XMLUni::fgXMLErrDomain, XMLErrs::IC_DuplicateDecl, name); return; } IC_Key* icKey = new (fGrammarPoolMemoryManager) IC_Key(name, elemDecl->getBaseName(), fGrammarPoolMemoryManager); Janitor janKey(icKey); fIdentityConstraintNames->put((void*) name, fTargetNSURI, icKey); // ----------------------------------------------------------------------- // Get selector and fields // ----------------------------------------------------------------------- if (!traverseIdentityConstraint(icKey, icElem)) { fIdentityConstraintNames->put((void*) name, fTargetNSURI, 0); return; } // ----------------------------------------------------------------------- // Add key to element declaration // ----------------------------------------------------------------------- elemDecl->addIdentityConstraint(icKey); icKey->setNamespaceURI(fTargetNSURI); janKey.orphan(); } /** * */ void TraverseSchema::traverseUnique(const DOMElement* const icElem, SchemaElementDecl* const elemDecl) { NamespaceScopeManager nsMgr(icElem, fSchemaInfo, this); // ----------------------------------------------------------------------- // Check Attributes // ----------------------------------------------------------------------- fAttributeCheck.checkAttributes( icElem, GeneralAttributeCheck::E_Unique, this, false, fNonXSAttList ); // ----------------------------------------------------------------------- // Create identity constraint // ----------------------------------------------------------------------- const XMLCh* name = getElementAttValue(icElem, SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName); if (!XMLChar1_0::isValidNCName(name, XMLString::stringLen(name))) { reportSchemaError(icElem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidDeclarationName, SchemaSymbols::fgELT_UNIQUE, name); return; } if (!fIdentityConstraintNames) { fIdentityConstraintNames = new (fGrammarPoolMemoryManager) RefHash2KeysTableOf(29, (bool) false, fGrammarPoolMemoryManager); } else if (fIdentityConstraintNames->containsKey(name, fTargetNSURI)) { reportSchemaError(icElem, XMLUni::fgXMLErrDomain, XMLErrs::IC_DuplicateDecl, name); return; } IC_Unique* icUnique = new (fGrammarPoolMemoryManager) IC_Unique(name, elemDecl->getBaseName(), fGrammarPoolMemoryManager); Janitor janUnique(icUnique); fIdentityConstraintNames->put((void*) name, fTargetNSURI, icUnique); // ----------------------------------------------------------------------- // Get selector and fields // ----------------------------------------------------------------------- if (!traverseIdentityConstraint(icUnique, icElem)) { fIdentityConstraintNames->put((void*) name, fTargetNSURI, 0); return; } // ----------------------------------------------------------------------- // Add identity cosntraints to element declaration // ----------------------------------------------------------------------- elemDecl->addIdentityConstraint(icUnique); icUnique->setNamespaceURI(fTargetNSURI); janUnique.orphan(); } /** * */ void TraverseSchema::traverseKeyRef(const DOMElement* const icElem, SchemaElementDecl* const elemDecl) { NamespaceScopeManager nsMgr(icElem, fSchemaInfo, this); // ----------------------------------------------------------------------- // Check Attributes // ----------------------------------------------------------------------- fAttributeCheck.checkAttributes( icElem, GeneralAttributeCheck::E_KeyRef, this, false, fNonXSAttList ); // ----------------------------------------------------------------------- // Verify that key reference "refer" attribute is valid // ----------------------------------------------------------------------- const XMLCh* name = getElementAttValue(icElem, SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName); const XMLCh* refer = getElementAttValue(icElem, SchemaSymbols::fgATT_REFER, DatatypeValidator::QName); if (!XMLChar1_0::isValidNCName(name, XMLString::stringLen(name))) { reportSchemaError(icElem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidDeclarationName, SchemaSymbols::fgELT_KEYREF, name); return; } const XMLCh* prefix = getPrefix(refer); const XMLCh* localPart = getLocalPart(refer); // we use the DOM API, as the NamespaceScope is now pointing to a different place const XMLCh* uriStr = icElem->lookupNamespaceURI(*prefix==0?NULL:prefix); if ((!uriStr || !*uriStr) && (prefix && *prefix)) reportSchemaError(icElem, XMLUni::fgXMLErrDomain, XMLErrs::UnresolvedPrefix, prefix); if(!uriStr) uriStr=XMLUni::fgZeroLenString; IdentityConstraint* icKey = (fIdentityConstraintNames) ? fIdentityConstraintNames->get(localPart, fURIStringPool->addOrFind(uriStr)) : 0; if (!icKey) { reportSchemaError(icElem, XMLUni::fgXMLErrDomain, XMLErrs::IC_KeyRefReferNotFound, name, localPart); return; } // ----------------------------------------------------------------------- // Create identity constraint // ----------------------------------------------------------------------- if(fIdentityConstraintNames->containsKey(name, fTargetNSURI)) { reportSchemaError(icElem, XMLUni::fgXMLErrDomain, XMLErrs::IC_DuplicateDecl, name); return; } IC_KeyRef* icKeyRef = new (fGrammarPoolMemoryManager) IC_KeyRef(name, elemDecl->getBaseName(), icKey, fGrammarPoolMemoryManager); Janitor janKeyRef(icKeyRef); fIdentityConstraintNames->put((void*) name, fTargetNSURI, icKeyRef); // ----------------------------------------------------------------------- // Get selector and fields // ----------------------------------------------------------------------- if (!traverseIdentityConstraint(icKeyRef, icElem)) { fIdentityConstraintNames->put((void*) name, fTargetNSURI, 0); return; } // ----------------------------------------------------------------------- // Add key reference to element decl // ----------------------------------------------------------------------- if (icKeyRef->getFieldCount() != icKey->getFieldCount()) { fIdentityConstraintNames->put((void*) name, fTargetNSURI, 0); reportSchemaError(icElem, XMLUni::fgXMLErrDomain, XMLErrs::IC_KeyRefCardinality, name, icKey->getIdentityConstraintName()); } else { elemDecl->addIdentityConstraint(icKeyRef); icKeyRef->setNamespaceURI(fTargetNSURI); janKeyRef.orphan(); } } bool TraverseSchema::traverseIdentityConstraint(IdentityConstraint* const ic, const DOMElement* const icElem) { NamespaceScopeManager nsMgr(icElem, fSchemaInfo, this); // ------------------------------------------------------------------ // First, handle any ANNOTATION declaration // ------------------------------------------------------------------ DOMElement* elem = checkContent(icElem, XUtil::getFirstChildElement(icElem), false); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(icElem, fNonXSAttList); } Janitor janAnnot(fAnnotation); // ------------------------------------------------------------------ // Get selector // ------------------------------------------------------------------ if (elem == 0) { // reportSchemaError(icElem, XMLUni::fgXMLErrDomain, XMLErrs::IC_BadContent); return false; } if (!XMLString::equals(elem->getLocalName(), SchemaSymbols::fgELT_SELECTOR)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::IC_BadContent); return false; } fAttributeCheck.checkAttributes( elem, GeneralAttributeCheck::E_Selector, this, false, fNonXSAttList ); if (checkContent(icElem, XUtil::getFirstChildElement(elem), true) != 0) reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::OnlyAnnotationExpected); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(elem, fNonXSAttList); } if (fAnnotation) { if (janAnnot.isDataNull()) janAnnot.reset(fAnnotation); else janAnnot.get()->setNext(fAnnotation); } // ------------------------------------------------------------------ // Get xpath attribute // ------------------------------------------------------------------ const XMLCh* xpathExpr = getElementAttValue(elem, SchemaSymbols::fgATT_XPATH); XMLSize_t xpathLen = XMLString::stringLen(xpathExpr); if (!xpathExpr || !xpathLen) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::IC_XPathExprMissing); return false; } // ------------------------------------------------------------------ // Parse xpath expression // ------------------------------------------------------------------ try { XercesXPath* sXPath = new (fGrammarPoolMemoryManager) XercesXPath(xpathExpr, fStringPool, fSchemaInfo->getNamespaceScope(), fEmptyNamespaceURI, true, fGrammarPoolMemoryManager); IC_Selector* icSelector = new (fGrammarPoolMemoryManager) IC_Selector(sXPath, ic); ic->setSelector(icSelector); } catch (const XPathException& e) { reportSchemaError(elem, e); return false; } // ------------------------------------------------------------------ // Get fields // ------------------------------------------------------------------ elem = XUtil::getNextSiblingElement(elem); if (elem == 0) { reportSchemaError(icElem, XMLUni::fgXMLErrDomain, XMLErrs::IC_BadContent); return false; } while (elem != 0) { if (!XMLString::equals(elem->getLocalName(), SchemaSymbols::fgELT_FIELD)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::IC_BadContent); } else { // General Attribute Checking fAttributeCheck.checkAttributes( elem, GeneralAttributeCheck::E_Field, this, false, fNonXSAttList ); if (checkContent(icElem, XUtil::getFirstChildElement(elem), true) != 0) reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::OnlyAnnotationExpected); if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size()) { fAnnotation = generateSyntheticAnnotation(elem, fNonXSAttList); } if (fAnnotation) { if (janAnnot.isDataNull()) janAnnot.reset(fAnnotation); else janAnnot.get()->setNext(fAnnotation); } // xpath expression parsing xpathExpr = getElementAttValue(elem, SchemaSymbols::fgATT_XPATH); if (!xpathExpr || !*xpathExpr) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::IC_XPathExprMissing); return false; } try { XercesXPath* fieldXPath = new (fGrammarPoolMemoryManager) XercesXPath ( xpathExpr , fStringPool , fSchemaInfo->getNamespaceScope() , fEmptyNamespaceURI , false , fGrammarPoolMemoryManager ); IC_Field* icField = new (fGrammarPoolMemoryManager) IC_Field(fieldXPath, ic); ic->addField(icField); } catch (const XPathException& e) { reportSchemaError(elem, e); return false; } } elem = XUtil::getNextSiblingElement(elem); } if (!janAnnot.isDataNull()) fSchemaGrammar->putAnnotation(ic, janAnnot.release()); if (ic->getFieldCount() == 0) { return false; } return true; } // --------------------------------------------------------------------------- // TraverseSchema: Helper methods // --------------------------------------------------------------------------- bool TraverseSchema::retrieveNamespaceMapping(const DOMElement* const elem) { DOMNamedNodeMap* eltAttrs = elem->getAttributes(); bool seenNS=false; const XMLSize_t attrCount = eltAttrs->getLength(); for (XMLSize_t i = 0; i < attrCount; i++) { DOMNode* attribute = eltAttrs->item(i); if (!attribute) { break; } const XMLCh* attName = attribute->getNodeName(); // starts with 'xmlns:' if (XMLString::startsWith(attName, XMLUni::fgXMLNSColonString)) { if(!seenNS) fSchemaInfo->getNamespaceScope()->increaseDepth(); seenNS=true; int offsetIndex = XMLString::indexOf(attName, chColon); const XMLCh* attValue = attribute->getNodeValue(); fSchemaInfo->getNamespaceScope()->addPrefix(attName + offsetIndex + 1, fURIStringPool->addOrFind(attValue)); } else if (XMLString::equals(attName, XMLUni::fgXMLNSString)) { // == 'xmlns' if(!seenNS) fSchemaInfo->getNamespaceScope()->increaseDepth(); seenNS=true; const XMLCh* attValue = attribute->getNodeValue(); fSchemaInfo->getNamespaceScope()->addPrefix(XMLUni::fgZeroLenString, fURIStringPool->addOrFind(attValue)); } } // end for return seenNS; } void TraverseSchema::processChildren(const DOMElement* const root) { NamespaceScopeManager nsMgr(root, fSchemaInfo, this); bool sawAnnotation = false; // process , and info items. DOMElement* child = XUtil::getFirstChildElement(root); for (; child != 0; child = XUtil::getNextSiblingElement(child)) { const XMLCh* name = child->getLocalName(); if (XMLString::equals(name, SchemaSymbols::fgELT_ANNOTATION)) { XSAnnotation* annot = traverseAnnotationDecl( child, fSchemaInfo->getNonXSAttList(), true); if (annot) { fSchemaGrammar->addAnnotation(annot); sawAnnotation = true; } } else if (XMLString::equals(name, SchemaSymbols::fgELT_INCLUDE)) { traverseInclude(child); } else if (XMLString::equals(name, SchemaSymbols::fgELT_IMPORT)) { traverseImport(child); } else if (XMLString::equals(name, SchemaSymbols::fgELT_REDEFINE)) { traverseRedefine(child); } else break; } // child refers to the first info item which is not or // one of the schema inclusion/importation declarations. for (; child != 0; child = XUtil::getNextSiblingElement(child)) { const XMLCh* name = child->getLocalName(); const XMLCh* typeName = getElementAttValue(child, SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName); int fullNameId = 0; if (typeName) { fBuffer.set(fTargetNSURIString); fBuffer.append(chComma); fBuffer.append(typeName); fullNameId = fStringPool->addOrFind(fBuffer.getRawBuffer()); } if (XMLString::equals(name, SchemaSymbols::fgELT_ANNOTATION)) { XSAnnotation* annot = traverseAnnotationDecl( child, fSchemaInfo->getNonXSAttList(), true); if (annot) { fSchemaGrammar->addAnnotation(annot); sawAnnotation = true; } } else if (XMLString::equals(name, SchemaSymbols::fgELT_SIMPLETYPE)) { if (typeName && *typeName) { if (fGlobalDeclarations[ENUM_ELT_SIMPLETYPE]->containsElement(fullNameId) || fGlobalDeclarations[ENUM_ELT_COMPLEXTYPE]->containsElement(fullNameId)) { reportSchemaError(child, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateGlobalType, SchemaSymbols::fgELT_SIMPLETYPE, typeName, SchemaSymbols::fgELT_COMPLEXTYPE); continue; } else { fGlobalDeclarations[ENUM_ELT_SIMPLETYPE]->addElement(fullNameId); } } traverseSimpleTypeDecl(child); } else if (XMLString::equals(name, SchemaSymbols::fgELT_COMPLEXTYPE)) { if (typeName && *typeName) { if (fGlobalDeclarations[ENUM_ELT_SIMPLETYPE]->containsElement(fullNameId) || fGlobalDeclarations[ENUM_ELT_COMPLEXTYPE]->containsElement(fullNameId)) { reportSchemaError(child, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateGlobalType, SchemaSymbols::fgELT_COMPLEXTYPE, typeName, SchemaSymbols::fgELT_SIMPLETYPE); continue; } else { fGlobalDeclarations[ENUM_ELT_COMPLEXTYPE]->addElement(fullNameId); } } traverseComplexTypeDecl(child); } else if (XMLString::equals(name, SchemaSymbols::fgELT_ELEMENT)) { if (typeName && *typeName) { if (fGlobalDeclarations[ENUM_ELT_ELEMENT]->containsElement(fullNameId)) { reportSchemaError(child, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateGlobalDeclaration, SchemaSymbols::fgELT_ELEMENT, typeName); continue; } else { fGlobalDeclarations[ENUM_ELT_ELEMENT]->addElement(fullNameId); } } traverseElementDecl(child, true); } else if (XMLString::equals(name, SchemaSymbols::fgELT_ATTRIBUTEGROUP)) { if (typeName && *typeName) { if (fGlobalDeclarations[ENUM_ELT_ATTRIBUTEGROUP]->containsElement(fullNameId)) { reportSchemaError(child, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateGlobalDeclaration, SchemaSymbols::fgELT_ATTRIBUTEGROUP, typeName); continue; } else { fGlobalDeclarations[ENUM_ELT_ATTRIBUTEGROUP]->addElement(fullNameId); } } if (!typeName || !fAttGroupRegistry->containsKey(typeName)) { traverseAttributeGroupDecl(child, 0, true); } } else if (XMLString::equals(name, SchemaSymbols::fgELT_ATTRIBUTE)) { if (typeName && *typeName) { if (fGlobalDeclarations[ENUM_ELT_ATTRIBUTE]->containsElement(fullNameId)) { reportSchemaError(child, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateAttribute, typeName); continue; } else { fGlobalDeclarations[ENUM_ELT_ATTRIBUTE]->addElement(fullNameId); } } if (!typeName || !fAttributeDeclRegistry->containsKey(typeName)) { traverseAttributeDecl( child, 0, true); } } else if (XMLString::equals(name, SchemaSymbols::fgELT_GROUP)) { if (typeName && *typeName) { if (fGlobalDeclarations[ENUM_ELT_GROUP]->containsElement(fullNameId)) { reportSchemaError(child, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateGlobalDeclaration, SchemaSymbols::fgELT_GROUP, typeName); continue; } else { fGlobalDeclarations[ENUM_ELT_GROUP]->addElement(fullNameId); } } if (!typeName || !fGroupRegistry->containsKey(fBuffer.getRawBuffer())) { traverseGroupDecl(child); } } else if (XMLString::equals(name, SchemaSymbols::fgELT_NOTATION)) { traverseNotationDecl(child); } else { reportSchemaError(child, XMLUni::fgXMLErrDomain, XMLErrs::SchemaElementContentError); } } // for each child node if (fScanner->getGenerateSyntheticAnnotations() && fSchemaInfo->getNonXSAttList()->size() && !sawAnnotation) { // synthesize a global annotation here. fSchemaGrammar->addAnnotation( generateSyntheticAnnotation(root, fSchemaInfo->getNonXSAttList()) ); } // Handle recursing elements - if any ValueVectorOf* recursingAnonTypes = fSchemaInfo->getRecursingAnonTypes(); if (recursingAnonTypes) { ValueVectorOf* recursingTypeNames = fSchemaInfo->getRecursingTypeNames(); XMLSize_t recurseSize = recursingAnonTypes->size(); for (XMLSize_t i=0; i < recurseSize; i++) { traverseComplexTypeDecl(recursingAnonTypes->elementAt(i), false, recursingTypeNames->elementAt(i)); } recursingAnonTypes->removeAllElements(); recursingTypeNames->removeAllElements(); } } void TraverseSchema::preprocessChildren(const DOMElement* const root) { NamespaceScopeManager nsMgr(root, fSchemaInfo, this); // process , and info items. DOMElement* child = XUtil::getFirstChildElement(root); for (; child != 0; child = XUtil::getNextSiblingElement(child)) { const XMLCh* name = child->getLocalName(); if (XMLString::equals(name, SchemaSymbols::fgELT_ANNOTATION)) { continue; } else if (XMLString::equals(name, SchemaSymbols::fgELT_INCLUDE)) { preprocessInclude(child); } else if (XMLString::equals(name, SchemaSymbols::fgELT_IMPORT)) { preprocessImport(child); } else if (XMLString::equals(name, SchemaSymbols::fgELT_REDEFINE)) { preprocessRedefine(child); } else break; } } DOMElement* TraverseSchema::checkContent( const DOMElement* const rootElem , DOMElement* const contentElem , const bool isEmpty , const bool processAnnot) { DOMElement* content = contentElem; const XMLCh* name = getElementAttValue(rootElem,SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName); fAnnotation = 0; Janitor janAnnot(0); if (!content) { if (!isEmpty) { reportSchemaError(rootElem, XMLUni::fgXMLErrDomain, XMLErrs::ContentError, name); } return 0; } if (XMLString::equals(content->getLocalName(), SchemaSymbols::fgELT_ANNOTATION)) { if (processAnnot) { janAnnot.reset(traverseAnnotationDecl(content, fNonXSAttList)); } content = XUtil::getNextSiblingElement(content); if (!content) { // must be followed by content if (!isEmpty) { reportSchemaError(contentElem, XMLUni::fgXMLErrDomain, XMLErrs::ContentError, name); } fAnnotation = janAnnot.release(); return 0; } if (XMLString::equals(content->getLocalName(), SchemaSymbols::fgELT_ANNOTATION)) { reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::AnnotationError, name); return 0; } fAnnotation = janAnnot.release(); } return content; } DatatypeValidator* TraverseSchema::getDatatypeValidator(const XMLCh* const uriStr, const XMLCh* const localPartStr) { DatatypeValidator* dv = 0; if (XMLString::equals(uriStr, SchemaSymbols::fgURI_SCHEMAFORSCHEMA)) { dv = fDatatypeRegistry->getDatatypeValidator(localPartStr); } else { fBuffer.set(uriStr); fBuffer.append(chComma); fBuffer.append(localPartStr); if ((uriStr) && !XMLString::equals(uriStr, fTargetNSURIString)) { Grammar* grammar = fGrammarResolver->getGrammar(uriStr); if (grammar && grammar->getGrammarType() == Grammar::SchemaGrammarType) { dv = ((SchemaGrammar*) grammar)->getDatatypeRegistry()->getDatatypeValidator(fBuffer.getRawBuffer()); } } else { dv = fDatatypeRegistry->getDatatypeValidator(fBuffer.getRawBuffer()); } } return dv; } DatatypeValidator* TraverseSchema::checkForSimpleTypeValidator(const DOMElement* const content, int baseRefContext) { DatatypeValidator* baseValidator = traverseSimpleTypeDecl(content, false, baseRefContext); if (!baseValidator) { const XMLCh* name = getElementAttValue(content,SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName); reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::UnknownSimpleType, name); } return baseValidator; } ComplexTypeInfo* TraverseSchema::checkForComplexTypeInfo(const DOMElement* const content) { int typeNameIndex = traverseComplexTypeDecl(content, false); ComplexTypeInfo* baseTypeInfo = 0; if (typeNameIndex != -1) { baseTypeInfo = fComplexTypeRegistry->get(fStringPool->getValueForId(typeNameIndex)); } if (typeNameIndex == -1 || baseTypeInfo == 0) { const XMLCh* name = getElementAttValue(content,SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName); reportSchemaError(content, XMLUni::fgXMLErrDomain, XMLErrs::UnknownComplexType, name); } return baseTypeInfo; } DatatypeValidator* TraverseSchema::findDTValidator(const DOMElement* const elem, const XMLCh* const derivedTypeName, const XMLCh* const baseTypeName, const int baseRefContext) { const XMLCh* prefix = getPrefix(baseTypeName); const XMLCh* localPart = getLocalPart(baseTypeName); const XMLCh* uri = resolvePrefixToURI(elem, prefix); DatatypeValidator* baseValidator = getDatatypeValidator(uri, localPart); if (baseValidator == 0) { // Check if the base is from the schema for schema namespace // if (XMLString::equals(uri, SchemaSymbols::fgURI_SCHEMAFORSCHEMA)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::TypeNotFound, uri, localPart); return 0; } SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; SchemaInfo* saveInfo = fSchemaInfo; unsigned int saveScope = fCurrentScope; if (!XMLString::equals(uri, fTargetNSURIString) && (uri && *uri)) { // Make sure that we have an explicit import statement. // Clause 4 of Schema Representation Constraint: // http://www.w3.org/TR/xmlschema-1/#src-resolve unsigned int uriId = fURIStringPool->addOrFind(uri); if (!isImportingNS(uriId)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidNSReference, uri); return 0; } SchemaInfo* impInfo = fSchemaInfo->getImportInfo(uriId); if (!impInfo || impInfo->getProcessed()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::TypeNotFound, uri, localPart); return 0; } infoType = SchemaInfo::IMPORT; restoreSchemaInfo(impInfo, infoType); } DOMElement* baseTypeNode = fSchemaInfo->getTopLevelComponent(SchemaInfo::C_SimpleType, SchemaSymbols::fgELT_SIMPLETYPE, localPart, &fSchemaInfo); if (baseTypeNode != 0) { baseValidator = traverseSimpleTypeDecl(baseTypeNode); // restore schema information, if necessary if (saveInfo != fSchemaInfo) { restoreSchemaInfo(saveInfo, infoType, saveScope); } } } if (baseValidator == 0) { reportSchemaError(elem, XMLUni::fgValidityDomain, XMLValid::UnknownBaseDatatype, baseTypeName, derivedTypeName); } else if ((baseValidator->getFinalSet() & baseRefContext) != 0) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::DisallowedBaseDerivation, baseTypeName); return 0; } return baseValidator; } const XMLCh* TraverseSchema::resolvePrefixToURI(const DOMElement* const elem, const XMLCh* const prefix) { unsigned int nameSpaceIndex = fSchemaInfo->getNamespaceScope()->getNamespaceForPrefix(prefix); const XMLCh* uriStr = fURIStringPool->getValueForId(nameSpaceIndex); if ((!uriStr || !*uriStr) && (prefix && *prefix)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::UnresolvedPrefix, prefix); return XMLUni::fgZeroLenString; } return uriStr; } SchemaElementDecl* TraverseSchema::processElementDeclRef(const DOMElement* const elem, const XMLCh* const refName) { // check attributes fAttributeCheck.checkAttributes( elem, GeneralAttributeCheck::E_ElementRef, this, false, fNonXSAttList ); // handle annotation DOMElement* content = checkContent(elem, XUtil::getFirstChildElement(elem), true); Janitor janAnnot(fAnnotation); // do not generate synthetic annotation for element reference... if (content != 0) reportSchemaError(elem, XMLUni::fgValidityDomain, XMLValid::NoContentForRef, SchemaSymbols::fgELT_ELEMENT); SchemaElementDecl* refElemDecl = getGlobalElemDecl(elem, refName); if (!refElemDecl) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::RefElementNotFound, refName); } else { if (fCurrentComplexType) fCurrentComplexType->addElement(refElemDecl); if (fCurrentGroupInfo) fCurrentGroupInfo->addElement(refElemDecl); } return refElemDecl; } int TraverseSchema::parseBlockSet(const DOMElement* const elem, const int blockType, const bool isRoot) { const XMLCh* blockVal = (isRoot) ? getElementAttValue(elem, SchemaSymbols::fgATT_BLOCKDEFAULT) : getElementAttValue(elem, SchemaSymbols::fgATT_BLOCK); // blockVal == 0 means 'block attribute is missing'; *blockVal == 0 means 'block="" found' if (blockVal == 0) return fSchemaInfo->getBlockDefault(); int blockSet = 0; if (XMLString::equals(blockVal, SchemaSymbols::fgATTVAL_POUNDALL)) { blockSet = SchemaSymbols::XSD_EXTENSION + SchemaSymbols::XSD_RESTRICTION + SchemaSymbols::XSD_SUBSTITUTION; return blockSet; } XMLStringTokenizer tokenizer(blockVal, fGrammarPoolMemoryManager); while (tokenizer.hasMoreTokens()) { XMLCh* token = tokenizer.nextToken(); if (XMLString::equals(token, SchemaSymbols::fgATTVAL_SUBSTITUTION) && blockType == ES_Block) { if ((blockSet & SchemaSymbols::XSD_SUBSTITUTION) == 0 ) { blockSet += SchemaSymbols::XSD_SUBSTITUTION; } } else if (XMLString::equals(token, SchemaSymbols::fgATTVAL_EXTENSION)) { if ((blockSet & SchemaSymbols::XSD_EXTENSION) == 0) { blockSet += SchemaSymbols::XSD_EXTENSION; } } else if (XMLString::equals(token, SchemaSymbols::fgATTVAL_RESTRICTION)) { if ((blockSet & SchemaSymbols::XSD_RESTRICTION) == 0 ) { blockSet += SchemaSymbols::XSD_RESTRICTION; } } else { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidBlockValue, blockVal); } } //end while return blockSet; } int TraverseSchema::parseFinalSet(const DOMElement* const elem, const int finalType, const bool isRoot) { const XMLCh* finalVal = (isRoot) ? getElementAttValue(elem, SchemaSymbols::fgATT_FINALDEFAULT) : getElementAttValue(elem, SchemaSymbols::fgATT_FINAL); // finalVal == 0 means 'final attribute is missing'; *finalVal == 0 means 'final="" found' if (finalVal == 0) return fSchemaInfo->getFinalDefault(); int finalSet = 0; if (XMLString::equals(finalVal, SchemaSymbols::fgATTVAL_POUNDALL)) { finalSet = SchemaSymbols::XSD_RESTRICTION + SchemaSymbols::XSD_LIST + SchemaSymbols::XSD_UNION + SchemaSymbols::XSD_EXTENSION; return finalSet; } XMLStringTokenizer tokenizer(finalVal, fGrammarPoolMemoryManager); while (tokenizer.hasMoreTokens()) { XMLCh* token = tokenizer.nextToken(); if (XMLString::equals(token, SchemaSymbols::fgELT_UNION) && (finalType == S_Final || finalType == ECS_Final)) { if ((finalSet & SchemaSymbols::XSD_UNION) == 0) { finalSet += SchemaSymbols::XSD_UNION; } } else if (XMLString::equals(token, SchemaSymbols::fgATTVAL_EXTENSION) && (finalType == EC_Final || finalType == ECS_Final)) { if ((finalSet & SchemaSymbols::XSD_EXTENSION) == 0) { finalSet += SchemaSymbols::XSD_EXTENSION; } } else if (XMLString::equals(token, SchemaSymbols::fgELT_LIST) && (finalType == S_Final || finalType == ECS_Final)) { if ((finalSet & SchemaSymbols::XSD_LIST) == 0 ) { finalSet += SchemaSymbols::XSD_LIST; } } else if (XMLString::equals(token, SchemaSymbols::fgATTVAL_RESTRICTION)) { if ((finalSet & SchemaSymbols::XSD_RESTRICTION) == 0 ) { finalSet += SchemaSymbols::XSD_RESTRICTION; } } else { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidFinalValue, finalVal); } } //end while return finalSet; } const DOMElement* TraverseSchema::checkIdentityConstraintContent(const DOMElement* const content) { const DOMElement* child = content; if (child != 0) { do { if (!isIdentityConstraintName(child->getLocalName())) { break; } child = XUtil::getNextSiblingElement(child); } while (child != 0); } return child; } bool TraverseSchema::isIdentityConstraintName(const XMLCh* const name) { return (XMLString::equals(name, SchemaSymbols::fgELT_KEY) || XMLString::equals(name, SchemaSymbols::fgELT_KEYREF) || XMLString::equals(name, SchemaSymbols::fgELT_UNIQUE)); } const XMLCh* TraverseSchema::checkTypeFromAnotherSchema(const DOMElement* const elem, const XMLCh* const typeStr) { const XMLCh* prefix = getPrefix(typeStr); const XMLCh* typeURI = resolvePrefixToURI(elem, prefix); if (!XMLString::equals(typeURI, fTargetNSURIString) && !XMLString::equals(typeURI, SchemaSymbols::fgURI_SCHEMAFORSCHEMA) ) { return typeURI; } return 0; } DatatypeValidator* TraverseSchema::getElementTypeValidator(const DOMElement* const elem, const XMLCh* const typeStr, bool& noErrorDetected, const XMLCh* const otherSchemaURI) { const XMLCh* localPart = getLocalPart(typeStr); const XMLCh* typeURI = otherSchemaURI; DatatypeValidator* dv = 0; SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; SchemaInfo* saveInfo = fSchemaInfo; unsigned int saveScope = fCurrentScope; if (otherSchemaURI && *otherSchemaURI) { // Make sure that we have an explicit import statement. // Clause 4 of Schema Representation Constraint: // http://www.w3.org/TR/xmlschema-1/#src-resolve unsigned int uriId = fURIStringPool->addOrFind(otherSchemaURI); if (!isImportingNS(uriId)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidNSReference, otherSchemaURI); return 0; } dv = getDatatypeValidator(typeURI, localPart); if (dv) { return dv; } SchemaInfo* impInfo = fSchemaInfo->getImportInfo(uriId); if (!impInfo || impInfo->getProcessed()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::TypeNotFound, typeURI, localPart); return 0; } infoType = SchemaInfo::IMPORT; restoreSchemaInfo(impInfo, infoType); } else { const XMLCh* prefix = getPrefix(typeStr); typeURI = resolvePrefixToURI(elem, prefix); dv = getDatatypeValidator(typeURI, localPart); } if (!dv) { if (!XMLString::equals(typeURI, SchemaSymbols::fgURI_SCHEMAFORSCHEMA) || XMLString::equals(fTargetNSURIString, SchemaSymbols::fgURI_SCHEMAFORSCHEMA)) { DOMElement* typeElem = fSchemaInfo->getTopLevelComponent(SchemaInfo::C_SimpleType, SchemaSymbols::fgELT_SIMPLETYPE, localPart, &fSchemaInfo); if (typeElem) { traverseSimpleTypeDecl(typeElem); dv = getDatatypeValidator(typeURI, localPart); } } // restore schema information, if necessary if (saveInfo != fSchemaInfo) { restoreSchemaInfo(saveInfo, infoType, saveScope); } if (!dv) { noErrorDetected = false; reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::TypeNotFound, typeURI, localPart); } } return dv; } DatatypeValidator* TraverseSchema::getAttrDatatypeValidatorNS(const DOMElement* const elem, const XMLCh* localPart, const XMLCh* typeURI) { DatatypeValidator* dv = getDatatypeValidator(typeURI, localPart); SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; SchemaInfo* saveInfo = fSchemaInfo; unsigned int saveScope = fCurrentScope; if (!XMLString::equals(typeURI, fTargetNSURIString) && (typeURI && *typeURI)) { // Make sure that we have an explicit import statement. // Clause 4 of Schema Representation Constraint: // http://www.w3.org/TR/xmlschema-1/#src-resolve unsigned int uriId = fURIStringPool->addOrFind(typeURI); if (!isImportingNS(uriId)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidNSReference, typeURI); return 0; } if (!dv) { SchemaInfo* impInfo = fSchemaInfo->getImportInfo(uriId); if (!impInfo || impInfo->getProcessed()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::TypeNotFound, typeURI, localPart); return 0; } infoType = SchemaInfo::IMPORT; restoreSchemaInfo(impInfo, infoType); } } if (!dv) { DOMElement* typeElem = fSchemaInfo->getTopLevelComponent ( SchemaInfo::C_SimpleType , SchemaSymbols::fgELT_SIMPLETYPE , localPart , &fSchemaInfo ); if (typeElem) dv = traverseSimpleTypeDecl(typeElem); // restore schema information, if necessary if (saveInfo != fSchemaInfo) { restoreSchemaInfo(saveInfo, infoType, saveScope); } } return dv; } ComplexTypeInfo* TraverseSchema::getElementComplexTypeInfo(const DOMElement* const elem, const XMLCh* const typeStr, const XMLCh* const otherSchemaURI) { const XMLCh* localPart = getLocalPart(typeStr); const XMLCh* prefix = getPrefix(typeStr); const XMLCh* typeURI = (otherSchemaURI) ? otherSchemaURI : resolvePrefixToURI(elem, prefix); ComplexTypeInfo* typeInfo = 0; SchemaInfo* saveInfo = fSchemaInfo; SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; unsigned int saveScope = fCurrentScope; fBuffer.set(typeURI); fBuffer.append(chComma); fBuffer.append(localPart); if (otherSchemaURI != 0) { // Make sure that we have an explicit import statement. // Clause 4 of Schema Representation Constraint: // http://www.w3.org/TR/xmlschema-1/#src-resolve unsigned int uriId = fURIStringPool->addOrFind(typeURI); if (!isImportingNS(uriId)) return 0; Grammar* aGrammar = fGrammarResolver->getGrammar(typeURI); if (!aGrammar || aGrammar->getGrammarType() != Grammar::SchemaGrammarType) { return 0; } typeInfo = ((SchemaGrammar*)aGrammar)->getComplexTypeRegistry()->get(fBuffer.getRawBuffer()); if (typeInfo) { return typeInfo; } SchemaInfo* impInfo = fSchemaInfo->getImportInfo(uriId); if (!impInfo || impInfo->getProcessed()) { return 0; } infoType = SchemaInfo::IMPORT; restoreSchemaInfo(impInfo, infoType); } else { typeInfo = fComplexTypeRegistry->get(fBuffer.getRawBuffer()); } if (!typeInfo) { if (!XMLString::equals(typeURI, SchemaSymbols::fgURI_SCHEMAFORSCHEMA) || XMLString::equals(fTargetNSURIString, SchemaSymbols::fgURI_SCHEMAFORSCHEMA)) { DOMElement* typeNode = fSchemaInfo->getTopLevelComponent(SchemaInfo::C_ComplexType, SchemaSymbols::fgELT_COMPLEXTYPE, localPart, &fSchemaInfo); if (typeNode) { // fBuffer is reused by traverseComplexTypeDecl, so we have to store its current value XMLBuffer buffCopy(fBuffer.getLen()+1, fMemoryManager); buffCopy.set(fBuffer.getRawBuffer()); traverseComplexTypeDecl(typeNode); typeInfo = fComplexTypeRegistry->get(buffCopy.getRawBuffer()); } } } // restore schema information restoreSchemaInfo(saveInfo, infoType, saveScope); return typeInfo; } SchemaElementDecl* TraverseSchema::getGlobalElemDecl(const DOMElement* const elem, const XMLCh* const qName) { const XMLCh* nameURI = resolvePrefixToURI(elem, getPrefix(qName)); const XMLCh* localPart = getLocalPart(qName); SchemaElementDecl* elemDecl = 0; SchemaInfo* saveInfo = fSchemaInfo; SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; unsigned int saveScope = fCurrentScope; unsigned int uriId = fURIStringPool->addOrFind(nameURI); if (fSchemaInfo->getTargetNSURI() != (int) uriId) { //if (!XMLString::equals(nameURI, fTargetNSURIString)) { // Make sure that we have an explicit import statement. // Clause 4 of Schema Representation Constraint: // http://www.w3.org/TR/xmlschema-1/#src-resolve if (!isImportingNS(uriId)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidNSReference, nameURI); return 0; } Grammar* grammar = fGrammarResolver->getGrammar(nameURI); if (grammar && grammar->getGrammarType() == Grammar::SchemaGrammarType) { elemDecl = (SchemaElementDecl*) grammar->getElemDecl( uriId, localPart, 0, Grammar::TOP_LEVEL_SCOPE); } else { reportSchemaError(elem, XMLUni::fgValidityDomain, XMLValid::GrammarNotFound, nameURI); return 0; } if (!elemDecl) { SchemaInfo* impInfo = fSchemaInfo->getImportInfo(uriId); if (!impInfo || impInfo->getProcessed()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::TypeNotFound, nameURI, localPart); return 0; } infoType = SchemaInfo::IMPORT; restoreSchemaInfo(impInfo, infoType); } } else { elemDecl = (SchemaElementDecl*) fSchemaGrammar->getElemDecl(fTargetNSURI, localPart, 0, Grammar::TOP_LEVEL_SCOPE); } if (!elemDecl) { DOMElement* subsGroupElem = fSchemaInfo->getTopLevelComponent(SchemaInfo::C_Element, SchemaSymbols::fgELT_ELEMENT,localPart, &fSchemaInfo); if (subsGroupElem) elemDecl = traverseElementDecl(subsGroupElem, true); if (!elemDecl) reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::TypeNotFound, nameURI, localPart); } // restore schema information, if necessary if (saveInfo != fSchemaInfo) { restoreSchemaInfo(saveInfo, infoType, saveScope); } return elemDecl; } bool TraverseSchema::isSubstitutionGroupValid(const DOMElement* const elem, const SchemaElementDecl* const subsElemDecl, const ComplexTypeInfo* const typeInfo, const DatatypeValidator* const validator, const XMLCh* const elemName, const bool toEmit) { // here we must do two things: // 1. Make sure there actually *is* a relation between the types of // the element being nominated and the element doing the nominating; // (see PR 3.3.6 point #3 in the first tableau, for instance; this // and the corresponding tableaux from 3.4.6 and 3.14.6 rule out the nominated // element having an anonymous type declaration. // 2. Make sure the nominated element allows itself to be nominated by // an element with the given type-relation. // Note: we assume that (complex|simple)Type processing checks // whether the type in question allows itself to // be modified as this element desires. // if substitution element has any as content model type, return true bool subsRestricted = false; if (subsElemDecl->getModelType() == SchemaElementDecl::Any) { if ((subsElemDecl->getFinalSet() & SchemaSymbols::XSD_RESTRICTION) == 0 || (typeInfo == 0 && validator == 0)) return true; else subsRestricted = true; } // Check for type relationship; // that is, make sure that the type we're deriving has some relatoinship // to substitutionGroupElt's type. else if (typeInfo) { // do complexType case ...need testing ComplexTypeInfo* subsTypeInfo = subsElemDecl->getComplexTypeInfo(); if (subsTypeInfo == typeInfo) return true; int derivationMethod = typeInfo->getDerivedBy(); if (subsTypeInfo == 0) { // take care of complexType based on simpleType case... DatatypeValidator* elemDV = typeInfo->getDatatypeValidator(); DatatypeValidator* subsValidator = subsElemDecl->getDatatypeValidator(); if (elemDV == subsValidator) { return true; } else if (subsValidator && subsValidator->isSubstitutableBy(elemDV)) { if ((subsElemDecl->getFinalSet() & derivationMethod) == 0) { return true; } else { subsRestricted = true; } } } else { // complex content const ComplexTypeInfo* elemTypeInfo = typeInfo; for (; elemTypeInfo && elemTypeInfo != subsTypeInfo; elemTypeInfo = elemTypeInfo->getBaseComplexTypeInfo()) { } if (elemTypeInfo) { if ((subsElemDecl->getFinalSet() & derivationMethod) == 0) { return true; } else { subsRestricted = true; } } } } else if (validator) { // do simpleType case... if (!subsElemDecl->getComplexTypeInfo()) { // first, check for type relation. DatatypeValidator* subsValidator = subsElemDecl->getDatatypeValidator(); if (subsValidator == validator) { return true; } else if (subsValidator && subsValidator->isSubstitutableBy(validator) && ((subsElemDecl->getFinalSet() & SchemaSymbols::XSD_RESTRICTION) == 0)) { return true; } } } else // validator==0 && typeInfo==0 -- no checking return true; if (toEmit) { if (subsRestricted) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidSubstitutionGroupElement, elemName, subsElemDecl->getBaseName()); } else { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::SubstitutionGroupTypeMismatch, elemName); } } return false; } SchemaElementDecl* TraverseSchema::createSchemaElementDecl(const DOMElement* const elem, const XMLCh* const name, bool& isDuplicate, const XMLCh*& valConstraint, const bool topLevel) { unsigned int enclosingScope = fCurrentScope; int uriIndex = fEmptyNamespaceURI; if (topLevel) { uriIndex = fTargetNSURI; enclosingScope = Grammar::TOP_LEVEL_SCOPE; } else { const XMLCh* elemForm = getElementAttValue(elem, SchemaSymbols::fgATT_FORM); if (((!elemForm || !*elemForm) && (fSchemaInfo->getElemAttrDefaultQualified() & Elem_Def_Qualified)) || XMLString::equals(elemForm,SchemaSymbols::fgATTVAL_QUALIFIED)) uriIndex = fTargetNSURI; // Check for duplicate elements SchemaElementDecl* other = (SchemaElementDecl*) fSchemaGrammar->getElemDecl(uriIndex, name, 0, enclosingScope); if (other != 0) { isDuplicate = true; return other; } } // create element decl and add it to the grammar Janitor elemDecl(new (fGrammarPoolMemoryManager) SchemaElementDecl( XMLUni::fgZeroLenString , name, uriIndex , SchemaElementDecl::Any , enclosingScope , fGrammarPoolMemoryManager )); elemDecl->setCreateReason(XMLElementDecl::Declared); if (topLevel) elemDecl->setPSVIScope(PSVIDefs::SCP_GLOBAL); // process attributes processElemDeclAttrs(elem, elemDecl.get(), valConstraint, topLevel); return elemDecl.release(); } void TraverseSchema::processAttributeDeclRef(const DOMElement* const elem, ComplexTypeInfo* const typeInfo, const XMLCh* const refName, const XMLCh* const useAttr, const XMLCh* const defaultVal, const XMLCh* const fixedVal) { if (!typeInfo && !fCurrentAttGroupInfo) { return; } const XMLCh* prefix = getPrefix(refName); const XMLCh* localPart = getLocalPart(refName); const XMLCh* uriStr = resolvePrefixToURI(elem, prefix); unsigned int attURI = fURIStringPool->addOrFind(uriStr); // Check for duplicate references if (typeInfo && typeInfo->getAttDef(localPart, attURI)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateRefAttribute, uriStr, localPart); return; } else if (fCurrentAttGroupInfo && fCurrentAttGroupInfo->containsAttribute(localPart, attURI)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateRefAttribute, uriStr, localPart); return; } // check for different namespace SchemaInfo* saveInfo = fSchemaInfo; SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; SchemaAttDef* refAttDef = 0; unsigned int saveScope = fCurrentScope; if (!XMLString::equals(uriStr, fTargetNSURIString)) { // Make sure that we have an explicit import statement. // Clause 4 of Schema Representation Constraint: // http://www.w3.org/TR/xmlschema-1/#src-resolve unsigned int uriId = fURIStringPool->addOrFind(uriStr); if (!isImportingNS(uriId)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidNSReference, uriStr); return; } Grammar* grammar = fGrammarResolver->getGrammar(uriStr); if (grammar == 0 || grammar->getGrammarType() != Grammar::SchemaGrammarType) { reportSchemaError(elem, XMLUni::fgValidityDomain, XMLValid::GrammarNotFound, uriStr); return; } refAttDef = (SchemaAttDef*) ((SchemaGrammar*) grammar)->getAttributeDeclRegistry()->get(localPart); if (!refAttDef) { SchemaInfo* impInfo = fSchemaInfo->getImportInfo(attURI); if (!impInfo || impInfo->getProcessed()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::TopLevelAttributeNotFound, refName); return; } infoType = SchemaInfo::IMPORT; restoreSchemaInfo(impInfo, infoType); } } // if Global attribute registry does not contain the ref attribute, get // the referred attribute declaration and traverse it. if (!refAttDef) { if (fAttributeDeclRegistry->containsKey(localPart) == false) { DOMElement* referredAttribute = fSchemaInfo->getTopLevelComponent(SchemaInfo::C_Attribute, SchemaSymbols::fgELT_ATTRIBUTE, localPart, &fSchemaInfo); if (referredAttribute != 0) { traverseAttributeDecl(referredAttribute, 0, true); } } refAttDef = (SchemaAttDef*) fAttributeDeclRegistry->get(localPart); } // restore schema information, if necessary if (fSchemaInfo != saveInfo) { restoreSchemaInfo(saveInfo, infoType, saveScope); } if (!refAttDef) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::TopLevelAttributeNotFound, refName); return; } XMLAttDef::DefAttTypes refAttDefType = refAttDef->getDefaultType(); const XMLCh* refAttValue = refAttDef->getValue(); bool invalidAttUse = false; if (refAttDefType == XMLAttDef::Fixed && (defaultVal || (fixedVal && !XMLString::equals(fixedVal, refAttValue)))) { invalidAttUse = true; reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::AttUseCorrect, refName); } DatatypeValidator* attDV = refAttDef->getDatatypeValidator(); //check for multiple attributes with type derived from ID if (attDV && attDV->getType() == DatatypeValidator::ID) { if (fCurrentAttGroupInfo) { if (fCurrentAttGroupInfo->containsTypeWithId()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::AttGrpPropCorrect3, refName); return; } fCurrentAttGroupInfo->setTypeWithId(true); } else { if (typeInfo->containsAttWithTypeId()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::AttDeclPropCorrect5, refName); return; } typeInfo->setAttWithTypeId(true); } } bool required = XMLString::equals(useAttr,SchemaSymbols::fgATTVAL_REQUIRED); bool prohibited = XMLString::equals(useAttr,SchemaSymbols::fgATTVAL_PROHIBITED); QName* attQName = refAttDef->getAttName(); SchemaAttDef* attDef = new (fGrammarPoolMemoryManager) SchemaAttDef(attQName->getPrefix(), attQName->getLocalPart(), attQName->getURI(), refAttValue, refAttDef->getType(), refAttDefType, 0, fGrammarPoolMemoryManager); attDef->setBaseAttDecl(refAttDef); attDef->setPSVIScope(PSVIDefs::SCP_GLOBAL); if (refAttDefType == XMLAttDef::Fixed) { if (required && !invalidAttUse) { attDef->setDefaultType(XMLAttDef::Required_And_Fixed); } } else { if (prohibited) { attDef->setDefaultType(XMLAttDef::Prohibited); } else { const XMLCh* valueConstraint = defaultVal; if (required){ if (fixedVal) { attDef->setDefaultType(XMLAttDef::Required_And_Fixed); valueConstraint = fixedVal; } else { attDef->setDefaultType(XMLAttDef::Required); } } else { if (fixedVal) { attDef->setDefaultType(XMLAttDef::Fixed); valueConstraint = fixedVal; } else if (defaultVal) { attDef->setDefaultType(XMLAttDef::Default); } } if (valueConstraint) { // validate content of value constraint if (attDV) { if (attDV->getType() == DatatypeValidator::ID) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::AttDeclPropCorrect3, refName); } else { try { attDV->validate(valueConstraint , fSchemaInfo->getValidationContext() , fMemoryManager); } catch(const XMLException& excep) { reportSchemaError(elem, excep); } catch(const OutOfMemoryException&) { throw; } catch (...) { reportSchemaError(elem, XMLUni::fgValidityDomain, XMLValid::DatatypeValidationFailure, valueConstraint); } } } attDef->setValue(valueConstraint); } } } attDef->setDatatypeValidator(attDV); bool toClone = false; if (typeInfo) { toClone = true; typeInfo->addAttDef(attDef); } if (fCurrentAttGroupInfo) { fCurrentAttGroupInfo->addAttDef(attDef, toClone); } } int TraverseSchema::checkMinMax(ContentSpecNode* const specNode, const DOMElement* const elem, const int allContextFlag) { int minOccurs = 1; int maxOccurs = 1; const XMLCh* minOccursStr = getElementAttValue(elem, SchemaSymbols::fgATT_MINOCCURS, DatatypeValidator::Decimal); const XMLCh* maxOccursStr = getElementAttValue(elem, SchemaSymbols::fgATT_MAXOCCURS, DatatypeValidator::Decimal); if (!minOccursStr || !*minOccursStr) { if (specNode) minOccurs = specNode->getMinOccurs(); } else { try { minOccurs = XMLString::parseInt(minOccursStr, fMemoryManager); } catch(const NumberFormatException& e) { // REVISIT: report a warning that we replaced a number too big? if(e.getCode()==XMLExcepts::Str_ConvertOverflow) minOccurs = 500; else minOccurs = 1; } catch(const OutOfMemoryException&) { throw; } if (specNode) specNode->setMinOccurs(minOccurs); } bool isMaxUnbounded = XMLString::equals(maxOccursStr, fgUnbounded); if (isMaxUnbounded) { maxOccurs = SchemaSymbols::XSD_UNBOUNDED; if (specNode) specNode->setMaxOccurs(maxOccurs); } else { if (!maxOccursStr || !*maxOccursStr) { if (specNode) maxOccurs = specNode->getMaxOccurs(); } else { try { maxOccurs = XMLString::parseInt(maxOccursStr, fMemoryManager); } catch(const NumberFormatException& e) { // REVISIT: report a warning that we replaced a number too big? if(e.getCode()==XMLExcepts::Str_ConvertOverflow && minOccurs < 500) maxOccurs = 500; else maxOccurs = minOccurs; } catch(const OutOfMemoryException&) { throw; } if (specNode) specNode->setMaxOccurs(maxOccurs); } } if (minOccurs == 0 && maxOccurs == 0){ return minOccurs; } // Constraint checking for min/max value if (!isMaxUnbounded) { XMLCh tmpMinStr[128]; XMLCh tmpMaxStr[128]; XMLString::binToText(minOccurs, tmpMinStr, 127, 10, fMemoryManager); XMLString::binToText(maxOccurs, tmpMaxStr, 127, 10, fMemoryManager); if (maxOccurs < 1) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidAttValue, tmpMaxStr, SchemaSymbols::fgATT_MAXOCCURS); if (specNode) specNode->setMaxOccurs(minOccurs); } else if (maxOccurs < minOccurs) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidMin2MaxOccurs, tmpMinStr, tmpMaxStr); if (specNode) specNode->setMaxOccurs(minOccurs); } } // Constraint checking for 'all' content bool isAllElement = (allContextFlag == All_Element); bool isAllGroup = (allContextFlag == All_Group); bool isGroupRefAll = (allContextFlag == Group_Ref_With_All); if (isAllElement || isAllGroup || isGroupRefAll) { if (maxOccurs != 1 || minOccurs > 1) { // set back correct value in order to carry on if (specNode) { specNode->setMaxOccurs(1); if (minOccurs > 1) specNode->setMinOccurs(1); } if (isAllElement) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadMinMaxAllElem); } else { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadMinMaxAllCT); } } } return minOccurs; } void TraverseSchema::processComplexContent(const DOMElement* const ctElem, const XMLCh* const typeName, const DOMElement* const childElem, ComplexTypeInfo* const typeInfo, const XMLCh* const baseLocalPart, const bool isMixed, const bool isBaseAnyType) { NamespaceScopeManager nsMgr(childElem, fSchemaInfo, this); Janitor specNodeJan(0); ContentSpecNode* specNode = specNodeJan.get(); const DOMElement* attrNode = 0; int typeDerivedBy = typeInfo->getDerivedBy(); ComplexTypeInfo* baseTypeInfo = typeInfo->getBaseComplexTypeInfo(); int baseContentType = (baseTypeInfo) ? baseTypeInfo->getContentType() : SchemaElementDecl::Empty; if (baseTypeInfo) { if (typeDerivedBy == SchemaSymbols::XSD_RESTRICTION) { // check to see if the baseType permits derivation by restriction if((baseTypeInfo->getFinalSet() & typeDerivedBy) != 0) { reportSchemaError(ctElem, XMLUni::fgXMLErrDomain, XMLErrs::ForbiddenDerivationByRestriction, baseLocalPart); throw TraverseSchema::InvalidComplexTypeInfo; } } else { // check to see if the baseType permits derivation by extension if((baseTypeInfo->getFinalSet() & typeDerivedBy) != 0) { reportSchemaError(ctElem, XMLUni::fgXMLErrDomain, XMLErrs::ForbiddenDerivationByExtension, baseLocalPart); throw TraverseSchema::InvalidComplexTypeInfo; // REVISIT - should we continue } processElements(ctElem, baseTypeInfo, typeInfo); } } bool effectiveContent_hasChild = false; if (childElem != 0) { fCircularCheckIndex = fCurrentTypeNameStack->size(); // -------------------------------------------------------------------- // GROUP, ALL, SEQUENCE or CHOICE, followed by attributes, if specified. // Note that it's possible that only attributes are specified. // -------------------------------------------------------------------- const XMLCh* childName = childElem->getLocalName(); if (XMLString::equals(childName, SchemaSymbols::fgELT_GROUP)) { XercesGroupInfo* grpInfo = traverseGroupDecl(childElem, false); if (grpInfo) { ContentSpecNode* const groupSpecNode = grpInfo->getContentSpec(); if (groupSpecNode) { int contentContext = groupSpecNode->hasAllContent() ? Group_Ref_With_All : Not_All_Context; specNodeJan.reset(new (fGrammarPoolMemoryManager) ContentSpecNode(*groupSpecNode)); specNode = specNodeJan.get(); checkMinMax(specNode, childElem, contentContext); } } attrNode = XUtil::getNextSiblingElement(childElem); } else if (XMLString::equals(childName, SchemaSymbols::fgELT_SEQUENCE)) { specNodeJan.reset(traverseChoiceSequence(childElem, ContentSpecNode::Sequence, effectiveContent_hasChild)); specNode = specNodeJan.get(); checkMinMax(specNode, childElem); attrNode = XUtil::getNextSiblingElement(childElem); } else if (XMLString::equals(childName, SchemaSymbols::fgELT_CHOICE)) { specNodeJan.reset(traverseChoiceSequence(childElem, ContentSpecNode::Choice, effectiveContent_hasChild)); specNode = specNodeJan.get(); int minOccurs = checkMinMax(specNode, childElem); if (!effectiveContent_hasChild && minOccurs != 0) { effectiveContent_hasChild = true; } attrNode = XUtil::getNextSiblingElement(childElem); } else if (XMLString::equals(childName, SchemaSymbols::fgELT_ALL)) { specNodeJan.reset(traverseAll(childElem, effectiveContent_hasChild)); specNode = specNodeJan.get(); checkMinMax(specNode, childElem, All_Group); attrNode = XUtil::getNextSiblingElement(childElem); } else if (isAttrOrAttrGroup(childElem)) { // reset the contentType typeInfo->setContentType(SchemaElementDecl::Any); attrNode = childElem; } else { reportSchemaError(childElem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidChildInComplexType, childName); } } typeInfo->setContentSpec(specNode); typeInfo->setAdoptContentSpec(true); specNodeJan.release(); bool specNodeWasNull = false; // ----------------------------------------------------------------------- // Merge in information from base, if it exists // ----------------------------------------------------------------------- if (baseTypeInfo) { ContentSpecNode* baseSpecNode = baseTypeInfo->getContentSpec(); if (typeDerivedBy == SchemaSymbols::XSD_RESTRICTION) { //check derivation valid - content type is empty (5.2) if (!typeInfo->getContentSpec()) { if (baseContentType != SchemaElementDecl::Empty && !emptiableParticle(baseSpecNode)) { reportSchemaError(ctElem, XMLUni::fgXMLErrDomain, XMLErrs::EmptyComplexRestrictionDerivation); } } // Delay particle constraint checking (5.3) until we have processed // the whole schema. } else { // Compose the final content model by concatenating the base and // the current in sequence if (!specNode) { specNodeWasNull = true; if (isMixed) { if (baseSpecNode && baseSpecNode->hasAllContent()) { reportSchemaError(ctElem, XMLUni::fgXMLErrDomain, XMLErrs::NotAllContent); throw TraverseSchema::InvalidComplexTypeInfo; // REVISIT - should we continue } } if (baseSpecNode) { specNodeJan.reset(new (fGrammarPoolMemoryManager) ContentSpecNode(*baseSpecNode)); specNode = specNodeJan.get(); typeInfo->setContentSpec(specNode); typeInfo->setAdoptContentSpec(true); specNodeJan.release(); } } else if (baseSpecNode) { if (specNode->hasAllContent() || baseSpecNode->hasAllContent()) { reportSchemaError(ctElem, XMLUni::fgXMLErrDomain, XMLErrs::NotAllContent); throw TraverseSchema::InvalidComplexTypeInfo; // REVISIT - should we continue } // Check for derivation valid (extension) - 1.4.3.2.2.1 if ((isMixed && baseContentType == SchemaElementDecl::Children) || (!isMixed && baseContentType != SchemaElementDecl::Children)) { reportSchemaError(ctElem, XMLUni::fgXMLErrDomain, XMLErrs::MixedOrElementOnly, baseLocalPart, typeName); throw TraverseSchema::InvalidComplexTypeInfo; //REVISIT - should we continue } typeInfo->setAdoptContentSpec(false); typeInfo->setContentSpec ( new (fGrammarPoolMemoryManager) ContentSpecNode ( ContentSpecNode::ModelGroupSequence , new (fGrammarPoolMemoryManager) ContentSpecNode(*baseSpecNode) , specNode , true , true , fGrammarPoolMemoryManager ) ); typeInfo->setAdoptContentSpec(true); } } } else { typeInfo->setDerivedBy(0); } // ------------------------------------------------------------- // Set the content type // ------------------------------------------------------------- if (isBaseAnyType && typeDerivedBy == SchemaSymbols::XSD_EXTENSION) { ContentSpecNode* anySpecNode = new (fGrammarPoolMemoryManager) ContentSpecNode ( new (fGrammarPoolMemoryManager) QName ( XMLUni::fgZeroLenString , XMLUni::fgZeroLenString , fEmptyNamespaceURI, fGrammarPoolMemoryManager ) , false , fGrammarPoolMemoryManager ); anySpecNode->setType(ContentSpecNode::Any_Lax); anySpecNode->setMinOccurs(0); anySpecNode->setMaxOccurs(SchemaSymbols::XSD_UNBOUNDED); if (!specNode) { typeInfo->setContentSpec(anySpecNode); typeInfo->setDerivedBy(typeDerivedBy); } else { typeInfo->setAdoptContentSpec(false); typeInfo->setContentSpec ( new (fGrammarPoolMemoryManager) ContentSpecNode ( ContentSpecNode::ModelGroupSequence , anySpecNode , specNode , true , true , fGrammarPoolMemoryManager ) ); typeInfo->setAdoptContentSpec(true); if (!isMixed) { reportSchemaError(ctElem, XMLUni::fgXMLErrDomain, XMLErrs::MixedOrElementOnly, baseLocalPart, typeName); throw TraverseSchema::InvalidComplexTypeInfo; //REVISIT - should we continue } } typeInfo->setContentType(SchemaElementDecl::Mixed_Complex); } else if (isMixed) { if (specNode != 0) { typeInfo->setContentType(SchemaElementDecl::Mixed_Complex); } else { // add #PCDATA leaf and set its minOccurs to 0 ContentSpecNode* pcdataNode = new (fGrammarPoolMemoryManager) ContentSpecNode ( new (fGrammarPoolMemoryManager) QName ( XMLUni::fgZeroLenString , XMLUni::fgZeroLenString , XMLElementDecl::fgPCDataElemId , fGrammarPoolMemoryManager ) , false , fGrammarPoolMemoryManager ); pcdataNode->setMinOccurs(0); typeInfo->setContentSpec(pcdataNode); typeInfo->setAdoptContentSpec(true); typeInfo->setContentType(SchemaElementDecl::Mixed_Simple); } } else if (specNodeWasNull && (typeDerivedBy == SchemaSymbols::XSD_EXTENSION) && baseTypeInfo) { typeInfo->setBaseDatatypeValidator(baseTypeInfo->getBaseDatatypeValidator()); typeInfo->setDatatypeValidator(baseTypeInfo->getDatatypeValidator()); typeInfo->setContentType(baseTypeInfo->getContentType()); } else if (typeInfo->getContentSpec() == 0) { if (!effectiveContent_hasChild) { typeInfo->setContentType(SchemaElementDecl::Empty); } else { typeInfo->setContentType(SchemaElementDecl::ElementOnlyEmpty); } } else { typeInfo->setContentType(SchemaElementDecl::Children); } // ------------------------------------------------------------- // Now, check attributes and handle // ------------------------------------------------------------- if (attrNode != 0) { if (!isAttrOrAttrGroup(attrNode)) { reportSchemaError(attrNode, XMLUni::fgXMLErrDomain, XMLErrs::InvalidChildInComplexType, attrNode->getLocalName()); } else { processAttributes(ctElem, attrNode, typeInfo, isBaseAnyType); } } else if (baseTypeInfo != 0 || isBaseAnyType) { processAttributes(ctElem, 0, typeInfo, isBaseAnyType); } } void TraverseSchema::processBaseTypeInfo(const DOMElement* const elem, const XMLCh* const baseName, const XMLCh* const localPart, const XMLCh* const uriStr, ComplexTypeInfo* const typeInfo) { SchemaInfo* saveInfo = fSchemaInfo; ComplexTypeInfo* baseComplexTypeInfo = 0; DatatypeValidator* baseDTValidator = 0; SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; unsigned int saveScope = fCurrentScope; // check if the base type is from another schema if (!XMLString::equals(uriStr, fTargetNSURIString)) { // check for datatype validator if it's schema for schema URI if (XMLString::equals(uriStr, SchemaSymbols::fgURI_SCHEMAFORSCHEMA)) { baseDTValidator = getDatatypeValidator(uriStr, localPart); if (!baseDTValidator) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BaseTypeNotFound, baseName); throw TraverseSchema::InvalidComplexTypeInfo; } } else { // Make sure that we have an explicit import statement. // Clause 4 of Schema Representation Constraint: // http://www.w3.org/TR/xmlschema-1/#src-resolve unsigned int uriId = fURIStringPool->addOrFind(uriStr); if (!isImportingNS(uriId)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidNSReference, uriStr); throw TraverseSchema::InvalidComplexTypeInfo; } baseComplexTypeInfo = getTypeInfoFromNS(elem, uriStr, localPart); if (!baseComplexTypeInfo) { baseDTValidator = getDatatypeValidator(uriStr, localPart); if (!baseDTValidator) { SchemaInfo* impInfo = fSchemaInfo->getImportInfo(fURIStringPool->addOrFind(uriStr)); if (!impInfo || impInfo->getProcessed()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BaseTypeNotFound, baseName); throw TraverseSchema::InvalidComplexTypeInfo; } infoType = SchemaInfo::IMPORT; restoreSchemaInfo(impInfo, infoType); } } } } else { fBuffer.set(uriStr); fBuffer.append(chComma); fBuffer.append(localPart); // assume the base is a complexType and try to locate the base type first const XMLCh* fullBaseName = fBuffer.getRawBuffer(); baseComplexTypeInfo = fComplexTypeRegistry->get(fullBaseName); // Circular check if (baseComplexTypeInfo) { if (fCurrentTypeNameStack->containsElement(fStringPool->addOrFind(fullBaseName), fCircularCheckIndex)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::NoCircularDefinition, fullBaseName); throw TraverseSchema::InvalidComplexTypeInfo; } else if (fCurrentTypeNameStack->containsElement(fStringPool->addOrFind(fullBaseName))) { typeInfo->setBaseComplexTypeInfo(baseComplexTypeInfo); throw TraverseSchema::RecursingElement; } else if (baseComplexTypeInfo->getPreprocessed()) { baseComplexTypeInfo = 0; } } } // if not found, 2 possibilities: // 1: ComplexType in question has not been compiled yet; // 2: base is SimpleType; if (!baseComplexTypeInfo && !baseDTValidator) { baseDTValidator = getDatatypeValidator(uriStr, localPart); if (baseDTValidator == 0) { DOMElement* baseTypeNode = fSchemaInfo->getTopLevelComponent(SchemaInfo::C_ComplexType, SchemaSymbols::fgELT_COMPLEXTYPE, localPart, &fSchemaInfo); if (baseTypeNode != 0) { int baseTypeSymbol = traverseComplexTypeDecl(baseTypeNode); baseComplexTypeInfo = fComplexTypeRegistry->get(fStringPool->getValueForId(baseTypeSymbol)); } else { baseTypeNode = fSchemaInfo->getTopLevelComponent(SchemaInfo::C_SimpleType, SchemaSymbols::fgELT_SIMPLETYPE, localPart, &fSchemaInfo); if (baseTypeNode != 0) { baseDTValidator = traverseSimpleTypeDecl(baseTypeNode); if (baseDTValidator == 0) { // restore schema information, if necessary if (saveInfo != fSchemaInfo) { restoreSchemaInfo(saveInfo, infoType, saveScope); } reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::TypeNotFound, uriStr, localPart, uriStr); throw TraverseSchema::InvalidComplexTypeInfo; } } else { // restore schema information, if necessary if (saveInfo != fSchemaInfo) { restoreSchemaInfo(saveInfo, infoType, saveScope); } reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BaseTypeNotFound, baseName); throw TraverseSchema::InvalidComplexTypeInfo; } } } } // end if // restore schema information, if necessary if (saveInfo != fSchemaInfo) { restoreSchemaInfo(saveInfo, infoType, saveScope); } typeInfo->setBaseComplexTypeInfo(baseComplexTypeInfo); typeInfo->setBaseDatatypeValidator(baseDTValidator); } ComplexTypeInfo* TraverseSchema::getTypeInfoFromNS(const DOMElement* const elem, const XMLCh* const uriStr, const XMLCh* const localPart) { Grammar* grammar = fGrammarResolver->getGrammar(uriStr); if (grammar != 0 && grammar->getGrammarType() == Grammar::SchemaGrammarType) { fBuffer.set(uriStr); fBuffer.append(chComma); fBuffer.append(localPart); ComplexTypeInfo* typeInfo = ((SchemaGrammar*)grammar)->getComplexTypeRegistry()->get(fBuffer.getRawBuffer()); return typeInfo; } else { reportSchemaError(elem, XMLUni::fgValidityDomain, XMLValid::GrammarNotFound, uriStr); } return 0; } void TraverseSchema::processAttributes(const DOMElement* const elem, const DOMElement* const attElem, ComplexTypeInfo* const typeInfo, const bool isBaseAnyType) { // If we do not have a complexTypeInfo, then what is the point of // processing. if (typeInfo == 0) { return; } ComplexTypeInfo* baseTypeInfo = typeInfo->getBaseComplexTypeInfo(); if (baseTypeInfo && baseTypeInfo->getPreprocessed()) throw TraverseSchema::RecursingElement; const DOMElement* child = attElem; SchemaAttDef* attWildCard = 0; Janitor janAttWildCard(0); XercesAttGroupInfo* attGroupInfo = 0; ValueVectorOf attGroupList(4, fGrammarPoolMemoryManager); for (; child != 0; child = XUtil::getNextSiblingElement(child)) { const XMLCh* childName = child->getLocalName(); if (XMLString::equals(childName, SchemaSymbols::fgELT_ATTRIBUTE)) { if(attWildCard) reportSchemaError(child, XMLUni::fgXMLErrDomain, XMLErrs::AnyAttributeBeforeAttribute); traverseAttributeDecl(child, typeInfo); } else if (XMLString::equals(childName, SchemaSymbols::fgELT_ATTRIBUTEGROUP)) { if(attWildCard) reportSchemaError(child, XMLUni::fgXMLErrDomain, XMLErrs::AnyAttributeBeforeAttribute); attGroupInfo = traverseAttributeGroupDecl(child, typeInfo); if (attGroupInfo && !attGroupList.containsElement(attGroupInfo)) { attGroupList.addElement(attGroupInfo); } } else if (XMLString::equals(childName, SchemaSymbols::fgELT_ANYATTRIBUTE) ) { if(attWildCard) reportSchemaError(child, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateAnyAttribute); attWildCard = traverseAnyAttribute(child); janAttWildCard.reset(attWildCard); } else { reportSchemaError(child, XMLUni::fgXMLErrDomain, XMLErrs::InvalidChildInComplexType, childName); } } // ------------------------------------------------------------- // Handle wild card/any attribute // ------------------------------------------------------------- int derivedBy = typeInfo->getDerivedBy(); XMLSize_t attGroupListSize = attGroupList.size(); if (attGroupListSize) { SchemaAttDef* completeWildCard = 0; Janitor janCompleteWildCard(0); XMLAttDef::DefAttTypes defAttType = XMLAttDef::Default; bool defAttTypeSet = false; for (XMLSize_t i=0; i < attGroupListSize; i++) { attGroupInfo = attGroupList.elementAt(i); XMLSize_t anyAttCount = attGroupInfo->anyAttributeCount(); if (anyAttCount) { if (!defAttTypeSet) { defAttType = (attWildCard) ? attWildCard->getDefaultType() : attGroupInfo->anyAttributeAt(0)->getDefaultType(); defAttTypeSet = true; } SchemaAttDef* attGroupWildCard = attGroupInfo->getCompleteWildCard(); if (completeWildCard) { attWildCardIntersection(completeWildCard, attGroupWildCard); } else { completeWildCard = new (fGrammarPoolMemoryManager) SchemaAttDef(attGroupWildCard); janCompleteWildCard.reset(completeWildCard); } } } if (completeWildCard) { if (attWildCard) { attWildCardIntersection(attWildCard, completeWildCard); } else { attWildCard = completeWildCard; janCompleteWildCard.orphan(); janAttWildCard.reset(attWildCard); } attWildCard->setDefaultType(defAttType); } } SchemaAttDef* baseAttWildCard = (baseTypeInfo) ? baseTypeInfo->getAttWildCard() : 0; Janitor janBaseAttWildCard(0); if (derivedBy == SchemaSymbols::XSD_EXTENSION) { if (isBaseAnyType) { baseAttWildCard = new (fGrammarPoolMemoryManager) SchemaAttDef(XMLUni::fgZeroLenString, XMLUni::fgZeroLenString, fEmptyNamespaceURI, XMLAttDef::Any_Any, XMLAttDef::ProcessContents_Lax, fGrammarPoolMemoryManager); janBaseAttWildCard.reset(baseAttWildCard); } if (baseAttWildCard && attWildCard) { XMLAttDef::DefAttTypes saveDefType = attWildCard->getDefaultType(); attWildCardUnion(attWildCard, baseAttWildCard); attWildCard->setDefaultType(saveDefType); } } // ------------------------------------------------------------- // insert wildcard attribute // ------------------------------------------------------------- if (attWildCard) { typeInfo->setAttWildCard(attWildCard); janAttWildCard.orphan(); if (attWildCard->getType() == XMLAttDef::AttTypes_Unknown) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::NotExpressibleWildCardIntersection); } } else if (baseAttWildCard && derivedBy == SchemaSymbols::XSD_EXTENSION) { if (isBaseAnyType) { typeInfo->setAttWildCard(baseAttWildCard); janBaseAttWildCard.orphan(); } else { SchemaAttDef* newWildCard = new (fGrammarPoolMemoryManager) SchemaAttDef(baseAttWildCard); typeInfo->setAttWildCard(newWildCard); } } // ------------------------------------------------------------- // Check attributes derivation OK // ------------------------------------------------------------- bool baseWithAttributes = (baseTypeInfo && baseTypeInfo->hasAttDefs()); bool childWithAttributes = (typeInfo->hasAttDefs() || typeInfo->getAttWildCard()); if (derivedBy == SchemaSymbols::XSD_RESTRICTION && childWithAttributes) { if (!baseWithAttributes && !baseAttWildCard) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_1); } else { checkAttDerivationOK(elem, baseTypeInfo, typeInfo); } } // ------------------------------------------------------------- // merge in base type's attribute decls // ------------------------------------------------------------- if (baseTypeInfo && baseTypeInfo->hasAttDefs()) { SchemaAttDefList& baseAttList = (SchemaAttDefList&) baseTypeInfo->getAttDefList(); for (XMLSize_t i=0; igetLocalPart(); // if found a duplicate, then skip the one from the base type if (typeInfo->getAttDef(localPart, attName->getURI()) != 0) { if (derivedBy == SchemaSymbols::XSD_EXTENSION) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateAttInDerivation, localPart); } continue; } if (attDef.getDefaultType() != XMLAttDef::Prohibited) { SchemaAttDef* newAttDef = new (fGrammarPoolMemoryManager) SchemaAttDef(attName->getPrefix(), attName->getLocalPart(), attName->getURI(), attDef.getValue(), attDef.getType(), attDef.getDefaultType(), attDef.getEnumeration(), fGrammarPoolMemoryManager); newAttDef->setDatatypeValidator(attDef.getDatatypeValidator()); typeInfo->addAttDef(newAttDef); if (attDef.getBaseAttDecl()) newAttDef->setBaseAttDecl(attDef.getBaseAttDecl()); else newAttDef->setBaseAttDecl(&attDef); } } } } void TraverseSchema::defaultComplexTypeInfo(ComplexTypeInfo* const typeInfo) { if (typeInfo) { typeInfo->setDerivedBy(0); typeInfo->setContentType(SchemaElementDecl::Any); typeInfo->setDatatypeValidator(0); typeInfo->setContentSpec(0); typeInfo->setBaseComplexTypeInfo(0); typeInfo->setBaseDatatypeValidator(0); } } InputSource* TraverseSchema::resolveSchemaLocation(const XMLCh* const loc, const XMLResourceIdentifier::ResourceIdentifierType resourceIdentitiferType, const XMLCh* const nameSpace) { // ------------------------------------------------------------------ // Create an input source // ------------------------------------------------------------------ InputSource* srcToFill = 0; XMLCh* normalizedURI = 0; if (loc) { XMLString::removeChar(loc, 0xFFFF, fBuffer); normalizedURI = fBuffer.getRawBuffer(); } if (fEntityHandler){ XMLResourceIdentifier resourceIdentifier(resourceIdentitiferType, normalizedURI, nameSpace, 0, fSchemaInfo->getCurrentSchemaURL(), fLocator); srcToFill = fEntityHandler->resolveEntity(&resourceIdentifier); } // If they didn't create a source via the entity resolver, then we // have to create one on our own if we have the schemaLocation (with // the update resolveEntity accepting nameSpace, a schemImport could // pass a null schemaLocation) if (!srcToFill && loc) { if (fScanner->getDisableDefaultEntityResolution()) return 0; XMLURL urlTmp(fMemoryManager); if ((!urlTmp.setURL(fSchemaInfo->getCurrentSchemaURL(), normalizedURI, urlTmp)) || (urlTmp.isRelative())) { if (!fScanner->getStandardUriConformant()) { XMLCh* tempURI = XMLString::replicate(normalizedURI, fMemoryManager); ArrayJanitor tempURIName(tempURI, fMemoryManager); XMLUri::normalizeURI(tempURI, fBuffer); srcToFill = new (fMemoryManager) LocalFileInputSource ( fSchemaInfo->getCurrentSchemaURL() , fBuffer.getRawBuffer() , fMemoryManager ); } else ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_MalformedURL, fMemoryManager); } else { if (fScanner->getStandardUriConformant() && urlTmp.hasInvalidChar()) ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_MalformedURL, fMemoryManager); srcToFill = new (fMemoryManager) URLInputSource(urlTmp, fMemoryManager); } } return srcToFill; } void TraverseSchema::restoreSchemaInfo(SchemaInfo* const toRestore, SchemaInfo::ListType const aListType, const unsigned int saveScope) { if (aListType == SchemaInfo::IMPORT) { // restore grammar info int targetNSURI = toRestore->getTargetNSURI(); fSchemaGrammar->setScopeCount (fScopeCount); fSchemaGrammar->setAnonTypeCount (fAnonXSTypeCount); fSchemaGrammar = (SchemaGrammar*) fGrammarResolver->getGrammar(toRestore->getTargetNSURIString()); fScopeCount = fSchemaGrammar->getScopeCount (); fAnonXSTypeCount = fSchemaGrammar->getAnonTypeCount (); fTargetNSURI = targetNSURI; fCurrentScope = saveScope; fDatatypeRegistry = fSchemaGrammar->getDatatypeRegistry(); fTargetNSURIString = fSchemaGrammar->getTargetNamespace(); fGroupRegistry = fSchemaGrammar->getGroupInfoRegistry(); fAttGroupRegistry = fSchemaGrammar->getAttGroupInfoRegistry(); fAttributeDeclRegistry = fSchemaGrammar->getAttributeDeclRegistry(); fComplexTypeRegistry = fSchemaGrammar->getComplexTypeRegistry(); fValidSubstitutionGroups = fSchemaGrammar->getValidSubstitutionGroups(); } fSchemaInfo = toRestore; } bool TraverseSchema::emptiableParticle(const ContentSpecNode* const specNode) { if (!fFullConstraintChecking || !specNode || (specNode->getMinTotalRange() == 0)) { return true; } return false; } void TraverseSchema::checkFixedFacet(const DOMElement* const elem, const XMLCh* const facetName, const DatatypeValidator* const baseDV, unsigned int& flags) { const XMLCh* fixedFacet = getElementAttValue(elem, SchemaSymbols::fgATT_FIXED); if ((fixedFacet && *fixedFacet) && (XMLString::equals(fixedFacet, SchemaSymbols::fgATTVAL_TRUE) || XMLString::equals(fixedFacet, fgValueOne))) { if (XMLString::equals(SchemaSymbols::fgELT_LENGTH, facetName)) { flags |= DatatypeValidator::FACET_LENGTH; } if (XMLString::equals(SchemaSymbols::fgELT_MINLENGTH, facetName)) { flags |= DatatypeValidator::FACET_MINLENGTH; } else if (XMLString::equals(SchemaSymbols::fgELT_MAXLENGTH, facetName)) { flags |= DatatypeValidator::FACET_MAXLENGTH; } else if (XMLString::equals(SchemaSymbols::fgELT_MAXEXCLUSIVE, facetName)) { flags |= DatatypeValidator::FACET_MAXEXCLUSIVE; } else if (XMLString::equals(SchemaSymbols::fgELT_MAXINCLUSIVE, facetName)) { flags |= DatatypeValidator::FACET_MAXINCLUSIVE; } else if (XMLString::equals(SchemaSymbols::fgELT_MINEXCLUSIVE, facetName)) { flags |= DatatypeValidator::FACET_MINEXCLUSIVE; } else if (XMLString::equals(SchemaSymbols::fgELT_MININCLUSIVE, facetName)) { flags |= DatatypeValidator::FACET_MININCLUSIVE; } else if (XMLString::equals(SchemaSymbols::fgELT_TOTALDIGITS, facetName)) { flags |= DatatypeValidator::FACET_TOTALDIGITS; } else if (XMLString::equals(SchemaSymbols::fgELT_FRACTIONDIGITS, facetName)) { flags |= DatatypeValidator::FACET_FRACTIONDIGITS; } else if ((XMLString::equals(SchemaSymbols::fgELT_WHITESPACE, facetName)) && baseDV->getType() == DatatypeValidator::String) { flags |= DatatypeValidator::FACET_WHITESPACE; } } } void TraverseSchema::buildValidSubstitutionListB(const DOMElement* const elem, SchemaElementDecl* const elemDecl, SchemaElementDecl* const subsElemDecl) { SchemaElementDecl* chainElemDecl = subsElemDecl->getSubstitutionGroupElem(); while (chainElemDecl) { int chainElemURI = chainElemDecl->getURI(); XMLCh* chainElemName = chainElemDecl->getBaseName(); ValueVectorOf* validSubsElements = fValidSubstitutionGroups->get(chainElemName, chainElemURI); if (!validSubsElements) { if (fTargetNSURI == chainElemURI) { break; // an error must have occured } SchemaGrammar* aGrammar = (SchemaGrammar*) fGrammarResolver->getGrammar(fURIStringPool->getValueForId(chainElemURI)); if (!aGrammar) break; validSubsElements = aGrammar->getValidSubstitutionGroups()->get(chainElemName, chainElemURI); if (!validSubsElements) { break; } validSubsElements = new (fGrammarPoolMemoryManager) ValueVectorOf(*validSubsElements); fValidSubstitutionGroups->put((void*) chainElemName, chainElemURI, validSubsElements); } if (validSubsElements->containsElement(elemDecl) || !isSubstitutionGroupValid(elem, chainElemDecl, elemDecl->getComplexTypeInfo(), elemDecl->getDatatypeValidator(), 0, false)) { break; } validSubsElements->addElement(elemDecl); // update related subs. info in case of circular import BaseRefVectorEnumerator importingEnum = fSchemaInfo->getImportingListEnumerator(); while (importingEnum.hasMoreElements()) { const SchemaInfo& curRef = importingEnum.nextElement(); SchemaGrammar* aGrammar = (SchemaGrammar*) fGrammarResolver->getGrammar(curRef.getTargetNSURIString()); ValueVectorOf* subsElemList = aGrammar->getValidSubstitutionGroups()->get(chainElemName, chainElemURI); if (subsElemList && !subsElemList->containsElement(elemDecl)) { subsElemList->addElement(elemDecl); } } chainElemDecl = chainElemDecl->getSubstitutionGroupElem(); } } void TraverseSchema::buildValidSubstitutionListF(const DOMElement* const elem, SchemaElementDecl* const elemDecl, SchemaElementDecl* const subsElemDecl) { int elemURI = elemDecl->getURI(); XMLCh* elemName = elemDecl->getBaseName(); ValueVectorOf* validSubsElements =fValidSubstitutionGroups->get(elemName, elemURI); if (validSubsElements) { int subsElemURI = subsElemDecl->getURI(); XMLCh* subsElemName = subsElemDecl->getBaseName(); ValueVectorOf* validSubs = fValidSubstitutionGroups->get(subsElemName, subsElemURI); if (!validSubs) { if (fTargetNSURI == subsElemURI) { return; // an error must have occured } SchemaGrammar* aGrammar = (SchemaGrammar*) fGrammarResolver->getGrammar(fURIStringPool->getValueForId(subsElemURI)); if (!aGrammar) return; validSubs = aGrammar->getValidSubstitutionGroups()->get(subsElemName, subsElemURI); if (!validSubs) { return; } validSubs = new (fGrammarPoolMemoryManager) ValueVectorOf(*validSubs); fValidSubstitutionGroups->put((void*) subsElemName, subsElemURI, validSubs); } XMLSize_t elemSize = validSubsElements->size(); for (XMLSize_t i=0; ielementAt(i); if (validSubs->containsElement(chainElem)) { continue; } if (isSubstitutionGroupValid(elem, subsElemDecl, chainElem->getComplexTypeInfo(), chainElem->getDatatypeValidator(), 0, false)) { validSubs->addElement(chainElem); buildValidSubstitutionListB(elem, chainElem, subsElemDecl); } } } } void TraverseSchema::checkEnumerationRequiredNotation(const DOMElement* const elem, const XMLCh* const name, const XMLCh* const type) { const XMLCh* localPart = getLocalPart(type); if (XMLString::equals(localPart, XMLUni::fgNotationString)) { const XMLCh* prefix = getPrefix(type); const XMLCh* typeURI = resolvePrefixToURI(elem, prefix); if (XMLString::equals(typeURI, SchemaSymbols::fgURI_SCHEMAFORSCHEMA)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::NoNotationType, name); } } } XercesGroupInfo* TraverseSchema::processGroupRef(const DOMElement* const elem, const XMLCh* const refName) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); DOMElement* content = checkContent(elem, XUtil::getFirstChildElement(elem), true); Janitor janAnnot(fAnnotation); if (content != 0) { reportSchemaError(elem, XMLUni::fgValidityDomain, XMLValid::NoContentForRef, SchemaSymbols::fgELT_GROUP); } const XMLCh* prefix = getPrefix(refName); const XMLCh* localPart = getLocalPart(refName); const XMLCh* uriStr = resolvePrefixToURI(elem, prefix); fBuffer.set(uriStr); fBuffer.append(chComma); fBuffer.append(localPart); unsigned int nameIndex = fStringPool->addOrFind(fBuffer.getRawBuffer()); if (fCurrentGroupStack->containsElement(nameIndex)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::NoCircularDefinition, localPart); return 0; } XercesGroupInfo* groupInfo = 0; SchemaInfo* saveInfo = fSchemaInfo; SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; unsigned int saveScope = fCurrentScope; //if from another target namespace if (!XMLString::equals(uriStr, fTargetNSURIString)) { // Make sure that we have an explicit import statement. // Clause 4 of Schema Representation Constraint: // http://www.w3.org/TR/xmlschema-1/#src-resolve unsigned int uriId = fURIStringPool->addOrFind(uriStr); if (!isImportingNS(uriId)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidNSReference, uriStr); return 0; } Grammar* aGrammar = fGrammarResolver->getGrammar(uriStr); if (!aGrammar || aGrammar->getGrammarType() != Grammar::SchemaGrammarType) { reportSchemaError(elem, XMLUni::fgValidityDomain, XMLValid::GrammarNotFound, uriStr); return 0; } groupInfo = ((SchemaGrammar*)aGrammar)->getGroupInfoRegistry()->get(fStringPool->getValueForId(nameIndex)); if (!groupInfo) { SchemaInfo* impInfo = fSchemaInfo->getImportInfo(fURIStringPool->addOrFind(uriStr)); if (!impInfo || impInfo->getProcessed()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::DeclarationNotFound, SchemaSymbols::fgELT_GROUP, uriStr, localPart); return 0; } infoType = SchemaInfo::IMPORT; restoreSchemaInfo(impInfo, infoType); } } else { groupInfo = fGroupRegistry->get(fStringPool->getValueForId(nameIndex)); } if (!groupInfo) { DOMElement* groupElem = fSchemaInfo->getTopLevelComponent(SchemaInfo::C_Group, SchemaSymbols::fgELT_GROUP, localPart, &fSchemaInfo); if (groupElem != 0) { groupInfo = traverseGroupDecl(groupElem); // restore schema information restoreSchemaInfo(saveInfo, infoType, saveScope); if (groupInfo && (fCurrentGroupInfo || infoType == SchemaInfo::IMPORT)) { copyGroupElements(elem, groupInfo, fCurrentGroupInfo, (infoType == SchemaInfo::IMPORT) ? fCurrentComplexType : 0); } return groupInfo; } else { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::DeclarationNotFound, SchemaSymbols::fgELT_GROUP, uriStr, localPart); } // restore schema information, if necessary if (saveInfo != fSchemaInfo) { restoreSchemaInfo(saveInfo, infoType, saveScope); } } else { copyGroupElements(elem, groupInfo, fCurrentGroupInfo, fCurrentComplexType); } return groupInfo; } XercesAttGroupInfo* TraverseSchema::processAttributeGroupRef(const DOMElement* const elem, const XMLCh* const refName, ComplexTypeInfo* const typeInfo) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); if (checkContent(elem, XUtil::getFirstChildElement(elem), true) != 0) { reportSchemaError(elem ,XMLUni::fgValidityDomain, XMLValid::NoContentForRef, SchemaSymbols::fgELT_ATTRIBUTEGROUP); } Janitor janAnnot(fAnnotation); const XMLCh* prefix = getPrefix(refName); const XMLCh* localPart = getLocalPart(refName); const XMLCh* uriStr = resolvePrefixToURI(elem, prefix); XercesAttGroupInfo* attGroupInfo = 0; SchemaInfo* saveInfo = fSchemaInfo; SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; unsigned int saveScope = fCurrentScope; if (!XMLString::equals(uriStr, fTargetNSURIString)) { // Make sure that we have an explicit import statement. // Clause 4 of Schema Representation Constraint: // http://www.w3.org/TR/xmlschema-1/#src-resolve unsigned int uriId = fURIStringPool->addOrFind(uriStr); if (!isImportingNS(uriId)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidNSReference, uriStr); return 0; } attGroupInfo = traverseAttributeGroupDeclNS(elem, uriStr, localPart); if (!attGroupInfo) { SchemaInfo* impInfo = fSchemaInfo->getImportInfo(fURIStringPool->addOrFind(uriStr)); if (!impInfo || impInfo->getProcessed()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::DeclarationNotFound, SchemaSymbols::fgELT_ATTRIBUTEGROUP, uriStr, localPart); return 0; } infoType = SchemaInfo::IMPORT; restoreSchemaInfo(impInfo, infoType); } } else { attGroupInfo = fAttGroupRegistry->get(localPart); } if (!attGroupInfo) { // traverse top level attributeGroup - if found DOMElement* attGroupElem = fSchemaInfo->getTopLevelComponent(SchemaInfo::C_AttributeGroup, SchemaSymbols::fgELT_ATTRIBUTEGROUP, localPart, &fSchemaInfo); if (attGroupElem != 0) { // circular attribute check if (fDeclStack->containsElement(attGroupElem)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::NoCircularDefinition, refName); return 0; } attGroupInfo = traverseAttributeGroupDecl(attGroupElem, typeInfo, true); if (attGroupInfo && fCurrentAttGroupInfo) { copyAttGroupAttributes(elem, attGroupInfo, fCurrentAttGroupInfo, 0); } // restore schema information, if necessary if (saveInfo != fSchemaInfo) { restoreSchemaInfo(saveInfo, infoType, saveScope); } return attGroupInfo; } else { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::DeclarationNotFound, SchemaSymbols::fgELT_ATTRIBUTEGROUP, uriStr, localPart); } } if (attGroupInfo) { copyAttGroupAttributes(elem, attGroupInfo, fCurrentAttGroupInfo, typeInfo); } // restore schema information, if necessary if (saveInfo != fSchemaInfo) { restoreSchemaInfo(saveInfo, infoType); } return attGroupInfo; } void TraverseSchema::processElements(const DOMElement* const elem, ComplexTypeInfo* const baseTypeInfo, ComplexTypeInfo* const newTypeInfo) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); XMLSize_t elemCount = baseTypeInfo->elementCount(); if (elemCount) { int newTypeScope = newTypeInfo->getScopeDefined(); int schemaURI = fURIStringPool->addOrFind(SchemaSymbols::fgURI_SCHEMAFORSCHEMA); for (XMLSize_t i=0; i < elemCount; i++) { SchemaGrammar* aGrammar = fSchemaGrammar; SchemaElementDecl* elemDecl = baseTypeInfo->elementAt(i); int elemURI = elemDecl->getURI(); unsigned int elemScope = elemDecl->getEnclosingScope(); if (elemScope != Grammar::TOP_LEVEL_SCOPE) { if (elemURI != fTargetNSURI && elemURI != schemaURI && elemURI != fEmptyNamespaceURI) { Grammar* aGrammar = fGrammarResolver->getGrammar(fURIStringPool->getValueForId(elemURI)); if (!aGrammar || aGrammar->getGrammarType() != Grammar::SchemaGrammarType) { continue; // REVISIT - error message } } const XMLCh* localPart = elemDecl->getBaseName(); const SchemaElementDecl* other = (SchemaElementDecl*) aGrammar->getElemDecl(elemURI, localPart, 0, newTypeScope); if (other) { if (elemDecl->getComplexTypeInfo() != other->getComplexTypeInfo() || elemDecl->getDatatypeValidator() != other->getDatatypeValidator()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateElementDeclaration, localPart); } continue; } elemDecl->setEnclosingScope(newTypeScope); ((SchemaGrammar*) aGrammar)->putGroupElemDecl(elemDecl); elemDecl->setEnclosingScope(elemScope); } newTypeInfo->addElement(elemDecl); } } } void TraverseSchema::processElements(const DOMElement* const elem, XercesGroupInfo* const fromGroup, ComplexTypeInfo* const typeInfo) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); XMLSize_t elemCount = fromGroup->elementCount(); int newScope = typeInfo->getScopeDefined(); for (XMLSize_t i = 0; i < elemCount; i++) { SchemaElementDecl* elemDecl = fromGroup->elementAt(i); unsigned int elemScope = elemDecl->getEnclosingScope(); if (elemScope != Grammar::TOP_LEVEL_SCOPE) { int elemURI = elemDecl->getURI(); const XMLCh* localPart = elemDecl->getBaseName(); const SchemaElementDecl* other = (SchemaElementDecl*) fSchemaGrammar->getElemDecl(elemURI, localPart, 0, newScope); if (other) { if (elemDecl->getComplexTypeInfo() != other->getComplexTypeInfo() || elemDecl->getDatatypeValidator() != other->getDatatypeValidator()) { reportSchemaError( elem, XMLUni::fgXMLErrDomain , XMLErrs::DuplicateElementDeclaration, localPart); } continue; } elemDecl->setEnclosingScope(newScope); fSchemaGrammar->putGroupElemDecl(elemDecl); elemDecl->setEnclosingScope(elemScope); typeInfo->addElement(elemDecl); } } } void TraverseSchema::copyGroupElements(const DOMElement* const elem, XercesGroupInfo* const fromGroup, XercesGroupInfo* const toGroup, ComplexTypeInfo* const typeInfo) { XMLSize_t elemCount = fromGroup->elementCount(); int newScope = (typeInfo) ? typeInfo->getScopeDefined() : 0; if (typeInfo) fromGroup->setCheckElementConsistency(false); for (XMLSize_t i = 0; i < elemCount; i++) { SchemaElementDecl* elemDecl = fromGroup->elementAt(i); if (typeInfo) { unsigned int elemScope = elemDecl->getEnclosingScope(); if (elemScope != Grammar::TOP_LEVEL_SCOPE) { int elemURI = elemDecl->getURI(); const XMLCh* localPart = elemDecl->getBaseName(); const SchemaElementDecl* other = (SchemaElementDecl*) fSchemaGrammar->getElemDecl(elemURI, localPart, 0, newScope); if (other) { if (elemDecl->getComplexTypeInfo() != other->getComplexTypeInfo() || elemDecl->getDatatypeValidator() != other->getDatatypeValidator()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateElementDeclaration, localPart); } continue; } elemDecl->setEnclosingScope(newScope); fSchemaGrammar->putGroupElemDecl(elemDecl); elemDecl->setEnclosingScope(elemScope); } typeInfo->addElement(elemDecl); } if (toGroup) { toGroup->addElement(elemDecl); } } } void TraverseSchema::copyAttGroupAttributes(const DOMElement* const elem, XercesAttGroupInfo* const fromAttGroup, XercesAttGroupInfo* const toAttGroup, ComplexTypeInfo* const typeInfo) { XMLSize_t attCount = fromAttGroup->attributeCount(); for (XMLSize_t i=0; i < attCount; i++) { SchemaAttDef* attDef = fromAttGroup->attributeAt(i); QName* attName = attDef->getAttName(); const XMLCh* localPart = attName->getLocalPart(); DatatypeValidator* attDV = attDef->getDatatypeValidator(); if (typeInfo) { if (typeInfo->getAttDef(localPart, attName->getURI())) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateAttribute, localPart); continue; } if (attDV && attDV->getType() == DatatypeValidator::ID) { if (typeInfo->containsAttWithTypeId()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::AttDeclPropCorrect5, localPart); continue; } typeInfo->setAttWithTypeId(true); } SchemaAttDef* clonedAttDef = new (fGrammarPoolMemoryManager) SchemaAttDef(attDef); typeInfo->addAttDef(clonedAttDef); if (!clonedAttDef->getBaseAttDecl()) clonedAttDef->setBaseAttDecl(attDef); if (toAttGroup) { toAttGroup->addAttDef(attDef, true); } } else { if (toAttGroup->containsAttribute(localPart, attName->getURI())) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::DuplicateAttribute, localPart); continue; } if (attDV && attDV->getType() == DatatypeValidator::ID) { if (toAttGroup->containsTypeWithId()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::AttGrpPropCorrect3, localPart); continue; } toAttGroup->setTypeWithId(true); } toAttGroup->addAttDef(attDef, true); } } if (toAttGroup) { XMLSize_t anyAttCount = fromAttGroup->anyAttributeCount(); for (XMLSize_t j=0; j < anyAttCount; j++) { toAttGroup->addAnyAttDef(fromAttGroup->anyAttributeAt(j), true); } } } void TraverseSchema::attWildCardIntersection(SchemaAttDef* const resultWildCard, const SchemaAttDef* const compareWildCard) { XMLAttDef::AttTypes typeR = resultWildCard->getType(); XMLAttDef::AttTypes typeC = compareWildCard->getType(); //If either O1 or O2 is any, then the other must be the value. if (typeC == XMLAttDef::Any_Any || typeR == XMLAttDef::AttTypes_Unknown) { return; } if (typeR == XMLAttDef::Any_Any || typeC == XMLAttDef::AttTypes_Unknown) { resultWildCard->resetNamespaceList(); copyWildCardData(compareWildCard, resultWildCard); return; } // If either O1 or O2 is a pair of not and a namespace name and the other // is a set, then that set, minus the negated namespace name if it was in // is the value if ((typeC == XMLAttDef::Any_Other && typeR == XMLAttDef::Any_List) || (typeR == XMLAttDef::Any_Other && typeC == XMLAttDef::Any_List)) { unsigned int compareURI = 0; ValueVectorOf* nameURIList = 0; if (typeC == XMLAttDef::Any_List) { nameURIList = compareWildCard->getNamespaceList(); compareURI = resultWildCard->getAttName()->getURI(); } else { nameURIList = resultWildCard->getNamespaceList(); compareURI = compareWildCard->getAttName()->getURI(); } XMLSize_t listSize = (nameURIList) ? nameURIList->size() : 0; if (listSize) { bool found = false; ValueVectorOf tmpURIList(listSize, fGrammarPoolMemoryManager); for (XMLSize_t i=0; i < listSize; i++) { unsigned int nameURI = nameURIList->elementAt(i); if (nameURI != compareURI && nameURI != (unsigned int) fEmptyNamespaceURI) { tmpURIList.addElement(nameURI); } else { found = true; } } if (found || typeC == XMLAttDef::Any_List) { resultWildCard->setNamespaceList(&tmpURIList); } } if (typeC == XMLAttDef::Any_List) { copyWildCardData(compareWildCard, resultWildCard); } return; } // If both O1 and O2 are sets, then the intersection of those sets must be // the value. if (typeR == XMLAttDef::Any_List && typeC == XMLAttDef::Any_List) { ValueVectorOf* uriListR = resultWildCard->getNamespaceList(); ValueVectorOf* uriListC = compareWildCard->getNamespaceList(); XMLSize_t listSize = (uriListC) ? uriListC->size() : 0; if (listSize) { ValueVectorOf tmpURIList(listSize, fGrammarPoolMemoryManager); for (XMLSize_t i=0; i < listSize; i++) { unsigned int uriName = uriListC->elementAt(i); if (uriListR && uriListR->containsElement(uriName)) { tmpURIList.addElement(uriName); } } resultWildCard->setNamespaceList(&tmpURIList); } else { resultWildCard->resetNamespaceList(); } return; } // If the two are negations of different namespace names, then: // if one is a negation of absent, then result is negation of namespace // else intersection is not expressible. if (typeR == XMLAttDef::Any_Other && typeC == XMLAttDef::Any_Other) { QName* qnameR = resultWildCard->getAttName(); if (qnameR->getURI() != compareWildCard->getAttName()->getURI()) { if (qnameR->getURI() == (unsigned int)fEmptyNamespaceURI) { qnameR->setURI(compareWildCard->getAttName()->getURI()); } else if (compareWildCard->getAttName()->getURI() != (unsigned int)fEmptyNamespaceURI) { qnameR->setURI(fEmptyNamespaceURI); resultWildCard->setType(XMLAttDef::AttTypes_Unknown); } } } } void TraverseSchema::attWildCardUnion(SchemaAttDef* const resultWildCard, const SchemaAttDef* const compareWildCard) { XMLAttDef::AttTypes typeR = resultWildCard->getType(); XMLAttDef::AttTypes typeC = compareWildCard->getType(); //If either O1 or O2 is any, then the other must be the value. if (typeR == XMLAttDef::Any_Any || typeR == XMLAttDef::AttTypes_Unknown) { return; } if (typeC == XMLAttDef::Any_Any || typeC == XMLAttDef::AttTypes_Unknown) { resultWildCard->resetNamespaceList(); copyWildCardData(compareWildCard, resultWildCard); return; } // If both O1 and O2 are sets, then the union of those sets must be // the value. if (typeR == XMLAttDef::Any_List && typeC == XMLAttDef::Any_List) { ValueVectorOf* uriListR = resultWildCard->getNamespaceList(); ValueVectorOf* uriListC = compareWildCard->getNamespaceList(); XMLSize_t listSizeC = (uriListC) ? uriListC->size() : 0; if (listSizeC) { if (!uriListR || !uriListR->size()) { resultWildCard->setNamespaceList(uriListC); return; } ValueVectorOf tmpURIList(*uriListR); for (XMLSize_t i = 0; i < listSizeC; i++) { unsigned int uriName = uriListC->elementAt(i); if (!uriListR->containsElement(uriName)) { tmpURIList.addElement(uriName); } } resultWildCard->setNamespaceList(&tmpURIList); } return; } // If the two are negations of different namespace names, then not and // absent must be the value if (typeR == XMLAttDef::Any_Other && typeC == XMLAttDef::Any_Other) { QName* qnameR = resultWildCard->getAttName(); if (qnameR->getURI() != compareWildCard->getAttName()->getURI()) { qnameR->setURI(fEmptyNamespaceURI); resultWildCard->setType(XMLAttDef::Any_Other); } } // 5. If either O1 or O2 is a pair of not and a namespace name and the // other is a set, then: // 1. If the set includes both the negated namespace name and absent // then any must be the value. // 2. If the set includes the negated namespace name but not absent, // then a pair of not and absent must be the value. // 3. If the set includes absent but not the negated namespace name, // then the union is not expressible. // 4. If the set does not include either the negated namespace or // absent, then whichever of O1 or O2 is a pair of not and a // namespace name. // // 6. If either O1 or O2 is a pair of not and absent and the other is a // set, then: // 1. If the set includes absent then any must be the value. // 2. If the set does not include absent, then a pair of not and // absent. if ((typeC == XMLAttDef::Any_Other && typeR == XMLAttDef::Any_List) || (typeR == XMLAttDef::Any_Other && typeC == XMLAttDef::Any_List)) { ValueVectorOf* nameURIList = 0; QName* attNameR = resultWildCard->getAttName(); unsigned int compareURI = 0; if (typeC == XMLAttDef::Any_List) { nameURIList = compareWildCard->getNamespaceList(); compareURI = attNameR->getURI(); } else { nameURIList = resultWildCard->getNamespaceList(); compareURI = compareWildCard->getAttName()->getURI(); } // 6. not and absent if (compareURI == (unsigned int) fEmptyNamespaceURI) { if (nameURIList) { // 6.1 result is any if (nameURIList->containsElement(compareURI)) { resultWildCard->setType(XMLAttDef::Any_Any); attNameR->setURI(fEmptyNamespaceURI); } // 6.2 result is not and absent else if (typeR == XMLAttDef::Any_List){ resultWildCard->setType(XMLAttDef::Any_Other); attNameR->setURI(fEmptyNamespaceURI); } } // 6.2 result is not and absent else if (typeR == XMLAttDef::Any_List) { resultWildCard->setType(XMLAttDef::Any_Other); attNameR->setURI(fEmptyNamespaceURI); } } // 5. not and namespace else { // 5.3 result is not expressible if (!nameURIList) { resultWildCard->setType(XMLAttDef::AttTypes_Unknown); attNameR->setURI(fEmptyNamespaceURI); } else { bool containsAbsent = nameURIList->containsElement(fEmptyNamespaceURI); bool containsNamespace = nameURIList->containsElement(compareURI); // 5.1 result is any if (containsAbsent && containsNamespace) { resultWildCard->setType(XMLAttDef::Any_Any); attNameR->setURI(fEmptyNamespaceURI); } // 5.2 result is not and absent else if (containsNamespace) { resultWildCard->setType(XMLAttDef::Any_Other); attNameR->setURI(fEmptyNamespaceURI); } // 5.3 result is not expressible else if (containsAbsent) { resultWildCard->setType(XMLAttDef::AttTypes_Unknown); attNameR->setURI(fEmptyNamespaceURI); } // 5.4. whichever is not and namespace else if (typeR == XMLAttDef::Any_List) { resultWildCard->setType(XMLAttDef::Any_Other); attNameR->setURI(compareURI); } } } resultWildCard->resetNamespaceList(); } } void TraverseSchema::checkAttDerivationOK(const DOMElement* const elem, const ComplexTypeInfo* const baseTypeInfo, const ComplexTypeInfo* const childTypeInfo) { SchemaAttDefList& childAttList = (SchemaAttDefList&) childTypeInfo->getAttDefList(); const SchemaAttDef* baseAttWildCard = baseTypeInfo->getAttWildCard(); for (XMLSize_t i=0; igetLocalPart(); const SchemaAttDef* baseAttDef = baseTypeInfo->getAttDef(childLocalPart, childAttName->getURI()); if (baseAttDef) { XMLAttDef::DefAttTypes baseAttDefType = baseAttDef->getDefaultType(); XMLAttDef::DefAttTypes childAttDefType = childAttDef.getDefaultType(); // Constraint 2.1.1 & 3 + check for prohibited base attribute if (baseAttDefType == XMLAttDef::Prohibited && childAttDefType != XMLAttDef::Prohibited) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_8, childLocalPart); } if ((baseAttDefType & XMLAttDef::Required) && !(childAttDefType & XMLAttDef::Required)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_2, childLocalPart); } // if the attribute in the derived type is prohibited, and it didn't try to override a required attribute, // it's ok and shouldn't be tested for data type or fixed value if (childAttDefType == XMLAttDef::Prohibited) continue; // Constraint 2.1.2 DatatypeValidator* baseDV = baseAttDef->getDatatypeValidator(); DatatypeValidator* childDV = childAttDef.getDatatypeValidator(); if (!baseDV || !baseDV->isSubstitutableBy(childDV)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_3, childLocalPart); } // Constraint 2.1.3 if ((baseAttDefType & XMLAttDef::Fixed) && (!(childAttDefType & XMLAttDef::Fixed) || !XMLString::equals(baseAttDef->getValue(), childAttDef.getValue()))) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_4, childLocalPart); } } // Constraint 2.2 else if (!baseAttWildCard || !wildcardAllowsNamespace(baseAttWildCard, childAttName->getURI())) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_5, childLocalPart); } } // Constraint 4 const SchemaAttDef* childAttWildCard = childTypeInfo->getAttWildCard(); if (childAttWildCard) { if (!baseAttWildCard) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_6); } else if (!isWildCardSubset(baseAttWildCard, childAttWildCard)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_7); } else if (childAttWildCard->getDefaultType() < baseAttWildCard->getDefaultType()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_9); } } } void TraverseSchema::checkAttDerivationOK(const DOMElement* const elem, const XercesAttGroupInfo* const baseAttGrpInfo, const XercesAttGroupInfo* const childAttGrpInfo) { XMLSize_t baseAttCount = baseAttGrpInfo->attributeCount(); XMLSize_t baseAnyAttCount = baseAttGrpInfo->anyAttributeCount(); XMLSize_t childAttCount = childAttGrpInfo->attributeCount(); XMLSize_t childAnyAttCount = childAttGrpInfo->anyAttributeCount(); if ((childAttCount || childAnyAttCount) && (!baseAttCount && !baseAnyAttCount)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_1); } const SchemaAttDef* baseAttWildCard = (baseAnyAttCount) ? baseAttGrpInfo->anyAttributeAt(0) : 0; for (XMLSize_t i=0; iattributeAt(i); QName* childAttName = childAttDef->getAttName(); const XMLCh* childLocalPart = childAttName->getLocalPart(); const SchemaAttDef* baseAttDef = baseAttGrpInfo->getAttDef(childLocalPart, childAttName->getURI()); if (baseAttDef) { XMLAttDef::DefAttTypes baseAttDefType = baseAttDef->getDefaultType(); XMLAttDef::DefAttTypes childAttDefType = childAttDef->getDefaultType(); // Constraint 2.1.1 & 3 + check for prohibited base attribute if (baseAttDefType == XMLAttDef::Prohibited && childAttDefType != XMLAttDef::Prohibited) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_8, childLocalPart); } if ((baseAttDefType & XMLAttDef::Required) && !(childAttDefType & XMLAttDef::Required)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_2, childLocalPart); } // if the attribute in the derived type is prohibited, and it didn't try to override a required attribute, // it's ok and shouldn't be tested for data type or fixed value if (childAttDefType == XMLAttDef::Prohibited) continue; // Constraint 2.1.2 DatatypeValidator* baseDV = baseAttDef->getDatatypeValidator(); DatatypeValidator* childDV = childAttDef->getDatatypeValidator(); if (!baseDV || !baseDV->isSubstitutableBy(childDV)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_3, childLocalPart); } // Constraint 2.1.3 if ((baseAttDefType & XMLAttDef::Fixed) && (!(childAttDefType & XMLAttDef::Fixed) || !XMLString::equals(baseAttDef->getValue(), childAttDef->getValue()))) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_4, childLocalPart); } } // Constraint 2.2 else if (!baseAttWildCard || !wildcardAllowsNamespace(baseAttWildCard, childAttName->getURI())) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_5, childLocalPart); } } // Constraint 4 const SchemaAttDef* childAttWildCard = (childAnyAttCount) ? childAttGrpInfo->anyAttributeAt(0) : 0; if (childAttWildCard) { if (!baseAttWildCard) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_6); } else if (!isWildCardSubset(baseAttWildCard, childAttWildCard)) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_7); } else if (childAttWildCard->getDefaultType() < baseAttWildCard->getDefaultType()) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::BadAttDerivation_9); } } } bool TraverseSchema::wildcardAllowsNamespace(const SchemaAttDef* const wildCard, const unsigned int nameURI) { XMLAttDef::AttTypes wildCardType = wildCard->getType(); // The constraint must be any if (wildCardType == XMLAttDef::Any_Any) { return true; } // All of the following must be true: // 2.1 The constraint is a pair of not and a namespace name or ·absent // 2.2 The value must not be identical to the ·namespace test·. // 2.3 The value must not be ·absent·. if (wildCardType == XMLAttDef::Any_Other && ((int) nameURI) != fEmptyNamespaceURI && wildCard->getAttName()->getURI() != nameURI) { return true; } // The constraint is a set, and the value is identical to one of the // members of the set if (wildCardType == XMLAttDef::Any_List) { ValueVectorOf* nameURIList = wildCard->getNamespaceList(); if (nameURIList->containsElement(nameURI)) { return true; } } return false; } bool TraverseSchema::isWildCardSubset(const SchemaAttDef* const baseAttWildCard, const SchemaAttDef* const childAttWildCard) { XMLAttDef::AttTypes baseWildCardType = baseAttWildCard->getType(); XMLAttDef::AttTypes childWildCardType = childAttWildCard->getType(); if (baseWildCardType == XMLAttDef::AttTypes_Unknown || childWildCardType == XMLAttDef::AttTypes_Unknown) { return false; } // 1 super must be any. if (baseWildCardType == XMLAttDef::Any_Any) { return true; } // 2 All of the following must be true: // 2.1 sub must be a pair of not and a namespace name or ·absent·. // 2.2 super must be a pair of not and the same value. if (childWildCardType == XMLAttDef::Any_Other && baseWildCardType == XMLAttDef::Any_Other && childAttWildCard->getAttName()->getURI() == baseAttWildCard->getAttName()->getURI()) { return true; } // 3 All of the following must be true: // 3.1 sub must be a set whose members are either namespace names or ·absent·. // 3.2 One of the following must be true: // 3.2.1 super must be the same set or a superset thereof. // 3.2.2 super must be a pair of not and a namespace name or ·absent· and // that value must not be in sub's set. if (childWildCardType == XMLAttDef::Any_List) { ValueVectorOf* childURIList = childAttWildCard->getNamespaceList(); if (baseWildCardType == XMLAttDef::Any_List) { ValueVectorOf* baseURIList = baseAttWildCard->getNamespaceList(); XMLSize_t childListSize = (childURIList) ? childURIList->size() : 0; for (XMLSize_t i=0; icontainsElement(childURIList->elementAt(i))) { return false; } } return true; } else if (baseWildCardType == XMLAttDef::Any_Other) { if (!childURIList->containsElement(baseAttWildCard->getAttName()->getURI())) { return true; } } } return false; } bool TraverseSchema::openRedefinedSchema(const DOMElement* const redefineElem) { if (fPreprocessedNodes->containsKey(redefineElem)) { restoreSchemaInfo(fPreprocessedNodes->get(redefineElem)); return true; } // ------------------------------------------------------------------ // Get 'schemaLocation' attribute // ------------------------------------------------------------------ const XMLCh* schemaLocation = getElementAttValue(redefineElem, SchemaSymbols::fgATT_SCHEMALOCATION, DatatypeValidator::AnyURI); if (!schemaLocation || !*schemaLocation) { reportSchemaError(redefineElem, XMLUni::fgXMLErrDomain, XMLErrs::DeclarationNoSchemaLocation, SchemaSymbols::fgELT_REDEFINE); return false; } // ------------------------------------------------------------------ // Resolve schema location // ------------------------------------------------------------------ fLocator->setValues(fSchemaInfo->getCurrentSchemaURL(), 0, ((XSDElementNSImpl*) redefineElem)->getLineNo(), ((XSDElementNSImpl*) redefineElem)->getColumnNo()); InputSource* srcToFill = resolveSchemaLocation(schemaLocation, XMLResourceIdentifier::SchemaRedefine); Janitor janSrc(srcToFill); // Nothing to do if (!srcToFill) { return false; } const XMLCh* includeURL = srcToFill->getSystemId(); if (XMLString::equals(includeURL, fSchemaInfo->getCurrentSchemaURL())) { return false; } SchemaInfo* redefSchemaInfo = fCachedSchemaInfoList->get(includeURL, fTargetNSURI); if (!redefSchemaInfo && fSchemaInfoList != fCachedSchemaInfoList) redefSchemaInfo = fSchemaInfoList->get(includeURL, fTargetNSURI); if (redefSchemaInfo) { reportSchemaError(redefineElem, XMLUni::fgXMLErrDomain, XMLErrs::InvalidRedefine, includeURL); return false; } // ------------------------------------------------------------------ // Parse input source // ------------------------------------------------------------------ if (!fParser) fParser = new (fGrammarPoolMemoryManager) XSDDOMParser(0,fGrammarPoolMemoryManager, 0); fParser->setValidationScheme(XercesDOMParser::Val_Never); fParser->setDoNamespaces(true); fParser->setUserEntityHandler(fEntityHandler); fParser->setUserErrorReporter(fErrorReporter); // Should just issue warning if the schema is not found bool flag = srcToFill->getIssueFatalErrorIfNotFound(); srcToFill->setIssueFatalErrorIfNotFound(false); fParser->parse(*srcToFill) ; // Reset the InputSource srcToFill->setIssueFatalErrorIfNotFound(flag); if (fParser->getSawFatal() && fScanner->getExitOnFirstFatal()) reportSchemaError(redefineElem, XMLUni::fgXMLErrDomain, XMLErrs::SchemaScanFatalError); // ------------------------------------------------------------------ // Get root element // ------------------------------------------------------------------ DOMDocument* document = fParser->getDocument(); if (!document) { return false; } else { DOMElement* root = document->getDocumentElement(); if (root == 0) { return false; } const XMLCh* targetNSURIString = root->getAttribute(SchemaSymbols::fgATT_TARGETNAMESPACE); // check to see if targetNameSpace is right if (*targetNSURIString && !XMLString::equals(targetNSURIString,fTargetNSURIString)){ reportSchemaError(root, XMLUni::fgXMLErrDomain, XMLErrs::RedefineNamespaceDifference, schemaLocation, targetNSURIString); return false; } // if targetNamespace is empty, change it to redefin'g schema // targetNamespace if (!*targetNSURIString && root->getAttributeNode(XMLUni::fgXMLNSString) == 0 && fTargetNSURI != fEmptyNamespaceURI) { root->setAttribute(XMLUni::fgXMLNSString, fTargetNSURIString); } // -------------------------------------------------------- // Update schema information with redefined schema // -------------------------------------------------------- redefSchemaInfo = fSchemaInfo; Janitor newSchemaInfo(new (fMemoryManager) SchemaInfo(0, 0, 0, fTargetNSURI, 0, includeURL, fTargetNSURIString, root, fScanner, fGrammarPoolMemoryManager)); fSchemaInfo = newSchemaInfo.get(); fSchemaInfo->getNamespaceScope()->reset(fEmptyNamespaceURI); // Add mapping for the xml prefix fSchemaInfo->getNamespaceScope()->addPrefix(XMLUni::fgXMLString, fURIStringPool->addOrFind(XMLUni::fgXMLURIName)); traverseSchemaHeader(root); fSchemaInfoList->put((void*) fSchemaInfo->getCurrentSchemaURL(), fSchemaInfo->getTargetNSURI(), fSchemaInfo); newSchemaInfo.release(); redefSchemaInfo->addSchemaInfo(fSchemaInfo, SchemaInfo::INCLUDE); fPreprocessedNodes->put((void*) redefineElem, fSchemaInfo); } return true; } void TraverseSchema::renameRedefinedComponents(const DOMElement* const redefineElem, SchemaInfo* const redefiningSchemaInfo, SchemaInfo* const redefinedSchemaInfo) { DOMElement* child = XUtil::getFirstChildElement(redefineElem); for (; child != 0; child = XUtil::getNextSiblingElement(child)) { const XMLCh* childName = child->getLocalName(); if (XMLString::equals(childName, SchemaSymbols::fgELT_ANNOTATION)) { continue; } // if component already redefined skip const XMLCh* typeName = getElementAttValue(child, SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName); fBuffer.set(fTargetNSURIString); fBuffer.append(chComma); fBuffer.append(typeName); if (fRedefineComponents->containsKey(childName, fStringPool->addOrFind(fBuffer.getRawBuffer()))) { continue; } // Rename const XMLCh* tmpChildName = fStringPool->getValueForId(fStringPool->addOrFind(childName)); if (validateRedefineNameChange(child, tmpChildName, typeName, 1, redefiningSchemaInfo)) { fixRedefinedSchema(child, redefinedSchemaInfo, tmpChildName, typeName, 1); } else { redefiningSchemaInfo->addFailedRedefine(child); } } } bool TraverseSchema::validateRedefineNameChange(const DOMElement* const redefineChildElem, const XMLCh* const redefineChildComponentName, const XMLCh* const redefineChildTypeName, const int redefineNameCounter, SchemaInfo* const redefiningSchemaInfo) { const XMLCh* baseTypeName = 0; unsigned int typeNameId = fStringPool->addOrFind(redefineChildTypeName); fBuffer.set(fTargetNSURIString); fBuffer.append(chComma); fBuffer.append(redefineChildTypeName); int fullTypeNameId = fStringPool->addOrFind(fBuffer.getRawBuffer()); const XMLCh* typeNameStr = fStringPool->getValueForId(fullTypeNameId); restoreSchemaInfo(redefiningSchemaInfo); if (XMLString::equals(redefineChildComponentName,SchemaSymbols::fgELT_SIMPLETYPE)) { if (fDatatypeRegistry->getDatatypeValidator(typeNameStr)) { return false; } DOMElement* grandKid = XUtil::getFirstChildElement(redefineChildElem); if (grandKid && XMLString::equals(grandKid->getLocalName(), SchemaSymbols::fgELT_ANNOTATION)) { grandKid = XUtil::getNextSiblingElement(grandKid); } if (grandKid == 0) { reportSchemaError(redefineChildElem, XMLUni::fgXMLErrDomain, XMLErrs::Redefine_InvalidSimpleType); return false; } else if(!XMLString::equals(grandKid->getLocalName(), SchemaSymbols::fgELT_RESTRICTION)) { reportSchemaError(grandKid, XMLUni::fgXMLErrDomain, XMLErrs::Redefine_InvalidSimpleType); return false; } baseTypeName = getElementAttValue(grandKid, SchemaSymbols::fgATT_BASE, DatatypeValidator::QName); const XMLCh* prefix = getPrefix(baseTypeName); const XMLCh* localPart = getLocalPart(baseTypeName); const XMLCh* uriStr = resolvePrefixToURI(grandKid, prefix); if (fTargetNSURI != (int) fURIStringPool->addOrFind(uriStr) || fStringPool->addOrFind(localPart) != typeNameId) { reportSchemaError(grandKid, XMLUni::fgXMLErrDomain, XMLErrs::Redefine_InvalidSimpleTypeBase); return false; } // now we have to do the renaming... getRedefineNewTypeName(baseTypeName, redefineNameCounter, fBuffer); grandKid->setAttribute(SchemaSymbols::fgATT_BASE, fBuffer.getRawBuffer()); fRedefineComponents->put((void*) SchemaSymbols::fgELT_SIMPLETYPE, fullTypeNameId, 0); } else if (XMLString::equals(redefineChildComponentName,SchemaSymbols::fgELT_COMPLEXTYPE)) { if (fComplexTypeRegistry->containsKey(typeNameStr)) { return false; } DOMElement* grandKid = XUtil::getFirstChildElement(redefineChildElem); if (grandKid && XMLString::equals(grandKid->getLocalName(), SchemaSymbols::fgELT_ANNOTATION)) { grandKid = XUtil::getNextSiblingElement(grandKid); } if (grandKid == 0) { reportSchemaError(redefineChildElem, XMLUni::fgXMLErrDomain, XMLErrs::Redefine_InvalidComplexType); return false; } else { // have to go one more level down; let another pass worry whether complexType is valid. DOMElement* greatGrandKid = XUtil::getFirstChildElement(grandKid); if (greatGrandKid != 0 && XMLString::equals(greatGrandKid->getLocalName(), SchemaSymbols::fgELT_ANNOTATION)) { greatGrandKid = XUtil::getNextSiblingElement(greatGrandKid); } if (greatGrandKid == 0) { reportSchemaError(grandKid, XMLUni::fgXMLErrDomain, XMLErrs::Redefine_InvalidComplexType); return false; } else { const XMLCh* greatGrandKidName = greatGrandKid->getLocalName(); if (!XMLString::equals(greatGrandKidName, SchemaSymbols::fgELT_RESTRICTION) && !XMLString::equals(greatGrandKidName, SchemaSymbols::fgELT_EXTENSION)) { reportSchemaError(greatGrandKid, XMLUni::fgXMLErrDomain, XMLErrs::Redefine_InvalidComplexType); return false; } baseTypeName = getElementAttValue(greatGrandKid, SchemaSymbols::fgATT_BASE, DatatypeValidator::QName); const XMLCh* prefix = getPrefix(baseTypeName); const XMLCh* localPart = getLocalPart(baseTypeName); const XMLCh* uriStr = resolvePrefixToURI(greatGrandKid, prefix); if (fTargetNSURI != (int) fURIStringPool->addOrFind(uriStr) || fStringPool->addOrFind(localPart) != typeNameId) { reportSchemaError(greatGrandKid, XMLUni::fgXMLErrDomain, XMLErrs::Redefine_InvalidComplexTypeBase); return false; } // now we have to do the renaming... getRedefineNewTypeName(baseTypeName, redefineNameCounter, fBuffer); greatGrandKid->setAttribute(SchemaSymbols::fgATT_BASE, fBuffer.getRawBuffer()); fRedefineComponents->put((void*) SchemaSymbols::fgELT_COMPLEXTYPE, fullTypeNameId, 0); } } } else if (XMLString::equals(redefineChildComponentName, SchemaSymbols::fgELT_GROUP)) { if (fGroupRegistry->containsKey(typeNameStr)) { return false; } int groupRefCount = changeRedefineGroup(redefineChildElem, redefineChildComponentName, redefineChildTypeName, redefineNameCounter); if (groupRefCount > 1) { reportSchemaError(redefineChildElem, XMLUni::fgXMLErrDomain, XMLErrs::Redefine_GroupRefCount); return false; } else if (groupRefCount == 0) { // put a dummy value, default is null. // when processing groups, we will check that table, if a value // is found, we need to do a particle derivation check. fRedefineComponents->put((void*) SchemaSymbols::fgELT_GROUP, fullTypeNameId, fSchemaInfo->getCurrentSchemaURL()); } else { fRedefineComponents->put((void*) SchemaSymbols::fgELT_GROUP, fullTypeNameId, 0); } } else if (XMLString::equals(redefineChildComponentName, SchemaSymbols::fgELT_ATTRIBUTEGROUP)) { if (fAttGroupRegistry->containsKey(redefineChildTypeName)) { return false; } int attGroupRefCount = changeRedefineGroup(redefineChildElem, redefineChildComponentName, redefineChildTypeName, redefineNameCounter); if (attGroupRefCount > 1) { reportSchemaError(redefineChildElem, XMLUni::fgXMLErrDomain, XMLErrs::Redefine_AttGroupRefCount); return false; } else if (attGroupRefCount == 0) { // put a dummy value, default is null. // when processing attributeGroups, we will check that table, if // a value is found, we need to check for attribute derivation ok // (by restriction) fRedefineComponents->put((void*) SchemaSymbols::fgELT_ATTRIBUTEGROUP, fullTypeNameId, fSchemaInfo->getCurrentSchemaURL()); } else { fRedefineComponents->put((void*) SchemaSymbols::fgELT_ATTRIBUTEGROUP, fullTypeNameId, 0); } } else { reportSchemaError ( redefineChildElem , XMLUni::fgXMLErrDomain , XMLErrs::Redefine_InvalidChild , redefineChildComponentName ); return false; } return true; } int TraverseSchema::changeRedefineGroup(const DOMElement* const redefineChildElem, const XMLCh* const redefineChildComponentName, const XMLCh* const redefineChildTypeName, const int redefineNameCounter) { int result = 0; DOMElement* child = XUtil::getFirstChildElement(redefineChildElem); for (; child != 0; child = XUtil::getNextSiblingElement(child)) { const XMLCh* name = child->getLocalName(); if (XMLString::equals(name, SchemaSymbols::fgELT_ANNOTATION)) { continue; } if (!XMLString::equals(name, redefineChildComponentName)) { result += changeRedefineGroup(child, redefineChildComponentName, redefineChildTypeName, redefineNameCounter); } else { const XMLCh* refName = getElementAttValue(child, SchemaSymbols::fgATT_REF, DatatypeValidator::QName); if (refName && *refName) { const XMLCh* prefix = getPrefix(refName); const XMLCh* localPart = getLocalPart(refName); const XMLCh* uriStr = resolvePrefixToURI(child, prefix); if (fTargetNSURI == (int) fURIStringPool->addOrFind(uriStr) && fStringPool->addOrFind(localPart) == fStringPool->addOrFind(redefineChildTypeName)) { // now we have to do the renaming... getRedefineNewTypeName(refName, redefineNameCounter, fBuffer); child->setAttribute(SchemaSymbols::fgATT_REF, fBuffer.getRawBuffer()); result++; if(XMLString::equals(redefineChildComponentName, SchemaSymbols::fgELT_GROUP)) { const XMLCh* minOccurs = getElementAttValue(child, SchemaSymbols::fgATT_MINOCCURS, DatatypeValidator::Decimal); const XMLCh* maxOccurs = getElementAttValue(child, SchemaSymbols::fgATT_MAXOCCURS, DatatypeValidator::Decimal); if (((maxOccurs && *maxOccurs) && !XMLString::equals(maxOccurs, fgValueOne)) || ((minOccurs && *minOccurs) && !XMLString::equals(minOccurs, fgValueOne))) { reportSchemaError(child, XMLUni::fgXMLErrDomain, XMLErrs::Redefine_InvalidGroupMinMax, redefineChildTypeName); } } } } // if ref was null some other stage of processing will flag the error } } return result; } void TraverseSchema::fixRedefinedSchema(const DOMElement* const elem, SchemaInfo* const redefinedSchemaInfo, const XMLCh* const redefineChildComponentName, const XMLCh* const redefineChildTypeName, const int redefineNameCounter) { bool foundIt = false; DOMElement* child = XUtil::getFirstChildElement(redefinedSchemaInfo->getRoot()); restoreSchemaInfo(redefinedSchemaInfo); for (; child != 0; child = XUtil::getNextSiblingElement(child)) { const XMLCh* name = child->getLocalName(); if (XMLString::equals(name, redefineChildComponentName)) { const XMLCh* infoItemName = getElementAttValue(child, SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName); if(!XMLString::equals(infoItemName, redefineChildTypeName)) { continue; } else { // found it! // now we have to do the renaming... foundIt = true; getRedefineNewTypeName(infoItemName, redefineNameCounter, fBuffer); child->setAttribute(SchemaSymbols::fgATT_NAME, fBuffer.getRawBuffer()); break; } } else if (XMLString::equals(name, SchemaSymbols::fgELT_REDEFINE)) { // need to search the redefine decl... for (DOMElement* redefChild = XUtil::getFirstChildElement(child); redefChild != 0; redefChild = XUtil::getNextSiblingElement(redefChild)) { const XMLCh* redefName = redefChild->getLocalName(); if (XMLString::equals(redefName, redefineChildComponentName)) { const XMLCh* infoItemName = getElementAttValue(redefChild, SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName); if(!XMLString::equals(infoItemName, redefineChildTypeName)) { continue; } else { // found it! if (!openRedefinedSchema(child)) { redefinedSchemaInfo->addFailedRedefine(child); return; } foundIt = true; SchemaInfo* reRedefinedSchemaInfo = fSchemaInfo; if (validateRedefineNameChange(redefChild, redefineChildComponentName, redefineChildTypeName, redefineNameCounter + 1, redefinedSchemaInfo)) { fixRedefinedSchema(redefChild, reRedefinedSchemaInfo, redefineChildComponentName, redefineChildTypeName, redefineNameCounter + 1); // now we have to do the renaming... getRedefineNewTypeName(infoItemName, redefineNameCounter, fBuffer); const XMLCh* newInfoItemName = fStringPool->getValueForId(fStringPool->addOrFind(fBuffer.getRawBuffer())); redefChild->setAttribute(SchemaSymbols::fgATT_NAME, newInfoItemName); // and we now know we will traverse this, so set fRedefineComponents appropriately... fBuffer.set(fTargetNSURIString); fBuffer.append(chComma); fBuffer.append(newInfoItemName); } else { fixRedefinedSchema(redefChild, reRedefinedSchemaInfo, redefineChildComponentName, redefineChildTypeName, redefineNameCounter); redefinedSchemaInfo->addFailedRedefine(redefChild); // and we now know we will traverse this, so set fRedefineComponents appropriately... fBuffer.set(fTargetNSURIString); fBuffer.append(chComma); fBuffer.append(infoItemName); } unsigned int infoItemNameId = fStringPool->addOrFind(fBuffer.getRawBuffer()); if (!fRedefineComponents->containsKey(redefineChildComponentName, infoItemNameId)) { fRedefineComponents->put((void*) redefineChildComponentName, infoItemNameId, 0); } break; } } } //for if (foundIt) { break; } } } //for if(!foundIt) { reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::Redefine_DeclarationNotFound, redefineChildTypeName); } } bool TraverseSchema::isSubstitutionGroupCircular(SchemaElementDecl* const elemDecl, SchemaElementDecl* const subsElemDecl) { if (elemDecl == subsElemDecl) return true; SchemaElementDecl* tmpElemDecl = subsElemDecl->getSubstitutionGroupElem(); while (tmpElemDecl) { if (tmpElemDecl == elemDecl) return true; tmpElemDecl = tmpElemDecl->getSubstitutionGroupElem(); } return false; } // --------------------------------------------------------------------------- // TraverseSchema: Error reporting methods // --------------------------------------------------------------------------- void TraverseSchema::reportSchemaError(const XSDLocator* const aLocator, const XMLCh* const msgDomain, const int errorCode) { fXSDErrorReporter.emitError(errorCode, msgDomain, aLocator); } void TraverseSchema::reportSchemaError(const XSDLocator* const aLocator, const XMLCh* const msgDomain, const int errorCode, const XMLCh* const text1, const XMLCh* const text2, const XMLCh* const text3, const XMLCh* const text4) { fXSDErrorReporter.emitError(errorCode, msgDomain, aLocator, text1, text2, text3, text4, fMemoryManager); } void TraverseSchema::reportSchemaError(const DOMElement* const elem, const XMLCh* const msgDomain, const int errorCode) { fLocator->setValues(fSchemaInfo->getCurrentSchemaURL(), 0, ((XSDElementNSImpl*) elem)->getLineNo(), ((XSDElementNSImpl*) elem)->getColumnNo()); fXSDErrorReporter.emitError(errorCode, msgDomain, fLocator); } void TraverseSchema::reportSchemaError(const DOMElement* const elem, const XMLCh* const msgDomain, const int errorCode, const XMLCh* const text1, const XMLCh* const text2, const XMLCh* const text3, const XMLCh* const text4) { fLocator->setValues(fSchemaInfo->getCurrentSchemaURL(), 0, ((XSDElementNSImpl*) elem)->getLineNo(), ((XSDElementNSImpl*) elem)->getColumnNo()); fXSDErrorReporter.emitError(errorCode, msgDomain, fLocator, text1, text2, text3, text4, fMemoryManager); } void TraverseSchema::reportSchemaError(const DOMElement* const elem, const XMLException& except) { fLocator->setValues(fSchemaInfo->getCurrentSchemaURL(), 0, ((XSDElementNSImpl*) elem)->getLineNo(), ((XSDElementNSImpl*) elem)->getColumnNo()); fXSDErrorReporter.emitError(except, fLocator); } // --------------------------------------------------------------------------- // TraverseSchema: Init/CleanUp methods // --------------------------------------------------------------------------- void TraverseSchema::init() { fXSDErrorReporter.setErrorReporter(fErrorReporter); fXSDErrorReporter.setExitOnFirstFatal(fScanner->getExitOnFirstFatal()); fFullConstraintChecking = fScanner->getValidationSchemaFullChecking(); fDatatypeRegistry = fSchemaGrammar->getDatatypeRegistry(); fStringPool = fGrammarResolver->getStringPool(); fEmptyNamespaceURI = fScanner->getEmptyNamespaceId(); fCurrentTypeNameStack = new (fMemoryManager) ValueVectorOf(8, fMemoryManager); fCurrentGroupStack = new (fMemoryManager) ValueVectorOf(8, fMemoryManager); fGlobalDeclarations = (ValueVectorOf**) fMemoryManager->allocate ( ENUM_ELT_SIZE * sizeof(ValueVectorOf*) );//new ValueVectorOf*[ENUM_ELT_SIZE]; memset(fGlobalDeclarations, 0, ENUM_ELT_SIZE * sizeof(ValueVectorOf*)); for(unsigned int i=0; i < ENUM_ELT_SIZE; i++) fGlobalDeclarations[i] = new (fMemoryManager) ValueVectorOf(8, fMemoryManager); fNonXSAttList = new (fMemoryManager) ValueVectorOf(4, fMemoryManager); fNotationRegistry = new (fMemoryManager) RefHash2KeysTableOf(13, (bool) false, fMemoryManager); fPreprocessedNodes = new (fMemoryManager) RefHashTableOf ( 29 , false , fMemoryManager ); fLocator = new (fMemoryManager) XSDLocator(); fDeclStack = new (fMemoryManager) ValueVectorOf(16, fMemoryManager); } void TraverseSchema::cleanUp() { delete fCurrentTypeNameStack; delete fCurrentGroupStack; if (fGlobalDeclarations) { for(unsigned int i=0; i < ENUM_ELT_SIZE; i++) delete fGlobalDeclarations[i]; fMemoryManager->deallocate(fGlobalDeclarations);//delete [] fGlobalDeclarations; } delete fNonXSAttList; delete fImportedNSList; delete fNotationRegistry; delete fRedefineComponents; delete fIdentityConstraintNames; delete fDeclStack; delete fIC_ElementsNS; delete fIC_NodeListNS; delete fPreprocessedNodes; delete fLocator; delete fParser; } void TraverseSchema::processElemDeclAttrs(const DOMElement* const elem, SchemaElementDecl* const elemDecl, const XMLCh*& valueConstraint, bool isTopLevel) { int elementMiscFlags = 0; const XMLCh* fixedVal = getElementAttValue(elem, SchemaSymbols::fgATT_FIXED); const XMLCh* nillable = getElementAttValue(elem, SchemaSymbols::fgATT_NILLABLE, DatatypeValidator::Boolean); // check constraint value valueConstraint = getElementAttValue(elem, SchemaSymbols::fgATT_DEFAULT); if (fixedVal) { elementMiscFlags |= SchemaSymbols::XSD_FIXED; // if both default and fixed, emit an error if (valueConstraint) reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::ElementWithFixedAndDefault, getElementAttValue(elem, SchemaSymbols::fgATT_NAME, DatatypeValidator::NCName)); // set constraint value to the fixed one valueConstraint = fixedVal; } // check nillable if (nillable && *nillable) { if (XMLString::equals(nillable, SchemaSymbols::fgATTVAL_TRUE) || XMLString::equals(nillable, fgValueOne)) { elementMiscFlags |= SchemaSymbols::XSD_NILLABLE; } } if (isTopLevel) { const XMLCh* bAbstract = getElementAttValue(elem, SchemaSymbols::fgATT_ABSTRACT, DatatypeValidator::Boolean); if (bAbstract && *bAbstract) { if (XMLString::equals(bAbstract, SchemaSymbols::fgATTVAL_TRUE) || XMLString::equals(bAbstract, fgValueOne)) { elementMiscFlags |= SchemaSymbols::XSD_ABSTRACT; } } elemDecl->setFinalSet(parseFinalSet(elem, EC_Final)); } elemDecl->setBlockSet(parseBlockSet(elem, ES_Block)); elemDecl->setMiscFlags(elementMiscFlags); } void TraverseSchema::processElemDeclIC(DOMElement* const icElem, SchemaElementDecl* const elemDecl) { // key/keyref/unique processing ValueVectorOf* icNodes = 0; DOMElement* ic = icElem; while (ic != 0) { if (XMLString::equals(ic->getLocalName(), SchemaSymbols::fgELT_KEY)) { traverseKey(ic, elemDecl); } else if (XMLString::equals(ic->getLocalName(), SchemaSymbols::fgELT_UNIQUE)) { traverseUnique(ic, elemDecl); } else { if (!icNodes) { icNodes = new (fGrammarPoolMemoryManager) ValueVectorOf(8, fGrammarPoolMemoryManager); } icNodes->addElement(ic); } ic = XUtil::getNextSiblingElementNS( ic, fgIdentityConstraints, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, 3); } if (icNodes) { if (!fIC_ElementsNS) { fIC_ElementsNS = new (fMemoryManager) RefHashTableOf(13, fMemoryManager); fIC_NodeListNS = new (fMemoryManager) RefHashTableOf, PtrHasher>(29, true, fMemoryManager); } fIC_Elements = fIC_ElementsNS->get(fTargetNSURIString); if (!fIC_Elements) { fIC_Elements = new (fMemoryManager) ValueVectorOf(8, fMemoryManager); fIC_ElementsNS->put((void*) fTargetNSURIString, fIC_Elements); } fIC_NodeListNS->put(elemDecl, icNodes); fIC_Elements->addElement(elemDecl); } } bool TraverseSchema::checkElemDeclValueConstraint(const DOMElement* const elem, SchemaElementDecl* const elemDecl, const XMLCh* const valConstraint, ComplexTypeInfo* const typeInfo, DatatypeValidator* const validator) { bool isValid = false; if (validator) { if (validator->getType() == DatatypeValidator::ID) reportSchemaError( elem, XMLUni::fgXMLErrDomain, XMLErrs::ElemIDValueConstraint , elemDecl->getBaseName(), valConstraint ); try { const XMLCh* valueToCheck = valConstraint; short wsFacet = validator->getWSFacet(); if((wsFacet == DatatypeValidator::REPLACE && !XMLString::isWSReplaced(valueToCheck)) || (wsFacet == DatatypeValidator::COLLAPSE && !XMLString::isWSCollapsed(valueToCheck))) { XMLCh* normalizedValue=XMLString::replicate(valueToCheck, fMemoryManager); ArrayJanitor tempURIName(normalizedValue, fMemoryManager); if(wsFacet == DatatypeValidator::REPLACE) XMLString::replaceWS(normalizedValue, fMemoryManager); else if(wsFacet == DatatypeValidator::COLLAPSE) XMLString::collapseWS(normalizedValue, fMemoryManager); valueToCheck=fStringPool->getValueForId(fStringPool->addOrFind(normalizedValue)); } validator->validate(valueToCheck,0,fMemoryManager); XMLCh* canonical = (XMLCh*) validator->getCanonicalRepresentation(valueToCheck, fMemoryManager); ArrayJanitor tempCanonical(canonical, fMemoryManager); if(!XMLString::equals(canonical, valueToCheck)) { validator->validate(canonical, 0, fMemoryManager); valueToCheck=fStringPool->getValueForId(fStringPool->addOrFind(canonical)); } elemDecl->setDefaultValue(valueToCheck); isValid = true; } catch(const XMLException& excep) { reportSchemaError(elem, excep); } catch(const OutOfMemoryException&) { throw; } catch(...) { reportSchemaError(elem, XMLUni::fgValidityDomain, XMLValid::DatatypeValidationFailure, valConstraint); } } if (typeInfo) { int contentSpecType = typeInfo->getContentType(); if (contentSpecType != SchemaElementDecl::Simple && contentSpecType != SchemaElementDecl::Mixed_Simple && contentSpecType != SchemaElementDecl::Mixed_Complex) reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::NotSimpleOrMixedElement, elemDecl->getBaseName()); if (((contentSpecType == SchemaElementDecl::Mixed_Complex || contentSpecType == SchemaElementDecl::Mixed_Simple) && !emptiableParticle(typeInfo->getContentSpec()))) reportSchemaError(elem, XMLUni::fgXMLErrDomain, XMLErrs::EmptiableMixedContent, elemDecl->getBaseName()); } return isValid; } void TraverseSchema::processSubstitutionGroup(const DOMElement* const elem, SchemaElementDecl* const elemDecl, ComplexTypeInfo*& typeInfo, DatatypeValidator*& validator, const XMLCh* const subsElemQName) { NamespaceScopeManager nsMgr(elem, fSchemaInfo, this); SchemaElementDecl* subsElemDecl = getGlobalElemDecl(elem, subsElemQName); if (subsElemDecl) { if (isSubstitutionGroupCircular(elemDecl, subsElemDecl)) { reportSchemaError( elem , XMLUni::fgXMLErrDomain , XMLErrs::CircularSubsGroup, elemDecl->getBaseName()); } else { // Check for substitution validity constraint // Substitution allowed (block and blockDefault) && same type if (isSubstitutionGroupValid(elem, subsElemDecl, typeInfo, validator, elemDecl->getBaseName())) { elemDecl->setSubstitutionGroupElem(subsElemDecl); // if type information is missing, use subsGroup one if (!typeInfo && !validator) { typeInfo = subsElemDecl->getComplexTypeInfo(); validator = subsElemDecl->getDatatypeValidator(); if (validator) { elemDecl->setDatatypeValidator(validator); elemDecl->setModelType(SchemaElementDecl::Simple); } else if (typeInfo) { elemDecl->setComplexTypeInfo(typeInfo); elemDecl->setModelType((SchemaElementDecl::ModelTypes)typeInfo->getContentType()); } } XMLCh* subsElemBaseName = subsElemDecl->getBaseName(); int subsElemURI = subsElemDecl->getURI(); ValueVectorOf* subsElements = fValidSubstitutionGroups->get(subsElemBaseName, subsElemURI); if (!subsElements && fTargetNSURI != subsElemURI) { SchemaGrammar* aGrammar = (SchemaGrammar*) fGrammarResolver->getGrammar(fURIStringPool->getValueForId(subsElemURI)); if (aGrammar) { subsElements = aGrammar->getValidSubstitutionGroups()->get(subsElemBaseName, subsElemURI); if (subsElements) { subsElements = new (fGrammarPoolMemoryManager) ValueVectorOf(*subsElements); fValidSubstitutionGroups->put(subsElemBaseName, subsElemURI, subsElements); } else if (fSchemaInfo->circularImportExist(subsElemURI)) { aGrammar->getValidSubstitutionGroups()->put( subsElemBaseName, subsElemURI, new (fGrammarPoolMemoryManager) ValueVectorOf(8, fGrammarPoolMemoryManager)); } } } if (!subsElements) { subsElements = new (fGrammarPoolMemoryManager) ValueVectorOf(8, fGrammarPoolMemoryManager); fValidSubstitutionGroups->put(subsElemBaseName, subsElemURI, subsElements); } subsElements->addElement(elemDecl); // update related subs. info in case of circular import BaseRefVectorEnumerator importingEnum = fSchemaInfo->getImportingListEnumerator(); while (importingEnum.hasMoreElements()) { const SchemaInfo& curRef = importingEnum.nextElement(); SchemaGrammar* aGrammar = (SchemaGrammar*) fGrammarResolver->getGrammar(curRef.getTargetNSURIString()); ValueVectorOf* subsElemList = aGrammar->getValidSubstitutionGroups()->get(subsElemBaseName, subsElemURI); if (subsElemList && !subsElemList->containsElement(elemDecl)) subsElemList->addElement(elemDecl); } buildValidSubstitutionListB(elem, elemDecl, subsElemDecl); buildValidSubstitutionListF(elem, elemDecl, subsElemDecl); } } } } void TraverseSchema::processAttValue(const XMLCh* const attVal, XMLBuffer& aBuf) { // REVISIT-KN: assuming that attVal is not NULL // // normally, nothing will happen const XMLCh* srcVal = attVal; XMLCh nextCh = *srcVal; while (nextCh) { if (nextCh <= chCloseAngle) { switch (nextCh) { case chDoubleQuote: aBuf.append(chAmpersand); aBuf.append(XMLUni::fgQuot); aBuf.append(chSemiColon); break; case chSingleQuote: aBuf.append(chAmpersand); aBuf.append(XMLUni::fgApos); aBuf.append(chSemiColon); break; case chCloseAngle: aBuf.append(chAmpersand); aBuf.append(XMLUni::fgGT); aBuf.append(chSemiColon); break; case chOpenAngle: aBuf.append(chAmpersand); aBuf.append(XMLUni::fgLT); aBuf.append(chSemiColon); break; case chAmpersand: aBuf.append(chAmpersand); aBuf.append(XMLUni::fgAmp); aBuf.append(chSemiColon); break; default: aBuf.append(nextCh); break; } // end switch } else aBuf.append(nextCh); nextCh = *++srcVal; } } XSAnnotation* TraverseSchema::generateSyntheticAnnotation(const DOMElement* const elem , ValueVectorOf* nonXSAttList) { const XMLCh* prefix = elem->getPrefix(); ValueHashTableOf* listOfURIs = new (fMemoryManager) ValueHashTableOf(29, fMemoryManager); bool sawXMLNS = false; fBuffer.reset(); fBuffer.append(chOpenAngle); if (prefix) { fBuffer.append(prefix); fBuffer.append(chColon); } fBuffer.append(SchemaSymbols::fgELT_ANNOTATION); // next is the nonXSAttList names & values XMLSize_t nonXSAttSize = nonXSAttList->size(); for (XMLSize_t i=0; ielementAt(i); fBuffer.append(chSpace); fBuffer.append(attNode->getNodeName()); fBuffer.append(chEqual); fBuffer.append(chDoubleQuote); processAttValue(attNode->getNodeValue(), fBuffer); fBuffer.append(chDoubleQuote); } // next is the namespaces on the elem DOMElement* currentElem = (DOMElement*) elem; DOMNamedNodeMap* eltAttrs; XMLSize_t attrCount; do { eltAttrs = currentElem->getAttributes(); attrCount = eltAttrs->getLength(); for (XMLSize_t j = 0; j < attrCount; j++) { DOMNode* attribute = eltAttrs->item(j); const XMLCh* attName = attribute->getNodeName(); if (XMLString::startsWith(attName, XMLUni::fgXMLNSColonString)) { if (!listOfURIs->containsKey((void*) attName)) { listOfURIs->put((void*) attName, 0); fBuffer.append(chSpace); fBuffer.append(attName); fBuffer.append(chEqual); fBuffer.append(chDoubleQuote); processAttValue(attribute->getNodeValue(), fBuffer); fBuffer.append(chDoubleQuote); } } else if (!sawXMLNS && XMLString::equals(attName, XMLUni::fgXMLNSString)) { fBuffer.append(chSpace); fBuffer.append(attName); fBuffer.append(chEqual); fBuffer.append(chDoubleQuote); processAttValue(attribute->getNodeValue(), fBuffer); fBuffer.append(chDoubleQuote); sawXMLNS = true; } } currentElem = (DOMElement*) currentElem->getParentNode(); } while (currentElem != fSchemaInfo->getRoot()->getParentNode()); delete listOfURIs; fBuffer.append(chCloseAngle); fBuffer.append(chLF); fBuffer.append(chOpenAngle); if (prefix) { fBuffer.append(prefix); fBuffer.append(chColon); } fBuffer.append(SchemaSymbols::fgELT_DOCUMENTATION); fBuffer.append(chCloseAngle); fBuffer.append(fgSynthetic_Annotation); fBuffer.append(chOpenAngle); fBuffer.append(chForwardSlash); if (prefix) { fBuffer.append(prefix); fBuffer.append(chColon); } fBuffer.append(SchemaSymbols::fgELT_DOCUMENTATION); fBuffer.append(chCloseAngle); fBuffer.append(chLF); fBuffer.append(chOpenAngle); fBuffer.append(chForwardSlash); if (prefix) { fBuffer.append(prefix); fBuffer.append(chColon); } fBuffer.append(SchemaSymbols::fgELT_ANNOTATION); fBuffer.append(chCloseAngle); XSAnnotation* annot = new (fGrammarPoolMemoryManager) XSAnnotation(fBuffer.getRawBuffer(), fGrammarPoolMemoryManager); annot->setLineCol( ((XSDElementNSImpl*)elem)->getLineNo() , ((XSDElementNSImpl*)elem)->getColumnNo() ); annot->setSystemId(fSchemaInfo->getCurrentSchemaURL()); return annot; } class AnnotationErrorReporter : public XMLErrorReporter { public: AnnotationErrorReporter(XMLErrorReporter* chainedErrorReporter) { fErrorReporter = chainedErrorReporter; setSystemIdAndPosition(NULL, 0, 0); } void setSystemIdAndPosition(const XMLCh* systemId, XMLFileLoc line, XMLFileLoc column) { fSystemId=systemId; fLine=line; fColumn=column; } virtual void error ( const unsigned int errCode , const XMLCh* const errDomain , const ErrTypes type , const XMLCh* const errorText , const XMLCh* const /*systemId*/ , const XMLCh* const publicId , const XMLFileLoc lineNum , const XMLFileLoc colNum ) { if(fErrorReporter) fErrorReporter->error(errCode, errDomain, type, errorText, fSystemId, publicId, fLine+lineNum-1, lineNum==1?fColumn+colNum:colNum); } virtual void resetErrors() {} protected: XMLErrorReporter* fErrorReporter; const XMLCh* fSystemId; XMLFileLoc fLine, fColumn; }; void TraverseSchema::validateAnnotations() { MemoryManager *memMgr = fMemoryManager; RefHashTableOfEnumerator xsAnnotationEnum = RefHashTableOfEnumerator (fSchemaGrammar->getAnnotations(), false, memMgr); XSAnnotation& xsAnnot = xsAnnotationEnum.nextElement(); XSAnnotation* nextAnnot; // create schema grammar SchemaGrammar *grammar = new (memMgr) SchemaGrammar(memMgr); grammar->setComplexTypeRegistry(new (memMgr) RefHashTableOf(29, memMgr)); grammar->setGroupInfoRegistry(new (memMgr) RefHashTableOf(13, memMgr)); grammar->setAttGroupInfoRegistry(new (memMgr) RefHashTableOf(13, memMgr)); grammar->setAttributeDeclRegistry(new (memMgr) RefHashTableOf(29, memMgr)); grammar->setValidSubstitutionGroups(new (memMgr) RefHash2KeysTableOf(29, memMgr)); grammar->setTargetNamespace(SchemaSymbols::fgURI_SCHEMAFORSCHEMA); XMLSchemaDescription* gramDesc = (XMLSchemaDescription*) grammar->getGrammarDescription(); gramDesc->setTargetNamespace(SchemaSymbols::fgURI_SCHEMAFORSCHEMA); // setup components of annotation grammar SchemaElementDecl* annotElemDecl = new (memMgr) SchemaElementDecl ( XMLUni::fgZeroLenString , SchemaSymbols::fgELT_ANNOTATION , fURIStringPool->addOrFind(SchemaSymbols::fgURI_SCHEMAFORSCHEMA) , SchemaElementDecl::Mixed_Complex, Grammar::TOP_LEVEL_SCOPE , memMgr ); annotElemDecl->setCreateReason(XMLElementDecl::Declared); grammar->putElemDecl(annotElemDecl); ComplexTypeInfo* complexType = new (memMgr) ComplexTypeInfo(memMgr); complexType->setAnonymous(); complexType->setContentType(SchemaElementDecl::Mixed_Complex); annotElemDecl->setComplexTypeInfo(complexType); fBuffer.set(SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuffer.append(chComma); fBuffer.append(chLatin_C); fBuffer.append(chDigit_0); const XMLCh* fullName = fStringPool->getValueForId(fStringPool->addOrFind(fBuffer.getRawBuffer())); grammar->getComplexTypeRegistry()->put((void*) fullName, complexType); complexType->setTypeName(fullName); complexType->setAttWildCard ( new (memMgr) SchemaAttDef ( XMLUni::fgZeroLenString, XMLUni::fgZeroLenString, fEmptyNamespaceURI, XMLAttDef::Any_Any, XMLAttDef::ProcessContents_Lax, memMgr ) ); SchemaElementDecl* appInfoElemDecl = new (memMgr) SchemaElementDecl ( XMLUni::fgZeroLenString , SchemaSymbols::fgELT_APPINFO , fURIStringPool->addOrFind(SchemaSymbols::fgURI_SCHEMAFORSCHEMA) , SchemaElementDecl::Any, Grammar::TOP_LEVEL_SCOPE , memMgr ); appInfoElemDecl->setCreateReason(XMLElementDecl::Declared); appInfoElemDecl->setAttWildCard ( new (memMgr) SchemaAttDef ( XMLUni::fgZeroLenString, XMLUni::fgZeroLenString, fEmptyNamespaceURI, XMLAttDef::Any_Any, XMLAttDef::ProcessContents_Lax, memMgr ) ); grammar->putElemDecl(appInfoElemDecl); complexType->addElement(appInfoElemDecl); SchemaElementDecl* docElemDecl = new (memMgr) SchemaElementDecl ( XMLUni::fgZeroLenString , SchemaSymbols::fgELT_DOCUMENTATION , fURIStringPool->addOrFind(SchemaSymbols::fgURI_SCHEMAFORSCHEMA) , SchemaElementDecl::Any, Grammar::TOP_LEVEL_SCOPE , memMgr ); docElemDecl->setCreateReason(XMLElementDecl::Declared); docElemDecl->setAttWildCard ( new (memMgr) SchemaAttDef ( XMLUni::fgZeroLenString, XMLUni::fgZeroLenString, fEmptyNamespaceURI, XMLAttDef::Any_Any, XMLAttDef::ProcessContents_Lax, memMgr ) ); grammar->putElemDecl(docElemDecl); complexType->addElement(docElemDecl); ContentSpecNode* left = new (memMgr) ContentSpecNode(appInfoElemDecl, memMgr); ContentSpecNode* right = new (memMgr) ContentSpecNode(docElemDecl, memMgr); ContentSpecNode* root = new (memMgr) ContentSpecNode(ContentSpecNode::ModelGroupChoice , left , right , true , true , memMgr); root->setMinOccurs(0); root->setMaxOccurs(SchemaSymbols::XSD_UNBOUNDED); complexType->setContentSpec(root); // create input source to scan MemBufInputSource* memBufIS = new (memMgr) MemBufInputSource ( (const XMLByte*)xsAnnot.getAnnotationString() , XMLString::stringLen(xsAnnot.getAnnotationString())*sizeof(XMLCh) , SchemaSymbols::fgELT_ANNOTATION , false , memMgr ); Janitor janMemBuf(memBufIS); memBufIS->setEncoding(XMLUni::fgXMLChEncodingString); memBufIS->setCopyBufToStream(false); XSAXMLScanner *scanner = new (memMgr) XSAXMLScanner ( fGrammarResolver, fURIStringPool, grammar, memMgr ); Janitor janScanner(scanner); AnnotationErrorReporter annErrReporter(fErrorReporter); scanner->setErrorReporter(&annErrReporter); XMLFileLoc line, col; xsAnnot.getLineCol(line, col); annErrReporter.setSystemIdAndPosition(xsAnnot.getSystemId(), line, col); scanner->scanDocument(*memBufIS); nextAnnot = xsAnnot.getNext(); while (nextAnnot || xsAnnotationEnum.hasMoreElements()) { if (nextAnnot) { memBufIS->resetMemBufInputSource((const XMLByte*)nextAnnot->getAnnotationString() , XMLString::stringLen(nextAnnot->getAnnotationString())*sizeof(XMLCh)); nextAnnot->getLineCol(line, col); annErrReporter.setSystemIdAndPosition(nextAnnot->getSystemId(), line, col); nextAnnot = nextAnnot->getNext(); } else { XSAnnotation& xsAnnot = xsAnnotationEnum.nextElement(); memBufIS->resetMemBufInputSource((const XMLByte*)xsAnnot.getAnnotationString() , XMLString::stringLen(xsAnnot.getAnnotationString())*sizeof(XMLCh)); xsAnnot.getLineCol(line, col); annErrReporter.setSystemIdAndPosition(xsAnnot.getSystemId(), line, col); nextAnnot = xsAnnot.getNext(); } scanner->scanDocument(*memBufIS); } } const XMLCh* TraverseSchema::getElementAttValue(const DOMElement* const elem, const XMLCh* const attName, const DatatypeValidator::ValidatorType attType /* = UnKnown */) { DOMAttr* attNode = elem->getAttributeNode(attName); if (attNode == 0) { return 0; } const XMLCh* attValue = attNode->getValue(); if (attType < DatatypeValidator::ID) { static bool bInitialized = false; static short wsFacets[DatatypeValidator::ID] = {0}; if(!bInitialized) { bInitialized=true; DVHashTable* registry = DatatypeValidatorFactory::getBuiltInRegistry(); wsFacets[DatatypeValidator::String] = registry->get(SchemaSymbols::fgDT_STRING)->getWSFacet(); wsFacets[DatatypeValidator::AnyURI] = registry->get(SchemaSymbols::fgDT_ANYURI)->getWSFacet(); wsFacets[DatatypeValidator::QName] = registry->get(SchemaSymbols::fgDT_QNAME)->getWSFacet(); wsFacets[DatatypeValidator::Name] = registry->get(SchemaSymbols::fgDT_NAME)->getWSFacet(); wsFacets[DatatypeValidator::NCName] = registry->get(SchemaSymbols::fgDT_NCNAME)->getWSFacet(); wsFacets[DatatypeValidator::Boolean] = registry->get(SchemaSymbols::fgDT_BOOLEAN)->getWSFacet(); wsFacets[DatatypeValidator::Float] = registry->get(SchemaSymbols::fgDT_FLOAT)->getWSFacet(); wsFacets[DatatypeValidator::Double] = registry->get(SchemaSymbols::fgDT_DOUBLE)->getWSFacet(); wsFacets[DatatypeValidator::Decimal] = registry->get(SchemaSymbols::fgDT_DECIMAL)->getWSFacet(); wsFacets[DatatypeValidator::HexBinary] = registry->get(SchemaSymbols::fgDT_HEXBINARY)->getWSFacet(); wsFacets[DatatypeValidator::Base64Binary]= registry->get(SchemaSymbols::fgDT_BASE64BINARY)->getWSFacet(); wsFacets[DatatypeValidator::Duration] = registry->get(SchemaSymbols::fgDT_DURATION)->getWSFacet(); wsFacets[DatatypeValidator::DateTime] = registry->get(SchemaSymbols::fgDT_DATETIME)->getWSFacet(); wsFacets[DatatypeValidator::Date] = registry->get(SchemaSymbols::fgDT_DATE)->getWSFacet(); wsFacets[DatatypeValidator::Time] = registry->get(SchemaSymbols::fgDT_TIME)->getWSFacet(); wsFacets[DatatypeValidator::MonthDay] = registry->get(SchemaSymbols::fgDT_MONTHDAY)->getWSFacet(); wsFacets[DatatypeValidator::YearMonth] = registry->get(SchemaSymbols::fgDT_YEARMONTH)->getWSFacet(); wsFacets[DatatypeValidator::Year] = registry->get(SchemaSymbols::fgDT_YEAR)->getWSFacet(); wsFacets[DatatypeValidator::Month] = registry->get(SchemaSymbols::fgDT_MONTH)->getWSFacet(); wsFacets[DatatypeValidator::Day] = registry->get(SchemaSymbols::fgDT_DAY)->getWSFacet(); } short wsFacet = wsFacets[attType]; if((wsFacet == DatatypeValidator::REPLACE && !XMLString::isWSReplaced(attValue)) || (wsFacet == DatatypeValidator::COLLAPSE && !XMLString::isWSCollapsed(attValue))) { XMLCh* normalizedValue=XMLString::replicate(attValue, fMemoryManager); ArrayJanitor tempName(normalizedValue, fMemoryManager); if(wsFacet == DatatypeValidator::REPLACE) XMLString::replaceWS(normalizedValue, fMemoryManager); else if(wsFacet == DatatypeValidator::COLLAPSE) XMLString::collapseWS(normalizedValue, fMemoryManager); if (!*normalizedValue) return XMLUni::fgZeroLenString; return fStringPool->getValueForId(fStringPool->addOrFind(normalizedValue)); } } return attValue; } XERCES_CPP_NAMESPACE_END /** * End of file TraverseSchema.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/SchemaElementDecl.hpp000644 000765 000024 00000032713 13241160332 025712 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SchemaElementDecl.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_SCHEMAELEMENTDECL_HPP) #define XERCESC_INCLUDE_GUARD_SCHEMAELEMENTDECL_HPP #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class ContentSpecNode; class SchemaAttDefList; // // This class is a derivative of the basic element decl. This one implements // the virtuals so that they work for a Schema. // class VALIDATORS_EXPORT SchemaElementDecl : public XMLElementDecl { public : // ----------------------------------------------------------------------- // Class specific types // // ModelTypes // Indicates the type of content model that an element has. This // indicates how the content model is represented and validated. // ----------------------------------------------------------------------- enum ModelTypes { Empty , Any , Mixed_Simple , Mixed_Complex , Children , Simple , ElementOnlyEmpty , ModelTypes_Count }; // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- SchemaElementDecl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); SchemaElementDecl ( const XMLCh* const prefix , const XMLCh* const localPart , const int uriId , const ModelTypes modelType = Any , const unsigned int enclosingScope = Grammar::TOP_LEVEL_SCOPE , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); SchemaElementDecl ( const QName* const elementName , const ModelTypes modelType = Any , const unsigned int enclosingScope = Grammar::TOP_LEVEL_SCOPE , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~SchemaElementDecl(); // ----------------------------------------------------------------------- // The virtual element decl interface // ----------------------------------------------------------------------- virtual XMLAttDefList& getAttDefList() const; virtual CharDataOpts getCharDataOpts() const; virtual bool hasAttDefs() const; virtual const ContentSpecNode* getContentSpec() const; virtual ContentSpecNode* getContentSpec(); virtual void setContentSpec(ContentSpecNode* toAdopt); virtual XMLContentModel* getContentModel(); virtual void setContentModel(XMLContentModel* const newModelToAdopt); virtual const XMLCh* getFormattedContentModel () const; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- const SchemaAttDef* getAttDef(const XMLCh* const baseName, const int uriId) const; SchemaAttDef* getAttDef(const XMLCh* const baseName, const int uriId); const SchemaAttDef* getAttWildCard() const; SchemaAttDef* getAttWildCard(); ModelTypes getModelType() const; PSVIDefs::PSVIScope getPSVIScope() const; DatatypeValidator* getDatatypeValidator() const; unsigned int getEnclosingScope() const; int getFinalSet() const; int getBlockSet() const; int getMiscFlags() const; XMLCh* getDefaultValue() const; ComplexTypeInfo* getComplexTypeInfo() const; virtual bool isGlobalDecl() const; SchemaElementDecl* getSubstitutionGroupElem() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setModelType(const SchemaElementDecl::ModelTypes toSet); void setPSVIScope(const PSVIDefs::PSVIScope toSet); void setDatatypeValidator(DatatypeValidator* newDatatypeValidator); void setEnclosingScope(const unsigned int enclosingScope); void setFinalSet(const int finalSet); void setBlockSet(const int blockSet); void setMiscFlags(const int flags); void setDefaultValue(const XMLCh* const value); void setComplexTypeInfo(ComplexTypeInfo* const typeInfo); void setAttWildCard(SchemaAttDef* const attWildCard); void setSubstitutionGroupElem(SchemaElementDecl* const elemDecl); // ----------------------------------------------------------------------- // IC methods // ----------------------------------------------------------------------- void addIdentityConstraint(IdentityConstraint* const ic); XMLSize_t getIdentityConstraintCount() const; IdentityConstraint* getIdentityConstraintAt(XMLSize_t index) const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(SchemaElementDecl) virtual XMLElementDecl::objectType getObjectType() const; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- SchemaElementDecl(const SchemaElementDecl&); SchemaElementDecl& operator=(const SchemaElementDecl&); // ----------------------------------------------------------------------- // Private data members // // fModelType // The content model type of this element. This tells us what kind // of content model to create. // // fDatatypeValidator // The DatatypeValidator used to validate this element type. // // fEnclosingScope // The enclosing scope where this element is declared. // // fFinalSet // The value set of the 'final' attribute. // // fBlockSet // The value set of the 'block' attribute. // // fMiscFlags // Stores 'abstract/nullable' values // // fDefaultValue // The default/fixed value // // fComplexTypeInfo // Stores complex type information // (no need to delete - handled by schema grammar) // // fAttDefs // The list of attributes that are faulted in for this element // when ComplexTypeInfo does not exist. We want to keep track // of these faulted in attributes to avoid duplicate redundant // error. // // fIdentityConstraints // Store information about an element identity constraints. // // fAttWildCard // Store wildcard attribute in the case of an element with a type of // 'anyType'. // // fSubstitutionGroupElem // The substitution group element declaration. // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- ModelTypes fModelType; PSVIDefs::PSVIScope fPSVIScope; unsigned int fEnclosingScope; int fFinalSet; int fBlockSet; int fMiscFlags; XMLCh* fDefaultValue; ComplexTypeInfo* fComplexTypeInfo; RefHash2KeysTableOf* fAttDefs; RefVectorOf* fIdentityConstraints; SchemaAttDef* fAttWildCard; SchemaElementDecl* fSubstitutionGroupElem; DatatypeValidator* fDatatypeValidator; }; // --------------------------------------------------------------------------- // SchemaElementDecl: XMLElementDecl virtual interface implementation // --------------------------------------------------------------------------- inline ContentSpecNode* SchemaElementDecl::getContentSpec() { if (fComplexTypeInfo != 0) { return fComplexTypeInfo->getContentSpec(); } return 0; } inline const ContentSpecNode* SchemaElementDecl::getContentSpec() const { if (fComplexTypeInfo != 0) { return fComplexTypeInfo->getContentSpec(); } return 0; } inline void SchemaElementDecl::setContentSpec(ContentSpecNode*) { //Handled by complexType } inline XMLContentModel* SchemaElementDecl::getContentModel() { if (fComplexTypeInfo != 0) { return fComplexTypeInfo->getContentModel(); } return 0; } inline void SchemaElementDecl::setContentModel(XMLContentModel* const) { //Handled by complexType } // --------------------------------------------------------------------------- // SchemaElementDecl: Getter methods // --------------------------------------------------------------------------- inline SchemaElementDecl::ModelTypes SchemaElementDecl::getModelType() const { if (fComplexTypeInfo) { return (SchemaElementDecl::ModelTypes) fComplexTypeInfo->getContentType(); } return fModelType; } inline PSVIDefs::PSVIScope SchemaElementDecl::getPSVIScope() const { return fPSVIScope; } inline DatatypeValidator* SchemaElementDecl::getDatatypeValidator() const { return fDatatypeValidator; } inline unsigned int SchemaElementDecl::getEnclosingScope() const { return fEnclosingScope; } inline int SchemaElementDecl::getFinalSet() const { return fFinalSet; } inline int SchemaElementDecl::getBlockSet() const { return fBlockSet; } inline int SchemaElementDecl::getMiscFlags() const { return fMiscFlags; } inline XMLCh* SchemaElementDecl::getDefaultValue() const { return fDefaultValue; } inline ComplexTypeInfo* SchemaElementDecl::getComplexTypeInfo() const { return fComplexTypeInfo; } inline const SchemaAttDef* SchemaElementDecl::getAttWildCard() const { return fAttWildCard; } inline SchemaAttDef* SchemaElementDecl::getAttWildCard() { return fAttWildCard; } inline bool SchemaElementDecl::isGlobalDecl() const { return (fEnclosingScope == Grammar::TOP_LEVEL_SCOPE); } inline SchemaElementDecl* SchemaElementDecl::getSubstitutionGroupElem() const { return fSubstitutionGroupElem; } // --------------------------------------------------------------------------- // SchemaElementDecl: Setter methods // --------------------------------------------------------------------------- inline void SchemaElementDecl::setModelType(const SchemaElementDecl::ModelTypes toSet) { fModelType = toSet; } inline void SchemaElementDecl::setPSVIScope(const PSVIDefs::PSVIScope toSet) { fPSVIScope = toSet; } inline void SchemaElementDecl::setDatatypeValidator(DatatypeValidator* newDatatypeValidator) { fDatatypeValidator = newDatatypeValidator; } inline void SchemaElementDecl::setEnclosingScope(const unsigned int newEnclosingScope) { fEnclosingScope = newEnclosingScope; } inline void SchemaElementDecl::setFinalSet(const int finalSet) { fFinalSet = finalSet; } inline void SchemaElementDecl::setBlockSet(const int blockSet) { fBlockSet = blockSet; } inline void SchemaElementDecl::setMiscFlags(const int flags) { fMiscFlags = flags; } inline void SchemaElementDecl::setDefaultValue(const XMLCh* const value) { if (fDefaultValue) { getMemoryManager()->deallocate(fDefaultValue);//delete[] fDefaultValue; } fDefaultValue = XMLString::replicate(value, getMemoryManager()); } inline void SchemaElementDecl::setComplexTypeInfo(ComplexTypeInfo* const typeInfo) { fComplexTypeInfo = typeInfo; } inline void SchemaElementDecl::setAttWildCard(SchemaAttDef* const attWildCard) { if (fAttWildCard) delete fAttWildCard; fAttWildCard = attWildCard; } inline void SchemaElementDecl::setSubstitutionGroupElem(SchemaElementDecl* const elemDecl) { fSubstitutionGroupElem = elemDecl; } // --------------------------------------------------------------------------- // SchemaElementDecl: IC methods // --------------------------------------------------------------------------- inline void SchemaElementDecl::addIdentityConstraint(IdentityConstraint* const ic) { if (!fIdentityConstraints) { fIdentityConstraints = new (getMemoryManager()) RefVectorOf(16, true, getMemoryManager()); } fIdentityConstraints->addElement(ic); } inline XMLSize_t SchemaElementDecl::getIdentityConstraintCount() const { if (fIdentityConstraints) { return fIdentityConstraints->size(); } return 0; } inline IdentityConstraint* SchemaElementDecl::getIdentityConstraintAt(XMLSize_t index) const { if (fIdentityConstraints) { return fIdentityConstraints->elementAt(index); } return 0; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/schema/XSDDOMParser.hpp000644 000765 000024 00000030156 13241160332 024562 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSDDOMParser.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSDDOMPARSER_HPP) #define XERCESC_INCLUDE_GUARD_XSDDOMPARSER_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMElement; class XMLValidator; /** * This class is used to parse schema documents into DOM trees */ class PARSERS_EXPORT XSDDOMParser : public XercesDOMParser { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ /** Construct a XSDDOMParser, with an optional validator * * Constructor with an instance of validator class to use for * validation. If you don't provide a validator, a default one will * be created for you in the scanner. * * @param gramPool Pointer to the grammar pool instance from * external application. * The parser does NOT own it. * * @param valToAdopt Pointer to the validator instance to use. The * parser is responsible for freeing the memory. */ XSDDOMParser ( XMLValidator* const valToAdopt = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager , XMLGrammarPool* const gramPool = 0 ); /** * Destructor */ ~XSDDOMParser(); //@} // ----------------------------------------------------------------------- // Implementation of the XMLDocumentHandler interface. // ----------------------------------------------------------------------- /** @name Implementation of the XMLDocumentHandler interface. */ //@{ /** Handle a start element event * * This method is used to report the start of an element. It is * called at the end of the element, by which time all attributes * specified are also parsed. A new DOM Element node is created * along with as many attribute nodes as required. This new element * is added appended as a child of the current node in the tree, and * then replaces it as the current node (if the isEmpty flag is false.) * * @param elemDecl A const reference to the object containing element * declaration information. * @param urlId An id referring to the namespace prefix, if * namespaces setting is switched on. * @param elemPrefix A const pointer to a Unicode string containing * the namespace prefix for this element. Applicable * only when namespace processing is enabled. * @param attrList A const reference to the object containing the * list of attributes just scanned for this element. * @param attrCount A count of number of attributes in the list * specified by the parameter 'attrList'. * @param isEmpty A flag indicating whether this is an empty element * or not. If empty, then no endElement() call will * be made. * @param isRoot A flag indicating whether this element was the * root element. * @see DocumentHandler#startElement */ virtual void startElement ( const XMLElementDecl& elemDecl , const unsigned int urlId , const XMLCh* const elemPrefix , const RefVectorOf& attrList , const XMLSize_t attrCount , const bool isEmpty , const bool isRoot ); /** Handle and end of element event * * This method is used to indicate the end tag of an element. The * DOM parser pops the current element off the top of the element * stack, and make it the new current element. * * @param elemDecl A const reference to the object containing element * declaration information. * @param urlId An id referring to the namespace prefix, if * namespaces setting is switched on. * @param isRoot A flag indicating whether this element was the * root element. * @param elemPrefix A const pointer to a Unicode string containing * the namespace prefix for this element. Applicable * only when namespace processing is enabled. */ virtual void endElement ( const XMLElementDecl& elemDecl , const unsigned int urlId , const bool isRoot , const XMLCh* const elemPrefix ); /** Handle document character events * * This method is used to report all the characters scanned by the * parser. This DOM implementation stores this data in the appropriate * DOM node, creating one if necessary. * * @param chars A const pointer to a Unicode string representing the * character data. * @param length The length of the Unicode string returned in 'chars'. * @param cdataSection A flag indicating if the characters represent * content from the CDATA section. */ virtual void docCharacters ( const XMLCh* const chars , const XMLSize_t length , const bool cdataSection ); /** Handle a document comment event * * This method is used to report any comments scanned by the parser. * A new comment node is created which stores this data. * * @param comment A const pointer to a null terminated Unicode * string representing the comment text. */ virtual void docComment ( const XMLCh* const comment ); /** Handle a start entity reference event * * This method is used to indicate the start of an entity reference. * If the expand entity reference flag is true, then a new * DOM Entity reference node is created. * * @param entDecl A const reference to the object containing the * entity declaration information. */ virtual void startEntityReference ( const XMLEntityDecl& entDecl ); /** Handle and end of entity reference event * * This method is used to indicate that an end of an entity reference * was just scanned. * * @param entDecl A const reference to the object containing the * entity declaration information. */ virtual void endEntityReference ( const XMLEntityDecl& entDecl ); /** Handle an ignorable whitespace vent * * This method is used to report all the whitespace characters, which * are determined to be 'ignorable'. This distinction between characters * is only made, if validation is enabled. * * Any whitespace before content is ignored. If the current node is * already of type DOMNode::TEXT_NODE, then these whitespaces are * appended, otherwise a new Text node is created which stores this * data. Essentially all contiguous ignorable characters are collected * in one node. * * @param chars A const pointer to a Unicode string representing the * ignorable whitespace character data. * @param length The length of the Unicode string 'chars'. * @param cdataSection A flag indicating if the characters represent * content from the CDATA section. */ virtual void ignorableWhitespace ( const XMLCh* const chars , const XMLSize_t length , const bool cdataSection ); //@} // ----------------------------------------------------------------------- // Get methods // ----------------------------------------------------------------------- bool getSawFatal() const; // ----------------------------------------------------------------------- // Set methods // ----------------------------------------------------------------------- void setUserErrorReporter(XMLErrorReporter* const errorReporter); void setUserEntityHandler(XMLEntityHandler* const entityHandler); // ----------------------------------------------------------------------- // XMLErrorReporter interface // ----------------------------------------------------------------------- virtual void error ( const unsigned int errCode , const XMLCh* const errDomain , const ErrTypes type , const XMLCh* const errorText , const XMLCh* const systemId , const XMLCh* const publicId , const XMLFileLoc lineNum , const XMLFileLoc colNum ); // ----------------------------------------------------------------------- // XMLEntityHandler interface // ----------------------------------------------------------------------- virtual InputSource* resolveEntity(XMLResourceIdentifier* resourceIdentifier); protected : // ----------------------------------------------------------------------- // Protected Helper methods // ----------------------------------------------------------------------- virtual DOMElement* createElementNSNode(const XMLCh *fNamespaceURI, const XMLCh *qualifiedName); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSDDOMParser(const XSDDOMParser&); XSDDOMParser& operator=(const XSDDOMParser&); // ----------------------------------------------------------------------- // Private Helper methods // ----------------------------------------------------------------------- void startAnnotation ( const XMLElementDecl& elemDecl , const RefVectorOf& attrList , const XMLSize_t attrCount ); void startAnnotationElement ( const XMLElementDecl& elemDecl , const RefVectorOf& attrList , const XMLSize_t attrCount ); void endAnnotationElement ( const XMLElementDecl& elemDecl , bool complete ); // ----------------------------------------------------------------------- // Private data members // ----------------------------------------------------------------------- bool fSawFatal; int fAnnotationDepth; int fInnerAnnotationDepth; int fDepth; XMLErrorReporter* fUserErrorReporter; XMLEntityHandler* fUserEntityHandler; ValueVectorOf* fURIs; XMLBuffer fAnnotationBuf; XSDErrorReporter fXSDErrorReporter; XSDLocator fXSLocator; }; inline bool XSDDOMParser::getSawFatal() const { return fSawFatal; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/schema/SchemaAttDef.hpp000644 000765 000024 00000020302 13241160332 024667 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SchemaAttDef.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_SCHEMAATTDEF_HPP) #define XERCESC_INCLUDE_GUARD_SCHEMAATTDEF_HPP #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class DatatypeValidator; class QName; class ComplexTypeInfo; // // This class is a derivative of the core XMLAttDef class. This class adds // any Schema specific data members and provides Schema specific implementations // of any underlying attribute def virtual methods. // class VALIDATORS_EXPORT SchemaAttDef : public XMLAttDef { public : // ----------------------------------------------------------------------- // Constructors and Destructors // ----------------------------------------------------------------------- SchemaAttDef(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); SchemaAttDef ( const XMLCh* const prefix , const XMLCh* const localPart , const int uriId , const XMLAttDef::AttTypes type = CData , const XMLAttDef::DefAttTypes defType = Implied , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); SchemaAttDef ( const XMLCh* const prefix , const XMLCh* const localPart , const int uriId , const XMLCh* const attValue , const XMLAttDef::AttTypes type , const XMLAttDef::DefAttTypes defType , const XMLCh* const enumValues = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); SchemaAttDef ( const SchemaAttDef* other ); virtual ~SchemaAttDef(); // ----------------------------------------------------------------------- // Implementation of the XMLAttDef interface // ----------------------------------------------------------------------- virtual const XMLCh* getFullName() const; virtual void reset(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- XMLSize_t getElemId() const; QName* getAttName() const; DatatypeValidator* getDatatypeValidator() const; ValueVectorOf* getNamespaceList() const; const SchemaAttDef* getBaseAttDecl() const; SchemaAttDef* getBaseAttDecl(); PSVIDefs::PSVIScope getPSVIScope() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setElemId(const XMLSize_t newId); void setAttName ( const XMLCh* const prefix ,const XMLCh* const localPart ,const int uriId = -1 ); void setDatatypeValidator(DatatypeValidator* newDatatypeValidator); void setBaseAttDecl(SchemaAttDef* const attDef); void setPSVIScope(const PSVIDefs::PSVIScope toSet); void setNamespaceList(const ValueVectorOf* const toSet); void resetNamespaceList(); void setEnclosingCT(ComplexTypeInfo* complexTypeInfo); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(SchemaAttDef) private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- SchemaAttDef(const SchemaAttDef&); SchemaAttDef& operator=(const SchemaAttDef&); // ----------------------------------------------------------------------- // Private data members // // fElemId // This is the id of the element (the id is into the element decl // pool) of the element this attribute def said it belonged to. // This is used later to link back to the element, mostly for // validation purposes. // // fAttName // This is the name of the attribute. // // fDatatypeValidator // The DatatypeValidator used to validate this attribute type. // // fNamespaceList // The list of namespace values for a wildcard attribute // // fBaseAttDecl // The base attribute declaration that this attribute is based on // NOTE: we do not have a notion of attribute use, so in the case // of ref'd attributes and inherited attributes, we make a copy // of the actual attribute declaration. The fBaseAttDecl stores that // declaration, and will be helpful when we build the XSModel (i.e // easy access the XSAnnotation object). // ----------------------------------------------------------------------- XMLSize_t fElemId; PSVIDefs::PSVIScope fPSVIScope; QName* fAttName; DatatypeValidator* fDatatypeValidator; ValueVectorOf* fNamespaceList; SchemaAttDef* fBaseAttDecl; }; // --------------------------------------------------------------------------- // SchemaAttDef: Getter methods // --------------------------------------------------------------------------- inline XMLSize_t SchemaAttDef::getElemId() const { return fElemId; } inline QName* SchemaAttDef::getAttName() const { return fAttName; } inline DatatypeValidator* SchemaAttDef::getDatatypeValidator() const { return fDatatypeValidator; } inline ValueVectorOf* SchemaAttDef::getNamespaceList() const { return fNamespaceList; } inline SchemaAttDef* SchemaAttDef::getBaseAttDecl() { return fBaseAttDecl; } inline const SchemaAttDef* SchemaAttDef::getBaseAttDecl() const { return fBaseAttDecl; } inline PSVIDefs::PSVIScope SchemaAttDef::getPSVIScope() const { return fPSVIScope; } // --------------------------------------------------------------------------- // SchemaAttDef: Setter methods // --------------------------------------------------------------------------- inline void SchemaAttDef::setElemId(const XMLSize_t newId) { fElemId = newId; } inline void SchemaAttDef::setDatatypeValidator(DatatypeValidator* newDatatypeValidator) { fDatatypeValidator = newDatatypeValidator; } inline void SchemaAttDef::resetNamespaceList() { if (fNamespaceList && fNamespaceList->size()) { fNamespaceList->removeAllElements(); } } inline void SchemaAttDef::setNamespaceList(const ValueVectorOf* const toSet) { if (toSet && toSet->size()) { if (fNamespaceList) { *fNamespaceList = *toSet; } else { fNamespaceList = new (getMemoryManager()) ValueVectorOf(*toSet); } } else { resetNamespaceList(); } } inline void SchemaAttDef::reset() { } inline void SchemaAttDef::setEnclosingCT(ComplexTypeInfo*) { } inline void SchemaAttDef::setBaseAttDecl(SchemaAttDef* const attDef) { fBaseAttDecl = attDef; } inline void SchemaAttDef::setPSVIScope(const PSVIDefs::PSVIScope toSet) { fPSVIScope = toSet; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/schema/XUtil.hpp000644 000765 000024 00000004721 13241160332 023453 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XUtil.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XUTIL_HPP) #define XERCESC_INCLUDE_GUARD_XUTIL_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMNode; class DOMElement; /** * Some useful utility methods. */ class VALIDATORS_EXPORT XUtil { public: // Finds and returns the first child element node. static DOMElement* getFirstChildElement(const DOMNode* const parent); // Finds and returns the first child node with the given qualifiedname. static DOMElement* getFirstChildElementNS(const DOMNode* const parent , const XMLCh** const elemNames , const XMLCh* const uriStr , unsigned int length); // Finds and returns the next sibling element node. static DOMElement* getNextSiblingElement(const DOMNode* const node); static DOMElement* getNextSiblingElementNS(const DOMNode* const node , const XMLCh** const elemNames , const XMLCh* const uriStr , unsigned int length); private: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- // This class cannot be instantiated. XUtil() {}; ~XUtil() {}; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/schema/XSDErrorReporter.hpp000644 000765 000024 00000010305 13241160332 025574 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSDErrorReporter.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSDERRORREPORTER_HPP) #define XERCESC_INCLUDE_GUARD_XSDERRORREPORTER_HPP #include XERCES_CPP_NAMESPACE_BEGIN class Locator; class XMLErrorReporter; /** * This class reports schema errors */ class VALIDATORS_EXPORT XSDErrorReporter : public XMemory { public: // ----------------------------------------------------------------------- // Constructors are hidden, only the virtual destructor is exposed // ----------------------------------------------------------------------- XSDErrorReporter(XMLErrorReporter* const errorReporter = 0); virtual ~XSDErrorReporter() { } // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- bool getExitOnFirstFatal() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setErrorReporter(XMLErrorReporter* const errorReporter); void setExitOnFirstFatal(const bool newValue); // ----------------------------------------------------------------------- // Report error methods // ----------------------------------------------------------------------- void emitError(const unsigned int toEmit, const XMLCh* const msgDomain, const Locator* const aLocator); void emitError(const unsigned int toEmit, const XMLCh* const msgDomain, const Locator* const aLocator, const XMLCh* const text1, const XMLCh* const text2 = 0, const XMLCh* const text3 = 0, const XMLCh* const text4 = 0, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); void emitError(const XMLException& except, const Locator* const aLocator); private: // ----------------------------------------------------------------------- // Unimplemented constructors and destructor // ----------------------------------------------------------------------- XSDErrorReporter(const XSDErrorReporter&); XSDErrorReporter& operator=(const XSDErrorReporter&); // ----------------------------------------------------------------------- // Private data members // ----------------------------------------------------------------------- bool fExitOnFirstFatal; XMLErrorReporter* fErrorReporter; }; // --------------------------------------------------------------------------- // XSDErrorReporter: Getter methods // --------------------------------------------------------------------------- inline bool XSDErrorReporter::getExitOnFirstFatal() const { return fExitOnFirstFatal; } // --------------------------------------------------------------------------- // XSDErrorReporter: Setter methods // --------------------------------------------------------------------------- inline void XSDErrorReporter::setExitOnFirstFatal(const bool newValue) { fExitOnFirstFatal = newValue; } inline void XSDErrorReporter::setErrorReporter(XMLErrorReporter* const errorReporter) { fErrorReporter = errorReporter; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/schema/XSDLocator.cpp000644 000765 000024 00000003662 13241160332 024366 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSDLocator.cpp 672273 2008-06-27 13:57:00Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSDLocator: Constructors and Destructor // --------------------------------------------------------------------------- XSDLocator::XSDLocator() : fLineNo(0) , fColumnNo(0) , fSystemId(0) , fPublicId(0) { } // --------------------------------------------------------------------------- // XSDLocator: Setter methods // --------------------------------------------------------------------------- void XSDLocator::setValues(const XMLCh* const systemId, const XMLCh* const publicId, const XMLFileLoc lineNo, const XMLFileLoc columnNo) { fLineNo = lineNo; fColumnNo = columnNo; fSystemId = systemId; fPublicId = publicId; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/validators/schema/NamespaceScope.hpp000644 000765 000024 00000013657 13241160332 025304 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: NamespaceScope.hpp 1801095 2017-07-06 19:04:47Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_NAMESPACESCOPE_HPP) #define XERCESC_INCLUDE_GUARD_NAMESPACESCOPE_HPP #include XERCES_CPP_NAMESPACE_BEGIN // Define a pure interface to allow XercesXPath to work on both NamespaceScope and DOMXPathNSResolver class VALIDATORS_EXPORT XercesNamespaceResolver { public: virtual unsigned int getNamespaceForPrefix(const XMLCh* const prefix) const = 0; }; // // NamespaceScope provides a data structure for mapping namespace prefixes // to their URI's. The mapping accurately reflects the scoping of namespaces // at a particular instant in time. // class VALIDATORS_EXPORT NamespaceScope : public XMemory, public XercesNamespaceResolver { public : // ----------------------------------------------------------------------- // Class specific data types // // These really should be private, but some of the compilers we have to // support are too dumb to deal with that. // // PrefMapElem // fURIId is the id of the URI from the validator's URI map. The // fPrefId is the id of the prefix from our own prefix pool. The // namespace stack consists of these elements. // // StackElem // The fMapCapacity is how large fMap has grown so far. fMapCount // is how many of them are valid right now. // ----------------------------------------------------------------------- struct PrefMapElem : public XMemory { unsigned int fPrefId; unsigned int fURIId; }; struct StackElem : public XMemory { PrefMapElem* fMap; unsigned int fMapCapacity; unsigned int fMapCount; }; // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- NamespaceScope(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); NamespaceScope(const NamespaceScope* const initialize, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); virtual ~NamespaceScope(); // ----------------------------------------------------------------------- // Stack access // ----------------------------------------------------------------------- unsigned int increaseDepth(); unsigned int decreaseDepth(); // ----------------------------------------------------------------------- // Prefix map methods // ----------------------------------------------------------------------- void addPrefix(const XMLCh* const prefixToAdd, const unsigned int uriId); virtual unsigned int getNamespaceForPrefix(const XMLCh* const prefixToMap) const; // ----------------------------------------------------------------------- // Miscellaneous methods // ----------------------------------------------------------------------- bool isEmpty() const; void reset(const unsigned int emptyId); unsigned int getEmptyNamespaceId() const; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- NamespaceScope(const NamespaceScope&); NamespaceScope& operator=(const NamespaceScope&); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void expandMap(StackElem* const toExpand); void expandStack(); // ----------------------------------------------------------------------- // Data members // // fEmptyNamespaceId // This is the special URI id for the "" namespace, which is magic // because of the xmlns="" operation. // // fPrefixPool // This is the prefix pool where prefixes are hashed and given unique // ids. These ids are used to track prefixes in the element stack. // // fStack // fStackCapacity // fStackTop // This the stack array. Its an array of pointers to StackElem // structures. The capacity is the current high water mark of the // stack. The top is the current top of stack (i.e. the part of it // being used.) // ----------------------------------------------------------------------- unsigned int fEmptyNamespaceId; unsigned int fStackCapacity; unsigned int fStackTop; XMLStringPool fPrefixPool; StackElem** fStack; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // NamespaceScope: Miscellaneous methods // --------------------------------------------------------------------------- inline bool NamespaceScope::isEmpty() const { return (fStackTop == 0); } inline unsigned int NamespaceScope::getEmptyNamespaceId() const { return fEmptyNamespaceId; } XERCES_CPP_NAMESPACE_END #endif /** * End of file NameSpaceScope.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/ComplexTypeInfo.cpp000644 000765 000024 00000073021 13241160332 025465 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ComplexTypeInfo.cpp 901107 2010-01-20 08:45:02Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // ComplexTypeInfo: Static member data // --------------------------------------------------------------------------- ComplexTypeInfo* ComplexTypeInfo::fAnyType = 0; void XMLInitializer::initializeComplexTypeInfo() { // create type name XMLCh typeName[128]; XMLSize_t nsLen = XMLString::stringLen(SchemaSymbols::fgURI_SCHEMAFORSCHEMA); XMLString::copyString(typeName, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); typeName[nsLen] = chComma; XMLString::copyString(typeName + nsLen + 1, SchemaSymbols::fgATTVAL_ANYTYPE); // Create and initialize 'anyType' ComplexTypeInfo::fAnyType = new ComplexTypeInfo(); ContentSpecNode* term = new ContentSpecNode ( new QName ( XMLUni::fgZeroLenString , XMLUni::fgZeroLenString , 1 ) , false ); term->setType(ContentSpecNode::Any_Lax); term->setMinOccurs(0); term->setMaxOccurs(SchemaSymbols::XSD_UNBOUNDED); ContentSpecNode* particle = new ContentSpecNode ( ContentSpecNode::ModelGroupSequence , term , 0 ); SchemaAttDef* attWildCard = new SchemaAttDef ( XMLUni::fgZeroLenString , XMLUni::fgZeroLenString , 1 , XMLAttDef::Any_Any , XMLAttDef::ProcessContents_Lax ); ComplexTypeInfo::fAnyType->setTypeName(typeName); ComplexTypeInfo::fAnyType->setBaseComplexTypeInfo(ComplexTypeInfo::fAnyType); ComplexTypeInfo::fAnyType->setDerivedBy(SchemaSymbols::XSD_RESTRICTION); ComplexTypeInfo::fAnyType->setContentType(SchemaElementDecl::Mixed_Complex); ComplexTypeInfo::fAnyType->setContentSpec(particle); ComplexTypeInfo::fAnyType->setAttWildCard(attWildCard); } void XMLInitializer::terminateComplexTypeInfo() { delete ComplexTypeInfo::fAnyType; ComplexTypeInfo::fAnyType = 0; } ComplexTypeInfo* ComplexTypeInfo::getAnyType(unsigned int /*emptyNSId*/) { return fAnyType; } // --------------------------------------------------------------------------- // ComplexTypeInfo: Constructors and Destructor // --------------------------------------------------------------------------- ComplexTypeInfo::ComplexTypeInfo(MemoryManager* const manager) : fAnonymous(false) , fAbstract(false) , fAdoptContentSpec(true) , fAttWithTypeId(false) , fPreprocessed(false) , fDerivedBy(0) , fBlockSet(0) , fFinalSet(0) , fScopeDefined(Grammar::TOP_LEVEL_SCOPE) , fContentType(SchemaElementDecl::Empty) , fElementId(XMLElementDecl::fgInvalidElemId) , fUniqueURI(0) , fContentSpecOrgURISize(16) , fTypeName(0) , fTypeLocalName(0) , fTypeUri(0) , fBaseDatatypeValidator(0) , fDatatypeValidator(0) , fBaseComplexTypeInfo(0) , fContentSpec(0) , fAttWildCard(0) , fAttList(0) , fElements(0) , fAttDefs(0) , fContentModel(0) , fFormattedModel(0) , fContentSpecOrgURI(0) , fLocator(0) , fMemoryManager(manager) { fAttDefs = new (fMemoryManager) RefHash2KeysTableOf(29, true, fMemoryManager); fAttList = new (fMemoryManager) SchemaAttDefList(fAttDefs,fMemoryManager); } ComplexTypeInfo::~ComplexTypeInfo() { fMemoryManager->deallocate(fTypeName); //delete [] fTypeName; fMemoryManager->deallocate(fTypeLocalName); //delete [] fTypeLocalName; fMemoryManager->deallocate(fTypeUri); //delete [] fTypeUri; if (fAdoptContentSpec) { delete fContentSpec; } delete fAttWildCard; delete fAttDefs; delete fAttList; delete fElements; delete fLocator; delete fContentModel; fMemoryManager->deallocate(fFormattedModel); //delete [] fFormattedModel; fMemoryManager->deallocate(fContentSpecOrgURI); //delete [] fContentSpecOrgURI; } // --------------------------------------------------------------------------- // ComplexTypeInfo: Setter methods // --------------------------------------------------------------------------- void ComplexTypeInfo::addAttDef(SchemaAttDef* const toAdd) { // Tell this guy the element id of its parent (us) toAdd->setElemId(getElementId()); fAttDefs->put((void*)(toAdd->getAttName()->getLocalPart()), toAdd->getAttName()->getURI(), toAdd); // update and/or create fAttList fAttList->addAttDef(toAdd); } void ComplexTypeInfo::setContentSpec(ContentSpecNode* const toAdopt) { if (fContentSpec && fAdoptContentSpec) { delete fContentSpec; } fContentSpec = toAdopt; } void ComplexTypeInfo::setLocator(XSDLocator* const aLocator) { if (fLocator) delete fLocator; fLocator = aLocator; } // --------------------------------------------------------------------------- // ComplexTypeInfo: Getter methods // --------------------------------------------------------------------------- XMLAttDefList& ComplexTypeInfo::getAttDefList() const { // NOTE: if users plan on using nextElement() to access attributes // they need to call Reset() explicitly (i.e attList.Reset()). // It's better to get the attribute count and use an index to // access attributes (especially if same grammar is used in // multiple threads). return *fAttList; } const XMLCh* ComplexTypeInfo::getFormattedContentModel() const { // // If its not already built, then call the protected virtual method // to allow the derived class to build it (since only it knows.) // Otherwise, just return the previously formatted methods. // // Since we are faulting this in, within a const getter, we have to // cast off the const-ness. // if (!fFormattedModel) ((ComplexTypeInfo*)this)->fFormattedModel = formatContentModel(); return fFormattedModel; } // --------------------------------------------------------------------------- // ComplexTypeInfo: Helper methods // --------------------------------------------------------------------------- void ComplexTypeInfo::checkUniqueParticleAttribution (SchemaGrammar* const pGrammar, GrammarResolver* const pGrammarResolver, XMLStringPool* const pStringPool, XMLValidator* const pValidator) { if (fContentSpec && !fContentModel) { fContentModel = makeContentModel(true); if (fContentModel) { fContentModel->checkUniqueParticleAttribution(pGrammar, pGrammarResolver, pStringPool, pValidator, fContentSpecOrgURI, fTypeLocalName); } } } // --------------------------------------------------------------------------- // ComplexTypeInfo: Private Helper methods // --------------------------------------------------------------------------- void ComplexTypeInfo::faultInAttDefList() const { // Use a hash modulus of 29 and tell it owns its elements ((ComplexTypeInfo*)this)->fAttDefs = new (fMemoryManager) RefHash2KeysTableOf(29, true, fMemoryManager); } XMLCh* ComplexTypeInfo::formatContentModel() const { XMLCh* newValue = 0; if (fContentType == SchemaElementDecl::Any) { newValue = XMLString::replicate(XMLUni::fgAnyString, fMemoryManager); } else if (fContentType == SchemaElementDecl::Empty || fContentType == SchemaElementDecl::ElementOnlyEmpty) { newValue = XMLString::replicate(XMLUni::fgEmptyString, fMemoryManager); } else { // // Use a temp XML buffer to format into. Content models could be // pretty long, but very few will be longer than one K. The buffer // will expand to handle the more pathological ones. // const ContentSpecNode* specNode = fContentSpec; if (specNode) { XMLBuffer bufFmt(1023, fMemoryManager); specNode->formatSpec(bufFmt); newValue = XMLString::replicate ( bufFmt.getRawBuffer() , fMemoryManager ); } } return newValue; } bool ComplexTypeInfo::useRepeatingLeafNodes(ContentSpecNode* particle) { int maxOccurs = particle->getMaxOccurs(); int minOccurs = particle->getMinOccurs(); ContentSpecNode::NodeTypes type = particle->getType(); if (((type & 0x0f) == ContentSpecNode::Choice) || ((type & 0x0f) == ContentSpecNode::Sequence)) { if (minOccurs != 1 || maxOccurs != 1) { if(particle->getFirst()!=0 && particle->getSecond()==0) { ContentSpecNode* particle2 = particle->getFirst(); ContentSpecNode::NodeTypes type2 = particle2->getType(); return (((type2 == ContentSpecNode::Leaf) || ((type2 & 0x0f) == ContentSpecNode::Any) || ((type2 & 0x0f) == ContentSpecNode::Any_Other) || ((type2 & 0x0f) == ContentSpecNode::Any_NS)) && particle2->getMinOccurs() == 1 && particle2->getMaxOccurs() == 1); } return (particle->getFirst()==0 && particle->getSecond()==0); } if(particle->getFirst()!=0 && !useRepeatingLeafNodes(particle->getFirst())) return false; if(particle->getSecond()!=0 && !useRepeatingLeafNodes(particle->getSecond())) return false; } return true; } XMLContentModel* ComplexTypeInfo::makeContentModel(bool checkUPA) { ContentSpecNode* aSpecNode = new (fMemoryManager) ContentSpecNode(*fContentSpec); if (checkUPA) { fContentSpecOrgURI = (unsigned int*) fMemoryManager->allocate ( fContentSpecOrgURISize * sizeof(unsigned int) ); //new unsigned int[fContentSpecOrgURISize]; } aSpecNode = convertContentSpecTree(aSpecNode, checkUPA, useRepeatingLeafNodes(aSpecNode)); Janitor janSpecNode(aSpecNode); XMLContentModel* cmRet = 0; if (fContentType == SchemaElementDecl::Simple || fContentType == SchemaElementDecl::ElementOnlyEmpty) { // just return nothing } else if (fContentType == SchemaElementDecl::Mixed_Simple) { // // Just create a mixel content model object. This type of // content model is optimized for mixed content validation. // cmRet = new (fMemoryManager) MixedContentModel(false, aSpecNode, false, fMemoryManager); } else if (fContentType == SchemaElementDecl::Mixed_Complex || fContentType == SchemaElementDecl::Children) { bool isMixed = (fContentType == SchemaElementDecl::Mixed_Complex); // // This method will create an optimal model for the complexity // of the element's defined model. If its simple, it will create // a SimpleContentModel object. If its a simple list, it will // create a SimpleListContentModel object. If its complex, it // will create a DFAContentModel object. // if(!aSpecNode) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_UnknownCMSpecType, fMemoryManager); ContentSpecNode::NodeTypes specType = aSpecNode->getType(); // // Do a sanity check that the node is does not have a PCDATA id. Since, // if it was, it should have already gotten taken by the Mixed model. // if (aSpecNode->getElement() && aSpecNode->getElement()->getURI() == XMLElementDecl::fgPCDataElemId) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_NoPCDATAHere, fMemoryManager); // // According to the type of node, we will create the correct type of // content model. // if (((specType & 0x0f) == ContentSpecNode::Any) || ((specType & 0x0f) == ContentSpecNode::Any_Other) || ((specType & 0x0f) == ContentSpecNode::Any_NS) || specType == ContentSpecNode::Loop) { // let fall through to build a DFAContentModel } else if (isMixed) { if (specType == ContentSpecNode::All) { // All the nodes under an ALL must be additional ALL nodes and // ELEMENTs (or ELEMENTs under ZERO_OR_ONE nodes.) // We collapse the ELEMENTs into a single vector. cmRet = new (fMemoryManager) AllContentModel(aSpecNode, true, fMemoryManager); } else if (specType == ContentSpecNode::ZeroOrOne) { // An ALL node can appear under a ZERO_OR_ONE node. if (aSpecNode->getFirst()->getType() == ContentSpecNode::All) { cmRet = new (fMemoryManager) AllContentModel(aSpecNode->getFirst(), true, fMemoryManager); } } // otherwise, let fall through to build a DFAContentModel } else if (specType == ContentSpecNode::Leaf) { // Create a simple content model cmRet = new (fMemoryManager) SimpleContentModel ( false , aSpecNode->getElement() , 0 , ContentSpecNode::Leaf , fMemoryManager ); } else if (((specType & 0x0f) == ContentSpecNode::Choice) || ((specType & 0x0f) == ContentSpecNode::Sequence)) { // // Lets see if both of the children are leafs. If so, then it has to // be a simple content model // if ((aSpecNode->getFirst()->getType() == ContentSpecNode::Leaf) && (aSpecNode->getSecond()) && (aSpecNode->getSecond()->getType() == ContentSpecNode::Leaf)) { cmRet = new (fMemoryManager) SimpleContentModel ( false , aSpecNode->getFirst()->getElement() , aSpecNode->getSecond()->getElement() , specType , fMemoryManager ); } } else if ((specType == ContentSpecNode::OneOrMore) || (specType == ContentSpecNode::ZeroOrMore) || (specType == ContentSpecNode::ZeroOrOne)) { // // Its a repetition, so see if its one child is a leaf. If so its a // repetition of a single element, so we can do a simple content // model for that. // if (aSpecNode->getFirst()->getType() == ContentSpecNode::Leaf) { cmRet = new (fMemoryManager) SimpleContentModel ( false , aSpecNode->getFirst()->getElement() , 0 , specType , fMemoryManager ); } else if (aSpecNode->getFirst()->getType() == ContentSpecNode::All) cmRet = new (fMemoryManager) AllContentModel(aSpecNode->getFirst(), false, fMemoryManager); } else if (specType == ContentSpecNode::All) cmRet = new (fMemoryManager) AllContentModel(aSpecNode, false, fMemoryManager); else { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_UnknownCMSpecType, fMemoryManager); } // Its not any simple type of content, so create a DFA based content model if(cmRet==0) cmRet = new (fMemoryManager) DFAContentModel(false, aSpecNode, isMixed, fMemoryManager); } else { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_MustBeMixedOrChildren, fMemoryManager); } return cmRet; } // --------------------------------------------------------------------------- // SchemaElementDecl: Private helper methods // --------------------------------------------------------------------------- ContentSpecNode* ComplexTypeInfo::convertContentSpecTree(ContentSpecNode* const curNode, bool checkUPA, bool bAllowCompactSyntax) { if (!curNode) return 0; const ContentSpecNode::NodeTypes curType = curNode->getType(); // When checking Unique Particle Attribution, rename leaf elements if (checkUPA) { if (curNode->getElement()) { if (fUniqueURI == fContentSpecOrgURISize) { resizeContentSpecOrgURI(); } fContentSpecOrgURI[fUniqueURI] = curNode->getElement()->getURI(); curNode->getElement()->setURI(fUniqueURI); fUniqueURI++; } } // Get the spec type of the passed node int minOccurs = curNode->getMinOccurs(); int maxOccurs = curNode->getMaxOccurs(); ContentSpecNode* retNode = curNode; if ((curType & 0x0f) == ContentSpecNode::Any || (curType & 0x0f) == ContentSpecNode::Any_Other || (curType & 0x0f) == ContentSpecNode::Any_NS || curType == ContentSpecNode::Leaf) { retNode = expandContentModel(curNode, minOccurs, maxOccurs, bAllowCompactSyntax); } else if (((curType & 0x0f) == ContentSpecNode::Choice) || (curType == ContentSpecNode::All) || ((curType & 0x0f) == ContentSpecNode::Sequence)) { ContentSpecNode* childNode = curNode->getFirst(); ContentSpecNode* leftNode = convertContentSpecTree(childNode, checkUPA, bAllowCompactSyntax); ContentSpecNode* rightNode = curNode->getSecond(); if (!rightNode) { retNode = expandContentModel(leftNode, minOccurs, maxOccurs, bAllowCompactSyntax); curNode->setAdoptFirst(false); delete curNode; return retNode; } if (leftNode != childNode) { curNode->setAdoptFirst(false); curNode->setFirst(leftNode); curNode->setAdoptFirst(true); } childNode = rightNode; rightNode = convertContentSpecTree(childNode, checkUPA, bAllowCompactSyntax); if (rightNode != childNode) { curNode->setAdoptSecond(false); curNode->setSecond(rightNode); curNode->setAdoptSecond(true); } retNode = expandContentModel(curNode, minOccurs, maxOccurs, bAllowCompactSyntax); } return retNode; } ContentSpecNode* ComplexTypeInfo::expandContentModel(ContentSpecNode* const specNode, int minOccurs, int maxOccurs, bool bAllowCompactSyntax) { if (!specNode) { return 0; } ContentSpecNode* saveNode = specNode; ContentSpecNode* retNode = specNode; if (minOccurs == 1 && maxOccurs == 1) { } else if (minOccurs == 0 && maxOccurs == 1) { retNode = new (fMemoryManager) ContentSpecNode ( ContentSpecNode::ZeroOrOne , retNode , 0 , true , true , fMemoryManager ); } else if (minOccurs == 0 && maxOccurs == -1) { retNode = new (fMemoryManager) ContentSpecNode ( ContentSpecNode::ZeroOrMore , retNode , 0 , true , true , fMemoryManager ); } else if (minOccurs == 1 && maxOccurs == -1) { retNode = new (fMemoryManager) ContentSpecNode ( ContentSpecNode::OneOrMore , retNode , 0 , true , true , fMemoryManager ); } // if what is being repeated is a leaf avoid expanding the tree else if(bAllowCompactSyntax && (saveNode->getType()==ContentSpecNode::Leaf || (saveNode->getType() & 0x0f)==ContentSpecNode::Any || (saveNode->getType() & 0x0f)==ContentSpecNode::Any_Other || (saveNode->getType() & 0x0f)==ContentSpecNode::Any_NS)) { retNode = new (fMemoryManager) ContentSpecNode ( ContentSpecNode::Loop , retNode , 0 , true , true , fMemoryManager ); retNode->setMinOccurs(minOccurs); retNode->setMaxOccurs(maxOccurs); if(minOccurs==0) retNode = new (fMemoryManager) ContentSpecNode ( ContentSpecNode::ZeroOrMore , retNode , 0 , true , true , fMemoryManager ); else retNode = new (fMemoryManager) ContentSpecNode ( ContentSpecNode::OneOrMore , retNode , 0 , true , true , fMemoryManager ); } else if (maxOccurs == -1) { retNode = new (fMemoryManager) ContentSpecNode ( ContentSpecNode::OneOrMore , retNode , 0 , true , true , fMemoryManager ); for (int i=0; i < (minOccurs-1); i++) { retNode = new (fMemoryManager) ContentSpecNode ( ContentSpecNode::Sequence , saveNode , retNode , false , true , fMemoryManager ); } } else { if (minOccurs == 0) { ContentSpecNode* optional = new (fMemoryManager) ContentSpecNode ( ContentSpecNode::ZeroOrOne , saveNode , 0 , true , true , fMemoryManager ); retNode = optional; for (int i=0; i < (maxOccurs-1); i++) { retNode = new (fMemoryManager) ContentSpecNode ( ContentSpecNode::Sequence , retNode , optional , true , false , fMemoryManager ); } } else { if (minOccurs > 1) { retNode = new (fMemoryManager) ContentSpecNode ( ContentSpecNode::Sequence , retNode , saveNode , true , false , fMemoryManager ); for (int i=1; i < (minOccurs-1); i++) { retNode = new (fMemoryManager) ContentSpecNode ( ContentSpecNode::Sequence , retNode , saveNode , true , false , fMemoryManager ); } } int counter = maxOccurs-minOccurs; if (counter > 0) { ContentSpecNode* optional = new (fMemoryManager) ContentSpecNode ( ContentSpecNode::ZeroOrOne , saveNode , 0 , false , true , fMemoryManager ); retNode = new (fMemoryManager) ContentSpecNode ( ContentSpecNode::Sequence , retNode , optional , true , true , fMemoryManager ); for (int j=1; j < counter; j++) { retNode = new (fMemoryManager) ContentSpecNode ( ContentSpecNode::Sequence , retNode , optional , true , false , fMemoryManager ); } } } } return retNode; } void ComplexTypeInfo::resizeContentSpecOrgURI() { unsigned int newSize = fContentSpecOrgURISize * 2; unsigned int* newContentSpecOrgURI = (unsigned int*) fMemoryManager->allocate ( newSize * sizeof(unsigned int) ); //new unsigned int[newSize]; // Copy the existing values unsigned int index = 0; for (; index < fContentSpecOrgURISize; index++) newContentSpecOrgURI[index] = fContentSpecOrgURI[index]; for (; index < newSize; index++) newContentSpecOrgURI[index] = 0; // Delete the old array and udpate our members fMemoryManager->deallocate(fContentSpecOrgURI); //delete [] fContentSpecOrgURI; fContentSpecOrgURI = newContentSpecOrgURI; fContentSpecOrgURISize = newSize; } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(ComplexTypeInfo) void ComplexTypeInfo::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng<* fElements; * Serialize RefHash2KeysTableOf* fAttDefs; ***/ XTemplateSerializer::storeObject(fElements, serEng); XTemplateSerializer::storeObject(fAttDefs, serEng); /*** * Don't serialize * * fContentModel; * fFormattedModel; * fLocator; * * fContentSpecOrgURI: start of the array * fContentSpecOrgURISize: size of the array * fUniqueURI: the current last element in the array ***/ } else { serEng>>fAnonymous; serEng>>fAbstract; serEng>>fAdoptContentSpec; serEng>>fAttWithTypeId; serEng>>fPreprocessed; serEng>>fDerivedBy; serEng>>fBlockSet; serEng>>fFinalSet; serEng>>fScopeDefined; serEng>>fContentType; serEng>>fElementId; serEng.readString(fTypeName); serEng.readString(fTypeLocalName); serEng.readString(fTypeUri); fBaseDatatypeValidator = DatatypeValidator::loadDV(serEng); fDatatypeValidator = DatatypeValidator::loadDV(serEng); serEng>>fBaseComplexTypeInfo; serEng>>fContentSpec; serEng>>fAttWildCard; delete fAttList; // will recreate it next... serEng>>fAttList; /*** * * Deserialize RefVectorOf* fElements; * Deserialize RefHash2KeysTableOf* fAttDefs; ***/ XTemplateSerializer::loadObject(&fElements, 8, false, serEng); delete fAttDefs; // will recreate it next... XTemplateSerializer::loadObject(&fAttDefs, 29, true, serEng); /*** * Don't deserialize * * fFormattedModel; * fLocator; * * fContentSpecOrgURI: start of the array * fContentSpecOrgURISize: size of the array * fUniqueURI: the current last element in the array ***/ fFormattedModel = 0; fLocator = 0; fContentSpecOrgURI = 0; fContentSpecOrgURISize = 0; fUniqueURI = 0; // Create the content model by calling getContentModel(). This // will ensure the grammar can be used concurrently by multiple // parsers. // Don't bother to do check unique particle attribution, since // this will already have been done when the grammar was first // created (if full schema checking was enabled). getContentModel(false); } } XERCES_CPP_NAMESPACE_END /** * End of file ComplexTypeInfo.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/SubstitutionGroupComparator.hpp000644 000765 000024 00000010431 13241160332 030162 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SubstitutionGroupComparator.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_SUBSTITUTIONGROUPCOMPARATOR_HPP) #define XERCESC_INCLUDE_GUARD_SUBSTITUTIONGROUPCOMPARATOR_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class SchemaGrammar; class VALIDATORS_EXPORT SubstitutionGroupComparator : public XMemory { public: // ----------------------------------------------------------------------- // Public Constructor // ----------------------------------------------------------------------- /** @name Constructor. */ //@{ SubstitutionGroupComparator(GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool); //@} // ----------------------------------------------------------------------- // Public Destructor // ----------------------------------------------------------------------- /** @name Destructor. */ //@{ ~SubstitutionGroupComparator(); //@} // ----------------------------------------------------------------------- // Validation methods // ----------------------------------------------------------------------- /** @name Validation Function */ //@{ /** * Checks that the "anElement" is within the substitution group. * * @param anElement QName of the element * * @param exemplar QName of the head element in the group */ bool isEquivalentTo(const QName* const anElement , const QName* const exemplar); //@} /* * check whether one element or any element in its substitution group * is allowed by a given wildcard uri * * @param pGrammar the grammar where the wildcard is declared * @param element the QName of a given element * @param wuri the uri of the wildcard * @param wother whether the uri is from ##other, so wuri is excluded * * @return whether the element is allowed by the wildcard */ bool isAllowedByWildcard(SchemaGrammar* const pGrammar, QName* const element, unsigned int wuri, bool wother); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- SubstitutionGroupComparator(); SubstitutionGroupComparator(const SubstitutionGroupComparator&); SubstitutionGroupComparator& operator=(const SubstitutionGroupComparator&); // ----------------------------------------------------------------------- // Private data members // // // ----------------------------------------------------------------------- GrammarResolver *fGrammarResolver; XMLStringPool *fStringPool; }; // --------------------------------------------------------------------------- // SubstitutionGroupComparator: Getters // --------------------------------------------------------------------------- inline SubstitutionGroupComparator::SubstitutionGroupComparator(GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool) :fGrammarResolver(pGrammarResolver) ,fStringPool(pStringPool) {} inline SubstitutionGroupComparator::~SubstitutionGroupComparator() {} XERCES_CPP_NAMESPACE_END #endif /** * End of file SubstitutionGroupComparator.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/GeneralAttributeCheck.hpp000644 000765 000024 00000017625 13241160332 026614 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: GeneralAttributeCheck.hpp 729944 2008-12-29 17:03:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_GENERALATTRIBUTECHECK_HPP) #define XERCESC_INCLUDE_GUARD_GENERALATTRIBUTECHECK_HPP /** * A general purpose class to check for valid values of attributes, as well * as check for proper association with corresponding schema elements. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Forward declaration // --------------------------------------------------------------------------- class TraverseSchema; class DOMElement; class DOMNode; class VALIDATORS_EXPORT GeneralAttributeCheck : public XMemory { public: // ----------------------------------------------------------------------- // Constants // ----------------------------------------------------------------------- //Elements enum { E_All, E_Annotation, E_Any, E_AnyAttribute, E_Appinfo, E_AttributeGlobal, E_AttributeLocal, E_AttributeRef, E_AttributeGroupGlobal, E_AttributeGroupRef, E_Choice, E_ComplexContent, E_ComplexTypeGlobal, E_ComplexTypeLocal, E_Documentation, E_ElementGlobal, E_ElementLocal, E_ElementRef, E_Enumeration, E_Extension, E_Field, E_FractionDigits, E_GroupGlobal, E_GroupRef, E_Import, E_Include, E_Key, E_KeyRef, E_Length, E_List, E_MaxExclusive, E_MaxInclusive, E_MaxLength, E_MinExclusive, E_MinInclusive, E_MinLength, E_Notation, E_Pattern, E_Redefine, E_Restriction, E_Schema, E_Selector, E_Sequence, E_SimpleContent, E_SimpleTypeGlobal, E_SimpleTypeLocal, E_TotalDigits, E_Union, E_Unique, E_WhiteSpace, E_Count, E_Invalid = -1 }; //Attributes enum { A_Abstract, A_AttributeFormDefault, A_Base, A_Block, A_BlockDefault, A_Default, A_ElementFormDefault, A_Final, A_FinalDefault, A_Fixed, A_Form, A_ID, A_ItemType, A_MaxOccurs, A_MemberTypes, A_MinOccurs, A_Mixed, A_Name, A_Namespace, A_Nillable, A_ProcessContents, A_Public, A_Ref, A_Refer, A_SchemaLocation, A_Source, A_SubstitutionGroup, A_System, A_TargetNamespace, A_Type, A_Use, A_Value, A_Version, A_XPath, A_Count, A_Invalid = -1 }; //Validators enum { DV_String = 0, DV_AnyURI = 4, DV_NonNegInt = 8, DV_Boolean = 16, DV_ID = 32, DV_Form = 64, DV_MaxOccurs = 128, DV_MaxOccurs1 = 256, DV_MinOccurs1 = 512, DV_ProcessContents = 1024, DV_Use = 2048, DV_WhiteSpace = 4096, DV_Mask = (DV_AnyURI | DV_NonNegInt | DV_Boolean | DV_ID | DV_Form | DV_MaxOccurs | DV_MaxOccurs1 | DV_MinOccurs1 | DV_ProcessContents | DV_Use | DV_WhiteSpace) }; // generate element-attributes map table #if defined(NEED_TO_GEN_ELEM_ATT_MAP_TABLE) static void initCharFlagTable(); #endif // ----------------------------------------------------------------------- // Constructor/Destructor // ----------------------------------------------------------------------- GeneralAttributeCheck(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~GeneralAttributeCheck(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- unsigned short getFacetId(const XMLCh* const facetName, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); // ----------------------------------------------------------------------- // Validation methods // ----------------------------------------------------------------------- void checkAttributes(const DOMElement* const elem, const unsigned short elemContext, TraverseSchema* const schema, const bool isTopLevel = false, ValueVectorOf* const nonXSAttList = 0); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- GeneralAttributeCheck(const GeneralAttributeCheck&); GeneralAttributeCheck& operator=(const GeneralAttributeCheck&); // ----------------------------------------------------------------------- // Validation methods // ----------------------------------------------------------------------- void validate(const DOMElement* const elem, const XMLCh* const attName, const XMLCh* const attValue, const short dvIndex, TraverseSchema* const schema); // ----------------------------------------------------------------------- // Private Constants // ----------------------------------------------------------------------- // optional vs. required attribute enum { Att_Required = 1, Att_Optional = 2, Att_Mask = 3 }; // ----------------------------------------------------------------------- // Private data members // ----------------------------------------------------------------------- static ValueHashTableOf* fAttMap; static ValueHashTableOf* fFacetsMap; static DatatypeValidator* fNonNegIntDV; static DatatypeValidator* fBooleanDV; static DatatypeValidator* fAnyURIDV; static unsigned short fgElemAttTable[E_Count][A_Count]; static const XMLCh* fAttNames[A_Count]; MemoryManager* fMemoryManager; IDDatatypeValidator fIDValidator; private: static void initialize(); friend class XMLInitializer; }; // --------------------------------------------------------------------------- // GeneralAttributeCheck: Getter methods // --------------------------------------------------------------------------- inline unsigned short GeneralAttributeCheck::getFacetId(const XMLCh* const facetName, MemoryManager* const manager) { return fFacetsMap->get(facetName, manager); } XERCES_CPP_NAMESPACE_END #endif /** * End of file GeneralAttributeCheck.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/XercesAttGroupInfo.hpp000644 000765 000024 00000017342 13241160332 026144 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XercesAttGroupInfo.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XERCESATTGROUPINFO_HPP) #define XERCESC_INCLUDE_GUARD_XERCESATTGROUPINFO_HPP /** * The class act as a place holder to store attributeGroup information. * * The class is intended for internal use. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT XercesAttGroupInfo : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Public Constructors/Destructor // ----------------------------------------------------------------------- XercesAttGroupInfo ( unsigned int attGroupNameId , unsigned int attGroupNamespaceId , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~XercesAttGroupInfo(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- bool containsTypeWithId() const; XMLSize_t attributeCount() const; XMLSize_t anyAttributeCount() const; unsigned int getNameId() const; unsigned int getNamespaceId() const; SchemaAttDef* attributeAt(const XMLSize_t index); const SchemaAttDef* attributeAt(const XMLSize_t index) const; SchemaAttDef* anyAttributeAt(const XMLSize_t index); const SchemaAttDef* anyAttributeAt(const XMLSize_t index) const; SchemaAttDef* getCompleteWildCard() const; const SchemaAttDef* getAttDef(const XMLCh* const baseName, const int uriId) const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setTypeWithId(const bool other); void addAttDef(SchemaAttDef* const toAdd, const bool toClone = false); void addAnyAttDef(SchemaAttDef* const toAdd, const bool toClone = false); void setCompleteWildCard(SchemaAttDef* const toSet); // ----------------------------------------------------------------------- // Query methods // ----------------------------------------------------------------------- bool containsAttribute(const XMLCh* const name, const unsigned int uri); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XercesAttGroupInfo) XercesAttGroupInfo(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XercesAttGroupInfo(const XercesAttGroupInfo& elemInfo); XercesAttGroupInfo& operator= (const XercesAttGroupInfo& other); // ----------------------------------------------------------------------- // Private data members // ----------------------------------------------------------------------- bool fTypeWithId; unsigned int fNameId; unsigned int fNamespaceId; RefVectorOf* fAttributes; RefVectorOf* fAnyAttributes; SchemaAttDef* fCompleteWildCard; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // XercesAttGroupInfo: Getter methods // --------------------------------------------------------------------------- inline bool XercesAttGroupInfo::containsTypeWithId() const { return fTypeWithId; } inline XMLSize_t XercesAttGroupInfo::attributeCount() const { if (fAttributes) { return fAttributes->size(); } return 0; } inline XMLSize_t XercesAttGroupInfo::anyAttributeCount() const { if (fAnyAttributes) { return fAnyAttributes->size(); } return 0; } inline unsigned int XercesAttGroupInfo::getNameId() const { return fNameId; } inline unsigned int XercesAttGroupInfo::getNamespaceId() const { return fNamespaceId; } inline SchemaAttDef* XercesAttGroupInfo::attributeAt(const XMLSize_t index) { if (fAttributes) { return fAttributes->elementAt(index); } return 0; } inline const SchemaAttDef* XercesAttGroupInfo::attributeAt(const XMLSize_t index) const { if (fAttributes) { return fAttributes->elementAt(index); } return 0; } inline SchemaAttDef* XercesAttGroupInfo::anyAttributeAt(const XMLSize_t index) { if (fAnyAttributes) { return fAnyAttributes->elementAt(index); } return 0; } inline const SchemaAttDef* XercesAttGroupInfo::anyAttributeAt(const XMLSize_t index) const { if (fAnyAttributes) { return fAnyAttributes->elementAt(index); } return 0; } inline SchemaAttDef* XercesAttGroupInfo::getCompleteWildCard() const { return fCompleteWildCard; } // --------------------------------------------------------------------------- // XercesAttGroupInfo: Setter methods // --------------------------------------------------------------------------- inline void XercesAttGroupInfo::setTypeWithId(const bool other) { fTypeWithId = other; } inline void XercesAttGroupInfo::addAttDef(SchemaAttDef* const toAdd, const bool toClone) { if (!fAttributes) { fAttributes = new (fMemoryManager) RefVectorOf(4, true, fMemoryManager); } if (toClone) { SchemaAttDef* clonedAttDef = new (fMemoryManager) SchemaAttDef(toAdd); if (!clonedAttDef->getBaseAttDecl()) clonedAttDef->setBaseAttDecl(toAdd); fAttributes->addElement(clonedAttDef); } else { fAttributes->addElement(toAdd); } } inline void XercesAttGroupInfo::addAnyAttDef(SchemaAttDef* const toAdd, const bool toClone) { if (!fAnyAttributes) { fAnyAttributes = new (fMemoryManager) RefVectorOf(2, true, fMemoryManager); } if (toClone) { SchemaAttDef* clonedAttDef = new (fMemoryManager) SchemaAttDef(toAdd); if (!clonedAttDef->getBaseAttDecl()) clonedAttDef->setBaseAttDecl(toAdd); fAnyAttributes->addElement(clonedAttDef); } else { fAnyAttributes->addElement(toAdd); } } inline void XercesAttGroupInfo::setCompleteWildCard(SchemaAttDef* const toSet) { if (fCompleteWildCard) { delete fCompleteWildCard; } fCompleteWildCard = toSet; } XERCES_CPP_NAMESPACE_END #endif /** * End of file XercesAttGroupInfo.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/IdentityConstraintHandler.cpp000644 000765 000024 00000016256 13241160332 031374 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IdentityConstraintHandler.cpp 803869 2009-08-13 12:56:21Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include "IdentityConstraintHandler.hpp" #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN typedef JanitorMemFunCall CleanupType; // --------------------------------------------------------------------------- // IdentityConstraintHandler: Constructors and Destructor // --------------------------------------------------------------------------- IdentityConstraintHandler::IdentityConstraintHandler(XMLScanner* const scanner , MemoryManager* const manager) : fScanner(scanner) , fMemoryManager(manager) , fMatcherStack(0) , fValueStoreCache(0) , fFieldActivator(0) { CleanupType cleanup(this, &IdentityConstraintHandler::cleanUp); try { fMatcherStack = new (fMemoryManager) XPathMatcherStack(fMemoryManager); fValueStoreCache = new (fMemoryManager) ValueStoreCache(fMemoryManager); fFieldActivator = new (fMemoryManager) FieldActivator(fValueStoreCache, fMatcherStack, fMemoryManager); fValueStoreCache->setScanner(scanner); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } IdentityConstraintHandler::~IdentityConstraintHandler() { cleanUp(); } // --------------------------------------------------------------------------- // IdentityConstraintHandler: methods // --------------------------------------------------------------------------- void IdentityConstraintHandler::deactivateContext( SchemaElementDecl* const elem , const XMLCh* const content , ValidationContext* validationContext /*=0*/ , DatatypeValidator* actualValidator /*=0*/) { XMLSize_t oldCount = fMatcherStack->getMatcherCount(); if (oldCount || elem->getIdentityConstraintCount()) { for (XMLSize_t i = oldCount; i > 0; i--) { XPathMatcher* matcher = fMatcherStack->getMatcherAt(i-1); matcher->endElement(*(elem), content, validationContext, actualValidator); } if (fMatcherStack->size() > 0) { fMatcherStack->popContext(); } // handle everything *but* keyref's. XMLSize_t newCount = fMatcherStack->getMatcherCount(); for (XMLSize_t j = oldCount; j > newCount; j--) { XPathMatcher* matcher = fMatcherStack->getMatcherAt(j-1); IdentityConstraint* ic = matcher->getIdentityConstraint(); if (ic && (ic->getType() != IdentityConstraint::ICType_KEYREF)) fValueStoreCache->transplant(ic, matcher->getInitialDepth()); } // now handle keyref's... for (XMLSize_t k = oldCount; k > newCount; k--) { XPathMatcher* matcher = fMatcherStack->getMatcherAt(k-1); IdentityConstraint* ic = matcher->getIdentityConstraint(); if (ic && (ic->getType() == IdentityConstraint::ICType_KEYREF)) { ValueStore* values = fValueStoreCache->getValueStoreFor(ic, matcher->getInitialDepth()); if (values) { // nothing to do if nothing matched! values->endDocumentFragment(fValueStoreCache); } } } fValueStoreCache->endElement(); } } void IdentityConstraintHandler::activateIdentityConstraint ( SchemaElementDecl* const elem , int elemDepth , const unsigned int uriId , const XMLCh* const elemPrefix , const RefVectorOf& attrList , const XMLSize_t attrCount , ValidationContext* validationContext /*=0*/) { XMLSize_t count = elem->getIdentityConstraintCount(); if (count || fMatcherStack->getMatcherCount()) { fValueStoreCache->startElement(); fMatcherStack->pushContext(); fValueStoreCache->initValueStoresFor( elem, elemDepth); for (XMLSize_t i = 0; i < count; i++) { activateSelectorFor(elem->getIdentityConstraintAt(i), elemDepth); } // call all active identity constraints count = fMatcherStack->getMatcherCount(); for (XMLSize_t j = 0; j < count; j++) { XPathMatcher* matcher = fMatcherStack->getMatcherAt(j); matcher->startElement(*elem, uriId, elemPrefix, attrList, attrCount, validationContext); } } } void IdentityConstraintHandler::activateSelectorFor( IdentityConstraint* const ic , const int initialDepth) { IC_Selector* selector = ic->getSelector(); if (!selector) return; XPathMatcher* matcher = selector->createMatcher(fFieldActivator, initialDepth, fMemoryManager); fMatcherStack->addMatcher(matcher); matcher->startDocumentFragment(); } // --------------------------------------------------------------------------- // IdentityConstraintHandler: Getter methods // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // IdentityConstraintHandler: cleanUp methods // --------------------------------------------------------------------------- void IdentityConstraintHandler::cleanUp() { if (fMatcherStack) delete fMatcherStack; if (fValueStoreCache) delete fValueStoreCache; if (fFieldActivator) delete fFieldActivator; } void IdentityConstraintHandler::reset() { fValueStoreCache->startDocument(); fMatcherStack->clear(); } XERCES_CPP_NAMESPACE_END /** * End of file IdentityConstraintHandler.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/FieldValueMap.hpp000644 000765 000024 00000014733 13241160332 026721 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: FieldValueMap.hpp 708224 2008-10-27 16:02:26Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_FIELDVALUEMAP_HPP) #define XERCESC_INCLUDE_GUARD_FIELDVALUEMAP_HPP /** * This class maps values associated with fields of an identity constraint * that have successfully matched some string in an instance document. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Forward Declaration // --------------------------------------------------------------------------- class IC_Field; class DatatypeValidator; class VALIDATORS_EXPORT FieldValueMap : public XMemory { public: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- FieldValueMap(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); FieldValueMap(const FieldValueMap& other); ~FieldValueMap(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- DatatypeValidator* getDatatypeValidatorAt(const XMLSize_t index) const; DatatypeValidator* getDatatypeValidatorFor(const IC_Field* const key) const; XMLCh* getValueAt(const XMLSize_t index) const; XMLCh* getValueFor(const IC_Field* const key) const; IC_Field* keyAt(const XMLSize_t index) const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void put(IC_Field* const key, DatatypeValidator* const dv, const XMLCh* const value); // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- XMLSize_t size() const; bool indexOf(const IC_Field* const key, XMLSize_t& location) const; void clear(); private: // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void cleanUp(); // ----------------------------------------------------------------------- // Unimplemented operators // ----------------------------------------------------------------------- FieldValueMap& operator= (const FieldValueMap& other); // ----------------------------------------------------------------------- // Data // ----------------------------------------------------------------------- ValueVectorOf* fFields; ValueVectorOf* fValidators; RefArrayVectorOf* fValues; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // FieldValueMap: Getter methods // --------------------------------------------------------------------------- inline DatatypeValidator* FieldValueMap::getDatatypeValidatorAt(const XMLSize_t index) const { if (fValidators) { return fValidators->elementAt(index); } return 0; } inline DatatypeValidator* FieldValueMap::getDatatypeValidatorFor(const IC_Field* const key) const { XMLSize_t location; if (fValidators && indexOf(key, location)) { return fValidators->elementAt(location); } return 0; } inline XMLCh* FieldValueMap::getValueAt(const XMLSize_t index) const { if (fValues) { return fValues->elementAt(index); } return 0; } inline XMLCh* FieldValueMap::getValueFor(const IC_Field* const key) const { XMLSize_t location; if (fValues && indexOf(key, location)) { return fValues->elementAt(location); } return 0; } inline IC_Field* FieldValueMap::keyAt(const XMLSize_t index) const { if (fFields) { return fFields->elementAt(index); } return 0; } // --------------------------------------------------------------------------- // FieldValueMap: Helper methods // --------------------------------------------------------------------------- inline XMLSize_t FieldValueMap::size() const { if (fFields) { return fFields->size(); } return 0; } // --------------------------------------------------------------------------- // FieldValueMap: Setter methods // --------------------------------------------------------------------------- inline void FieldValueMap::put(IC_Field* const key, DatatypeValidator* const dv, const XMLCh* const value) { if (!fFields) { fFields = new (fMemoryManager) ValueVectorOf(4, fMemoryManager); fValidators = new (fMemoryManager) ValueVectorOf(4, fMemoryManager); fValues = new (fMemoryManager) RefArrayVectorOf(4, true, fMemoryManager); } XMLSize_t keyIndex; bool bFound=indexOf(key, keyIndex); if (!bFound) { fFields->addElement(key); fValidators->addElement(dv); fValues->addElement(XMLString::replicate(value, fMemoryManager)); } else { fValidators->setElementAt(dv, keyIndex); fValues->setElementAt(XMLString::replicate(value, fMemoryManager), keyIndex); } } XERCES_CPP_NAMESPACE_END #endif /** * End of file FieldValueMap.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/FieldActivator.hpp000644 000765 000024 00000012077 13241160332 027142 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: FieldActivator.hpp 679340 2008-07-24 10:28:29Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_FIELDACTIVATOR_HPP) #define XERCESC_INCLUDE_GUARD_FIELDACTIVATOR_HPP /** * This class is responsible for activating fields within a specific scope; * the caller merely requests the fields to be activated. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Forward Declaration // --------------------------------------------------------------------------- class IdentityConstraint; class XPathMatcher; class ValueStoreCache; class IC_Field; class XPathMatcherStack; class VALIDATORS_EXPORT FieldActivator : public XMemory { public: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- FieldActivator(ValueStoreCache* const valueStoreCache, XPathMatcherStack* const matcherStack, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); FieldActivator(const FieldActivator& other); ~FieldActivator(); // ----------------------------------------------------------------------- // Operator methods // ----------------------------------------------------------------------- FieldActivator& operator =(const FieldActivator& other); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- bool getMayMatch(IC_Field* const field); // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setValueStoreCache(ValueStoreCache* const other); void setMatcherStack(XPathMatcherStack* const matcherStack); void setMayMatch(IC_Field* const field, bool value); // ----------------------------------------------------------------------- // Activation methods // ----------------------------------------------------------------------- /** * Start the value scope for the specified identity constraint. This * method is called when the selector matches in order to initialize * the value store. */ void startValueScopeFor(const IdentityConstraint* const ic, const int initialDepth); /** * Request to activate the specified field. This method returns the * matcher for the field. */ XPathMatcher* activateField(IC_Field* const field, const int initialDepth); /** * Ends the value scope for the specified identity constraint. */ void endValueScopeFor(const IdentityConstraint* const ic, const int initialDepth); private: // ----------------------------------------------------------------------- // Data // ----------------------------------------------------------------------- ValueStoreCache* fValueStoreCache; XPathMatcherStack* fMatcherStack; ValueHashTableOf* fMayMatch; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // FieldActivator: Getter methods // --------------------------------------------------------------------------- inline bool FieldActivator::getMayMatch(IC_Field* const field) { return fMayMatch->get(field); } // --------------------------------------------------------------------------- // FieldActivator: Setter methods // --------------------------------------------------------------------------- inline void FieldActivator::setValueStoreCache(ValueStoreCache* const other) { fValueStoreCache = other; } inline void FieldActivator::setMatcherStack(XPathMatcherStack* const matcherStack) { fMatcherStack = matcherStack; } inline void FieldActivator::setMayMatch(IC_Field* const field, bool value) { fMayMatch->put(field, value); } XERCES_CPP_NAMESPACE_END #endif /** * End of file FieldActivator.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/XPathException.hpp000644 000765 000024 00000002234 13241160332 027137 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XPathException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XPATHEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_XPATHEXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(XPathException, VALIDATORS_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/schema/identity/IdentityConstraint.hpp000644 000765 000024 00000016251 13241160332 030076 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IdentityConstraint.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_IDENTITYCONSTRAINT_HPP) #define XERCESC_INCLUDE_GUARD_IDENTITYCONSTRAINT_HPP /** * The class act as a base class for schema identity constraints. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Forward Declarations // --------------------------------------------------------------------------- class IC_Selector; class VALIDATORS_EXPORT IdentityConstraint : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Constants // ----------------------------------------------------------------------- enum ICType { ICType_UNIQUE = 0, ICType_KEY = 1, ICType_KEYREF = 2, ICType_UNKNOWN }; // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- virtual ~IdentityConstraint(); // ----------------------------------------------------------------------- // operators // ----------------------------------------------------------------------- bool operator== (const IdentityConstraint& other) const; bool operator!= (const IdentityConstraint& other) const; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- virtual short getType() const = 0; XMLSize_t getFieldCount() const; XMLCh* getIdentityConstraintName() const; XMLCh* getElementName() const; IC_Selector* getSelector() const; int getNamespaceURI() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setSelector(IC_Selector* const selector); void setNamespaceURI(int uri); // ----------------------------------------------------------------------- // Access methods // ----------------------------------------------------------------------- void addField(IC_Field* const field); const IC_Field* getFieldAt(const XMLSize_t index) const; IC_Field* getFieldAt(const XMLSize_t index); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(IdentityConstraint) static void storeIC(XSerializeEngine& serEng , IdentityConstraint* const ic); static IdentityConstraint* loadIC(XSerializeEngine& serEng); protected: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- IdentityConstraint(const XMLCh* const identityConstraintName, const XMLCh* const elementName, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- IdentityConstraint(const IdentityConstraint& other); IdentityConstraint& operator= (const IdentityConstraint& other); // ----------------------------------------------------------------------- // CleanUp methods // ----------------------------------------------------------------------- void cleanUp(); // ----------------------------------------------------------------------- // Data members // // fIdentityConstraintName // The identity constraint name // // fElemName // The element name // // fSelector // The selector information // // fFields // The field(s) information // ----------------------------------------------------------------------- XMLCh* fIdentityConstraintName; XMLCh* fElemName; IC_Selector* fSelector; RefVectorOf* fFields; MemoryManager* fMemoryManager; int fNamespaceURI; }; // --------------------------------------------------------------------------- // IdentityConstraint: Getter methods // --------------------------------------------------------------------------- inline XMLSize_t IdentityConstraint::getFieldCount() const { if (fFields) { return fFields->size(); } return 0; } inline XMLCh* IdentityConstraint::getIdentityConstraintName() const { return fIdentityConstraintName; } inline XMLCh* IdentityConstraint::getElementName() const { return fElemName; } inline IC_Selector* IdentityConstraint::getSelector() const { return fSelector; } inline int IdentityConstraint::getNamespaceURI() const { return fNamespaceURI; } // --------------------------------------------------------------------------- // IdentityConstraint: Setter methods // --------------------------------------------------------------------------- inline void IdentityConstraint::setNamespaceURI(int uri) { fNamespaceURI = uri; } // --------------------------------------------------------------------------- // IdentityConstraint: Access methods // --------------------------------------------------------------------------- inline void IdentityConstraint::addField(IC_Field* const field) { if (!fFields) { fFields = new (fMemoryManager) RefVectorOf(4, true, fMemoryManager); } fFields->addElement(field); } inline const IC_Field* IdentityConstraint::getFieldAt(const XMLSize_t index) const { if (fFields) { return (fFields->elementAt(index)); } return 0; } inline IC_Field* IdentityConstraint::getFieldAt(const XMLSize_t index) { if (fFields) { return (fFields->elementAt(index)); } return 0; } XERCES_CPP_NAMESPACE_END #endif /** * End of file IdentityConstraint.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/XPathSymbols.cpp000644 000765 000024 00000011415 13241160332 026625 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XPathSymbols.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // SchemaSymbols: Static data // --------------------------------------------------------------------------- const XMLCh XPathSymbols::fgSYMBOL_AND[] = { chLatin_a, chLatin_n, chLatin_d, chNull }; const XMLCh XPathSymbols::fgSYMBOL_OR[] = { chLatin_o, chLatin_r, chNull }; const XMLCh XPathSymbols::fgSYMBOL_MOD[] = { chLatin_m, chLatin_o, chLatin_d, chNull }; const XMLCh XPathSymbols::fgSYMBOL_DIV[] = { chLatin_d, chLatin_i, chLatin_v, chNull }; const XMLCh XPathSymbols::fgSYMBOL_COMMENT[] = { chLatin_c, chLatin_o, chLatin_m, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chNull }; const XMLCh XPathSymbols::fgSYMBOL_TEXT[] = { chLatin_t, chLatin_e, chLatin_x, chLatin_t, chNull }; const XMLCh XPathSymbols::fgSYMBOL_PI[] = { chLatin_p, chLatin_r, chLatin_o, chLatin_c, chLatin_e, chLatin_s, chLatin_s, chLatin_i, chLatin_n, chLatin_g, chDash, chLatin_i, chLatin_n, chLatin_s, chLatin_t, chLatin_r, chLatin_u, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh XPathSymbols::fgSYMBOL_NODE[] = { chLatin_n, chLatin_o, chLatin_d, chLatin_e, chNull }; const XMLCh XPathSymbols::fgSYMBOL_ANCESTOR[] = { chLatin_a, chLatin_n, chLatin_c, chLatin_e, chLatin_s, chLatin_t, chLatin_o, chLatin_r, chNull }; const XMLCh XPathSymbols::fgSYMBOL_ANCESTOR_OR_SELF[] = { chLatin_a, chLatin_n, chLatin_c, chLatin_e, chLatin_s, chLatin_t, chLatin_o, chLatin_r, chDash, chLatin_o, chLatin_r, chDash, chLatin_s, chLatin_e, chLatin_l, chLatin_f, chNull }; const XMLCh XPathSymbols::fgSYMBOL_ATTRIBUTE[] = { chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chNull }; const XMLCh XPathSymbols::fgSYMBOL_CHILD[] = { chLatin_c, chLatin_h, chLatin_i, chLatin_l, chLatin_d, chNull }; const XMLCh XPathSymbols::fgSYMBOL_DESCENDANT[] = { chLatin_d, chLatin_e, chLatin_s, chLatin_c, chLatin_e, chLatin_n, chLatin_d, chLatin_a, chLatin_n, chLatin_t, chNull }; const XMLCh XPathSymbols::fgSYMBOL_DESCENDANT_OR_SELF[] = { chLatin_d, chLatin_e, chLatin_s, chLatin_c, chLatin_e, chLatin_n, chLatin_d, chLatin_a, chLatin_n, chLatin_t, chDash, chLatin_o, chLatin_r, chDash, chLatin_s, chLatin_e, chLatin_l, chLatin_f, chNull }; const XMLCh XPathSymbols::fgSYMBOL_FOLLOWING[] = { chLatin_f, chLatin_o, chLatin_l, chLatin_l, chLatin_o, chLatin_w, chLatin_i, chLatin_n, chLatin_g, chNull }; const XMLCh XPathSymbols::fgSYMBOL_FOLLOWING_SIBLING[] = { chLatin_f, chLatin_o, chLatin_l, chLatin_l, chLatin_o, chLatin_w, chLatin_i, chLatin_n, chLatin_g, chDash, chLatin_s, chLatin_i, chLatin_b, chLatin_l, chLatin_i, chLatin_n, chLatin_g, chNull }; const XMLCh XPathSymbols::fgSYMBOL_NAMESPACE[] = { chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chNull }; const XMLCh XPathSymbols::fgSYMBOL_PARENT[] = { chLatin_p, chLatin_a, chLatin_r, chLatin_e, chLatin_n, chLatin_t, chNull }; const XMLCh XPathSymbols::fgSYMBOL_PRECEDING[] = { chLatin_p, chLatin_r, chLatin_e, chLatin_c, chLatin_e, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chNull }; const XMLCh XPathSymbols::fgSYMBOL_PRECEDING_SIBLING[] = { chLatin_p, chLatin_r, chLatin_e, chLatin_c, chLatin_e, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chDash, chLatin_s, chLatin_i, chLatin_b, chLatin_l, chLatin_i, chLatin_n, chLatin_g, chNull }; const XMLCh XPathSymbols::fgSYMBOL_SELF[] = { chLatin_s, chLatin_e, chLatin_l, chLatin_f, chNull }; XERCES_CPP_NAMESPACE_END /** * End of file XPathSymbols.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/XPathMatcher.hpp000644 000765 000024 00000015704 13241160332 026572 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XPathMatcher.hpp 1515307 2013-08-19 08:03:01Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XPATHMATCHER_HPP) #define XERCESC_INCLUDE_GUARD_XPATHMATCHER_HPP // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Forward Declaration // --------------------------------------------------------------------------- class XMLElementDecl; class XercesXPath; class IdentityConstraint; class DatatypeValidator; class XMLStringPool; class XercesLocationPath; class XMLAttr; class XercesNodeTest; class QName; class ValidationContext; class VALIDATORS_EXPORT XPathMatcher : public XMemory { public: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- XPathMatcher(XercesXPath* const xpath, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); XPathMatcher(XercesXPath* const xpath, IdentityConstraint* const ic, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); virtual ~XPathMatcher(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- IdentityConstraint* getIdentityConstraint() const { return fIdentityConstraint; } MemoryManager* getMemoryManager() const { return fMemoryManager; } // ----------------------------------------------------------------------- // Match methods // ----------------------------------------------------------------------- /** * Returns true if XPath has been matched. */ unsigned char isMatched(); virtual int getInitialDepth() const; // ----------------------------------------------------------------------- // XMLDocumentHandler methods // ----------------------------------------------------------------------- virtual void startDocumentFragment(); virtual void startElement(const XMLElementDecl& elemDecl, const unsigned int urlId, const XMLCh* const elemPrefix, const RefVectorOf& attrList, const XMLSize_t attrCount, ValidationContext* validationContext = 0); virtual void endElement(const XMLElementDecl& elemDecl, const XMLCh* const elemContent, ValidationContext* validationContext = 0, DatatypeValidator* actualValidator = 0); enum { XP_MATCHED = 1 // matched any way , XP_MATCHED_A = 3 // matched on the attribute axis , XP_MATCHED_D = 5 // matched on the descendant-or-self axixs , XP_MATCHED_DP = 13 // matched some previous (ancestor) node on the // descendant-or-self-axis, but not this node }; protected: // ----------------------------------------------------------------------- // Match methods // ----------------------------------------------------------------------- /** * This method is called when the XPath handler matches the XPath * expression. Subclasses can override this method to provide default * handling upon a match. */ virtual void matched(const XMLCh* const content, DatatypeValidator* const dv, const bool isNil); bool matches(const XercesNodeTest* nodeTest, const QName* qName); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XPathMatcher(const XPathMatcher&); XPathMatcher& operator=(const XPathMatcher&); // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- void init(XercesXPath* const xpath); void cleanUp(); protected: // ----------------------------------------------------------------------- // Data members // // fMatched // Indicates whether XPath has been matched or not // // fNoMatchDepth // Indicates whether matching is successful for the given xpath // expression. // // fCurrentStep // Stores current step. // // fStepIndexes // Integer stack of step indexes. // // fLocationPaths // fLocationPathSize // XPath location path, and its size. // // fIdentityConstraint // The identity constraint we're the matcher for. Only used for // selectors. // // ----------------------------------------------------------------------- XMLSize_t fLocationPathSize; unsigned char* fMatched; XMLSize_t* fNoMatchDepth; XMLSize_t* fCurrentStep; RefVectorOf >* fStepIndexes; RefVectorOf* fLocationPaths; IdentityConstraint* fIdentityConstraint; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // XPathMatcher: Helper methods // --------------------------------------------------------------------------- inline void XPathMatcher::cleanUp() { fMemoryManager->deallocate(fMatched);//delete [] fMatched; fMemoryManager->deallocate(fNoMatchDepth);//delete [] fNoMatchDepth; fMemoryManager->deallocate(fCurrentStep);//delete [] fCurrentStep; delete fStepIndexes; } XERCES_CPP_NAMESPACE_END #endif /** * End of file XPathMatcher.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/XercesXPath.hpp000644 000765 000024 00000047371 13241160332 026445 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XercesXPath.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XERCESXPATH_HPP) #define XERCESC_INCLUDE_GUARD_XERCESXPATH_HPP // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Forward Declarations // --------------------------------------------------------------------------- class XMLStringPool; class VALIDATORS_EXPORT XercesNodeTest : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Constants // ----------------------------------------------------------------------- enum NodeType { NodeType_QNAME = 1, NodeType_WILDCARD = 2, NodeType_NODE = 3, NodeType_NAMESPACE= 4, NodeType_UNKNOWN }; // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- XercesNodeTest(const short type, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); XercesNodeTest(const QName* const qName); XercesNodeTest(const XMLCh* const prefix, const unsigned int uriId, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); XercesNodeTest(const XercesNodeTest& other); ~XercesNodeTest() { delete fName; } // ----------------------------------------------------------------------- // Operators // ----------------------------------------------------------------------- XercesNodeTest& operator= (const XercesNodeTest& other); bool operator== (const XercesNodeTest& other) const; bool operator!= (const XercesNodeTest& other) const; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- short getType() const { return fType; } QName* getName() const { return fName; } /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XercesNodeTest) XercesNodeTest(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); private: // ----------------------------------------------------------------------- // Data members // ----------------------------------------------------------------------- short fType; QName* fName; }; /** * A location path step comprised of an axis and node test. */ class VALIDATORS_EXPORT XercesStep : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Constants // ----------------------------------------------------------------------- enum AxisType { // Axis type AxisType_CHILD = 1, AxisType_ATTRIBUTE = 2, AxisType_SELF = 3, AxisType_DESCENDANT = 4, AxisType_UNKNOWN }; // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- XercesStep(const unsigned short axisType, XercesNodeTest* const nodeTest); XercesStep(const XercesStep& other); ~XercesStep() { delete fNodeTest; } // ----------------------------------------------------------------------- // Operators // ----------------------------------------------------------------------- XercesStep& operator= (const XercesStep& other); bool operator== (const XercesStep& other) const; bool operator!= (const XercesStep& other) const; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- unsigned short getAxisType() const { return fAxisType; } XercesNodeTest* getNodeTest() const { return fNodeTest; } /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XercesStep) XercesStep(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); private: // ----------------------------------------------------------------------- // Data members // ----------------------------------------------------------------------- unsigned short fAxisType; XercesNodeTest* fNodeTest; }; /** * A location path representation for an XPath expression. */ class VALIDATORS_EXPORT XercesLocationPath : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- XercesLocationPath(RefVectorOf* const steps); ~XercesLocationPath() { delete fSteps; } // ----------------------------------------------------------------------- // Operators // ----------------------------------------------------------------------- bool operator== (const XercesLocationPath& other) const; bool operator!= (const XercesLocationPath& other) const; // ----------------------------------------------------------------------- // Access methods // ----------------------------------------------------------------------- XMLSize_t getStepSize() const; void addStep(XercesStep* const aStep); XercesStep* getStep(const XMLSize_t index) const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XercesLocationPath) XercesLocationPath(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XercesLocationPath(const XercesLocationPath& other); XercesLocationPath& operator= (const XercesLocationPath& other); // ----------------------------------------------------------------------- // Data members // ----------------------------------------------------------------------- RefVectorOf* fSteps; }; class VALIDATORS_EXPORT XercesXPath : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Constants // ----------------------------------------------------------------------- /** * [28] ExprToken ::= '(' | ')' | '[' | ']' | '.' | '..' | '@' | ',' | '::' * | NameTest | NodeType | Operator | FunctionName * | AxisName | Literal | Number | VariableReference */ enum { EXPRTOKEN_OPEN_PAREN = 0, EXPRTOKEN_CLOSE_PAREN = 1, EXPRTOKEN_OPEN_BRACKET = 2, EXPRTOKEN_CLOSE_BRACKET = 3, EXPRTOKEN_PERIOD = 4, EXPRTOKEN_DOUBLE_PERIOD = 5, EXPRTOKEN_ATSIGN = 6, EXPRTOKEN_COMMA = 7, EXPRTOKEN_DOUBLE_COLON = 8, EXPRTOKEN_NAMETEST_ANY = 9, EXPRTOKEN_NAMETEST_NAMESPACE = 10, EXPRTOKEN_NAMETEST_QNAME = 11, EXPRTOKEN_NODETYPE_COMMENT = 12, EXPRTOKEN_NODETYPE_TEXT = 13, EXPRTOKEN_NODETYPE_PI = 14, EXPRTOKEN_NODETYPE_NODE = 15, EXPRTOKEN_OPERATOR_AND = 16, EXPRTOKEN_OPERATOR_OR = 17, EXPRTOKEN_OPERATOR_MOD = 18, EXPRTOKEN_OPERATOR_DIV = 19, EXPRTOKEN_OPERATOR_MULT = 20, EXPRTOKEN_OPERATOR_SLASH = 21, EXPRTOKEN_OPERATOR_DOUBLE_SLASH = 22, EXPRTOKEN_OPERATOR_UNION = 23, EXPRTOKEN_OPERATOR_PLUS = 24, EXPRTOKEN_OPERATOR_MINUS = 25, EXPRTOKEN_OPERATOR_EQUAL = 26, EXPRTOKEN_OPERATOR_NOT_EQUAL = 27, EXPRTOKEN_OPERATOR_LESS = 28, EXPRTOKEN_OPERATOR_LESS_EQUAL = 29, EXPRTOKEN_OPERATOR_GREATER = 30, EXPRTOKEN_OPERATOR_GREATER_EQUAL = 31, EXPRTOKEN_FUNCTION_NAME = 32, EXPRTOKEN_AXISNAME_ANCESTOR = 33, EXPRTOKEN_AXISNAME_ANCESTOR_OR_SELF = 34, EXPRTOKEN_AXISNAME_ATTRIBUTE = 35, EXPRTOKEN_AXISNAME_CHILD = 36, EXPRTOKEN_AXISNAME_DESCENDANT = 37, EXPRTOKEN_AXISNAME_DESCENDANT_OR_SELF = 38, EXPRTOKEN_AXISNAME_FOLLOWING = 39, EXPRTOKEN_AXISNAME_FOLLOWING_SIBLING = 40, EXPRTOKEN_AXISNAME_NAMESPACE = 41, EXPRTOKEN_AXISNAME_PARENT = 42, EXPRTOKEN_AXISNAME_PRECEDING = 43, EXPRTOKEN_AXISNAME_PRECEDING_SIBLING = 44, EXPRTOKEN_AXISNAME_SELF = 45, EXPRTOKEN_LITERAL = 46, EXPRTOKEN_NUMBER = 47, EXPRTOKEN_VARIABLE_REFERENCE = 48 }; // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- XercesXPath(const XMLCh* const xpathExpr, XMLStringPool* const stringPool, XercesNamespaceResolver* const scopeContext, const unsigned int emptyNamespaceId, const bool isSelector = false, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~XercesXPath(); // ----------------------------------------------------------------------- // Operators // ----------------------------------------------------------------------- bool operator== (const XercesXPath& other) const; bool operator!= (const XercesXPath& other) const; // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- RefVectorOf* getLocationPaths() const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XercesXPath) XercesXPath(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); XMLCh* getExpression(); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XercesXPath(const XercesXPath& other); XercesXPath& operator= (const XercesXPath& other); // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- void cleanUp(); void checkForSelectedAttributes(); void parseExpression(XMLStringPool* const stringPool, XercesNamespaceResolver* const scopeContext); // ----------------------------------------------------------------------- // Data members // ----------------------------------------------------------------------- unsigned int fEmptyNamespaceId; XMLCh* fExpression; RefVectorOf* fLocationPaths; MemoryManager* fMemoryManager; }; class VALIDATORS_EXPORT XPathScanner : public XMemory { public: // ----------------------------------------------------------------------- // Constants // ----------------------------------------------------------------------- enum { CHARTYPE_INVALID = 0, // invalid XML character CHARTYPE_OTHER = 1, // not special - one of "#%&;?\^`{}~" or DEL CHARTYPE_WHITESPACE = 2, // one of "\t\n\r " (0x09, 0x0A, 0x0D, 0x20) CHARTYPE_EXCLAMATION = 3, // '!' (0x21) CHARTYPE_QUOTE = 4, // '\"' or '\'' (0x22 and 0x27) CHARTYPE_DOLLAR = 5, // '$' (0x24) CHARTYPE_OPEN_PAREN = 6, // '(' (0x28) CHARTYPE_CLOSE_PAREN = 7, // ')' (0x29) CHARTYPE_STAR = 8, // '*' (0x2A) CHARTYPE_PLUS = 9, // '+' (0x2B) CHARTYPE_COMMA = 10, // ',' (0x2C) CHARTYPE_MINUS = 11, // '-' (0x2D) CHARTYPE_PERIOD = 12, // '.' (0x2E) CHARTYPE_SLASH = 13, // '/' (0x2F) CHARTYPE_DIGIT = 14, // '0'-'9' (0x30 to 0x39) CHARTYPE_COLON = 15, // ':' (0x3A) CHARTYPE_LESS = 16, // '<' (0x3C) CHARTYPE_EQUAL = 17, // '=' (0x3D) CHARTYPE_GREATER = 18, // '>' (0x3E) CHARTYPE_ATSIGN = 19, // '@' (0x40) CHARTYPE_LETTER = 20, // 'A'-'Z' or 'a'-'z' (0x41 to 0x5A and 0x61 to 0x7A) CHARTYPE_OPEN_BRACKET = 21, // '[' (0x5B) CHARTYPE_CLOSE_BRACKET = 22, // ']' (0x5D) CHARTYPE_UNDERSCORE = 23, // '_' (0x5F) CHARTYPE_UNION = 24, // '|' (0x7C) CHARTYPE_NONASCII = 25 // Non-ASCII Unicode codepoint (>= 0x80) }; // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- XPathScanner(XMLStringPool* const stringPool); virtual ~XPathScanner() {} // ----------------------------------------------------------------------- // Scan methods // ----------------------------------------------------------------------- bool scanExpression(const XMLCh* const data, XMLSize_t currentOffset, const XMLSize_t endOffset, ValueVectorOf* const tokens); protected: // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- /** * This method adds the specified token to the token list. By default, * this method allows all tokens. However, subclasses can can override * this method in order to disallow certain tokens from being used in the * scanned XPath expression. This is a convenient way of allowing only * a subset of XPath. */ virtual void addToken(ValueVectorOf* const tokens, const int aToken); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XPathScanner(const XPathScanner& other); XPathScanner& operator= (const XPathScanner& other); // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- void init(); // ----------------------------------------------------------------------- // Scan methods // ----------------------------------------------------------------------- XMLSize_t scanNCName(const XMLCh* const data, const XMLSize_t endOffset, XMLSize_t currentOffset); XMLSize_t scanNumber(const XMLCh* const data, const XMLSize_t endOffset, XMLSize_t currentOffset, ValueVectorOf* const tokens); // ----------------------------------------------------------------------- // Data members // ----------------------------------------------------------------------- int fAndSymbol; int fOrSymbol; int fModSymbol; int fDivSymbol; int fCommentSymbol; int fTextSymbol; int fPISymbol; int fNodeSymbol; int fAncestorSymbol; int fAncestorOrSelfSymbol; int fAttributeSymbol; int fChildSymbol; int fDescendantSymbol; int fDescendantOrSelfSymbol; int fFollowingSymbol; int fFollowingSiblingSymbol; int fNamespaceSymbol; int fParentSymbol; int fPrecedingSymbol; int fPrecedingSiblingSymbol; int fSelfSymbol; XMLStringPool* fStringPool; static const XMLByte fASCIICharMap[128]; }; class VALIDATORS_EXPORT XPathScannerForSchema: public XPathScanner { public: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- XPathScannerForSchema(XMLStringPool* const stringPool); ~XPathScannerForSchema() {} protected: // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- void addToken(ValueVectorOf* const tokens, const int aToken); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XPathScannerForSchema(const XPathScannerForSchema& other); XPathScannerForSchema& operator= (const XPathScannerForSchema& other); }; // --------------------------------------------------------------------------- // XercesLocationPath: Access methods // --------------------------------------------------------------------------- inline XMLSize_t XercesLocationPath::getStepSize() const { if (fSteps) return fSteps->size(); return 0; } inline void XercesLocationPath::addStep(XercesStep* const aStep) { fSteps->addElement(aStep); } inline XercesStep* XercesLocationPath::getStep(const XMLSize_t index) const { if (fSteps) return fSteps->elementAt(index); return 0; } // --------------------------------------------------------------------------- // XercesScanner: Helper methods // --------------------------------------------------------------------------- inline void XPathScanner::addToken(ValueVectorOf* const tokens, const int aToken) { tokens->addElement(aToken); } // --------------------------------------------------------------------------- // XercesXPath: Getter methods // --------------------------------------------------------------------------- inline RefVectorOf* XercesXPath::getLocationPaths() const { return fLocationPaths; } inline XMLCh* XercesXPath::getExpression() { return fExpression; } XERCES_CPP_NAMESPACE_END #endif /** * End of file XercesPath.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/ValueStore.cpp000644 000765 000024 00000025704 13241160332 026327 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ValueStore.cpp 804209 2009-08-14 13:15:05Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // // --------------------------------------------------------------------------- // ICValueHasher: the hasher for identity constraints values // --------------------------------------------------------------------------- XMLSize_t ICValueHasher::getHashVal(const void* key, XMLSize_t mod) const { const FieldValueMap* valueMap=(const FieldValueMap*)key; XMLSize_t hashVal = 0; XMLSize_t size = valueMap->size(); for (XMLSize_t j=0; jgetDatatypeValidatorAt(j); while(dv && dv->getBaseValidator()) dv = dv->getBaseValidator(); const XMLCh* const val = valueMap->getValueAt(j); const XMLCh* canonVal = (dv && val)?dv->getCanonicalRepresentation(val, fMemoryManager):0; if(canonVal) { hashVal += XMLString::hash(canonVal, mod); fMemoryManager->deallocate((void*)canonVal); } else if(val) hashVal += XMLString::hash(val, mod); } return hashVal % mod; } bool ICValueHasher::equals(const void *const key1, const void *const key2) const { const FieldValueMap* left=(const FieldValueMap*)key1; const FieldValueMap* right=(const FieldValueMap*)key2; XMLSize_t lSize = left->size(); XMLSize_t rSize = right->size(); if (lSize == rSize) { bool matchFound = true; for (XMLSize_t j=0; jgetDatatypeValidatorAt(j), left->getValueAt(j), right->getDatatypeValidatorAt(j), right->getValueAt(j))) { matchFound = false; break; } } if (matchFound) { // found it return true; } } return false; } bool ICValueHasher::isDuplicateOf(DatatypeValidator* const dv1, const XMLCh* const val1, DatatypeValidator* const dv2, const XMLCh* const val2) const { // if either validator's null, fall back on string comparison if(!dv1 || !dv2) { return (XMLString::equals(val1, val2)); } bool val1IsEmpty = (val1==0 || *val1==0); bool val2IsEmpty = (val2==0 || *val2==0); if (val1IsEmpty && val2IsEmpty) { if (dv1 == dv2) { return true; } return false; } if (val1IsEmpty || val2IsEmpty) { return false; } // find the common ancestor, if there is one DatatypeValidator* tempVal1 = dv1; while(tempVal1) { DatatypeValidator* tempVal2 = dv2; for(; tempVal2 != NULL && tempVal2 != tempVal1; tempVal2 = tempVal2->getBaseValidator()) ; if (tempVal2) return ((tempVal2->compare(val1, val2, fMemoryManager)) == 0); tempVal1=tempVal1->getBaseValidator(); } // if we're here it means the types weren't related. They are different: return false; } // --------------------------------------------------------------------------- // ValueStore: Constructors and Destructor // --------------------------------------------------------------------------- ValueStore::ValueStore(IdentityConstraint* const ic, XMLScanner* const scanner, MemoryManager* const manager) : fDoReportError(false) , fValuesCount(0) , fIdentityConstraint(ic) , fValues(manager) , fValueTuples(0) , fScanner(scanner) , fMemoryManager(manager) { fDoReportError = (scanner && (scanner->getValidationScheme() == XMLScanner::Val_Always)); } ValueStore::~ValueStore() { delete fValueTuples; } // --------------------------------------------------------------------------- // ValueStore: Helper methods // --------------------------------------------------------------------------- void ValueStore::addValue(FieldActivator* const fieldActivator, IC_Field* const field, DatatypeValidator* const dv, const XMLCh* const value) { if (!fieldActivator->getMayMatch(field) && fDoReportError) { fScanner->getValidator()->emitError(XMLValid::IC_FieldMultipleMatch); } // do we even know this field? XMLSize_t index; bool bFound = fValues.indexOf(field, index); if (!bFound) { if (fDoReportError) { fScanner->getValidator()->emitError(XMLValid::IC_UnknownField); } return; } // store value if (!fValues.getDatatypeValidatorAt(index) && !fValues.getValueAt(index)) { fValuesCount++; } fValues.put(field, dv, value); if (fValuesCount == fValues.size()) { // is this value as a group duplicated? if (contains(&fValues)) { duplicateValue(); } // store values if (!fValueTuples) { fValueTuples = new (fMemoryManager) RefHashTableOf(107, true, ICValueHasher(fMemoryManager), fMemoryManager); } FieldValueMap* pICItem = new (fMemoryManager) FieldValueMap(fValues); fValueTuples->put(pICItem, pICItem); } } void ValueStore::append(const ValueStore* const other) { if (!other->fValueTuples) { return; } RefHashTableOfEnumerator iter(other->fValueTuples, false, fMemoryManager); while(iter.hasMoreElements()) { FieldValueMap& valueMap = iter.nextElement(); if (!contains(&valueMap)) { if (!fValueTuples) { fValueTuples = new (fMemoryManager) RefHashTableOf(107, true, ICValueHasher(fMemoryManager), fMemoryManager); } FieldValueMap* pICItem = new (fMemoryManager) FieldValueMap(valueMap); fValueTuples->put(pICItem, pICItem); } } } void ValueStore::startValueScope() { fValuesCount = 0; XMLSize_t count = fIdentityConstraint->getFieldCount(); for (XMLSize_t i = 0; i < count; i++) { fValues.put(fIdentityConstraint->getFieldAt(i), 0, 0); } } void ValueStore::endValueScope() { if (fValuesCount == 0) { if (fIdentityConstraint->getType() == IdentityConstraint::ICType_KEY && fDoReportError) { fScanner->getValidator()->emitError(XMLValid::IC_AbsentKeyValue, fIdentityConstraint->getElementName()); } return; } // do we have enough values? if ((fValuesCount != fIdentityConstraint->getFieldCount()) && fDoReportError) { if(fIdentityConstraint->getType()==IdentityConstraint::ICType_KEY) { fScanner->getValidator()->emitError(XMLValid::IC_KeyNotEnoughValues, fIdentityConstraint->getElementName(), fIdentityConstraint->getIdentityConstraintName()); } } } bool ValueStore::contains(const FieldValueMap* const other) { if (fValueTuples) return fValueTuples->get(other)!=0; return false; } void ValueStore::clear() { fValuesCount=0; fValues.clear(); if(fValueTuples) fValueTuples->removeAll(); } // --------------------------------------------------------------------------- // ValueStore: Document handling methods // --------------------------------------------------------------------------- void ValueStore::endDocumentFragment(ValueStoreCache* const valueStoreCache) { if (fIdentityConstraint->getType() == IdentityConstraint::ICType_KEYREF) { // verify references // get the key store corresponding (if it exists): ValueStore* keyValueStore = valueStoreCache->getGlobalValueStoreFor(((IC_KeyRef*) fIdentityConstraint)->getKey()); if (!keyValueStore) { if (fDoReportError) { fScanner->getValidator()->emitError(XMLValid::IC_KeyRefOutOfScope, fIdentityConstraint->getIdentityConstraintName()); } return; } if(fValueTuples) { RefHashTableOfEnumerator iter(fValueTuples, false, fMemoryManager); while(iter.hasMoreElements()) { FieldValueMap& valueMap = iter.nextElement(); if (!keyValueStore->contains(&valueMap) && fDoReportError) { fScanner->getValidator()->emitError(XMLValid::IC_KeyNotFound, fIdentityConstraint->getElementName()); } } } } } // --------------------------------------------------------------------------- // ValueStore: Error reporting methods // --------------------------------------------------------------------------- void ValueStore::reportNilError(IdentityConstraint* const ic) { if (fDoReportError && ic->getType() == IdentityConstraint::ICType_KEY) { fScanner->getValidator()->emitError(XMLValid::IC_KeyMatchesNillable, ic->getElementName()); } } void ValueStore::duplicateValue() { if (fDoReportError) { switch (fIdentityConstraint->getType()) { case IdentityConstraint::ICType_UNIQUE: { fScanner->getValidator()->emitError(XMLValid::IC_DuplicateUnique, fIdentityConstraint->getElementName()); break; } case IdentityConstraint::ICType_KEY: { fScanner->getValidator()->emitError(XMLValid::IC_DuplicateKey, fIdentityConstraint->getElementName()); break; } } } } XERCES_CPP_NAMESPACE_END /** * End of file ValueStore.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/IC_Unique.cpp000644 000765 000024 00000003667 13241160332 026063 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IC_Unique.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // IC_Unique: Constructors and Destructor // --------------------------------------------------------------------------- IC_Unique::IC_Unique(const XMLCh* const identityConstraintName, const XMLCh* const elemName, MemoryManager* const manager) : IdentityConstraint(identityConstraintName, elemName, manager) { } IC_Unique::~IC_Unique() { } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(IC_Unique) void IC_Unique::serialize(XSerializeEngine& serEng) { IdentityConstraint::serialize(serEng); //no data } IC_Unique::IC_Unique(MemoryManager* const manager) :IdentityConstraint(0, 0, manager) { } XERCES_CPP_NAMESPACE_END /** * End of file IC_Unique.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/IC_KeyRef.hpp000644 000765 000024 00000006066 13241160332 026003 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IC_KeyRef.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_IC_KEYREF_HPP) #define XERCESC_INCLUDE_GUARD_IC_KEYREF_HPP // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT IC_KeyRef: public IdentityConstraint { public: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- IC_KeyRef(const XMLCh* const identityConstraintName, const XMLCh* const elemName, IdentityConstraint* const icKey, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~IC_KeyRef(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- short getType() const; IdentityConstraint* getKey() const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(IC_KeyRef) IC_KeyRef(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- IC_KeyRef(const IC_KeyRef& other); IC_KeyRef& operator= (const IC_KeyRef& other); // ----------------------------------------------------------------------- // Data members // ----------------------------------------------------------------------- IdentityConstraint* fKey; }; // --------------------------------------------------------------------------- // IC_KeyRef: Getter methods // --------------------------------------------------------------------------- inline short IC_KeyRef::getType() const { return IdentityConstraint::ICType_KEYREF; } inline IdentityConstraint* IC_KeyRef::getKey() const { return fKey; } XERCES_CPP_NAMESPACE_END #endif /** * End of file IC_KeyRef.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/IC_Key.hpp000644 000765 000024 00000005213 13241160332 025337 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IC_Key.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_IC_KEY_HPP) #define XERCESC_INCLUDE_GUARD_IC_KEY_HPP // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT IC_Key: public IdentityConstraint { public: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- IC_Key(const XMLCh* const identityConstraintName, const XMLCh* const elemName, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~IC_Key(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- short getType() const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(IC_Key) IC_Key(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- IC_Key(const IC_Key& other); IC_Key& operator= (const IC_Key& other); }; // --------------------------------------------------------------------------- // IC_Key: Getter methods // --------------------------------------------------------------------------- inline short IC_Key::getType() const { return IdentityConstraint::ICType_KEY; } XERCES_CPP_NAMESPACE_END #endif /** * End of file IC_Key.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/IC_Selector.cpp000644 000765 000024 00000015477 13241160332 026377 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IC_Selector.cpp 1515307 2013-08-19 08:03:01Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // SelectorMatcher: Constructors and Destructor // --------------------------------------------------------------------------- SelectorMatcher::SelectorMatcher(XercesXPath* const xpath, IC_Selector* const selector, FieldActivator* const fieldActivator, const int initialDepth, MemoryManager* const manager) : XPathMatcher(xpath, selector->getIdentityConstraint(), manager) , fInitialDepth(initialDepth) , fElementDepth(0) , fMatchedDepth(0) , fSelector(selector) , fFieldActivator(fieldActivator) { fMatchedDepth = (int*) fMemoryManager->allocate ( fLocationPathSize * sizeof(int) );//new int[fLocationPathSize]; for(XMLSize_t k = 0;kdeallocate(fMatchedDepth);//delete [] fMatchedDepth; } // --------------------------------------------------------------------------- // FieldMatcher: XMLDocumentHandler methods // --------------------------------------------------------------------------- void SelectorMatcher::startDocumentFragment() { XPathMatcher::startDocumentFragment(); fElementDepth = 0; for(XMLSize_t k = 0;k& attrList, const XMLSize_t attrCount, ValidationContext* validationContext /*=0*/) { XPathMatcher::startElement(elemDecl, urlId, elemPrefix, attrList, attrCount, validationContext); fElementDepth++; for(XMLSize_t k = 0;kgetIdentityConstraint(); XMLSize_t count = ic->getFieldCount(); fMatchedDepth[k] = fElementDepth; fFieldActivator->startValueScopeFor(ic, fInitialDepth); for (XMLSize_t i = 0; i < count; i++) { XPathMatcher* matcher = fFieldActivator->activateField(ic->getFieldAt(i), fInitialDepth); matcher->startElement(elemDecl, urlId, elemPrefix, attrList, attrCount, validationContext); } break; } } } void SelectorMatcher::endElement(const XMLElementDecl& elemDecl, const XMLCh* const elemContent, ValidationContext* validationContext /*=0*/, DatatypeValidator* actualValidator /*=0*/) { XPathMatcher::endElement(elemDecl, elemContent, validationContext, actualValidator); for(XMLSize_t k = 0;kendValueScopeFor(fSelector->getIdentityConstraint(), fInitialDepth); break; } } --fElementDepth; } // --------------------------------------------------------------------------- // IC_Selector: Constructors and Destructor // --------------------------------------------------------------------------- IC_Selector::IC_Selector(XercesXPath* const xpath, IdentityConstraint* const identityConstraint) : fXPath(xpath) , fIdentityConstraint(identityConstraint) { } IC_Selector::~IC_Selector() { delete fXPath; } // --------------------------------------------------------------------------- // IC_Selector: operators // --------------------------------------------------------------------------- bool IC_Selector::operator ==(const IC_Selector& other) const { return (*fXPath == *(other.fXPath)); } bool IC_Selector::operator !=(const IC_Selector& other) const { return !operator==(other); } // --------------------------------------------------------------------------- // IC_Selector: Factory methods // --------------------------------------------------------------------------- XPathMatcher* IC_Selector::createMatcher(FieldActivator* const fieldActivator, const int initialDepth, MemoryManager* const manager) { return new (manager) SelectorMatcher(fXPath, this, fieldActivator, initialDepth, manager); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(IC_Selector) void IC_Selector::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng<>fXPath; fIdentityConstraint = IdentityConstraint::loadIC(serEng); } } IC_Selector::IC_Selector(MemoryManager* const ) :fXPath(0) ,fIdentityConstraint(0) { } XERCES_CPP_NAMESPACE_END /** * End of file IC_Selector.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/ValueStoreCache.hpp000644 000765 000024 00000015736 13241160332 027264 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ValueStoreCache.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_VALUESTORECACHE_HPP) #define XERCESC_INCLUDE_GUARD_VALUESTORECACHE_HPP /** * This class is used to store the values for identity constraints. * * Sketch of algorithm: * - When a constraint is first encountered, its values are stored in the * (local) fIC2ValueStoreMap; * - Once it is validated (i.e., when it goes out of scope), its values are * merged into the fGlobalICMap; * - As we encounter keyref's, we look at the global table to validate them. * - Validation always occurs against the fGlobalIDConstraintMap (which * comprises all the "eligible" id constraints). When an endelement is * found, this Hashtable is merged with the one below in the stack. When a * start tag is encountered, we create a new fGlobalICMap. * i.e., the top of the fGlobalIDMapStack always contains the preceding * siblings' eligible id constraints; the fGlobalICMap contains * descendants+self. Keyrefs can only match descendants+self. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Forward Declaration // --------------------------------------------------------------------------- class ValueStore; class SchemaElementDecl; class XMLScanner; class VALIDATORS_EXPORT ValueStoreCache : public XMemory { public: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- ValueStoreCache(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~ValueStoreCache(); // ----------------------------------------------------------------------- // Setter Methods // ----------------------------------------------------------------------- void setScanner(XMLScanner* const scanner); // ----------------------------------------------------------------------- // Document Handling methods // ----------------------------------------------------------------------- void startDocument(); void startElement(); void endElement(); void endDocument(); // ----------------------------------------------------------------------- // Initialization methods // ----------------------------------------------------------------------- void initValueStoresFor(SchemaElementDecl* const elemDecl, const int initialDepth); // ----------------------------------------------------------------------- // Access methods // ----------------------------------------------------------------------- ValueStore* getValueStoreFor(const IC_Field* const field, const int initialDepth); ValueStore* getValueStoreFor(const IdentityConstraint* const ic, const int initialDepth); ValueStore* getGlobalValueStoreFor(const IdentityConstraint* const ic); // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- /** This method takes the contents of the (local) ValueStore associated * with ic and moves them into the global hashtable, if ic is a * or a . If it's a , then we leave it for later. */ void transplant(IdentityConstraint* const ic, const int initialDepth); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ValueStoreCache(const ValueStoreCache& other); ValueStoreCache& operator= (const ValueStoreCache& other); // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- void init(); void cleanUp(); // ----------------------------------------------------------------------- // Data // ----------------------------------------------------------------------- RefVectorOf* fValueStores; RefHashTableOf* fGlobalICMap; RefHash2KeysTableOf* fIC2ValueStoreMap; RefStackOf >* fGlobalMapStack; XMLScanner* fScanner; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // ValueStoreCache: Access methods // --------------------------------------------------------------------------- inline void ValueStoreCache::setScanner(XMLScanner* const scanner) { fScanner = scanner; } // --------------------------------------------------------------------------- // ValueStoreCache: Access methods // --------------------------------------------------------------------------- inline ValueStore* ValueStoreCache::getValueStoreFor(const IC_Field* const field, const int initialDepth) { return fIC2ValueStoreMap->get(field->getIdentityConstraint(), initialDepth); } inline ValueStore* ValueStoreCache::getValueStoreFor(const IdentityConstraint* const ic, const int initialDepth) { return fIC2ValueStoreMap->get(ic, initialDepth); } inline ValueStore* ValueStoreCache::getGlobalValueStoreFor(const IdentityConstraint* const ic) { return fGlobalICMap->get(ic); } // --------------------------------------------------------------------------- // ValueStoreCache: Document handling methods // --------------------------------------------------------------------------- inline void ValueStoreCache::endDocument() { } XERCES_CPP_NAMESPACE_END #endif /** * End of file ValueStoreCache.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/IC_Field.cpp000644 000765 000024 00000011037 13241160332 025626 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IC_Field.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // FieldMatcher: Constructors and Destructor // --------------------------------------------------------------------------- FieldMatcher::FieldMatcher(XercesXPath* const xpath, IC_Field* const aField, ValueStore* const valueStore, FieldActivator* const fieldActivator, MemoryManager* const manager) : XPathMatcher(xpath, (IdentityConstraint*) 0, manager) , fValueStore(valueStore) , fField(aField) , fFieldActivator(fieldActivator) { } // --------------------------------------------------------------------------- // FieldMatcher: Match methods // --------------------------------------------------------------------------- void FieldMatcher::matched(const XMLCh* const content, DatatypeValidator* const dv, const bool isNil) { if(isNil) { fValueStore->reportNilError(fField->getIdentityConstraint()); } fValueStore->addValue(fFieldActivator, fField, dv, content); // once we've stored the value for this field, we set the mayMatch // member to false so that, in the same scope, we don't match any more // values (and throw an error instead). fFieldActivator->setMayMatch(fField, false); } // --------------------------------------------------------------------------- // IC_Field: Constructors and Destructor // --------------------------------------------------------------------------- IC_Field::IC_Field(XercesXPath* const xpath, IdentityConstraint* const identityConstraint) : fXPath(xpath) , fIdentityConstraint(identityConstraint) { } IC_Field::~IC_Field() { delete fXPath; } // --------------------------------------------------------------------------- // IC_Field: operators // --------------------------------------------------------------------------- bool IC_Field::operator== (const IC_Field& other) const { return (*fXPath == *(other.fXPath)); } bool IC_Field::operator!= (const IC_Field& other) const { return !operator==(other); } // --------------------------------------------------------------------------- // IC_Field: Factory methods // --------------------------------------------------------------------------- XPathMatcher* IC_Field::createMatcher(FieldActivator* const fieldActivator, ValueStore* const valueStore, MemoryManager* const manager) { return new (manager) FieldMatcher(fXPath, this, valueStore, fieldActivator, manager); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(IC_Field) void IC_Field::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng<>fXPath; fIdentityConstraint = IdentityConstraint::loadIC(serEng); } } IC_Field::IC_Field(MemoryManager* const ) :fXPath(0) ,fIdentityConstraint(0) { } XERCES_CPP_NAMESPACE_END /** * End of file IC_Field.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/XPathMatcherStack.hpp000644 000765 000024 00000011445 13241160332 027556 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XPathMatcherStack.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XPATHMATCHERSTACK_HPP) #define XERCESC_INCLUDE_GUARD_XPATHMATCHERSTACK_HPP // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT XPathMatcherStack : public XMemory { public: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- XPathMatcherStack(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~XPathMatcherStack(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- XPathMatcher* getMatcherAt(const XMLSize_t index) const; XMLSize_t getMatcherCount() const; XMLSize_t size() const; // ----------------------------------------------------------------------- // Access methods // ----------------------------------------------------------------------- void addMatcher(XPathMatcher* const matcher); // ----------------------------------------------------------------------- // Stack methods // ----------------------------------------------------------------------- void pushContext(); void popContext(); // ----------------------------------------------------------------------- // Reset methods // ----------------------------------------------------------------------- void clear(); private: // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void cleanUp(); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XPathMatcherStack(const XPathMatcherStack& other); XPathMatcherStack& operator= (const XPathMatcherStack& other); // ----------------------------------------------------------------------- // Data members // ----------------------------------------------------------------------- unsigned int fMatchersCount; ValueStackOf* fContextStack; RefVectorOf* fMatchers; }; // --------------------------------------------------------------------------- // XPathMatcherStack: Getter methods // --------------------------------------------------------------------------- inline XMLSize_t XPathMatcherStack::size() const { return fContextStack->size(); } inline XMLSize_t XPathMatcherStack::getMatcherCount() const { return fMatchersCount; } inline XPathMatcher* XPathMatcherStack::getMatcherAt(const XMLSize_t index) const { return fMatchers->elementAt(index); } // --------------------------------------------------------------------------- // XPathMatcherStack: Stack methods // --------------------------------------------------------------------------- inline void XPathMatcherStack::pushContext() { fContextStack->push(fMatchersCount); } inline void XPathMatcherStack::popContext() { fMatchersCount = fContextStack->pop(); } // --------------------------------------------------------------------------- // XPathMatcherStack: Access methods // --------------------------------------------------------------------------- inline void XPathMatcherStack::addMatcher(XPathMatcher* const matcher) { if (fMatchersCount == fMatchers->size()) { fMatchers->addElement(matcher); fMatchersCount++; } else { fMatchers->setElementAt(matcher, fMatchersCount++); } } XERCES_CPP_NAMESPACE_END #endif /** * End of file XPathMatcherStack.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/XercesXPath.cpp000644 000765 000024 00000147634 13241160332 026443 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XercesXPath.cpp 903997 2010-01-28 08:28:06Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Static data // --------------------------------------------------------------------------- const XMLByte XPathScanner::fASCIICharMap[128] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 1, 5, 1, 1, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 1, 16, 17, 18, 1, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 1, 22, 1, 23, 1, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 1, 24, 1, 1, 1 }; // --------------------------------------------------------------------------- // XercesNodeTest: Constructors and Destructor // --------------------------------------------------------------------------- XercesNodeTest::XercesNodeTest(const short aType, MemoryManager* const manager) : fType(aType) , fName(new (manager) QName(manager)) { } XercesNodeTest::XercesNodeTest(const QName* const qName) : fType(NodeType_QNAME) , fName(new (qName->getMemoryManager()) QName(*qName)) { } XercesNodeTest::XercesNodeTest(const XMLCh* const prefix, const unsigned int uriId, MemoryManager* const manager) : fType(NodeType_NAMESPACE) , fName(new (manager) QName(manager)) { fName->setURI(uriId); fName->setPrefix(prefix); } XercesNodeTest::XercesNodeTest(const XercesNodeTest& other) : XSerializable(other) , XMemory(other) , fType(other.fType) , fName(new ((other.fName)->getMemoryManager()) QName(*other.fName)) { } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(XercesNodeTest) void XercesNodeTest::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng<>fType; serEng>>fName; } } XercesNodeTest::XercesNodeTest(MemoryManager* const) :fType(NodeType_UNKNOWN) ,fName(0) { } // --------------------------------------------------------------------------- // XercesNodeTest: Operators // --------------------------------------------------------------------------- XercesNodeTest& XercesNodeTest::operator=(const XercesNodeTest& other) { if (this == &other) return *this; fType = other.fType; fName->setValues(*(other.fName)); return *this; } bool XercesNodeTest::operator ==(const XercesNodeTest& other) const { if (this == &other) return true; if (fType != other.fType) return false; return (*fName == *(other.fName)); } bool XercesNodeTest::operator !=(const XercesNodeTest& other) const { return !operator==(other); } // --------------------------------------------------------------------------- // XercesStep: Constructors and Destructor // --------------------------------------------------------------------------- XercesStep::XercesStep(const unsigned short axisType, XercesNodeTest* const nodeTest) : fAxisType(axisType) , fNodeTest(nodeTest) { } XercesStep::XercesStep(const XercesStep& other) : XSerializable(other) , XMemory(other) , fAxisType(other.fAxisType) , fNodeTest(0) { fNodeTest = new (other.fNodeTest->getName()->getMemoryManager()) XercesNodeTest(*(other.fNodeTest)); } // --------------------------------------------------------------------------- // XercesStep: Operators // --------------------------------------------------------------------------- XercesStep& XercesStep::operator=(const XercesStep& other) { if (this == &other) return *this; fAxisType = other.fAxisType; *fNodeTest = *(other.fNodeTest); return *this; } bool XercesStep::operator==(const XercesStep& other) const { if (this == &other) return true; if (fAxisType != other.fAxisType) return false; if (fAxisType == XercesStep::AxisType_CHILD || fAxisType == XercesStep::AxisType_ATTRIBUTE) { return (*fNodeTest == *(other.fNodeTest)); } return true; } bool XercesStep::operator!=(const XercesStep& other) const { return !operator==(other); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(XercesStep) void XercesStep::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng<<(int)fAxisType; serEng<>i; fAxisType = (unsigned short) i; serEng>>fNodeTest; } } XercesStep::XercesStep(MemoryManager* const) :fAxisType(AxisType_UNKNOWN) ,fNodeTest(0) { } // --------------------------------------------------------------------------- // XercesLocationPath: Constructors and Destructor // --------------------------------------------------------------------------- XercesLocationPath::XercesLocationPath(RefVectorOf* const steps) : fSteps(steps) { } // --------------------------------------------------------------------------- // XercesLocationPath: Operators // --------------------------------------------------------------------------- bool XercesLocationPath::operator==(const XercesLocationPath& other) const { XMLSize_t stepsSize = fSteps->size(); if (stepsSize != other.fSteps->size()) return false; for (XMLSize_t i=0; i < stepsSize; i++) { if (*(fSteps->elementAt(i)) != *(other.fSteps->elementAt(i))) return false; } return true; } bool XercesLocationPath::operator!=(const XercesLocationPath& other) const { return !operator==(other); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(XercesLocationPath) void XercesLocationPath::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { /*** * Serialize RefVectorOf* fSteps; ***/ XTemplateSerializer::storeObject(fSteps, serEng); } else { /*** * Deserialize RefVectorOf* fSteps; ***/ XTemplateSerializer::loadObject(&fSteps, 8, true, serEng); } } XercesLocationPath::XercesLocationPath(MemoryManager* const) :fSteps(0) { } typedef JanitorMemFunCall CleanupType; // --------------------------------------------------------------------------- // XercesPath: Constructors and Destructor // --------------------------------------------------------------------------- XercesXPath::XercesXPath(const XMLCh* const xpathExpr, XMLStringPool* const stringPool, XercesNamespaceResolver* const scopeContext, const unsigned int emptyNamespaceId, const bool isSelector, MemoryManager* const manager) : fEmptyNamespaceId(emptyNamespaceId) , fExpression(0) , fLocationPaths(0) , fMemoryManager(manager) { CleanupType cleanup(this, &XercesXPath::cleanUp); try { fExpression = XMLString::replicate(xpathExpr, fMemoryManager); parseExpression(stringPool, scopeContext); if (isSelector) { checkForSelectedAttributes(); } } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XercesXPath::~XercesXPath() { cleanUp(); } // --------------------------------------------------------------------------- // XercesXPath: Operators // --------------------------------------------------------------------------- bool XercesXPath::operator==(const XercesXPath& other) const { XMLSize_t locPathSize = fLocationPaths->size(); if (locPathSize != other.fLocationPaths->size()) return false; for (XMLSize_t i=0; i < locPathSize; i++) { if (*(fLocationPaths->elementAt(i)) != *(other.fLocationPaths->elementAt(i))) return false; } return true; } bool XercesXPath::operator!=(const XercesXPath& other) const { return !operator==(other); } // --------------------------------------------------------------------------- // XercesPath: Helper methods // --------------------------------------------------------------------------- void XercesXPath::cleanUp() { fMemoryManager->deallocate(fExpression);//delete [] fExpression; delete fLocationPaths; } void XercesXPath::checkForSelectedAttributes() { // verify that an attribute is not selected XMLSize_t locSize = (fLocationPaths) ? fLocationPaths->size() : 0; for (XMLSize_t i = 0; i < locSize; i++) { XercesLocationPath* locPath = fLocationPaths->elementAt(i); XMLSize_t stepSize = locPath->getStepSize(); if (stepSize) { if (locPath->getStep(stepSize - 1)->getAxisType() == XercesStep::AxisType_ATTRIBUTE) { ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_NoAttrSelector, fMemoryManager); } } } } void XercesXPath::parseExpression(XMLStringPool* const stringPool, XercesNamespaceResolver* const scopeContext) { XMLSize_t length = XMLString::stringLen(fExpression); if (!length) { return; } ValueVectorOf tokens(16, fMemoryManager); XPathScannerForSchema scanner(stringPool); if(!scanner.scanExpression(fExpression, 0, length, &tokens)) ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_TokenNotSupported, fMemoryManager); bool firstTokenOfLocationPath=true; XMLSize_t tokenCount = tokens.size(); RefVectorOf* stepsVector = new (fMemoryManager) RefVectorOf(16, true, fMemoryManager); Janitor > janSteps(stepsVector); if (tokenCount) { fLocationPaths = new (fMemoryManager) RefVectorOf(8, true, fMemoryManager); } for (XMLSize_t i = 0; i < tokenCount; i++) { int aToken = tokens.elementAt(i); bool isNamespace=false; switch (aToken) { case XercesXPath::EXPRTOKEN_OPERATOR_UNION: { if (i == 0) { ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_NoUnionAtStart, fMemoryManager); } XMLSize_t stepsSize = stepsVector->size(); if (stepsSize == 0) { ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_NoMultipleUnion, fMemoryManager); } if(stepsVector->elementAt(0)->getAxisType()!=XercesStep::AxisType_SELF) { // prepend ./ XercesNodeTest* nodeTest = new (fMemoryManager) XercesNodeTest(XercesNodeTest::NodeType_NODE, fMemoryManager); XercesStep* step = new (fMemoryManager) XercesStep(XercesStep::AxisType_SELF, nodeTest); stepsVector->insertElementAt(step, 0); } XercesLocationPath* newPath = new (fMemoryManager) XercesLocationPath(stepsVector); janSteps.orphan(); bool bFound=false; for(XMLSize_t i=0;isize();i++) if((*(fLocationPaths->elementAt(i)))==(*newPath)) { bFound=true; break; } if(bFound) delete newPath; else fLocationPaths->addElement(newPath); stepsVector = new (fMemoryManager) RefVectorOf(16, true, fMemoryManager); janSteps.reset(stepsVector); firstTokenOfLocationPath = true; } break; case XercesXPath::EXPRTOKEN_AXISNAME_ATTRIBUTE: { // consume "::" token and drop through i++; } case XercesXPath::EXPRTOKEN_ATSIGN: { // consume QName token if (i == tokenCount - 1) { ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_MissingAttr, fMemoryManager); } aToken = tokens.elementAt(++i); if (aToken != XercesXPath::EXPRTOKEN_NAMETEST_QNAME && aToken!= XercesXPath::EXPRTOKEN_NAMETEST_ANY && aToken!= XercesXPath::EXPRTOKEN_NAMETEST_NAMESPACE) { ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_ExpectedToken1, fMemoryManager); } bool isNamespaceAtt=false; switch (aToken) { case XercesXPath::EXPRTOKEN_NAMETEST_ANY: { XercesNodeTest* nodeTest = new (fMemoryManager) XercesNodeTest(XercesNodeTest::NodeType_WILDCARD, fMemoryManager); XercesStep* step = new (fMemoryManager) XercesStep(XercesStep::AxisType_ATTRIBUTE, nodeTest); stepsVector->addElement(step); break; } case XercesXPath::EXPRTOKEN_NAMETEST_NAMESPACE: { isNamespaceAtt = true; } case XercesXPath::EXPRTOKEN_NAMETEST_QNAME: { aToken = tokens.elementAt(++i); const XMLCh* prefix = XMLUni::fgZeroLenString; unsigned int uri = fEmptyNamespaceId; if (scopeContext && aToken != -1) { prefix = stringPool->getValueForId(aToken); uri = scopeContext->getNamespaceForPrefix(prefix); } if (aToken != -1 && scopeContext && uri == fEmptyNamespaceId) { ThrowXMLwithMemMgr1(XPathException, XMLExcepts::XPath_PrefixNoURI, prefix, fMemoryManager); } if (isNamespaceAtt) { // build step XercesNodeTest* nodeTest = new (fMemoryManager) XercesNodeTest(prefix, uri, fMemoryManager); XercesStep* step = new (fMemoryManager) XercesStep(XercesStep::AxisType_ATTRIBUTE, nodeTest); stepsVector->addElement(step); break; } aToken = tokens.elementAt(++i); const XMLCh* localPart = stringPool->getValueForId(aToken); QName aQName(prefix, localPart, uri, fMemoryManager); // build step XercesNodeTest* nodeTest = new (fMemoryManager) XercesNodeTest(&aQName); XercesStep* step = new (fMemoryManager) XercesStep(XercesStep::AxisType_ATTRIBUTE, nodeTest); stepsVector->addElement(step); break; } } firstTokenOfLocationPath=false; break; } case XercesXPath::EXPRTOKEN_DOUBLE_COLON: { // should never have a bare double colon ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_NoDoubleColon, fMemoryManager); } case XercesXPath::EXPRTOKEN_AXISNAME_CHILD: { // consume "::" token and drop through i++; if (i == tokenCount - 1) { ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_ExpectedStep1, fMemoryManager); } firstTokenOfLocationPath=false; break; } case XercesXPath::EXPRTOKEN_NAMETEST_ANY: { XercesNodeTest* nodeTest = new (fMemoryManager) XercesNodeTest(XercesNodeTest::NodeType_WILDCARD, fMemoryManager); XercesStep* step = new (fMemoryManager) XercesStep(XercesStep::AxisType_CHILD, nodeTest); stepsVector->addElement(step); firstTokenOfLocationPath = false; break; } case XercesXPath::EXPRTOKEN_NAMETEST_NAMESPACE: { isNamespace=true; } case XercesXPath::EXPRTOKEN_NAMETEST_QNAME: { // consume QName token aToken = tokens.elementAt(++i); const XMLCh* prefix = XMLUni::fgZeroLenString; unsigned int uri = fEmptyNamespaceId; if (scopeContext && aToken != -1) { prefix = stringPool->getValueForId(aToken); uri = scopeContext->getNamespaceForPrefix(prefix); } if (aToken != -1 && scopeContext && uri == fEmptyNamespaceId) { ThrowXMLwithMemMgr1(XPathException, XMLExcepts::XPath_PrefixNoURI, prefix, fMemoryManager); } if (isNamespace) { // build step XercesNodeTest* nodeTest = new (fMemoryManager) XercesNodeTest(prefix, uri, fMemoryManager); XercesStep* step = new (fMemoryManager) XercesStep(XercesStep::AxisType_CHILD, nodeTest); stepsVector->addElement(step); break; } aToken = tokens.elementAt(++i); const XMLCh* localPart = stringPool->getValueForId(aToken); QName aQName(prefix, localPart, uri, fMemoryManager); // build step XercesNodeTest* nodeTest = new (fMemoryManager) XercesNodeTest(&aQName); XercesStep* step = new (fMemoryManager) XercesStep(XercesStep::AxisType_CHILD, nodeTest); stepsVector->addElement(step); firstTokenOfLocationPath = false; break; } case XercesXPath::EXPRTOKEN_PERIOD: { // build step XercesNodeTest* nodeTest = new (fMemoryManager) XercesNodeTest(XercesNodeTest::NodeType_NODE, fMemoryManager); XercesStep* step = new (fMemoryManager) XercesStep(XercesStep::AxisType_SELF, nodeTest); stepsVector->addElement(step); if (firstTokenOfLocationPath && i+1 < tokenCount) { aToken = tokens.elementAt(i+1); if (aToken == XercesXPath::EXPRTOKEN_OPERATOR_DOUBLE_SLASH){ if (++i == tokenCount - 1) { ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_ExpectedStep2, fMemoryManager); } if (i+1 < tokenCount) { aToken = tokens.elementAt(i+1); if (aToken == XercesXPath::EXPRTOKEN_OPERATOR_SLASH) { ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_NoForwardSlash, fMemoryManager); } } // build step nodeTest = new (fMemoryManager) XercesNodeTest(XercesNodeTest::NodeType_NODE, fMemoryManager); step = new (fMemoryManager) XercesStep(XercesStep::AxisType_DESCENDANT, nodeTest); stepsVector->addElement(step); } } firstTokenOfLocationPath=false; break; } case XercesXPath::EXPRTOKEN_OPERATOR_DOUBLE_SLASH: { ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_NoDoubleForwardSlash, fMemoryManager); } case XercesXPath::EXPRTOKEN_OPERATOR_SLASH: { if (i == 0) { ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_NoForwardSlashAtStart, fMemoryManager); } // keep on truckin' if (firstTokenOfLocationPath) { ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_NoSelectionOfRoot, fMemoryManager); } if (i == tokenCount - 1) { ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_ExpectedStep3, fMemoryManager); } aToken = tokens.elementAt(i+1); if(aToken == XercesXPath::EXPRTOKEN_OPERATOR_SLASH || aToken == XercesXPath::EXPRTOKEN_OPERATOR_DOUBLE_SLASH || aToken == XercesXPath::EXPRTOKEN_OPERATOR_UNION) ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_ExpectedStep3, fMemoryManager); firstTokenOfLocationPath=false; break; } default: firstTokenOfLocationPath=false; } } XMLSize_t stepsSize = stepsVector->size(); if (stepsSize == 0) { if (!fLocationPaths || fLocationPaths->size() == 0) { ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_EmptyExpr, fMemoryManager); } else { ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_NoUnionAtEnd, fMemoryManager); } } if(stepsVector->elementAt(0)->getAxisType()!=XercesStep::AxisType_SELF) { // prepend ./ XercesNodeTest* nodeTest = new (fMemoryManager) XercesNodeTest(XercesNodeTest::NodeType_NODE, fMemoryManager); XercesStep* step = new (fMemoryManager) XercesStep(XercesStep::AxisType_SELF, nodeTest); stepsVector->insertElementAt(step, 0); } XercesLocationPath* newPath = new (fMemoryManager) XercesLocationPath(stepsVector); janSteps.orphan(); bool bFound=false; for(XMLSize_t j=0;jsize();j++) if((*(fLocationPaths->elementAt(j)))==(*newPath)) { bFound=true; break; } if(bFound) delete newPath; else fLocationPaths->addElement(newPath); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(XercesXPath) void XercesXPath::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng<* fLocationPaths; ***/ XTemplateSerializer::storeObject(fLocationPaths, serEng); } else { serEng>>fEmptyNamespaceId; serEng.readString(fExpression); /*** * Deserialize RefVectorOf* fLocationPaths; ***/ XTemplateSerializer::loadObject(&fLocationPaths, 8, true, serEng); } } XercesXPath::XercesXPath(MemoryManager* const manager) :fEmptyNamespaceId(0) ,fExpression(0) ,fLocationPaths(0) ,fMemoryManager(manager) { } // --------------------------------------------------------------------------- // XPathScanner: Constructors and Destructor // --------------------------------------------------------------------------- XPathScanner::XPathScanner(XMLStringPool* const stringPool) : fAndSymbol (0) , fOrSymbol(0) , fModSymbol(0) , fDivSymbol(0) , fCommentSymbol(0) , fTextSymbol(0) , fPISymbol(0) , fNodeSymbol(0) , fAncestorSymbol(0) , fAncestorOrSelfSymbol(0) , fAttributeSymbol(0) , fChildSymbol(0) , fDescendantSymbol(0) , fDescendantOrSelfSymbol(0) , fFollowingSymbol(0) , fFollowingSiblingSymbol(0) , fNamespaceSymbol(0) , fParentSymbol(0) , fPrecedingSymbol(0) , fPrecedingSiblingSymbol(0) , fSelfSymbol(0) , fStringPool(stringPool) { init(); } // --------------------------------------------------------------------------- // XPathScanner: Helper methods // --------------------------------------------------------------------------- void XPathScanner::init() { fAndSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_AND); fOrSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_OR); fModSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_MOD); fDivSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_DIV); fCommentSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_COMMENT); fTextSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_TEXT); fPISymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_PI); fNodeSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_NODE); fAncestorSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_ANCESTOR); fAncestorOrSelfSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_ANCESTOR_OR_SELF); fAttributeSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_ATTRIBUTE); fChildSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_CHILD); fDescendantSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_DESCENDANT); fDescendantOrSelfSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_DESCENDANT_OR_SELF); fFollowingSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_FOLLOWING); fFollowingSiblingSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_FOLLOWING_SIBLING); fNamespaceSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_NAMESPACE); fParentSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_PARENT); fPrecedingSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_PRECEDING); fPrecedingSiblingSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_PRECEDING_SIBLING); fSelfSymbol = fStringPool->addOrFind(XPathSymbols::fgSYMBOL_SELF); } // --------------------------------------------------------------------------- // XPathScanner: Scan methods // --------------------------------------------------------------------------- bool XPathScanner::scanExpression(const XMLCh* const data, XMLSize_t currentOffset, const XMLSize_t endOffset, ValueVectorOf* const tokens) { bool starIsMultiplyOperator = false; XMLSize_t nameOffset = 0; int nameHandle = -1; int prefixHandle = -1; XMLCh ch; XMLBuffer dataBuffer(128, tokens->getMemoryManager()); while (currentOffset != endOffset) { ch = data[currentOffset]; while (XMLChar1_0::isWhitespace(ch)) { if (++currentOffset == endOffset) { break; } ch = data[currentOffset]; } if (currentOffset == endOffset) { break; } // // [28] ExprToken ::= '(' | ')' | '[' | ']' | '.' | '..' | '@' | ',' | '::' // | NameTest | NodeType | Operator | FunctionName // | AxisName | Literal | Number | VariableReference // XMLByte chartype = (ch >= 0x80) ? (XMLByte)CHARTYPE_NONASCII : fASCIICharMap[ch]; switch (chartype) { case CHARTYPE_OPEN_PAREN: // '(' addToken(tokens, XercesXPath::EXPRTOKEN_OPEN_PAREN); starIsMultiplyOperator = false; ++currentOffset; break; case CHARTYPE_CLOSE_PAREN: // ')' addToken(tokens, XercesXPath::EXPRTOKEN_CLOSE_PAREN); starIsMultiplyOperator = true; ++currentOffset; break; case CHARTYPE_OPEN_BRACKET: // '[' addToken(tokens, XercesXPath::EXPRTOKEN_OPEN_BRACKET); starIsMultiplyOperator = false; ++currentOffset; break; case CHARTYPE_CLOSE_BRACKET: // ']' addToken(tokens, XercesXPath::EXPRTOKEN_CLOSE_BRACKET); starIsMultiplyOperator = true; ++currentOffset; break; // // [30] Number ::= Digits ('.' Digits?)? | '.' Digits // ^^^^^^^^^^ // case CHARTYPE_PERIOD: // '.', '..' or '.' Digits if (currentOffset + 1 == endOffset) { addToken(tokens, XercesXPath::EXPRTOKEN_PERIOD); starIsMultiplyOperator = true; currentOffset++; break; } ch = data[currentOffset + 1]; if (ch == chPeriod) { // '..' addToken(tokens, XercesXPath::EXPRTOKEN_DOUBLE_PERIOD); starIsMultiplyOperator = true; currentOffset += 2; } else if (ch >= chDigit_0 && ch <= chDigit_9) { addToken(tokens, XercesXPath::EXPRTOKEN_NUMBER); starIsMultiplyOperator = true; currentOffset = scanNumber(data, endOffset, currentOffset, tokens); } else if (ch == chForwardSlash) { addToken(tokens, XercesXPath::EXPRTOKEN_PERIOD); starIsMultiplyOperator = true; currentOffset++; } else if (ch == chPipe) { // '|' addToken(tokens, XercesXPath::EXPRTOKEN_PERIOD); starIsMultiplyOperator = true; currentOffset++; } else if (XMLChar1_0::isWhitespace(ch)) { do { if (++currentOffset == endOffset) break; ch = data[currentOffset]; } while (XMLChar1_0::isWhitespace(ch)); if (currentOffset == endOffset || ch == chPipe || ch == chForwardSlash) { addToken(tokens, XercesXPath::EXPRTOKEN_PERIOD); starIsMultiplyOperator = true; break; } } else { XMLCh str[2]= {ch, 0 }; ThrowXMLwithMemMgr1(XPathException, XMLExcepts::XPath_InvalidChar, str, tokens->getMemoryManager()); } break; case CHARTYPE_ATSIGN: // '@' addToken(tokens, XercesXPath::EXPRTOKEN_ATSIGN); starIsMultiplyOperator = false; ++currentOffset; break; case CHARTYPE_COMMA: // ',' addToken(tokens, XercesXPath::EXPRTOKEN_COMMA); starIsMultiplyOperator = false; ++currentOffset; break; case CHARTYPE_COLON: // '::' if (++currentOffset == endOffset) { return false; // REVISIT } ch = data[currentOffset]; if (ch != chColon) { return false; // REVISIT } addToken(tokens, XercesXPath::EXPRTOKEN_DOUBLE_COLON); starIsMultiplyOperator = false; ++currentOffset; break; case CHARTYPE_SLASH: // '/' and '//' if (++currentOffset == endOffset) { addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_SLASH); starIsMultiplyOperator = false; break; } ch = data[currentOffset]; if (ch == chForwardSlash) { // '//' addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_DOUBLE_SLASH); starIsMultiplyOperator = false; ++currentOffset; } else { addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_SLASH); starIsMultiplyOperator = false; } break; case CHARTYPE_UNION: // '|' addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_UNION); starIsMultiplyOperator = false; ++currentOffset; break; case CHARTYPE_PLUS: // '+' addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_PLUS); starIsMultiplyOperator = false; ++currentOffset; break; case CHARTYPE_MINUS: // '-' addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_MINUS); starIsMultiplyOperator = false; ++currentOffset; break; case CHARTYPE_EQUAL: // '=' addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_EQUAL); starIsMultiplyOperator = false; ++currentOffset; break; case CHARTYPE_EXCLAMATION: // '!=' if (++currentOffset == endOffset) { return false; // REVISIT } ch = data[currentOffset]; if (ch != chEqual) { return false; // REVISIT } addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_NOT_EQUAL); starIsMultiplyOperator = false; ++currentOffset; break; case CHARTYPE_LESS: // '<' and '<=' if (++currentOffset == endOffset) { addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_LESS); starIsMultiplyOperator = false; break; } ch = data[currentOffset]; if (ch == chEqual) { // '<=' addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_LESS_EQUAL); starIsMultiplyOperator = false; ++currentOffset; } else { addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_LESS); starIsMultiplyOperator = false; } break; case CHARTYPE_GREATER: // '>' and '>=' if (++currentOffset == endOffset) { addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_GREATER); starIsMultiplyOperator = false; break; } ch = data[currentOffset]; if (ch == chEqual) { // '>=' addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_GREATER_EQUAL); starIsMultiplyOperator = false; ++currentOffset; } else { addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_GREATER); starIsMultiplyOperator = false; } break; // // [29] Literal ::= '"' [^"]* '"' | "'" [^']* "'" // case CHARTYPE_QUOTE: // '\"' or '\'' { XMLCh qchar = ch; if (++currentOffset == endOffset) { return false; // REVISIT } ch = data[currentOffset]; XMLSize_t litOffset = currentOffset; while (ch != qchar) { if (++currentOffset == endOffset) { return false; // REVISIT } ch = data[currentOffset]; } addToken(tokens, XercesXPath::EXPRTOKEN_LITERAL); starIsMultiplyOperator = true; dataBuffer.set(data + litOffset, currentOffset - litOffset); tokens->addElement(fStringPool->addOrFind(dataBuffer.getRawBuffer())); ++currentOffset; break; } // // [30] Number ::= Digits ('.' Digits?)? | '.' Digits // [31] Digits ::= [0-9]+ // case CHARTYPE_DIGIT: addToken(tokens, XercesXPath::EXPRTOKEN_NUMBER); starIsMultiplyOperator = true; currentOffset = scanNumber(data, endOffset, currentOffset, tokens); break; // // [36] VariableReference ::= '$' QName // case CHARTYPE_DOLLAR: if (++currentOffset == endOffset) { return false; // REVISIT } nameOffset = currentOffset; currentOffset = scanNCName(data, endOffset, currentOffset); if (currentOffset == nameOffset) { return false; // REVISIT } if (currentOffset < endOffset) { ch = data[currentOffset]; } else { ch = 0; } dataBuffer.set(data + nameOffset, currentOffset - nameOffset); nameHandle = fStringPool->addOrFind(dataBuffer.getRawBuffer()); prefixHandle = -1; if (ch == chColon) { prefixHandle = nameHandle; if (++currentOffset == endOffset) { return false; // REVISIT } nameOffset = currentOffset; currentOffset = scanNCName(data, endOffset, currentOffset); if (currentOffset == nameOffset) { return false; // REVISIT } dataBuffer.set(data + nameOffset, currentOffset - nameOffset); nameHandle = fStringPool->addOrFind(dataBuffer.getRawBuffer()); } addToken(tokens, XercesXPath::EXPRTOKEN_VARIABLE_REFERENCE); starIsMultiplyOperator = true; tokens->addElement(prefixHandle); tokens->addElement(nameHandle); break; // // [37] NameTest ::= '*' | NCName ':' '*' | QName // [34] MultiplyOperator ::= '*' // case CHARTYPE_STAR: // '*' // // 3.7 Lexical Structure // // If there is a preceding token and the preceding token is not one of @, ::, (, [, , or // an Operator, then a * must be recognized as a MultiplyOperator. // // Otherwise, the token must not be recognized as a MultiplyOperator. // if (starIsMultiplyOperator) { addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_MULT); starIsMultiplyOperator = false; } else { addToken(tokens, XercesXPath::EXPRTOKEN_NAMETEST_ANY); starIsMultiplyOperator = true; } ++currentOffset; break; // // NCName, QName and non-terminals // case CHARTYPE_NONASCII: // possibly a valid non-ascii 'Letter' (BaseChar | Ideographic) case CHARTYPE_LETTER: case CHARTYPE_UNDERSCORE: { // // 3.7 Lexical Structure // // If there is a preceding token and the preceding token is not one of @, ::, (, [, , or // an Operator, then an NCName must be recognized as an OperatorName. // // If the character following an NCName (possibly after intervening ExprWhitespace) is (, // then the token must be recognized as a NodeType or a FunctionName. // // If the two characters following an NCName (possibly after intervening ExprWhitespace) // are ::, then the token must be recognized as an AxisName. // // Otherwise, the token must not be recognized as an OperatorName, a NodeType, a // FunctionName, or an AxisName. // // [33] OperatorName ::= 'and' | 'or' | 'mod' | 'div' // [38] NodeType ::= 'comment' | 'text' | 'processing-instruction' | 'node' // [35] FunctionName ::= QName - NodeType // [6] AxisName ::= (see above) // // [37] NameTest ::= '*' | NCName ':' '*' | QName // [5] NCName ::= (Letter | '_') (NCNameChar)* // [?] NCNameChar ::= Letter | Digit | '.' | '-' | '_' (ascii subset of 'NCNameChar') // [?] QName ::= (NCName ':')? NCName // [?] Letter ::= [A-Za-z] (ascii subset of 'Letter') // [?] Digit ::= [0-9] (ascii subset of 'Digit') // nameOffset = currentOffset; currentOffset = scanNCName(data, endOffset, currentOffset); if (currentOffset == nameOffset) { return false; // REVISIT } if (currentOffset < endOffset) { ch = data[currentOffset]; } else { ch = 0; } dataBuffer.set(data + nameOffset, currentOffset - nameOffset); nameHandle = fStringPool->addOrFind(dataBuffer.getRawBuffer()); bool isNameTestNCName = false; bool isAxisName = false; prefixHandle = -1; if (ch == chColon) { if (++currentOffset == endOffset) { return false; // REVISIT } ch = data[currentOffset]; if (ch == chAsterisk) { if (++currentOffset < endOffset) { ch = data[currentOffset]; } isNameTestNCName = true; } else if (ch == chColon) { if (++currentOffset < endOffset) { ch = data[currentOffset]; } isAxisName = true; } else { prefixHandle = nameHandle; nameOffset = currentOffset; currentOffset = scanNCName(data, endOffset, currentOffset); if (currentOffset == nameOffset) { return false; // REVISIT } if (currentOffset < endOffset) { ch = data[currentOffset]; } else { ch = 0; } dataBuffer.set(data + nameOffset, currentOffset - nameOffset); nameHandle = fStringPool->addOrFind(dataBuffer.getRawBuffer()); } } // // [39] ExprWhitespace ::= S // while (XMLChar1_0::isWhitespace(ch)) { if (++currentOffset == endOffset) { break; } ch = data[currentOffset]; } // // If there is a preceding token and the preceding token is not one of @, ::, (, [, , or // an Operator, then an NCName must be recognized as an OperatorName. // if (starIsMultiplyOperator) { if (nameHandle == fAndSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_AND); starIsMultiplyOperator = false; } else if (nameHandle == fOrSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_OR); starIsMultiplyOperator = false; } else if (nameHandle == fModSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_MOD); starIsMultiplyOperator = false; } else if (nameHandle == fDivSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_OPERATOR_DIV); starIsMultiplyOperator = false; } else { return false; // REVISIT } if (isNameTestNCName) { return false; // REVISIT - NCName:* where an OperatorName is required } else if (isAxisName) { return false; // REVISIT - AxisName:: where an OperatorName is required } break; } // // If the character following an NCName (possibly after intervening ExprWhitespace) is (, // then the token must be recognized as a NodeType or a FunctionName. // if (ch == chOpenParen && !isNameTestNCName && !isAxisName) { if (nameHandle == fCommentSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_NODETYPE_COMMENT); } else if (nameHandle == fTextSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_NODETYPE_TEXT); } else if (nameHandle == fPISymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_NODETYPE_PI); } else if (nameHandle == fNodeSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_NODETYPE_NODE); } else { addToken(tokens, XercesXPath::EXPRTOKEN_FUNCTION_NAME); tokens->addElement(prefixHandle); tokens->addElement(nameHandle); } addToken(tokens, XercesXPath::EXPRTOKEN_OPEN_PAREN); starIsMultiplyOperator = false; ++currentOffset; break; } // // If the two characters following an NCName (possibly after intervening ExprWhitespace) // are ::, then the token must be recognized as an AxisName. // if (isAxisName || (ch == chColon && currentOffset + 1 < endOffset && data[currentOffset + 1] == chColon)) { if (nameHandle == fAncestorSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_AXISNAME_ANCESTOR); } else if (nameHandle == fAncestorOrSelfSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_AXISNAME_ANCESTOR_OR_SELF); } else if (nameHandle == fAttributeSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_AXISNAME_ATTRIBUTE); } else if (nameHandle == fChildSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_AXISNAME_CHILD); } else if (nameHandle == fDescendantSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_AXISNAME_DESCENDANT); } else if (nameHandle == fDescendantOrSelfSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_AXISNAME_DESCENDANT_OR_SELF); } else if (nameHandle == fFollowingSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_AXISNAME_FOLLOWING); } else if (nameHandle == fFollowingSiblingSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_AXISNAME_FOLLOWING_SIBLING); } else if (nameHandle == fNamespaceSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_AXISNAME_NAMESPACE); } else if (nameHandle == fParentSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_AXISNAME_PARENT); } else if (nameHandle == fPrecedingSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_AXISNAME_PRECEDING); } else if (nameHandle == fPrecedingSiblingSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_AXISNAME_PRECEDING_SIBLING); } else if (nameHandle == fSelfSymbol) { addToken(tokens, XercesXPath::EXPRTOKEN_AXISNAME_SELF); } else { return false; // REVISIT } if (isNameTestNCName) { return false; // REVISIT - "NCName:* ::" where "AxisName ::" is required } addToken(tokens, XercesXPath::EXPRTOKEN_DOUBLE_COLON); starIsMultiplyOperator = false; if (!isAxisName) { currentOffset += 2; } break; } // // Otherwise, the token must not be recognized as an OperatorName, a NodeType, a // FunctionName, or an AxisName. // if (isNameTestNCName) { addToken(tokens, XercesXPath::EXPRTOKEN_NAMETEST_NAMESPACE); tokens->addElement(nameHandle); } else { addToken(tokens, XercesXPath::EXPRTOKEN_NAMETEST_QNAME); tokens->addElement(prefixHandle); tokens->addElement(nameHandle); } starIsMultiplyOperator = true; break; } default: { XMLCh str[2]= {ch, 0 }; ThrowXMLwithMemMgr1(XPathException, XMLExcepts::XPath_InvalidChar, str, tokens->getMemoryManager()); break; } } } return true; } XMLSize_t XPathScanner::scanNCName(const XMLCh* const data, const XMLSize_t endOffset, XMLSize_t currentOffset) { XMLCh ch = data[currentOffset]; if (!XMLChar1_0::isFirstNCNameChar(ch)) { return currentOffset; } while (++currentOffset < endOffset) { ch = data[currentOffset]; if (!XMLChar1_0::isNCNameChar(ch)) { break; } } return currentOffset; } XMLSize_t XPathScanner::scanNumber(const XMLCh* const data, const XMLSize_t endOffset, XMLSize_t currentOffset, ValueVectorOf* const tokens) { XMLCh ch = data[currentOffset]; int whole = 0; int part = 0; while (ch >= chDigit_0 && ch <= chDigit_9) { whole = (whole * 10) + (ch - chDigit_0); if (++currentOffset == endOffset) { break; } ch = data[currentOffset]; } if (ch == chPeriod) { if (++currentOffset < endOffset) { ch = data[currentOffset]; while (ch >= chDigit_0 && ch <= chDigit_9) { part = (part * 10) + (ch - chDigit_0); if (++currentOffset == endOffset) { break; } ch = data[currentOffset]; } if (part != 0) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::XPath_FindSolution, tokens->getMemoryManager()); } } } tokens->addElement(whole); tokens->addElement(part); return currentOffset; } // --------------------------------------------------------------------------- // XPathScannerForSchema: Constructors and Destructor // --------------------------------------------------------------------------- XPathScannerForSchema::XPathScannerForSchema(XMLStringPool* const stringPool) : XPathScanner(stringPool) { } // --------------------------------------------------------------------------- // XPathScannerForSchema: Helper methods // --------------------------------------------------------------------------- void XPathScannerForSchema::addToken(ValueVectorOf* const tokens, const int aToken) { if (aToken == XercesXPath::EXPRTOKEN_ATSIGN || aToken == XercesXPath::EXPRTOKEN_AXISNAME_ATTRIBUTE || aToken == XercesXPath::EXPRTOKEN_AXISNAME_CHILD || //token == XercesXPath::EXPRTOKEN_AXISNAME_SELF || aToken == XercesXPath::EXPRTOKEN_DOUBLE_COLON || aToken == XercesXPath::EXPRTOKEN_NAMETEST_QNAME || //token == XercesXPath::EXPRTOKEN_NODETYPE_NODE || aToken == XercesXPath::EXPRTOKEN_OPERATOR_SLASH || aToken == XercesXPath::EXPRTOKEN_PERIOD || aToken == XercesXPath::EXPRTOKEN_NAMETEST_ANY || aToken == XercesXPath::EXPRTOKEN_NAMETEST_NAMESPACE || aToken == XercesXPath::EXPRTOKEN_OPERATOR_DOUBLE_SLASH || aToken == XercesXPath::EXPRTOKEN_OPERATOR_UNION) { tokens->addElement(aToken); return; } ThrowXMLwithMemMgr(XPathException, XMLExcepts::XPath_TokenNotSupported, tokens->getMemoryManager()); } XERCES_CPP_NAMESPACE_END /** * End of file XercesPath.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/ValueStore.hpp000644 000765 000024 00000013145 13241160332 026330 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ValueStore.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_VALUESTORE_HPP) #define XERCESC_INCLUDE_GUARD_VALUESTORE_HPP /** * This class stores values associated to an identity constraint. * Each value stored corresponds to a field declared for the identity * constraint. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Forward Declaration // --------------------------------------------------------------------------- class FieldActivator; class IdentityConstraint; class XMLScanner; class ValueStoreCache; struct ICValueHasher { ICValueHasher(MemoryManager* const manager) : fMemoryManager(manager) {} XMLSize_t getHashVal(const void* key, XMLSize_t mod) const; bool equals(const void *const key1, const void *const key2) const; // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- /** * Returns whether a field associated value * is a duplicate of another associated value. * It is a duplicate only if either of these conditions are true: * - The Datatypes are the same or related by derivation and the values * are in the same valuespace. * - The datatypes are unrelated and the values are Stringwise identical. */ bool isDuplicateOf(DatatypeValidator* const dv1, const XMLCh* const val1, DatatypeValidator* const dv2, const XMLCh* const val2) const; MemoryManager* fMemoryManager; }; class VALIDATORS_EXPORT ValueStore : public XMemory { public: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- ValueStore(IdentityConstraint* const ic, XMLScanner* const scanner, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~ValueStore(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- IdentityConstraint* getIdentityConstraint() const; // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- void append(const ValueStore* const other); void startValueScope(); void endValueScope(); void addValue(FieldActivator* const fieldActivator, IC_Field* const field, DatatypeValidator* const dv, const XMLCh* const value); bool contains(const FieldValueMap* const other); void clear(); // ----------------------------------------------------------------------- // Document handling methods // ----------------------------------------------------------------------- void endDocumentFragment(ValueStoreCache* const valueStoreCache); // ----------------------------------------------------------------------- // Error reporting methods // ----------------------------------------------------------------------- void duplicateValue(); void reportNilError(IdentityConstraint* const ic); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ValueStore(const ValueStore& other); ValueStore& operator= (const ValueStore& other); // ----------------------------------------------------------------------- // Data // ----------------------------------------------------------------------- bool fDoReportError; XMLSize_t fValuesCount; IdentityConstraint* fIdentityConstraint; FieldValueMap fValues; RefHashTableOf* fValueTuples; XMLScanner* fScanner; // for error reporting - REVISIT MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // ValueStore: Getter methods // --------------------------------------------------------------------------- inline IdentityConstraint* ValueStore::getIdentityConstraint() const { return fIdentityConstraint; } XERCES_CPP_NAMESPACE_END #endif /** * End of file ValueStore.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/IC_Unique.hpp000644 000765 000024 00000005361 13241160332 026061 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IC_Unique.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_IC_UNIQUE_HPP) #define XERCESC_INCLUDE_GUARD_IC_UNIQUE_HPP /** * Schema unique identity constraint */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT IC_Unique: public IdentityConstraint { public: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- IC_Unique(const XMLCh* const identityConstraintName, const XMLCh* const elemName, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~IC_Unique(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- short getType() const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(IC_Unique) IC_Unique(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- IC_Unique(const IC_Unique& other); IC_Unique& operator= (const IC_Unique& other); }; // --------------------------------------------------------------------------- // IC_Unique: Getter methods // --------------------------------------------------------------------------- inline short IC_Unique::getType() const { return IdentityConstraint::ICType_UNIQUE; } XERCES_CPP_NAMESPACE_END #endif /** * End of file IC_Unique.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/IC_KeyRef.cpp000644 000765 000024 00000004236 13241160332 025773 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IC_KeyRef.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // IC_KeyRef: Constructors and Destructor // --------------------------------------------------------------------------- IC_KeyRef::IC_KeyRef(const XMLCh* const identityConstraintName, const XMLCh* const elemName, IdentityConstraint* const icKey, MemoryManager* const manager) : IdentityConstraint(identityConstraintName, elemName, manager) , fKey(icKey) { } IC_KeyRef::~IC_KeyRef() { } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(IC_KeyRef) void IC_KeyRef::serialize(XSerializeEngine& serEng) { IdentityConstraint::serialize(serEng); if (serEng.isStoring()) { IdentityConstraint::storeIC(serEng, fKey); } else { fKey = IdentityConstraint::loadIC(serEng); } } IC_KeyRef::IC_KeyRef(MemoryManager* const manager) :IdentityConstraint(0, 0, manager) ,fKey(0) { } XERCES_CPP_NAMESPACE_END /** * End of file IC_KeyRef.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/IC_Key.cpp000644 000765 000024 00000003570 13241160332 025336 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IC_Key.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // IC_Key: Constructors and Destructor // --------------------------------------------------------------------------- IC_Key::IC_Key(const XMLCh* const identityConstraintName, const XMLCh* const elemName, MemoryManager* const manager) :IdentityConstraint(identityConstraintName, elemName, manager) { } IC_Key::~IC_Key() { } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(IC_Key) void IC_Key::serialize(XSerializeEngine& serEng) { IdentityConstraint::serialize(serEng); //no data } IC_Key::IC_Key(MemoryManager* const manager) :IdentityConstraint(0, 0, manager) { } XERCES_CPP_NAMESPACE_END /** * End of file IC_Key.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/IC_Selector.hpp000644 000765 000024 00000014263 13241160332 026374 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IC_Selector.hpp 1515307 2013-08-19 08:03:01Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_IC_SELECTOR_HPP) #define XERCESC_INCLUDE_GUARD_IC_SELECTOR_HPP // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Forward Declaration // --------------------------------------------------------------------------- class FieldActivator; class VALIDATORS_EXPORT IC_Selector : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- IC_Selector(XercesXPath* const xpath, IdentityConstraint* const identityConstraint); ~IC_Selector(); // ----------------------------------------------------------------------- // operators // ----------------------------------------------------------------------- bool operator== (const IC_Selector& other) const; bool operator!= (const IC_Selector& other) const; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- XercesXPath* getXPath() const { return fXPath; } IdentityConstraint* getIdentityConstraint() const { return fIdentityConstraint; } // ----------------------------------------------------------------------- // Factory methods // ----------------------------------------------------------------------- XPathMatcher* createMatcher(FieldActivator* const fieldActivator, const int initialDepth, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(IC_Selector) IC_Selector(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- IC_Selector(const IC_Selector& other); IC_Selector& operator= (const IC_Selector& other); // ----------------------------------------------------------------------- // Data members // ----------------------------------------------------------------------- XercesXPath* fXPath; IdentityConstraint* fIdentityConstraint; }; class VALIDATORS_EXPORT SelectorMatcher : public XPathMatcher { public: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- ~SelectorMatcher(); int getInitialDepth() const { return fInitialDepth; } // ----------------------------------------------------------------------- // XMLDocumentHandler methods // ----------------------------------------------------------------------- virtual void startDocumentFragment(); virtual void startElement(const XMLElementDecl& elemDecl, const unsigned int urlId, const XMLCh* const elemPrefix, const RefVectorOf& attrList, const XMLSize_t attrCount, ValidationContext* validationContext = 0); virtual void endElement(const XMLElementDecl& elemDecl, const XMLCh* const elemContent, ValidationContext* validationContext = 0, DatatypeValidator* actualValidator = 0); private: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- SelectorMatcher(XercesXPath* const anXPath, IC_Selector* const selector, FieldActivator* const fieldActivator, const int initialDepth, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- SelectorMatcher(const SelectorMatcher& other); SelectorMatcher& operator= (const SelectorMatcher& other); // ----------------------------------------------------------------------- // Friends // ----------------------------------------------------------------------- friend class IC_Selector; // ----------------------------------------------------------------------- // Data members // ----------------------------------------------------------------------- int fInitialDepth; int fElementDepth; int* fMatchedDepth; IC_Selector* fSelector; FieldActivator* fFieldActivator; }; XERCES_CPP_NAMESPACE_END #endif /** * End of file IC_Selector.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/ValueStoreCache.cpp000644 000765 000024 00000012625 13241160332 027251 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ValueStoreCache.cpp 708224 2008-10-27 16:02:26Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN typedef JanitorMemFunCall CleanupType; // --------------------------------------------------------------------------- // ValueStoreCache: Constructors and Destructor // --------------------------------------------------------------------------- ValueStoreCache::ValueStoreCache(MemoryManager* const manager) : fValueStores(0) , fGlobalICMap(0) , fIC2ValueStoreMap(0) , fGlobalMapStack(0) , fScanner(0) , fMemoryManager(manager) { CleanupType cleanup(this, &ValueStoreCache::cleanUp); try { init(); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } ValueStoreCache::~ValueStoreCache() { cleanUp(); } // --------------------------------------------------------------------------- // ValueStoreCache: Document handling methods // --------------------------------------------------------------------------- void ValueStoreCache::startDocument() { fIC2ValueStoreMap->removeAll(); fGlobalICMap->removeAll(); fValueStores->removeAllElements(); fGlobalMapStack->removeAllElements(); } void ValueStoreCache::startElement() { fGlobalMapStack->push(fGlobalICMap); fGlobalICMap = new (fMemoryManager) RefHashTableOf ( 13 , false , fMemoryManager ); } void ValueStoreCache::endElement() { if (fGlobalMapStack->empty()) { return; // must be an invalid doc! } RefHashTableOf* oldMap = fGlobalMapStack->pop(); RefHashTableOfEnumerator mapEnum(oldMap, false, fMemoryManager); // Janitor > janMap(oldMap); while (mapEnum.hasMoreElements()) { ValueStore& oldVal = mapEnum.nextElement(); IdentityConstraint* ic = oldVal.getIdentityConstraint(); ValueStore* currVal = fGlobalICMap->get(ic); if (!currVal) { fGlobalICMap->put(ic, &oldVal); } else { currVal->append(&oldVal); } } delete oldMap; } // --------------------------------------------------------------------------- // ValueStoreCache: Helper methods // --------------------------------------------------------------------------- void ValueStoreCache::cleanUp() { delete fIC2ValueStoreMap; delete fGlobalICMap; delete fGlobalMapStack; delete fValueStores; } void ValueStoreCache::init() { fValueStores = new (fMemoryManager) RefVectorOf(8, false, fMemoryManager); fGlobalICMap = new (fMemoryManager) RefHashTableOf ( 13 , false , fMemoryManager ); fIC2ValueStoreMap = new (fMemoryManager) RefHash2KeysTableOf ( 13 , true , fMemoryManager ); fGlobalMapStack = new (fMemoryManager) RefStackOf >(8, true, fMemoryManager); } void ValueStoreCache::initValueStoresFor(SchemaElementDecl* const elemDecl, const int initialDepth) { // initialize value stores for unique fields XMLSize_t icCount = elemDecl->getIdentityConstraintCount(); for (XMLSize_t i=0; igetIdentityConstraintAt(i); ValueStore* valueStore=fIC2ValueStoreMap->get(ic, initialDepth); if(valueStore==0) { valueStore = new (fMemoryManager) ValueStore(ic, fScanner, fMemoryManager); fIC2ValueStoreMap->put(ic, initialDepth, valueStore); } else valueStore->clear(); fValueStores->addElement(valueStore); } } void ValueStoreCache::transplant(IdentityConstraint* const ic, const int initialDepth) { if (ic->getType() == IdentityConstraint::ICType_KEYREF) { return; } ValueStore* newVals = fIC2ValueStoreMap->get(ic, initialDepth); ValueStore* currVals = fGlobalICMap->get(ic); if (currVals) { currVals->append(newVals); } else { fGlobalICMap->put(ic, newVals); } } XERCES_CPP_NAMESPACE_END /** * End of file ValueStoreCache.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/IC_Field.hpp000644 000765 000024 00000013307 13241160332 025635 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IC_Field.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_IC_FIELD_HPP) #define XERCESC_INCLUDE_GUARD_IC_FIELD_HPP // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Forward Declaration // --------------------------------------------------------------------------- class ValueStore; class FieldActivator; class VALIDATORS_EXPORT IC_Field : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- IC_Field(XercesXPath* const xpath, IdentityConstraint* const identityConstraint); ~IC_Field(); // ----------------------------------------------------------------------- // operators // ----------------------------------------------------------------------- bool operator== (const IC_Field& other) const; bool operator!= (const IC_Field& other) const; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- XercesXPath* getXPath() const { return fXPath; } IdentityConstraint* getIdentityConstraint() const { return fIdentityConstraint; } // ----------------------------------------------------------------------- // Factory methods // ----------------------------------------------------------------------- XPathMatcher* createMatcher ( FieldActivator* const fieldActivator , ValueStore* const valueStore , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(IC_Field) IC_Field(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- IC_Field(const IC_Field& other); IC_Field& operator= (const IC_Field& other); // ----------------------------------------------------------------------- // Data members // ----------------------------------------------------------------------- XercesXPath* fXPath; IdentityConstraint* fIdentityConstraint; }; class VALIDATORS_EXPORT FieldMatcher : public XPathMatcher { public: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- ~FieldMatcher() {} // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- ValueStore* getValueStore() const { return fValueStore; } IC_Field* getField() const { return fField; } // ----------------------------------------------------------------------- // Virtual methods // ----------------------------------------------------------------------- void matched(const XMLCh* const content, DatatypeValidator* const dv, const bool isNil); private: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- FieldMatcher(XercesXPath* const anXPath, IC_Field* const aField, ValueStore* const valueStore, FieldActivator* const fieldActivator, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- FieldMatcher(const FieldMatcher& other); FieldMatcher& operator= (const FieldMatcher& other); // ----------------------------------------------------------------------- // Friends // ----------------------------------------------------------------------- friend class IC_Field; // ----------------------------------------------------------------------- // Data members // ----------------------------------------------------------------------- ValueStore* fValueStore; IC_Field* fField; FieldActivator* fFieldActivator; }; XERCES_CPP_NAMESPACE_END #endif /** * End of file IC_Field.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/XPathMatcherStack.cpp000644 000765 000024 00000005272 13241160332 027552 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XPathMatcherStack.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN typedef JanitorMemFunCall CleanupType; // --------------------------------------------------------------------------- // XPathMatherStack: Constructors and Destructor // --------------------------------------------------------------------------- XPathMatcherStack::XPathMatcherStack(MemoryManager* const manager) : fMatchersCount(0) , fContextStack(0) , fMatchers(0) { CleanupType cleanup(this, &XPathMatcherStack::cleanUp); try { fContextStack = new (manager) ValueStackOf(8, manager); fMatchers = new (manager) RefVectorOf(8, true, manager); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XPathMatcherStack::~XPathMatcherStack() { cleanUp(); } // --------------------------------------------------------------------------- // XPathMatcherStack: Private helper methods. // --------------------------------------------------------------------------- void XPathMatcherStack::cleanUp() { delete fContextStack; delete fMatchers; } // --------------------------------------------------------------------------- // XPathMatherStack: Clear methods // --------------------------------------------------------------------------- void XPathMatcherStack::clear() { fContextStack->removeAllElements(); fMatchers->removeAllElements(); fMatchersCount = 0; } XERCES_CPP_NAMESPACE_END /** * End of file XPathMatcherStack.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/IdentityConstraintHandler.hpp000644 000765 000024 00000013764 13241160332 031402 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IdentityConstraintHandler.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_IDENTITYCONSTRAINT_HANDLER_HPP) #define XERCESC_INCLUDE_GUARD_IDENTITYCONSTRAINT_HANDLER_HPP // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Forward Declarations // --------------------------------------------------------------------------- class XMLScanner; class FieldActivator; class MemoryManager; class XMLElementDecl; class VALIDATORS_EXPORT IdentityConstraintHandler: public XMemory { public: // ----------------------------------------------------------------------- // Constructors/Destructor // ----------------------------------------------------------------------- virtual ~IdentityConstraintHandler(); IdentityConstraintHandler ( XMLScanner* const scanner , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- inline XMLSize_t getMatcherCount() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- // Access methods // ----------------------------------------------------------------------- inline void endDocument(); void deactivateContext ( SchemaElementDecl* const elem , const XMLCh* const content , ValidationContext* validationContext = 0 , DatatypeValidator* actualValidator = 0); void activateIdentityConstraint ( SchemaElementDecl* const elem , int elemDepth , const unsigned int uriId , const XMLCh* const elemPrefix , const RefVectorOf& attrList , const XMLSize_t attrCount , ValidationContext* validationContext = 0 ); void reset(); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- IdentityConstraintHandler(const IdentityConstraintHandler& other); IdentityConstraintHandler& operator= (const IdentityConstraintHandler& other); // ----------------------------------------------------------------------- // CleanUp methods // ----------------------------------------------------------------------- void cleanUp(); // ----------------------------------------------------------------------- // Helper // ----------------------------------------------------------------------- void activateSelectorFor( IdentityConstraint* const ic , const int initialDepth ) ; // ----------------------------------------------------------------------- // Data members // // fMatcherStack // Stack of active XPath matchers for identity constraints. All // active XPath matchers are notified of startElement, characters // and endElement callbacks in order to perform their matches. // // fValueStoreCache // Cache of value stores for identity constraint fields. // // fFieldActivator // Activates fields within a certain scope when a selector matches // its xpath. // // ----------------------------------------------------------------------- XMLScanner* fScanner; MemoryManager* fMemoryManager; XPathMatcherStack* fMatcherStack; ValueStoreCache* fValueStoreCache; FieldActivator* fFieldActivator; }; // --------------------------------------------------------------------------- // IdentityConstraintHandler: // --------------------------------------------------------------------------- inline void IdentityConstraintHandler::endDocument() { fValueStoreCache->endDocument(); } inline XMLSize_t IdentityConstraintHandler::getMatcherCount() const { return fMatcherStack->getMatcherCount(); } XERCES_CPP_NAMESPACE_END #endif /** * End of file IdentityConstraintHandler.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/FieldValueMap.cpp000644 000765 000024 00000007363 13241160332 026715 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: FieldValueMap.cpp 708224 2008-10-27 16:02:26Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN typedef JanitorMemFunCall CleanupType; // --------------------------------------------------------------------------- // FieldValueMap: Constructors and Destructor // --------------------------------------------------------------------------- FieldValueMap::FieldValueMap(MemoryManager* const manager) : fFields(0) , fValidators(0) , fValues(0) , fMemoryManager(manager) { } FieldValueMap::FieldValueMap(const FieldValueMap& other) : XMemory(other) , fFields(0) , fValidators(0) , fValues(0) , fMemoryManager(other.fMemoryManager) { if (other.fFields) { CleanupType cleanup(this, &FieldValueMap::cleanUp); try { XMLSize_t valuesSize = other.fValues->size(); fFields = new (fMemoryManager) ValueVectorOf(*(other.fFields)); fValidators = new (fMemoryManager) ValueVectorOf(*(other.fValidators)); fValues = new (fMemoryManager) RefArrayVectorOf(other.fFields->curCapacity(), true, fMemoryManager); for (XMLSize_t i=0; iaddElement(XMLString::replicate(other.fValues->elementAt(i), fMemoryManager)); } } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } } FieldValueMap::~FieldValueMap() { cleanUp(); } // --------------------------------------------------------------------------- // FieldValueMap: Private helper methods. // --------------------------------------------------------------------------- void FieldValueMap::cleanUp() { delete fFields; delete fValidators; delete fValues; } // --------------------------------------------------------------------------- // FieldValueMap: Helper methods // --------------------------------------------------------------------------- bool FieldValueMap::indexOf(const IC_Field* const key, XMLSize_t& location) const { if (fFields) { XMLSize_t fieldSize = fFields->size(); for (XMLSize_t i=0; i < fieldSize; i++) { if (fFields->elementAt(i) == key) { location=i; return true; } } } return false; } void FieldValueMap::clear() { if(fFields) fFields->removeAllElements(); if(fValidators) fValidators->removeAllElements(); if(fValues) fValues->removeAllElements(); } XERCES_CPP_NAMESPACE_END /** * End of file FieldValueMap.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/FieldActivator.cpp000644 000765 000024 00000010450 13241160332 027126 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: FieldActivator.cpp 679340 2008-07-24 10:28:29Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // FieldActivator: Constructors and Destructor // --------------------------------------------------------------------------- FieldActivator::FieldActivator(ValueStoreCache* const valueStoreCache, XPathMatcherStack* const matcherStack, MemoryManager* const manager) : fValueStoreCache(valueStoreCache) , fMatcherStack(matcherStack) , fMayMatch(0) , fMemoryManager(manager) { fMayMatch = new (manager) ValueHashTableOf(29, manager); } FieldActivator::FieldActivator(const FieldActivator& other) : XMemory(other) , fValueStoreCache(other.fValueStoreCache) , fMatcherStack(other.fMatcherStack) , fMayMatch(0) , fMemoryManager(other.fMemoryManager) { fMayMatch = new (fMemoryManager) ValueHashTableOf(29, fMemoryManager); ValueHashTableOfEnumerator mayMatchEnum(other.fMayMatch, false, fMemoryManager); // Build key set while (mayMatchEnum.hasMoreElements()) { IC_Field* field = (IC_Field*) mayMatchEnum.nextElementKey(); fMayMatch->put(field, other.fMayMatch->get(field)); } } FieldActivator::~FieldActivator() { delete fMayMatch; } // --------------------------------------------------------------------------- // FieldActivator: Operator methods // --------------------------------------------------------------------------- FieldActivator& FieldActivator::operator =(const FieldActivator& other) { if (this == &other) { return *this; } fValueStoreCache = other.fValueStoreCache; fMatcherStack = other.fMatcherStack; return *this; } // --------------------------------------------------------------------------- // FieldActivator: Operator methods // --------------------------------------------------------------------------- XPathMatcher* FieldActivator::activateField(IC_Field* const field, const int initialDepth) { ValueStore* valueStore = fValueStoreCache->getValueStoreFor(field, initialDepth); XPathMatcher* matcher = field->createMatcher(this, valueStore, fMemoryManager); setMayMatch(field, true); fMatcherStack->addMatcher(matcher); matcher->startDocumentFragment(); return matcher; } void FieldActivator::startValueScopeFor(const IdentityConstraint* const ic, const int initialDepth) { XMLSize_t fieldCount = ic->getFieldCount(); for(XMLSize_t i=0; igetFieldAt(i); ValueStore* valueStore = fValueStoreCache->getValueStoreFor(field, initialDepth); valueStore->startValueScope(); } } void FieldActivator::endValueScopeFor(const IdentityConstraint* const ic, const int initialDepth) { ValueStore* valueStore = fValueStoreCache->getValueStoreFor(ic, initialDepth); valueStore->endValueScope(); } XERCES_CPP_NAMESPACE_END /** * End of file FieldActivator.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/IdentityConstraint.cpp000644 000765 000024 00000014231 13241160332 030065 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IdentityConstraint.cpp 676911 2008-07-15 13:27:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include //since we need to dynamically created each and every derivatives //during deserialization by XSerializeEngine>>Derivative, we got //to include all hpp #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN typedef JanitorMemFunCall CleanupType; // --------------------------------------------------------------------------- // IdentityConstraint: Constructors and Destructor // --------------------------------------------------------------------------- IdentityConstraint::IdentityConstraint(const XMLCh* const identityConstraintName, const XMLCh* const elemName, MemoryManager* const manager) : fIdentityConstraintName(0) , fElemName(0) , fSelector(0) , fFields(0) , fMemoryManager(manager) , fNamespaceURI(-1) { CleanupType cleanup(this, &IdentityConstraint::cleanUp); try { fIdentityConstraintName = XMLString::replicate(identityConstraintName, fMemoryManager); fElemName = XMLString::replicate(elemName, fMemoryManager); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } IdentityConstraint::~IdentityConstraint() { cleanUp(); } // --------------------------------------------------------------------------- // IdentityConstraint: operators // --------------------------------------------------------------------------- bool IdentityConstraint::operator ==(const IdentityConstraint& other) const { if (getType() != other.getType()) return false; if (!XMLString::equals(fIdentityConstraintName, other.fIdentityConstraintName)) return false; if (*fSelector != *(other.fSelector)) return false; XMLSize_t fieldCount = fFields->size(); if (fieldCount != other.fFields->size()) return false; for (XMLSize_t i = 0; i < fieldCount; i++) { if (*(fFields->elementAt(i)) != *(other.fFields->elementAt(i))) return false; } return true; } bool IdentityConstraint::operator !=(const IdentityConstraint& other) const { return !operator==(other); } // --------------------------------------------------------------------------- // IdentityConstraint: Setter methods // --------------------------------------------------------------------------- void IdentityConstraint::setSelector(IC_Selector* const selector) { if (fSelector) { delete fSelector; } fSelector = selector; } // --------------------------------------------------------------------------- // IdentityConstraint: cleanUp methods // --------------------------------------------------------------------------- void IdentityConstraint::cleanUp() { fMemoryManager->deallocate(fIdentityConstraintName);//delete [] fIdentityConstraintName; fMemoryManager->deallocate(fElemName);//delete [] fElemName; delete fFields; delete fSelector; } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_NOCREATE(IdentityConstraint) void IdentityConstraint::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng.writeString(fIdentityConstraintName); serEng.writeString(fElemName); serEng<* fFields; * ***/ XTemplateSerializer::storeObject(fFields, serEng); } else { serEng.readString(fIdentityConstraintName); serEng.readString(fElemName); serEng>>fSelector; serEng>>fNamespaceURI; /*** * * Deserialize RefVectorOf* fFields; * ***/ XTemplateSerializer::loadObject(&fFields, 4, true, serEng); } } void IdentityConstraint::storeIC(XSerializeEngine& serEng , IdentityConstraint* const ic) { if (ic) { serEng<<(int) ic->getType(); serEng<>type; switch((ICType)type) { case ICType_UNIQUE: IC_Unique* ic_unique; serEng>>ic_unique; return ic_unique; case ICType_KEY: IC_Key* ic_key; serEng>>ic_key; return ic_key; case ICType_KEYREF: IC_KeyRef* ic_keyref; serEng>>ic_keyref; return ic_keyref; case ICType_UNKNOWN: return 0; default: //we treat this same as UnKnown return 0; } } XERCES_CPP_NAMESPACE_END /** * End of file IdentityConstraint.cpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/XPathSymbols.hpp000644 000765 000024 00000005021 13241160332 026626 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XPathSymbols.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XPATHSYMBOLS_HPP) #define XERCESC_INCLUDE_GUARD_XPATHSYMBOLS_HPP #include XERCES_CPP_NAMESPACE_BEGIN /* * Collection of symbols used to parse a Schema Grammar */ class VALIDATORS_EXPORT XPathSymbols { public : // ----------------------------------------------------------------------- // Constant data // ----------------------------------------------------------------------- static const XMLCh fgSYMBOL_AND[]; static const XMLCh fgSYMBOL_OR[]; static const XMLCh fgSYMBOL_MOD[]; static const XMLCh fgSYMBOL_DIV[]; static const XMLCh fgSYMBOL_COMMENT[]; static const XMLCh fgSYMBOL_TEXT[]; static const XMLCh fgSYMBOL_PI[]; static const XMLCh fgSYMBOL_NODE[]; static const XMLCh fgSYMBOL_ANCESTOR[]; static const XMLCh fgSYMBOL_ANCESTOR_OR_SELF[]; static const XMLCh fgSYMBOL_ATTRIBUTE[]; static const XMLCh fgSYMBOL_CHILD[]; static const XMLCh fgSYMBOL_DESCENDANT[]; static const XMLCh fgSYMBOL_DESCENDANT_OR_SELF[]; static const XMLCh fgSYMBOL_FOLLOWING[]; static const XMLCh fgSYMBOL_FOLLOWING_SIBLING[]; static const XMLCh fgSYMBOL_NAMESPACE[]; static const XMLCh fgSYMBOL_PARENT[]; static const XMLCh fgSYMBOL_PRECEDING[]; static const XMLCh fgSYMBOL_PRECEDING_SIBLING[]; static const XMLCh fgSYMBOL_SELF[]; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XPathSymbols(); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file XPathSymbols.hpp */ xerces-c-3.2.2/src/xercesc/validators/schema/identity/XPathMatcher.cpp000644 000765 000024 00000034054 13241160332 026564 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XPathMatcher.cpp 804234 2009-08-14 14:20:16Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN typedef JanitorMemFunCall CleanupType; // --------------------------------------------------------------------------- // XPathMatcher: Constructors and Destructor // --------------------------------------------------------------------------- XPathMatcher::XPathMatcher( XercesXPath* const xpath , MemoryManager* const manager) : fLocationPathSize(0) , fMatched(0) , fNoMatchDepth(0) , fCurrentStep(0) , fStepIndexes(0) , fLocationPaths(0) , fIdentityConstraint(0) , fMemoryManager(manager) { CleanupType cleanup(this, &XPathMatcher::cleanUp); try { init(xpath); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XPathMatcher::XPathMatcher(XercesXPath* const xpath, IdentityConstraint* const ic, MemoryManager* const manager) : fLocationPathSize(0) , fMatched(0) , fNoMatchDepth(0) , fCurrentStep(0) , fStepIndexes(0) , fLocationPaths(0) , fIdentityConstraint(ic) , fMemoryManager(manager) { CleanupType cleanup(this, &XPathMatcher::cleanUp); try { init(xpath); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XPathMatcher::~XPathMatcher() { cleanUp(); } // --------------------------------------------------------------------------- // XPathMatcher: Helper methods // --------------------------------------------------------------------------- void XPathMatcher::init(XercesXPath* const xpath) { if (xpath) { fLocationPaths = xpath->getLocationPaths(); fLocationPathSize = (fLocationPaths ? fLocationPaths->size() : 0); if (fLocationPathSize) { fStepIndexes = new (fMemoryManager) RefVectorOf >(fLocationPathSize, true, fMemoryManager); fCurrentStep = (XMLSize_t*) fMemoryManager->allocate ( fLocationPathSize * sizeof(XMLSize_t) );//new int[fLocationPathSize]; fNoMatchDepth = (XMLSize_t*) fMemoryManager->allocate ( fLocationPathSize * sizeof(XMLSize_t) );//new int[fLocationPathSize]; fMatched = (unsigned char*) fMemoryManager->allocate ( fLocationPathSize * sizeof(unsigned char) );//new int[fLocationPathSize]; for(XMLSize_t i=0; i < fLocationPathSize; i++) { fStepIndexes->addElement(new (fMemoryManager) ValueStackOf(8, fMemoryManager)); } } } } // --------------------------------------------------------------------------- // XPathMatcher: XMLDocumentHandler methods // --------------------------------------------------------------------------- void XPathMatcher::startDocumentFragment() { for(XMLSize_t i = 0; i < fLocationPathSize; i++) { fStepIndexes->elementAt(i)->removeAllElements(); fCurrentStep[i] = 0; fNoMatchDepth[i] = 0; fMatched[i] = 0; } } void XPathMatcher::startElement(const XMLElementDecl& elemDecl, const unsigned int urlId, const XMLCh* const elemPrefix, const RefVectorOf& attrList, const XMLSize_t attrCount, ValidationContext* validationContext /*=0*/) { for (XMLSize_t i = 0; i < fLocationPathSize; i++) { // push context XMLSize_t startStep = fCurrentStep[i]; fStepIndexes->elementAt(i)->push(startStep); // try next xpath, if not matching if ((fMatched[i] & XP_MATCHED_D) == XP_MATCHED || fNoMatchDepth[i] > 0) { fNoMatchDepth[i]++; continue; } if((fMatched[i] & XP_MATCHED_D) == XP_MATCHED_D) { fMatched[i] = XP_MATCHED_DP; } // consume self::node() steps XercesLocationPath* locPath = fLocationPaths->elementAt(i); XMLSize_t stepSize = locPath->getStepSize(); while (fCurrentStep[i] < stepSize && locPath->getStep(fCurrentStep[i])->getAxisType() == XercesStep::AxisType_SELF) { fCurrentStep[i]++; } if (fCurrentStep[i] == stepSize) { fMatched[i] = XP_MATCHED; continue; } // now if the current step is a descendant step, we let the next // step do its thing; if it fails, we reset ourselves // to look at this step for next time we're called. // so first consume all descendants: XMLSize_t descendantStep = fCurrentStep[i]; while (fCurrentStep[i] < stepSize && locPath->getStep(fCurrentStep[i])->getAxisType() == XercesStep::AxisType_DESCENDANT) { fCurrentStep[i]++; } bool sawDescendant = fCurrentStep[i] > descendantStep; if (fCurrentStep[i] == stepSize) { fNoMatchDepth[i]++; continue; } // match child::... step, if haven't consumed any self::node() if ((fCurrentStep[i] == startStep || fCurrentStep[i] > descendantStep) && locPath->getStep(fCurrentStep[i])->getAxisType() == XercesStep::AxisType_CHILD) { XercesStep* step = locPath->getStep(fCurrentStep[i]); XercesNodeTest* nodeTest = step->getNodeTest(); QName elemQName(elemPrefix, elemDecl.getElementName()->getLocalPart(), urlId, fMemoryManager); if (!matches(nodeTest, &elemQName)) { if(fCurrentStep[i] > descendantStep) { fCurrentStep[i] = descendantStep; continue; } fNoMatchDepth[i]++; continue; } fCurrentStep[i]++; } if (fCurrentStep[i] == stepSize) { if (sawDescendant) { fCurrentStep[i] = descendantStep; fMatched[i] = XP_MATCHED_D; } else { fMatched[i] = XP_MATCHED; } continue; } // match attribute::... step if (fCurrentStep[i] < stepSize && locPath->getStep(fCurrentStep[i])->getAxisType() == XercesStep::AxisType_ATTRIBUTE) { if (attrCount) { XercesNodeTest* nodeTest = locPath->getStep(fCurrentStep[i])->getNodeTest(); for (XMLSize_t attrIndex = 0; attrIndex < attrCount; attrIndex++) { const XMLAttr* curDef = attrList.elementAt(attrIndex); if (matches(nodeTest, curDef->getAttName())) { fCurrentStep[i]++; if (fCurrentStep[i] == stepSize) { fMatched[i] = XP_MATCHED_A; SchemaAttDef* attDef = ((SchemaElementDecl&) elemDecl).getAttDef(curDef->getName(), curDef->getURIId()); DatatypeValidator* dv = (attDef) ? attDef->getDatatypeValidator() : 0; const XMLCh* value = curDef->getValue(); // store QName using their Clark name if(dv && dv->getType()==DatatypeValidator::QName) { int index=XMLString::indexOf(value, chColon); if(index==-1) matched(value, dv, false); else { XMLBuffer buff(1023, fMemoryManager); buff.append(chOpenCurly); if(validationContext) { XMLCh* prefix=(XMLCh*)fMemoryManager->allocate((index+1)*sizeof(XMLCh)); ArrayJanitor janPrefix(prefix, fMemoryManager); XMLString::subString(prefix, value, 0, (XMLSize_t)index, fMemoryManager); buff.append(validationContext->getURIForPrefix(prefix)); } buff.append(chCloseCurly); buff.append(value+index+1); matched(buff.getRawBuffer(), dv, false); } } else matched(value, dv, false); } break; } } } if ((fMatched[i] & XP_MATCHED) != XP_MATCHED) { if(fCurrentStep[i] > descendantStep) { fCurrentStep[i] = descendantStep; continue; } fNoMatchDepth[i]++; } } } } void XPathMatcher::endElement(const XMLElementDecl& elemDecl, const XMLCh* const elemContent, ValidationContext* validationContext /*=0*/, DatatypeValidator* actualValidator /*=0*/) { for(XMLSize_t i = 0; i < fLocationPathSize; i++) { // go back a step fCurrentStep[i] = fStepIndexes->elementAt(i)->pop(); // don't do anything, if not matching if (fNoMatchDepth[i] > 0) { fNoMatchDepth[i]--; } // signal match, if appropriate else { if (fMatched[i] == 0) continue; if ((fMatched[i] & XP_MATCHED_A) == XP_MATCHED_A) { fMatched[i] = 0; continue; } DatatypeValidator* dv = actualValidator?actualValidator:((SchemaElementDecl*) &elemDecl)->getDatatypeValidator(); bool isNillable = (((SchemaElementDecl *) &elemDecl)->getMiscFlags() & SchemaSymbols::XSD_NILLABLE) != 0; // store QName using their Clark name if(dv && dv->getType()==DatatypeValidator::QName) { int index=XMLString::indexOf(elemContent, chColon); if(index==-1) matched(elemContent, dv, isNillable); else { XMLBuffer buff(1023, fMemoryManager); buff.append(chOpenCurly); if(validationContext) { XMLCh* prefix=(XMLCh*)fMemoryManager->allocate((index+1)*sizeof(XMLCh)); ArrayJanitor janPrefix(prefix, fMemoryManager); XMLString::subString(prefix, elemContent, 0, (XMLSize_t)index, fMemoryManager); buff.append(validationContext->getURIForPrefix(prefix)); } buff.append(chCloseCurly); buff.append(elemContent+index+1); matched(buff.getRawBuffer(), dv, isNillable); } } else matched(elemContent, dv, isNillable); fMatched[i] = 0; } } } // --------------------------------------------------------------------------- // XPathMatcher: Match methods // --------------------------------------------------------------------------- unsigned char XPathMatcher::isMatched() { // xpath has been matched if any one of the members of the union have matched. for (XMLSize_t i=0; i < fLocationPathSize; i++) { if (((fMatched[i] & XP_MATCHED) == XP_MATCHED) && ((fMatched[i] & XP_MATCHED_DP) != XP_MATCHED_DP)) return fMatched[i]; } return 0; } void XPathMatcher::matched(const XMLCh* const, DatatypeValidator* const, const bool) { return; } bool XPathMatcher::matches(const XercesNodeTest* nodeTest, const QName* qName) { if (nodeTest->getType() == XercesNodeTest::NodeType_QNAME) { return (*nodeTest->getName())==(*qName); } if (nodeTest->getType() == XercesNodeTest::NodeType_NAMESPACE) { return nodeTest->getName()->getURI() == qName->getURI(); } // NodeType_WILDCARD return true; } // --------------------------------------------------------------------------- // XPathMatcher: Match methods // --------------------------------------------------------------------------- int XPathMatcher::getInitialDepth() const { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Regex_NotSupported, fMemoryManager); return 0; // to make some compilers happy } XERCES_CPP_NAMESPACE_END /** * End of file XPathMatcher.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/QNameDatatypeValidator.hpp000644 000765 000024 00000006731 13241160333 027330 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: QNameDatatypeValidator.hpp 577322 2007-09-19 14:58:04Z cargilld $ */ #if !defined(XERCESC_INCLUDE_GUARD_QNAME_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_QNAME_DATATYPEVALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT QNameDatatypeValidator : public AbstractStringValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ QNameDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); QNameDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~QNameDatatypeValidator(); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(QNameDatatypeValidator) protected: virtual void checkValueSpace(const XMLCh* const content , MemoryManager* const manager); virtual void checkContent(const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager); virtual void inspectFacetBase(MemoryManager* const manager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- QNameDatatypeValidator(const QNameDatatypeValidator&); QNameDatatypeValidator& operator=(const QNameDatatypeValidator&); // ----------------------------------------------------------------------- // Private data members // // Nil // ----------------------------------------------------------------------- }; XERCES_CPP_NAMESPACE_END #endif /** * End of file QNameDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/DateTimeDatatypeValidator.cpp000644 000765 000024 00000010320 13241160333 030003 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DateTimeDatatypeValidator.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- DateTimeDatatypeValidator::DateTimeDatatypeValidator(MemoryManager* const manager) :DateTimeValidator(0, 0, 0, DatatypeValidator::DateTime, manager) { setOrdered(XSSimpleTypeDefinition::ORDERED_PARTIAL); } DateTimeDatatypeValidator::DateTimeDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :DateTimeValidator(baseValidator, facets, finalSet, DatatypeValidator::DateTime, manager) { init(enums, manager); } DateTimeDatatypeValidator::~DateTimeDatatypeValidator() {} DatatypeValidator* DateTimeDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) DateTimeDatatypeValidator(this, facets, enums, finalSet, manager); } // // caller need to release the date created here // XMLDateTime* DateTimeDatatypeValidator::parse(const XMLCh* const content, MemoryManager* const manager) { XMLDateTime *pRetDate = new (manager) XMLDateTime(content, manager); Janitor jan(pRetDate); try { pRetDate->parseDateTime(); } catch(const OutOfMemoryException&) { jan.release(); throw; } return jan.release(); } void DateTimeDatatypeValidator::parse(XMLDateTime* const pDate) { pDate->parseDateTime(); } const XMLCh* DateTimeDatatypeValidator::getCanonicalRepresentation(const XMLCh* const rawData , MemoryManager* const memMgr , bool toValidate) const { MemoryManager* toUse = memMgr? memMgr : fMemoryManager; if (toValidate) { DateTimeDatatypeValidator* temp = (DateTimeDatatypeValidator*) this; try { temp->checkContent(rawData, 0, false, toUse); } catch (...) { return 0; } } try { XMLDateTime aDateTime(rawData, toUse); aDateTime.parseDateTime(); return aDateTime.getDateTimeCanonicalRepresentation(toUse); } catch (...) { return 0; } } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(DateTimeDatatypeValidator) void DateTimeDatatypeValidator::serialize(XSerializeEngine& serEng) { DateTimeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file DateTimeDatatypeValidator::cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/DatatypeValidatorFactory.cpp000644 000765 000024 00000106264 13241160333 027733 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DatatypeValidatorFactory.cpp 1798761 2017-06-14 21:17:19Z rleigh $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // DatatypeValidatorFactory: Local const data // --------------------------------------------------------------------------- const XMLCh fgTokPattern[] = { chBackSlash, chLatin_c, chPlus, chNull }; //E2-43 //[+\-]?[0-9]+ const XMLCh fgIntegerPattern[] = { chOpenSquare, chPlus, chBackSlash, chDash, chCloseSquare, chQuestion, chOpenSquare, chDigit_0, chDash, chDigit_9, chCloseSquare, chPlus, chNull }; // --------------------------------------------------------------------------- // DatatypeValidatorFactory: Static member data // --------------------------------------------------------------------------- RefHashTableOf* DatatypeValidatorFactory::fBuiltInRegistry = 0; RefHashTableOf* DatatypeValidatorFactory::fCanRepRegistry = 0; void XMLInitializer::initializeDatatypeValidatorFactory() { // @@ This is ugly. Need to make expandRegistryToFullSchemaSet // static. // DatatypeValidatorFactory *dvFactory = new DatatypeValidatorFactory(); if (dvFactory) { dvFactory->expandRegistryToFullSchemaSet(); delete dvFactory; } } void XMLInitializer::terminateDatatypeValidatorFactory() { delete DatatypeValidatorFactory::fBuiltInRegistry; DatatypeValidatorFactory::fBuiltInRegistry = 0; delete DatatypeValidatorFactory::fCanRepRegistry; DatatypeValidatorFactory::fCanRepRegistry = 0; } // --------------------------------------------------------------------------- // DatatypeValidatorFactory: Constructors and Destructor // --------------------------------------------------------------------------- DatatypeValidatorFactory::DatatypeValidatorFactory(MemoryManager* const manager) : fUserDefinedRegistry(0) , fMemoryManager(manager) { } DatatypeValidatorFactory::~DatatypeValidatorFactory() { cleanUp(); } // --------------------------------------------------------------------------- // DatatypeValidatorFactory: Reset methods // --------------------------------------------------------------------------- void DatatypeValidatorFactory::resetRegistry() { if (fUserDefinedRegistry != 0) { fUserDefinedRegistry->removeAll(); } } // --------------------------------------------------------------------------- // DatatypeValidatorFactory: Registry initialization methods // --------------------------------------------------------------------------- void DatatypeValidatorFactory::expandRegistryToFullSchemaSet() { //Initialize common Schema/DTD Datatype validator set fBuiltInRegistry = new RefHashTableOf(29); DatatypeValidator *dv = new StringDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_STRING, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_STRING, dv); dv = new NOTATIONDatatypeValidator(); dv->setTypeName(XMLUni::fgNotationString, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) XMLUni::fgNotationString, dv); dv = new AnySimpleTypeDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_ANYSIMPLETYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_ANYSIMPLETYPE, dv); dv = new BooleanDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_BOOLEAN, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_BOOLEAN, dv); dv = new DecimalDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_DECIMAL, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_DECIMAL, dv); dv = new HexBinaryDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_HEXBINARY, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_HEXBINARY, dv); dv = new Base64BinaryDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_BASE64BINARY, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_BASE64BINARY, dv); dv = new DoubleDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_DOUBLE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_DOUBLE, dv); dv = new FloatDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_FLOAT, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_FLOAT, dv); dv = new AnyURIDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_ANYURI, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_ANYURI, dv); dv = new QNameDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_QNAME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_QNAME, dv); dv = new DateTimeDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_DATETIME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_DATETIME, dv); dv = new DateDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_DATE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_DATE, dv); dv = new TimeDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_TIME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_TIME, dv); dv = new DayDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_DAY, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_DAY, dv); dv = new MonthDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_MONTH, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_MONTH, dv); dv = new MonthDayDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_MONTHDAY, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_MONTHDAY, dv); dv = new YearDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_YEAR, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_YEAR, dv); dv = new YearMonthDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_YEARMONTH, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_YEARMONTH, dv); dv = new DurationDatatypeValidator(); dv->setTypeName(SchemaSymbols::fgDT_DURATION, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_DURATION, dv); // REVISIT // We are creating a lot of Hashtables for the facets of the different // validators. It's better to have some kind of a memory pool and ask // the pool to give us a new instance of the hashtable. RefHashTableOf* facets = new RefHashTableOf(3); // Create 'normalizedString' datatype validator facets->put((void*) SchemaSymbols::fgELT_WHITESPACE, new KVStringPair(SchemaSymbols::fgELT_WHITESPACE, SchemaSymbols::fgWS_REPLACE)); createDatatypeValidator(SchemaSymbols::fgDT_NORMALIZEDSTRING, getDatatypeValidator(SchemaSymbols::fgDT_STRING), facets, 0, false, 0, false); // Create 'token' datatype validator facets = new RefHashTableOf(3); facets->put((void*) SchemaSymbols::fgELT_WHITESPACE, new KVStringPair(SchemaSymbols::fgELT_WHITESPACE, SchemaSymbols::fgWS_COLLAPSE)); createDatatypeValidator(SchemaSymbols::fgDT_TOKEN, getDatatypeValidator(SchemaSymbols::fgDT_NORMALIZEDSTRING), facets, 0, false, 0, false); dv = new NameDatatypeValidator(getDatatypeValidator(SchemaSymbols::fgDT_TOKEN), 0, 0, 0); dv->setTypeName(SchemaSymbols::fgDT_NAME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_NAME, dv); dv = new NCNameDatatypeValidator(getDatatypeValidator(SchemaSymbols::fgDT_NAME), 0, 0, 0); dv->setTypeName(SchemaSymbols::fgDT_NCNAME, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) SchemaSymbols::fgDT_NCNAME, dv); // Create 'NMTOKEN' datatype validator facets = new RefHashTableOf(3); facets->put((void*) SchemaSymbols::fgELT_PATTERN , new KVStringPair(SchemaSymbols::fgELT_PATTERN,fgTokPattern)); facets->put((void*) SchemaSymbols::fgELT_WHITESPACE, new KVStringPair(SchemaSymbols::fgELT_WHITESPACE, SchemaSymbols::fgWS_COLLAPSE)); createDatatypeValidator(XMLUni::fgNmTokenString, getDatatypeValidator(SchemaSymbols::fgDT_TOKEN),facets, 0, false, 0, false); // Create 'NMTOKENS' datatype validator facets = new RefHashTableOf(2); facets->put((void*) SchemaSymbols::fgELT_MINLENGTH, new KVStringPair(SchemaSymbols::fgELT_MINLENGTH, XMLUni::fgValueOne)); createDatatypeValidator(XMLUni::fgNmTokensString, getDatatypeValidator(XMLUni::fgNmTokenString), facets, 0, true, 0, false); // Create 'language' datatype validator facets = new RefHashTableOf(3); facets->put((void*) SchemaSymbols::fgELT_PATTERN, new KVStringPair(SchemaSymbols::fgELT_PATTERN, XMLUni::fgLangPattern)); createDatatypeValidator(SchemaSymbols::fgDT_LANGUAGE, getDatatypeValidator(SchemaSymbols::fgDT_TOKEN), facets, 0, false, 0, false); // Create 'integer' datatype validator facets = new RefHashTableOf(3); facets->put((void*) SchemaSymbols::fgELT_FRACTIONDIGITS, new KVStringPair(SchemaSymbols::fgELT_FRACTIONDIGITS, XMLUni::fgValueZero)); facets->put((void*) SchemaSymbols::fgELT_PATTERN, new KVStringPair(SchemaSymbols::fgELT_PATTERN, fgIntegerPattern)); createDatatypeValidator(SchemaSymbols::fgDT_INTEGER, getDatatypeValidator(SchemaSymbols::fgDT_DECIMAL), facets, 0, false, 0, false); // Create 'nonPositiveInteger' datatype validator facets = new RefHashTableOf(2); facets->put((void*) SchemaSymbols::fgELT_MAXINCLUSIVE, new KVStringPair(SchemaSymbols::fgELT_MAXINCLUSIVE, XMLUni::fgValueZero)); createDatatypeValidator(SchemaSymbols::fgDT_NONPOSITIVEINTEGER, getDatatypeValidator(SchemaSymbols::fgDT_INTEGER), facets, 0, false, 0, false); // Create 'negativeInteger' datatype validator facets = new RefHashTableOf(2); facets->put((void*) SchemaSymbols::fgELT_MAXINCLUSIVE, new KVStringPair(SchemaSymbols::fgELT_MAXINCLUSIVE, XMLUni::fgNegOne)); createDatatypeValidator(SchemaSymbols::fgDT_NEGATIVEINTEGER, getDatatypeValidator(SchemaSymbols::fgDT_NONPOSITIVEINTEGER), facets, 0, false, 0, false); // Create 'long' datatype validator facets = new RefHashTableOf(2); facets->put((void*) SchemaSymbols::fgELT_MAXINCLUSIVE, new KVStringPair(SchemaSymbols::fgELT_MAXINCLUSIVE, XMLUni::fgLongMaxInc)); facets->put((void*) SchemaSymbols::fgELT_MININCLUSIVE, new KVStringPair(SchemaSymbols::fgELT_MININCLUSIVE, XMLUni::fgLongMinInc)); createDatatypeValidator(SchemaSymbols::fgDT_LONG, getDatatypeValidator(SchemaSymbols::fgDT_INTEGER), facets, 0, false, 0, false); // Create 'int' datatype validator facets = new RefHashTableOf(2); facets->put((void*) SchemaSymbols::fgELT_MAXINCLUSIVE, new KVStringPair(SchemaSymbols::fgELT_MAXINCLUSIVE, XMLUni::fgIntMaxInc)); facets->put((void*) SchemaSymbols::fgELT_MININCLUSIVE, new KVStringPair(SchemaSymbols::fgELT_MININCLUSIVE, XMLUni::fgIntMinInc)); createDatatypeValidator(SchemaSymbols::fgDT_INT, getDatatypeValidator(SchemaSymbols::fgDT_LONG), facets, 0, false, 0, false); // Create 'short' datatype validator facets = new RefHashTableOf(2); facets->put((void*) SchemaSymbols::fgELT_MAXINCLUSIVE, new KVStringPair(SchemaSymbols::fgELT_MAXINCLUSIVE, XMLUni::fgShortMaxInc)); facets->put((void*) SchemaSymbols::fgELT_MININCLUSIVE, new KVStringPair(SchemaSymbols::fgELT_MININCLUSIVE, XMLUni::fgShortMinInc)); createDatatypeValidator(SchemaSymbols::fgDT_SHORT, getDatatypeValidator(SchemaSymbols::fgDT_INT), facets, 0, false, 0 ,false); // Create 'byte' datatype validator facets = new RefHashTableOf(2); facets->put((void*) SchemaSymbols::fgELT_MAXINCLUSIVE, new KVStringPair(SchemaSymbols::fgELT_MAXINCLUSIVE, XMLUni::fgByteMaxInc)); facets->put((void*) SchemaSymbols::fgELT_MININCLUSIVE, new KVStringPair(SchemaSymbols::fgELT_MININCLUSIVE, XMLUni::fgByteMinInc)); createDatatypeValidator(SchemaSymbols::fgDT_BYTE, getDatatypeValidator(SchemaSymbols::fgDT_SHORT), facets, 0, false, 0, false); // Create 'nonNegativeInteger' datatype validator facets = new RefHashTableOf(2); facets->put((void*) SchemaSymbols::fgELT_MININCLUSIVE, new KVStringPair(SchemaSymbols::fgELT_MININCLUSIVE, XMLUni::fgValueZero)); createDatatypeValidator(SchemaSymbols::fgDT_NONNEGATIVEINTEGER, getDatatypeValidator(SchemaSymbols::fgDT_INTEGER), facets, 0, false, 0, false); // Create 'unsignedLong' datatype validator facets = new RefHashTableOf(2); facets->put((void*) SchemaSymbols::fgELT_MAXINCLUSIVE, new KVStringPair(SchemaSymbols::fgELT_MAXINCLUSIVE, XMLUni::fgULongMaxInc)); createDatatypeValidator(SchemaSymbols::fgDT_ULONG, getDatatypeValidator(SchemaSymbols::fgDT_NONNEGATIVEINTEGER), facets, 0, false, 0, false); // Create 'unsignedInt' datatype validator facets = new RefHashTableOf(2); facets->put((void*) SchemaSymbols::fgELT_MAXINCLUSIVE, new KVStringPair(SchemaSymbols::fgELT_MAXINCLUSIVE, XMLUni::fgUIntMaxInc)); createDatatypeValidator(SchemaSymbols::fgDT_UINT, getDatatypeValidator(SchemaSymbols::fgDT_ULONG), facets, 0, false, 0, false); // Create 'unsignedShort' datatypeValidator facets = new RefHashTableOf(2); facets->put((void*) SchemaSymbols::fgELT_MAXINCLUSIVE, new KVStringPair(SchemaSymbols::fgELT_MAXINCLUSIVE, XMLUni::fgUShortMaxInc)); createDatatypeValidator(SchemaSymbols::fgDT_USHORT, getDatatypeValidator(SchemaSymbols::fgDT_UINT), facets, 0, false, 0, false); // Create 'unsignedByte' datatype validator facets = new RefHashTableOf(2); facets->put((void*) SchemaSymbols::fgELT_MAXINCLUSIVE, new KVStringPair(SchemaSymbols::fgELT_MAXINCLUSIVE, XMLUni::fgUByteMaxInc)); createDatatypeValidator(SchemaSymbols::fgDT_UBYTE, getDatatypeValidator(SchemaSymbols::fgDT_USHORT), facets, 0, false, 0, false); // Create 'positiveInteger' datatype validator facets = new RefHashTableOf(2); facets->put((void*) SchemaSymbols::fgELT_MININCLUSIVE, new KVStringPair(SchemaSymbols::fgELT_MININCLUSIVE, XMLUni::fgValueOne)); createDatatypeValidator(SchemaSymbols::fgDT_POSITIVEINTEGER, getDatatypeValidator(SchemaSymbols::fgDT_NONNEGATIVEINTEGER), facets, 0, false, 0, false); // Create 'ID', 'IDREF' and 'ENTITY' datatype validator dv = new IDDatatypeValidator(getDatatypeValidator(SchemaSymbols::fgDT_NCNAME), 0, 0, 0); dv->setTypeName(XMLUni::fgIDString, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) XMLUni::fgIDString, dv); dv = new IDREFDatatypeValidator(getDatatypeValidator(SchemaSymbols::fgDT_NCNAME), 0, 0, 0); dv->setTypeName(XMLUni::fgIDRefString, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) XMLUni::fgIDRefString, dv); dv = new ENTITYDatatypeValidator(getDatatypeValidator(SchemaSymbols::fgDT_NCNAME), 0, 0, 0); dv->setTypeName(XMLUni::fgEntityString, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); fBuiltInRegistry->put((void*) XMLUni::fgEntityString, dv); facets = new RefHashTableOf(2); facets->put((void*) SchemaSymbols::fgELT_MINLENGTH, new KVStringPair(SchemaSymbols::fgELT_MINLENGTH, XMLUni::fgValueOne)); // Create 'IDREFS' datatype validator createDatatypeValidator ( XMLUni::fgIDRefsString , getDatatypeValidator(XMLUni::fgIDRefString) , facets , 0 , true , 0 , false ); facets = new RefHashTableOf(2); facets->put((void*) SchemaSymbols::fgELT_MINLENGTH, new KVStringPair(SchemaSymbols::fgELT_MINLENGTH, XMLUni::fgValueOne)); // Create 'ENTITIES' datatype validator createDatatypeValidator ( XMLUni::fgEntitiesString , getDatatypeValidator(XMLUni::fgEntityString) , facets , 0 , true , 0 , false ); initCanRepRegistory(); } /*** * * For Decimal-derivated, an instance of DecimalDatatypeValidator * can be used by the primitive datatype, decimal, or any one of * the derivated datatypes, such as int, long, unsighed short, just * name a few, or any user-defined datatypes, which may derivate from * either the primitive datatype, decimal, or from any one of those * decimal derivated datatypes, or other user-defined datatypes, which * in turn, indirectly derivate from decimal or decimal-derived. * * fCanRepRegisty captures deciaml dv and its derivatives. * ***/ void DatatypeValidatorFactory::initCanRepRegistory() { /*** * key: dv * data: XMLCanRepGroup ***/ fCanRepRegistry = new RefHashTableOf(29, true); fCanRepRegistry->put((void*) getDatatypeValidator(SchemaSymbols::fgDT_DECIMAL), new XMLCanRepGroup(XMLCanRepGroup::Decimal)); fCanRepRegistry->put((void*) getDatatypeValidator(SchemaSymbols::fgDT_INTEGER), new XMLCanRepGroup(XMLCanRepGroup::Decimal_Derived_signed)); fCanRepRegistry->put((void*) getDatatypeValidator(SchemaSymbols::fgDT_LONG), new XMLCanRepGroup(XMLCanRepGroup::Decimal_Derived_signed)); fCanRepRegistry->put((void*) getDatatypeValidator(SchemaSymbols::fgDT_INT), new XMLCanRepGroup(XMLCanRepGroup::Decimal_Derived_signed)); fCanRepRegistry->put((void*) getDatatypeValidator(SchemaSymbols::fgDT_SHORT), new XMLCanRepGroup(XMLCanRepGroup::Decimal_Derived_signed)); fCanRepRegistry->put((void*) getDatatypeValidator(SchemaSymbols::fgDT_BYTE), new XMLCanRepGroup(XMLCanRepGroup::Decimal_Derived_signed)); fCanRepRegistry->put((void*) getDatatypeValidator(SchemaSymbols::fgDT_NONNEGATIVEINTEGER), new XMLCanRepGroup(XMLCanRepGroup::Decimal_Derived_signed)); fCanRepRegistry->put((void*) getDatatypeValidator(SchemaSymbols::fgDT_POSITIVEINTEGER), new XMLCanRepGroup(XMLCanRepGroup::Decimal_Derived_signed)); fCanRepRegistry->put((void*) getDatatypeValidator(SchemaSymbols::fgDT_NEGATIVEINTEGER), new XMLCanRepGroup(XMLCanRepGroup::Decimal_Derived_unsigned)); fCanRepRegistry->put((void*) getDatatypeValidator(SchemaSymbols::fgDT_ULONG), new XMLCanRepGroup(XMLCanRepGroup::Decimal_Derived_unsigned)); fCanRepRegistry->put((void*) getDatatypeValidator(SchemaSymbols::fgDT_UINT), new XMLCanRepGroup(XMLCanRepGroup::Decimal_Derived_unsigned)); fCanRepRegistry->put((void*) getDatatypeValidator(SchemaSymbols::fgDT_USHORT), new XMLCanRepGroup(XMLCanRepGroup::Decimal_Derived_unsigned)); fCanRepRegistry->put((void*) getDatatypeValidator(SchemaSymbols::fgDT_UBYTE), new XMLCanRepGroup(XMLCanRepGroup::Decimal_Derived_unsigned)); fCanRepRegistry->put((void*) getDatatypeValidator(SchemaSymbols::fgDT_NONPOSITIVEINTEGER), new XMLCanRepGroup(XMLCanRepGroup::Decimal_Derived_npi)); } /*** * * For any dv other than Decimaldv, return String only. * Later on if support to dv other than Decimaldv arise, we may * add them fCanRepRegistry during DatatypeValidatorFactory::initCanRepRegistory() * ***/ XMLCanRepGroup::CanRepGroup DatatypeValidatorFactory::getCanRepGroup(const DatatypeValidator* const dv) { if (!dv) return XMLCanRepGroup::String; DatatypeValidator *curdv = (DatatypeValidator*) dv; while (curdv) { if (fCanRepRegistry->containsKey(curdv)) return fCanRepRegistry->get(curdv)->getGroup(); else curdv = curdv->getBaseValidator(); } return XMLCanRepGroup::String; } DatatypeValidator* DatatypeValidatorFactory::getBuiltInBaseValidator(const DatatypeValidator* const dv) { DatatypeValidator *curdv = (DatatypeValidator*)dv; while (curdv) { if (curdv == getBuiltInRegistry()->get(curdv->getTypeLocalName())) return curdv; else curdv = curdv->getBaseValidator(); } return 0; } // --------------------------------------------------------------------------- // DatatypeValidatorFactory: factory methods // --------------------------------------------------------------------------- DatatypeValidator* DatatypeValidatorFactory::createDatatypeValidator ( const XMLCh* const typeName , DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const bool isDerivedByList , const int finalSet , const bool isUserDefined , MemoryManager* const userManager ) { if (baseValidator == 0) { if (facets) { Janitor janFacets(facets); } if (enums) { Janitor janEnums(enums); } return 0; } DatatypeValidator* datatypeValidator = 0; MemoryManager* const manager = (isUserDefined) ? userManager : XMLPlatformUtils::fgMemoryManager; if (isDerivedByList) { datatypeValidator = new (manager) ListDatatypeValidator(baseValidator, facets, enums, finalSet, manager); // Set PSVI information for Ordered, Numeric, Bounded & Finite datatypeValidator->setOrdered(XSSimpleTypeDefinition::ORDERED_FALSE); datatypeValidator->setNumeric(false); if (facets && ((facets->get(SchemaSymbols::fgELT_LENGTH) || (facets->get(SchemaSymbols::fgELT_MINLENGTH) && facets->get(SchemaSymbols::fgELT_MAXLENGTH))))) { datatypeValidator->setBounded(true); datatypeValidator->setFinite(true); } else { datatypeValidator->setBounded(false); datatypeValidator->setFinite(false); } } else { if ((baseValidator->getType() != DatatypeValidator::String) && facets) { KVStringPair* value = facets->get(SchemaSymbols::fgELT_WHITESPACE); if (value != 0) { facets->removeKey(SchemaSymbols::fgELT_WHITESPACE); } } datatypeValidator = baseValidator->newInstance ( facets , enums , finalSet , manager ); // Set PSVI information for Ordered, Numeric, Bounded & Finite datatypeValidator->setOrdered(baseValidator->getOrdered()); datatypeValidator->setNumeric(baseValidator->getNumeric()); RefHashTableOf* baseFacets = baseValidator->getFacets(); if (facets && ((facets->get(SchemaSymbols::fgELT_MININCLUSIVE) || facets->get(SchemaSymbols::fgELT_MINEXCLUSIVE) || (baseFacets && (baseFacets->get(SchemaSymbols::fgELT_MININCLUSIVE) || baseFacets->get(SchemaSymbols::fgELT_MINEXCLUSIVE))))) && (facets->get(SchemaSymbols::fgELT_MAXINCLUSIVE) || facets->get(SchemaSymbols::fgELT_MAXEXCLUSIVE) || (baseFacets && ((baseFacets->get(SchemaSymbols::fgELT_MAXINCLUSIVE) || baseFacets->get(SchemaSymbols::fgELT_MAXEXCLUSIVE)))))) { datatypeValidator->setBounded(true); } else { datatypeValidator->setBounded(false); } if (baseValidator->getFinite()) { datatypeValidator->setFinite(true); } else if (!facets) { datatypeValidator->setFinite(false); } else if (facets->get(SchemaSymbols::fgELT_LENGTH) || facets->get(SchemaSymbols::fgELT_MAXLENGTH) || facets->get(SchemaSymbols::fgELT_TOTALDIGITS)) { datatypeValidator->setFinite(true); } //for efficiency use this instead of rechecking... //else if ((facets->get(SchemaSymbols::fgELT_MININCLUSIVE) || facets->get(SchemaSymbols::fgELT_MINEXCLUSIVE)) && // (facets->get(SchemaSymbols::fgELT_MAXINCLUSIVE) || facets->get(SchemaSymbols::fgELT_MAXEXCLUSIVE))) else if (datatypeValidator->getBounded() || datatypeValidator->getType() == DatatypeValidator::Date || datatypeValidator->getType() == DatatypeValidator::YearMonth || datatypeValidator->getType() == DatatypeValidator::Year || datatypeValidator->getType() == DatatypeValidator::MonthDay || datatypeValidator->getType() == DatatypeValidator::Day || datatypeValidator->getType() == DatatypeValidator::Month) { if (facets->get(SchemaSymbols::fgELT_FRACTIONDIGITS)) { datatypeValidator->setFinite(true); } else { datatypeValidator->setFinite(false); } } else { datatypeValidator->setFinite(false); } } if (datatypeValidator != 0) { if (isUserDefined) { if (!fUserDefinedRegistry) { fUserDefinedRegistry = new (userManager) RefHashTableOf(29, userManager); } fUserDefinedRegistry->put((void *)typeName, datatypeValidator); } else { fBuiltInRegistry->put((void *)typeName, datatypeValidator); } datatypeValidator->setTypeName(typeName); } return datatypeValidator; } static DatatypeValidator::ValidatorType getPrimitiveDV(DatatypeValidator::ValidatorType validationDV) { if (validationDV == DatatypeValidator::ID || validationDV == DatatypeValidator::IDREF || validationDV == DatatypeValidator::ENTITY) { return DatatypeValidator::String; } return validationDV; } DatatypeValidator* DatatypeValidatorFactory::createDatatypeValidator ( const XMLCh* const typeName , RefVectorOf* const validators , const int finalSet , const bool userDefined , MemoryManager* const userManager ) { if (validators == 0) return 0; DatatypeValidator* datatypeValidator = 0; MemoryManager* const manager = (userDefined) ? userManager : XMLPlatformUtils::fgMemoryManager; datatypeValidator = new (manager) UnionDatatypeValidator(validators, finalSet, manager); if (datatypeValidator != 0) { if (userDefined) { if (!fUserDefinedRegistry) { fUserDefinedRegistry = new (userManager) RefHashTableOf(29, userManager); } fUserDefinedRegistry->put((void *)typeName, datatypeValidator); } else { fBuiltInRegistry->put((void *)typeName, datatypeValidator); } datatypeValidator->setTypeName(typeName); // Set PSVI information for Ordered, Numeric, Bounded & Finite XMLSize_t valSize = validators->size(); if (valSize) { DatatypeValidator::ValidatorType ancestorId = getPrimitiveDV(validators->elementAt(0)->getType()); // For a union the ORDERED {value} is partial unless one of the following: // 1. If every member of {member type definitions} is derived from a common ancestor other than the simple ur-type, then {value} is the same as that ancestor's ordered facet. // 2. If every member of {member type definitions} has a {value} of false for the ordered facet, then {value} is false. bool allOrderedFalse = true; bool commonAnc = ancestorId != DatatypeValidator::AnySimpleType; bool allNumeric = true; bool allBounded = true; bool allFinite = true; for(XMLSize_t i = 0 ; (i < valSize) && (commonAnc || allOrderedFalse || allNumeric || allBounded || allFinite); i++) { // for the other member types, check whether the value is false // and whether they have the same ancestor as the first one if (commonAnc) commonAnc = ancestorId == getPrimitiveDV(validators->elementAt(i)->getType()); if (allOrderedFalse) allOrderedFalse = validators->elementAt(i)->getOrdered() == XSSimpleTypeDefinition::ORDERED_FALSE; if (allNumeric && !validators->elementAt(i)->getNumeric()) { allNumeric = false; } if (allBounded && (!validators->elementAt(i)->getBounded() || ancestorId != getPrimitiveDV(validators->elementAt(i)->getType()))) { allBounded = false; } if (allFinite && !validators->elementAt(i)->getFinite()) { allFinite = false; } } if (commonAnc) { datatypeValidator->setOrdered(validators->elementAt(0)->getOrdered()); } else if (allOrderedFalse) { datatypeValidator->setOrdered(XSSimpleTypeDefinition::ORDERED_FALSE); } else { datatypeValidator->setOrdered(XSSimpleTypeDefinition::ORDERED_PARTIAL); } datatypeValidator->setNumeric(allNumeric); datatypeValidator->setBounded(allBounded); datatypeValidator->setFinite(allFinite); } else // size = 0 { datatypeValidator->setOrdered(XSSimpleTypeDefinition::ORDERED_PARTIAL); datatypeValidator->setNumeric(true); datatypeValidator->setBounded(true); datatypeValidator->setFinite(true); } } return datatypeValidator; } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(DatatypeValidatorFactory) void DatatypeValidatorFactory::serialize(XSerializeEngine& serEng) { // Need not to serialize static data member, fBuiltInRegistry if (serEng.isStoring()) { /*** * Serialize RefHashTableOf ***/ XTemplateSerializer::storeObject(fUserDefinedRegistry, serEng); } else { /*** * Deserialize RefHashTableOf ***/ XTemplateSerializer::loadObject(&fUserDefinedRegistry, 29, true, serEng); } } XERCES_CPP_NAMESPACE_END /** * End of file DatatypeValidatorFactory.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/ENTITYDatatypeValidator.cpp000644 000765 000024 00000010460 13241160333 027330 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ENTITYDatatypeValidator.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- ENTITYDatatypeValidator::ENTITYDatatypeValidator(MemoryManager* const manager) :StringDatatypeValidator(0, 0, 0, DatatypeValidator::ENTITY, manager) {} ENTITYDatatypeValidator::ENTITYDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :StringDatatypeValidator(baseValidator, facets, finalSet, DatatypeValidator::ENTITY, manager) { init(enums, manager); } ENTITYDatatypeValidator::~ENTITYDatatypeValidator() {} DatatypeValidator* ENTITYDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) ENTITYDatatypeValidator(this, facets, enums, finalSet, manager); } // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- int ENTITYDatatypeValidator::compare(const XMLCh* const lValue , const XMLCh* const rValue , MemoryManager* const) { return ( XMLString::equals(lValue, rValue)? 0 : -1); } void ENTITYDatatypeValidator::validate(const XMLCh* const content , ValidationContext* const context , MemoryManager* const manager) { // use StringDatatypeValidator (which in turn, invoke // the baseValidator) to validate content against // facets if any. // StringDatatypeValidator::validate(content, context, manager); // // parse the entity iff an EntityDeclPool is provided // if (context) { context->checkEntity(content); } } void ENTITYDatatypeValidator::checkValueSpace(const XMLCh* const content , MemoryManager* const manager) { // // 3.3.11 check must: "NCName" // if ( !XMLChar1_0::isValidNCName(content, XMLString::stringLen(content)) ) { ThrowXMLwithMemMgr1(InvalidDatatypeValueException , XMLExcepts::VALUE_Invalid_NCName , content , manager); } } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(ENTITYDatatypeValidator) void ENTITYDatatypeValidator::serialize(XSerializeEngine& serEng) { StringDatatypeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file ENTITYDatatypeValidator.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/TimeDatatypeValidator.cpp000644 000765 000024 00000010150 13241160333 027206 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: TimeDatatypeValidator.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- TimeDatatypeValidator::TimeDatatypeValidator(MemoryManager* const manager) :DateTimeValidator(0, 0, 0, DatatypeValidator::Time, manager) { setOrdered(XSSimpleTypeDefinition::ORDERED_PARTIAL); } TimeDatatypeValidator::TimeDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :DateTimeValidator(baseValidator, facets, finalSet, DatatypeValidator::Time, manager) { init(enums, manager); } TimeDatatypeValidator::~TimeDatatypeValidator() {} DatatypeValidator* TimeDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) TimeDatatypeValidator(this, facets, enums, finalSet, manager); } // // caller need to release the date created here // XMLDateTime* TimeDatatypeValidator::parse(const XMLCh* const content, MemoryManager* const manager) { XMLDateTime *pRetDate = new (manager) XMLDateTime(content, manager); Janitor jan(pRetDate); try { pRetDate->parseTime(); } catch(const OutOfMemoryException&) { jan.release(); throw; } return jan.release(); } void TimeDatatypeValidator::parse(XMLDateTime* const pDate) { pDate->parseTime(); } const XMLCh* TimeDatatypeValidator::getCanonicalRepresentation(const XMLCh* const rawData , MemoryManager* const memMgr , bool toValidate) const { MemoryManager* toUse = memMgr? memMgr : fMemoryManager; if (toValidate) { TimeDatatypeValidator* temp = (TimeDatatypeValidator*) this; try { temp->checkContent(rawData, 0, false, toUse); } catch (...) { return 0; } } try { XMLDateTime aDateTime(rawData, toUse); aDateTime.parseTime(); return aDateTime.getTimeCanonicalRepresentation(toUse); } catch (...) { return 0; } } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(TimeDatatypeValidator) void TimeDatatypeValidator::serialize(XSerializeEngine& serEng) { DateTimeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file TimeDatatypeValidator::cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/BooleanDatatypeValidator.cpp000644 000765 000024 00000016114 13241160333 027675 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BooleanDatatypeValidator.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- BooleanDatatypeValidator::BooleanDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :DatatypeValidator(baseValidator, facets, finalSet, DatatypeValidator::Boolean, manager) { // Set Facets if any defined if ( facets ) { // Boolean shall NOT have enumeration if (enums) { delete enums; ThrowXMLwithMemMgr1(InvalidDatatypeFacetException , XMLExcepts::FACET_Invalid_Tag , "enumeration" , manager); } XMLCh* key; XMLCh* value; RefHashTableOfEnumerator e(facets, false, manager); while (e.hasMoreElements()) { KVStringPair pair = e.nextElement(); key = pair.getKey(); value = pair.getValue(); if (XMLString::equals(key, SchemaSymbols::fgELT_PATTERN)) { setPattern(value); setFacetsDefined(DatatypeValidator::FACET_PATTERN); } else { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException , XMLExcepts::FACET_Invalid_Tag , key , manager); } } }// End of facet setting } void BooleanDatatypeValidator::checkContent( const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager) { //validate against base validator if any BooleanDatatypeValidator *pBaseValidator = (BooleanDatatypeValidator*) this->getBaseValidator(); if (pBaseValidator !=0) pBaseValidator->checkContent(content, context, true, manager); // we check pattern first if ( (getFacetsDefined() & DatatypeValidator::FACET_PATTERN ) != 0 ) { if (getRegex()->matches(content, manager) ==false) { ThrowXMLwithMemMgr2(InvalidDatatypeValueException , XMLExcepts::VALUE_NotMatch_Pattern , content , getPattern() , manager); } } // if this is a base validator, we only need to check pattern facet // all other facet were inherited by the derived type if (asBase) return; unsigned int i = 0; for ( ; i < XMLUni::fgBooleanValueSpaceArraySize; i++ ) { if ( XMLString::equals(content, XMLUni::fgBooleanValueSpace[i])) break; } if (i == XMLUni::fgBooleanValueSpaceArraySize) ThrowXMLwithMemMgr2(InvalidDatatypeValueException , XMLExcepts::VALUE_Invalid_Name , content , SchemaSymbols::fgDT_BOOLEAN , manager); //Not valid boolean type } int BooleanDatatypeValidator::compare(const XMLCh* const lValue , const XMLCh* const rValue , MemoryManager* const) { // need to check by bool semantics // 1 == true // 0 == false if (XMLString::equals(lValue, XMLUni::fgBooleanValueSpace[0])|| XMLString::equals(lValue, XMLUni::fgBooleanValueSpace[2])) { if (XMLString::equals(rValue, XMLUni::fgBooleanValueSpace[0]) || XMLString::equals(rValue, XMLUni::fgBooleanValueSpace[2])) return 0; } else if (XMLString::equals(lValue, XMLUni::fgBooleanValueSpace[1]) || XMLString::equals(lValue, XMLUni::fgBooleanValueSpace[3])) { if (XMLString::equals(rValue, XMLUni::fgBooleanValueSpace[1]) || XMLString::equals(rValue, XMLUni::fgBooleanValueSpace[3])) return 0; } return 1; } const RefArrayVectorOf* BooleanDatatypeValidator::getEnumString() const { return 0; } /*** * 3.2.2.2 Canonical representation * * The canonical representation for boolean is the set of literals {true, false}. ***/ const XMLCh* BooleanDatatypeValidator::getCanonicalRepresentation(const XMLCh* const rawData , MemoryManager* const memMgr , bool toValidate) const { MemoryManager* toUse = memMgr? memMgr : getMemoryManager(); if (toValidate) { BooleanDatatypeValidator *temp = (BooleanDatatypeValidator*) this; try { temp->checkContent(rawData, 0, false, toUse); } catch (...) { return 0; } } return ( XMLString::equals(rawData, XMLUni::fgBooleanValueSpace[0]) || XMLString::equals(rawData, XMLUni::fgBooleanValueSpace[2]) ) ? XMLString::replicate(XMLUni::fgBooleanValueSpace[0], toUse) : XMLString::replicate(XMLUni::fgBooleanValueSpace[1], toUse) ; } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(BooleanDatatypeValidator) void BooleanDatatypeValidator::serialize(XSerializeEngine& serEng) { DatatypeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file BooleanDatatypeValidator.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.cpp000644 000765 000024 00000006416 13241160333 031065 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: AnySimpleTypeDatatypeValidator.cpp 637054 2008-03-14 11:08:37Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // AnySimpleTypeDatatypeValidator: Constructors and Destructor // --------------------------------------------------------------------------- AnySimpleTypeDatatypeValidator::AnySimpleTypeDatatypeValidator(MemoryManager* const manager) : DatatypeValidator(0, 0, SchemaSymbols::XSD_RESTRICTION, DatatypeValidator::AnySimpleType, manager) { setWhiteSpace(DatatypeValidator::PRESERVE); setFinite(true); } AnySimpleTypeDatatypeValidator::~AnySimpleTypeDatatypeValidator() { } // --------------------------------------------------------------------------- // DatatypeValidators: Compare methods // --------------------------------------------------------------------------- int AnySimpleTypeDatatypeValidator::compare( const XMLCh* const lValue , const XMLCh* const rValue , MemoryManager* const) { return XMLString::compareString(lValue, rValue); } // --------------------------------------------------------------------------- // AnySimpleTypeDatatypeValidator: Instance methods // --------------------------------------------------------------------------- DatatypeValidator* AnySimpleTypeDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int , MemoryManager* const manager ) { // We own them, so we will delete them first delete facets; delete enums; ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::DV_InvalidOperation, manager); // to satisfy some compilers return 0; } const RefArrayVectorOf* AnySimpleTypeDatatypeValidator::getEnumString() const { return 0; } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(AnySimpleTypeDatatypeValidator) void AnySimpleTypeDatatypeValidator::serialize(XSerializeEngine& serEng) { DatatypeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file AnySimpleTypeDatatypeValidator.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/DatatypeValidator.cpp000644 000765 000024 00000036375 13241160333 026410 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DatatypeValidator.cpp 555320 2007-07-11 16:05:13Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include //since we need to dynamically created each and every derivatives //during deserialization by XSerializeEngine>>Derivative, we got //to include all hpp #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN static const int DV_BUILTIN = -1; static const int DV_NORMAL = -2; static const int DV_ZERO = -3; static const int TYPENAME_ZERO = -1; static const int TYPENAME_S4S = -2; static const int TYPENAME_NORMAL = -3; // --------------------------------------------------------------------------- // DatatypeValidator: Constructors and Destructor // --------------------------------------------------------------------------- DatatypeValidator::DatatypeValidator(DatatypeValidator* const baseValidator, RefHashTableOf* const facets, const int finalSet, const ValidatorType type, MemoryManager* const manager) : fAnonymous(false) , fFinite(false) , fBounded(false) , fNumeric(false) , fWhiteSpace(COLLAPSE) , fFinalSet(finalSet) , fFacetsDefined(0) , fFixed(0) , fType(type) , fOrdered(XSSimpleTypeDefinition::ORDERED_FALSE) , fBaseValidator(baseValidator) , fFacets(facets) , fPattern(0) , fRegex(0) , fTypeName(0) , fTypeLocalName(XMLUni::fgZeroLenString) , fTypeUri(XMLUni::fgZeroLenString) , fMemoryManager(manager) { } DatatypeValidator::~DatatypeValidator() { cleanUp(); } const XMLCh* DatatypeValidator::getWSstring(const short theType) const { switch (theType) { case PRESERVE: return SchemaSymbols::fgWS_PRESERVE; case REPLACE: return SchemaSymbols::fgWS_REPLACE; case COLLAPSE: return SchemaSymbols::fgWS_COLLAPSE; default: return SchemaSymbols::fgWS_PRESERVE; } } void DatatypeValidator::setTypeName(const XMLCh* const name, const XMLCh* const uri) { if (fTypeName) { fMemoryManager->deallocate(fTypeName); fTypeName = 0; } if (name || uri) { XMLSize_t nameLen = XMLString::stringLen(name); XMLSize_t uriLen = XMLString::stringLen(uri); fTypeName = (XMLCh*) fMemoryManager->allocate ( (nameLen + uriLen + 2)*sizeof(XMLCh) ); fTypeUri = fTypeName; fTypeLocalName = &fTypeName[uriLen+1]; if (uri) XMLString::moveChars(fTypeName, uri, uriLen+1); else fTypeName[0] = chNull; if (name) XMLString::moveChars(&fTypeName[uriLen+1], name, nameLen+1); else fTypeName[uriLen+1] = chNull; } else { fTypeUri = fTypeLocalName = XMLUni::fgZeroLenString; } } void DatatypeValidator::setTypeName(const XMLCh* const typeName) { if (fTypeName) { fMemoryManager->deallocate(fTypeName); fTypeName = 0; } if (typeName) { XMLSize_t nameLen = XMLString::stringLen(typeName); int commaOffset = XMLString::indexOf(typeName, chComma); fTypeName = (XMLCh*) fMemoryManager->allocate ( (nameLen + 1) * sizeof(XMLCh) ); XMLString::moveChars(fTypeName, typeName, nameLen+1); if ( commaOffset == -1) { fTypeUri = SchemaSymbols::fgURI_SCHEMAFORSCHEMA; fTypeLocalName = fTypeName; } else { fTypeUri = fTypeName; fTypeLocalName = &fTypeName[commaOffset+1]; fTypeName[commaOffset] = chNull; } } else { fTypeUri = fTypeLocalName = XMLUni::fgZeroLenString; } } // --------------------------------------------------------------------------- // DatatypeValidator: CleanUp methods // --------------------------------------------------------------------------- void DatatypeValidator::cleanUp() { delete fFacets; delete fRegex; if (fPattern) fMemoryManager->deallocate(fPattern);//delete [] fPattern; if (fTypeName) fMemoryManager->deallocate(fTypeName); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_NOCREATE(DatatypeValidator) void DatatypeValidator::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng< ***/ XTemplateSerializer::storeObject(fFacets, serEng); serEng.writeString(fPattern); if (fTypeUri==XMLUni::fgZeroLenString) { serEng<>fAnonymous; serEng>>fFinite; serEng>>fBounded; serEng>>fNumeric; serEng>>fWhiteSpace; serEng>>fFinalSet; serEng>>fFacetsDefined; serEng>>fFixed; int type; serEng>>type; fType=(ValidatorType)type; serEng>>type; fOrdered = (XSSimpleTypeDefinition::ORDERING)type; fBaseValidator = loadDV(serEng); /*** * * Deserialize RefHashTableOf * ***/ XTemplateSerializer::loadObject(&fFacets, 29, true, serEng); serEng.readString(fPattern); /*** * Recreate through setTypeName() * fTypeName ***/ int flag; serEng>>flag; if ( TYPENAME_ZERO == flag ) { setTypeName(0); } else if ( TYPENAME_S4S == flag ) { XMLCh* typeLocalName; serEng.readString(typeLocalName); ArrayJanitor janName(typeLocalName, fMemoryManager); setTypeName(typeLocalName); } else // TYPENAME_NORMAL { XMLCh* typeLocalName; serEng.readString(typeLocalName); ArrayJanitor janName(typeLocalName, fMemoryManager); XMLCh* typeUri; serEng.readString(typeUri); ArrayJanitor janUri(typeUri, fMemoryManager); setTypeName(typeLocalName, typeUri); } /*** * don't serialize fRegex ***/ fRegex = new (fMemoryManager) RegularExpression(fPattern, SchemaSymbols::fgRegEx_XOption, fMemoryManager); } } /*** * * When deserialized, we need to know, exactly what * validator was serialized here. * * Design Issue: * * This extra type information is only necessary when * we need to create and deserialize an DatatypeValidator * derivative by operator >>, but not by object.serialize(). * Therefore it is appropriate to save this type info by * hosting object rather than by derivative.serialize(). * * ***/ void DatatypeValidator::storeDV(XSerializeEngine& serEng , DatatypeValidator* const dv) { if (dv) { //builtIndv if (dv == DatatypeValidatorFactory::getBuiltInRegistry()->get(dv->getTypeLocalName())) { serEng<getTypeLocalName()); } else { serEng<getType(); serEng<>flag; if (DV_BUILTIN == flag) { XMLCh* dvName; serEng.readString(dvName); ArrayJanitor janName(dvName, serEng.getMemoryManager()); return DatatypeValidatorFactory::getBuiltInRegistry()->get(dvName); } else if (DV_ZERO == flag) { return 0; } int type; serEng>>type; switch((ValidatorType)type) { case String: StringDatatypeValidator* stringdv; serEng>>stringdv; return stringdv; case AnyURI: AnyURIDatatypeValidator* anyuridv; serEng>>anyuridv; return anyuridv; case QName: QNameDatatypeValidator* qnamedv; serEng>>qnamedv; return qnamedv; case Name: NameDatatypeValidator* namedv; serEng>>namedv; return namedv; case NCName: NCNameDatatypeValidator* ncnamedv; serEng>>ncnamedv; return ncnamedv; case Boolean: BooleanDatatypeValidator* booleandv; serEng>>booleandv; return booleandv; case Float: FloatDatatypeValidator* floatdv; serEng>>floatdv; return floatdv; case Double: DoubleDatatypeValidator* doubledv; serEng>>doubledv; return doubledv; case Decimal: DecimalDatatypeValidator* decimaldv; serEng>>decimaldv; return decimaldv; case HexBinary: HexBinaryDatatypeValidator* hexbinarydv; serEng>>hexbinarydv; return hexbinarydv; case Base64Binary: Base64BinaryDatatypeValidator* base64binarydv; serEng>>base64binarydv; return base64binarydv; case Duration: DurationDatatypeValidator* durationdv; serEng>>durationdv; return durationdv; case DateTime: DateTimeDatatypeValidator* datetimedv; serEng>>datetimedv; return datetimedv; case Date: DateDatatypeValidator* datedv; serEng>>datedv; return datedv; case Time: TimeDatatypeValidator* timedv; serEng>>timedv; return timedv; case MonthDay: MonthDayDatatypeValidator* monthdaydv; serEng>>monthdaydv; return monthdaydv; case YearMonth: YearMonthDatatypeValidator* yearmonthdv; serEng>>yearmonthdv; return yearmonthdv; case Year: YearDatatypeValidator* yeardv; serEng>>yeardv; return yeardv; case Month: MonthDatatypeValidator* monthdv; serEng>>monthdv; return monthdv; case Day: DayDatatypeValidator* daydv; serEng>>daydv; return daydv; case ID: IDDatatypeValidator* iddv; serEng>>iddv; return iddv; case IDREF: IDREFDatatypeValidator* idrefdv; serEng>>idrefdv; return idrefdv; case ENTITY: ENTITYDatatypeValidator* entitydv; serEng>>entitydv; return entitydv; case NOTATION: NOTATIONDatatypeValidator* notationdv; serEng>>notationdv; return notationdv; case List: ListDatatypeValidator* listdv; serEng>>listdv; return listdv; case Union: UnionDatatypeValidator* uniondv; serEng>>uniondv; return uniondv; case AnySimpleType: AnySimpleTypeDatatypeValidator* anysimpletypedv; serEng>>anysimpletypedv; return anysimpletypedv; case UnKnown: return 0; default: //we treat this same as UnKnown return 0; } } /** * Canonical Representation * */ const XMLCh* DatatypeValidator::getCanonicalRepresentation(const XMLCh* const rawData , MemoryManager* const memMgr , bool toValidate) const { MemoryManager* toUse = memMgr? memMgr : fMemoryManager; if (toValidate) { DatatypeValidator *temp = (DatatypeValidator*) this; try { temp->validate(rawData, 0, toUse); } catch (...) { return 0; } } return XMLString::replicate(rawData, toUse); } XERCES_CPP_NAMESPACE_END /** * End of file DatatypeValidator.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/HexBinaryDatatypeValidator.hpp000644 000765 000024 00000006411 13241160333 030213 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: HexBinaryDatatypeValidator.hpp 695949 2008-09-16 15:57:44Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_HEXBINARY_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_HEXBINARY_DATATYPEVALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT HexBinaryDatatypeValidator : public AbstractStringValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ HexBinaryDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); HexBinaryDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~HexBinaryDatatypeValidator(); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(HexBinaryDatatypeValidator) protected: virtual void checkValueSpace(const XMLCh* const content , MemoryManager* const manager); virtual XMLSize_t getLength(const XMLCh* const content , MemoryManager* const manager) const; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- HexBinaryDatatypeValidator(const HexBinaryDatatypeValidator&); HexBinaryDatatypeValidator& operator=(const HexBinaryDatatypeValidator&); // ----------------------------------------------------------------------- // Private data members // // Nil. // ----------------------------------------------------------------------- }; XERCES_CPP_NAMESPACE_END #endif /** * End of file HexBinaryDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/FloatDatatypeValidator.hpp000644 000765 000024 00000011636 13241160333 027374 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: FloatDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_FLOAT_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_FLOAT_DATATYPEVALIDATOR_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT FloatDatatypeValidator : public AbstractNumericValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ FloatDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); FloatDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~FloatDatatypeValidator(); //@} // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- /** @name Compare Function */ //@{ /** * Compare two boolean data types * * @param content1 * @param content2 * @return */ virtual int compare(const XMLCh* const, const XMLCh* const , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(FloatDatatypeValidator) protected: // ----------------------------------------------------------------------- // ctor provided to be used by derived classes // ----------------------------------------------------------------------- FloatDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); // ----------------------------------------------------------------------- // Abstract interface from AbstractNumericFacetValidator // ----------------------------------------------------------------------- virtual int compareValues(const XMLNumber* const lValue , const XMLNumber* const rValue); virtual void setMaxInclusive(const XMLCh* const); virtual void setMaxExclusive(const XMLCh* const); virtual void setMinInclusive(const XMLCh* const); virtual void setMinExclusive(const XMLCh* const); virtual void setEnumeration(MemoryManager* const manager); // ----------------------------------------------------------------------- // Abstract interface from AbstractNumericValidator // ----------------------------------------------------------------------- virtual void checkContent(const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- FloatDatatypeValidator(const FloatDatatypeValidator&); FloatDatatypeValidator& operator = (const FloatDatatypeValidator&); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file FloatDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/DurationDatatypeValidator.cpp000644 000765 000024 00000007167 13241160333 030113 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DurationDatatypeValidator.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- DurationDatatypeValidator::DurationDatatypeValidator(MemoryManager* const manager) :DateTimeValidator(0, 0, 0, DatatypeValidator::Duration, manager) { setOrdered(XSSimpleTypeDefinition::ORDERED_PARTIAL); } DurationDatatypeValidator::DurationDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :DateTimeValidator(baseValidator, facets, finalSet, DatatypeValidator::Duration, manager) { init(enums, manager); } DurationDatatypeValidator::~DurationDatatypeValidator() {} DatatypeValidator* DurationDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) DurationDatatypeValidator(this, facets, enums, finalSet, manager); } // // caller need to release the date created here // XMLDateTime* DurationDatatypeValidator::parse(const XMLCh* const content, MemoryManager* const manager) { XMLDateTime *pRetDate = new (manager) XMLDateTime(content, manager); Janitor jan(pRetDate); try { pRetDate->parseDuration(); } catch(const OutOfMemoryException&) { jan.release(); throw; } return jan.release(); } void DurationDatatypeValidator::parse(XMLDateTime* const pDate) { pDate->parseDuration(); } int DurationDatatypeValidator::compareDates(const XMLDateTime* const date1 , const XMLDateTime* const date2 , bool strict) { return XMLDateTime::compare(date1, date2, strict); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(DurationDatatypeValidator) void DurationDatatypeValidator::serialize(XSerializeEngine& serEng) { DateTimeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file DurationDatatypeValidator::cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/YearMonthDatatypeValidator.cpp000644 000765 000024 00000006600 13241160333 030223 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: YearMonthDatatypeValidator.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- YearMonthDatatypeValidator::YearMonthDatatypeValidator(MemoryManager* const manager) :DateTimeValidator(0, 0, 0, DatatypeValidator::YearMonth, manager) { setOrdered(XSSimpleTypeDefinition::ORDERED_PARTIAL); } YearMonthDatatypeValidator::YearMonthDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :DateTimeValidator(baseValidator, facets, finalSet, DatatypeValidator::YearMonth, manager) { init(enums, manager); } YearMonthDatatypeValidator::~YearMonthDatatypeValidator() {} DatatypeValidator* YearMonthDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) YearMonthDatatypeValidator(this, facets, enums, finalSet, manager); } // // caller need to release the date created here // XMLDateTime* YearMonthDatatypeValidator::parse(const XMLCh* const content, MemoryManager* const manager) { XMLDateTime *pRetDate = new (manager) XMLDateTime(content, manager); Janitor jan(pRetDate); try { pRetDate->parseYearMonth(); } catch(const OutOfMemoryException&) { jan.release(); throw; } return jan.release(); } void YearMonthDatatypeValidator::parse(XMLDateTime* const pDate) { pDate->parseYearMonth(); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(YearMonthDatatypeValidator) void YearMonthDatatypeValidator::serialize(XSerializeEngine& serEng) { DateTimeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file YearMonthDatatypeValidator::cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/ListDatatypeValidator.cpp000644 000765 000024 00000037625 13241160333 027243 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ListDatatypeValidator.cpp 695949 2008-09-16 15:57:44Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN static const int BUF_LEN = 64; // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- ListDatatypeValidator::ListDatatypeValidator(MemoryManager* const manager) :AbstractStringValidator(0, 0, 0, DatatypeValidator::List, manager) ,fContent(0) {} ListDatatypeValidator::ListDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :AbstractStringValidator(baseValidator, facets, finalSet, DatatypeValidator::List, manager) ,fContent(0) { // // baseValidator shall either // an atomic DTV which servers as itemType, or // another ListDTV from which, this ListDTV is derived by restriction. // // In either case, it shall be not null // if (!baseValidator) ThrowXMLwithMemMgr(InvalidDatatypeFacetException, XMLExcepts::FACET_List_Null_baseValidator, manager); init(enums, manager); } ListDatatypeValidator::~ListDatatypeValidator() {} DatatypeValidator* ListDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) ListDatatypeValidator(this, facets, enums, finalSet, manager); } int ListDatatypeValidator::compare(const XMLCh* const lValue , const XMLCh* const rValue , MemoryManager* const manager) { DatatypeValidator* theItemTypeDTV = getItemTypeDTV(); BaseRefVectorOf* lVector = XMLString::tokenizeString(lValue, manager); Janitor > janl(lVector); BaseRefVectorOf* rVector = XMLString::tokenizeString(rValue, manager); Janitor > janr(rVector); XMLSize_t lNumberOfTokens = lVector->size(); XMLSize_t rNumberOfTokens = rVector->size(); if (lNumberOfTokens < rNumberOfTokens) return -1; else if (lNumberOfTokens > rNumberOfTokens) return 1; else { //compare each token for ( XMLSize_t i = 0; i < lNumberOfTokens; i++) { int returnValue = theItemTypeDTV->compare(lVector->elementAt(i), rVector->elementAt(i), manager); if (returnValue != 0) return returnValue; //REVISIT: does it make sense to return -1 or +1..? } return 0; } } void ListDatatypeValidator::validate( const XMLCh* const content , ValidationContext* const context , MemoryManager* const manager) { setContent(content); BaseRefVectorOf* tokenVector = XMLString::tokenizeString(content, manager); Janitor > janName(tokenVector); checkContent(tokenVector, content, context, false, manager); } void ListDatatypeValidator::checkContent( const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager) { setContent(content); BaseRefVectorOf* tokenVector = XMLString::tokenizeString(content, manager); Janitor > janName(tokenVector); checkContent(tokenVector, content, context, asBase, manager); } // // here content is a list of items // void ListDatatypeValidator::checkContent( BaseRefVectorOf* tokenVector , const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager) { DatatypeValidator* bv = getBaseValidator(); if (bv->getType() == DatatypeValidator::List) ((ListDatatypeValidator*)bv)->checkContent(tokenVector, content, context, true, manager); else { // the ultimate itemType DTV for (unsigned int i = 0; i < tokenVector->size(); i++) bv->validate(tokenVector->elementAt(i), context, manager); } int thisFacetsDefined = getFacetsDefined(); // we check pattern first if ( (thisFacetsDefined & DatatypeValidator::FACET_PATTERN ) != 0 ) { //check every item in the list as a whole if (getRegex()->matches(content, manager) == false) { ThrowXMLwithMemMgr2(InvalidDatatypeValueException , XMLExcepts::VALUE_NotMatch_Pattern , content , getPattern() , manager); } } // if this is a base validator, we only need to check pattern facet // all other facet were inherited by the derived type if (asBase) return; XMLSize_t tokenNumber = tokenVector->size(); if (((thisFacetsDefined & DatatypeValidator::FACET_MAXLENGTH) != 0) && (tokenNumber > getMaxLength())) { XMLCh value1[BUF_LEN+1]; XMLCh value2[BUF_LEN+1]; XMLString::sizeToText(tokenNumber, value1, BUF_LEN, 10, manager); XMLString::sizeToText(getMaxLength(), value2, BUF_LEN, 10, manager); ThrowXMLwithMemMgr3(InvalidDatatypeValueException , XMLExcepts::VALUE_GT_maxLen , getContent() , value1 , value2 , manager); } if (((thisFacetsDefined & DatatypeValidator::FACET_MINLENGTH) != 0) && (tokenNumber < getMinLength())) { XMLCh value1[BUF_LEN+1]; XMLCh value2[BUF_LEN+1]; XMLString::sizeToText(tokenNumber, value1, BUF_LEN, 10, manager); XMLString::sizeToText(getMinLength(), value2, BUF_LEN, 10, manager); ThrowXMLwithMemMgr3(InvalidDatatypeValueException , XMLExcepts::VALUE_LT_minLen , getContent() , value1 , value2 , manager); } if (((thisFacetsDefined & DatatypeValidator::FACET_LENGTH) != 0) && (tokenNumber != AbstractStringValidator::getLength())) { XMLCh value1[BUF_LEN+1]; XMLCh value2[BUF_LEN+1]; XMLString::sizeToText(tokenNumber, value1, BUF_LEN, 10, manager); XMLString::sizeToText(AbstractStringValidator::getLength(), value2, BUF_LEN, 10, manager); ThrowXMLwithMemMgr3(InvalidDatatypeValueException , XMLExcepts::VALUE_NE_Len , getContent() , value1 , value2 , manager); } if ((thisFacetsDefined & DatatypeValidator::FACET_ENUMERATION) != 0 && (getEnumeration() != 0)) { XMLSize_t i; XMLSize_t enumLength = getEnumeration()->size(); for ( i = 0; i < enumLength; i++) { //optimization: we do a lexical comparision first // this may be faster for string and its derived if (XMLString::equals(getEnumeration()->elementAt(i), getContent())) break; // a match found // do a value space check // this is needed for decimal (and probably other types // such as datetime related) // eg. // tokenVector = "1 2 3.0 4" vs enumeration = "1 2 3 4.0" // if (valueSpaceCheck(tokenVector, getEnumeration()->elementAt(i), manager)) break; } if (i == enumLength) ThrowXMLwithMemMgr1(InvalidDatatypeValueException, XMLExcepts::VALUE_NotIn_Enumeration, getContent(), manager); } // enumeration } bool ListDatatypeValidator::valueSpaceCheck(BaseRefVectorOf* tokenVector , const XMLCh* const enumStr , MemoryManager* const manager) const { DatatypeValidator* theItemTypeDTV = getItemTypeDTV(); BaseRefVectorOf* enumVector = XMLString::tokenizeString(enumStr, manager); Janitor > janName(enumVector); if (tokenVector->size() != enumVector->size()) return false; for ( unsigned int j = 0; j < tokenVector->size(); j++ ) { if (theItemTypeDTV->compare(tokenVector->elementAt(j), enumVector->elementAt(j), manager) != 0) return false; } return true; } DatatypeValidator* ListDatatypeValidator::getItemTypeDTV() const { DatatypeValidator* bdv = this->getBaseValidator(); while (bdv->getType() == DatatypeValidator::List) bdv = bdv->getBaseValidator(); return bdv; } // --------------------------------------------------------------------------- // Utilities // --------------------------------------------------------------------------- void ListDatatypeValidator::checkValueSpace(const XMLCh* const , MemoryManager* const) {} XMLSize_t ListDatatypeValidator::getLength(const XMLCh* const content , MemoryManager* const manager) const { BaseRefVectorOf* tokenVector = XMLString::tokenizeString(content, manager); Janitor > janName(tokenVector); return tokenVector->size(); } void ListDatatypeValidator::inspectFacetBase(MemoryManager* const manager) { // // we are pretty sure baseValidator is not null // if (getBaseValidator()->getType() == DatatypeValidator::List) { AbstractStringValidator::inspectFacetBase(manager); } else { // the first level ListDTV // check 4.3.5.c0 must: enumeration values from the value space of base if ( ((getFacetsDefined() & DatatypeValidator::FACET_ENUMERATION) != 0) && (getEnumeration() !=0) ) { XMLSize_t i; XMLSize_t enumLength = getEnumeration()->size(); try { for ( i = 0; i < enumLength; i++) { // ask the itemType for a complete check BaseRefVectorOf* tempList = XMLString::tokenizeString(getEnumeration()->elementAt(i), manager); Janitor > jan(tempList); XMLSize_t tokenNumber = tempList->size(); try { for ( XMLSize_t j = 0; j < tokenNumber; j++) getBaseValidator()->validate(tempList->elementAt(j), (ValidationContext*)0, manager); } catch(const OutOfMemoryException&) { jan.release(); throw; } #if 0 // spec says that only base has to checkContent // enum shall pass this->checkContent() as well. checkContent(getEnumeration()->elementAt(i), (ValidationContext*)0, false, manager); #endif } } catch ( XMLException& ) { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException , XMLExcepts::FACET_enum_base , getEnumeration()->elementAt(i) , manager); } } } }// End of inspectFacetBase() void ListDatatypeValidator::inheritFacet() { //iff the base validator is List, then we inherit // if (getBaseValidator()->getType() == DatatypeValidator::List) { AbstractStringValidator::inheritFacet(); } } /*** * 2.5.1.2 List datatypes * * The canonical-lexical-representation for the list datatype is defined as * the lexical form in which each item in the list has the canonical * lexical representation of its itemType. ***/ const XMLCh* ListDatatypeValidator::getCanonicalRepresentation(const XMLCh* const rawData , MemoryManager* const memMgr , bool toValidate) const { MemoryManager* toUse = memMgr? memMgr : getMemoryManager(); ListDatatypeValidator* temp = (ListDatatypeValidator*) this; temp->setContent(rawData); BaseRefVectorOf* tokenVector = XMLString::tokenizeString(rawData, toUse); Janitor > janName(tokenVector); if (toValidate) { try { temp->checkContent(tokenVector, rawData, 0, false, toUse); } catch (...) { return 0; } } XMLSize_t retBufSize = 2 * XMLString::stringLen(rawData); XMLCh* retBuf = (XMLCh*) toUse->allocate(retBufSize * sizeof(XMLCh)); retBuf[0] = 0; XMLCh* retBufPtr = retBuf; DatatypeValidator* itemDv = this->getItemTypeDTV(); try { for (unsigned int i = 0; i < tokenVector->size(); i++) { XMLCh* itemCanRep = (XMLCh*) itemDv->getCanonicalRepresentation(tokenVector->elementAt(i), toUse, false); XMLSize_t itemLen = XMLString::stringLen(itemCanRep); if(retBufPtr+itemLen+2 >= retBuf+retBufSize) { // need to resize XMLCh * oldBuf = retBuf; retBuf = (XMLCh*) toUse->allocate(retBufSize * sizeof(XMLCh) * 4); memcpy(retBuf, oldBuf, retBufSize * sizeof(XMLCh )); retBufPtr = (retBufPtr - oldBuf) + retBuf; toUse->deallocate(oldBuf); retBufSize <<= 2; } XMLString::catString(retBufPtr, itemCanRep); retBufPtr = retBufPtr + itemLen; *(retBufPtr++) = chSpace; *(retBufPtr) = chNull; toUse->deallocate(itemCanRep); } return retBuf; } catch (...) { return 0; } } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(ListDatatypeValidator) void ListDatatypeValidator::serialize(XSerializeEngine& serEng) { AbstractStringValidator::serialize(serEng); //don't serialize fContent, since it is NOT owned and //will be reset each time validate()/checkContent() invoked. } XERCES_CPP_NAMESPACE_END /** * End of file ListDatatypeValidator.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/UnionDatatypeValidator.hpp000644 000765 000024 00000023543 13241160333 027417 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: UnionDatatypeValidator.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_UNION_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_UNION_DATATYPEVALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT UnionDatatypeValidator : public DatatypeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor. */ //@{ UnionDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); // // constructor for native Union datatype validator // // // // UnionDatatypeValidator ( RefVectorOf* const memberTypeValidators , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); // // constructor for derived Union datatype validator // // // // // // // UnionDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager , RefVectorOf* const memberTypeValidators = 0 , const bool memberTypesInherited = true ); virtual ~UnionDatatypeValidator(); //@} virtual const RefArrayVectorOf* getEnumString() const; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** @name Getter Functions */ //@{ /** * Returns whether the type is atomic or not */ virtual bool isAtomic() const; virtual const XMLCh* getCanonicalRepresentation ( const XMLCh* const rawData , MemoryManager* const memMgr = 0 , bool toValidate = false ) const; //@} // ----------------------------------------------------------------------- // Validation methods // ----------------------------------------------------------------------- /** @name Validation Function */ //@{ /** * validate that a string matches the boolean datatype * @param content A string containing the content to be validated * * @exception throws InvalidDatatypeException if the content is * is not valid. */ virtual void validate ( const XMLCh* const content , ValidationContext* const context = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Checks whether a given type can be used as a substitute * * @param toCheck A datatype validator of the type to be used as a * substitute * * To be redefined in UnionDatatypeValidator */ virtual bool isSubstitutableBy(const DatatypeValidator* const toCheck); //@} // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- /** @name Compare Function */ //@{ /** * Compare two boolean data types * * @param content1 * @param content2 * @return */ int compare(const XMLCh* const, const XMLCh* const , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(UnionDatatypeValidator) RefVectorOf* getMemberTypeValidators() const; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- UnionDatatypeValidator(const UnionDatatypeValidator&); UnionDatatypeValidator& operator=(const UnionDatatypeValidator&); virtual void checkContent(const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager); void init(DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , MemoryManager* const manager); void cleanUp(); RefArrayVectorOf* getEnumeration() const; void setEnumeration(RefArrayVectorOf*, bool); // ----------------------------------------------------------------------- // Private data members // // fEnumeration // we own it (or not, depending on state of fEnumerationInherited). // // fMemberTypeValidators // we own it (or not, depending on the state of fMemberTypesInherited). // // ----------------------------------------------------------------------- bool fEnumerationInherited; bool fMemberTypesInherited; RefArrayVectorOf* fEnumeration; RefVectorOf* fMemberTypeValidators; }; inline DatatypeValidator* UnionDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) UnionDatatypeValidator(this, facets, enums, finalSet, manager, fMemberTypeValidators, true); } inline void UnionDatatypeValidator::validate( const XMLCh* const content , ValidationContext* const context , MemoryManager* const manager) { checkContent(content, context, false, manager); } inline void UnionDatatypeValidator::cleanUp() { //~RefVectorOf will delete all adopted elements if ( !fEnumerationInherited && fEnumeration) delete fEnumeration; if (!fMemberTypesInherited && fMemberTypeValidators) delete fMemberTypeValidators; } inline RefArrayVectorOf* UnionDatatypeValidator:: getEnumeration() const { return fEnumeration; } inline void UnionDatatypeValidator::setEnumeration(RefArrayVectorOf* enums , bool inherited) { if (enums) { if ( !fEnumerationInherited && fEnumeration) delete fEnumeration; fEnumeration = enums; fEnumerationInherited = inherited; setFacetsDefined(DatatypeValidator::FACET_ENUMERATION); } } // // get the native UnionDTV's fMemberTypeValidators // inline RefVectorOf* UnionDatatypeValidator::getMemberTypeValidators() const { return this->fMemberTypeValidators; } inline bool UnionDatatypeValidator::isAtomic() const { if (!fMemberTypeValidators) { return false; } XMLSize_t memberSize = fMemberTypeValidators->size(); for (XMLSize_t i=0; i < memberSize; i++) { if (!fMemberTypeValidators->elementAt(i)->isAtomic()) { return false; } } return true; } inline bool UnionDatatypeValidator::isSubstitutableBy(const DatatypeValidator* const toCheck) { if (toCheck == this) { return true; } if (fMemberTypeValidators) { XMLSize_t memberSize = fMemberTypeValidators->size(); for (XMLSize_t i=0; i < memberSize; i++) { if ((fMemberTypeValidators->elementAt(i)->getType() == DatatypeValidator::Union) && (fMemberTypeValidators->elementAt(i) == toCheck)) return false; if (fMemberTypeValidators->elementAt(i)->isSubstitutableBy(toCheck)) { return true; } } } return false; } XERCES_CPP_NAMESPACE_END #endif /** * End of file UnionDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/IDREFDatatypeValidator.cpp000644 000765 000024 00000010702 13241160333 027144 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IDREFDatatypeValidator.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- IDREFDatatypeValidator::IDREFDatatypeValidator(MemoryManager* const manager) :StringDatatypeValidator(0, 0, 0, DatatypeValidator::IDREF, manager) {} IDREFDatatypeValidator::IDREFDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :StringDatatypeValidator(baseValidator, facets, finalSet, DatatypeValidator::IDREF, manager) { init(enums, manager); } IDREFDatatypeValidator::~IDREFDatatypeValidator() {} DatatypeValidator* IDREFDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) IDREFDatatypeValidator(this, facets, enums, finalSet, manager); } IDREFDatatypeValidator::IDREFDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager) :StringDatatypeValidator(baseValidator, facets, finalSet, type, manager) { // do not invoke init() here!!! } void IDREFDatatypeValidator::validate(const XMLCh* const content , ValidationContext* const context , MemoryManager* const manager) { // use StringDatatypeValidator (which in turn, invoke // the baseValidator) to validate content against // facets if any. // StringDatatypeValidator::validate(content, context, manager); // this is different from java, since we always add, while // in java, it is done as told. REVISIT. // if (context) { context->addIdRef(content); } } void IDREFDatatypeValidator::checkValueSpace(const XMLCh* const content , MemoryManager* const manager) { // // 3.3.9 check must: "NCName" // if ( !XMLChar1_0::isValidNCName(content, XMLString::stringLen(content)) ) { ThrowXMLwithMemMgr1(InvalidDatatypeValueException , XMLExcepts::VALUE_Invalid_NCName , content , manager); } } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(IDREFDatatypeValidator) void IDREFDatatypeValidator::serialize(XSerializeEngine& serEng) { StringDatatypeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file IDREFDatatypeValidator.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/YearDatatypeValidator.cpp000644 000765 000024 00000006440 13241160333 027217 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: YearDatatypeValidator.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- YearDatatypeValidator::YearDatatypeValidator(MemoryManager* const manager) :DateTimeValidator(0, 0, 0, DatatypeValidator::Year, manager) { setOrdered(XSSimpleTypeDefinition::ORDERED_PARTIAL); } YearDatatypeValidator::YearDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :DateTimeValidator(baseValidator, facets, finalSet, DatatypeValidator::Year, manager) { init(enums, manager); } YearDatatypeValidator::~YearDatatypeValidator() {} DatatypeValidator* YearDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) YearDatatypeValidator(this, facets, enums, finalSet, manager); } // // caller need to release the date created here // XMLDateTime* YearDatatypeValidator::parse(const XMLCh* const content, MemoryManager* const manager) { XMLDateTime *pRetDate = new (manager) XMLDateTime(content, manager); Janitor jan(pRetDate); try { pRetDate->parseYear(); } catch(const OutOfMemoryException&) { jan.release(); throw; } return jan.release(); } void YearDatatypeValidator::parse(XMLDateTime* const pDate) { pDate->parseYear(); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(YearDatatypeValidator) void YearDatatypeValidator::serialize(XSerializeEngine& serEng) { DateTimeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file YearDatatypeValidator::cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/DateDatatypeValidator.hpp000644 000765 000024 00000006637 13241160333 027211 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DateDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DATE_DATATYPE_VALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_DATE_DATATYPE_VALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT DateDatatypeValidator : public DateTimeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ DateDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); DateDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~DateDatatypeValidator(); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual const XMLCh* getCanonicalRepresentation ( const XMLCh* const rawData , MemoryManager* const memMgr = 0 , bool toValidate = false ) const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(DateDatatypeValidator) protected: // ----------------------------------------------------------------------- // implementation of (DateTimeValidator's) virtual interface // ----------------------------------------------------------------------- virtual XMLDateTime* parse(const XMLCh* const, MemoryManager* const manager); virtual void parse(XMLDateTime* const); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DateDatatypeValidator(const DateDatatypeValidator&); DateDatatypeValidator& operator=(const DateDatatypeValidator&); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file DateDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/IDDatatypeValidator.hpp000644 000765 000024 00000010434 13241160333 026616 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IDDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_ID_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_ID_DATATYPEVALIDATOR_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT IDDatatypeValidator : public StringDatatypeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ IDDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); IDDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~IDDatatypeValidator(); //@} // ----------------------------------------------------------------------- // Validation methods // ----------------------------------------------------------------------- /** @name Validation Function */ //@{ /** * validate that a string matches the boolean datatype * @param content A string containing the content to be validated * * @exception throws InvalidDatatypeException if the content is * is not valid. */ virtual void validate ( const XMLCh* const content , ValidationContext* const context = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(IDDatatypeValidator) protected: // // ctor provided to be used by derived classes // IDDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual void checkValueSpace(const XMLCh* const content , MemoryManager* const manager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- IDDatatypeValidator(const IDDatatypeValidator&); IDDatatypeValidator& operator=(const IDDatatypeValidator&); // ----------------------------------------------------------------------- // Private data members // // // ----------------------------------------------------------------------- }; XERCES_CPP_NAMESPACE_END #endif /** * End of file IDDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/DateTimeValidator.cpp000644 000765 000024 00000023703 13241160333 026320 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DateTimeValidator.cpp 676911 2008-07-15 13:27:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Macro // --------------------------------------------------------------------------- #define REPORT_VALUE_ERROR(val1, val2, except_code, manager) \ ThrowXMLwithMemMgr2(InvalidDatatypeValueException \ , except_code \ , val1->getRawData() \ , val2->getRawData() \ , manager); // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- DateTimeValidator::~DateTimeValidator() { } DateTimeValidator::DateTimeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager) :AbstractNumericFacetValidator(baseValidator, facets, finalSet, type, manager) { //do not invoke init() here !!! } void DateTimeValidator::validate(const XMLCh* const content , ValidationContext* const context , MemoryManager* const manager) { checkContent(content, context, false, manager); } int DateTimeValidator::compare(const XMLCh* const value1 , const XMLCh* const value2 , MemoryManager* const manager) { try { XMLDateTime *pDate1 = parse(value1, manager); Janitor jName1(pDate1); XMLDateTime *pDate2 = parse(value2, manager); Janitor jName2(pDate2); int result = compareDates(pDate1, pDate2, true); return (result==INDETERMINATE)? -1 : result; } catch(const OutOfMemoryException&) { throw; } catch (...) // RuntimeException e { return -1; // revisit after implement compareDates() } } void DateTimeValidator::checkContent(const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager) { //validate against base validator if any DateTimeValidator *pBaseValidator = (DateTimeValidator*) this->getBaseValidator(); if (pBaseValidator) pBaseValidator->checkContent(content, context, true, manager); int thisFacetsDefined = getFacetsDefined(); // we check pattern first if ( (thisFacetsDefined & DatatypeValidator::FACET_PATTERN ) != 0 ) { if (getRegex()->matches(content, manager) ==false) { ThrowXMLwithMemMgr2(InvalidDatatypeValueException , XMLExcepts::VALUE_NotMatch_Pattern , content , getPattern() , manager); } } // if this is a base validator, we only need to check pattern facet // all other facet were inherited by the derived type if (asBase) return; // the derived classes' parse() method constructs an // XMLDateTime object anc invokes appropriate XMLDateTime's // parser to parse the content. XMLDateTime dateTimeValue(content, manager); XMLDateTime* dateTime = &dateTimeValue; parse(dateTime); // must be < MaxExclusive if ((thisFacetsDefined & DatatypeValidator::FACET_MAXEXCLUSIVE) != 0) { if (compareValues(dateTime, getMaxExclusive()) != XMLDateTime::LESS_THAN) { REPORT_VALUE_ERROR( dateTime , getMaxExclusive() , XMLExcepts::VALUE_exceed_maxExcl , manager) } } // must be <= MaxInclusive if ((thisFacetsDefined & DatatypeValidator::FACET_MAXINCLUSIVE) != 0) { int result = compareValues(dateTime, getMaxInclusive()); if ( result == XMLDateTime::GREATER_THAN || result == XMLDateTime::INDETERMINATE ) { REPORT_VALUE_ERROR( dateTime , getMaxInclusive() , XMLExcepts::VALUE_exceed_maxIncl , manager) } } // must be >= MinInclusive if ((thisFacetsDefined & DatatypeValidator::FACET_MININCLUSIVE) != 0) { int result = compareValues(dateTime, getMinInclusive()); if (result == XMLDateTime::LESS_THAN || result == XMLDateTime::INDETERMINATE) { REPORT_VALUE_ERROR( dateTime , getMinInclusive() , XMLExcepts::VALUE_exceed_minIncl , manager) } } // must be > MinExclusive if ( (thisFacetsDefined & DatatypeValidator::FACET_MINEXCLUSIVE) != 0 ) { if (compareValues(dateTime, getMinExclusive()) != XMLDateTime::GREATER_THAN) { REPORT_VALUE_ERROR( dateTime , getMinExclusive() , XMLExcepts::VALUE_exceed_minExcl , manager) } } if ((thisFacetsDefined & DatatypeValidator::FACET_ENUMERATION) != 0 && (getEnumeration() != 0)) { XMLSize_t i=0; XMLSize_t enumLength = getEnumeration()->size(); for ( ; i < enumLength; i++) { if (compareValues(dateTime, getEnumeration()->elementAt(i)) == XMLDateTime::EQUAL) break; } if (i == enumLength) ThrowXMLwithMemMgr1(InvalidDatatypeValueException, XMLExcepts::VALUE_NotIn_Enumeration, content, manager); } } // // Comparision methods // int DateTimeValidator::compareValues(const XMLNumber* const lValue , const XMLNumber* const rValue) { return compareDates((XMLDateTime*) lValue, (XMLDateTime*) rValue, true); } /** * Compare algorithm described in dateDime (3.2.7). * Duration datatype overwrites this method * * @param date1 normalized date representation of the first value * @param date2 normalized date representation of the second value * @param strict * @return less, greater, less_equal, greater_equal, equal */ int DateTimeValidator::compareDates(const XMLDateTime* const date1 , const XMLDateTime* const date2 , bool) { return XMLDateTime::compare(date1, date2); } // // In fact, the proper way of the following set*() shall be // { // if (fMaxInclusive) // delete fMaxInclusive; // // fMaxInclusive = parse(value); // // } // // But we know this function is invoked once and only once // since there is no duplicated facet passed in, therefore // fMaxInclusive is alwasy zero before, so for the // sake of performance, we do not do the checking/delete. // void DateTimeValidator::setMaxInclusive(const XMLCh* const value) { fMaxInclusive = parse(value, fMemoryManager); } void DateTimeValidator::setMaxExclusive(const XMLCh* const value) { fMaxExclusive = parse(value, fMemoryManager); } void DateTimeValidator::setMinInclusive(const XMLCh* const value) { fMinInclusive = parse(value, fMemoryManager); } void DateTimeValidator::setMinExclusive(const XMLCh* const value) { fMinExclusive = parse(value, fMemoryManager); } void DateTimeValidator::setEnumeration(MemoryManager* const) { // to do: do we need to check against base value space??? if (!fStrEnumeration) return; XMLSize_t enumLength = fStrEnumeration->size(); fEnumeration = new (fMemoryManager) RefVectorOf(enumLength, true, fMemoryManager); fEnumerationInherited = false; for ( XMLSize_t i = 0; i < enumLength; i++) fEnumeration->insertElementAt(parse(fStrEnumeration->elementAt(i), fMemoryManager), i); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_NOCREATE(DateTimeValidator) void DateTimeValidator::serialize(XSerializeEngine& serEng) { /*** * * Note: All its derivatives share the same number type, that is * XMLNumber::DateTime, so this class would write it. ***/ if (serEng.isStoring()) { serEng<<(int) XMLNumber::DateTime; } AbstractNumericFacetValidator::serialize(serEng); //dateTime can be instantiated during checkContent(), so don't serialize it. } XERCES_CPP_NAMESPACE_END /** * End of file DateTimeValidator::cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/StringDatatypeValidator.hpp000644 000765 000024 00000007266 13241160333 027601 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: StringDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_STRING_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_STRING_DATATYPEVALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT StringDatatypeValidator : public AbstractStringValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ StringDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); StringDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~StringDatatypeValidator(); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(StringDatatypeValidator) protected: // // ctor provided to be used by derived classes // StringDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual void assignAdditionalFacet(const XMLCh* const key , const XMLCh* const value , MemoryManager* const manager); virtual void inheritAdditionalFacet(); virtual void checkAdditionalFacetConstraints(MemoryManager* const manager) const; virtual void checkAdditionalFacet(const XMLCh* const content , MemoryManager* const manager) const; virtual void checkValueSpace(const XMLCh* const content , MemoryManager* const manager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- StringDatatypeValidator(const StringDatatypeValidator&); StringDatatypeValidator& operator=(const StringDatatypeValidator&); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file StringDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/NCNameDatatypeValidator.cpp000644 000765 000024 00000011205 13241160333 027413 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: NCNameDatatypeValidator.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- NCNameDatatypeValidator::NCNameDatatypeValidator(MemoryManager* const manager) :StringDatatypeValidator(0, 0, 0, DatatypeValidator::NCName, manager) {} NCNameDatatypeValidator::~NCNameDatatypeValidator() {} NCNameDatatypeValidator::NCNameDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :StringDatatypeValidator(baseValidator, facets, finalSet, DatatypeValidator::NCName, manager) { init(enums, manager); } DatatypeValidator* NCNameDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) NCNameDatatypeValidator(this, facets, enums, finalSet, manager); } NCNameDatatypeValidator::NCNameDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager) :StringDatatypeValidator(baseValidator, facets, finalSet, type, manager) { // do not invoke init() here!!! } // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- int NCNameDatatypeValidator::compare(const XMLCh* const lValue , const XMLCh* const rValue , MemoryManager* const) { return ( XMLString::equals(lValue, rValue)? 0 : -1); } void NCNameDatatypeValidator::validate(const XMLCh* const content , ValidationContext* const context , MemoryManager* const manager) { // use StringDatatypeValidator (which in turn, invoke // the baseValidator) to validate content against // facets if any. // StringDatatypeValidator::validate(content, context, manager); return; } void NCNameDatatypeValidator::checkValueSpace(const XMLCh* const content , MemoryManager* const manager) { // // 3.3.7 check must: "NCName" // if ( !XMLChar1_0::isValidNCName(content, XMLString::stringLen(content)) ) { ThrowXMLwithMemMgr1(InvalidDatatypeValueException , XMLExcepts::VALUE_Invalid_NCName , content , manager); } } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(NCNameDatatypeValidator) void NCNameDatatypeValidator::serialize(XSerializeEngine& serEng) { StringDatatypeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file NCNameDatatypeValidator.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/NOTATIONDatatypeValidator.hpp000644 000765 000024 00000006606 13241160333 027563 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: NOTATIONDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_NOTATION_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_NOTATION_DATATYPEVALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT NOTATIONDatatypeValidator : public AbstractStringValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ NOTATIONDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); NOTATIONDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~NOTATIONDatatypeValidator(); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(NOTATIONDatatypeValidator) protected: virtual void checkValueSpace(const XMLCh* const content , MemoryManager* const manager); virtual void checkContent(const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- NOTATIONDatatypeValidator(const NOTATIONDatatypeValidator&); NOTATIONDatatypeValidator& operator=(const NOTATIONDatatypeValidator&); // ----------------------------------------------------------------------- // Private data members // // Nil // ----------------------------------------------------------------------- }; XERCES_CPP_NAMESPACE_END #endif /** * End of file NOTATIONDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/DoubleDatatypeValidator.cpp000644 000765 000024 00000021334 13241160333 027530 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DoubleDatatypeValidator.cpp 676911 2008-07-15 13:27:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- DoubleDatatypeValidator::DoubleDatatypeValidator(MemoryManager* const manager) :AbstractNumericValidator(0, 0, 0, DatatypeValidator::Double, manager) { setOrdered(XSSimpleTypeDefinition::ORDERED_PARTIAL); setBounded(true); setFinite(true); setNumeric(true); } DoubleDatatypeValidator::DoubleDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :AbstractNumericValidator(baseValidator, facets, finalSet, DatatypeValidator::Double, manager) { init(enums, manager); } DoubleDatatypeValidator::~DoubleDatatypeValidator() {} // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- int DoubleDatatypeValidator::compare(const XMLCh* const lValue , const XMLCh* const rValue , MemoryManager* const manager) { XMLDouble lObj(lValue, manager); XMLDouble rObj(rValue, manager); return compareValues(&lObj, &rObj); } DatatypeValidator* DoubleDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) DoubleDatatypeValidator(this, facets, enums, finalSet, manager); } // ----------------------------------------------------------------------- // ctor provided to be used by derived classes // ----------------------------------------------------------------------- DoubleDatatypeValidator::DoubleDatatypeValidator(DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager) :AbstractNumericValidator(baseValidator, facets, finalSet, type, manager) { //do not invoke init here !!! } int DoubleDatatypeValidator::compareValues(const XMLNumber* const lValue , const XMLNumber* const rValue) { return XMLDouble::compareValues((XMLDouble*) lValue, (XMLDouble*) rValue); } void DoubleDatatypeValidator::setMaxInclusive(const XMLCh* const value) { fMaxInclusive = new (fMemoryManager) XMLDouble(value, fMemoryManager); } void DoubleDatatypeValidator::setMaxExclusive(const XMLCh* const value) { fMaxExclusive = new (fMemoryManager) XMLDouble(value, fMemoryManager); } void DoubleDatatypeValidator::setMinInclusive(const XMLCh* const value) { fMinInclusive = new (fMemoryManager) XMLDouble(value, fMemoryManager); } void DoubleDatatypeValidator::setMinExclusive(const XMLCh* const value) { fMinExclusive = new (fMemoryManager) XMLDouble(value, fMemoryManager); } void DoubleDatatypeValidator::setEnumeration(MemoryManager* const manager) { // check 4.3.5.c0 must: enumeration values from the value space of base // // 1. shall be from base value space // 2. shall be from current value space as well ( shall go through boundsCheck() ) // if (!fStrEnumeration) return; XMLSize_t i = 0; XMLSize_t enumLength = fStrEnumeration->size(); DoubleDatatypeValidator *numBase = (DoubleDatatypeValidator*) getBaseValidator(); if (numBase) { try { for ( i = 0; i < enumLength; i++) { numBase->checkContent(fStrEnumeration->elementAt(i), (ValidationContext*)0, false, manager); } } catch (XMLException&) { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException , XMLExcepts::FACET_enum_base , fStrEnumeration->elementAt(i) , manager); } } #if 0 // spec says that only base has to checkContent // We put the this->checkContent in a separate loop // to not block original message with in that method. // for ( i = 0; i < enumLength; i++) { checkContent(fStrEnumeration->elementAt(i), (ValidationContext*)0, false, manager); } #endif fEnumeration = new (manager) RefVectorOf(enumLength, true, manager); fEnumerationInherited = false; for ( i = 0; i < enumLength; i++) { fEnumeration->insertElementAt(new (manager) XMLDouble(fStrEnumeration->elementAt(i), manager), i); } } // ----------------------------------------------------------------------- // Abstract interface from AbstractNumericValidator // ----------------------------------------------------------------------- void DoubleDatatypeValidator::checkContent(const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager) { //validate against base validator if any DoubleDatatypeValidator *pBase = (DoubleDatatypeValidator*) this->getBaseValidator(); if (pBase) pBase->checkContent(content, context, true, manager); // we check pattern first if ( (getFacetsDefined() & DatatypeValidator::FACET_PATTERN ) != 0 ) { if (getRegex()->matches(content, manager) ==false) { ThrowXMLwithMemMgr2(InvalidDatatypeValueException , XMLExcepts::VALUE_NotMatch_Pattern , content , getPattern() , manager); } } // if this is a base validator, we only need to check pattern facet // all other facet were inherited by the derived type if (asBase) return; XMLDouble theValue(content, manager); XMLDouble *theData = &theValue; if (getEnumeration()) { XMLSize_t i=0; XMLSize_t enumLength = getEnumeration()->size(); for ( ; i < enumLength; i++) { if (compareValues(theData, (XMLDouble*) getEnumeration()->elementAt(i)) ==0 ) break; } if (i == enumLength) ThrowXMLwithMemMgr1(InvalidDatatypeValueException, XMLExcepts::VALUE_NotIn_Enumeration, content, manager); } boundsCheck(theData, manager); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(DoubleDatatypeValidator) void DoubleDatatypeValidator::serialize(XSerializeEngine& serEng) { /*** * Note: * * During storing, we need write the specific number * type info before calling base::serialize(). * * While loading, we do nothing here ***/ if (serEng.isStoring()) { serEng<<(int) (XMLNumber::Double); } AbstractNumericValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file DoubleDatatypeValidator::cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/AbstractStringValidator.hpp000644 000765 000024 00000017155 13241160333 027567 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: AbstractStringValidator.hpp 695949 2008-09-16 15:57:44Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_ABSTRACT_STRING_VALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_ABSTRACT_STRING_VALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT AbstractStringValidator : public DatatypeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructor. */ //@{ virtual ~AbstractStringValidator(); //@} virtual const RefArrayVectorOf* getEnumString() const; // ----------------------------------------------------------------------- // Validation methods // ----------------------------------------------------------------------- /** @name Validation Function */ //@{ /** * validate that a string matches the boolean datatype * @param content A string containing the content to be validated * * @exception throws InvalidDatatypeException if the content is * is not valid. */ virtual void validate ( const XMLCh* const content , ValidationContext* const context = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- /** @name Compare Function */ //@{ virtual int compare(const XMLCh* const, const XMLCh* const , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(AbstractStringValidator) protected: AbstractStringValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); void init(RefArrayVectorOf* const enums , MemoryManager* const manager); // // Abstract interface // virtual void assignAdditionalFacet(const XMLCh* const key , const XMLCh* const value , MemoryManager* const manager); virtual void inheritAdditionalFacet(); virtual void checkAdditionalFacetConstraints(MemoryManager* const manager) const; virtual void checkAdditionalFacet(const XMLCh* const content , MemoryManager* const manager) const; virtual XMLSize_t getLength(const XMLCh* const content , MemoryManager* const manager) const; virtual void checkValueSpace(const XMLCh* const content , MemoryManager* const manager) = 0; // // to Allow ListDTV to overwrite // virtual void inspectFacetBase(MemoryManager* const manager); virtual void inheritFacet(); virtual void checkContent(const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager); /* ** Base64BinaryDatatypeValidator to overwrite */ virtual void normalizeEnumeration(MemoryManager* const manager); virtual void normalizeContent(XMLCh* const, MemoryManager* const manager) const; public: // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- inline XMLSize_t getLength() const; inline XMLSize_t getMaxLength() const; inline XMLSize_t getMinLength() const; inline RefArrayVectorOf* getEnumeration() const; protected: // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- inline void setLength(XMLSize_t); inline void setMaxLength(XMLSize_t); inline void setMinLength(XMLSize_t); inline void setEnumeration(RefArrayVectorOf*, bool); private: void assignFacet(MemoryManager* const manager); void inspectFacet(MemoryManager* const manager); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- AbstractStringValidator(const AbstractStringValidator&); AbstractStringValidator& operator=(const AbstractStringValidator&); // ----------------------------------------------------------------------- // Private data members // // ----------------------------------------------------------------------- XMLSize_t fLength; XMLSize_t fMaxLength; XMLSize_t fMinLength; bool fEnumerationInherited; RefArrayVectorOf* fEnumeration; }; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- inline XMLSize_t AbstractStringValidator::getLength() const { return fLength; } inline XMLSize_t AbstractStringValidator::getMaxLength() const { return fMaxLength; } inline XMLSize_t AbstractStringValidator::getMinLength() const { return fMinLength; } inline RefArrayVectorOf* AbstractStringValidator:: getEnumeration() const { return fEnumeration; } // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- inline void AbstractStringValidator::setLength(XMLSize_t newLength) { fLength = newLength; } inline void AbstractStringValidator::setMaxLength(XMLSize_t newMaxLength) { fMaxLength = newMaxLength; } inline void AbstractStringValidator::setMinLength(XMLSize_t newMinLength) { fMinLength = newMinLength; } inline void AbstractStringValidator::setEnumeration(RefArrayVectorOf* enums , bool inherited) { if (enums) { if ( !fEnumerationInherited && fEnumeration) delete fEnumeration; fEnumeration = enums; fEnumerationInherited = inherited; setFacetsDefined(DatatypeValidator::FACET_ENUMERATION); } } XERCES_CPP_NAMESPACE_END #endif /** * End of file AbstractStringValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/AbstractNumericFacetValidator.hpp000644 000765 000024 00000014543 13241160333 030664 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: AbstractNumericFacetValidator.hpp 673155 2008-07-01 17:55:39Z dbertoni $ */ #if !defined(XERCESC_INCLUDE_GUARD_ABSTRACT_NUMERIC_FACET_VALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_ABSTRACT_NUMERIC_FACET_VALIDATOR_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT AbstractNumericFacetValidator : public DatatypeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructor. */ //@{ virtual ~AbstractNumericFacetValidator(); //@} virtual const RefArrayVectorOf* getEnumString() const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(AbstractNumericFacetValidator) protected: AbstractNumericFacetValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); void init(RefArrayVectorOf* const enums , MemoryManager* const manager); // // Abstract interface // virtual void assignAdditionalFacet(const XMLCh* const key , const XMLCh* const value , MemoryManager* const manager); virtual void inheritAdditionalFacet(); virtual void checkAdditionalFacetConstraints(MemoryManager* const manager) const; virtual void checkAdditionalFacetConstraintsBase(MemoryManager* const manager) const; virtual int compareValues(const XMLNumber* const lValue , const XMLNumber* const rValue) = 0; virtual void checkContent(const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager) = 0; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- virtual void setMaxInclusive(const XMLCh* const) = 0; virtual void setMaxExclusive(const XMLCh* const) = 0; virtual void setMinInclusive(const XMLCh* const) = 0; virtual void setMinExclusive(const XMLCh* const) = 0; virtual void setEnumeration(MemoryManager* const manager) = 0; static const int INDETERMINATE; public: // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- inline XMLNumber* getMaxInclusive() const; inline XMLNumber* getMaxExclusive() const; inline XMLNumber* getMinInclusive() const; inline XMLNumber* getMinExclusive() const; inline RefVectorOf* getEnumeration() const; protected: // ----------------------------------------------------------------------- // Protected data members // // Allow access to derived class // // ----------------------------------------------------------------------- bool fMaxInclusiveInherited; bool fMaxExclusiveInherited; bool fMinInclusiveInherited; bool fMinExclusiveInherited; bool fEnumerationInherited; XMLNumber* fMaxInclusive; XMLNumber* fMaxExclusive; XMLNumber* fMinInclusive; XMLNumber* fMinExclusive; RefVectorOf* fEnumeration; // save the actual value RefArrayVectorOf* fStrEnumeration; private: void assignFacet(MemoryManager* const manager); void inspectFacet(MemoryManager* const manager); void inspectFacetBase(MemoryManager* const manager); void inheritFacet(); void storeClusive(XSerializeEngine& , bool , XMLNumber*); void loadClusive(XSerializeEngine& , bool& , XMLNumber*& , XMLNumber::NumberType , int ); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- AbstractNumericFacetValidator(const AbstractNumericFacetValidator&); AbstractNumericFacetValidator& operator=(const AbstractNumericFacetValidator&); }; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- inline XMLNumber* AbstractNumericFacetValidator::getMaxInclusive() const { return fMaxInclusive; } inline XMLNumber* AbstractNumericFacetValidator::getMaxExclusive() const { return fMaxExclusive; } inline XMLNumber* AbstractNumericFacetValidator::getMinInclusive() const { return fMinInclusive; } inline XMLNumber* AbstractNumericFacetValidator::getMinExclusive() const { return fMinExclusive; } inline RefVectorOf* AbstractNumericFacetValidator::getEnumeration() const { return fEnumeration; } XERCES_CPP_NAMESPACE_END #endif /** * End of file AbstractNumericFacetValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/XMLCanRepGroup.cpp000644 000765 000024 00000002447 13241160333 025526 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLCanRepGroup.cpp 471747 2006-11-06 14:31:56Z amassari $ * */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN XMLCanRepGroup::~XMLCanRepGroup() { } XMLCanRepGroup::XMLCanRepGroup(CanRepGroup val) :fData(val) { } XERCES_CPP_NAMESPACE_END /** * End of file DatatypeValidator.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/Base64BinaryDatatypeValidator.hpp000644 000765 000024 00000006374 13241160333 030523 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Base64BinaryDatatypeValidator.hpp 695949 2008-09-16 15:57:44Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_BASE64BINARY_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_BASE64BINARY_DATATYPEVALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT Base64BinaryDatatypeValidator : public AbstractStringValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ Base64BinaryDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); Base64BinaryDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~Base64BinaryDatatypeValidator(); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(Base64BinaryDatatypeValidator) protected: virtual void checkValueSpace(const XMLCh* const content , MemoryManager* const manager); virtual XMLSize_t getLength(const XMLCh* const content , MemoryManager* const manager) const; virtual void normalizeEnumeration(MemoryManager* const manager); virtual void normalizeContent(XMLCh* const, MemoryManager* const manager) const; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- Base64BinaryDatatypeValidator(const Base64BinaryDatatypeValidator&); Base64BinaryDatatypeValidator& operator=(const Base64BinaryDatatypeValidator&); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file Base64BinaryDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/DayDatatypeValidator.hpp000644 000765 000024 00000006135 13241160333 027042 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DayDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DAY_DATATYPE_VALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_DAY_DATATYPE_VALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT DayDatatypeValidator : public DateTimeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor*/ //@{ DayDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); DayDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~DayDatatypeValidator(); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(DayDatatypeValidator) protected: // ----------------------------------------------------------------------- // implementation of (DateTimeValidator's) virtual interface // ----------------------------------------------------------------------- virtual XMLDateTime* parse(const XMLCh* const, MemoryManager* const manager); virtual void parse(XMLDateTime* const); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DayDatatypeValidator(const DayDatatypeValidator&); DayDatatypeValidator& operator=(const DayDatatypeValidator&); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file DayDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/MonthDayDatatypeValidator.hpp000644 000765 000024 00000006237 13241160333 030053 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: MonthDayDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_MONTHDAY_DATATYPE_VALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_MONTHDAY_DATATYPE_VALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT MonthDayDatatypeValidator : public DateTimeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ MonthDayDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); MonthDayDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~MonthDayDatatypeValidator(); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(MonthDayDatatypeValidator) protected: // ----------------------------------------------------------------------- // implementation of (DateTimeValidator's) virtual interface // ----------------------------------------------------------------------- virtual XMLDateTime* parse(const XMLCh* const, MemoryManager* const manager); virtual void parse(XMLDateTime* const); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- MonthDayDatatypeValidator(const MonthDayDatatypeValidator&); MonthDayDatatypeValidator& operator=(const MonthDayDatatypeValidator&); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file MonthDayDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/AbstractNumericValidator.cpp000644 000765 000024 00000014430 13241160333 027707 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: AbstractNumericValidator.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN #define REPORT_VALUE_ERROR(val1, val2, except_code, manager) \ ThrowXMLwithMemMgr2(InvalidDatatypeValueException \ , except_code \ , val1->getFormattedString() \ , val2->getFormattedString() \ , manager); // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- AbstractNumericValidator::~AbstractNumericValidator() {} AbstractNumericValidator::AbstractNumericValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager) :AbstractNumericFacetValidator(baseValidator, facets, finalSet, type, manager) { //do not invoke init() here !!! } void AbstractNumericValidator::validate(const XMLCh* const content , ValidationContext* const context , MemoryManager* const manager) { checkContent(content, context, false, manager); } void AbstractNumericValidator::boundsCheck(const XMLNumber* const theData , MemoryManager* const manager) { int thisFacetsDefined = getFacetsDefined(); int result; if (thisFacetsDefined == 0) return; // must be < MaxExclusive if ( (thisFacetsDefined & DatatypeValidator::FACET_MAXEXCLUSIVE) != 0 ) { result = compareValues(theData, getMaxExclusive()); if ( result != -1) { REPORT_VALUE_ERROR(theData , getMaxExclusive() , XMLExcepts::VALUE_exceed_maxExcl , manager) } } // must be <= MaxInclusive if ( (thisFacetsDefined & DatatypeValidator::FACET_MAXINCLUSIVE) != 0 ) { result = compareValues(theData, getMaxInclusive()); if (result == 1) { REPORT_VALUE_ERROR(theData , getMaxInclusive() , XMLExcepts::VALUE_exceed_maxIncl , manager) } } // must be >= MinInclusive if ( (thisFacetsDefined & DatatypeValidator::FACET_MININCLUSIVE) != 0 ) { result = compareValues(theData, getMinInclusive()); if (result == -1) { REPORT_VALUE_ERROR(theData , getMinInclusive() , XMLExcepts::VALUE_exceed_minIncl , manager) } } // must be > MinExclusive if ( (thisFacetsDefined & DatatypeValidator::FACET_MINEXCLUSIVE) != 0 ) { result = compareValues(theData, getMinExclusive()); if (result != 1) { REPORT_VALUE_ERROR(theData , getMinExclusive() , XMLExcepts::VALUE_exceed_minExcl , manager) } } } const XMLCh* AbstractNumericValidator::getCanonicalRepresentation(const XMLCh* const rawData , MemoryManager* const memMgr , bool toValidate) const { MemoryManager* toUse = memMgr? memMgr : fMemoryManager; if (toValidate) { AbstractNumericValidator* temp = (AbstractNumericValidator*) this; try { temp->checkContent(rawData, 0, false, toUse); } catch (...) { return 0; } } // XMLAbstractDoubleFloat::getCanonicalRepresentation handles // exceptional cases return XMLAbstractDoubleFloat::getCanonicalRepresentation(rawData, toUse); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_NOCREATE(AbstractNumericValidator) void AbstractNumericValidator::serialize(XSerializeEngine& serEng) { AbstractNumericFacetValidator::serialize(serEng); /*** * Need not to do anything else here * * Note: its derivatives, Doubledv, Floatdv and Decimaldv writes * number type info into the binary data stream to be read * by AbstractNumericFacetVaildator during loading, therefore * this class can NOT write/read anything into/from the binary * data stream. * * Later on, if this class has to write/read something into/from * the binary data stream, we need to add a numberType data * to XMLNumber and let AbstractNumericFacetValidator to write/read * this number type info. ***/ } XERCES_CPP_NAMESPACE_END /** * End of file AbstractNumericValidator::cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/NameDatatypeValidator.cpp000644 000765 000024 00000011133 13241160333 027172 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: NameDatatypeValidator.cpp 558817 2007-07-23 18:12:54Z cargilld $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- NameDatatypeValidator::NameDatatypeValidator(MemoryManager* const manager) :StringDatatypeValidator(0, 0, 0, DatatypeValidator::Name, manager) {} NameDatatypeValidator::~NameDatatypeValidator() {} NameDatatypeValidator::NameDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :StringDatatypeValidator(baseValidator, facets, finalSet, DatatypeValidator::Name, manager) { init(enums, manager); } DatatypeValidator* NameDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) NameDatatypeValidator(this, facets, enums, finalSet, manager); } NameDatatypeValidator::NameDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager) :StringDatatypeValidator(baseValidator, facets, finalSet, type, manager) { // do not invoke init() here!!! } // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- int NameDatatypeValidator::compare(const XMLCh* const lValue , const XMLCh* const rValue , MemoryManager* const) { return ( XMLString::equals(lValue, rValue)? 0 : -1); } void NameDatatypeValidator::validate(const XMLCh* const content , ValidationContext* const context , MemoryManager* const manager) { // use StringDatatypeValidator (which in turn, invoke // the baseValidator) to validate content against // facets if any. // StringDatatypeValidator::validate(content, context, manager); return; } void NameDatatypeValidator::checkValueSpace(const XMLCh* const content , MemoryManager* const manager) { // // 3.3.6 check must: "Name" // if ( !XMLChar1_0::isValidName(content)) { ThrowXMLwithMemMgr2(InvalidDatatypeValueException , XMLExcepts::VALUE_Invalid_Name , content , SchemaSymbols::fgDT_NAME , manager); } } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(NameDatatypeValidator) void NameDatatypeValidator::serialize(XSerializeEngine& serEng) { StringDatatypeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file NameDatatypeValidator.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/MonthDatatypeValidator.hpp000644 000765 000024 00000006170 13241160333 027411 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: MonthDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_MONTH_DATATYPE_VALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_MONTH_DATATYPE_VALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT MonthDatatypeValidator : public DateTimeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ MonthDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); MonthDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~MonthDatatypeValidator(); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(MonthDatatypeValidator) protected: // ----------------------------------------------------------------------- // implementation of (DateTimeValidator's) virtual interface // ----------------------------------------------------------------------- virtual XMLDateTime* parse(const XMLCh* const, MemoryManager* const manager); virtual void parse(XMLDateTime* const); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- MonthDatatypeValidator(const MonthDatatypeValidator&); MonthDatatypeValidator& operator=(const MonthDatatypeValidator&); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file MonthDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/AnyURIDatatypeValidator.hpp000644 000765 000024 00000006060 13241160333 027431 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: AnyURIDatatypeValidator.hpp 608951 2008-01-04 18:21:22Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_ANYURI_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_ANYURI_DATATYPEVALIDATOR_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLBuffer; class VALIDATORS_EXPORT AnyURIDatatypeValidator : public AbstractStringValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ AnyURIDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); AnyURIDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~AnyURIDatatypeValidator(); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(AnyURIDatatypeValidator) protected: virtual void checkValueSpace(const XMLCh* const content , MemoryManager* const manager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- AnyURIDatatypeValidator(const AnyURIDatatypeValidator&); AnyURIDatatypeValidator& operator=(const AnyURIDatatypeValidator&); void encode(const XMLCh* const content, const XMLSize_t len, XMLBuffer& encoded, MemoryManager* const manager); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file AnyURIDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/DecimalDatatypeValidator.cpp000644 000765 000024 00000053740 13241160333 027662 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DecimalDatatypeValidator.cpp 932889 2010-04-11 13:10:10Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN static const int BUF_LEN = 64; // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- DecimalDatatypeValidator::DecimalDatatypeValidator(MemoryManager* const manager) :AbstractNumericValidator(0, 0, 0, DatatypeValidator::Decimal, manager) , fTotalDigits(0) , fFractionDigits(0) { setOrdered(XSSimpleTypeDefinition::ORDERED_TOTAL); setNumeric(true); } DecimalDatatypeValidator::DecimalDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :AbstractNumericValidator(baseValidator, facets, finalSet, DatatypeValidator::Decimal, manager) , fTotalDigits(0) , fFractionDigits(0) { init(enums, manager); } DecimalDatatypeValidator::~DecimalDatatypeValidator() { } // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- int DecimalDatatypeValidator::compare(const XMLCh* const lValue , const XMLCh* const rValue , MemoryManager* const manager) { XMLBigDecimal lObj(lValue, manager); XMLBigDecimal rObj(rValue, manager); return compareValues(&lObj, &rObj); } DatatypeValidator* DecimalDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) DecimalDatatypeValidator(this, facets, enums, finalSet, manager); } // ----------------------------------------------------------------------- // ctor provided to be used by derived classes // ----------------------------------------------------------------------- DecimalDatatypeValidator::DecimalDatatypeValidator(DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager) :AbstractNumericValidator(baseValidator, facets, finalSet, type, manager) , fTotalDigits(0) , fFractionDigits(0) { //do not invoke init here !!! } void DecimalDatatypeValidator::assignAdditionalFacet(const XMLCh* const key , const XMLCh* const value , MemoryManager* const manager) { if (XMLString::equals(key, SchemaSymbols::fgELT_TOTALDIGITS)) { int val; try { val = XMLString::parseInt(value, manager); } catch (NumberFormatException&) { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_Invalid_TotalDigit, value, manager); } // check 4.3.11.c0 must: totalDigits > 0 if ( val <= 0 ) ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_PosInt_TotalDigit, value, manager); setTotalDigits(val); setFacetsDefined(DatatypeValidator::FACET_TOTALDIGITS); } else if (XMLString::equals(key, SchemaSymbols::fgELT_FRACTIONDIGITS)) { int val; try { val = XMLString::parseInt(value, manager); } catch (NumberFormatException&) { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_Invalid_FractDigit, value, manager); } // check 4.3.12.c0 must: fractionDigits > 0 if ( val < 0 ) ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_NonNeg_FractDigit, value, manager); setFractionDigits(val); setFacetsDefined(DatatypeValidator::FACET_FRACTIONDIGITS); } else { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException , XMLExcepts::FACET_Invalid_Tag , key , manager); } } void DecimalDatatypeValidator::inheritAdditionalFacet() { DecimalDatatypeValidator *numBase = (DecimalDatatypeValidator*) getBaseValidator(); if (!numBase) return; int thisFacetsDefined = getFacetsDefined(); int baseFacetsDefined = numBase->getFacetsDefined(); // inherit totalDigits if ((( baseFacetsDefined & DatatypeValidator::FACET_TOTALDIGITS) != 0) && (( thisFacetsDefined & DatatypeValidator::FACET_TOTALDIGITS) == 0) ) { setTotalDigits(numBase->fTotalDigits); setFacetsDefined(DatatypeValidator::FACET_TOTALDIGITS); } // inherit fractionDigits if ((( baseFacetsDefined & DatatypeValidator::FACET_FRACTIONDIGITS) != 0) && (( thisFacetsDefined & DatatypeValidator::FACET_FRACTIONDIGITS) == 0) ) { setFractionDigits(numBase->fFractionDigits); setFacetsDefined(DatatypeValidator::FACET_FRACTIONDIGITS); } } void DecimalDatatypeValidator::checkAdditionalFacetConstraints(MemoryManager* const manager) const { int thisFacetsDefined = getFacetsDefined(); // check 4.3.12.c1 must: fractionDigits <= totalDigits if ( ((thisFacetsDefined & DatatypeValidator::FACET_FRACTIONDIGITS) != 0) && ((thisFacetsDefined & DatatypeValidator::FACET_TOTALDIGITS) != 0) ) { if ( fFractionDigits > fTotalDigits ) { XMLCh value1[BUF_LEN+1]; XMLCh value2[BUF_LEN+1]; XMLString::binToText(getFractionDigits(), value1, BUF_LEN, 10, manager); XMLString::binToText(getTotalDigits(), value2, BUF_LEN, 10, manager); ThrowXMLwithMemMgr2(InvalidDatatypeFacetException , XMLExcepts::FACET_TotDigit_FractDigit , value2 , value1 , manager); } } } void DecimalDatatypeValidator::checkAdditionalFacetConstraintsBase(MemoryManager* const manager) const { DecimalDatatypeValidator *numBase = (DecimalDatatypeValidator*) getBaseValidator(); if (!numBase) return; int thisFacetsDefined = getFacetsDefined(); int baseFacetsDefined = numBase->getFacetsDefined(); // check 4.3.11.c1 error: totalDigits > base.totalDigits // totalDigits != base.totalDigits if (base.fixed) if (( thisFacetsDefined & DatatypeValidator::FACET_TOTALDIGITS) != 0) { if ( (( baseFacetsDefined & DatatypeValidator::FACET_TOTALDIGITS) != 0) && ( fTotalDigits > numBase->fTotalDigits )) { XMLCh value1[BUF_LEN+1]; XMLCh value2[BUF_LEN+1]; XMLString::binToText(fTotalDigits, value1, BUF_LEN, 10, manager); XMLString::binToText(numBase->fTotalDigits, value2, BUF_LEN, 10, manager); ThrowXMLwithMemMgr2(InvalidDatatypeFacetException , XMLExcepts::FACET_totalDigit_base_totalDigit , value1 , value2 , manager); } if ( (( baseFacetsDefined & DatatypeValidator::FACET_TOTALDIGITS) != 0) && (( numBase->getFixed() & DatatypeValidator::FACET_TOTALDIGITS) != 0) && ( fTotalDigits != numBase->fTotalDigits )) { XMLCh value1[BUF_LEN+1]; XMLCh value2[BUF_LEN+1]; XMLString::binToText(fTotalDigits, value1, BUF_LEN, 10, manager); XMLString::binToText(numBase->fTotalDigits, value2, BUF_LEN, 10, manager); ThrowXMLwithMemMgr2(InvalidDatatypeFacetException , XMLExcepts::FACET_totalDigit_base_fixed , value1 , value2 , manager); } } if (( thisFacetsDefined & DatatypeValidator::FACET_FRACTIONDIGITS) != 0) { // check question error: fractionDigits > base.fractionDigits ??? if ( (( baseFacetsDefined & DatatypeValidator::FACET_FRACTIONDIGITS) != 0) && ( fFractionDigits > numBase->fFractionDigits )) { XMLCh value1[BUF_LEN+1]; XMLCh value2[BUF_LEN+1]; XMLString::binToText(fFractionDigits, value1, BUF_LEN, 10, manager); XMLString::binToText(numBase->fFractionDigits, value2, BUF_LEN, 10, manager); ThrowXMLwithMemMgr2(InvalidDatatypeFacetException , XMLExcepts::FACET_fractDigit_base_fractDigit , value1 , value2 , manager); } // check question error: fractionDigits > base.totalDigits ??? if ( (( baseFacetsDefined & DatatypeValidator::FACET_TOTALDIGITS) != 0) && ( fFractionDigits > numBase->fTotalDigits )) { XMLCh value1[BUF_LEN+1]; XMLCh value2[BUF_LEN+1]; XMLString::binToText(fFractionDigits, value1, BUF_LEN, 10, manager); XMLString::binToText(numBase->fTotalDigits, value2, BUF_LEN, 10, manager); ThrowXMLwithMemMgr2(InvalidDatatypeFacetException , XMLExcepts::FACET_fractDigit_base_totalDigit , value1 , value2 , manager); } // fractionDigits != base.fractionDigits if (base.fixed) if ( (( baseFacetsDefined & DatatypeValidator::FACET_FRACTIONDIGITS) != 0) && (( numBase->getFixed() & DatatypeValidator::FACET_FRACTIONDIGITS) != 0) && ( fFractionDigits != numBase->fFractionDigits )) { XMLCh value1[BUF_LEN+1]; XMLCh value2[BUF_LEN+1]; XMLString::binToText(fFractionDigits, value1, BUF_LEN, 10, manager); XMLString::binToText(numBase->fFractionDigits, value2, BUF_LEN, 10, manager); ThrowXMLwithMemMgr2(InvalidDatatypeFacetException , XMLExcepts::FACET_fractDigit_base_fixed , value1 , value2 , manager); } } } int DecimalDatatypeValidator::compareValues(const XMLNumber* const lValue , const XMLNumber* const rValue) { return XMLBigDecimal::compareValues((XMLBigDecimal*) lValue, (XMLBigDecimal*) rValue, ((XMLBigDecimal*)lValue)->getMemoryManager()); } void DecimalDatatypeValidator::setMaxInclusive(const XMLCh* const value) { fMaxInclusive = new (fMemoryManager) XMLBigDecimal(value, fMemoryManager); } void DecimalDatatypeValidator::setMaxExclusive(const XMLCh* const value) { fMaxExclusive = new (fMemoryManager) XMLBigDecimal(value, fMemoryManager); } void DecimalDatatypeValidator::setMinInclusive(const XMLCh* const value) { fMinInclusive = new (fMemoryManager) XMLBigDecimal(value, fMemoryManager); } void DecimalDatatypeValidator::setMinExclusive(const XMLCh* const value) { fMinExclusive = new (fMemoryManager) XMLBigDecimal(value, fMemoryManager); } void DecimalDatatypeValidator::setEnumeration(MemoryManager* const manager) { // check 4.3.5.c0 must: enumeration values from the value space of base // // 1. shall be from base value space // 2. shall be from current value space as well ( shall go through boundsCheck() ) // if (!fStrEnumeration) return; XMLSize_t i = 0; XMLSize_t enumLength = fStrEnumeration->size(); DecimalDatatypeValidator *numBase = (DecimalDatatypeValidator*) getBaseValidator(); if (numBase) { try { for ( i = 0; i < enumLength; i++) { numBase->checkContent(fStrEnumeration->elementAt(i), (ValidationContext*)0, false, manager); } } catch (XMLException&) { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException , XMLExcepts::FACET_enum_base , fStrEnumeration->elementAt(i) , manager); } } #if 0 // spec says that only base has to checkContent // We put the this->checkContent in a separate loop // to not block original message with in that method. // for ( i = 0; i < enumLength; i++) { checkContent(fStrEnumeration->elementAt(i), (ValidationContext*)0, false, manager); } #endif fEnumeration = new (manager) RefVectorOf(enumLength, true, manager); fEnumerationInherited = false; for ( i = 0; i < enumLength; i++) { fEnumeration->insertElementAt(new (manager) XMLBigDecimal(fStrEnumeration->elementAt(i), manager), i); } } // ----------------------------------------------------------------------- // Abstract interface from AbstractNumericValidator // ----------------------------------------------------------------------- void DecimalDatatypeValidator::checkContent(const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager) { //validate against base validator if any DecimalDatatypeValidator *pBase = (DecimalDatatypeValidator*) this->getBaseValidator(); if (pBase) pBase->checkContent(content, context, true, manager); int thisFacetsDefined = getFacetsDefined(); // we check pattern first if ( (thisFacetsDefined & DatatypeValidator::FACET_PATTERN ) != 0 ) { if (getRegex()->matches(content, manager) ==false) { ThrowXMLwithMemMgr2(InvalidDatatypeValueException , XMLExcepts::VALUE_NotMatch_Pattern , content , getPattern() , manager); } } // if this is a base validator, we only need to check pattern facet // all other facet were inherited by the derived type if (asBase) return; XMLBigDecimal compareDataValue(content, manager); XMLBigDecimal* compareData = &compareDataValue; if (getEnumeration()) { XMLSize_t i=0; XMLSize_t enumLength = getEnumeration()->size(); for ( ; i < enumLength; i++) { if (compareValues(compareData, (XMLBigDecimal*) getEnumeration()->elementAt(i)) ==0 ) break; } if (i == enumLength) ThrowXMLwithMemMgr1(InvalidDatatypeValueException, XMLExcepts::VALUE_NotIn_Enumeration, content, manager); } boundsCheck(compareData, manager); if ( (thisFacetsDefined & DatatypeValidator::FACET_FRACTIONDIGITS) != 0 ) { if ( compareData->getScale() > fFractionDigits ) { XMLCh value1[BUF_LEN+1]; XMLCh value2[BUF_LEN+1]; XMLString::binToText(compareData->getScale(), value1, BUF_LEN, 10, manager); XMLString::binToText(fFractionDigits, value2, BUF_LEN, 10, manager); ThrowXMLwithMemMgr3(InvalidDatatypeFacetException , XMLExcepts::VALUE_exceed_fractDigit , compareData->getRawData() , value1 , value2 , manager); } } if ( (thisFacetsDefined & DatatypeValidator::FACET_TOTALDIGITS) != 0 ) { if ( compareData->getTotalDigit() > fTotalDigits ) { XMLCh value1[BUF_LEN+1]; XMLCh value2[BUF_LEN+1]; XMLString::binToText(compareData->getTotalDigit(), value1, BUF_LEN, 10, manager); XMLString::binToText(fTotalDigits, value2, BUF_LEN, 10, manager); ThrowXMLwithMemMgr3(InvalidDatatypeFacetException , XMLExcepts::VALUE_exceed_totalDigit , compareData->getRawData() , value1 , value2 , manager); } /*** E2-44 totalDigits ... by restricting it to numbers that are expressible as i x 10^-n where i and n are integers such that |i| < 10^totalDigits and 0 <= n <= totalDigits. ***/ if ( compareData->getScale() > fTotalDigits ) { XMLCh value1[BUF_LEN+1]; XMLCh value2[BUF_LEN+1]; XMLString::binToText(compareData->getScale(), value1, BUF_LEN, 10, manager); XMLString::binToText(fTotalDigits, value2, BUF_LEN, 10, manager); ThrowXMLwithMemMgr3(InvalidDatatypeFacetException , XMLExcepts::VALUE_exceed_totalDigit , compareData->getRawData() , value1 , value2 , manager); } } } /*** * 3.2.3 decimal * * . the preceding optional "+" sign is prohibited. * . The decimal point is required. * . Leading and trailing zeroes are prohibited subject to the following: * there must be at least one digit to the right and to the left of the decimal point which may be a zero. * * * 3.3.13 integer * 3.3.16 long * 3.3.17 int * 3.3.18 short * 3.3.19 byte * 3.3.20 nonNegativeInteger * 3.3.25 positiveInteger * * . the preceding optional "+" sign is prohibited and * . leading zeroes are prohibited. * * * E2-27 * 3.3.14 nonPositiveInteger * * . In the canonical form for zero, the sign must be omitted. * . leading zeroes are prohibited. * * 3.3.15 negativeInteger * 3.3.21 unsignedLong * 3.3.22 unsignedInt * 3.3.23 unsignedShort * 3.3.24 unsignedByte * * . leading zeroes are prohibited. * * Summary: * . leading zeros are prohibited for all three groups * . '-' is required for nonPositiveInteger if it is zero * ***/ const XMLCh* DecimalDatatypeValidator::getCanonicalRepresentation(const XMLCh* const rawData , MemoryManager* const memMgr , bool toValidate) const { MemoryManager* toUse = memMgr? memMgr : fMemoryManager; DecimalDatatypeValidator* temp = (DecimalDatatypeValidator*) this; if (toValidate) { try { temp->checkContent(rawData, 0, false, toUse); } catch (...) { return 0; } } // XMLBigInteger::getCanonicalRepresentation and // XMLBigDecimal::getCanonicalRepresentation will handle exceptional cases XMLCanRepGroup::CanRepGroup dvType = DatatypeValidatorFactory::getCanRepGroup(temp); if ((dvType == XMLCanRepGroup::Decimal_Derived_signed) || (dvType == XMLCanRepGroup::Decimal_Derived_unsigned) || (dvType == XMLCanRepGroup::Decimal_Derived_npi) ) { return XMLBigInteger::getCanonicalRepresentation(rawData, toUse, dvType == XMLCanRepGroup::Decimal_Derived_npi); } else if (dvType == XMLCanRepGroup::Decimal) { return XMLBigDecimal::getCanonicalRepresentation(rawData, toUse); } else //in case? { return XMLString::replicate(rawData, toUse); } } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(DecimalDatatypeValidator) void DecimalDatatypeValidator::serialize(XSerializeEngine& serEng) { /*** * Note: * * During storing, we need write the specific number * type info before calling base::serialize(). * * While loading, we do nothing here ***/ if (serEng.isStoring()) { serEng<<(int) (XMLNumber::BigDecimal); } AbstractNumericValidator::serialize(serEng); //don't serialize XMLBigDecimal* if (serEng.isStoring()) { serEng<>fTotalDigits; serEng>>fFractionDigits; } } XERCES_CPP_NAMESPACE_END /** * End of file DecimalDatatypeValidator::cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/NOTATIONDatatypeValidator.cpp000644 000765 000024 00000012743 13241160333 027555 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: NOTATIONDatatypeValidator.cpp 676911 2008-07-15 13:27:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- NOTATIONDatatypeValidator::NOTATIONDatatypeValidator(MemoryManager* const manager) :AbstractStringValidator(0, 0, 0, DatatypeValidator::NOTATION, manager) {} NOTATIONDatatypeValidator::~NOTATIONDatatypeValidator() {} NOTATIONDatatypeValidator::NOTATIONDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :AbstractStringValidator(baseValidator, facets, finalSet, DatatypeValidator::NOTATION, manager) { init(enums, manager); } DatatypeValidator* NOTATIONDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) NOTATIONDatatypeValidator(this, facets, enums, finalSet, manager); } // --------------------------------------------------------------------------- // Utilities // --------------------------------------------------------------------------- void NOTATIONDatatypeValidator::checkValueSpace(const XMLCh* const content , MemoryManager* const manager) { if (!XMLString::isValidNOTATION(content, manager)) { ThrowXMLwithMemMgr1(InvalidDatatypeValueException , XMLExcepts::VALUE_NOTATION_Invalid , content , manager); } } void NOTATIONDatatypeValidator::checkContent( const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager ) { //validate against base validator if any NOTATIONDatatypeValidator *pBaseValidator = (NOTATIONDatatypeValidator*) this->getBaseValidator(); if (pBaseValidator) pBaseValidator->checkContent(content, context, true, manager); int thisFacetsDefined = getFacetsDefined(); // we check pattern first if ( (thisFacetsDefined & DatatypeValidator::FACET_PATTERN ) != 0 ) { if (getRegex()->matches(content, manager) ==false) { ThrowXMLwithMemMgr2(InvalidDatatypeValueException , XMLExcepts::VALUE_NotMatch_Pattern , content , getPattern() , manager); } } // if this is a base validator, we only need to check pattern facet // all other facet were inherited by the derived type if (asBase) return; checkValueSpace(content, manager); if ((thisFacetsDefined & DatatypeValidator::FACET_ENUMERATION) != 0 && (getEnumeration() != 0)) { XMLCh* normContent = XMLString::replicate(content, manager); ArrayJanitor jan(normContent, manager); normalizeContent(normContent, manager); XMLSize_t i=0; XMLSize_t enumLength = getEnumeration()->size(); for ( ; i < enumLength; i++) { if (XMLString::equals(normContent, getEnumeration()->elementAt(i))) break; } if (i == enumLength) ThrowXMLwithMemMgr1(InvalidDatatypeValueException, XMLExcepts::VALUE_NotIn_Enumeration, content, manager); } checkAdditionalFacet(content, manager); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(NOTATIONDatatypeValidator) void NOTATIONDatatypeValidator::serialize(XSerializeEngine& serEng) { AbstractStringValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file NOTATIONDatatypeValidator.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/DoubleDatatypeValidator.hpp000644 000765 000024 00000011627 13241160333 027541 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DoubleDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOUBLE_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_DOUBLE_DATATYPEVALIDATOR_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT DoubleDatatypeValidator : public AbstractNumericValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ DoubleDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); DoubleDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~DoubleDatatypeValidator(); //@} // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- /** @name Compare Function */ //@{ /** * Compare two boolean data types * * @param content1 * @param content2 * @return */ virtual int compare(const XMLCh* const, const XMLCh* const , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(DoubleDatatypeValidator) protected: // ----------------------------------------------------------------------- // ctor provided to be used by derived classes // ----------------------------------------------------------------------- DoubleDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); // ----------------------------------------------------------------------- // Abstract interface from AbstractNumericFacetValidator // ----------------------------------------------------------------------- virtual int compareValues(const XMLNumber* const lValue , const XMLNumber* const rValue); virtual void setMaxInclusive(const XMLCh* const); virtual void setMaxExclusive(const XMLCh* const); virtual void setMinInclusive(const XMLCh* const); virtual void setMinExclusive(const XMLCh* const); virtual void setEnumeration(MemoryManager* const manager); // ----------------------------------------------------------------------- // Abstract interface from AbstractNumericValidator // ----------------------------------------------------------------------- virtual void checkContent(const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DoubleDatatypeValidator(const DoubleDatatypeValidator &); DoubleDatatypeValidator& operator = (const DoubleDatatypeValidator&); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file DoubleDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/AbstractStringValidator.cpp000644 000765 000024 00000062525 13241160333 027563 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: AbstractStringValidator.cpp 834826 2009-11-11 10:03:53Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN static const int BUF_LEN = 64; #define REPORT_FACET_ERROR(val1, val2, except_code, manager) \ XMLCh value1[BUF_LEN+1]; \ XMLCh value2[BUF_LEN+1]; \ XMLString::sizeToText(val1, value1, BUF_LEN, 10, manager); \ XMLString::sizeToText(val2, value2, BUF_LEN, 10, manager); \ ThrowXMLwithMemMgr2(InvalidDatatypeFacetException \ , except_code \ , value1 \ , value2 \ , manager); #define REPORT_VALUE_ERROR(data, val1, val2, except_code, manager) \ XMLCh value1[BUF_LEN+1]; \ XMLCh value2[BUF_LEN+1]; \ XMLString::sizeToText(val1, value1, BUF_LEN, 10, manager); \ XMLString::sizeToText(val2, value2, BUF_LEN, 10, manager); \ ThrowXMLwithMemMgr3(InvalidDatatypeValueException \ , except_code \ , data \ , value1 \ , value2 \ , manager); // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- AbstractStringValidator::~AbstractStringValidator() { //~RefVectorOf will delete all adopted elements if ( !fEnumerationInherited && fEnumeration) { delete fEnumeration; fEnumeration = 0; } } AbstractStringValidator::AbstractStringValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager) :DatatypeValidator(baseValidator, facets, finalSet, type, manager) ,fLength(0) ,fMaxLength(SchemaSymbols::fgINT_MAX_VALUE) ,fMinLength(0) ,fEnumerationInherited(false) ,fEnumeration(0) { // init() is invoked from derived class's ctor instead of from // here to allow correct resolution of virutal method, such as // assigneAdditionalFacet(), inheritAdditionalFacet(). } void AbstractStringValidator::init(RefArrayVectorOf* const enums ,MemoryManager* const manager) { if (enums) { setEnumeration(enums, false); normalizeEnumeration(manager); } assignFacet(manager); inspectFacet(manager); inspectFacetBase(manager); inheritFacet(); } // // Assign facets // assign common facets // assign additional facet // void AbstractStringValidator::assignFacet(MemoryManager* const manager) { RefHashTableOf* facets = getFacets(); if (!facets) return; XMLCh* key; RefHashTableOfEnumerator e(facets, false, manager); while (e.hasMoreElements()) { KVStringPair pair = e.nextElement(); key = pair.getKey(); XMLCh* value = pair.getValue(); if (XMLString::equals(key, SchemaSymbols::fgELT_LENGTH)) { int val; try { val = XMLString::parseInt(value, manager); } catch (NumberFormatException&) { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_Invalid_Len, value, manager); } if ( val < 0 ) ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_NonNeg_Len, value, manager); setLength(val); setFacetsDefined(DatatypeValidator::FACET_LENGTH); } else if (XMLString::equals(key, SchemaSymbols::fgELT_MINLENGTH)) { int val; try { val = XMLString::parseInt(value, manager); } catch (NumberFormatException&) { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_Invalid_minLen, value, manager); } if ( val < 0 ) ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_NonNeg_minLen, value, manager); setMinLength(val); setFacetsDefined(DatatypeValidator::FACET_MINLENGTH); } else if (XMLString::equals(key, SchemaSymbols::fgELT_MAXLENGTH)) { int val; try { val = XMLString::parseInt(value, manager); } catch (NumberFormatException&) { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_Invalid_maxLen, value, manager); } if ( val < 0 ) ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_NonNeg_maxLen, value, manager); setMaxLength(val); setFacetsDefined(DatatypeValidator::FACET_MAXLENGTH); } else if (XMLString::equals(key, SchemaSymbols::fgELT_PATTERN)) { setPattern(value); if (getPattern()) setFacetsDefined(DatatypeValidator::FACET_PATTERN); // do not construct regex until needed } else if (XMLString::equals(key, SchemaSymbols::fgATT_FIXED)) { unsigned int val; bool retStatus; try { retStatus = XMLString::textToBin(value, val, fMemoryManager); } catch (RuntimeException&) { ThrowXMLwithMemMgr(InvalidDatatypeFacetException, XMLExcepts::FACET_internalError_fixed, manager); } if (!retStatus) { ThrowXMLwithMemMgr(InvalidDatatypeFacetException, XMLExcepts::FACET_internalError_fixed, manager); } setFixed(val); //no setFacetsDefined here } // // else if (XMLString::equals(key, SchemaSymbols::fgELT_SPECIAL_TOKEN)) // TODO // // Note: whitespace is taken care of by TraverseSchema. // else { assignAdditionalFacet(key, value, manager); } }//while }//end of assigneFacet() // // Check facet among self // check common facets // check Additional Facet Constraint // void AbstractStringValidator::inspectFacet(MemoryManager* const manager) { int thisFacetsDefined = getFacetsDefined(); if (!thisFacetsDefined) return; // check 4.3.1.c1 error: length & (maxLength | minLength) if ((thisFacetsDefined & DatatypeValidator::FACET_LENGTH) != 0) { if ((thisFacetsDefined & DatatypeValidator::FACET_MAXLENGTH) != 0) ThrowXMLwithMemMgr(InvalidDatatypeFacetException, XMLExcepts::FACET_Len_maxLen, manager); else if (((thisFacetsDefined & DatatypeValidator::FACET_MINLENGTH) != 0)) ThrowXMLwithMemMgr(InvalidDatatypeFacetException, XMLExcepts::FACET_Len_minLen, manager); } // check 4.3.2.c1 must: minLength <= maxLength if ((thisFacetsDefined & (DatatypeValidator::FACET_MINLENGTH |DatatypeValidator::FACET_MAXLENGTH)) != 0) { XMLSize_t thisMinLength = getMinLength(); XMLSize_t thisMaxLength = getMaxLength(); if ( thisMinLength > thisMaxLength ) { REPORT_FACET_ERROR(thisMaxLength , thisMinLength , XMLExcepts::FACET_maxLen_minLen , manager) } } }// end of inspectFacet() // // Check vs base // check common facets // check enumeration // check Additional Facet Constraint // void AbstractStringValidator::inspectFacetBase(MemoryManager* const manager) { AbstractStringValidator *pBaseValidator = (AbstractStringValidator*) getBaseValidator(); int thisFacetsDefined = getFacetsDefined(); if ( (!thisFacetsDefined && !fEnumeration) || (!pBaseValidator) ) return; int baseFacetsDefined = pBaseValidator->getFacetsDefined(); XMLSize_t thisLength = getLength(); XMLSize_t thisMinLength = getMinLength(); XMLSize_t thisMaxLength = getMaxLength(); XMLSize_t baseLength = pBaseValidator->getLength(); XMLSize_t baseMinLength = pBaseValidator->getMinLength(); XMLSize_t baseMaxLength = pBaseValidator->getMaxLength(); int baseFixed = pBaseValidator->getFixed(); /*** check facets against base.facets Note: later we need to check the "fix" option of the base type and apply that to every individual facet. ***/ /*** Non coexistence of derived' length and base' (minLength | maxLength) base' length and derived' (minLength | maxLength) E2-35 It is an error for both length and either of minLength or maxLength to be members of {facets}, unless they are specified in different derivation steps in which case the following must be true: the {value} of minLength <= the {value} of length <= the {value} of maxLength ***/ // error: length > base.maxLength // length < base.minLength if ((thisFacetsDefined & DatatypeValidator::FACET_LENGTH) !=0) { if (((baseFacetsDefined & DatatypeValidator::FACET_MAXLENGTH) !=0) && (thisLength > baseMaxLength) ) { REPORT_FACET_ERROR(thisLength , baseMaxLength , XMLExcepts::FACET_Len_baseMaxLen , manager) } if (((baseFacetsDefined & DatatypeValidator::FACET_MINLENGTH) !=0) && (thisLength < baseMinLength) ) { REPORT_FACET_ERROR(thisLength , baseMinLength , XMLExcepts::FACET_Len_baseMinLen , manager) } } // error: baseLength > maxLength // baseLength < minLength if ((baseFacetsDefined & DatatypeValidator::FACET_LENGTH) !=0) { if (((thisFacetsDefined & DatatypeValidator::FACET_MAXLENGTH) !=0) && (baseLength > thisMaxLength) ) { REPORT_FACET_ERROR(thisMaxLength , baseLength , XMLExcepts::FACET_maxLen_baseLen , manager) } if (((thisFacetsDefined & DatatypeValidator::FACET_MINLENGTH) !=0) && (baseLength < thisMinLength) ) { REPORT_FACET_ERROR(thisMinLength , baseLength , XMLExcepts::FACET_minLen_baseLen , manager) } } // check 4.3.1.c2 error: length != base.length if (((thisFacetsDefined & DatatypeValidator::FACET_LENGTH) !=0) && ((baseFacetsDefined & DatatypeValidator::FACET_LENGTH) !=0)) { if ( thisLength != baseLength ) { REPORT_FACET_ERROR(thisLength , baseLength , XMLExcepts::FACET_Len_baseLen , manager) } } /*** |--- derived ---| base.minLength <= minLength <= maxLength <= base.maxLength |------------------- base -------------------| ***/ // check 4.3.2.c1 must: minLength <= base.maxLength if (((thisFacetsDefined & DatatypeValidator::FACET_MINLENGTH ) != 0) && ((baseFacetsDefined & DatatypeValidator::FACET_MAXLENGTH ) != 0)) { if ( thisMinLength > baseMaxLength ) { REPORT_FACET_ERROR(thisMinLength , baseMaxLength , XMLExcepts::FACET_minLen_basemaxLen , manager) } } // check 4.3.2.c2 error: minLength < base.minLength if (((thisFacetsDefined & DatatypeValidator::FACET_MINLENGTH) !=0) && ((baseFacetsDefined & DatatypeValidator::FACET_MINLENGTH) != 0)) { if ((baseFixed & DatatypeValidator::FACET_MINLENGTH) !=0) { if ( thisMinLength != baseMinLength ) { REPORT_FACET_ERROR(thisMinLength , baseMinLength , XMLExcepts::FACET_minLen_base_fixed , manager) } } else { if ( thisMinLength < baseMinLength ) { REPORT_FACET_ERROR(thisMinLength , baseMinLength , XMLExcepts::FACET_minLen_baseminLen , manager) } } } // check 4.3.2.c1 must: base.minLength <= maxLength if (((baseFacetsDefined & DatatypeValidator::FACET_MINLENGTH) !=0) && ((thisFacetsDefined & DatatypeValidator::FACET_MAXLENGTH) !=0)) { if ( baseMinLength > thisMaxLength ) { REPORT_FACET_ERROR(thisMaxLength , baseMinLength , XMLExcepts::FACET_maxLen_baseminLen , manager) } } // check 4.3.3.c1 error: maxLength > base.maxLength if (((thisFacetsDefined & DatatypeValidator::FACET_MAXLENGTH) !=0) && ((baseFacetsDefined & DatatypeValidator::FACET_MAXLENGTH) !=0)) { if ((baseFixed & DatatypeValidator::FACET_MAXLENGTH) !=0) { if ( thisMaxLength != baseMaxLength ) { REPORT_FACET_ERROR(thisMaxLength , baseMaxLength , XMLExcepts::FACET_maxLen_base_fixed , manager) } } else { if ( thisMaxLength > baseMaxLength ) { REPORT_FACET_ERROR(thisMaxLength , baseMaxLength , XMLExcepts::FACET_maxLen_basemaxLen , manager) } } } // check 4.3.5.c0 must: enumeration values from the value space of base if ( ((thisFacetsDefined & DatatypeValidator::FACET_ENUMERATION) != 0) && (getEnumeration() !=0)) { XMLSize_t i = 0; XMLSize_t enumLength = getEnumeration()->size(); for ( ; i < enumLength; i++) { // ask parent do a complete check pBaseValidator->checkContent(getEnumeration()->elementAt(i), (ValidationContext*)0, false, manager); #if 0 // spec says that only base has to checkContent // enum shall pass this->checkContent() as well. checkContent(getEnumeration()->elementAt(i), (ValidationContext*)0, false, manager); #endif } } checkAdditionalFacetConstraints(manager); } //end of inspectFacetBase // // Inherit facet from base // a. inherit common facets // b. inherit additional facet // void AbstractStringValidator::inheritFacet() { /*** P3. Inherit facets from base.facets The reason of this inheriting (or copying values) is to ease schema constraint checking, so that we need NOT trace back to our very first base validator in the hierachy. Instead, we are pretty sure checking against immediate base validator is enough. ***/ AbstractStringValidator *pBaseValidator = (AbstractStringValidator*) getBaseValidator(); if (!pBaseValidator) return; int thisFacetsDefined = getFacetsDefined(); int baseFacetsDefined = pBaseValidator->getFacetsDefined(); // inherit length if (((baseFacetsDefined & DatatypeValidator::FACET_LENGTH) != 0) && ((thisFacetsDefined & DatatypeValidator::FACET_LENGTH) == 0)) { setLength(pBaseValidator->getLength()); setFacetsDefined(DatatypeValidator::FACET_LENGTH); } // inherit minLength if (((baseFacetsDefined & DatatypeValidator::FACET_MINLENGTH) !=0) && ((thisFacetsDefined & DatatypeValidator::FACET_MINLENGTH) == 0)) { setMinLength(pBaseValidator->getMinLength()); setFacetsDefined(DatatypeValidator::FACET_MINLENGTH); } // inherit maxLength if (((baseFacetsDefined & DatatypeValidator::FACET_MAXLENGTH) !=0) && ((thisFacetsDefined & DatatypeValidator::FACET_MAXLENGTH) == 0)) { setMaxLength(pBaseValidator->getMaxLength()); setFacetsDefined(DatatypeValidator::FACET_MAXLENGTH); } // inherit enumeration if (((baseFacetsDefined & DatatypeValidator::FACET_ENUMERATION) !=0) && ((thisFacetsDefined & DatatypeValidator::FACET_ENUMERATION) == 0)) { setEnumeration(pBaseValidator->getEnumeration(), true); } // we don't inherit pattern // inherit "fixed" option setFixed(getFixed() | pBaseValidator->getFixed()); // inherit additional facet inheritAdditionalFacet(); } // end of inheritance // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- int AbstractStringValidator::compare(const XMLCh* const lValue , const XMLCh* const rValue , MemoryManager* const) { return XMLString::compareString(lValue, rValue); } void AbstractStringValidator::validate( const XMLCh* const content , ValidationContext* const context , MemoryManager* const manager) { checkContent(content, context, false, manager); } void AbstractStringValidator::checkContent( const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager ) { //validate against base validator if any AbstractStringValidator *pBaseValidator = (AbstractStringValidator*) this->getBaseValidator(); if (pBaseValidator) pBaseValidator->checkContent(content, context, true, manager); int thisFacetsDefined = getFacetsDefined(); // we check pattern first if ( (thisFacetsDefined & DatatypeValidator::FACET_PATTERN ) != 0 ) { if (getRegex()->matches(content, manager) ==false) { ThrowXMLwithMemMgr2(InvalidDatatypeValueException , XMLExcepts::VALUE_NotMatch_Pattern , content , getPattern() , manager); } } // if this is a base validator, we only need to check pattern facet // all other facet were inherited by the derived type if (asBase) return; checkValueSpace(content, manager); XMLSize_t length = getLength(content, manager); if (((thisFacetsDefined & DatatypeValidator::FACET_MAXLENGTH) != 0) && (length > getMaxLength())) { REPORT_VALUE_ERROR(content , length , getMaxLength() , XMLExcepts::VALUE_GT_maxLen , manager) } if (((thisFacetsDefined & DatatypeValidator::FACET_MINLENGTH) != 0) && (length < getMinLength())) { REPORT_VALUE_ERROR(content , length , getMinLength() , XMLExcepts::VALUE_LT_minLen , manager) } if (((thisFacetsDefined & DatatypeValidator::FACET_LENGTH) != 0) && (length != getLength())) { REPORT_VALUE_ERROR(content , length , getLength() , XMLExcepts::VALUE_NE_Len , manager) } if ((thisFacetsDefined & DatatypeValidator::FACET_ENUMERATION) != 0 && (getEnumeration() != 0)) { XMLCh* normContent = XMLString::replicate(content, manager); ArrayJanitor jan(normContent, manager); normalizeContent(normContent, manager); XMLSize_t i=0; XMLSize_t enumLength = getEnumeration()->size(); for ( ; i < enumLength; i++) { if (XMLString::equals(normContent, getEnumeration()->elementAt(i))) break; } if (i == enumLength) ThrowXMLwithMemMgr1(InvalidDatatypeValueException, XMLExcepts::VALUE_NotIn_Enumeration, content, manager); } checkAdditionalFacet(content, manager); } const RefArrayVectorOf* AbstractStringValidator::getEnumString() const { return getEnumeration(); } void AbstractStringValidator::normalizeEnumeration(MemoryManager* const manager) { AbstractStringValidator *pBaseValidator = (AbstractStringValidator*) getBaseValidator(); if (!fEnumeration || !pBaseValidator) return; int baseFacetsDefined = pBaseValidator->getFacetsDefined(); if ((baseFacetsDefined & DatatypeValidator::FACET_WHITESPACE) == 0) return; short whiteSpace = pBaseValidator->getWSFacet(); if ( whiteSpace == DatatypeValidator::PRESERVE ) { return; } else if ( whiteSpace == DatatypeValidator::REPLACE ) { XMLSize_t enumLength = getEnumeration()->size(); for ( XMLSize_t i=0; i < enumLength; i++) { XMLString::replaceWS(getEnumeration()->elementAt(i), manager); } } else if ( whiteSpace == DatatypeValidator::COLLAPSE ) { XMLSize_t enumLength = getEnumeration()->size(); for ( XMLSize_t i=0; i < enumLength; i++) { XMLString::collapseWS(getEnumeration()->elementAt(i), manager); } } } void AbstractStringValidator::normalizeContent(XMLCh* const, MemoryManager* const) const { // default implementation: do nothing return; } void AbstractStringValidator::checkAdditionalFacetConstraints(MemoryManager* const) const { return; } void AbstractStringValidator::checkAdditionalFacet(const XMLCh* const , MemoryManager* const) const { return; } void AbstractStringValidator::inheritAdditionalFacet() { return; } void AbstractStringValidator::assignAdditionalFacet( const XMLCh* const key , const XMLCh* const , MemoryManager* const manager) { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException , XMLExcepts::FACET_Invalid_Tag , key , manager); } XMLSize_t AbstractStringValidator::getLength(const XMLCh* const content , MemoryManager* const) const { return XMLString::stringLen(content); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_NOCREATE(AbstractStringValidator) void AbstractStringValidator::serialize(XSerializeEngine& serEng) { DatatypeValidator::serialize(serEng); if (serEng.isStoring()) { serEng.writeSize (fLength); serEng.writeSize (fMaxLength); serEng.writeSize (fMinLength); serEng< * ***/ XTemplateSerializer::storeObject(fEnumeration, serEng); } else { serEng.readSize (fLength); serEng.readSize (fMaxLength); serEng.readSize (fMinLength); serEng>>fEnumerationInherited; /*** * * Deserialize RefArrayVectorOf * ***/ XTemplateSerializer::loadObject(&fEnumeration, 8, true, serEng); } } XERCES_CPP_NAMESPACE_END /** * End of file AbstractStringValidator.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/AbstractNumericFacetValidator.cpp000644 000765 000024 00000103704 13241160333 030655 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: AbstractNumericFacetValidator.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include //since we need to dynamically created each and every derivatives //during deserialization by XSerializeEngine>>Derivative, we got //to include all hpp #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN const int AbstractNumericFacetValidator::INDETERMINATE = 2; #define REPORT_FACET_ERROR(val1, val2, except_code, manager) \ ThrowXMLwithMemMgr2(InvalidDatatypeFacetException \ , except_code \ , val1->getFormattedString() \ , val2->getFormattedString() \ , manager); #define FROM_BASE_VALUE_SPACE(val, facetFlag, except_code, manager) \ if ((thisFacetsDefined & facetFlag) != 0) \ { \ try \ { \ numBase->checkContent(val->getRawData(), (ValidationContext*)0, false, manager); \ } \ catch ( XMLException& ) \ { \ ThrowXMLwithMemMgr1(InvalidDatatypeFacetException \ , except_code \ , val->getRawData() \ , manager); \ } \ } // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- AbstractNumericFacetValidator::~AbstractNumericFacetValidator() { if (!fMaxInclusiveInherited && fMaxInclusive) delete fMaxInclusive; if (!fMaxExclusiveInherited && fMaxExclusive) delete fMaxExclusive; if (!fMinInclusiveInherited && fMinInclusive) delete fMinInclusive; if (!fMinExclusiveInherited && fMinExclusive) delete fMinExclusive; //~RefVectorOf will delete all adopted elements if (!fEnumerationInherited && fEnumeration) delete fEnumeration; if (!fEnumerationInherited && fStrEnumeration) delete fStrEnumeration; } AbstractNumericFacetValidator::AbstractNumericFacetValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager) :DatatypeValidator(baseValidator, facets, finalSet, type, manager) , fMaxInclusiveInherited(false) , fMaxExclusiveInherited(false) , fMinInclusiveInherited(false) , fMinExclusiveInherited(false) , fEnumerationInherited(false) , fMaxInclusive(0) , fMaxExclusive(0) , fMinInclusive(0) , fMinExclusive(0) , fEnumeration(0) , fStrEnumeration(0) { //do not invoke init() here !!! } // // P1. Enumeration // void AbstractNumericFacetValidator::init(RefArrayVectorOf* const enums , MemoryManager* const manager) { fStrEnumeration = enums; // save the literal value // which is needed for getEnumString() if (enums) { setFacetsDefined(DatatypeValidator::FACET_ENUMERATION); } assignFacet(manager); inspectFacet(manager); inspectFacetBase(manager); inheritFacet(); } // // Assign facets // assign common facets // assign additional facet // void AbstractNumericFacetValidator::assignFacet(MemoryManager* const manager) { RefHashTableOf* facets = getFacets(); if (!facets) // no facets defined return; XMLCh* key; RefHashTableOfEnumerator e(facets, false, manager); while (e.hasMoreElements()) { KVStringPair pair = e.nextElement(); key = pair.getKey(); XMLCh* value = pair.getValue(); if (XMLString::equals(key, SchemaSymbols::fgELT_PATTERN)) { setPattern(value); if (getPattern()) setFacetsDefined(DatatypeValidator::FACET_PATTERN); // do not construct regex until needed } else if (XMLString::equals(key, SchemaSymbols::fgELT_MAXINCLUSIVE)) { try { setMaxInclusive(value); } catch (NumberFormatException&) { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_Invalid_MaxIncl, value, manager); } setFacetsDefined(DatatypeValidator::FACET_MAXINCLUSIVE); } else if (XMLString::equals(key, SchemaSymbols::fgELT_MAXEXCLUSIVE)) { try { setMaxExclusive(value); } catch (NumberFormatException&) { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_Invalid_MaxExcl, value, manager); } setFacetsDefined(DatatypeValidator::FACET_MAXEXCLUSIVE); } else if (XMLString::equals(key, SchemaSymbols::fgELT_MININCLUSIVE)) { try { setMinInclusive(value); } catch (NumberFormatException&) { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_Invalid_MinIncl, value, manager); } setFacetsDefined(DatatypeValidator::FACET_MININCLUSIVE); } else if (XMLString::equals(key, SchemaSymbols::fgELT_MINEXCLUSIVE)) { try { setMinExclusive(value); } catch (NumberFormatException&) { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_Invalid_MinExcl, value, manager); } setFacetsDefined(DatatypeValidator::FACET_MINEXCLUSIVE); } else if (XMLString::equals(key, SchemaSymbols::fgATT_FIXED)) { unsigned int val; bool retStatus; try { retStatus = XMLString::textToBin(value, val, fMemoryManager); } catch (RuntimeException&) { ThrowXMLwithMemMgr(InvalidDatatypeFacetException, XMLExcepts::FACET_internalError_fixed, manager); } if (!retStatus) { ThrowXMLwithMemMgr(InvalidDatatypeFacetException, XMLExcepts::FACET_internalError_fixed, manager); } setFixed(val); //no setFacetsDefined here } else { assignAdditionalFacet(key, value, manager); } }//while }// end of assigneFacet() // // Check facet among self // check common facets // check Additional Facet Constraint // void AbstractNumericFacetValidator::inspectFacet(MemoryManager* const manager) { int thisFacetsDefined = getFacetsDefined(); XMLNumber *thisMaxInclusive = getMaxInclusive(); XMLNumber *thisMaxExclusive = getMaxExclusive(); XMLNumber *thisMinInclusive = getMinInclusive(); XMLNumber *thisMinExclusive = getMinExclusive(); if (!thisFacetsDefined) return; // non co-existence checking // check 4.3.8.c1 error: maxInclusive + maxExclusive if (((thisFacetsDefined & DatatypeValidator::FACET_MAXEXCLUSIVE) != 0) && ((thisFacetsDefined & DatatypeValidator::FACET_MAXINCLUSIVE) != 0) ) ThrowXMLwithMemMgr(InvalidDatatypeFacetException, XMLExcepts::FACET_max_Incl_Excl, manager); // non co-existence checking // check 4.3.9.c1 error: minInclusive + minExclusive if (((thisFacetsDefined & DatatypeValidator::FACET_MINEXCLUSIVE) != 0) && ((thisFacetsDefined & DatatypeValidator::FACET_MININCLUSIVE) != 0) ) ThrowXMLwithMemMgr(InvalidDatatypeFacetException, XMLExcepts::FACET_min_Incl_Excl, manager); // // minExclusive < minInclusive <= maxInclusive < maxExclusive // // check 4.3.7.c1 must: minInclusive <= maxInclusive if (((thisFacetsDefined & DatatypeValidator::FACET_MAXINCLUSIVE) != 0) && ((thisFacetsDefined & DatatypeValidator::FACET_MININCLUSIVE) != 0) ) { int result = compareValues(thisMinInclusive, thisMaxInclusive); if ( result == 1 || result == INDETERMINATE ) { REPORT_FACET_ERROR(thisMinInclusive , thisMaxInclusive , XMLExcepts::FACET_maxIncl_minIncl , manager) } } // check 4.3.8.c2 must: minExclusive <= maxExclusive if ( ((thisFacetsDefined & DatatypeValidator::FACET_MAXEXCLUSIVE) != 0) && ((thisFacetsDefined & DatatypeValidator::FACET_MINEXCLUSIVE) != 0) ) { int result = compareValues(getMinExclusive(), getMaxExclusive()); if ( result == 1 || result == INDETERMINATE ) { REPORT_FACET_ERROR(thisMinExclusive , thisMaxExclusive , XMLExcepts::FACET_maxExcl_minExcl , manager) } } // check 4.3.9.c2 must: minExclusive < maxInclusive if ( ((thisFacetsDefined & DatatypeValidator::FACET_MAXINCLUSIVE) != 0) && ((thisFacetsDefined & DatatypeValidator::FACET_MINEXCLUSIVE) != 0) ) { int result = compareValues(getMinExclusive(), getMaxInclusive()); if ( result != -1 ) { REPORT_FACET_ERROR(thisMinExclusive , thisMaxInclusive , XMLExcepts::FACET_maxIncl_minExcl , manager) } } // check 4.3.10.c1 must: minInclusive < maxExclusive if ( ((thisFacetsDefined & DatatypeValidator::FACET_MAXEXCLUSIVE) != 0) && ((thisFacetsDefined & DatatypeValidator::FACET_MININCLUSIVE) != 0) ) { int result = compareValues(getMinInclusive(), getMaxExclusive()); if ( result != -1) { REPORT_FACET_ERROR(thisMinInclusive , thisMaxExclusive , XMLExcepts::FACET_maxExcl_minIncl , manager) } } checkAdditionalFacetConstraints(manager); }// end of inspectFacet() // // Check vs base // check common facets // check enumeration // check Additional Facet Constraint // void AbstractNumericFacetValidator::inspectFacetBase(MemoryManager* const manager) { AbstractNumericFacetValidator* numBase = (AbstractNumericFacetValidator*) getBaseValidator(); int thisFacetsDefined = getFacetsDefined(); if ( (!thisFacetsDefined && !fEnumeration) || !numBase ) return; int baseFacetsDefined = numBase->getFacetsDefined(); XMLNumber *thisMaxInclusive = getMaxInclusive(); XMLNumber *thisMaxExclusive = getMaxExclusive(); XMLNumber *thisMinInclusive = getMinInclusive(); XMLNumber *thisMinExclusive = getMinExclusive(); XMLNumber *baseMaxInclusive = numBase->getMaxInclusive(); XMLNumber *baseMaxExclusive = numBase->getMaxExclusive(); XMLNumber *baseMinInclusive = numBase->getMinInclusive(); XMLNumber *baseMinExclusive = numBase->getMinExclusive(); int baseFixed = numBase->getFixed(); // this // minExclusive maxExclusive // minInclusive maxInclusive // // base // minExclusive maxExclusive // minInclusive maxInclusive // // check 4.3.7.c2 error: // maxInclusive > base.maxInclusive && maxInclusive != base.maxInclusive if (base.fixed) // maxInclusive >= base.maxExclusive // maxInclusive < base.minInclusive // maxInclusive <= base.minExclusive if ((thisFacetsDefined & DatatypeValidator::FACET_MAXINCLUSIVE) != 0) { if ((baseFacetsDefined & DatatypeValidator::FACET_MAXINCLUSIVE) != 0) { int result = compareValues(thisMaxInclusive, baseMaxInclusive); if (((baseFixed & DatatypeValidator::FACET_MAXINCLUSIVE) != 0) && (result != 0 )) { REPORT_FACET_ERROR(thisMaxInclusive , baseMaxInclusive , XMLExcepts::FACET_maxIncl_base_fixed , manager) } if (result == 1 || result == INDETERMINATE) { REPORT_FACET_ERROR(thisMaxInclusive , baseMaxInclusive , XMLExcepts::FACET_maxIncl_base_maxIncl , manager) } } if ((baseFacetsDefined & DatatypeValidator::FACET_MAXEXCLUSIVE) != 0) { int result = compareValues(thisMaxInclusive, baseMaxExclusive); if (result != -1 ) { REPORT_FACET_ERROR(thisMaxInclusive , baseMaxExclusive , XMLExcepts::FACET_maxIncl_base_maxExcl , manager) } } if ((baseFacetsDefined & DatatypeValidator::FACET_MININCLUSIVE) != 0) { int result = compareValues(thisMaxInclusive, baseMinInclusive); if (result == -1 || result == INDETERMINATE) { REPORT_FACET_ERROR(thisMaxInclusive , baseMinInclusive , XMLExcepts::FACET_maxIncl_base_minIncl , manager) } } if ((baseFacetsDefined & DatatypeValidator::FACET_MINEXCLUSIVE) != 0) { int result = compareValues(thisMaxInclusive, baseMinExclusive); if (result != 1 ) { REPORT_FACET_ERROR(thisMaxInclusive , baseMinExclusive , XMLExcepts::FACET_maxIncl_base_minExcl , manager) } } } // check 4.3.8.c3 error: // maxExclusive > base.maxExclusive && maxExclusive != base.maxExclusive if (base.fixed) // maxExclusive > base.maxInclusive // maxExclusive <= base.minInclusive // maxExclusive <= base.minExclusive if ((thisFacetsDefined & DatatypeValidator::FACET_MAXEXCLUSIVE) != 0) { if (( baseFacetsDefined & DatatypeValidator::FACET_MAXEXCLUSIVE) != 0) { int result = compareValues(thisMaxExclusive, baseMaxExclusive); if (((baseFixed & DatatypeValidator::FACET_MAXEXCLUSIVE) != 0) && (result != 0 )) { REPORT_FACET_ERROR(thisMaxExclusive , baseMaxExclusive , XMLExcepts::FACET_maxExcl_base_fixed , manager) } if (result == 1 || result == INDETERMINATE) { REPORT_FACET_ERROR(thisMaxExclusive , baseMaxExclusive , XMLExcepts::FACET_maxExcl_base_maxExcl , manager) } /** * Schema Errata * E2-16 maxExclusive * * derived type's maxExclusive must either be * 1) equal to base' maxExclusive or * 2) from the base type value space * */ if (result != 0) { FROM_BASE_VALUE_SPACE(thisMaxExclusive , DatatypeValidator::FACET_MAXEXCLUSIVE , XMLExcepts::FACET_maxExcl_notFromBase , manager) } } else // base has no maxExclusive { FROM_BASE_VALUE_SPACE(thisMaxExclusive , DatatypeValidator::FACET_MAXEXCLUSIVE , XMLExcepts::FACET_maxExcl_notFromBase , manager) } if (( baseFacetsDefined & DatatypeValidator::FACET_MAXINCLUSIVE) != 0) { int result = compareValues(thisMaxExclusive, baseMaxInclusive); if (result == 1 || result == INDETERMINATE) { REPORT_FACET_ERROR(thisMaxExclusive , baseMaxInclusive , XMLExcepts::FACET_maxExcl_base_maxIncl , manager) } } if (( baseFacetsDefined & DatatypeValidator::FACET_MINEXCLUSIVE) != 0) { int result = compareValues(thisMaxExclusive, baseMinExclusive); if (result != 1) { REPORT_FACET_ERROR(thisMaxExclusive , baseMinExclusive , XMLExcepts::FACET_maxExcl_base_minExcl , manager) } } if (( baseFacetsDefined & DatatypeValidator::FACET_MININCLUSIVE) != 0) { int result = compareValues(thisMaxExclusive, baseMinInclusive); if (result != 1) { REPORT_FACET_ERROR(thisMaxExclusive , baseMinInclusive , XMLExcepts::FACET_maxExcl_base_minIncl , manager) } } } // check 4.3.9.c3 error: // minExclusive < base.minExclusive minExclusive != base.minExclusive if (base.fixed) // minExclusive > base.maxInclusive ??? minExclusive >= base.maxInclusive // minExclusive < base.minInclusive // minExclusive >= base.maxExclusive if ((thisFacetsDefined & DatatypeValidator::FACET_MINEXCLUSIVE) != 0) { if (( baseFacetsDefined & DatatypeValidator::FACET_MINEXCLUSIVE) != 0) { int result = compareValues(thisMinExclusive, baseMinExclusive); if (((baseFixed & DatatypeValidator::FACET_MINEXCLUSIVE) != 0) && (result != 0 )) { REPORT_FACET_ERROR(thisMinExclusive , baseMinExclusive , XMLExcepts::FACET_minExcl_base_fixed , manager) } if (result == -1 || result == INDETERMINATE) { REPORT_FACET_ERROR(thisMinExclusive , baseMinExclusive , XMLExcepts::FACET_minExcl_base_minExcl , manager) } /** * Schema Errata * E2-16 maxExclusive * * derived type's minExclusive must either be * 1) equal to base' minxExclusive or * 2) from the base type value space * * Note: deduced from, not explicitly expressed in the Errata */ if (result != 0) { FROM_BASE_VALUE_SPACE(thisMinExclusive , DatatypeValidator::FACET_MINEXCLUSIVE , XMLExcepts::FACET_minExcl_notFromBase , manager) } } else // base has no minExclusive { FROM_BASE_VALUE_SPACE(thisMinExclusive , DatatypeValidator::FACET_MINEXCLUSIVE , XMLExcepts::FACET_minExcl_notFromBase , manager) } if (( baseFacetsDefined & DatatypeValidator::FACET_MAXINCLUSIVE) != 0) { int result = compareValues(thisMinExclusive, baseMaxInclusive); if (result == 1 || result == INDETERMINATE) { REPORT_FACET_ERROR(thisMinExclusive , baseMaxInclusive , XMLExcepts::FACET_minExcl_base_maxIncl , manager) } } if (( baseFacetsDefined & DatatypeValidator::FACET_MININCLUSIVE) != 0) { int result = compareValues(thisMinExclusive, baseMinInclusive); if (result == -1 || result == INDETERMINATE) { REPORT_FACET_ERROR(thisMinExclusive , baseMinInclusive , XMLExcepts::FACET_minExcl_base_minIncl , manager) } } if (( baseFacetsDefined & DatatypeValidator::FACET_MAXEXCLUSIVE) != 0) { int result = compareValues(thisMinExclusive, baseMaxExclusive); if (result != -1) { REPORT_FACET_ERROR(thisMinExclusive , baseMaxExclusive , XMLExcepts::FACET_minExcl_base_maxExcl , manager) } } } // check 4.3.10.c2 error: // minInclusive < base.minInclusive minInclusive != base.minInclusive if (base.fixed) // minInclusive > base.maxInclusive // minInclusive <= base.minExclusive // minInclusive >= base.maxExclusive if ((thisFacetsDefined & DatatypeValidator::FACET_MININCLUSIVE) != 0) { if ((baseFacetsDefined & DatatypeValidator::FACET_MININCLUSIVE) != 0) { int result = compareValues(thisMinInclusive, baseMinInclusive); if (((baseFixed & DatatypeValidator::FACET_MININCLUSIVE) != 0) && (result != 0 )) { REPORT_FACET_ERROR(thisMinInclusive , baseMinInclusive , XMLExcepts::FACET_minIncl_base_fixed , manager) } if (result == -1 || result == INDETERMINATE) { REPORT_FACET_ERROR(thisMinInclusive , baseMinInclusive , XMLExcepts::FACET_minIncl_base_minIncl , manager) } } if (( baseFacetsDefined & DatatypeValidator::FACET_MAXINCLUSIVE) != 0) { int result = compareValues(thisMinInclusive, baseMaxInclusive); if (result == 1 || result == INDETERMINATE) { REPORT_FACET_ERROR(thisMinInclusive , baseMaxInclusive , XMLExcepts::FACET_minIncl_base_maxIncl , manager) } } if (( baseFacetsDefined & DatatypeValidator::FACET_MINEXCLUSIVE) != 0) { int result = compareValues(thisMinInclusive, baseMinExclusive); if (result != 1) { REPORT_FACET_ERROR(thisMinInclusive , baseMinExclusive , XMLExcepts::FACET_minIncl_base_minExcl , manager) } } if (( baseFacetsDefined & DatatypeValidator::FACET_MAXEXCLUSIVE) != 0) { int result = compareValues(thisMinInclusive, baseMaxExclusive); if (result != -1) { REPORT_FACET_ERROR(thisMinInclusive , baseMaxExclusive , XMLExcepts::FACET_minIncl_base_maxExcl , manager) } } } checkAdditionalFacetConstraintsBase(manager); // check 4.3.5.c0 must: enumeration values from the value space of base // // In fact, the values in the enumeration shall go through validation // of this class as well. // this->checkContent(value, false); // if ( ((thisFacetsDefined & DatatypeValidator::FACET_ENUMERATION) != 0) && ( fStrEnumeration )) { setEnumeration(manager); } // // maxInclusive, maxExclusive, minInclusive and minExclusive // shall come from the base's value space as well // FROM_BASE_VALUE_SPACE(thisMaxInclusive , DatatypeValidator::FACET_MAXINCLUSIVE , XMLExcepts::FACET_maxIncl_notFromBase , manager) FROM_BASE_VALUE_SPACE(thisMinInclusive , DatatypeValidator::FACET_MININCLUSIVE , XMLExcepts::FACET_minIncl_notFromBase , manager) } //end of inspectFacetBase // // Inherit facet from base // a. inherit common facets // b. inherit additional facet // void AbstractNumericFacetValidator::inheritFacet() { AbstractNumericFacetValidator* numBase = (AbstractNumericFacetValidator*) getBaseValidator(); if (!numBase) return; int thisFacetsDefined = getFacetsDefined(); int baseFacetsDefined = numBase->getFacetsDefined(); // inherit enumeration if ((( baseFacetsDefined & DatatypeValidator::FACET_ENUMERATION) != 0) && (( thisFacetsDefined & DatatypeValidator::FACET_ENUMERATION) == 0)) { fEnumeration = numBase->fEnumeration; fEnumerationInherited = true; setFacetsDefined(DatatypeValidator::FACET_ENUMERATION); } // inherit maxInclusive if ((( baseFacetsDefined & DatatypeValidator::FACET_MAXINCLUSIVE) != 0) && (( thisFacetsDefined & DatatypeValidator::FACET_MAXEXCLUSIVE) == 0) && (( thisFacetsDefined & DatatypeValidator::FACET_MAXINCLUSIVE) == 0) ) { fMaxInclusive = numBase->getMaxInclusive(); fMaxInclusiveInherited = true; setFacetsDefined(DatatypeValidator::FACET_MAXINCLUSIVE); } // inherit maxExclusive if ((( baseFacetsDefined & DatatypeValidator::FACET_MAXEXCLUSIVE) != 0) && (( thisFacetsDefined & DatatypeValidator::FACET_MAXEXCLUSIVE) == 0) && (( thisFacetsDefined & DatatypeValidator::FACET_MAXINCLUSIVE) == 0) ) { fMaxExclusive = numBase->getMaxExclusive(); fMaxExclusiveInherited = true; setFacetsDefined(DatatypeValidator::FACET_MAXEXCLUSIVE); } // inherit minExclusive if ((( baseFacetsDefined & DatatypeValidator::FACET_MININCLUSIVE) != 0) && (( thisFacetsDefined & DatatypeValidator::FACET_MINEXCLUSIVE) == 0) && (( thisFacetsDefined & DatatypeValidator::FACET_MININCLUSIVE) == 0) ) { fMinInclusive = numBase->getMinInclusive(); fMinInclusiveInherited = true; setFacetsDefined(DatatypeValidator::FACET_MININCLUSIVE); } // inherit minExclusive if ((( baseFacetsDefined & DatatypeValidator::FACET_MINEXCLUSIVE) != 0) && (( thisFacetsDefined & DatatypeValidator::FACET_MINEXCLUSIVE) == 0) && (( thisFacetsDefined & DatatypeValidator::FACET_MININCLUSIVE) == 0) ) { fMinExclusive = numBase->getMinExclusive(); fMinExclusiveInherited = true; setFacetsDefined(DatatypeValidator::FACET_MINEXCLUSIVE); } inheritAdditionalFacet(); // inherit "fixed" option setFixed(getFixed() | numBase->getFixed()); } const RefArrayVectorOf* AbstractNumericFacetValidator::getEnumString() const { return (fEnumerationInherited? getBaseValidator()->getEnumString() : fStrEnumeration ); } void AbstractNumericFacetValidator::checkAdditionalFacetConstraints(MemoryManager* const) const { return; } void AbstractNumericFacetValidator::checkAdditionalFacetConstraintsBase(MemoryManager* const) const { return; } void AbstractNumericFacetValidator::inheritAdditionalFacet() { return; } void AbstractNumericFacetValidator::assignAdditionalFacet( const XMLCh* const key , const XMLCh* const , MemoryManager* const manager) { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException , XMLExcepts::FACET_Invalid_Tag , key , manager); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_NOCREATE(AbstractNumericFacetValidator) /*** * This dv needs to serialize/deserialize four boundary data members * which are derivatives of XMLlNumber. * The derivatives of this class, namely, Deciamldv, Doubledv, Floatdv and * DateTimedv needs to write a typeEnum into the binary data stream, so * during loading, this method reads the typeEnum first, and then instantiate * the right type of objects, say XMLDouble, XMLFloat, XMLBigDecimal and * XMLDateTime. * * ***/ void AbstractNumericFacetValidator::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { /*** * don't move this line out of the if statement, * it is done purposely to allow AbstractNumericFacetValidator * read the number type information before DatatypeValidator * during loading ***/ DatatypeValidator::serialize(serEng); // need not write type info for the XMLNumber since // the derivative class has done that storeClusive(serEng, fMaxInclusiveInherited, fMaxInclusive); storeClusive(serEng, fMaxExclusiveInherited, fMaxExclusive); storeClusive(serEng, fMinInclusiveInherited, fMinInclusive); storeClusive(serEng, fMinExclusiveInherited, fMinExclusive); serEng< * Serialize RefVectorOf ***/ XTemplateSerializer::storeObject(fStrEnumeration, serEng); XTemplateSerializer::storeObject(fEnumeration, serEng); } else { // Read the number type info for the XMLNumber FIRST!!! int nType; XMLNumber::NumberType numType; serEng>>nType; numType = (XMLNumber::NumberType) nType; DatatypeValidator::serialize(serEng); loadClusive(serEng, fMaxInclusiveInherited, fMaxInclusive, numType, 1); loadClusive(serEng, fMaxExclusiveInherited, fMaxExclusive, numType, 2); loadClusive(serEng, fMinInclusiveInherited, fMinInclusive, numType, 3); loadClusive(serEng, fMinExclusiveInherited, fMinExclusive, numType, 4); serEng>>fEnumerationInherited; /*** * Deserialize RefArrayVectorOf * Deserialize RefVectorOf ***/ XTemplateSerializer::loadObject(&fStrEnumeration, 8, true, serEng); XTemplateSerializer::loadObject(&fEnumeration, 8, true, numType, serEng); } } // // A user defined dv may inherit any of the Max/Min/Inc/Exc from a // built dv, which will create its own Max/Min/Inc/Exc during the // loading. Therefore if the user defined store and load this // facet, and does not own it, that will cause leakage. // // To avoid checking if the facet belongs to a builtIn dv or not, we // do this way, for any inherited *clusive, we will not store it, and later // on during loading, we get it from the base dv. // void AbstractNumericFacetValidator::storeClusive(XSerializeEngine& serEng , bool inherited , XMLNumber* data) { serEng<>inherited; if (!inherited) data = XMLNumber::loadNumber(numType, serEng); else { AbstractNumericFacetValidator* basedv = (AbstractNumericFacetValidator*) getBaseValidator(); switch(flag) { case 1: data = basedv->getMaxInclusive(); break; case 2: data = basedv->getMaxExclusive(); break; case 3: data = basedv->getMinInclusive(); break; case 4: data = basedv->getMinExclusive(); break; default: break; } } } XERCES_CPP_NAMESPACE_END /** * End of file AbstractNumericFacetValidator::cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/XMLCanRepGroup.hpp000644 000765 000024 00000003661 13241160333 025532 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLCanRepGroup.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLCANREPGROUP_HPP) #define XERCESC_INCLUDE_GUARD_XMLCANREPGROUP_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT XMLCanRepGroup : public XMemory { public: enum CanRepGroup { Boolean, DoubleFloat, DateTime, Time, Decimal, Decimal_Derived_signed, Decimal_Derived_unsigned, Decimal_Derived_npi, String }; ~XMLCanRepGroup(); XMLCanRepGroup(CanRepGroup val); inline CanRepGroup getGroup() const; private: CanRepGroup fData; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLCanRepGroup(const XMLCanRepGroup&); XMLCanRepGroup& operator=(const XMLCanRepGroup&); }; inline XMLCanRepGroup::CanRepGroup XMLCanRepGroup::getGroup() const { return fData; } XERCES_CPP_NAMESPACE_END #endif /** * End of file XMLCanRepGroup.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/Base64BinaryDatatypeValidator.cpp000644 000765 000024 00000010546 13241160333 030512 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Base64BinaryDatatypeValidator.cpp 695949 2008-09-16 15:57:44Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- Base64BinaryDatatypeValidator::Base64BinaryDatatypeValidator(MemoryManager* const manager) :AbstractStringValidator(0, 0, 0, DatatypeValidator::Base64Binary, manager) {} Base64BinaryDatatypeValidator::~Base64BinaryDatatypeValidator() {} Base64BinaryDatatypeValidator::Base64BinaryDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :AbstractStringValidator(baseValidator, facets, finalSet, DatatypeValidator::Base64Binary, manager) { init(enums, manager); } DatatypeValidator* Base64BinaryDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) Base64BinaryDatatypeValidator(this, facets, enums, finalSet, manager); } // --------------------------------------------------------------------------- // Utilities // --------------------------------------------------------------------------- void Base64BinaryDatatypeValidator::checkValueSpace(const XMLCh* const content , MemoryManager* const manager) { if (!content || !*content) return; if (Base64::getDataLength(content, manager, Base64::Conf_Schema) < 0) { ThrowXMLwithMemMgr1(InvalidDatatypeValueException , XMLExcepts::VALUE_Not_Base64 , content , manager); } } XMLSize_t Base64BinaryDatatypeValidator::getLength(const XMLCh* const content , MemoryManager* const manager) const { if (!content || !*content) return 0; return (XMLSize_t)Base64::getDataLength(content, manager, Base64::Conf_Schema); } void Base64BinaryDatatypeValidator::normalizeEnumeration(MemoryManager* const manager) { XMLSize_t enumLength = getEnumeration()->size(); for ( XMLSize_t i=0; i < enumLength; i++) { XMLString::removeWS(getEnumeration()->elementAt(i), manager); } } void Base64BinaryDatatypeValidator::normalizeContent(XMLCh* const content , MemoryManager* const manager) const { XMLString::removeWS(content, manager); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(Base64BinaryDatatypeValidator) void Base64BinaryDatatypeValidator::serialize(XSerializeEngine& serEng) { AbstractStringValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file Base64BinaryDatatypeValidator.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/DayDatatypeValidator.cpp000644 000765 000024 00000006415 13241160333 027036 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DayDatatypeValidator.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- DayDatatypeValidator::DayDatatypeValidator(MemoryManager* const manager) :DateTimeValidator(0, 0, 0, DatatypeValidator::Day, manager) { setOrdered(XSSimpleTypeDefinition::ORDERED_PARTIAL); } DayDatatypeValidator::DayDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :DateTimeValidator(baseValidator, facets, finalSet, DatatypeValidator::Day, manager) { init(enums, manager); } DayDatatypeValidator::~DayDatatypeValidator() {} DatatypeValidator* DayDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) DayDatatypeValidator(this, facets, enums, finalSet, manager); } // // caller need to release the date created here // XMLDateTime* DayDatatypeValidator::parse(const XMLCh* const content, MemoryManager* const manager) { XMLDateTime *pRetDate = new (manager) XMLDateTime(content, manager); Janitor jan(pRetDate); try { pRetDate->parseDay(); } catch(const OutOfMemoryException&) { jan.release(); throw; } return jan.release(); } void DayDatatypeValidator::parse(XMLDateTime* const pDate) { pDate->parseDay(); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(DayDatatypeValidator) void DayDatatypeValidator::serialize(XSerializeEngine& serEng) { DateTimeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file DayDatatypeValidator::cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/MonthDayDatatypeValidator.cpp000644 000765 000024 00000006555 13241160333 030051 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: MonthDayDatatypeValidator.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- MonthDayDatatypeValidator::MonthDayDatatypeValidator(MemoryManager* const manager) :DateTimeValidator(0, 0, 0, DatatypeValidator::MonthDay, manager) { setOrdered(XSSimpleTypeDefinition::ORDERED_PARTIAL); } MonthDayDatatypeValidator::MonthDayDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :DateTimeValidator(baseValidator, facets, finalSet, DatatypeValidator::MonthDay, manager) { init(enums, manager); } MonthDayDatatypeValidator::~MonthDayDatatypeValidator() {} DatatypeValidator* MonthDayDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) MonthDayDatatypeValidator(this, facets, enums, finalSet, manager); } // // caller need to release the date created here // XMLDateTime* MonthDayDatatypeValidator::parse(const XMLCh* const content, MemoryManager* const manager) { XMLDateTime *pRetDate = new (manager) XMLDateTime(content, manager); Janitor jan(pRetDate); try { pRetDate->parseMonthDay(); } catch(const OutOfMemoryException&) { jan.release(); throw; } return jan.release(); } void MonthDayDatatypeValidator::parse(XMLDateTime* const pDate) { pDate->parseMonthDay(); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(MonthDayDatatypeValidator) void MonthDayDatatypeValidator::serialize(XSerializeEngine& serEng) { DateTimeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file MonthDayDatatypeValidator::cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/AbstractNumericValidator.hpp000644 000765 000024 00000007165 13241160333 027723 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: AbstractNumericValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_ABSTRACT_NUMERIC_VALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_ABSTRACT_NUMERIC_VALIDATOR_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT AbstractNumericValidator : public AbstractNumericFacetValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructor. */ //@{ virtual ~AbstractNumericValidator(); //@} virtual void validate ( const XMLCh* const content , ValidationContext* const context = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual const XMLCh* getCanonicalRepresentation ( const XMLCh* const rawData , MemoryManager* const memMgr = 0 , bool toValidate = false ) const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(AbstractNumericValidator) protected: AbstractNumericValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); inline void init(RefArrayVectorOf* const enums , MemoryManager* const manager); // // Abstract interface // virtual void checkContent(const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager) = 0; void boundsCheck(const XMLNumber* const , MemoryManager* const manager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- AbstractNumericValidator(const AbstractNumericValidator&); AbstractNumericValidator& operator=(const AbstractNumericValidator&); }; inline void AbstractNumericValidator::init(RefArrayVectorOf* const enums , MemoryManager* const manager) { AbstractNumericFacetValidator::init(enums, manager); } XERCES_CPP_NAMESPACE_END #endif /** * End of file AbstractNumericValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/NameDatatypeValidator.hpp000644 000765 000024 00000011225 13241160333 027201 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: NameDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_NAME_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_NAME_DATATYPEVALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT NameDatatypeValidator : public StringDatatypeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ NameDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); NameDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~NameDatatypeValidator(); //@} // ----------------------------------------------------------------------- // Validation methods // ----------------------------------------------------------------------- /** @name Validation Function */ //@{ /** * validate that a string matches the boolean datatype * @param content A string containing the content to be validated * * @exception throws InvalidDatatypeException if the content is * is not valid. */ virtual void validate ( const XMLCh* const content , ValidationContext* const context = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- /** @name Compare Function */ //@{ /** * Compare two boolean data types * * @param content1 * @param content2 * @return */ virtual int compare(const XMLCh* const, const XMLCh* const , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(NameDatatypeValidator) protected: // // ctor provided to be used by derived classes // NameDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual void checkValueSpace(const XMLCh* const content , MemoryManager* const manager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- NameDatatypeValidator(const NameDatatypeValidator&); NameDatatypeValidator& operator=(const NameDatatypeValidator&); // ----------------------------------------------------------------------- // Private data members // // // ----------------------------------------------------------------------- }; XERCES_CPP_NAMESPACE_END #endif /** * End of file NameDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/DecimalDatatypeValidator.hpp000644 000765 000024 00000016346 13241160333 027670 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DecimalDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DECIMAL_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_DECIMAL_DATATYPEVALIDATOR_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLBigDecimal; class VALIDATORS_EXPORT DecimalDatatypeValidator : public AbstractNumericValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ DecimalDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); DecimalDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~DecimalDatatypeValidator(); //@} // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- /** @name Compare Function */ //@{ /** * Compare two boolean data types * * @param content1 * @param content2 * @return */ virtual int compare(const XMLCh* const, const XMLCh* const , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual const XMLCh* getCanonicalRepresentation ( const XMLCh* const rawData , MemoryManager* const memMgr = 0 , bool toValidate = false ) const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(DecimalDatatypeValidator) protected: // ----------------------------------------------------------------------- // ctor provided to be used by derived classes // ----------------------------------------------------------------------- DecimalDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); // ----------------------------------------------------------------------- // Abstract interface from AbstractNumericFacetValidator // ----------------------------------------------------------------------- virtual void assignAdditionalFacet(const XMLCh* const key , const XMLCh* const value , MemoryManager* const manager); virtual void inheritAdditionalFacet(); virtual void checkAdditionalFacetConstraints(MemoryManager* const manager) const; virtual void checkAdditionalFacetConstraintsBase(MemoryManager* const manager) const; virtual int compareValues(const XMLNumber* const lValue , const XMLNumber* const rValue); virtual void setMaxInclusive(const XMLCh* const); virtual void setMaxExclusive(const XMLCh* const); virtual void setMinInclusive(const XMLCh* const); virtual void setMinExclusive(const XMLCh* const); virtual void setEnumeration(MemoryManager* const manager); // ----------------------------------------------------------------------- // Abstract interface from AbstractNumericValidator // ----------------------------------------------------------------------- virtual void checkContent(const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager); public: // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- inline unsigned int getTotalDigits() const; inline unsigned int getFractionDigits() const; private: // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- inline void setTotalDigits(unsigned int); inline void setFractionDigits(unsigned int); // ----------------------------------------------------------------------- // Private data members // // ----------------------------------------------------------------------- unsigned int fTotalDigits; unsigned int fFractionDigits; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DecimalDatatypeValidator(const DecimalDatatypeValidator&); DecimalDatatypeValidator& operator=(const DecimalDatatypeValidator&); }; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- inline unsigned int DecimalDatatypeValidator::getTotalDigits() const { return fTotalDigits; } inline unsigned int DecimalDatatypeValidator::getFractionDigits() const { return fFractionDigits; } // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- inline void DecimalDatatypeValidator::setTotalDigits(unsigned int newTotalDigits) { fTotalDigits = newTotalDigits; } inline void DecimalDatatypeValidator::setFractionDigits(unsigned int newFractionDigits) { fFractionDigits = newFractionDigits; } XERCES_CPP_NAMESPACE_END #endif /** * End of file DecimalDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/MonthDatatypeValidator.cpp000644 000765 000024 00000006464 13241160333 027412 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: MonthDatatypeValidator.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- MonthDatatypeValidator::MonthDatatypeValidator(MemoryManager* const manager) :DateTimeValidator(0, 0, 0, DatatypeValidator::Month, manager) { setOrdered(XSSimpleTypeDefinition::ORDERED_PARTIAL); } MonthDatatypeValidator::MonthDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :DateTimeValidator(baseValidator, facets, finalSet, DatatypeValidator::Month, manager) { init(enums, manager); } MonthDatatypeValidator::~MonthDatatypeValidator() {} DatatypeValidator* MonthDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) MonthDatatypeValidator(this, facets, enums, finalSet, manager); } // // caller need to release the date created here // XMLDateTime* MonthDatatypeValidator::parse(const XMLCh* const content, MemoryManager* const manager) { XMLDateTime *pRetDate = new (manager) XMLDateTime(content, manager); Janitor jan(pRetDate); try { pRetDate->parseMonth(); } catch(const OutOfMemoryException&) { jan.release(); throw; } return jan.release(); } void MonthDatatypeValidator::parse(XMLDateTime* const pDate) { pDate->parseMonth(); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(MonthDatatypeValidator) void MonthDatatypeValidator::serialize(XSerializeEngine& serEng) { DateTimeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file MonthDatatypeValidator::cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/AnyURIDatatypeValidator.cpp000644 000765 000024 00000017335 13241160333 027433 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: AnyURIDatatypeValidator.cpp 676796 2008-07-15 05:04:13Z dbertoni $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- AnyURIDatatypeValidator::AnyURIDatatypeValidator(MemoryManager* const manager) :AbstractStringValidator(0, 0, 0, DatatypeValidator::AnyURI, manager) {} AnyURIDatatypeValidator::~AnyURIDatatypeValidator() { } AnyURIDatatypeValidator::AnyURIDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :AbstractStringValidator(baseValidator, facets, finalSet, DatatypeValidator::AnyURI, manager) { init(enums, manager); } DatatypeValidator* AnyURIDatatypeValidator::newInstance( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) { return (DatatypeValidator*) new (manager) AnyURIDatatypeValidator(this, facets, enums, finalSet, manager); } // --------------------------------------------------------------------------- // Utilities // --------------------------------------------------------------------------- void AnyURIDatatypeValidator::checkValueSpace(const XMLCh* const content , MemoryManager* const manager) { bool validURI = true; // check 3.2.17.c0 must: URI (rfc 2396/2723) try { // Support for relative URLs // According to Java 1.1: URLs may also be specified with a // String and the URL object that it is related to. // XMLSize_t len = XMLString::stringLen(content); if (len) { // Encode special characters using XLink 5.4 algorithm XMLBuffer encoded((len*3)+1, manager); encode(content, len, encoded, manager); validURI = XMLUri::isValidURI(true, encoded.getRawBuffer(), true); } } catch(const OutOfMemoryException&) { throw; } catch (...) { ThrowXMLwithMemMgr1(InvalidDatatypeValueException , XMLExcepts::VALUE_URI_Malformed , content , manager); } if (!validURI) { ThrowXMLwithMemMgr1(InvalidDatatypeValueException , XMLExcepts::VALUE_URI_Malformed , content , manager); } } /*** * To encode special characters in anyURI, by using %HH to represent * special ASCII characters: 0x00~0x1F, 0x7F, ' ', '<', '>', etc. * and non-ASCII characters (whose value >= 128). ***/ void AnyURIDatatypeValidator::encode(const XMLCh* const content, const XMLSize_t len, XMLBuffer& encoded, MemoryManager* const manager) { static const bool needEscapeMap[] = { true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , /* 0x00 to 0x0F need escape */ true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , /* 0x10 to 0x1F need escape */ true , false, true , false, false, false, false, false, false, false, false, false, false, false, false, false, /* 0x20:' ', 0x22:'"' */ false, false, false, false, false, false, false, false, false, false, false, false, true , false, true , false, /* 0x3C:'<', 0x3E:'>' */ false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true , false, true , false, /* 0x5C:'\\', 0x5E:'^' */ true , false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, /* 0x60:'`' */ false, false, false, false, false, false, false, false, false, false, false, true , true , true , true , true /* 0x7B:'{', 0x7C:'|', 0x7D:'}', 0x7E:'~', 0x7F:DEL */ }; // For each character in content XMLSize_t i; for (i = 0; i < len; i++) { int ch = (int)content[i]; // If it's not an ASCII character, break here, and use UTF-8 encoding if (ch >= 128) break; if (needEscapeMap[ch]) { char tempStr[3] = "\0"; sprintf(tempStr, "%02X", ch); encoded.append('%'); encoded.append((XMLCh)tempStr[0]); encoded.append((XMLCh)tempStr[1]); } else { encoded.append((XMLCh)ch); } } // we saw some non-ascii character if (i < len) { // get UTF-8 bytes for the remaining sub-string const XMLCh* remContent = (XMLCh*)&content[i]; const XMLSize_t remContentLen = len - i; XMLByte* UTF8Byte = (XMLByte*)manager->allocate((remContentLen*4+1) * sizeof(XMLByte)); XMLSize_t charsEaten; XMLUTF8Transcoder transcoder(XMLUni::fgUTF8EncodingString, remContentLen*4+1, manager); XMLSize_t utf8Len = transcoder.transcodeTo(remContent, remContentLen, UTF8Byte, remContentLen*4, charsEaten, XMLTranscoder::UnRep_RepChar); assert(charsEaten == remContentLen); XMLSize_t j; for (j = 0; j < utf8Len; j++) { XMLByte b = UTF8Byte[j]; if (b >= 128 || needEscapeMap[b]) { char tempStr[3] = "\0"; sprintf(tempStr, "%02X", b); encoded.append('%'); encoded.append((XMLCh)tempStr[0]); encoded.append((XMLCh)tempStr[1]); } else { encoded.append((XMLCh)b); } } manager->deallocate(UTF8Byte); } } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(AnyURIDatatypeValidator) void AnyURIDatatypeValidator::serialize(XSerializeEngine& serEng) { AbstractStringValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file AnyURIDatatypeValidator.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/InvalidDatatypeValueException.hpp000644 000765 000024 00000002325 13241160333 030716 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: InvalidDatatypeValueException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_INVALIDDATATYPEVALUEEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_INVALIDDATATYPEVALUEEXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(InvalidDatatypeValueException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/datatype/InvalidDatatypeFacetException.hpp000644 000765 000024 00000002325 13241160333 030664 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: InvalidDatatypeFacetException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_INVALIDDATATYPEFACETEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_INVALIDDATATYPEFACETEXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(InvalidDatatypeFacetException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/validators/datatype/DatatypeValidatorFactory.hpp000644 000765 000024 00000023407 13241160333 027735 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DatatypeValidatorFactory.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DATATYPEVALIDATORFACTORY_HPP) #define XERCESC_INCLUDE_GUARD_DATATYPEVALIDATORFACTORY_HPP /** * This class implements a factory of Datatype Validators. Internally the * DatatypeValidators are kept in a registry. * There is one instance of DatatypeValidatorFactory per Parser. * There is one datatype Registry per instance of DatatypeValidatorFactory, * such registry is first allocated with the number DatatypeValidators needed. * e.g. * If Parser finds an XML document with a DTD, a registry of DTD validators (only * 9 validators) get initialized in the registry. * The initialization process consist of instantiating the Datatype and * facets and registering the Datatype into registry table. * This implementation uses a Hashtable as a registry. The datatype validators created * by the factory will be deleted by the registry. * * As the Parser parses an instance document it knows if validation needs * to be checked. If no validation is necessary we should not instantiate a * DatatypeValidatorFactory. * If validation is needed, we need to instantiate a DatatypeValidatorFactory. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // DatatypeValidatorFactory: Local declaration // --------------------------------------------------------------------------- typedef RefHashTableOf KVStringPairHashTable; typedef RefHashTableOf DVHashTable; typedef RefArrayVectorOf XMLChRefVector; class VALIDATORS_EXPORT DatatypeValidatorFactory : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Public Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ DatatypeValidatorFactory ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** @name Destructor. */ //@{ ~DatatypeValidatorFactory(); //@} // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** @name Getter Functions */ //@{ /** * Returns the datatype validator * * @param dvType Datatype validator name/type */ DatatypeValidator* getDatatypeValidator(const XMLCh* const dvType) const; /** * Returns the user defined registry of types **/ DVHashTable* getUserDefinedRegistry() const; /** * Returns the built in registry of types **/ static DVHashTable* getBuiltInRegistry(); //@} private: /** * Initializes registry with primitive and derived Simple types. * * This method does not clear the registry to clear the registry you * have to call resetRegistry. * * The net effect of this method is to start with the smallest set of * datatypes needed by the validator. * * If we start with Schema's then we initialize to full set of * validators. */ void expandRegistryToFullSchemaSet(); public: // ----------------------------------------------------------------------- // Canonical Representation Group // ----------------------------------------------------------------------- void initCanRepRegistory(); static XMLCanRepGroup::CanRepGroup getCanRepGroup(const DatatypeValidator* const); static DatatypeValidator* getBuiltInBaseValidator(const DatatypeValidator* const); // ----------------------------------------------------------------------- // Validator Factory methods // ----------------------------------------------------------------------- /** @name Validator Factory Functions */ //@{ /** * Creates a new datatype validator of type baseValidator's class and * adds it to the registry * * @param typeName Datatype validator name * * @param baseValidator Base datatype validator * * @param facets datatype facets if any * * @param enums vector of values for enum facet * * @param isDerivedByList Indicates whether the datatype is derived by * list or not * * @param finalSet 'final' values of the simpleType * * @param isUserDefined Indicates whether the datatype is built-in or * user defined */ DatatypeValidator* createDatatypeValidator ( const XMLCh* const typeName , DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const bool isDerivedByList , const int finalSet = 0 , const bool isUserDefined = true , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Creates a new datatype validator of type UnionDatatypeValidator and * adds it to the registry * * @param typeName Datatype validator name * * @param validators Vector of datatype validators * * @param finalSet 'final' values of the simpleType * * @param isUserDefined Indicates whether the datatype is built-in or * user defined */ DatatypeValidator* createDatatypeValidator ( const XMLCh* const typeName , RefVectorOf* const validators , const int finalSet , const bool isUserDefined = true , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** * Reset datatype validator registry */ void resetRegistry(); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(DatatypeValidatorFactory) private: // ----------------------------------------------------------------------- // CleanUp methods // ----------------------------------------------------------------------- void cleanUp(); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DatatypeValidatorFactory(const DatatypeValidatorFactory&); DatatypeValidatorFactory& operator=(const DatatypeValidatorFactory&); // ----------------------------------------------------------------------- // Private data members // // fUserDefinedRegistry // This is a hashtable of user defined dataype validators. // // fBuiltInRegistry // This is a hashtable of built-in primitive datatype validators. // ----------------------------------------------------------------------- XERCES_CPP_NAMESPACE_QUALIFIER RefHashTableOf* fUserDefinedRegistry; static XERCES_CPP_NAMESPACE_QUALIFIER RefHashTableOf* fBuiltInRegistry; static XERCES_CPP_NAMESPACE_QUALIFIER RefHashTableOf* fCanRepRegistry; XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* const fMemoryManager; friend class XPath2ContextImpl; friend class XMLInitializer; }; inline DatatypeValidator* DatatypeValidatorFactory::getDatatypeValidator(const XMLCh* const dvType) const { if (dvType) { if (fBuiltInRegistry && fBuiltInRegistry->containsKey(dvType)) { return fBuiltInRegistry->get(dvType); } if (fUserDefinedRegistry && fUserDefinedRegistry->containsKey(dvType)) { return fUserDefinedRegistry->get(dvType); } } return 0; } inline DVHashTable* DatatypeValidatorFactory::getUserDefinedRegistry() const { return fUserDefinedRegistry; } inline DVHashTable* DatatypeValidatorFactory::getBuiltInRegistry() { return fBuiltInRegistry; } // --------------------------------------------------------------------------- // DatatypeValidator: CleanUp methods // --------------------------------------------------------------------------- inline void DatatypeValidatorFactory::cleanUp() { if (fUserDefinedRegistry) { delete fUserDefinedRegistry; fUserDefinedRegistry = 0; } } XERCES_CPP_NAMESPACE_END #endif /** * End of file DatatypeValidatorFactory.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/DateTimeDatatypeValidator.hpp000644 000765 000024 00000006724 13241160333 030025 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DateTimeDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DATETIME_DATATYPE_VALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_DATETIME_DATATYPE_VALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT DateTimeDatatypeValidator : public DateTimeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ DateTimeDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); DateTimeDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~DateTimeDatatypeValidator(); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual const XMLCh* getCanonicalRepresentation ( const XMLCh* const rawData , MemoryManager* const memMgr = 0 , bool toValidate = false ) const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(DateTimeDatatypeValidator) protected: // ----------------------------------------------------------------------- // implementation of (DateTimeValidator's) virtual interface // ----------------------------------------------------------------------- virtual XMLDateTime* parse(const XMLCh* const, MemoryManager* const manager); virtual void parse(XMLDateTime* const); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DateTimeDatatypeValidator(const DateTimeDatatypeValidator&); DateTimeDatatypeValidator& operator=(const DateTimeDatatypeValidator&); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file DateTimeDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/QNameDatatypeValidator.cpp000644 000765 000024 00000022655 13241160333 027326 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: QNameDatatypeValidator.cpp 676911 2008-07-15 13:27:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- QNameDatatypeValidator::QNameDatatypeValidator(MemoryManager* const manager) :AbstractStringValidator(0, 0, 0, DatatypeValidator::QName, manager) {} QNameDatatypeValidator::~QNameDatatypeValidator() {} QNameDatatypeValidator::QNameDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :AbstractStringValidator(baseValidator, facets, finalSet, DatatypeValidator::QName, manager) { init(enums, manager); } DatatypeValidator* QNameDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) QNameDatatypeValidator(this, facets, enums, finalSet, manager); } // --------------------------------------------------------------------------- // Utilities // --------------------------------------------------------------------------- void QNameDatatypeValidator::checkValueSpace(const XMLCh* const content , MemoryManager* const manager) { // // check 3.2.18.c0 must: QName // if ( !XMLChar1_0::isValidQName(content, XMLString::stringLen(content)) ) { ThrowXMLwithMemMgr1(InvalidDatatypeValueException , XMLExcepts::VALUE_QName_Invalid , content , manager); } } void QNameDatatypeValidator::checkContent( const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager ) { //validate against base validator if any QNameDatatypeValidator *pBaseValidator = (QNameDatatypeValidator*) this->getBaseValidator(); if (pBaseValidator) pBaseValidator->checkContent(content, context, true, manager); int thisFacetsDefined = getFacetsDefined(); // we check pattern first if ( (thisFacetsDefined & DatatypeValidator::FACET_PATTERN ) != 0 ) { if (getRegex()->matches(content, manager) ==false) { ThrowXMLwithMemMgr2(InvalidDatatypeValueException , XMLExcepts::VALUE_NotMatch_Pattern , content , getPattern() , manager); } } // if this is a base validator, we only need to check pattern facet // all other facet were inherited by the derived type if (asBase) return; checkValueSpace(content, manager); int colonPos = 0; XMLCh* prefix = 0; ArrayJanitor jan(prefix, manager); if (context) { prefix = XMLString::replicate(content, manager); jan.reset(prefix, manager); normalizeContent(prefix, manager); colonPos = XMLString::indexOf(content, chColon); if (colonPos > 0) { prefix[colonPos] = chNull; if (context->isPrefixUnknown(prefix)) { ThrowXMLwithMemMgr1(InvalidDatatypeValueException , XMLExcepts::VALUE_QName_Invalid2 , content , manager); } } } #if 0 if ((thisFacetsDefined & DatatypeValidator::FACET_ENUMERATION) != 0 && (getEnumeration() != 0)) { XMLCh* normContent = XMLString::replicate(content, manager); ArrayJanitor jan(normContent, manager); normalizeContent(normContent, manager); int i=0; int enumLength = getEnumeration()->size(); for ( ; i < enumLength; i++) { if (XMLString::equals(normContent, getEnumeration()->elementAt(i))) break; } if (i == enumLength) ThrowXMLwithMemMgr1(InvalidDatatypeValueException, XMLExcepts::VALUE_NotIn_Enumeration, content, manager); } #else if ((thisFacetsDefined & DatatypeValidator::FACET_ENUMERATION) != 0 && (getEnumeration() != 0) && context) { XMLCh* localName; if (colonPos > 0) { localName = prefix + colonPos + 1; } else { localName = prefix; } XMLCh* enumPrefix; XMLCh* enumLocalName; XMLSize_t i=0; XMLSize_t enumLength = getEnumeration()->size(); bool foundURIId = false; const XMLCh* normURI = 0; // The +=2 is because the enumeration has prefix:localname as one entry followed // by the URI string for the prefix as the next entry. for ( ; i < enumLength; i+=2) { enumPrefix = XMLString::replicate(getEnumeration()->elementAt(i), manager); ArrayJanitor janEnum(enumPrefix, manager); colonPos = XMLString::indexOf(enumPrefix, chColon, 0, manager); if (colonPos != -1) { enumLocalName = enumPrefix + colonPos + 1; enumPrefix[colonPos] = chNull; } else { enumLocalName = enumPrefix; } if (XMLString::equals(localName, enumLocalName)) { if (colonPos < 0) break; // now need to see if the prefix URI's are the same if (!foundURIId) { normURI = context->getURIForPrefix(prefix); foundURIId = true; } if (XMLString::equals(normURI, getEnumeration()->elementAt(i+1))) break; } } if (i == enumLength) ThrowXMLwithMemMgr1(InvalidDatatypeValueException, XMLExcepts::VALUE_NotIn_Enumeration, content, manager); } #endif checkAdditionalFacet(content, manager); } // // Check vs base // check common facets // check enumeration // check Additional Facet Constraint // void QNameDatatypeValidator::inspectFacetBase(MemoryManager* const manager) { QNameDatatypeValidator *pBaseValidator = (QNameDatatypeValidator*) getBaseValidator(); int thisFacetsDefined = getFacetsDefined(); if ( (!thisFacetsDefined && !getEnumeration()) || (!pBaseValidator) ) return; // check 4.3.5.c0 must: enumeration values from the value space of base if ( ((thisFacetsDefined & DatatypeValidator::FACET_ENUMERATION) != 0) && (getEnumeration() !=0)) { XMLSize_t i = 0; XMLSize_t enumLength = getEnumeration()->size(); // The +=2 is because the enumeration has prefix:localname as one entry followed // by the URI string for the prefix as the next entry. for ( ; i < enumLength; i+=2) { // ask parent do a complete check pBaseValidator->checkContent(getEnumeration()->elementAt(i), (ValidationContext*)0, false, manager); #if 0 // spec says that only base has to checkContent // enum shall pass this->checkContent() as well. checkContent(getEnumeration()->elementAt(i), (ValidationContext*)0, false, manager); #endif } } checkAdditionalFacetConstraints(manager); } //end of inspectFacetBase /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(QNameDatatypeValidator) void QNameDatatypeValidator::serialize(XSerializeEngine& serEng) { AbstractStringValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file QNameDatatypeValidator.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/BooleanDatatypeValidator.hpp000644 000765 000024 00000014405 13241160333 027703 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BooleanDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_BOOLEAN_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_BOOLEAN_DATATYPEVALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT BooleanDatatypeValidator : public DatatypeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructor. */ //@{ BooleanDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); BooleanDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~BooleanDatatypeValidator(); //@} virtual const RefArrayVectorOf* getEnumString() const; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** @name Getter Functions */ //@{ virtual const XMLCh* getCanonicalRepresentation ( const XMLCh* const rawData , MemoryManager* const memMgr = 0 , bool toValidate = false ) const; //@} // ----------------------------------------------------------------------- // Validation methods // ----------------------------------------------------------------------- /** @name Validation Function */ //@{ /** * validate that a string matches the boolean datatype * @param content A string containing the content to be validated * * @exception throws InvalidDatatypeException if the content is * is not valid. */ virtual void validate ( const XMLCh* const content , ValidationContext* const context = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- /** @name Compare Function */ //@{ /** * Compare two boolean data types * * @param content1 * @param content2 * @return */ int compare(const XMLCh* const, const XMLCh* const , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(BooleanDatatypeValidator) private: virtual void checkContent(const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager); // ----------------------------------------------------------------------- // Unimplemented methods. // ----------------------------------------------------------------------- BooleanDatatypeValidator(const BooleanDatatypeValidator&); BooleanDatatypeValidator& operator=(const BooleanDatatypeValidator&); }; // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- inline BooleanDatatypeValidator::BooleanDatatypeValidator(MemoryManager* const manager) :DatatypeValidator(0, 0, 0, DatatypeValidator::Boolean, manager) { setFinite(true); } inline BooleanDatatypeValidator::~BooleanDatatypeValidator() { } // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- inline DatatypeValidator* BooleanDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) BooleanDatatypeValidator(this, facets, enums, finalSet, manager); } inline void BooleanDatatypeValidator::validate( const XMLCh* const content , ValidationContext* const context , MemoryManager* const manager) { checkContent(content, context, false, manager); } XERCES_CPP_NAMESPACE_END #endif /** * End of file BooleanDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/ENTITYDatatypeValidator.hpp000644 000765 000024 00000011124 13241160333 027333 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ENTITYDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_ENTITY_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_ENTITY_DATATYPEVALIDATOR_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT ENTITYDatatypeValidator : public StringDatatypeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor. */ //@{ ENTITYDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ENTITYDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~ENTITYDatatypeValidator(); //@} // ----------------------------------------------------------------------- // Validation methods // ----------------------------------------------------------------------- /** @name Validation Function */ //@{ /** * validate that a string matches the boolean datatype * @param content A string containing the content to be validated * * @exception throws InvalidDatatypeException if the content is * is not valid. */ virtual void validate ( const XMLCh* const content , ValidationContext* const context = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- /** @name Compare Function */ //@{ /** * Compare two boolean data types * * @param content1 * @param content2 * @return */ virtual int compare(const XMLCh* const, const XMLCh* const , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(ENTITYDatatypeValidator) protected: // // ctor provided to be used by derived classes // ENTITYDatatypeValidator(DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type); virtual void checkValueSpace(const XMLCh* const content , MemoryManager* const manager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ENTITYDatatypeValidator(const ENTITYDatatypeValidator&); ENTITYDatatypeValidator& operator = (const ENTITYDatatypeValidator&); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file ENTITYDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/TimeDatatypeValidator.hpp000644 000765 000024 00000006715 13241160333 027227 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: TimeDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_TIME_DATATYPE_VALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_TIME_DATATYPE_VALIDATOR_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT TimeDatatypeValidator : public DateTimeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ TimeDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); TimeDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~TimeDatatypeValidator(); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual const XMLCh* getCanonicalRepresentation ( const XMLCh* const rawData , MemoryManager* const memMgr = 0 , bool toValidate = false ) const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(TimeDatatypeValidator) protected: // ----------------------------------------------------------------------- // implementation of (DateTimeValidator's) virtual interface // ----------------------------------------------------------------------- virtual XMLDateTime* parse(const XMLCh* const, MemoryManager* const manager); virtual void parse(XMLDateTime* const); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- TimeDatatypeValidator(const TimeDatatypeValidator&); TimeDatatypeValidator& operator=(const TimeDatatypeValidator&); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file TimeDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.hpp000644 000765 000024 00000013057 13241160333 031071 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: AnySimpleTypeDatatypeValidator.hpp 637054 2008-03-14 11:08:37Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_ANYSIMPLETYPEDATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_ANYSIMPLETYPEDATATYPEVALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT AnySimpleTypeDatatypeValidator : public DatatypeValidator { public: // ----------------------------------------------------------------------- // Public Constructor // ----------------------------------------------------------------------- /** @name Constructor */ //@{ AnySimpleTypeDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} // ----------------------------------------------------------------------- // Public Destructor // ----------------------------------------------------------------------- /** @name Destructor. */ //@{ virtual ~AnySimpleTypeDatatypeValidator(); //@} virtual const RefArrayVectorOf* getEnumString() const; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** @name Getter Functions */ //@{ /** * Returns whether the type is atomic or not */ virtual bool isAtomic() const; //@} // ----------------------------------------------------------------------- // Validation methods // ----------------------------------------------------------------------- /** @name Validation Function */ //@{ /** * Checks that the "content" string is valid datatype. * If invalid, a Datatype validation exception is thrown. * * @param content A string containing the content to be validated * */ virtual void validate ( const XMLCh* const content , ValidationContext* const context = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Checks whether a given type can be used as a substitute * * @param toCheck A datatype validator of the type to be used as a * substitute * */ virtual bool isSubstitutableBy(const DatatypeValidator* const toCheck); //@} // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- /** @name Compare Function */ //@{ /** * Compares content in the Domain value vs. lexical value. * * @param value1 string to compare * * @param value2 string to compare * */ virtual int compare(const XMLCh* const value1, const XMLCh* const value2 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(AnySimpleTypeDatatypeValidator) private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- AnySimpleTypeDatatypeValidator(const AnySimpleTypeDatatypeValidator&); AnySimpleTypeDatatypeValidator& operator=(const AnySimpleTypeDatatypeValidator&); }; // --------------------------------------------------------------------------- // DatatypeValidator: Getters // --------------------------------------------------------------------------- inline bool AnySimpleTypeDatatypeValidator::isAtomic() const { return false; } // --------------------------------------------------------------------------- // DatatypeValidators: Validation methods // --------------------------------------------------------------------------- inline bool AnySimpleTypeDatatypeValidator::isSubstitutableBy(const DatatypeValidator* const) { return true; } inline void AnySimpleTypeDatatypeValidator::validate(const XMLCh* const , ValidationContext* const , MemoryManager* const) { return; } XERCES_CPP_NAMESPACE_END #endif /** * End of file AnySimpleTypeDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/HexBinaryDatatypeValidator.cpp000644 000765 000024 00000007236 13241160333 030214 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: HexBinaryDatatypeValidator.cpp 695949 2008-09-16 15:57:44Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- HexBinaryDatatypeValidator::HexBinaryDatatypeValidator(MemoryManager* const manager) :AbstractStringValidator(0, 0, 0, DatatypeValidator::HexBinary, manager) {} HexBinaryDatatypeValidator::~HexBinaryDatatypeValidator() {} HexBinaryDatatypeValidator::HexBinaryDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :AbstractStringValidator(baseValidator, facets, finalSet, DatatypeValidator::HexBinary, manager) { init(enums, manager); } DatatypeValidator* HexBinaryDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) HexBinaryDatatypeValidator(this, facets, enums, finalSet, manager); } // --------------------------------------------------------------------------- // Utilities // --------------------------------------------------------------------------- void HexBinaryDatatypeValidator::checkValueSpace(const XMLCh* const content, MemoryManager* const manager) { if (HexBin::getDataLength(content) < 0) { ThrowXMLwithMemMgr1(InvalidDatatypeValueException , XMLExcepts::VALUE_Not_HexBin , content , manager); } } XMLSize_t HexBinaryDatatypeValidator::getLength(const XMLCh* const content , MemoryManager* const) const { return (XMLSize_t)HexBin::getDataLength(content); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(HexBinaryDatatypeValidator) void HexBinaryDatatypeValidator::serialize(XSerializeEngine& serEng) { AbstractStringValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file HexBinaryDatatypeValidator.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/DatatypeValidator.hpp000644 000765 000024 00000047235 13241160333 026412 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DatatypeValidator.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_DATATYPEVALIDATOR_HPP #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class MemoryManager; /** * DataTypeValidator defines the interface that data type validators must * obey. These validators can be supplied by the application writer and may * be useful as standalone code as well as plugins to the validator * architecture. * * Notice: * The datatype validator will own the facets hashtable passed to it during * construction, which means that the datatype validator will be responsible * for the deletion. The facets hashtable will be created during parsing and * passed to the appropriate datatype validator which in turn will delete it * upon its destruction. * */ class VALIDATORS_EXPORT DatatypeValidator : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Constant data // ----------------------------------------------------------------------- //facets enum { FACET_LENGTH = 1, FACET_MINLENGTH = 1<<1, FACET_MAXLENGTH = 1<<2, FACET_PATTERN = 1<<3, FACET_ENUMERATION = 1<<4, FACET_MAXINCLUSIVE = 1<<5, FACET_MAXEXCLUSIVE = 1<<6, FACET_MININCLUSIVE = 1<<7, FACET_MINEXCLUSIVE = 1<<8, FACET_TOTALDIGITS = 1<<9, FACET_FRACTIONDIGITS = 1<<10, FACET_ENCODING = 1<<11, FACET_DURATION = 1<<12, FACET_PERIOD = 1<<13, FACET_WHITESPACE = 1<<14 }; //2.4.2.6 whiteSpace - Datatypes enum { PRESERVE = 0, REPLACE = 1, COLLAPSE = 2 }; enum ValidatorType { String, AnyURI, QName, Name, NCName, Boolean, Float, Double, Decimal, HexBinary, Base64Binary, Duration, DateTime, Date, Time, MonthDay, YearMonth, Year, Month, Day, ID, IDREF, ENTITY, NOTATION, List, Union, AnySimpleType, UnKnown }; // ----------------------------------------------------------------------- // Public Destructor // ----------------------------------------------------------------------- /** @name Destructor. */ //@{ virtual ~DatatypeValidator(); //@} // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** @name Getter Functions */ //@{ /** * Returns the final values of the simpleType */ int getFinalSet() const; /** * Returns the datatype facet if any is set. */ RefHashTableOf* getFacets() const; /** * Returns default value (collapse) for whiteSpace facet. * This function is overwritten in StringDatatypeValidator. */ short getWSFacet () const; /** * Returns the base datatype validator if set. */ DatatypeValidator* getBaseValidator() const; /** * Returns the 'class' type of datatype validator */ ValidatorType getType() const; /** * Returns whether the type is atomic or not * * To be redefined in List/Union validators */ virtual bool isAtomic() const; /** * Returns the datatype enumeration if any is set. * Derived class shall provide their own copy. */ virtual const RefArrayVectorOf* getEnumString() const = 0; /** * returns true if this type is anonymous **/ bool getAnonymous() const; /** * sets this type to be anonymous **/ void setAnonymous(); /** * Fundamental Facet: ordered */ XSSimpleTypeDefinition::ORDERING getOrdered() const; /** * Fundamental Facet: cardinality. */ bool getFinite() const; /** * Fundamental Facet: bounded. */ bool getBounded() const; /** * Fundamental Facet: numeric. */ bool getNumeric() const; /** * Canonical Representation * * Derivative datatype may overwrite this method once * it has its own canonical representation other than * the default one. * * @param rawData: data in raw string * @param memMgr: memory manager * @param toValiate: to validate the raw string or not * * @return: canonical representation of the data * * Note: * * 1. the return value is kept in memory allocated * by the memory manager passed in or by dv's * if no memory manager is provided. * * 2. client application is responsible for the * proper deallocation of the memory allocated * for the returned value. * * 3. In the case where the rawData is not valid * with regards to the fundamental datatype, * a null string is returned. * */ virtual const XMLCh* getCanonicalRepresentation ( const XMLCh* const rawData , MemoryManager* const memMgr = 0 , bool toValidate = false ) const; //@} // ----------------------------------------------------------------------- // Validation methods // ----------------------------------------------------------------------- /** @name Validation Function */ //@{ /** * Checks that the "content" string is valid datatype. * If invalid, a Datatype validation exception is thrown. * * @param content A string containing the content to be validated * */ virtual void validate ( const XMLCh* const content , ValidationContext* const context = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) = 0; /** * Checks whether a given type can be used as a substitute * * @param toCheck A datatype validator of the type to be used as a * substitute * * To be redefined in UnionDatatypeValidator */ virtual bool isSubstitutableBy(const DatatypeValidator* const toCheck); //@} // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- /** @name Compare Function */ //@{ /** * Compares content in the Domain value vs. lexical value. * * e.g. If type is a float then 1.0 may be equivalent to 1 even though * both are lexically different. * * @param value1 string to compare * * @param value2 string to compare * * We will provide a default behavior that should be redefined at the * children level, if necessary (i.e. boolean case). */ virtual int compare(const XMLCh* const value1, const XMLCh* const value2 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) = 0; /** * Returns the uri,name of the type this validator is for */ const XMLCh* getTypeName() const; /** * sets the uri,name that this validator is for - typeName is uri,name string. * due to the internals of xerces this will set the uri to be the schema uri if * there is no comma in typeName */ void setTypeName(const XMLCh* const typeName); /** * sets the uri,name that this validator is for */ void setTypeName(const XMLCh* const name, const XMLCh* const uri); /** * Returns the uri of the type this validator is for */ const XMLCh* getTypeUri() const; /** * Returns the name of the type this validator is for */ const XMLCh* getTypeLocalName() const; /** * Returns the plugged-in memory manager */ MemoryManager* getMemoryManager() const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(DatatypeValidator) /*** * * Serialize DatatypeValidator derivative * * Param * serEng: serialize engine * dv: DatatypeValidator derivative * * Return: * ***/ static void storeDV(XSerializeEngine& serEng , DatatypeValidator* const dv); /*** * * Create a DatatypeValidator derivative from the binary * stream. * * Param * serEng: serialize engine * * Return: * DatatypeValidator derivative * ***/ static DatatypeValidator* loadDV(XSerializeEngine& serEng); protected: // ----------------------------------------------------------------------- // Protected Constructors // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * * @param baseValidator The base datatype validator for derived * validators. Null if native validator. * * @param facets A hashtable of datatype facets (except enum). * * @param finalSet 'final' value of the simpleType */ DatatypeValidator(DatatypeValidator* const baseValidator, RefHashTableOf* const facets, const int finalSet, const ValidatorType type, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); //@} friend class DatatypeValidatorFactory; friend class XSObjectFactory; /** * facetDefined */ int getFacetsDefined() const; void setFacetsDefined(int); /** * fixed */ int getFixed() const; void setFixed(int); /** * fPattern */ const XMLCh* getPattern() const; void setPattern(const XMLCh* ); /** * fRegex */ RegularExpression* getRegex() const; void setRegex(RegularExpression* const); /** * set fType */ void setType(ValidatorType); /** * set fWhiteSpace */ void setWhiteSpace(short); /** * get WSString */ const XMLCh* getWSstring(const short WSType) const; /** * Fundamental Facet: ordered */ void setOrdered(XSSimpleTypeDefinition::ORDERING ordered); /** * Fundamental Facet: cardinality. */ void setFinite(bool finite); /** * Fundamental Facet: bounded. */ void setBounded(bool bounded); /** * Fundamental Facet: numeric. */ void setNumeric(bool numeric); private: // ----------------------------------------------------------------------- // CleanUp methods // ----------------------------------------------------------------------- void cleanUp(); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DatatypeValidator(const DatatypeValidator&); DatatypeValidator& operator=(const DatatypeValidator&); // ----------------------------------------------------------------------- // Private data members // // fFinalSet // stores "final" values of simpleTypes // // fBaseValidator // This is a pointer to a base datatype validator. If value is null, // it means we have a native datatype validator not a derived one. // // fFacets // This is a hashtable of dataype facets. // // fType // Stores the class type of datatype validator // // fFacetsDefined // Stores the constaiting facets flag // // fPattern // the pointer to the String of the pattern. The actual data is // in the Facets. // // fRegex // pointer to the RegularExpress object // // // fFixed // if {fixed} is true, then types for which this type is the // {base type definition} cannot specify a value for a specific // facet. // // fTypeName // the uri,name of the type this validator will validate // // fTypeLocalName // the name of the type this validator will validate // // fTypeUri // the uri of the type this validator will validate // fAnonymous // true if this type is anonynous // // ----------------------------------------------------------------------- bool fAnonymous; bool fFinite; bool fBounded; bool fNumeric; short fWhiteSpace; int fFinalSet; int fFacetsDefined; int fFixed; ValidatorType fType; XSSimpleTypeDefinition::ORDERING fOrdered; DatatypeValidator* fBaseValidator; RefHashTableOf* fFacets; XMLCh* fPattern; RegularExpression* fRegex; XMLCh* fTypeName; const XMLCh* fTypeLocalName; const XMLCh* fTypeUri; protected: // ----------------------------------------------------------------------- // Protected data members // // fMemoryManager // Pluggable memory manager for dynamic allocation/deallocation. // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // DatatypeValidator: Getters // --------------------------------------------------------------------------- inline int DatatypeValidator::getFinalSet() const { return fFinalSet; } inline RefHashTableOf* DatatypeValidator::getFacets() const { return fFacets; } inline DatatypeValidator* DatatypeValidator::getBaseValidator() const { return fBaseValidator; } inline short DatatypeValidator::getWSFacet() const { return fWhiteSpace; } inline DatatypeValidator::ValidatorType DatatypeValidator::getType() const { return fType; } inline int DatatypeValidator::getFacetsDefined() const { return fFacetsDefined; } inline int DatatypeValidator::getFixed() const { return fFixed; } inline const XMLCh* DatatypeValidator::getPattern() const { return fPattern; } inline RegularExpression* DatatypeValidator::getRegex() const { return fRegex; } inline const XMLCh* DatatypeValidator::getTypeName() const { return fTypeName; } inline bool DatatypeValidator::getAnonymous() const { return fAnonymous; } inline const XMLCh* DatatypeValidator::getTypeLocalName() const { return fTypeLocalName; } inline const XMLCh* DatatypeValidator::getTypeUri() const { return fTypeUri; } inline MemoryManager* DatatypeValidator::getMemoryManager() const { return fMemoryManager; } inline XSSimpleTypeDefinition::ORDERING DatatypeValidator::getOrdered() const { return fOrdered; } inline bool DatatypeValidator::getFinite() const { return fFinite; } inline bool DatatypeValidator::getBounded() const { return fBounded; } inline bool DatatypeValidator::getNumeric() const { return fNumeric; } // --------------------------------------------------------------------------- // DatatypeValidator: Setters // --------------------------------------------------------------------------- inline void DatatypeValidator::setType(ValidatorType theType) { fType = theType; } inline void DatatypeValidator::setWhiteSpace(short newValue) { fWhiteSpace = newValue; } inline void DatatypeValidator::setFacetsDefined(int facets) { fFacetsDefined |= facets; } inline void DatatypeValidator::setFixed(int fixed) { fFixed |= fixed; } inline void DatatypeValidator::setPattern(const XMLCh* pattern) { if (fPattern) { fMemoryManager->deallocate(fPattern);//delete [] fPattern; delete fRegex; } fPattern = XMLString::replicate(pattern, fMemoryManager); fRegex = new (fMemoryManager) RegularExpression(fPattern, SchemaSymbols::fgRegEx_XOption, fMemoryManager); } inline void DatatypeValidator::setRegex(RegularExpression* const regex) { fRegex = regex; } inline bool DatatypeValidator::isAtomic() const { return true; } inline void DatatypeValidator::setAnonymous() { fAnonymous = true; } inline void DatatypeValidator::setOrdered(XSSimpleTypeDefinition::ORDERING ordered) { fOrdered = ordered; } inline void DatatypeValidator::setFinite(bool finite) { fFinite = finite; } inline void DatatypeValidator::setBounded(bool bounded) { fBounded = bounded; } inline void DatatypeValidator::setNumeric(bool numeric) { fNumeric = numeric; } // --------------------------------------------------------------------------- // DatatypeValidators: Compare methods // --------------------------------------------------------------------------- inline int DatatypeValidator::compare(const XMLCh* const lValue, const XMLCh* const rValue , MemoryManager* const) { return XMLString::compareString(lValue, rValue); } // --------------------------------------------------------------------------- // DatatypeValidators: Validation methods // --------------------------------------------------------------------------- inline bool DatatypeValidator::isSubstitutableBy(const DatatypeValidator* const toCheck) { const DatatypeValidator* dv = toCheck; while (dv != 0) { if (dv == this) { return true; } dv = dv->getBaseValidator(); } return false; } XERCES_CPP_NAMESPACE_END #endif /** * End of file DatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/DurationDatatypeValidator.hpp000644 000765 000024 00000006574 13241160333 030121 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DurationDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DURATION_DATATYPE_VALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_DURATION_DATATYPE_VALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT DurationDatatypeValidator : public DateTimeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor. */ //@{ DurationDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); DurationDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~DurationDatatypeValidator(); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(DurationDatatypeValidator) protected: // ----------------------------------------------------------------------- // implementation of (DateTimeValidator's) virtual interface // ----------------------------------------------------------------------- virtual XMLDateTime* parse(const XMLCh* const, MemoryManager* const manager); virtual void parse(XMLDateTime* const); virtual int compareDates(const XMLDateTime* const , const XMLDateTime* const , bool ); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DurationDatatypeValidator(const DurationDatatypeValidator &); DurationDatatypeValidator& operator = (const DurationDatatypeValidator&); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file DurationDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/FloatDatatypeValidator.cpp000644 000765 000024 00000021360 13241160333 027362 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: FloatDatatypeValidator.cpp 676911 2008-07-15 13:27:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- FloatDatatypeValidator::FloatDatatypeValidator(MemoryManager* const manager) :AbstractNumericValidator(0, 0, 0, DatatypeValidator::Float, manager) { setOrdered(XSSimpleTypeDefinition::ORDERED_PARTIAL); setBounded(true); setFinite(true); setNumeric(true); } FloatDatatypeValidator::FloatDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :AbstractNumericValidator(baseValidator, facets, finalSet, DatatypeValidator::Float, manager) { init(enums, manager); } FloatDatatypeValidator::~FloatDatatypeValidator() {} // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- int FloatDatatypeValidator::compare(const XMLCh* const lValue , const XMLCh* const rValue , MemoryManager* const manager) { XMLFloat lObj(lValue, manager); XMLFloat rObj(rValue, manager); return compareValues(&lObj, &rObj); } DatatypeValidator* FloatDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) FloatDatatypeValidator(this, facets, enums, finalSet, manager); } // ----------------------------------------------------------------------- // ctor provided to be used by derived classes // ----------------------------------------------------------------------- FloatDatatypeValidator::FloatDatatypeValidator(DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager) :AbstractNumericValidator(baseValidator, facets, finalSet, type, manager) { //do not invoke init here !!! } int FloatDatatypeValidator::compareValues(const XMLNumber* const lValue , const XMLNumber* const rValue) { return XMLFloat::compareValues((XMLFloat*) lValue, (XMLFloat*) rValue); } void FloatDatatypeValidator::setMaxInclusive(const XMLCh* const value) { fMaxInclusive = new (fMemoryManager) XMLFloat(value, fMemoryManager); } void FloatDatatypeValidator::setMaxExclusive(const XMLCh* const value) { fMaxExclusive = new (fMemoryManager) XMLFloat(value, fMemoryManager); } void FloatDatatypeValidator::setMinInclusive(const XMLCh* const value) { fMinInclusive = new (fMemoryManager) XMLFloat(value, fMemoryManager); } void FloatDatatypeValidator::setMinExclusive(const XMLCh* const value) { fMinExclusive = new (fMemoryManager) XMLFloat(value, fMemoryManager); } void FloatDatatypeValidator::setEnumeration(MemoryManager* const manager) { // check 4.3.5.c0 must: enumeration values from the value space of base // // 1. shall be from base value space // 2. shall be from current value space as well ( shall go through boundsCheck() ) // if (!fStrEnumeration) return; XMLSize_t i = 0; XMLSize_t enumLength = fStrEnumeration->size(); FloatDatatypeValidator *numBase = (FloatDatatypeValidator*) getBaseValidator(); if (numBase) { try { for ( i = 0; i < enumLength; i++) { numBase->checkContent(fStrEnumeration->elementAt(i), (ValidationContext*)0, false, manager); } } catch (XMLException&) { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException , XMLExcepts::FACET_enum_base , fStrEnumeration->elementAt(i) , manager); } } #if 0 // spec says that only base has to checkContent // We put the this->checkContent in a separate loop // to not block original message with in that method. // for ( i = 0; i < enumLength; i++) { checkContent(fStrEnumeration->elementAt(i), (ValidationContext*)0, false, manager); } #endif fEnumeration = new (fMemoryManager) RefVectorOf(enumLength, true, fMemoryManager); fEnumerationInherited = false; for ( i = 0; i < enumLength; i++) { fEnumeration->insertElementAt(new (fMemoryManager) XMLFloat(fStrEnumeration->elementAt(i), fMemoryManager), i); } } // ----------------------------------------------------------------------- // Abstract interface from AbstractNumericValidator // ----------------------------------------------------------------------- void FloatDatatypeValidator::checkContent(const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager) { //validate against base validator if any FloatDatatypeValidator *pBase = (FloatDatatypeValidator*) this->getBaseValidator(); if (pBase) pBase->checkContent(content, context, true, manager); // we check pattern first if ( (getFacetsDefined() & DatatypeValidator::FACET_PATTERN ) != 0 ) { if (getRegex()->matches(content, manager) ==false) { ThrowXMLwithMemMgr2(InvalidDatatypeValueException , XMLExcepts::VALUE_NotMatch_Pattern , content , getPattern() , manager); } } // if this is a base validator, we only need to check pattern facet // all other facet were inherited by the derived type if (asBase) return; XMLFloat theValue(content, manager); XMLFloat *theData = &theValue; if (getEnumeration() != 0) { XMLSize_t i=0; XMLSize_t enumLength = getEnumeration()->size(); for ( ; i < enumLength; i++) { if (compareValues(theData, (XMLFloat*) getEnumeration()->elementAt(i))==0) break; } if (i == enumLength) ThrowXMLwithMemMgr1(InvalidDatatypeValueException, XMLExcepts::VALUE_NotIn_Enumeration, content, manager); } boundsCheck(theData, manager); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(FloatDatatypeValidator) void FloatDatatypeValidator::serialize(XSerializeEngine& serEng) { /*** * Note: * * During storing, we need write the specific number * type info before calling base::serialize(). * * While loading, we do nothing here ***/ if (serEng.isStoring()) { serEng<<(int) (XMLNumber::Float); } AbstractNumericValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file FloatDatatypeValidator::cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/ListDatatypeValidator.hpp000644 000765 000024 00000016272 13241160333 027243 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ListDatatypeValidator.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_LIST_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_LIST_DATATYPEVALIDATOR_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT ListDatatypeValidator : public AbstractStringValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ ListDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ListDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~ListDatatypeValidator(); //@} /** @name Getter Functions */ //@{ /** * Returns whether the type is atomic or not */ virtual bool isAtomic() const; virtual const XMLCh* getCanonicalRepresentation ( const XMLCh* const rawData , MemoryManager* const memMgr = 0 , bool toValidate = false ) const; //@} // ----------------------------------------------------------------------- // Validation methods // ----------------------------------------------------------------------- /** @name Validation Function */ //@{ /** * validate that a string matches the boolean datatype * @param content A string containing the content to be validated * * @exception throws InvalidDatatypeException if the content is * is not valid. */ virtual void validate ( const XMLCh* const content , ValidationContext* const context = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- /** @name Compare Function */ //@{ /** * Compare two boolean data types * * @param content1 * @param content2 * @return */ int compare(const XMLCh* const, const XMLCh* const , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); DatatypeValidator* getItemTypeDTV() const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(ListDatatypeValidator) protected: // // ctor provided to be used by derived classes: No // virtual void checkValueSpace(const XMLCh* const content , MemoryManager* const manager); virtual XMLSize_t getLength(const XMLCh* const content , MemoryManager* const manager) const; // // Overwrite AbstractStringValidator's // virtual void inspectFacetBase(MemoryManager* const manager); virtual void inheritFacet(); virtual void checkContent(const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager); private: void checkContent( BaseRefVectorOf* tokenVector , const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager ); bool valueSpaceCheck(BaseRefVectorOf* tokenVector , const XMLCh* const enumStr , MemoryManager* const manager) const; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- inline const XMLCh* getContent() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- inline void setContent(const XMLCh* const content); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ListDatatypeValidator(const ListDatatypeValidator&); ListDatatypeValidator& operator=(const ListDatatypeValidator&); // ----------------------------------------------------------------------- // Private data members // // fContent // temporary var referencing the content to be validated, // for error reporting purpose. // // ----------------------------------------------------------------------- const XMLCh* fContent; }; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- inline const XMLCh* ListDatatypeValidator::getContent() const { return fContent; } inline bool ListDatatypeValidator::isAtomic() const { return false; } // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- inline void ListDatatypeValidator::setContent(const XMLCh* const content) { fContent = content; } XERCES_CPP_NAMESPACE_END #endif /** * End of file ListDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/YearMonthDatatypeValidator.hpp000644 000765 000024 00000006254 13241160333 030235 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: YearMonthDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_YEARMONTH_DATATYPE_VALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_YEARMONTH_DATATYPE_VALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT YearMonthDatatypeValidator : public DateTimeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ YearMonthDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); YearMonthDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~YearMonthDatatypeValidator(); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(YearMonthDatatypeValidator) protected: // ----------------------------------------------------------------------- // implementation of (DateTimeValidator's) virtual interface // ----------------------------------------------------------------------- virtual XMLDateTime* parse(const XMLCh* const, MemoryManager* const manager); virtual void parse(XMLDateTime* const); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- YearMonthDatatypeValidator(const YearMonthDatatypeValidator&); YearMonthDatatypeValidator& operator=(const YearMonthDatatypeValidator&); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file YearMonthDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/IDREFDatatypeValidator.hpp000644 000765 000024 00000010325 13241160333 027152 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IDREFDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_IDREF_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_IDREF_DATATYPEVALIDATOR_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT IDREFDatatypeValidator : public StringDatatypeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ IDREFDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); IDREFDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~IDREFDatatypeValidator(); //@} // ----------------------------------------------------------------------- // Validation methods // ----------------------------------------------------------------------- /** @name Validation Function */ //@{ /** * validate that a string matches the boolean datatype * @param content A string containing the content to be validated * * @exception throws InvalidDatatypeException if the content is * is not valid. */ virtual void validate ( const XMLCh* const content , ValidationContext* const context = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(IDREFDatatypeValidator) protected: // // ctor provided to be used by derived classes // IDREFDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual void checkValueSpace(const XMLCh* const content , MemoryManager* const manager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- IDREFDatatypeValidator(const IDREFDatatypeValidator&); IDREFDatatypeValidator& operator=(const IDREFDatatypeValidator&); // ----------------------------------------------------------------------- // Private data members // // // ----------------------------------------------------------------------- }; XERCES_CPP_NAMESPACE_END #endif /** * End of file IDREFDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/UnionDatatypeValidator.cpp000644 000765 000024 00000036773 13241160333 027423 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: UnionDatatypeValidator.cpp 677559 2008-07-17 11:35:27Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN static const unsigned int BUF_LEN = 64; // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- UnionDatatypeValidator::UnionDatatypeValidator(MemoryManager* const manager) :DatatypeValidator(0, 0, 0, DatatypeValidator::Union, manager) ,fEnumerationInherited(false) ,fMemberTypesInherited(false) ,fEnumeration(0) ,fMemberTypeValidators(0) {} UnionDatatypeValidator::~UnionDatatypeValidator() { cleanUp(); } UnionDatatypeValidator::UnionDatatypeValidator( RefVectorOf* const memberTypeValidators , const int finalSet , MemoryManager* const manager) :DatatypeValidator(0, 0, finalSet, DatatypeValidator::Union, manager) ,fEnumerationInherited(false) ,fMemberTypesInherited(false) ,fEnumeration(0) ,fMemberTypeValidators(0) { if ( !memberTypeValidators ) { ThrowXMLwithMemMgr(InvalidDatatypeFacetException , XMLExcepts::FACET_Union_Null_memberTypeValidators, manager); } // no pattern, no enumeration fMemberTypeValidators = memberTypeValidators; } typedef JanitorMemFunCall CleanupType; UnionDatatypeValidator::UnionDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager , RefVectorOf* const memberTypeValidators , const bool memberTypesInherited ) :DatatypeValidator(baseValidator, facets, finalSet, DatatypeValidator::Union, manager) ,fEnumerationInherited(false) ,fMemberTypesInherited(memberTypesInherited) ,fEnumeration(0) ,fMemberTypeValidators(memberTypeValidators) { // // baseValidator another UnionDTV from which, // this UnionDTV is derived by restriction. // it shall be not null // if (!baseValidator) { ThrowXMLwithMemMgr(InvalidDatatypeFacetException , XMLExcepts::FACET_Union_Null_baseValidator, manager); } if (baseValidator->getType() != DatatypeValidator::Union) { XMLCh value1[BUF_LEN+1]; XMLString::binToText(baseValidator->getType(), value1, BUF_LEN, 10, manager); ThrowXMLwithMemMgr1(InvalidDatatypeFacetException , XMLExcepts::FACET_Union_invalid_baseValidatorType , value1 , manager); } CleanupType cleanup(this, &UnionDatatypeValidator::cleanUp); try { init(baseValidator, facets, enums, manager); } catch(const OutOfMemoryException&) { // Don't cleanup when out of memory, since executing the // code can cause problems. cleanup.release(); throw; } cleanup.release(); } void UnionDatatypeValidator::init(DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , MemoryManager* const manager) { if (enums) setEnumeration(enums, false); // Set Facets if any defined if (facets) { XMLCh* key; XMLCh* value; RefHashTableOfEnumerator e(facets, false, manager); while (e.hasMoreElements()) { KVStringPair pair = e.nextElement(); key = pair.getKey(); value = pair.getValue(); if (XMLString::equals(key, SchemaSymbols::fgELT_PATTERN)) { setPattern(value); if (getPattern()) setFacetsDefined(DatatypeValidator::FACET_PATTERN); // do not construct regex until needed } else { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException , XMLExcepts::FACET_Invalid_Tag , key , manager); } }//while /*** Schema constraint: Part I -- self checking ***/ // Nil /*** Schema constraint: Part II base vs derived checking ***/ // check 4.3.5.c0 must: enumeration values from the value space of base if ( ((getFacetsDefined() & DatatypeValidator::FACET_ENUMERATION) != 0) && (getEnumeration() !=0)) { XMLSize_t i = 0; XMLSize_t enumLength = getEnumeration()->size(); try { for ( ; i < enumLength; i++) { // ask parent do a complete check // // enum need NOT be passed this->checkContent() // since there are no other facets for Union, parent // checking is good enough. // baseValidator->validate(getEnumeration()->elementAt(i), (ValidationContext*)0, manager); } } catch ( XMLException& ) { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException , XMLExcepts::FACET_enum_base , getEnumeration()->elementAt(i) , manager); } } }// End of Facet setting /*** Inherit facets from base.facets The reason of this inheriting (or copying values) is to ease schema constraint checking, so that we need NOT trace back to our very first base validator in the hierachy. Instead, we are pretty sure checking against immediate base validator is enough. ***/ UnionDatatypeValidator *pBaseValidator = (UnionDatatypeValidator*) baseValidator; // inherit enumeration if (((pBaseValidator->getFacetsDefined() & DatatypeValidator::FACET_ENUMERATION) !=0) && ((getFacetsDefined() & DatatypeValidator::FACET_ENUMERATION) == 0)) { setEnumeration(pBaseValidator->getEnumeration(), true); } } // // 1) the bottom level UnionDTV would check against // pattern and enumeration as well // 2) each UnionDTV(s) above the bottom level UnionDTV and // below the native UnionDTV (the top level DTV) // would check against pattern only. // 3) the natvie Union DTV (the top level DTV) would invoke // memberTypeValidator to validate // void UnionDatatypeValidator::checkContent(const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager) { DatatypeValidator* bv = getBaseValidator(); if (bv) ((UnionDatatypeValidator*)bv)->checkContent(content, context, true, manager); else { // 3) native union type // check content against each member type validator in Union // report an error only in case content is not valid against all member datatypes. // bool memTypeValid = false; for ( unsigned int i = 0; i < fMemberTypeValidators->size(); ++i ) { if ( memTypeValid ) break; try { fMemberTypeValidators->elementAt(i)->validate(content, context, manager); memTypeValid = true; //set the validator of the type actually used to validate the content DatatypeValidator *dtv = fMemberTypeValidators->elementAt(i); // context will be null during schema construction if(context) context->setValidatingMemberType(dtv); } catch (XMLException&) { //absorbed } } // for if ( !memTypeValid ) { ThrowXMLwithMemMgr1(InvalidDatatypeValueException , XMLExcepts::VALUE_no_match_memberType , content , manager); //( "Content '"+content+"' does not match any union types" ); } } // 1) and 2). we check pattern first if ( (getFacetsDefined() & DatatypeValidator::FACET_PATTERN ) != 0 ) { if (getRegex()->matches(content, manager) == false) { ThrowXMLwithMemMgr2(InvalidDatatypeValueException , XMLExcepts::VALUE_NotMatch_Pattern , content , getPattern() , manager); } } // if this is a base validator, we only need to check pattern facet // all other facet were inherited by the derived type if (asBase) return; if ((getFacetsDefined() & DatatypeValidator::FACET_ENUMERATION) != 0 && (getEnumeration() != 0)) { // If the content match (compare equal) any enumeration with // any of the member types, it is considerd valid. // RefVectorOf* memberDTV = getMemberTypeValidators(); RefArrayVectorOf* tmpEnum = getEnumeration(); XMLSize_t memberTypeNumber = memberDTV->size(); XMLSize_t enumLength = tmpEnum->size(); for ( XMLSize_t memberIndex = 0; memberIndex < memberTypeNumber; ++memberIndex) { for ( XMLSize_t enumIndex = 0; enumIndex < enumLength; ++enumIndex) { try { if (memberDTV->elementAt(memberIndex)->compare(content, tmpEnum->elementAt(enumIndex), manager) == 0) return; } catch (XMLException&) { //absorbed } } // for enumIndex } // for memberIndex ThrowXMLwithMemMgr1(InvalidDatatypeValueException, XMLExcepts::VALUE_NotIn_Enumeration, content, manager); } // enumeration } // // // int UnionDatatypeValidator::compare(const XMLCh* const lValue , const XMLCh* const rValue , MemoryManager* const manager) { RefVectorOf* memberDTV = getMemberTypeValidators(); XMLSize_t memberTypeNumber = memberDTV->size(); for ( XMLSize_t memberIndex = 0; memberIndex < memberTypeNumber; ++memberIndex) { // 'compare' can throw exceptions when the datatype is not valid, or just // return -1; so attempt to validate both values to get the right validator try { memberDTV->elementAt(memberIndex)->validate(lValue, 0, manager); memberDTV->elementAt(memberIndex)->validate(rValue, 0, manager); if (memberDTV->elementAt(memberIndex)->compare(lValue, rValue, manager) ==0) return 0; } catch (XMLException&) { //absorbed } } //REVISIT: what does it mean for UNION1 to be or UNION2 ? // As long as -1 or +1 indicates an unequality, return either of them is ok. return -1; } const RefArrayVectorOf* UnionDatatypeValidator::getEnumString() const { return getEnumeration(); } /*** * 2.5.1.3 Union datatypes * * The canonical-lexical-representation for a union datatype is defined as the lexical form * in which the values have the canonical lexical representation of the appropriate memberTypes. ***/ const XMLCh* UnionDatatypeValidator::getCanonicalRepresentation(const XMLCh* const rawData , MemoryManager* const memMgr , bool toValidate) const { MemoryManager* toUse = memMgr? memMgr : getMemoryManager(); UnionDatatypeValidator* temp = (UnionDatatypeValidator*) this; if (toValidate) { try { temp->checkContent(rawData, 0, false, toUse); } catch (...) { return 0; } } //get the native unionDv UnionDatatypeValidator* bdv = (UnionDatatypeValidator*) temp->getBaseValidator(); while (bdv) { temp = bdv; bdv = (UnionDatatypeValidator*) temp->getBaseValidator(); } //let the member dv which recognize the rawData, to return //us the canonical form for ( unsigned int i = 0; i < temp->fMemberTypeValidators->size(); ++i ) { try { temp->fMemberTypeValidators->elementAt(i)->validate(rawData, 0, toUse); return temp->fMemberTypeValidators->elementAt(i)->getCanonicalRepresentation(rawData, toUse, false); } catch (XMLException&) { //absorbed } } //if no member dv recognize it return 0; } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(UnionDatatypeValidator) void UnionDatatypeValidator::serialize(XSerializeEngine& serEng) { DatatypeValidator::serialize(serEng); if (serEng.isStoring()) { serEng< * Serialize RefVectorOf ***/ XTemplateSerializer::storeObject(fEnumeration, serEng); XTemplateSerializer::storeObject(fMemberTypeValidators, serEng); } else { serEng>>fEnumerationInherited; serEng>>fMemberTypesInherited; /*** * Deserialize RefArrayVectorOf * Deserialize RefVectorOf ***/ XTemplateSerializer::loadObject(&fEnumeration, 8, true, serEng); XTemplateSerializer::loadObject(&fMemberTypeValidators, 4, false, serEng); } } XERCES_CPP_NAMESPACE_END /** * End of file UnionDatatypeValidator.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/YearDatatypeValidator.hpp000644 000765 000024 00000006153 13241160333 027225 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: YearDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_YEAR_DATATYPE_VALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_YEAR_DATATYPE_VALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT YearDatatypeValidator : public DateTimeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ YearDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); YearDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~YearDatatypeValidator(); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(YearDatatypeValidator) protected: // ----------------------------------------------------------------------- // implementation of (DateTimeValidator's) virtual interface // ----------------------------------------------------------------------- virtual XMLDateTime* parse(const XMLCh* const, MemoryManager* const manager); virtual void parse(XMLDateTime* const); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- YearDatatypeValidator(const YearDatatypeValidator&); YearDatatypeValidator& operator=(const YearDatatypeValidator&); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file YearDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/IDDatatypeValidator.cpp000644 000765 000024 00000010337 13241160333 026613 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IDDatatypeValidator.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- IDDatatypeValidator::IDDatatypeValidator(MemoryManager* const manager) :StringDatatypeValidator(0, 0, 0, DatatypeValidator::ID, manager) {} IDDatatypeValidator::IDDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :StringDatatypeValidator(baseValidator, facets, finalSet, DatatypeValidator::ID, manager) { init(enums, manager); } IDDatatypeValidator::~IDDatatypeValidator() {} DatatypeValidator* IDDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) IDDatatypeValidator(this, facets, enums, finalSet, manager); } IDDatatypeValidator::IDDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager) :StringDatatypeValidator(baseValidator, facets, finalSet, type, manager) { // do not invoke init() here!!! } void IDDatatypeValidator::validate(const XMLCh* const content , ValidationContext* const context , MemoryManager* const manager) { // use StringDatatypeValidator (which in turn, invoke // the baseValidator) to validate content against // facets if any. // StringDatatypeValidator::validate(content, context, manager); // storing IDs to the global ID table if (context) { context->addId(content); } } void IDDatatypeValidator::checkValueSpace(const XMLCh* const content , MemoryManager* const manager) { // // 3.3.8 check must: "NCName" // if ( !XMLChar1_0::isValidNCName(content, XMLString::stringLen(content)) ) { ThrowXMLwithMemMgr1(InvalidDatatypeValueException , XMLExcepts::VALUE_Invalid_NCName , content , manager); } } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(IDDatatypeValidator) void IDDatatypeValidator::serialize(XSerializeEngine& serEng) { StringDatatypeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file IDDatatypeValidator.cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/DateDatatypeValidator.cpp000644 000765 000024 00000010150 13241160333 027165 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DateDatatypeValidator.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- DateDatatypeValidator::DateDatatypeValidator(MemoryManager* const manager) :DateTimeValidator(0, 0, 0, DatatypeValidator::Date, manager) { setOrdered(XSSimpleTypeDefinition::ORDERED_PARTIAL); } DateDatatypeValidator::DateDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :DateTimeValidator(baseValidator, facets, finalSet, DatatypeValidator::Date, manager) { init(enums, manager); } DateDatatypeValidator::~DateDatatypeValidator() {} DatatypeValidator* DateDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) DateDatatypeValidator(this, facets, enums, finalSet, manager); } // // caller need to release the date created here // XMLDateTime* DateDatatypeValidator::parse(const XMLCh* const content, MemoryManager* const manager) { XMLDateTime *pRetDate = new (manager) XMLDateTime(content, manager); Janitor jan(pRetDate); try { pRetDate->parseDate(); } catch(const OutOfMemoryException&) { jan.release(); throw; } return jan.release(); } void DateDatatypeValidator::parse(XMLDateTime* const pDate) { pDate->parseDate(); } const XMLCh* DateDatatypeValidator::getCanonicalRepresentation(const XMLCh* const rawData , MemoryManager* const memMgr , bool toValidate) const { MemoryManager* toUse = memMgr? memMgr : fMemoryManager; if (toValidate) { DateDatatypeValidator* temp = (DateDatatypeValidator*) this; try { temp->checkContent(rawData, 0, false, toUse); } catch (...) { return 0; } } try { XMLDateTime aDateTime(rawData, toUse); aDateTime.parseDate(); return aDateTime.getDateCanonicalRepresentation(toUse); } catch (...) { return 0; } } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(DateDatatypeValidator) void DateDatatypeValidator::serialize(XSerializeEngine& serEng) { DateTimeValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file DateDatatypeValidator::cpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/DateTimeValidator.hpp000644 000765 000024 00000010356 13241160333 026325 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DateTimeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DATETIME_VALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_DATETIME_VALIDATOR_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT DateTimeValidator : public AbstractNumericFacetValidator { public: // ----------------------------------------------------------------------- // Public dtor // ----------------------------------------------------------------------- /** @name Constructor. */ //@{ virtual ~DateTimeValidator(); //@} virtual void validate ( const XMLCh* const content , ValidationContext* const context = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual int compare(const XMLCh* const value1 , const XMLCh* const value2 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(DateTimeValidator) protected: // ----------------------------------------------------------------------- // ctor used by derived class // ----------------------------------------------------------------------- DateTimeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); // // Abstract interface // virtual int compareValues(const XMLNumber* const lValue , const XMLNumber* const rValue); virtual void checkContent(const XMLCh* const content , ValidationContext* const context , bool asBase , MemoryManager* const manager); virtual void setMaxInclusive(const XMLCh* const); virtual void setMaxExclusive(const XMLCh* const); virtual void setMinInclusive(const XMLCh* const); virtual void setMinExclusive(const XMLCh* const); virtual void setEnumeration(MemoryManager* const manager); protected: // ----------------------------------------------------------------------- // helper interface: to be implemented/overwritten by derived class // ----------------------------------------------------------------------- virtual XMLDateTime* parse(const XMLCh* const, MemoryManager* const manager) = 0; virtual void parse(XMLDateTime* const) = 0; // to be overwritten by duration virtual int compareDates(const XMLDateTime* const lValue , const XMLDateTime* const rValue , bool strict); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DateTimeValidator(const DateTimeValidator&); DateTimeValidator& operator=(const DateTimeValidator&); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file DateTimeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/NCNameDatatypeValidator.hpp000644 000765 000024 00000011232 13241160333 027420 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: NCNameDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_NCNAME_DATATYPEVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_NCNAME_DATATYPEVALIDATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class VALIDATORS_EXPORT NCNameDatatypeValidator : public StringDatatypeValidator { public: // ----------------------------------------------------------------------- // Public ctor/dtor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ NCNameDatatypeValidator ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); NCNameDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~NCNameDatatypeValidator(); //@} // ----------------------------------------------------------------------- // Validation methods // ----------------------------------------------------------------------- /** @name Validation Function */ //@{ /** * validate that a string matches the boolean datatype * @param content A string containing the content to be validated * * @exception throws InvalidDatatypeException if the content is * is not valid. */ virtual void validate ( const XMLCh* const content , ValidationContext* const context = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} // ----------------------------------------------------------------------- // Compare methods // ----------------------------------------------------------------------- /** @name Compare Function */ //@{ /** * Compare two boolean data types * * @param content1 * @param content2 * @return */ virtual int compare(const XMLCh* const, const XMLCh* const , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); //@} /** * Returns an instance of the base datatype validator class * Used by the DatatypeValidatorFactory. */ virtual DatatypeValidator* newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(NCNameDatatypeValidator) protected: // // ctor provided to be used by derived classes // NCNameDatatypeValidator ( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual void checkValueSpace(const XMLCh* const content , MemoryManager* const manager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- NCNameDatatypeValidator(const NCNameDatatypeValidator&); NCNameDatatypeValidator& operator=(const NCNameDatatypeValidator&); // ----------------------------------------------------------------------- // Private data members // // // ----------------------------------------------------------------------- }; XERCES_CPP_NAMESPACE_END #endif /** * End of file NCNameDatatypeValidator.hpp */ xerces-c-3.2.2/src/xercesc/validators/datatype/StringDatatypeValidator.cpp000644 000765 000024 00000017422 13241160333 027567 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: StringDatatypeValidator.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- StringDatatypeValidator::StringDatatypeValidator(MemoryManager* const manager) :AbstractStringValidator(0, 0, 0, DatatypeValidator::String, manager) { setWhiteSpace(DatatypeValidator::PRESERVE); } StringDatatypeValidator::StringDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager) :AbstractStringValidator(baseValidator, facets, finalSet, DatatypeValidator::String, manager) { setWhiteSpace(DatatypeValidator::PRESERVE); init(enums, manager); } StringDatatypeValidator::~StringDatatypeValidator() {} DatatypeValidator* StringDatatypeValidator::newInstance ( RefHashTableOf* const facets , RefArrayVectorOf* const enums , const int finalSet , MemoryManager* const manager ) { return (DatatypeValidator*) new (manager) StringDatatypeValidator(this, facets, enums, finalSet, manager); } StringDatatypeValidator::StringDatatypeValidator( DatatypeValidator* const baseValidator , RefHashTableOf* const facets , const int finalSet , const ValidatorType type , MemoryManager* const manager) :AbstractStringValidator(baseValidator, facets, finalSet, type, manager) { setWhiteSpace(DatatypeValidator::PRESERVE); // do not invoke init() here!!! } // --------------------------------------------------------------------------- // Utilities // --------------------------------------------------------------------------- void StringDatatypeValidator::assignAdditionalFacet(const XMLCh* const key , const XMLCh* const value , MemoryManager* const manager) { if (XMLString::equals(key, SchemaSymbols::fgELT_WHITESPACE)) { // whiteSpace = preserve | replace | collapse if (XMLString::equals(value, SchemaSymbols::fgWS_PRESERVE)) setWhiteSpace(DatatypeValidator::PRESERVE); else if (XMLString::equals(value, SchemaSymbols::fgWS_REPLACE)) setWhiteSpace(DatatypeValidator::REPLACE); else if (XMLString::equals(value, SchemaSymbols::fgWS_COLLAPSE)) setWhiteSpace(DatatypeValidator::COLLAPSE); else ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_Invalid_WS, value, manager); //("whiteSpace value '" + ws + "' must be one of 'preserve', 'replace', 'collapse'."); setFacetsDefined(DatatypeValidator::FACET_WHITESPACE); } else { ThrowXMLwithMemMgr1(InvalidDatatypeFacetException , XMLExcepts::FACET_Invalid_Tag , key , manager); } } void StringDatatypeValidator::inheritAdditionalFacet() { StringDatatypeValidator *pBaseValidator = (StringDatatypeValidator*) getBaseValidator(); if (!pBaseValidator) return; // inherit whitespace if (((pBaseValidator->getFacetsDefined() & DatatypeValidator::FACET_WHITESPACE) !=0) && ((getFacetsDefined() & DatatypeValidator::FACET_WHITESPACE) == 0)) { setWhiteSpace(getBaseValidator()->getWSFacet()); setFacetsDefined(DatatypeValidator::FACET_WHITESPACE); } } void StringDatatypeValidator::checkAdditionalFacetConstraints(MemoryManager* const manager) const { StringDatatypeValidator *pBaseValidator = (StringDatatypeValidator*) getBaseValidator(); if (!pBaseValidator) return; short thisWSFacet = getWSFacet(); short baseWSFacet = pBaseValidator->getWSFacet(); // check 4.3.6.c1 error: whitespace if (((getFacetsDefined() & DatatypeValidator::FACET_WHITESPACE) != 0) && ((pBaseValidator->getFacetsDefined() & DatatypeValidator::FACET_WHITESPACE) != 0 )) { if ((baseWSFacet == DatatypeValidator::COLLAPSE) && ((thisWSFacet == DatatypeValidator::PRESERVE) || (thisWSFacet == DatatypeValidator::REPLACE))) ThrowXMLwithMemMgr(InvalidDatatypeFacetException, XMLExcepts::FACET_WS_collapse, manager); if ((baseWSFacet == DatatypeValidator::REPLACE) && (thisWSFacet == DatatypeValidator::PRESERVE)) ThrowXMLwithMemMgr(InvalidDatatypeFacetException, XMLExcepts::FACET_WS_replace, manager); if (((pBaseValidator->getFixed() & DatatypeValidator::FACET_WHITESPACE) !=0) && ( thisWSFacet != baseWSFacet)) { ThrowXMLwithMemMgr2(InvalidDatatypeFacetException , XMLExcepts::FACET_whitespace_base_fixed , getWSstring(thisWSFacet) , getWSstring(baseWSFacet) , manager); } } } void StringDatatypeValidator::checkAdditionalFacet(const XMLCh* const content , MemoryManager* const manager) const { // // check WhiteSpace // if ((getFacetsDefined() & DatatypeValidator::FACET_WHITESPACE) != 0 ) { if ( getWSFacet() == DatatypeValidator::REPLACE ) { if (!XMLString::isWSReplaced(content)) ThrowXMLwithMemMgr1(InvalidDatatypeValueException, XMLExcepts::VALUE_WS_replaced, content, manager); } else if ( getWSFacet() == DatatypeValidator::COLLAPSE ) { if (!XMLString::isWSCollapsed(content)) ThrowXMLwithMemMgr1(InvalidDatatypeValueException, XMLExcepts::VALUE_WS_collapsed, content, manager); } } } void StringDatatypeValidator::checkValueSpace(const XMLCh* const , MemoryManager* const) {} /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(StringDatatypeValidator) void StringDatatypeValidator::serialize(XSerializeEngine& serEng) { AbstractStringValidator::serialize(serEng); } XERCES_CPP_NAMESPACE_END /** * End of file StringDatatypeValidator.cpp */ xerces-c-3.2.2/src/xercesc/dom/DOMError.hpp000644 000765 000024 00000013100 13241160337 021202 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMError.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMERROR_HPP) #define XERCESC_INCLUDE_GUARD_DOMERROR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class DOMLocator; /** * DOMError is an interface that describes an error. * * @see DOMErrorHandler#handleError * @since DOM Level 3 */ class CDOM_EXPORT DOMError { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMError() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMError(const DOMError &); DOMError & operator = (const DOMError &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMError() {}; //@} // ----------------------------------------------------------------------- // Class types // ----------------------------------------------------------------------- /** @name Public constants */ //@{ /** * The severity of the error described by the DOMError. * *

DOM_SEVERITY_ERROR: * The severity of the error described by the DOMError is error. * A DOM_SEVERITY_ERROR may not cause the processing to stop if the error can * be recovered, unless DOMErrorHandler::handleError() returns false.

* *

DOM_SEVERITY_FATAL_ERROR * The severity of the error described by the DOMError is fatal error. * A DOM_SEVERITY_FATAL_ERROR will cause the normal processing to stop. The return * value of DOMErrorHandler::handleError() is ignored unless the * implementation chooses to continue, in which case the behavior becomes undefined.

* *

DOM_SEVERITY_WARNING * The severity of the error described by the DOMError is warning. * A DOM_SEVERITY_WARNING will not cause the processing to stop, unless * DOMErrorHandler::handleError() returns false.

* * @since DOM Level 3 */ enum ErrorSeverity { DOM_SEVERITY_WARNING = 1, DOM_SEVERITY_ERROR = 2, DOM_SEVERITY_FATAL_ERROR = 3 }; //@} // ----------------------------------------------------------------------- // Virtual DOMError interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Get the severity of the error * * @see setSeverity * @since DOM Level 3 */ virtual ErrorSeverity getSeverity() const = 0; /** * Get the message describing the error that occured. * * @since DOM Level 3 */ virtual const XMLCh* getMessage() const = 0; /** * Get the location of the error * * @since DOM Level 3 */ virtual DOMLocator* getLocation() const = 0; /** * The related platform dependent exception if any. * * @since DOM Level 3 */ virtual void* getRelatedException() const = 0; /** * A XMLCh* indicating which related data is expected in * relatedData. Users should refer to the specification of the error * in order to find its XMLCh* type and relatedData * definitions if any. * * Note: As an example, DOMDocument::normalizeDocument() does generate * warnings when the "split-cdata-sections" parameter is in use. Therefore, the * method generates a DOM_SEVERITY_WARNING with type "cdata-sections-splitted" * and the first DOMCDATASection node in document order resulting from the split * is returned by the relatedData attribute. * * @since DOM Level 3 */ virtual const XMLCh* getType() const = 0; /** * The related DOMError::getType dependent data if any. * * @since DOM Level 3 */ virtual void* getRelatedData() const = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMDocumentType.hpp000644 000765 000024 00000013347 13241160337 022546 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMDocumentType.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTTYPE_HPP) #define XERCESC_INCLUDE_GUARD_DOMDOCUMENTTYPE_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMNamedNodeMap; /** * Each DOMDocument has a doctype attribute whose value * is either null or a DOMDocumentType object. The * DOMDocumentType interface in the DOM Core provides an interface * to the list of entities that are defined for the document, and little * else because the effect of namespaces and the various XML schema efforts * on DTD representation are not clearly understood as of this writing. *

The DOM Level 2 doesn't support editing DOMDocumentType nodes. *

See also the Document Object Model (DOM) Level 2 Core Specification. * * @since DOM Level 1 */ class CDOM_EXPORT DOMDocumentType: public DOMNode { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMDocumentType() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMDocumentType(const DOMDocumentType &); DOMDocumentType & operator = (const DOMDocumentType &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMDocumentType() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMDocumentType interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 1 */ //@{ /** * The name of DTD; i.e., the name immediately following the * DOCTYPE keyword. * * @since DOM Level 1 */ virtual const XMLCh * getName() const = 0; /** * A DOMNamedNodeMap containing the general entities, both * external and internal, declared in the DTD. Parameter entities are * not contained. Duplicates are discarded. For example in: * <!DOCTYPE
* ex SYSTEM "ex.dtd" [ <!ENTITY foo "foo"> <!ENTITY bar
* "bar"> <!ENTITY bar "bar2"> <!ENTITY % baz "baz">
* ]> <ex/>
* the interface provides access to foo * and the first declaration of bar but not the second * declaration of bar or baz. Every node in * this map also implements the DOMEntity interface. *
The DOM Level 2 does not support editing entities, therefore * entities cannot be altered in any way. * * @since DOM Level 1 */ virtual DOMNamedNodeMap *getEntities() const = 0; /** * A DOMNamedNodeMap containing the notations declared in the * DTD. Duplicates are discarded. Every node in this map also implements * the DOMNotation interface. *
The DOM Level 2 does not support editing notations, therefore * notations cannot be altered in any way. * * @since DOM Level 1 */ virtual DOMNamedNodeMap *getNotations() const = 0; //@} /** @name Functions introduced in DOM Level 2. */ //@{ /** * Get the public identifier of the external subset. * * @return The public identifier of the external subset. * @since DOM Level 2 */ virtual const XMLCh * getPublicId() const = 0; /** * Get the system identifier of the external subset. * * @return The system identifier of the external subset. * @since DOM Level 2 */ virtual const XMLCh * getSystemId() const = 0; /** * The internal subset as a string, or null if there is none. * This is does not contain the delimiting square brackets.The actual * content returned depends on how much information is available to the * implementation. This may vary depending on various parameters, * including the XML processor used to build the document. * * @return The internal subset as a string. * @since DOM Level 2 */ virtual const XMLCh * getInternalSubset() const = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMRangeException.cpp000644 000765 000024 00000003010 13241160337 023016 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMRangeException.cpp 671894 2008-06-26 13:29:21Z borisk $ */ #include "DOMRangeException.hpp" #include XERCES_CPP_NAMESPACE_BEGIN DOMRangeException::DOMRangeException() : DOMException() { } DOMRangeException::DOMRangeException(short exCode, short messageCode, MemoryManager* const memoryManager) : DOMException(exCode, messageCode?messageCode:XMLDOMMsg::DOMRANGEEXCEPTION_ERRX+exCode-DOMRangeException::BAD_BOUNDARYPOINTS_ERR+1, memoryManager) { } DOMRangeException::DOMRangeException(const DOMRangeException &other) : DOMException(other) { } DOMRangeException::~DOMRangeException() { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/DOMLocator.hpp000644 000765 000024 00000007614 13241160337 021531 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLocator.hpp 676853 2008-07-15 09:58:05Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMLOCATOR_HPP) #define XERCESC_INCLUDE_GUARD_DOMLOCATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class DOMNode; /** * DOMLocator is an interface that describes a location. (e.g. where an error * occured). * * @see DOMError#DOMError * @since DOM Level 3 */ class CDOM_EXPORT DOMLocator { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMLocator() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMLocator(const DOMLocator &); DOMLocator & operator = (const DOMLocator &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMLocator() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMLocator interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Get the line number where the error occured, or 0 if there is * no line number available. * * @since DOM Level 3 */ virtual XMLFileLoc getLineNumber() const = 0; /** * Get the column number where the error occured, or 0 if there * is no column number available. * * @since DOM Level 3 */ virtual XMLFileLoc getColumnNumber() const = 0; /** * Get the byte offset into the input source, or ~(XMLFilePos(0)) if * there is no byte offset available. * * @since DOM Level 3 */ virtual XMLFilePos getByteOffset() const = 0; /** * Get the UTF-16 offset into the input source, or ~(XMLFilePos(0)) if * there is no UTF-16 offset available. * * @since DOM Level 3 */ virtual XMLFilePos getUtf16Offset() const = 0; /** * Get the DOMNode where the error occured, or null if there * is no node available. * * @since DOM Level 3 */ virtual DOMNode* getRelatedNode() const = 0; /** * Get the URI where the error occured, or null if there is no * URI available. * * @since DOM Level 3 */ virtual const XMLCh* getURI() const = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/000755 000765 000024 00000000000 13345765733 020026 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/dom/DOMNodeFilter.hpp000644 000765 000024 00000021522 13241160337 022153 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNodeFilter.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMNODEFILTER_HPP) #define XERCESC_INCLUDE_GUARD_DOMNODEFILTER_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Filters are objects that know how to "filter out" nodes. If a * DOMNodeIterator or DOMTreeWalker is given a * DOMNodeFilter, it applies the filter before it returns the next * node. If the filter says to accept the node, the traversal logic returns * it; otherwise, traversal looks for the next node and pretends that the * node that was rejected was not there. *

The DOM does not provide any filters. DOMNodeFilter is just an * interface that users can implement to provide their own filters. *

DOMNodeFilters do not need to know how to traverse from node * to node, nor do they need to know anything about the data structure that * is being traversed. This makes it very easy to write filters, since the * only thing they have to know how to do is evaluate a single node. One * filter may be used with a number of different kinds of traversals, * encouraging code reuse. *

See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. * @since DOM Level 2 */ class CDOM_EXPORT DOMNodeFilter { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMNodeFilter() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMNodeFilter(const DOMNodeFilter &); DOMNodeFilter & operator = (const DOMNodeFilter &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMNodeFilter() {}; //@} // ----------------------------------------------------------------------- // Class Types // ----------------------------------------------------------------------- /** @name Public Constants */ //@{ /** * Constants returned by acceptNode. * *

FILTER_ACCEPT: * Accept the node. Navigation methods defined for * DOMNodeIterator or DOMTreeWalker will return this * node.

* *

FILTER_REJECT: * Reject the node. Navigation methods defined for * DOMNodeIterator or DOMTreeWalker will not return * this node. For DOMTreeWalker, the children of this node * will also be rejected. DOMNodeIterators treat this as a * synonym for FILTER_SKIP.

* *

FILTER_SKIP: * Skip this single node. Navigation methods defined for * DOMNodeIterator or DOMTreeWalker will not return * this node. For both DOMNodeIterator and * DOMTreeWalker, the children of this node will still be * considered.

* * @since DOM Level 2 */ enum FilterAction {FILTER_ACCEPT = 1, FILTER_REJECT = 2, FILTER_SKIP = 3}; /** * Constants for whatToShow * *

SHOW_ALL: * Show all DOMNode(s).

* *

SHOW_ELEMENT: * Show DOMElement nodes.

* *

SHOW_ATTRIBUTE: * Show DOMAttr nodes. This is meaningful only when creating an * DOMNodeIterator or DOMTreeWalker with an * attribute node as its root; in this case, it means that * the attribute node will appear in the first position of the iteration * or traversal. Since attributes are never children of other nodes, * they do not appear when traversing over the document tree.

* *

SHOW_TEXT: * Show DOMText nodes.

* *

SHOW_CDATA_SECTION: * Show DOMCDATASection nodes.

* *

SHOW_ENTITY_REFERENCE: * Show DOMEntityReference nodes.

* *

SHOW_ENTITY: * Show DOMEntity nodes. This is meaningful only when creating * an DOMNodeIterator or DOMTreeWalker with an * DOMEntity node as its root; in this case, it * means that the DOMEntity node will appear in the first * position of the traversal. Since entities are not part of the * document tree, they do not appear when traversing over the document * tree.

* *

SHOW_PROCESSING_INSTRUCTION: * Show DOMProcessingInstruction nodes.

* *

SHOW_COMMENT: * Show DOMComment nodes.

* *

SHOW_DOCUMENT: * Show DOMDocument nodes.

* *

SHOW_DOCUMENT_TYPE: * Show DOMDocumentType nodes.

* *

SHOW_DOCUMENT_FRAGMENT: * Show DOMDocumentFragment nodes.

* *

SHOW_NOTATION: * Show DOMNotation nodes. This is meaningful only when creating * an DOMNodeIterator or DOMTreeWalker with a * DOMNotation node as its root; in this case, it * means that the DOMNotation node will appear in the first * position of the traversal. Since notations are not part of the * document tree, they do not appear when traversing over the document * tree.

* * @since DOM Level 2 */ enum ShowTypeMasks { SHOW_ALL = 0x0000FFFF, SHOW_ELEMENT = 0x00000001, SHOW_ATTRIBUTE = 0x00000002, SHOW_TEXT = 0x00000004, SHOW_CDATA_SECTION = 0x00000008, SHOW_ENTITY_REFERENCE = 0x00000010, SHOW_ENTITY = 0x00000020, SHOW_PROCESSING_INSTRUCTION = 0x00000040, SHOW_COMMENT = 0x00000080, SHOW_DOCUMENT = 0x00000100, SHOW_DOCUMENT_TYPE = 0x00000200, SHOW_DOCUMENT_FRAGMENT = 0x00000400, SHOW_NOTATION = 0x00000800 }; typedef unsigned long ShowType; //@} // ----------------------------------------------------------------------- // Virtual DOMNodeFilter interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 2 */ //@{ /** * Test whether a specified node is visible in the logical view of a * DOMTreeWalker or DOMNodeIterator. This function * will be called by the implementation of DOMTreeWalker and * DOMNodeIterator; it is not normally called directly from * user code. (Though you could do so if you wanted to use the same * filter to guide your own application logic.) * @param node The node to check to see if it passes the filter or not. * @return A constant to determine whether the node is accepted, * rejected, or skipped, as defined above. * @since DOM Level 2 */ virtual FilterAction acceptNode (const DOMNode* node) const =0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMDocumentRange.hpp000644 000765 000024 00000006230 13241160340 022644 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMDocumentRange.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTRANGE_HPP) #define XERCESC_INCLUDE_GUARD_DOMDOCUMENTRANGE_HPP #include XERCES_CPP_NAMESPACE_BEGIN class DOMRange; /** *

See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. * @since DOM Level 2 */ class CDOM_EXPORT DOMDocumentRange { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMDocumentRange() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMDocumentRange(const DOMDocumentRange &); DOMDocumentRange & operator = (const DOMDocumentRange &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMDocumentRange() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMDocumentRange interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 2 */ //@{ /** * To create the range consisting of boundary-points and offset of the * selected contents * * @return The initial state of the Range such that both the boundary-points * are positioned at the beginning of the corresponding DOMDOcument, before * any content. The range returned can only be used to select content * associated with this document, or with documentFragments and Attrs for * which this document is the ownerdocument * @since DOM Level 2 */ virtual DOMRange *createRange() = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMLSException.cpp000644 000765 000024 00000002706 13241160337 022313 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLSException.cpp 671894 2008-06-26 13:29:21Z borisk $ */ #include "DOMLSException.hpp" #include XERCES_CPP_NAMESPACE_BEGIN DOMLSException::DOMLSException() : DOMException() { } DOMLSException::DOMLSException(short exCode, short messageCode, MemoryManager* const memoryManager) : DOMException(exCode, messageCode?messageCode:XMLDOMMsg::DOMLSEXCEPTION_ERRX+exCode-DOMLSException::PARSE_ERR+1, memoryManager) { } DOMLSException::DOMLSException(const DOMLSException &other) : DOMException(other) { } DOMLSException::~DOMLSException() { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/DOMImplementation.hpp000644 000765 000024 00000025432 13241160337 023111 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMImplementation.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATION_HPP) #define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATION_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMDocument; class DOMDocumentType; /** * The DOMImplementation interface provides a number of methods * for performing operations that are independent of any particular instance * of the document object model. */ class CDOM_EXPORT DOMImplementation : public DOMImplementationLS { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMImplementation() {}; // no plain constructor //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMImplementation(const DOMImplementation &); // no copy constructor. DOMImplementation & operator = (const DOMImplementation &); // No Assignment //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMImplementation() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMImplementation interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 1 */ //@{ /** * Test if the DOM implementation implements a specific feature. * @param feature The name of the feature to test (case-insensitive). The * values used by DOM features are defined throughout the DOM Level 2 * specifications and listed in the section. The name must be an XML * name. To avoid possible conflicts, as a convention, names referring * to features defined outside the DOM specification should be made * unique. * @param version This is the version number of the feature to test. In * Level 2, the string can be either "2.0" or "1.0". If the version is * not specified, supporting any version of the feature causes the * method to return true. * @return true if the feature is implemented in the * specified version, false otherwise. * @since DOM Level 1 */ virtual bool hasFeature(const XMLCh *feature, const XMLCh *version) const = 0; //@} // ----------------------------------------------------------------------- // Functions introduced in DOM Level 2 // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 2 */ //@{ /** * Creates an empty DOMDocumentType node. Entity declarations * and notations are not made available. Entity reference expansions and * default attribute additions do not occur. It is expected that a * future version of the DOM will provide a way for populating a * DOMDocumentType. * @param qualifiedName The qualified name of the document type to be * created. * @param publicId The external subset public identifier. * @param systemId The external subset system identifier. * @return A new DOMDocumentType node with * ownerDocument set to null. * @exception DOMException * INVALID_CHARACTER_ERR: Raised if the specified qualified name * contains an illegal character. *
NAMESPACE_ERR: Raised if the qualifiedName is * malformed. *
NOT_SUPPORTED_ERR: May be raised by DOM implementations which do * not support the "XML" feature, if they choose not to * support this method. Other features introduced in the future, by * the DOM WG or in extensions defined by other groups, may also * demand support for this method; please consult the definition of * the feature to see if it requires this method. * @since DOM Level 2 */ virtual DOMDocumentType *createDocumentType(const XMLCh *qualifiedName, const XMLCh *publicId, const XMLCh *systemId) = 0; /** * Creates a DOMDocument object of the specified type with its document * element. * @param namespaceURI The namespace URI of the document element to * create. * @param qualifiedName The qualified name of the document element to be * created. * @param doctype The type of document to be created or null. * When doctype is not null, its * ownerDocument attribute is set to the document * being created. * @param manager Pointer to the memory manager to be used to * allocate objects. * @return A new DOMDocument object. * @exception DOMException * INVALID_CHARACTER_ERR: Raised if the specified qualified name * contains an illegal character. *
NAMESPACE_ERR: Raised if the qualifiedName is * malformed, if the qualifiedName has a prefix and the * namespaceURI is null, or if the * qualifiedName has a prefix that is "xml" and the * namespaceURI is different from " * http://www.w3.org/XML/1998/namespace" , or if the DOM * implementation does not support the "XML" feature but * a non-null namespace URI was provided, since namespaces were * defined by XML. *
WRONG_DOCUMENT_ERR: Raised if doctype has already * been used with a different document or was created from a different * implementation. *
NOT_SUPPORTED_ERR: May be raised by DOM implementations which do * not support the "XML" feature, if they choose not to support this * method. Other features introduced in the future, by the DOM WG or * in extensions defined by other groups, may also demand support for * this method; please consult the definition of the feature to see if * it requires this method. * @since DOM Level 2 */ virtual DOMDocument *createDocument(const XMLCh *namespaceURI, const XMLCh *qualifiedName, DOMDocumentType *doctype, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0; //@} // ----------------------------------------------------------------------- // Functions introduced in DOM Level 3 // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ /** * This method returns a specialized object which implements the specialized APIs * of the specified feature and version, as specified in DOM Features. * This method also allow the implementation to provide specialized objects which * do not support the DOMImplementation interface. * * @param feature The name of the feature requested (case-insensitive). * Note that any plus sign "+" prepended to the name of the feature will * be ignored since it is not significant in the context of this method. * @param version This is the version number of the feature to test. * @return Returns an object which implements the specialized APIs of the specified * feature and version, if any, or null if there is no object which implements * interfaces associated with that feature. * @since DOM Level 3 */ virtual void* getFeature(const XMLCh* feature, const XMLCh* version) const = 0; //@} // ----------------------------------------------------------------------- // Non-standard extension // ----------------------------------------------------------------------- /** @name Non-standard extension */ //@{ /** * Non-standard extension * * Create a completely empty document that has neither a root element or a doctype node. */ virtual DOMDocument *createDocument(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0; /** * Non-standard extension * * Factory method for getting a DOMImplementation object. * The DOM implementation retains ownership of the returned object. * Application code should NOT delete it. */ static DOMImplementation *getImplementation(); /** * Non-standard extension * * Load the default error text message for DOMException. * @param msgToLoad The DOM ExceptionCode id to be processed * @param toFill The buffer that will hold the output on return. The * size of this buffer should at least be 'maxChars + 1'. * @param maxChars The maximum number of output characters that can be * accepted. If the result will not fit, it is an error. * @return true if the message is successfully loaded */ static bool loadDOMExceptionMsg ( const short msgToLoad , XMLCh* const toFill , const XMLSize_t maxChars ); //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMLSSerializerFilter.hpp000644 000765 000024 00000006774 13241160337 023652 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLSSerializerFilter.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMLSSERIALIZERFILTER_HPP) #define XERCESC_INCLUDE_GUARD_DOMLSSERIALIZERFILTER_HPP /** * * DOMLSSerializerFilter.hpp: interface for the DOMLSSerializerFilter class. * * DOMLSSerializerFilter provide applications the ability to examine nodes * as they are being serialized. * * DOMLSSerializerFilter lets the application decide what nodes should be * serialized or not. * * The DOMDocument, DOMDocumentType, DOMNotation, and DOMEntity nodes are not passed * to the filter. * * @since DOM Level 3 */ #include XERCES_CPP_NAMESPACE_BEGIN class CDOM_EXPORT DOMLSSerializerFilter : public DOMNodeFilter { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMLSSerializerFilter() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMLSSerializerFilter(const DOMLSSerializerFilter &); DOMLSSerializerFilter & operator = (const DOMLSSerializerFilter &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMLSSerializerFilter() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMLSSerializerFilter interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ /** * Interface from DOMNodeFilter, * to be implemented by implementation (derived class) */ virtual FilterAction acceptNode(const DOMNode* node) const = 0; /** * Tells the DOMLSSerializer what types of nodes to show to the filter. * See DOMNodeFilter for definition of the constants. * The constant SHOW_ATTRIBUTE is meaningless here, attribute nodes will * never be passed to a DOMLSSerializerFilter. * * @return The constants of what types of nodes to show. * @since DOM Level 3 */ virtual ShowType getWhatToShow() const =0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMException.hpp000644 000765 000024 00000021615 13241160337 022061 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMException.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_DOMEXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * DOM operations only raise exceptions in "exceptional" circumstances, i.e., * when an operation is impossible to perform (either for logical reasons, * because data is lost, or because the implementation has become unstable). * In general, DOM methods return specific error values in ordinary * processing situations, such as out-of-bound errors when using * DOMNodeList. *

Implementations should raise other exceptions under other circumstances. * For example, implementations should raise an implementation-dependent * exception if a null argument is passed. *

Some languages and object systems do not support the concept of * exceptions. For such systems, error conditions may be indicated using * native error reporting mechanisms. For some bindings, for example, * methods may return error codes similar to those listed in the * corresponding method descriptions. *

See also the Document Object Model (DOM) Level 2 Core Specification. * @since DOM Level 1 */ class MemoryManager; class CDOM_EXPORT DOMException { public: // ----------------------------------------------------------------------- // Class Types // ----------------------------------------------------------------------- /** @name Public Constants */ //@{ /** * ExceptionCode * *

INDEX_SIZE_ERR: * If index or size is negative, or greater than the allowed value.

* *

DOMSTRING_SIZE_ERR: * If the specified range of text does not fit into a DOMString.

* *

HIERARCHY_REQUEST_ERR: * If any node is inserted somewhere it doesn't belong.

* *

WRONG_DOCUMENT_ERR: * If a node is used in a different document than the one that created it * (that doesn't support it).

* *

INVALID_CHARACTER_ERR: * If an invalid or illegal character is specified, such as in a name. See * production 2 in the XML specification for the definition of a legal * character, and production 5 for the definition of a legal name * character.

* *

NO_DATA_ALLOWED_ERR: * If data is specified for a node which does not support data.

* *

NO_MODIFICATION_ALLOWED_ERR: * If an attempt is made to modify an object where modifications are not * allowed.

* *

NOT_FOUND_ERR: * If an attempt is made to reference a node in a context where it does * not exist.

* *

NOT_SUPPORTED_ERR: * If the implementation does not support the requested type of object or * operation.

* *

INUSE_ATTRIBUTE_ERR: * If an attempt is made to add an attribute that is already in use * elsewhere.

* * The above are since DOM Level 1 * @since DOM Level 1 * *

INVALID_STATE_ERR: * If an attempt is made to use an object that is not, or is no longer, * usable.

* *

SYNTAX_ERR: * If an invalid or illegal string is specified.

* *

INVALID_MODIFICATION_ERR: * If an attempt is made to modify the type of the underlying object.

* *

NAMESPACE_ERR: * If an attempt is made to create or change an object in a way which is * incorrect with regard to namespaces.

* *

INVALID_ACCESS_ERR: * If a parameter or an operation is not supported by the underlying * object. * * The above are since DOM Level 2 * @since DOM Level 2 * *

VALIDATION_ERR: * If a call to a method such as insertBefore or * removeChild would make the Node invalid * with respect to "partial validity", this exception would be raised * and the operation would not be done. * *

TYPE_MISMATCH_ERR: * If the type of an object is incompatible with the expected type of * the parameter associated to the object, this exception would be raised. * * The above is since DOM Level 3 * @since DOM Level 3 */ enum ExceptionCode { INDEX_SIZE_ERR = 1, DOMSTRING_SIZE_ERR = 2, HIERARCHY_REQUEST_ERR = 3, WRONG_DOCUMENT_ERR = 4, INVALID_CHARACTER_ERR = 5, NO_DATA_ALLOWED_ERR = 6, NO_MODIFICATION_ALLOWED_ERR = 7, NOT_FOUND_ERR = 8, NOT_SUPPORTED_ERR = 9, INUSE_ATTRIBUTE_ERR = 10, INVALID_STATE_ERR = 11, SYNTAX_ERR = 12, INVALID_MODIFICATION_ERR = 13, NAMESPACE_ERR = 14, INVALID_ACCESS_ERR = 15, VALIDATION_ERR = 16, TYPE_MISMATCH_ERR = 17 }; //@} public: // ----------------------------------------------------------------------- // Constructors // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * Default constructor for DOMException. * */ DOMException(); /** * Constructor which takes an error code and an optional message code. * * @param code The error code which indicates the exception * @param messageCode The string containing the error message * @param memoryManager The memory manager used to (de)allocate memory */ DOMException(short code, short messageCode = 0, MemoryManager* const memoryManager = XMLPlatformUtils::fgMemoryManager); /** * Copy constructor. * * @param other The object to be copied. */ DOMException(const DOMException &other); //@} // ----------------------------------------------------------------------- // Destructors // ----------------------------------------------------------------------- /** @name Destructor. */ //@{ /** * Destructor for DOMException. * */ virtual ~DOMException(); //@} public: // ----------------------------------------------------------------------- // Getter // ----------------------------------------------------------------------- inline const XMLCh* getMessage() const; // ----------------------------------------------------------------------- // Class Types // ----------------------------------------------------------------------- /** @name Public variables */ //@{ /** * A code value, from the set defined by the ExceptionCode enum, * indicating the type of error that occured. */ short code; /** * A string value. Applications may use this field to hold an error * message. The field value is not set by the DOM implementation, * meaning that the string will be empty when an exception is first * thrown. */ const XMLCh *msg; //@} protected: MemoryManager* fMemoryManager; private: /** * A boolean value. * If the message is provided by the applications, it is not * adopted. * If the message is resolved by the DOM implementation, it is * owned. */ bool fMsgOwned; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMException & operator = (const DOMException &); }; inline const XMLCh* DOMException::getMessage() const { return msg; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMCharacterData.hpp000644 000765 000024 00000021470 13241160337 022610 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMCharacterData.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMCHARACTERDATA_HPP) #define XERCESC_INCLUDE_GUARD_DOMCHARACTERDATA_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * The DOMCharacterData interface extends DOMNode with a set of * attributes and methods for accessing character data in the DOM. For * clarity this set is defined here rather than on each object that uses * these attributes and methods. No DOM objects correspond directly to * DOMCharacterData, though DOMText and others do * inherit the interface from it. All offsets in this interface * start from 0. *

As explained in the DOM spec, text strings in * the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units. In * the following, the term 16-bit units is used whenever necessary to * indicate that indexing on DOMCharacterData is done in 16-bit units. *

See also the Document Object Model (DOM) Level 2 Core Specification. * @since DOM Level 1 */ class CDOM_EXPORT DOMCharacterData: public DOMNode { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMCharacterData() {} DOMCharacterData(const DOMCharacterData &other) : DOMNode(other) {} //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented operators */ //@{ DOMCharacterData & operator = (const DOMCharacterData &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMCharacterData() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMCharacterData interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 1 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Returns the character data of the node that implements this interface. * * The DOM implementation may not put arbitrary limits on the amount of data that * may be stored in a DOMCharacterData node. However, * implementation limits may mean that the entirety of a node's data may * not fit into a single XMLCh* String. In such cases, the user * may call substringData to retrieve the data in * appropriately sized pieces. * @exception DOMException * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * @since DOM Level 1 */ virtual const XMLCh * getData() const = 0; /** * Returns the number of characters that are available through data and * the substringData method below. * * This may have the value * zero, i.e., CharacterData nodes may be empty. * @since DOM Level 1 */ virtual XMLSize_t getLength() const = 0; /** * Extracts a range of data from the node. * * @param offset Start offset of substring to extract. * @param count The number of characters to extract. * @return The specified substring. If the sum of offset and * count exceeds the length, then all * characters to the end of the data are returned. * @exception DOMException * INDEX_SIZE_ERR: Raised if the specified offset is negative or greater * than the number of characters in data, or if the * specified count is negative. * @since DOM Level 1 */ virtual const XMLCh * substringData(XMLSize_t offset, XMLSize_t count) const = 0; // ----------------------------------------------------------------------- // String methods // ----------------------------------------------------------------------- /** * Append the string to the end of the character data of the node. * * Upon success, data provides access to the concatenation of * data and the XMLCh* String specified. * @param arg The XMLCh* String to append. * @exception DOMException * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. * @since DOM Level 1 */ virtual void appendData(const XMLCh *arg) = 0; /** * Insert a string at the specified character offset. * * @param offset The character offset at which to insert. * @param arg The XMLCh* String to insert. * @exception DOMException * INDEX_SIZE_ERR: Raised if the specified offset is negative or greater * than the number of characters in data. *
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. * @since DOM Level 1 */ virtual void insertData(XMLSize_t offset, const XMLCh *arg) = 0; /** * Remove a range of characters from the node. * * Upon success, * data and length reflect the change. * @param offset The offset from which to remove characters. * @param count The number of characters to delete. If the sum of * offset and count exceeds length * then all characters from offset to the end of the data * are deleted. * @exception DOMException * INDEX_SIZE_ERR: Raised if the specified offset is negative or greater * than the number of characters in data, or if the * specified count is negative. *
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. * @since DOM Level 1 */ virtual void deleteData(XMLSize_t offset, XMLSize_t count) = 0; /** * Replace the characters starting at the specified character offset with * the specified string. * * @param offset The offset from which to start replacing. * @param count The number of characters to replace. If the sum of * offset and count exceeds length * , then all characters to the end of the data are replaced (i.e., the * effect is the same as a remove method call with the same * range, followed by an append method invocation). * @param arg The XMLCh* String with which the range must be * replaced. * @exception DOMException * INDEX_SIZE_ERR: Raised if the specified offset is negative or greater * than the number of characters in data, or if the * specified count is negative. *
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. * @since DOM Level 1 */ virtual void replaceData(XMLSize_t offset, XMLSize_t count, const XMLCh *arg) = 0; /** * Sets the character data of the node that implements this interface. * * @param data The XMLCh* String to set. * @since DOM Level 1 */ virtual void setData(const XMLCh *data) = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMErrorHandler.hpp000644 000765 000024 00000007261 13241160337 022513 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMErrorHandler.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMERRORHANDLER_HPP) #define XERCESC_INCLUDE_GUARD_DOMERRORHANDLER_HPP #include XERCES_CPP_NAMESPACE_BEGIN class DOMError; /** * Basic interface for DOM error handlers. * *

DOMErrorHandler is a callback interface that the DOM implementation * can call when reporting errors that happens while processing XML data, or * when doing some other processing (e.g. validating a document).

* *

The application that is using the DOM implementation is expected to * implement this interface.

* * @see DOMLSParser#getDomConfig * @since DOM Level 3 */ class CDOM_EXPORT DOMErrorHandler { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMErrorHandler() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMErrorHandler(const DOMErrorHandler &); DOMErrorHandler & operator = (const DOMErrorHandler &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMErrorHandler() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMErrorHandler interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ /** * This method is called on the error handler when an error occurs. * If an exception is thrown from this method, it is considered to be equivalent of returning true. * * @param domError The error object that describes the error, this object * may be reused by the DOM implementation across multiple * calls to the handleError method. * @return If the handleError method returns true the DOM * implementation should continue as if the error didn't happen * when possible, if the method returns false then the * DOM implementation should stop the current processing when * possible. * * @since DOM Level 3 */ virtual bool handleError(const DOMError& domError) = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMLSResourceResolver.hpp000644 000765 000024 00000014615 13241160337 023675 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLSResourceResolver.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMLSRESOURCERESOLVER_HPP) #define XERCESC_INCLUDE_GUARD_DOMLSRESOURCERESOLVER_HPP #include XERCES_CPP_NAMESPACE_BEGIN class DOMLSInput; /** * DOMLSResourceResolver provides a way for applications to redirect references * to external entities. * *

Applications needing to implement customized handling for external * entities must implement this interface and register their implementation * by setting the entityResolver attribute of the DOMLSParser.

* *

The DOMLSParser will then allow the application to intercept any * external entities (including the external DTD subset and external parameter * entities) before including them.

* *

Many DOM applications will not need to implement this interface, but it * will be especially useful for applications that build XML documents from * databases or other specialized input sources, or for applications that use * URNs.

* * @see DOMLSParser#getDomConfig * @see DOMLSInput#DOMLSInput * @since DOM Level 3 */ class CDOM_EXPORT DOMLSResourceResolver { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMLSResourceResolver() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMLSResourceResolver(const DOMLSResourceResolver &); DOMLSResourceResolver & operator = (const DOMLSResourceResolver &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMLSResourceResolver() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMLSResourceResolver interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ /** * Allow the application to resolve external resources. * * The DOMLSParser will call this method before opening any external resource, * including the external DTD subset, external entities referenced within the DTD, and * external entities referenced within the document element (however, the top-level * document entity is not passed to this method). The application may then request that * the DOMLSParser resolve the external resource itself, that it use an * alternative URI, or that it use an entirely different input source. * * Application writers can use this method to redirect external system identifiers to * secure and/or local URI, to look up public identifiers in a catalogue, or to read * an entity from a database or other input source (including, for example, a dialog box). * * The returned DOMLSInput is owned by the DOMLSParser which is * responsible to clean up the memory. * * @param resourceType The type of the resource being resolved. For XML [XML 1.0] resources * (i.e. entities), applications must use the value "http://www.w3.org/TR/REC-xml". * For XML Schema [XML Schema Part 1], applications must use the value * "http://www.w3.org/2001/XMLSchema". Other types of resources are outside * the scope of this specification and therefore should recommend an absolute * URI in order to use this method. * @param namespaceUri The namespace of the resource being resolved, e.g. the target namespace * of the XML Schema [XML Schema Part 1] when resolving XML Schema resources. * @param publicId The public identifier of the external entity being referenced, or null * if no public identifier was supplied or if the resource is not an entity. * @param systemId The system identifier, a URI reference [IETF RFC 2396], of the external * resource being referenced, or null if no system identifier was supplied. * @param baseURI The absolute base URI of the resource being parsed, or null if * there is no base URI. * @return A DOMLSInput object describing the new input source, * or null to request that the parser open a regular * URI connection to the resource. * The returned DOMLSInput is owned by the DOMLSParser which is * responsible to clean up the memory. * @see DOMLSInput#DOMLSInput * @since DOM Level 3 */ virtual DOMLSInput* resolveResource( const XMLCh* const resourceType , const XMLCh* const namespaceUri , const XMLCh* const publicId , const XMLCh* const systemId , const XMLCh* const baseURI) = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMMemoryManager.hpp000644 000765 000024 00000012605 13241160337 022665 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(XERCESC_INCLUDE_GUARD_DOMMEMORYMANAGER_HPP) #define XERCESC_INCLUDE_GUARD_DOMMEMORYMANAGER_HPP //------------------------------------------------------------------------------------ // Includes //------------------------------------------------------------------------------------ XERCES_CPP_NAMESPACE_BEGIN /** * The DOMMemoryManager interface exposes the memory allocation-related * functionalities of a DOMDocument */ class CDOM_EXPORT DOMMemoryManager { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMMemoryManager() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMMemoryManager(const DOMMemoryManager &); DOMMemoryManager & operator = (const DOMMemoryManager &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMMemoryManager() {}; //@} // ----------------------------------------------------------------------- // data types // ----------------------------------------------------------------------- enum NodeObjectType { ATTR_OBJECT = 0, ATTR_NS_OBJECT = 1, CDATA_SECTION_OBJECT = 2, COMMENT_OBJECT = 3, DOCUMENT_FRAGMENT_OBJECT = 4, DOCUMENT_TYPE_OBJECT = 5, ELEMENT_OBJECT = 6, ELEMENT_NS_OBJECT = 7, ENTITY_OBJECT = 8, ENTITY_REFERENCE_OBJECT = 9, NOTATION_OBJECT = 10, PROCESSING_INSTRUCTION_OBJECT = 11, TEXT_OBJECT = 12 }; //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Returns the size of the chunks of memory allocated by the memory manager * * @return the dimension of the chunks of memory allocated by the memory manager */ virtual XMLSize_t getMemoryAllocationBlockSize() const = 0; //@} //@{ // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** * Set the size of the chunks of memory allocated by the memory manager * * @param size the new size of the chunks; it must be greater than 4KB */ virtual void setMemoryAllocationBlockSize(XMLSize_t size) = 0; //@} //@{ // ----------------------------------------------------------------------- // Operations // ----------------------------------------------------------------------- /** * Allocate a memory block of the requested size from the managed pool * * @param amount the size of the new memory block * * @return the pointer to the newly allocated block */ virtual void* allocate(XMLSize_t amount) = 0; /** * Allocate a memory block of the requested size from the managed pool of DOM objects * * @param amount the size of the new memory block * @param type the type of the DOM object that will be stored in the block * * @return the pointer to the newly allocated block */ virtual void* allocate(XMLSize_t amount, DOMMemoryManager::NodeObjectType type) = 0; /** * Release a DOM object and place its memory back in the pool * * @param object the pointer to the DOM node * @param type the type of the DOM object */ virtual void release(DOMNode* object, DOMMemoryManager::NodeObjectType type) = 0; /** * Allocate a memory block from the mnaged pool and copy the provided string * * @param src the string to be copied * * @return the pointer to the newly allocated block */ virtual XMLCh* cloneString(const XMLCh *src) = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif /** * End of file DOMMemoryManager.hpp */ xerces-c-3.2.2/src/xercesc/dom/DOMRange.hpp000644 000765 000024 00000052120 13241160337 021152 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMRange.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMRANGE_HPP) #define XERCESC_INCLUDE_GUARD_DOMRANGE_HPP #include XERCES_CPP_NAMESPACE_BEGIN class DOMNode; class DOMDocumentFragment; /** *

See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. * @since DOM Level 2 */ class CDOM_EXPORT DOMRange { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMRange() {} DOMRange(const DOMRange &) {} //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented operators */ //@{ DOMRange & operator = (const DOMRange &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMRange() {}; //@} // ----------------------------------------------------------------------- // Class Types // ----------------------------------------------------------------------- /** @name Public Constants */ //@{ /** * Constants CompareHow. * *

START_TO_START: * Compare start boundary-point of sourceRange to start * boundary-point of Range on which compareBoundaryPoints * is invoked.

* *

START_TO_END: * Compare start boundary-point of sourceRange to end * boundary-point of Range on which compareBoundaryPoints * is invoked.

* *

END_TO_END: * Compare end boundary-point of sourceRange to end * boundary-point of Range on which compareBoundaryPoints * is invoked.

* *

END_TO_START: * Compare end boundary-point of sourceRange to start * boundary-point of Range on which compareBoundaryPoints * is invoked.

* * @since DOM Level 2 */ enum CompareHow { START_TO_START = 0, START_TO_END = 1, END_TO_END = 2, END_TO_START = 3 }; //@} // ----------------------------------------------------------------------- // Virtual DOMRange interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 2 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * DOMNode within which the Range begins * @exception DOMException * INVALID_STATE_ERR: Raised if detach() has already been * invoked on this object. * * @since DOM Level 2 */ virtual DOMNode* getStartContainer() const = 0; /** * Offset within the starting node of the Range. * @exception DOMException * INVALID_STATE_ERR: Raised if detach() has already been * invoked on this object. * * @since DOM Level 2 */ virtual XMLSize_t getStartOffset() const = 0; /** * DOMNode within which the Range ends * @exception DOMException * INVALID_STATE_ERR: Raised if detach() has already been * invoked on this object. * * @since DOM Level 2 */ virtual DOMNode* getEndContainer() const = 0; /** * Offset within the ending node of the Range. * @exception DOMException * INVALID_STATE_ERR: Raised if detach() has already been * invoked on this object. * * @since DOM Level 2 */ virtual XMLSize_t getEndOffset() const = 0; /** * TRUE if the Range is collapsed * @exception DOMException * INVALID_STATE_ERR: Raised if detach() has already been * invoked on this object. * * @since DOM Level 2 */ virtual bool getCollapsed() const = 0; /** * The deepest common ancestor container of the Range's two * boundary-points. * @exception DOMException * INVALID_STATE_ERR: Raised if detach() has already been * invoked on this object. * * @since DOM Level 2 */ virtual const DOMNode* getCommonAncestorContainer() const = 0; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** * Sets the attributes describing the start of the Range. * @param refNode The refNode value. This parameter must be * different from null. * @param offset The startOffset value. * @exception DOMRangeException * INVALID_NODE_TYPE_ERR: Raised if refNode or an ancestor * of refNode is an DOMEntity, DOMNotation, or DOMDocumentType * node. * @exception DOMException * INDEX_SIZE_ERR: Raised if offset is negative or greater * than the number of child units in refNode. Child units * are 16-bit units if refNode is a type of DOMCharacterData * node (e.g., a DOMText or DOMComment node) or a DOMProcessingInstruction * node. Child units are Nodes in all other cases. *
INVALID_STATE_ERR: Raised if detach() has already * been invoked on this object. *
WRONG_DOCUMENT_ERR: Raised if refNode was created * from a different document than the one that created this range. * * @since DOM Level 2 */ virtual void setStart(const DOMNode *refNode, XMLSize_t offset) = 0; /** * Sets the attributes describing the end of a Range. * @param refNode The refNode value. This parameter must be * different from null. * @param offset The endOffset value. * @exception DOMRangeException * INVALID_NODE_TYPE_ERR: Raised if refNode or an ancestor * of refNode is an DOMEntity, DOMNotation, or DOMDocumentType * node. * @exception DOMException * INDEX_SIZE_ERR: Raised if offset is negative or greater * than the number of child units in refNode. Child units * are 16-bit units if refNode is a type of DOMCharacterData * node (e.g., a DOMText or DOMComment node) or a DOMProcessingInstruction * node. Child units are Nodes in all other cases. *
INVALID_STATE_ERR: Raised if detach() has already * been invoked on this object. *
WRONG_DOCUMENT_ERR: Raised if refNode was created * from a different document than the one that created this range. * * @since DOM Level 2 */ virtual void setEnd(const DOMNode *refNode, XMLSize_t offset) = 0; /** * Sets the start position to be before a node * @param refNode Range starts before refNode * @exception DOMRangeException * INVALID_NODE_TYPE_ERR: Raised if the root container of * refNode is not an DOMAttr, DOMDocument, or DOMDocumentFragment * node or if refNode is a DOMDocument, DOMDocumentFragment, * DOMAttr, DOMEntity, or DOMNotation node. * @exception DOMException * INVALID_STATE_ERR: Raised if detach() has already been * invoked on this object. *
WRONG_DOCUMENT_ERR: Raised if refNode was created * from a different document than the one that created this range. * * @since DOM Level 2 */ virtual void setStartBefore(const DOMNode *refNode) = 0; /** * Sets the start position to be after a node * @param refNode Range starts after refNode * @exception DOMRangeException * INVALID_NODE_TYPE_ERR: Raised if the root container of * refNode is not an DOMAttr, DOMDocument, or DOMDocumentFragment * node or if refNode is a DOMDocument, DOMDocumentFragment, * DOMAttr, DOMEntity, or DOMNotation node. * @exception DOMException * INVALID_STATE_ERR: Raised if detach() has already been * invoked on this object. *
WRONG_DOCUMENT_ERR: Raised if refNode was created * from a different document than the one that created this range. * * @since DOM Level 2 */ virtual void setStartAfter(const DOMNode *refNode) = 0; /** * Sets the end position to be before a node. * @param refNode Range ends before refNode * @exception DOMRangeException * INVALID_NODE_TYPE_ERR: Raised if the root container of * refNode is not an DOMAttr, DOMDocument, or DOMDocumentFragment * node or if refNode is a DOMDocument, DOMDocumentFragment, * DOMAttr, DOMEntity, or DOMNotation node. * @exception DOMException * INVALID_STATE_ERR: Raised if detach() has already been * invoked on this object. *
WRONG_DOCUMENT_ERR: Raised if refNode was created * from a different document than the one that created this range. * * @since DOM Level 2 */ virtual void setEndBefore(const DOMNode *refNode) = 0; /** * Sets the end of a Range to be after a node * @param refNode Range ends after refNode. * @exception DOMRangeException * INVALID_NODE_TYPE_ERR: Raised if the root container of * refNode is not a DOMAttr, DOMDocument or DOMDocumentFragment * node or if refNode is a DOMDocument, DOMDocumentFragment, * DOMAttr, DOMEntity, or DOMNotation node. * @exception DOMException * INVALID_STATE_ERR: Raised if detach() has already been * invoked on this object. *
WRONG_DOCUMENT_ERR: Raised if refNode was created * from a different document than the one that created this range. * * @since DOM Level 2 */ virtual void setEndAfter(const DOMNode *refNode) = 0; // ----------------------------------------------------------------------- // Misc methods // ----------------------------------------------------------------------- /** * Collapse a Range onto one of its boundary-points * @param toStart If TRUE, collapses the Range onto its start; if FALSE, * collapses it onto its end. * @exception DOMException * INVALID_STATE_ERR: Raised if detach() has already been * invoked on this object. * * @since DOM Level 2 */ virtual void collapse(bool toStart) = 0; /** * Select a node and its contents * @param refNode The node to select. * @exception DOMRangeException * INVALID_NODE_TYPE_ERR: Raised if an ancestor of refNode * is an DOMEntity, DOMNotation or DOMDocumentType node or if * refNode is a DOMDocument, DOMDocumentFragment, DOMAttr, DOMEntity, * or DOMNotation node. * @exception DOMException * INVALID_STATE_ERR: Raised if detach() has already been * invoked on this object. *
WRONG_DOCUMENT_ERR: Raised if refNode was created * from a different document than the one that created this range. * * @since DOM Level 2 */ virtual void selectNode(const DOMNode *refNode) = 0; /** * Select the contents within a node * @param refNode DOMNode to select from * @exception DOMRangeException * INVALID_NODE_TYPE_ERR: Raised if refNode or an ancestor * of refNode is an DOMEntity, DOMNotation or DOMDocumentType node. * @exception DOMException * INVALID_STATE_ERR: Raised if detach() has already been * invoked on this object. *
WRONG_DOCUMENT_ERR: Raised if refNode was created * from a different document than the one that created this range. * * @since DOM Level 2 */ virtual void selectNodeContents(const DOMNode *refNode) = 0; /** * Compare the boundary-points of two Ranges in a document. * @param how A code representing the type of comparison, as defined * above. * @param sourceRange The Range on which this current * Range is compared to. * @return -1, 0 or 1 depending on whether the corresponding * boundary-point of the Range is respectively before, equal to, or * after the corresponding boundary-point of sourceRange. * @exception DOMException * WRONG_DOCUMENT_ERR: Raised if the two Ranges are not in the same * DOMDocument or DOMDocumentFragment. *
INVALID_STATE_ERR: Raised if detach() has already * been invoked on this object. * * @since DOM Level 2 */ virtual short compareBoundaryPoints(CompareHow how, const DOMRange* sourceRange) const = 0; /** * Removes the contents of a Range from the containing document or * document fragment without returning a reference to the removed * content. * @exception DOMException * NO_MODIFICATION_ALLOWED_ERR: Raised if any portion of the content of * the Range is read-only or any of the nodes that contain any of the * content of the Range are read-only. *
INVALID_STATE_ERR: Raised if detach() has already * been invoked on this object. * * @since DOM Level 2 */ virtual void deleteContents() = 0; /** * Moves the contents of a Range from the containing document or document * fragment to a new DOMDocumentFragment. * @return A DOMDocumentFragment containing the extracted contents. * @exception DOMException * NO_MODIFICATION_ALLOWED_ERR: Raised if any portion of the content of * the Range is read-only or any of the nodes which contain any of the * content of the Range are read-only. *
HIERARCHY_REQUEST_ERR: Raised if a DOMDocumentType node would be * extracted into the new DOMDocumentFragment. *
INVALID_STATE_ERR: Raised if detach() has already * been invoked on this object. * * @since DOM Level 2 */ virtual DOMDocumentFragment* extractContents() = 0; /** * Duplicates the contents of a Range * @return A DOMDocumentFragment that contains content equivalent to this * Range. * @exception DOMException * HIERARCHY_REQUEST_ERR: Raised if a DOMDocumentType node would be * extracted into the new DOMDocumentFragment. *
INVALID_STATE_ERR: Raised if detach() has already * been invoked on this object. * * @since DOM Level 2 */ virtual DOMDocumentFragment* cloneContents() const = 0; /** * Inserts a node into the DOMDocument or DOMDocumentFragment at the start of * the Range. If the container is a DOMText node, this will be split at the * start of the Range (as if the DOMText node's splitText method was * performed at the insertion point) and the insertion will occur * between the two resulting DOMText nodes. Adjacent DOMText nodes will not be * automatically merged. If the node to be inserted is a * DOMDocumentFragment node, the children will be inserted rather than the * DOMDocumentFragment node itself. * @param newNode The node to insert at the start of the Range * @exception DOMException * NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor container of the * start of the Range is read-only. *
WRONG_DOCUMENT_ERR: Raised if newNode and the * container of the start of the Range were not created from the same * document. *
HIERARCHY_REQUEST_ERR: Raised if the container of the start of * the Range is of a type that does not allow children of the type of * newNode or if newNode is an ancestor of * the container. *
INVALID_STATE_ERR: Raised if detach() has already * been invoked on this object. * @exception DOMRangeException * INVALID_NODE_TYPE_ERR: Raised if newNode is an DOMAttr, * DOMEntity, DOMNotation, or DOMDocument node. * * @since DOM Level 2 */ virtual void insertNode(DOMNode *newNode) = 0; /** * Reparents the contents of the Range to the given node and inserts the * node at the position of the start of the Range. * @param newParent The node to surround the contents with. * @exception DOMException * NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor container of * either boundary-point of the Range is read-only. *
WRONG_DOCUMENT_ERR: Raised if newParent and the * container of the start of the Range were not created from the same * document. *
HIERARCHY_REQUEST_ERR: Raised if the container of the start of * the Range is of a type that does not allow children of the type of * newParent or if newParent is an ancestor * of the container or if node would end up with a child * node of a type not allowed by the type of node. *
INVALID_STATE_ERR: Raised if detach() has already * been invoked on this object. * @exception DOMRangeException * BAD_BOUNDARYPOINTS_ERR: Raised if the Range partially selects a * non-text node. *
INVALID_NODE_TYPE_ERR: Raised if node is an DOMAttr, * DOMEntity, DOMDocumentType, DOMNotation, DOMDocument, or DOMDocumentFragment node. * * @since DOM Level 2 */ virtual void surroundContents(DOMNode *newParent) = 0; /** * Produces a new Range whose boundary-points are equal to the * boundary-points of the Range. * @return The duplicated Range. * @exception DOMException * INVALID_STATE_ERR: Raised if detach() has already been * invoked on this object. * * @since DOM Level 2 */ virtual DOMRange* cloneRange() const = 0; /** * Returns the contents of a Range as a string. This string contains only * the data characters, not any markup. * @return The contents of the Range. * @exception DOMException * INVALID_STATE_ERR: Raised if detach() has already been * invoked on this object. * * @since DOM Level 2 */ virtual const XMLCh* toString() const = 0; /** * Called to indicate that the Range is no longer in use and that the * implementation may relinquish any resources associated with this * Range. Subsequent calls to any methods or attribute getters on this * Range will result in a DOMException being thrown with an * error code of INVALID_STATE_ERR. * @exception DOMException * INVALID_STATE_ERR: Raised if detach() has already been * invoked on this object. * * @since DOM Level 2 */ virtual void detach() = 0; //@} // ----------------------------------------------------------------------- // Non-standard Extension // ----------------------------------------------------------------------- /** @name Non-standard Extension */ //@{ /** * Called to indicate that this Range is no longer in use * and that the implementation may relinquish any resources associated with it. * (release() will call detach() where appropriate) * * Access to a released object will lead to unexpected result. */ virtual void release() = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMImplementationRegistry.hpp000644 000765 000024 00000007262 13241160337 024643 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMImplementationRegistry.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONREGISTRY_HPP) #define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONREGISTRY_HPP /** * This class holds the list of registered DOMImplementations. Implementation * or application can register DOMImplementationSource to the registry, and * then can query DOMImplementation based on a list of requested features. * *

This provides an application with an implementation independent starting * point. * * @see DOMImplementation * @see DOMImplementationList * @see DOMImplementationSource * @since DOM Level 3 */ #include XERCES_CPP_NAMESPACE_BEGIN class DOMImplementation; class DOMImplementationSource; class DOMImplementationList; class CDOM_EXPORT DOMImplementationRegistry { public: // ----------------------------------------------------------------------- // Static DOMImplementationRegistry interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ /** * Return the first registered implementation that has the desired features, * or null if none is found. * * @param features A string that specifies which features are required. * This is a space separated list in which each feature is * specified by its name optionally followed by a space * and a version number. * This is something like: "XML 1.0 Traversal 2.0" * @return An implementation that has the desired features, or * null if this source has none. * @since DOM Level 3 */ static DOMImplementation* getDOMImplementation(const XMLCh* features); /** * Return the list of registered implementation that have the desired features. * * @param features A string that specifies which features are required. * This is a space separated list in which each feature is * specified by its name optionally followed by a space * and a version number. * This is something like: "XML 1.0 Traversal 2.0" * @return A DOMImplementationList object that contains the DOMImplementation * that have the desired features * @since DOM Level 3 */ static DOMImplementationList* getDOMImplementationList(const XMLCh* features); /** * Register an implementation. * * @param source A DOMImplementation Source object to be added to the registry. * The registry does NOT adopt the source object. Users still own it. * @since DOM Level 3 */ static void addSource(DOMImplementationSource* source); //@} private: DOMImplementationRegistry(); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMUserDataHandler.hpp000644 000765 000024 00000011363 13241160337 023130 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMUserDataHandler.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMUSERDATAHANDLER_HPP) #define XERCESC_INCLUDE_GUARD_DOMUSERDATAHANDLER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * When associating an object to a key on a node using setUserData * the application can provide a handler that gets called when the node the * object is associated to is being cloned or imported. This can be used by * the application to implement various behaviors regarding the data it * associates to the DOM nodes. This interface defines that handler. * *

See also the Document Object Model (DOM) Level 3 Core Specification. * @since DOM Level 3 */ class CDOM_EXPORT DOMUserDataHandler { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMUserDataHandler() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMUserDataHandler(const DOMUserDataHandler &); DOMUserDataHandler & operator = (const DOMUserDataHandler &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMUserDataHandler() {}; //@} // ----------------------------------------------------------------------- // Class Types // ----------------------------------------------------------------------- /** @name Public Constants */ //@{ /** * Operation Type * *

NODE_CLONED: * The node is cloned.

* *

NODE_IMPORTED * The node is imported.

* *

NODE_DELETED * The node is deleted.

* *

NODE_RENAMED * The node is renamed. * *

NODE_ADOPTED * The node is adopted. * * @since DOM Level 3 */ enum DOMOperationType { NODE_CLONED = 1, NODE_IMPORTED = 2, NODE_DELETED = 3, NODE_RENAMED = 4, NODE_ADOPTED = 5 }; //@} // ----------------------------------------------------------------------- // Virtual DOMUserDataHandler interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ /** * This method is called whenever the node for which this handler is * registered is imported or cloned. * * @param operation Specifies the type of operation that is being * performed on the node. * @param key Specifies the key for which this handler is being called. * @param data Specifies the data for which this handler is being called. * @param src Specifies the node being cloned, adopted, imported, or renamed. * This is null when the node is being deleted. * @param dst Specifies the node newly created if any, or null. * * @since DOM Level 3 */ virtual void handle(DOMOperationType operation, const XMLCh* const key, void* data, const DOMNode* src, DOMNode* dst) = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMConfiguration.hpp000644 000765 000024 00000045007 13241160337 022733 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(XERCESC_INCLUDE_GUARD_DOMCONFIGURATION_HPP) #define XERCESC_INCLUDE_GUARD_DOMCONFIGURATION_HPP //------------------------------------------------------------------------------------ // Includes //------------------------------------------------------------------------------------ #include #include #include XERCES_CPP_NAMESPACE_BEGIN /** * The DOMConfiguration interface represents the configuration of * a document and maintains a table of recognized parameters. * Using the configuration, it is possible to change * Document.normalizeDocument behavior, such as replacing * CDATASection nodes with Text nodes or * specifying the type of the schema that must be used when the * validation of the Document is requested. DOMConfiguration * objects are also used in [DOM Level 3 Load and Save] in * the DOMLSParser and DOMLSSerializer interfaces. * * The DOMConfiguration distinguish two types of parameters: * boolean (boolean parameters) and DOMUserData * (parameters). The names used by the DOMConfiguration object are * defined throughout the DOM Level 3 specifications. Names are * case-insensitive. To avoid possible conflicts, as a * convention, names referring to boolean parameters and * parameters defined outside the DOM specification should be made * unique. Names are recommended to follow the XML name * production rule but it is not enforced by the DOM * implementation. DOM Level 3 Core Implementations are required * to recognize all boolean parameters and parameters defined in * this specification. Each boolean parameter state or parameter * value may then be supported or not by the implementation. Refer * to their definition to know if a state or a value must be * supported or not. * * Note: Parameters are similar to features and properties used in * SAX2 [SAX]. * * The following list of parameters defined in the DOM: * * "error-handler" * [required] * A DOMErrorHandler object. If an error is * encountered in the document, the implementation will call * back the DOMErrorHandler registered using this * parameter. * When called, DOMError.relatedData will contain the * closest node to where the error occured. If the * implementation is unable to determine the node where the * error occurs, DOMError.relatedData will contain the * Document node. Mutations to the document from * within an error handler will result in implementation * dependent behaviour. * * "schema-type" * [optional] * A DOMString object containing an absolute URI and * representing the type of the schema language used to * validate a document against. Note that no lexical * checking is done on the absolute URI. * If this parameter is not set, a default value may be * provided by the implementation, based on the schema * languages supported and on the schema language used at * load time. * * Note: For XML Schema [XML Schema Part 1], * applications must use the value * "http://www.w3.org/2001/XMLSchema". For XML DTD * [XML 1.0], applications must use the value * "http://www.w3.org/TR/REC-xml". Other schema languages * are outside the scope of the W3C and therefore should * recommend an absolute URI in order to use this method. * * "schema-location" * [optional] * A DOMString object containing a list of URIs, * separated by white spaces (characters matching the * nonterminal production S defined in section 2.3 * [XML 1.0]), that represents the schemas against * which validation should occur. The types of schemas * referenced in this list must match the type specified * with schema-type, otherwise the behaviour of an * implementation is undefined. If the schema type is XML * Schema [XML Schema Part 1], only one of the XML * Schemas in the list can be with no namespace. * If validation occurs against a namespace aware schema, * i.e. XML Schema, and the targetNamespace of a schema * (specified using this property) matches the * targetNamespace of a schema occurring in the instance * document, i.e in schemaLocation attribute, the schema * specified by the user using this property will be used * (i.e., in XML Schema the schemaLocation attribute in the * instance document or on the import element will be * effectively ignored). * * Note: It is illegal to set the schema-location parameter * if the schema-type parameter value is not set. It is * strongly recommended that DOMInputSource.baseURI will be * set, so that an implementation can successfully resolve * any external entities referenced. * * The following list of boolean parameters (features) defined in * the DOM: * * "canonical-form" * * true * [optional] * Canonicalize the document according to the rules * specified in [Canonical XML]. Note that this * is limited to what can be represented in the DOM. * In particular, there is no way to specify the order * of the attributes in the DOM. * * false * [required] (default) * Do not canonicalize the document. * * "cdata-sections" * * true * [required] (default) * Keep CDATASection nodes in the document. * * false * [required] * Transform CDATASection nodes in the document * into Text nodes. The new Text node is * then combined with any adjacent Text node. * * "comments" * * true * [required] (default) * Keep Comment nodes in the document. * * false * [required] * Discard Comment nodes in the Document. * * "datatype-normalization" * * true * [required] * Exposed normalized values in the tree. * * false * [required] (default) * Do not perform normalization on the tree. * * "discard-default-content" * * true * [required] (default) * Use whatever information available to the * implementation (i.e. XML schema, DTD, the specified * flag on Attr nodes, and so on) to decide what * attributes and content should be discarded or not. * Note that the specified flag on Attr nodes in * itself is not always reliable, it is only reliable * when it is set to false since the only case where * it can be set to false is if the attribute was * created by the implementation. The default content * won't be removed if an implementation does not have * any information available. * * false * [required] * Keep all attributes and all content. * * "entities" * * true * [required] * Keep EntityReference and Entity nodes * in the document. * * false * [required] (default) * Remove all EntityReference and Entity * nodes from the document, putting the entity * expansions directly in their place. Text * nodes are into "normal" form. Only * EntityReference nodes to non-defined entities * are kept in the document. * * "infoset" * * true * [required] * Only keep in the document the information defined * in the XML Information Set [XML Information * set]. * This forces the following features to false: * namespace-declarations, validate-if-schema, * entities, datatype-normalization, cdata-sections. * This forces the following features to true: * whitespace-in-element-content, comments, * namespaces. * Other features are not changed unless explicitly * specified in the description of the features. * Note that querying this feature with getFeature * returns true only if the individual features * specified above are appropriately set. * * false * Setting infoset to false has no effect. * * "namespaces" * * true * [required] (default) * Perform the namespace processing as defined in * [XML Namespaces]. * * false * [optional] * Do not perform the namespace processing. * * "namespace-declarations" * * true * [required] (default) * Include namespace declaration attributes, specified * or defaulted from the schema or the DTD, in the * document. See also the section Declaring * Namespaces in [XML Namespaces]. * * false * [required] * Discard all namespace declaration attributes. The * Namespace prefixes are retained even if this * feature is set to false. * * "normalize-characters" * * true * [optional] * Perform the W3C Text Normalization of the * characters [CharModel] in the document. * * false * [required] (default) * Do not perform character normalization. * * "split-cdata-sections" * * true * [required] (default) * Split CDATA sections containing the CDATA section * termination marker ']]>'. When a CDATA section is * split a warning is issued. * * false * [required] * Signal an error if a CDATASection contains an * unrepresentable character. * * "validate" * * true * [optional] * Require the validation against a schema (i.e. XML * schema, DTD, any other type or representation of * schema) of the document as it is being normalized * as defined by [XML 1.0]. If validation errors * are found, or no schema was found, the error * handler is notified. Note also that normalized * values will not be exposed to the schema in used * unless the feature datatype-normalization is true. * * Note: validate-if-schema and validate are mutually * exclusive, setting one of them to true will set the * other one to false. * * false * [required] (default) * Only XML 1.0 non-validating processing must be * done. Note that validation might still happen if * validate-if-schema is true. * * "validate-if-schema" * * true * [optional] * Enable validation only if a declaration for the * document element can be found (independently of * where it is found, i.e. XML schema, DTD, or any * other type or representation of schema). If * validation errors are found, the error handler is * notified. Note also that normalized values will not * be exposed to the schema in used unless the feature * datatype-normalization is true. * * Note: validate-if-schema and validate are mutually * exclusive, setting one of them to true will set the * other one to false. * * false * [required] (default) * No validation should be performed if the document * has a schema. Note that validation must still * happen if validate is true. * * "element-content-whitespace" * * true * [required] (default) * Keep all white spaces in the document. * * false * [optional] * Discard white space in element content while * normalizing. The implementation is expected to use * the isWhitespaceInElementContent flag on Text * nodes to determine if a text node should be written * out or not. * * The resolutions of entities is done using Document.baseURI. * However, when the features "LS-Load" or "LS-Save" defined in * [DOM Level 3 Load and Save] are supported by the DOM * implementation, the parameter "entity-resolver" can also be * used on DOMConfiguration objects attached to Document * nodes. If this parameter is set, * Document.normalizeDocument will invoke the entity * resolver instead of using Document.baseURI. */ class CDOM_EXPORT DOMConfiguration { protected: //----------------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMConfiguration() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMConfiguration(const DOMConfiguration &); DOMConfiguration & operator = (const DOMConfiguration &); //@} public: // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** Set the value of a parameter. * @param name The name of the parameter to set. * @param value The new value or null if the user wishes to unset the * parameter. While the type of the value parameter is defined as * DOMUserData, the object type must match the type defined * by the definition of the parameter. For example, if the parameter is * "error-handler", the value must be of type DOMErrorHandler * @exception DOMException (NOT_SUPPORTED_ERR) Raised when the * parameter name is recognized but the requested value cannot be set. * @exception DOMException (NOT_FOUND_ERR) Raised when the * parameter name is not recognized. * @since DOM level 3 **/ virtual void setParameter(const XMLCh* name, const void* value) = 0; virtual void setParameter(const XMLCh* name, bool value) = 0; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** Return the value of a parameter if known. * @param name The name of the parameter. * @return The current object associated with the specified parameter or * null if no object has been associated or if the parameter is not * supported. * @exception DOMException (NOT_FOUND_ERR) Raised when the i * boolean parameter * name is not recognized. * @since DOM level 3 **/ virtual const void* getParameter(const XMLCh* name) const = 0; // ----------------------------------------------------------------------- // Query methods // ----------------------------------------------------------------------- /** Check if setting a parameter to a specific value is supported. * @param name The name of the parameter to check. * @param value An object. if null, the returned value is true. * @return true if the parameter could be successfully set to the specified * value, or false if the parameter is not recognized or the requested value * is not supported. This does not change the current value of the parameter * itself. * @since DOM level 3 **/ virtual bool canSetParameter(const XMLCh* name, const void* value) const = 0; virtual bool canSetParameter(const XMLCh* name, bool value) const = 0; /** * The list of the parameters supported by this DOMConfiguration object and * for which at least one value can be set by the application. * Note that this list can also contain parameter names defined outside this specification. * * @return The list of parameters that can be used with setParameter/getParameter * @since DOM level 3 **/ virtual const DOMStringList* getParameterNames() const = 0; // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMConfiguration() {}; //@} }; XERCES_CPP_NAMESPACE_END #endif /** * End of file DOMConfiguration.hpp */ xerces-c-3.2.2/src/xercesc/dom/DOMDocumentFragment.hpp000644 000765 000024 00000011067 13241160337 023365 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMDocumentFragment.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTFRAGMENT_HPP) #define XERCESC_INCLUDE_GUARD_DOMDOCUMENTFRAGMENT_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * DOMDocumentFragment is a "lightweight" or "minimal" * DOMDocument object. * * It is very common to want to be able to * extract a portion of a document's tree or to create a new fragment of a * document. Imagine implementing a user command like cut or rearranging a * document by moving fragments around. It is desirable to have an object * which can hold such fragments and it is quite natural to use a DOMNode for * this purpose. While it is true that a DOMDocument object could * fulfill this role, a DOMDocument object can potentially be a * heavyweight object, depending on the underlying implementation. What is * really needed for this is a very lightweight object. * DOMDocumentFragment is such an object. *

Furthermore, various operations -- such as inserting nodes as children * of another DOMNode -- may take DOMDocumentFragment * objects as arguments; this results in all the child nodes of the * DOMDocumentFragment being moved to the child list of this node. *

The children of a DOMDocumentFragment node are zero or more * nodes representing the tops of any sub-trees defining the structure of the * document. DOMDocumentFragment nodes do not need to be * well-formed XML documents (although they do need to follow the rules * imposed upon well-formed XML parsed entities, which can have multiple top * nodes). For example, a DOMDocumentFragment might have only one * child and that child node could be a DOMText node. Such a * structure model represents neither an HTML document nor a well-formed XML * document. *

When a DOMDocumentFragment is inserted into a * DOMDocument (or indeed any other DOMNode that may take * children) the children of the DOMDocumentFragment and not the * DOMDocumentFragment itself are inserted into the * DOMNode. This makes the DOMDocumentFragment very * useful when the user wishes to create nodes that are siblings; the * DOMDocumentFragment acts as the parent of these nodes so that the * user can use the standard methods from the DOMNode interface, * such as insertBefore() and appendChild(). * * @since DOM Level 1 */ class CDOM_EXPORT DOMDocumentFragment: public DOMNode { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMDocumentFragment() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMDocumentFragment(const DOMDocumentFragment &); DOMDocumentFragment & operator = (const DOMDocumentFragment &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMDocumentFragment() {}; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMImplementationSource.hpp000644 000765 000024 00000010152 13241160336 024262 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMImplementationSource.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONSOURCE_HPP) #define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONSOURCE_HPP /** * This interface permits a DOM implementer to supply one or more * implementations, based upon requested features and versions. Each implemented * DOMImplementationSource object is listed in the * binding-specific list of available sources so that its * DOMImplementation objects are made available. * * @since DOM Level 3 */ #include XERCES_CPP_NAMESPACE_BEGIN class DOMImplementation; class DOMImplementationList; class CDOM_EXPORT DOMImplementationSource { protected : // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMImplementationSource() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMImplementationSource(const DOMImplementationSource &); DOMImplementationSource & operator = (const DOMImplementationSource &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMImplementationSource() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMImplementationSource interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ /** * A method to request the first DOM implementation that supports the specified features. * * @param features A string that specifies which features are required. * This is a space separated list in which each feature is specified * by its name optionally followed by a space and a version number. * This is something like: "XML 1.0 Traversal 2.0" * @return An implementation that has the desired features, or * null if this source has none. * @since DOM Level 3 */ virtual DOMImplementation* getDOMImplementation(const XMLCh* features) const = 0; /** * A method to request a list of DOM implementations that support the specified features and versions, * * @param features A string that specifies which features are required. * This is a space separated list in which each feature is specified * by its name optionally followed by a space and a version number. * This is something like: "XML 1.0 Traversal 2.0" * @return A list of DOM implementations that support the desired features * @since DOM Level 3 */ virtual DOMImplementationList* getDOMImplementationList(const XMLCh* features) const = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMLSParser.hpp000644 000765 000024 00000112202 13241160337 021607 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLSParser.hpp 1800006 2017-06-27 02:40:16Z scantor $ * */ #if !defined(XERCESC_INCLUDE_GUARD_DOMLSPARSER_HPP) #define XERCESC_INCLUDE_GUARD_DOMLSPARSER_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMErrorHandler; class DOMLSInput; class DOMNode; class DOMDocument; /** * DOMLSParser provides an API for parsing XML documents and building the * corresponding DOM document tree. A DOMLSParser instance is obtained from * the DOMImplementationLS interface by invoking its createLSParser method. * * @since DOM Level 3 * */ class CDOM_EXPORT DOMLSParser { protected : // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMLSParser() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMLSParser(const DOMLSParser &); DOMLSParser & operator = (const DOMLSParser &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMLSParser() {}; //@} // ----------------------------------------------------------------------- // Class types // ----------------------------------------------------------------------- /** @name Public Constants */ //@{ /** * A set of possible actions for the parseWithContext method. * *

ACTION_APPEND_AS_CHILDREN: * Append the result of the parse operation as children of the context node. * For this action to work, the context node must be a DOMElement * or a DOMDocumentFragment.

* *

ACTION_INSERT_AFTER: * Insert the result of the parse operation as the immediately following sibling * of the context node. For this action to work the context node's parent must * be a DOMElement or a DOMDocumentFragment.

* *

ACTION_INSERT_BEFORE: * Insert the result of the parse operation as the immediately preceding sibling * of the context node. For this action to work the context node's parent must * be a DOMElement or a DOMDocumentFragment.

* *

ACTION_REPLACE: * Replace the context node with the result of the parse operation. For this * action to work, the context node must have a parent, and the parent must be * a DOMElement or a DOMDocumentFragment.

* *

ACTION_REPLACE_CHILDREN: * Replace all the children of the context node with the result of the parse * operation. For this action to work, the context node must be a DOMElement, * a DOMDocument, or a DOMDocumentFragment.

* * @see parseWithContext(...) * @since DOM Level 3 */ enum ActionType { ACTION_APPEND_AS_CHILDREN = 1, ACTION_REPLACE_CHILDREN = 2, ACTION_INSERT_BEFORE = 3, ACTION_INSERT_AFTER = 4, ACTION_REPLACE = 5 }; //@} // ----------------------------------------------------------------------- // Virtual DOMLSParser interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Get a pointer to the DOMConfiguration object used when parsing * an input source. * This DOMConfiguration is specific to the parse operation. * No parameter values from this DOMConfiguration object are passed * automatically to the DOMConfiguration object on the * DOMDocument that is created, or used, by the parse operation. * The DOM application is responsible for passing any needed parameter values * from this DOMConfiguration object to the DOMConfiguration * object referenced by the DOMDocument object. * * In addition to the parameters recognized in on the DOMConfiguration * interface defined in [DOM Level 3 Core], the DOMConfiguration objects * for DOMLSParser add or modify the following parameters: * * "charset-overrides-xml-encoding" * true [optional] (default) * If a higher level protocol such as HTTP [IETF RFC 2616] provides an * indication of the character encoding of the input stream being processed, * that will override any encoding specified in the XML declaration or the * Text declaration (see also section 4.3.3, "Character Encoding in Entities", * in [XML 1.0]). Explicitly setting an encoding in the DOMLSInput * overrides any encoding from the protocol. * false [required] * The parser ignores any character set encoding information from higher-level * protocols. * * "disallow-doctype" * true * Throw a fatal "doctype-not-allowed" error if a doctype node is found while * parsing the document. This is useful when dealing with things like SOAP * envelopes where doctype nodes are not allowed. * false (default) * Allow doctype nodes in the document. * * "ignore-unknown-character-denormalizations" * true [required] (default) * If, while verifying full normalization when [XML 1.1] is supported, a * processor encounters characters for which it cannot determine the normalization * properties, then the processor will ignore any possible denormalizations * caused by these characters. * This parameter is ignored for [XML 1.0]. * false [optional] * Report an fatal "unknown-character-denormalization" error if a character * is encountered for which the processor cannot determine the normalization * properties. * * "infoset" * See the definition of DOMConfiguration for a description of this parameter. * Unlike in [DOM Level 3 Core], this parameter will default to true for DOMLSParser. * * "namespaces" * true [required] (default) * Perform the namespace processing as defined in [XML Namespaces] and * [XML Namespaces 1.1]. * false [optional] * Do not perform the namespace processing. * * "resource-resolver" [required] * A pointer to a DOMLSResourceResolver object, or NULL. If the value of this parameter * is not null when an external resource (such as an external XML entity or an XML schema * location) is encountered, the implementation will request that the DOMLSResourceResolver * referenced in this parameter resolves the resource. * * "supported-media-types-only" * true [optional] * Check that the media type of the parsed resource is a supported media type. If * an unsupported media type is encountered, a fatal error of type "unsupported-media-type" * will be raised. The media types defined in [IETF RFC 3023] must always be accepted. * false [required] (default) * Accept any media type. * * "validate" * See the definition of DOMConfiguration for a description of this parameter. * Unlike in [DOM Level 3 Core], the processing of the internal subset is always accomplished, even * if this parameter is set to false. * * "validate-if-schema" * See the definition of DOMConfiguration for a description of this parameter. * Unlike in [DOM Level 3 Core], the processing of the internal subset is always accomplished, even * if this parameter is set to false. * * "well-formed" * See the definition of DOMConfiguration for a description of this parameter. * Unlike in [DOM Level 3 Core], this parameter cannot be set to false. * * In addition to these, Xerces adds these non standard parameters: * * "http://apache.org/xml/properties/entity-resolver" * A pointer to a XMLEntityResolver object, or NULL. If the value of this parameter * is not null when an external resource (such as an external XML entity or an XML schema * location) is encountered, the implementation will request that the XMLEntityResolver * referenced in this parameter resolves the resource. * * "http://apache.org/xml/properties/schema/external-schemaLocation" * A string holding a set of [namespaceUri schemaLocation] entries that will be treated as * the content of the attribute xsi:schemaLocation of the root element * * "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation" * A string holding the schemaLocation for the empty namespace URI that will be treated as * the content of the attribute xsi:noNamespaceSchemaLocation of the root element * * "http://apache.org/xml/properties/security-manager" * A pointer to a SecurityManager object that will control how many entity references will be * expanded during parsing * * "http://apache.org/xml/properties/scannerName" * A string holding the type of scanner used while parsing. The valid names are: *
    *
  • IGXMLScanner: the default one, capable of both XMLSchema and DTD validation
  • *
  • SGXMLScanner: a scanner that can only perform XMLSchema validation
  • *
  • DGXMLScanner: a scanner that can only perform DTD validation
  • *
  • WFXMLScanner: a scanner that cannot perform any type validation, only well-formedness
  • *
* * "http://apache.org/xml/properties/parser-use-DOMDocument-from-Implementation" * A string holding the capabilities of the DOM implementation to be used to create the DOMDocument * resulting from the parse operation. For instance, "LS" or "Core" * * "http://apache.org/xml/features/validation/schema" * true * Enable XMLSchema validation (note that also namespace processing should be enabled) * false (default) * Don't perform XMLSchema validation * * "http://apache.org/xml/features/validation/schema-full-checking" * true * Turn on full XMLSchema checking (e.g. Unique Particle Attribution) * false (default) * Don't perform full XMLSchema checking * * "http://apache.org/xml/features/validating/load-schema" * true (default) * Allow the parser to load schemas that are not in the grammar pool * false * Schemas that are not in the grammar pool are ignored * * "http://apache.org/xml/features/dom/user-adopts-DOMDocument" * true * The DOMDocument objects returned by parse will be owned by the caller * false (default) * The DOMDocument objects returned by parse will be owned by this DOMLSParser * and deleted when released * * "http://apache.org/xml/features/nonvalidating/load-external-dtd" * true (default) * Allow the parser to load external DTDs * false * References to external DTDs will be ignored * * "http://apache.org/xml/features/continue-after-fatal-error" * true * Parsing should try to continue even if a fatal error has been triggered, trying to generate a DOM tree * from a non well-formed XML * false (default) * Violation of XML rules will abort parsing * * "http://apache.org/xml/features/validation-error-as-fatal" * true * Validation errors are treated as fatal errors, and abort parsing (unless "continue-after-fatal-error" * has been specified) * false (default) * Validation errors are normal errors * * "http://apache.org/xml/features/validation/cache-grammarFromParse" * true * XMLSchemas referenced by an XML file are cached in order to be reused by other parse operations * false (default) * XMLSchemas loaded during a parse operation will be discarded before the next one * * "http://apache.org/xml/features/validation/use-cachedGrammarInParse" * true * During this parse operation, reuse the XMLSchemas found in the cache * false (default) * Don't reuse the XMLSchemas found in the cache * * "http://apache.org/xml/features/calculate-src-ofs" * true * During parsing update the position in the source stream * false (default) * Don't waste time computing the position in the source stream * * "http://apache.org/xml/features/standard-uri-conformant" * true * Require that every URL being resolved is made of valid URL characters only * false (default) * Allow invalid URL characters in URL (e.g. spaces) * * "http://apache.org/xml/features/dom-has-psvi-info" * true * Add schema informations to DOMElement and DOMAttr nodes in the output DOM tree * false (default) * Don't store schema informations in the output DOM tree * * "http://apache.org/xml/features/generate-synthetic-annotations" * true * Create annotation objects in the representation of the loaded XMLSchemas * false (default) * Discard annotations found in the loaded XMLSchemas * * "http://apache.org/xml/features/validate-annotations" * true * Check that annotations are valid according to their XMLSchema definition * false (default) * Don't validate annotations * * "http://apache.org/xml/features/validation/identity-constraint-checking" * true (default) * Enforce identity constraints specified in the XMLSchema * false * Don't enforce identity constraints * * "http://apache.org/xml/features/validation/ignoreCachedDTD" * true * Don't reuse DTDs found in the cache, even if use-cachedGrammarInParse is true * false (default) * Reuse DTDs found in the cache, if use-cachedGrammarInParse is true * * "http://apache.org/xml/features/schema/ignore-annotations" * true * Don't process annotations found in an XMLSchema * false (default) * Process the annotations found in an XMLSchema * * "http://apache.org/xml/features/disable-default-entity-resolution" * true * Entities will be resolved only by a resolver installed by the user * false (default) * If the entity resolver has not been installed, or it refuses to resolve the given entity, the * parser will try to locate it himself * * "http://apache.org/xml/features/validation/schema/skip-dtd-validation" * true * If XMLSchema validation is true, DTD validation will not be performed * false (default) * If a DTD is found, it will be used to validate the XML * * @return The pointer to the configuration object. * @since DOM Level 3 */ virtual DOMConfiguration* getDomConfig() = 0; /** * Get a const pointer to the application filter * * This method returns the installed application filter. If no filter * has been installed, then it will be a zero pointer. * * @return A const pointer to the installed application filter * @since DOM Level 3 */ virtual const DOMLSParserFilter* getFilter() const = 0; /** * Return whether the parser is asynchronous * * @return true if the DOMLSParser is asynchronous, * false if it is synchronous * @since DOM Level 3 */ virtual bool getAsync() const = 0; /** * Return whether the parser is busy parsing * * @return true if the DOMLSParser is currently busy * loading a document, otherwise false. * @since DOM Level 3 */ virtual bool getBusy() const = 0; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** * Set the application filter * * When the application provides a filter, the parser will call out to * the filter at the completion of the construction of each DOMElement * node. The filter implementation can choose to remove the element from the * document being constructed or to terminate the parse early. * The filter is invoked after the operations requested by the DOMConfiguration * parameters have been applied. For example, if "validate" is set to true, * the validation is done before invoking the filter. * * Any previously set filter is merely dropped, since the parser * does not own them. * * @param filter A const pointer to the user supplied application * filter. * * @see #getFilter * @since DOM Level 3 */ virtual void setFilter(DOMLSParserFilter* const filter) = 0; // ----------------------------------------------------------------------- // Parsing methods // ----------------------------------------------------------------------- /** * Parse an XML document from a resource identified by a DOMLSInput. * * The parser owns the returned DOMDocument. It will be deleted * when the parser is released. * * @param source The DOMLSInput from which the source of the document * is to be read. * @return If the DOMLSParser is a synchronous DOMLSParser * the newly created and populated DOMDocument is returned. * If the DOMLSParser is asynchronous then NULL * is returned since the document object may not yet be constructed when * this method returns. * @exception DOMException INVALID_STATE_ERR: Raised if the DOMLSParser::busy * attribute is true. * @exception DOMLSException PARSE_ERR: Starting from Xerces-C++ 4.0.0 this exception is * raised if the DOMLSParser was unable * to load the XML document. DOM applications should * attach a DOMErrorHandler using the * parameter "error-handler" if they wish to get details * on the error. * * @see DOMLSInput#DOMLSInput * @see DOMConfiguration * @see resetDocumentPool * @since DOM Level 3 */ virtual DOMDocument* parse(const DOMLSInput* source) = 0; /** * Parse an XML document from a location identified by a URI reference [IETF RFC 2396]. * If the URI contains a fragment identifier (see section 4.1 in [IETF RFC 2396]), * the behavior is not defined by this specification, future versions of this * specification may define the behavior. * * The parser owns the returned DOMDocument. It will be deleted * when the parser is released. * * @param uri The location of the XML document to be read (in Unicode) * @return If the DOMLSParser is a synchronous DOMLSParser * the newly created and populated DOMDocument is returned. * If the DOMLSParser is asynchronous then NULL * is returned since the document object is not yet parsed when this method returns. * @exception DOMException INVALID_STATE_ERR: Raised if the DOMLSParser::busy * attribute is true. * @exception DOMLSException PARSE_ERR: Starting from Xerces-C++ 4.0.0 this exception is * raised if the DOMLSParser was unable * to load the XML document. DOM applications should * attach a DOMErrorHandler using the * parameter "error-handler" if they wish to get details * on the error. * * @see #parse(DOMLSInput,...) * @see resetDocumentPool * @since DOM Level 3 */ virtual DOMDocument* parseURI(const XMLCh* const uri) = 0; /** * Parse an XML document from a location identified by a URI reference [IETF RFC 2396]. * If the URI contains a fragment identifier (see section 4.1 in [IETF RFC 2396]), * the behavior is not defined by this specification, future versions of this * specification may define the behavior. * * The parser owns the returned DOMDocument. It will be deleted * when the parser is released. * * @param uri The location of the XML document to be read (in the local code page) * @return If the DOMLSParser is a synchronous DOMLSParser * the newly created and populated DOMDocument is returned. * If the DOMLSParser is asynchronous then NULL * is returned since the document object is not yet parsed when this method returns. * @exception DOMException INVALID_STATE_ERR: Raised if the DOMLSParser::busy * attribute is true. * @exception DOMLSException PARSE_ERR: Starting from Xerces-C++ 4.0.0 this exception is * raised if the DOMLSParser was unable * to load the XML document. DOM applications should * attach a DOMErrorHandler using the * parameter "error-handler" if they wish to get details * on the error. * * @see #parse(DOMLSInput,...) * @see resetDocumentPool * @since DOM Level 3 */ virtual DOMDocument* parseURI(const char* const uri) = 0; /** * Parse an XML fragment from a resource identified by a DOMLSInput * and insert the content into an existing document at the position specified * with the context and action arguments. When parsing the input stream, the * context node (or its parent, depending on where the result will be inserted) * is used for resolving unbound namespace prefixes. The context node's * ownerDocument node (or the node itself if the node of type * DOCUMENT_NODE) is used to resolve default attributes and entity * references. * As the new data is inserted into the document, at least one mutation event * is fired per new immediate child or sibling of the context node. * If the context node is a DOMDocument node and the action is * ACTION_REPLACE_CHILDREN, then the document that is passed as * the context node will be changed such that its xmlEncoding, * documentURI, xmlVersion, inputEncoding, * xmlStandalone, and all other such attributes are set to what they * would be set to if the input source was parsed using DOMLSParser::parse(). * This method is always synchronous, even if the DOMLSParser is * asynchronous (DOMLSParser::getAsync() returns true). * If an error occurs while parsing, the caller is notified through the ErrorHandler * instance associated with the "error-handler" parameter of the DOMConfiguration. * When calling parseWithContext, the values of the following configuration * parameters will be ignored and their default values will always be used instead: * "validate", * "validate-if-schema" * "element-content-whitespace". * Other parameters will be treated normally, and the parser is expected to call * the DOMLSParserFilter just as if a whole document was parsed. * * @param source The DOMLSInput from which the source document is * to be read. The source document must be an XML fragment, i.e. * anything except a complete XML document (except in the case where * the context node of type DOCUMENT_NODE, and the action is * ACTION_REPLACE_CHILDREN), a DOCTYPE * (internal subset), entity declaration(s), notation declaration(s), * or XML or text declaration(s). * @param contextNode The node that is used as the context for the data that is being * parsed. This node must be a DOMDocument node, a * DOMDocumentFragment node, or a node of a type that * is allowed as a child of an DOMElement node, e.g. * it cannot be an DOMAttribute node. * @param action This parameter describes which action should be taken between the new * set of nodes being inserted and the existing children of the context node. * The set of possible actions is defined in ACTION_TYPES above. * @return Return the node that is the result of the parse operation. If the result is more * than one top-level node, the first one is returned. * * @exception DOMException * HIERARCHY_REQUEST_ERR: Raised if the content cannot replace, be inserted before, after, * or as a child of the context node (see also DOMNode::insertBefore * or DOMNode::replaceChild in [DOM Level 3 Core]). * NOT_SUPPORTED_ERR: Raised if the DOMLSParser doesn't support this method, * or if the context node is of type DOMDocument and the DOM * implementation doesn't support the replacement of the DOMDocumentType * child or DOMElement child. * NO_MODIFICATION_ALLOWED_ERR: Raised if the context node is a read only node and the content * is being appended to its child list, or if the parent node of * the context node is read only node and the content is being * inserted in its child list. * INVALID_STATE_ERR: Raised if the DOMLSParser::getBusy() returns true. * * @exception DOMLSException PARSE_ERR: Raised if the DOMLSParser was unable to load * the XML fragment. DOM applications should attach a * DOMErrorHandler using the parameter "error-handler" * if they wish to get details on the error. * @since DOM Level 3 */ virtual DOMNode* parseWithContext(const DOMLSInput* source, DOMNode* contextNode, const ActionType action) = 0; /** * Abort the loading of the document that is currently being loaded by the DOMLSParser. * If the DOMLSParser is currently not busy, a call to this method does nothing. * * Note: invoking this method will remove the installed DOMLSParserFilter filter * * @since DOM Level 3 */ virtual void abort() = 0; //@} // ----------------------------------------------------------------------- // Non-standard Extension // ----------------------------------------------------------------------- /** @name Non-standard Extension */ //@{ /** * Called to indicate that this DOMLSParser is no longer in use * and that the implementation may relinquish any resources associated with it. * * Access to a released object will lead to unexpected result. */ virtual void release() = 0; /** Reset the documents vector pool and release all the associated memory * back to the system. * * When parsing a document using a DOM parser, all memory allocated * for a DOM tree is associated to the DOM document. * * If you do multiple parse using the same DOM parser instance, then * multiple DOM documents will be generated and saved in a vector pool. * All these documents (and thus all the allocated memory) * won't be deleted until the parser instance is destroyed. * * If you don't need these DOM documents anymore and don't want to * destroy the DOM parser instance at this moment, then you can call this method * to reset the document vector pool and release all the allocated memory * back to the system. * * It is an error to call this method if you are in the middle of a * parse (e.g. in the mid of a progressive parse). * * @exception IOException An exception from the parser if this function * is called when a parse is in progress. * */ virtual void resetDocumentPool() = 0; /** * Preparse schema grammar (XML Schema, DTD, etc.) via an input source * object. * * This method invokes the preparsing process on a schema grammar XML * file specified by the DOMLSInput parameter. If the 'toCache' flag * is enabled, the parser will cache the grammars for re-use. If a grammar * key is found in the pool, no caching of any grammar will take place. * * @param source A const reference to the DOMLSInput object which * points to the schema grammar file to be preparsed. * @param grammarType The grammar type (Schema or DTD). * @param toCache If true, we cache the preparsed grammar, * otherwise, no chaching. Default is false. * @return The preparsed schema grammar object (SchemaGrammar or * DTDGrammar). That grammar object is owned by the parser. * * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @exception XMLException An exception from the parser or client * handler code. * @exception DOMException A DOM exception as per DOM spec. * * @see DOMLSInput#DOMLSInput */ virtual Grammar* loadGrammar(const DOMLSInput* source, const Grammar::GrammarType grammarType, const bool toCache = false) = 0; /** * Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL * * This method invokes the preparsing process on a schema grammar XML * file specified by the file path parameter. If the 'toCache' flag is * enabled, the parser will cache the grammars for re-use. If a grammar * key is found in the pool, no caching of any grammar will take place. * * @param systemId A const XMLCh pointer to the Unicode string which * contains the path to the XML grammar file to be * preparsed. * @param grammarType The grammar type (Schema or DTD). * @param toCache If true, we cache the preparsed grammar, * otherwise, no chaching. Default is false. * @return The preparsed schema grammar object (SchemaGrammar or * DTDGrammar). That grammar object is owned by the parser. * * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @exception XMLException An exception from the parser or client * handler code. * @exception DOMException A DOM exception as per DOM spec. */ virtual Grammar* loadGrammar(const XMLCh* const systemId, const Grammar::GrammarType grammarType, const bool toCache = false) = 0; /** * Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL * * This method invokes the preparsing process on a schema grammar XML * file specified by the file path parameter. If the 'toCache' flag is * enabled, the parser will cache the grammars for re-use. If a grammar * key is found in the pool, no caching of any grammar will take place. * * @param systemId A const char pointer to a native string which contains * the path to the XML grammar file to be preparsed. * @param grammarType The grammar type (Schema or DTD). * @param toCache If true, we cache the preparsed grammar, * otherwise, no chaching. Default is false. * @return The preparsed schema grammar object (SchemaGrammar or * DTDGrammar). That grammar object is owned by the parser. * * * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @exception XMLException An exception from the parser or client * handler code. * @exception DOMException A DOM exception as per DOM spec. */ virtual Grammar* loadGrammar(const char* const systemId, const Grammar::GrammarType grammarType, const bool toCache = false) = 0; /** * Retrieve the grammar that is associated with the specified namespace key * * @param nameSpaceKey Namespace key * @return Grammar associated with the Namespace key. */ virtual Grammar* getGrammar(const XMLCh* const nameSpaceKey) const = 0; /** * Retrieve the grammar where the root element is declared. * * @return Grammar where root element declared */ virtual Grammar* getRootGrammar() const = 0; /** * Returns the string corresponding to a URI id from the URI string pool. * * @param uriId id of the string in the URI string pool. * @return URI string corresponding to the URI id. */ virtual const XMLCh* getURIText(unsigned int uriId) const = 0; /** * Clear the cached grammar pool */ virtual void resetCachedGrammarPool() = 0; /** * Returns the current src offset within the input source. * * @return offset within the input source */ virtual XMLFilePos getSrcOffset() const = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMImplementationList.hpp000644 000765 000024 00000010440 13241160340 023730 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMImplementationList.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONLIST_HPP) #define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONLIST_HPP #include XERCES_CPP_NAMESPACE_BEGIN class DOMImplementation; /** * The DOMImplementationList interface provides the abstraction of an ordered * collection of DOM implementations, without defining or constraining how this collection * is implemented. The items in the DOMImplementationList are accessible via * an integral index, starting from 0. */ class CDOM_EXPORT DOMImplementationList { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMImplementationList() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMImplementationList(const DOMImplementationList &); DOMImplementationList & operator = (const DOMImplementationList &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMImplementationList() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMImplementationList interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Returns the index item in the collection. * * If index is greater than or equal to the number of DOMImplementation in * the list, this returns null. * * @param index Index into the collection. * @return The DOMImplementation at the indexth position in the * DOMImplementationList, or null if that is not a valid * index. * @since DOM Level 3 */ virtual DOMImplementation *item(XMLSize_t index) const = 0; /** * Returns the number of DOMImplementation in the list. * * The range of valid child node indices is 0 to length-1 inclusive. * @since DOM Level 3 */ virtual XMLSize_t getLength() const = 0; //@} // ----------------------------------------------------------------------- // Non-standard Extension // ----------------------------------------------------------------------- /** @name Non-standard Extension */ //@{ /** * Called to indicate that this list is no longer in use * and that the implementation may relinquish any resources associated with it and * its associated children. * * Access to a released object will lead to unexpected result. * */ virtual void release() = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMNamedNodeMap.hpp000644 000765 000024 00000023574 13241160337 022421 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNamedNodeMap.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMNAMEDNODEMAP_HPP) #define XERCESC_INCLUDE_GUARD_DOMNAMEDNODEMAP_HPP #include XERCES_CPP_NAMESPACE_BEGIN class DOMNode; /** * DOMNamedNodeMaps are used to * represent collections of nodes that can be accessed by name. * * Note that DOMNamedNodeMap does not inherit from DOMNodeList; * DOMNamedNodeMaps are not maintained in any particular order. * Nodes contained in a DOMNamedNodeMap may * also be accessed by an ordinal index, but this is simply to allow * convenient enumeration of the contents, and * does not imply that the DOM specifies an order to these Nodes. * * @since DOM Level 1 */ class CDOM_EXPORT DOMNamedNodeMap { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMNamedNodeMap() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMNamedNodeMap(const DOMNamedNodeMap &); DOMNamedNodeMap & operator = (const DOMNamedNodeMap &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMNamedNodeMap() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMNamedNodeMap interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 1 */ //@{ // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** * Adds a node using its nodeName attribute. * *
As the nodeName attribute is used to derive the name * which the node must be stored under, multiple nodes of certain types * (those that have a "special" string value) cannot be stored as the names * would clash. This is seen as preferable to allowing nodes to be aliased. * @param arg A node to store in a named node map. The node will later be * accessible using the value of the nodeName attribute of * the node. If a node with that name is already present in the map, it * is replaced by the new one. * @return If the new DOMNode replaces an existing node the * replaced DOMNode is returned, * otherwise null is returned. * @exception DOMException * WRONG_DOCUMENT_ERR: Raised if arg was created from a * different document than the one that created the * DOMNamedNodeMap. *
NO_MODIFICATION_ALLOWED_ERR: Raised if this * DOMNamedNodeMap is readonly. *
INUSE_ATTRIBUTE_ERR: Raised if arg is an * DOMAttr that is already an attribute of another * DOMElement object. The DOM user must explicitly clone * DOMAttr nodes to re-use them in other elements. * @since DOM Level 1 */ virtual DOMNode *setNamedItem(DOMNode *arg) = 0; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Returns the indexth item in the map. * * If index * is greater than or equal to the number of nodes in the map, this returns * null. * @param index Index into the map. * @return The node at the indexth position in the * DOMNamedNodeMap, or null if that is not a valid * index. * @since DOM Level 1 */ virtual DOMNode *item(XMLSize_t index) const = 0; /** * Retrieves a node specified by name. * * @param name The nodeName of a node to retrieve. * @return A DOMNode (of any type) with the specified nodeName, or * null if it does not identify any node in * the map. * @since DOM Level 1 */ virtual DOMNode *getNamedItem(const XMLCh *name) const = 0; /** * The number of nodes in the map. * * The range of valid child node indices is * 0 to length-1 inclusive. * @since DOM Level 1 */ virtual XMLSize_t getLength() const = 0; // ----------------------------------------------------------------------- // Node methods // ----------------------------------------------------------------------- /** * Removes a node specified by name. * * If the removed node is an * DOMAttr with a default value it is immediately replaced. * @param name The nodeName of a node to remove. * @return The node removed from the map if a node with such a name exists. * @exception DOMException * NOT_FOUND_ERR: Raised if there is no node named name in * the map. *
* NO_MODIFICATION_ALLOWED_ERR: Raised if this DOMNamedNodeMap * is readonly. * @since DOM Level 1 */ virtual DOMNode *removeNamedItem(const XMLCh *name) = 0; //@} /** @name Functions introduced in DOM Level 2 */ //@{ /** * Retrieves a node specified by local name and namespace URI. * * @param namespaceURI The namespace URI of * the node to retrieve. * @param localName The local name of the node to retrieve. * @return A DOMNode (of any type) with the specified * local name and namespace URI, or null if they do not * identify any node in the map. * @since DOM Level 2 */ virtual DOMNode *getNamedItemNS(const XMLCh *namespaceURI, const XMLCh *localName) const = 0; /** * Adds a node using its namespaceURI and localName. * * @param arg A node to store in a named node map. The node will later be * accessible using the value of the namespaceURI and * localName attribute of the node. If a node with those * namespace URI and local name is already present in the map, it is * replaced by the new one. * @return If the new DOMNode replaces an existing node the * replaced DOMNode is returned, * otherwise null is returned. * @exception DOMException * WRONG_DOCUMENT_ERR: Raised if arg was created from a * different document than the one that created the * DOMNamedNodeMap. *
NO_MODIFICATION_ALLOWED_ERR: Raised if this * DOMNamedNodeMap is readonly. *
INUSE_ATTRIBUTE_ERR: Raised if arg is an * DOMAttr that is already an attribute of another * DOMElement object. The DOM user must explicitly clone * DOMAttr nodes to re-use them in other elements. * @since DOM Level 2 */ virtual DOMNode *setNamedItemNS(DOMNode *arg) = 0; /** * Removes a node specified by local name and namespace URI. * * @param namespaceURI The namespace URI of * the node to remove. * @param localName The local name of the * node to remove. When this DOMNamedNodeMap contains the * attributes attached to an element, as returned by the attributes * attribute of the DOMNode interface, if the removed * attribute is known to have a default value, an attribute * immediately appears containing the default value * as well as the corresponding namespace URI, local name, and prefix. * @return The node removed from the map if a node with such a local name * and namespace URI exists. * @exception DOMException * NOT_FOUND_ERR: Raised if there is no node named name in * the map. *
* NO_MODIFICATION_ALLOWED_ERR: Raised if this DOMNamedNodeMap * is readonly. * @since DOM Level 2 */ virtual DOMNode *removeNamedItemNS(const XMLCh *namespaceURI, const XMLCh *localName) = 0; //@} }; #define GetDOMNamedNodeMapMemoryManager GET_INDIRECT_MM(fOwnerNode) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMElement.hpp000644 000765 000024 00000056002 13241160337 021512 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMElement.hpp 792236 2009-07-08 17:22:35Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMELEMENT_HPP) #define XERCESC_INCLUDE_GUARD_DOMELEMENT_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMAttr; class DOMNodeList; class DOMTypeInfo; /** * By far the vast majority of objects (apart from text) that authors * encounter when traversing a document are DOMElement nodes. * * Assume the following XML document:<elementExample id="demo"> * <subelement1/> * <subelement2><subsubelement/></subelement2> * </elementExample> *

When represented using DOM, the top node is an DOMElement node * for "elementExample", which contains two child DOMElement nodes, * one for "subelement1" and one for "subelement2". "subelement1" contains no * child nodes. *

Elements may have attributes associated with them; since the * DOMElement interface inherits from DOMNode, the generic * DOMNode interface method getAttributes may be used * to retrieve the set of all attributes for an element. There are methods on * the DOMElement interface to retrieve either an DOMAttr * object by name or an attribute value by name. In XML, where an attribute * value may contain entity references, an DOMAttr object should be * retrieved to examine the possibly fairly complex sub-tree representing the * attribute value. On the other hand, in HTML, where all attributes have * simple string values, methods to directly access an attribute value can * safely be used as a convenience. * * @since DOM Level 1 * * It also defines the ElementTraversal helper interface defined by http://www.w3.org/TR/2008/REC-ElementTraversal-20081222/ * */ class CDOM_EXPORT DOMElement: public DOMNode { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMElement() {} DOMElement(const DOMElement &other) : DOMNode(other) {} //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented operators */ //@{ DOMElement & operator = (const DOMElement &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMElement() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMElement interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 1 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * The name of the element. * * For example, in: <elementExample * id="demo"> ... </elementExample> , tagName has * the value "elementExample". Note that this is * case-preserving in XML, as are all of the operations of the DOM. * @since DOM Level 1 */ virtual const XMLCh * getTagName() const = 0; /** * Retrieves an attribute value by name. * * @param name The name of the attribute to retrieve. * @return The DOMAttr value as a string, or the empty string if * that attribute does not have a specified or default value. * @since DOM Level 1 */ virtual const XMLCh * getAttribute(const XMLCh *name) const = 0; /** * Retrieves an DOMAttr node by name. * * @param name The name (nodeName) of the attribute to retrieve. * @return The DOMAttr node with the specified name (nodeName) or * null if there is no such attribute. * @since DOM Level 1 */ virtual DOMAttr * getAttributeNode(const XMLCh *name) const = 0; /** * Returns a DOMNodeList of all descendant elements with a given * tag name, in the order in which they would be encountered in a preorder * traversal of the DOMElement tree. * * @param name The name of the tag to match on. The special value "*" * matches all tags. * @return A list of matching DOMElement nodes. * @since DOM Level 1 */ virtual DOMNodeList * getElementsByTagName(const XMLCh *name) const = 0; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** * Adds a new attribute. * * If an attribute with that name is already present * in the element, its value is changed to be that of the value parameter. * This value is a simple string, it is not parsed as it is being set. So * any markup (such as syntax to be recognized as an entity reference) is * treated as literal text, and needs to be appropriately escaped by the * implementation when it is written out. In order to assign an attribute * value that contains entity references, the user must create an * DOMAttr node plus any DOMText and * DOMEntityReference nodes, build the appropriate subtree, and * use setAttributeNode to assign it as the value of an * attribute. * @param name The name of the attribute to create or alter. * @param value Value to set in string form. * @exception DOMException * INVALID_CHARACTER_ERR: Raised if the specified name contains an * illegal character. *
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. * @since DOM Level 1 */ virtual void setAttribute(const XMLCh *name, const XMLCh *value) = 0; /** * Adds a new attribute. * * If an attribute with that name (nodeName) is already present * in the element, it is replaced by the new one. * @param newAttr The DOMAttr node to add to the attribute list. * @return If the newAttr attribute replaces an existing * attribute, the replaced * DOMAttr node is returned, otherwise null is * returned. * @exception DOMException * WRONG_DOCUMENT_ERR: Raised if newAttr was created from a * different document than the one that created the element. *
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. *
INUSE_ATTRIBUTE_ERR: Raised if newAttr is already an * attribute of another DOMElement object. The DOM user must * explicitly clone DOMAttr nodes to re-use them in other * elements. * @since DOM Level 1 */ virtual DOMAttr * setAttributeNode(DOMAttr *newAttr) = 0; /** * Removes the specified attribute node. * If the removed DOMAttr * has a default value it is immediately replaced. The replacing attribute * has the same namespace URI and local name, as well as the original prefix, * when applicable. * * @param oldAttr The DOMAttr node to remove from the attribute * list. * @return The DOMAttr node that was removed. * @exception DOMException * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. *
NOT_FOUND_ERR: Raised if oldAttr is not an attribute * of the element. * @since DOM Level 1 */ virtual DOMAttr * removeAttributeNode(DOMAttr *oldAttr) = 0; /** * Removes an attribute by name. * * If the removed attribute * is known to have a default value, an attribute immediately appears * containing the default value as well as the corresponding namespace URI, * local name, and prefix when applicable.
To remove an attribute by local * name and namespace URI, use the removeAttributeNS method. * @param name The name of the attribute to remove. * @exception DOMException * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. * @since DOM Level 1 */ virtual void removeAttribute(const XMLCh *name) = 0; //@} /** @name Functions introduced in DOM Level 2. */ //@{ /** * Retrieves an attribute value by local name and namespace URI. * * @param namespaceURI The namespace URI of * the attribute to retrieve. * @param localName The local name of the * attribute to retrieve. * @return The DOMAttr value as a string, or an null if * that attribute does not have a specified or default value. * @since DOM Level 2 */ virtual const XMLCh * getAttributeNS(const XMLCh *namespaceURI, const XMLCh *localName) const = 0; /** * Adds a new attribute. If an attribute with the same * local name and namespace URI is already present on the element, its prefix * is changed to be the prefix part of the qualifiedName, and * its value is changed to be the value parameter. This value is * a simple string, it is not parsed as it is being set. So any markup (such * as syntax to be recognized as an entity reference) is treated as literal * text, and needs to be appropriately escaped by the implementation when it * is written out. In order to assign an attribute value that contains entity * references, the user must create an DOMAttr * node plus any DOMText and DOMEntityReference * nodes, build the appropriate subtree, and use * setAttributeNodeNS or setAttributeNode to assign * it as the value of an attribute. * * @param namespaceURI The namespace URI of * the attribute to create or alter. * @param qualifiedName The qualified name of the * attribute to create or alter. * @param value The value to set in string form. * @exception DOMException * INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an * illegal character. *
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. *
* NAMESPACE_ERR: Raised if the qualifiedName is * malformed, if the qualifiedName has a prefix and the * namespaceURI is null or an empty string, * if the qualifiedName has a prefix that is "xml" and the * namespaceURI is different from * "http://www.w3.org/XML/1998/namespace", if the * qualifiedName has a prefix that is "xmlns" and the * namespaceURI is different from * "http://www.w3.org/2000/xmlns/", or if the * qualifiedName is "xmlns" and the * namespaceURI is different from * "http://www.w3.org/2000/xmlns/". * @since DOM Level 2 */ virtual void setAttributeNS(const XMLCh *namespaceURI, const XMLCh *qualifiedName, const XMLCh *value) = 0; /** * Removes an attribute by local name and namespace URI. If the * removed attribute has a default value it is immediately replaced. * The replacing attribute has the same namespace URI and local name, as well as * the original prefix. * * @param namespaceURI The namespace URI of * the attribute to remove. * @param localName The local name of the * attribute to remove. * @exception DOMException * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. * @since DOM Level 2 */ virtual void removeAttributeNS(const XMLCh *namespaceURI, const XMLCh *localName) = 0; /** * Retrieves an DOMAttr node by local name and namespace URI. * * @param namespaceURI The namespace URI of * the attribute to retrieve. * @param localName The local name of the * attribute to retrieve. * @return The DOMAttr node with the specified attribute local * name and namespace URI or null if there is no such attribute. * @since DOM Level 2 */ virtual DOMAttr * getAttributeNodeNS(const XMLCh *namespaceURI, const XMLCh *localName) const = 0; /** * Adds a new attribute. * * If an attribute with that local name and namespace URI is already present * in the element, it is replaced by the new one. * * @param newAttr The DOMAttr node to add to the attribute list. * @return If the newAttr attribute replaces an existing * attribute with the same local name and namespace URI, * the replaced DOMAttr node is * returned, otherwise null is returned. * @exception DOMException * WRONG_DOCUMENT_ERR: Raised if newAttr was created from a * different document than the one that created the element. *
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. *
INUSE_ATTRIBUTE_ERR: Raised if newAttr is already an * attribute of another DOMElement object. The DOM user must * explicitly clone DOMAttr nodes to re-use them in other * elements. * @since DOM Level 2 */ virtual DOMAttr * setAttributeNodeNS(DOMAttr *newAttr) = 0; /** * Returns a DOMNodeList of all the DOMElements * with a given local name and namespace URI in the order in which they * would be encountered in a preorder traversal of the * DOMDocument tree, starting from this node. * * @param namespaceURI The namespace URI of * the elements to match on. The special value "*" matches all * namespaces. * @param localName The local name of the * elements to match on. The special value "*" matches all local names. * @return A new DOMNodeList object containing all the matched * DOMElements. * @since DOM Level 2 */ virtual DOMNodeList * getElementsByTagNameNS(const XMLCh *namespaceURI, const XMLCh *localName) const = 0; /** * Returns true when an attribute with a given name is * specified on this element or has a default value, false * otherwise. * @param name The name of the attribute to look for. * @return true if an attribute with the given name is * specified on this element or has a default value, false * otherwise. * @since DOM Level 2 */ virtual bool hasAttribute(const XMLCh *name) const = 0; /** * Returns true when an attribute with a given local name and * namespace URI is specified on this element or has a default value, * false otherwise. HTML-only DOM implementations do not * need to implement this method. * @param namespaceURI The namespace URI of the attribute to look for. * @param localName The local name of the attribute to look for. * @return true if an attribute with the given local name * and namespace URI is specified or has a default value on this * element, false otherwise. * @since DOM Level 2 */ virtual bool hasAttributeNS(const XMLCh *namespaceURI, const XMLCh *localName) const = 0; //@} /** @name Functions introduced in DOM Level 3 */ //@{ /** * If the parameter isId is true, this method declares the specified * attribute to be a user-determined ID attribute. * This affects the value of DOMAttr::isId and the behavior of * DOMDocument::getElementById, but does not change any schema that * may be in use, in particular this does not affect the DOMAttr::getSchemaTypeInfo * of the specified DOMAttr node. Use the value false for the parameter isId * to undeclare an attribute for being a user-determined ID attribute. * To specify an DOMAttr by local name and namespace URI, use the * setIdAttributeNS method. * * @param name The name of the DOMAttr. * @param isId Whether the attribute is of type ID. * @exception DOMException * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
* NOT_FOUND_ERR: Raised if the specified node is not an DOMAttr * of this element. * * @since DOM Level 3 */ virtual void setIdAttribute(const XMLCh* name, bool isId) = 0; /** * If the parameter isId is true, this method declares the specified * attribute to be a user-determined ID attribute. * This affects the value of DOMAttr::isId and the behavior of * DOMDocument::getElementById, but does not change any schema that * may be in use, in particular this does not affect the DOMAttr::getSchemaTypeInfo * of the specified DOMAttr node. Use the value false for the parameter isId * to undeclare an attribute for being a user-determined ID attribute. * * @param namespaceURI The namespace URI of the DOMAttr. * @param localName The local name of the DOMAttr. * @param isId Whether the attribute is of type ID. * @exception DOMException * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
* NOT_FOUND_ERR: Raised if the specified node is not an DOMAttr of this element. * * @since DOM Level 3 */ virtual void setIdAttributeNS(const XMLCh* namespaceURI, const XMLCh* localName, bool isId) = 0; /** * If the parameter isId is true, this method declares the specified * attribute to be a user-determined ID attribute. * This affects the value of DOMAttr::isId and the behavior of * DOMDocument::getElementById, but does not change any schema that * may be in use, in particular this does not affect the DOMAttr::getSchemaTypeInfo * of the specified DOMAttr node. Use the value false for the parameter isId * to undeclare an attribute for being a user-determined ID attribute. * * @param idAttr The DOMAttr node. * @param isId Whether the attribute is of type ID. * @exception DOMException * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
* NOT_FOUND_ERR: Raised if the specified node is not an DOMAttr of this element. * * @since DOM Level 3 */ virtual void setIdAttributeNode(const DOMAttr *idAttr, bool isId) = 0; /** * Returns the type information associated with this element. * * @return the DOMTypeInfo associated with this element * @since DOM level 3 */ virtual const DOMTypeInfo* getSchemaTypeInfo() const = 0; //@} // ----------------------------------------------------------------------- // DOMElementTraversal interface // ----------------------------------------------------------------------- /** @name Functions introduced in the ElementTraversal specification (http://www.w3.org/TR/2008/REC-ElementTraversal-20081222/)*/ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * The first child of type DOMElement. * * @return The DOMElement object that is the first element node * among the child nodes of this node, or null if there is none. */ virtual DOMElement * getFirstElementChild() const = 0; /** * The last child of type DOMElement. * * @return The DOMElement object that is the last element node * among the child nodes of this node, or null if there is none. */ virtual DOMElement * getLastElementChild() const = 0; /** * The previous sibling node of type DOMElement. * * @return The DOMElement object that is the previous sibling element node * in document order, or null if there is none. */ virtual DOMElement * getPreviousElementSibling() const = 0; /** * The next sibling node of type DOMElement. * * @return The DOMElement object that is the next sibling element node * in document order, or null if there is none. */ virtual DOMElement * getNextElementSibling() const = 0; /** * The number of child nodes that are of type DOMElement. * * Note: the count is computed every time this function is invoked * * @return The number of DOMElement objects that are direct children * of this object (nested elements are not counted), or 0 if there is none. * */ virtual XMLSize_t getChildElementCount() const = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMXPathException.cpp000644 000765 000024 00000003067 13241160337 023022 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "DOMXPathException.hpp" #include #include #include #include "impl/DOMImplementationImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN DOMXPathException::DOMXPathException() : DOMException() { } DOMXPathException::DOMXPathException(short exCode, short messageCode, MemoryManager* const memoryManager) : DOMException(exCode, messageCode?messageCode:XMLDOMMsg::DOMXPATHEXCEPTION_ERRX+exCode-DOMXPathException::INVALID_EXPRESSION_ERR+1, memoryManager) { } DOMXPathException::DOMXPathException(const DOMXPathException &other) : DOMException(other) { } DOMXPathException::~DOMXPathException() { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/DOMTreeWalker.hpp000644 000765 000024 00000026634 13241160336 022175 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMTreeWalker.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMTREEWALKER_HPP) #define XERCESC_INCLUDE_GUARD_DOMTREEWALKER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * DOMTreeWalker objects are used to navigate a document tree or * subtree using the view of the document defined by their * whatToShow flags and filter (if any). Any function which * performs navigation using a DOMTreeWalker will automatically * support any view defined by a DOMTreeWalker. *

Omitting nodes from the logical view of a subtree can result in a * structure that is substantially different from the same subtree in the * complete, unfiltered document. Nodes that are siblings in the * DOMTreeWalker view may be children of different, widely * separated nodes in the original view. For instance, consider a * DOMNodeFilter that skips all nodes except for DOMText nodes and * the root node of a document. In the logical view that results, all text * nodes will be siblings and appear as direct children of the root node, no * matter how deeply nested the structure of the original document. *

See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. * * @since DOM Level 2 */ class CDOM_EXPORT DOMTreeWalker { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMTreeWalker() {} DOMTreeWalker(const DOMTreeWalker &) {} //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMTreeWalker & operator = (const DOMTreeWalker &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMTreeWalker() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMTreeWalker interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 2 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * The root node of the DOMTreeWalker, as specified * when it was created. * * @since DOM Level 2 */ virtual DOMNode* getRoot() = 0; /** * This attribute determines which node types are presented via the * DOMTreeWalker. The available set of constants is defined in * the DOMNodeFilter interface. Nodes not accepted by * whatToShow will be skipped, but their children may still * be considered. Note that this skip takes precedence over the filter, * if any. * * @since DOM Level 2 */ virtual DOMNodeFilter::ShowType getWhatToShow()= 0; /** * Return The filter used to screen nodes. * * @since DOM Level 2 */ virtual DOMNodeFilter* getFilter()= 0; /** * The value of this flag determines whether the children of entity * reference nodes are visible to the DOMTreeWalker. If false, * these children and their descendants will be rejected. Note that * this rejection takes precedence over whatToShow and the * filter, if any. *
To produce a view of the document that has entity references * expanded and does not expose the entity reference node itself, use * the whatToShow flags to hide the entity reference node * and set expandEntityReferences to true when creating the * DOMTreeWalker. To produce a view of the document that has * entity reference nodes but no entity expansion, use the * whatToShow flags to show the entity reference node and * set expandEntityReferences to false. * * @since DOM Level 2 */ virtual bool getExpandEntityReferences()= 0; /** * Return the node at which the DOMTreeWalker is currently positioned. * * @since DOM Level 2 */ virtual DOMNode* getCurrentNode()= 0; // ----------------------------------------------------------------------- // Query methods // ----------------------------------------------------------------------- /** * Moves to and returns the closest visible ancestor node of the current * node. If the search for parentNode attempts to step * upward from the DOMTreeWalker's root node, or * if it fails to find a visible ancestor node, this method retains the * current position and returns null. * @return The new parent node, or null if the current node * has no parent in the DOMTreeWalker's logical view. * * @since DOM Level 2 */ virtual DOMNode* parentNode()= 0; /** * Moves the DOMTreeWalker to the first visible child of the * current node, and returns the new node. If the current node has no * visible children, returns null, and retains the current * node. * @return The new node, or null if the current node has no * visible children in the DOMTreeWalker's logical view. * * @since DOM Level 2 */ virtual DOMNode* firstChild()= 0; /** * Moves the DOMTreeWalker to the last visible child of the * current node, and returns the new node. If the current node has no * visible children, returns null, and retains the current * node. * @return The new node, or null if the current node has no * children in the DOMTreeWalker's logical view. * * @since DOM Level 2 */ virtual DOMNode* lastChild()= 0; /** * Moves the DOMTreeWalker to the previous sibling of the * current node, and returns the new node. If the current node has no * visible previous sibling, returns null, and retains the * current node. * @return The new node, or null if the current node has no * previous sibling. in the DOMTreeWalker's logical view. * * @since DOM Level 2 */ virtual DOMNode* previousSibling()= 0; /** * Moves the DOMTreeWalker to the next sibling of the current * node, and returns the new node. If the current node has no visible * next sibling, returns null, and retains the current node. * @return The new node, or null if the current node has no * next sibling. in the DOMTreeWalker's logical view. * * @since DOM Level 2 */ virtual DOMNode* nextSibling()= 0; /** * Moves the DOMTreeWalker to the previous visible node in * document order relative to the current node, and returns the new * node. If the current node has no previous node, or if the search for * previousNode attempts to step upward from the * DOMTreeWalker's root node, returns * null, and retains the current node. * @return The new node, or null if the current node has no * previous node in the DOMTreeWalker's logical view. * * @since DOM Level 2 */ virtual DOMNode* previousNode()= 0; /** * Moves the DOMTreeWalker to the next visible node in document * order relative to the current node, and returns the new node. If the * current node has no next node, or if the search for nextNode attempts * to step upward from the DOMTreeWalker's root * node, returns null, and retains the current node. * @return The new node, or null if the current node has no * next node in the DOMTreeWalker's logical view. * * @since DOM Level 2 */ virtual DOMNode* nextNode()= 0; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** * The node at which the DOMTreeWalker is currently positioned. *
Alterations to the DOM tree may cause the current node to no longer * be accepted by the DOMTreeWalker's associated filter. * currentNode may also be explicitly set to any node, * whether or not it is within the subtree specified by the * root node or would be accepted by the filter and * whatToShow flags. Further traversal occurs relative to * currentNode even if it is not part of the current view, * by applying the filters in the requested direction; if no traversal * is possible, currentNode is not changed. * @exception DOMException * NOT_SUPPORTED_ERR: Raised if an attempt is made to set * currentNode to null. * * @since DOM Level 2 */ virtual void setCurrentNode(DOMNode* currentNode)= 0; //@} // ----------------------------------------------------------------------- // Non-standard Extension // ----------------------------------------------------------------------- /** @name Non-standard Extension */ //@{ /** * Called to indicate that this TreeWalker is no longer in use * and that the implementation may relinquish any resources associated with it. * * Access to a released object will lead to unexpected result. */ virtual void release() = 0; //@} }; #define GetDOMTreeWalkerMemoryManager GET_INDIRECT_MM(fCurrentNode) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMXPathNSResolver.hpp000644 000765 000024 00000011157 13241160337 023132 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMXPathNSResolver.hpp 698579 2008-09-24 14:13:08Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHNSRESOLVER_HPP) #define XERCESC_INCLUDE_GUARD_DOMXPATHNSRESOLVER_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * The DOMXPathNSResolver interface permit prefix strings * in the expression to be properly bound to namespaceURI strings. * DOMXPathEvaluator can construct an implementation of * DOMXPathNSResolver from a node, or the interface may be * implemented by any application. * @since DOM Level 3 */ class CDOM_EXPORT DOMXPathNSResolver { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMXPathNSResolver() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMXPathNSResolver(const DOMXPathNSResolver &); DOMXPathNSResolver& operator = (const DOMXPathNSResolver&); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMXPathNSResolver() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMDocument interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ /** Look up the namespace URI associated to the given namespace prefix. * * @param prefix of type XMLCh - The prefix to look for. An empty or * null string denotes the default namespace. * @return the associated namespace URI or null if none is found. */ virtual const XMLCh* lookupNamespaceURI(const XMLCh* prefix) const = 0; //@} // ----------------------------------------------------------------------- // Non-standard extension // ----------------------------------------------------------------------- /** @name Non-standard extension */ //@{ /** * Non-standard extension * * XPath2 implementations require a reverse lookup in the static context. * Look up the prefix associated with the namespace URI * @param URI of type XMLCh - The namespace to look for. * @return the associated prefix which can be an empty string if this * is a default namespace or null if none is found. */ virtual const XMLCh* lookupPrefix(const XMLCh* URI) const = 0; /** * Non-standard extension * * Associate the given namespace prefix to the namespace URI. * @param prefix of type XMLCh - The namespace prefix to bind. An empty * or null string denotes the default namespace. * @param uri of type XMLCh - The associated namespace URI. If this * argument is null or an empty string then the existing binding for this * prefix is removed. */ virtual void addNamespaceBinding(const XMLCh* prefix, const XMLCh* uri) = 0; /** * Called to indicate that this object (and its associated children) is no longer in use * and that the implementation may relinquish any resources associated with it and * its associated children. * * Access to a released object will lead to unexpected result. */ virtual void release() = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMException.cpp000644 000765 000024 00000004743 13241160337 022057 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMException.cpp 671894 2008-06-26 13:29:21Z borisk $ */ #include #include #include #include #include #include "impl/DOMImplementationImpl.hpp" #include "DOMException.hpp" XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Destructor and Constructor // --------------------------------------------------------------------------- DOMException::~DOMException() { if (msg && fMsgOwned) fMemoryManager->deallocate((void*)msg); } DOMException::DOMException() :code(0) ,msg(0) ,fMemoryManager(0) ,fMsgOwned(false) { } DOMException::DOMException(short exCode, short messageCode, MemoryManager* const memoryManager) :code(exCode) ,fMemoryManager(0) ,fMsgOwned(true) { if (memoryManager) fMemoryManager = memoryManager->getExceptionMemoryManager(); const XMLSize_t msgSize = 2047; XMLCh errText[msgSize + 1]; // load the text if(messageCode==0) messageCode=XMLDOMMsg::DOMEXCEPTION_ERRX+exCode; msg = XMLString::replicate ( DOMImplementationImpl::getMsgLoader4DOM()->loadMsg(messageCode, errText, msgSize) ? errText : XMLUni::fgDefErrMsg , fMemoryManager ); } DOMException::DOMException(const DOMException &other) :code(other.code) ,msg(0) ,fMemoryManager(other.fMemoryManager) ,fMsgOwned(other.fMsgOwned) { if (other.msg) msg = other.fMsgOwned? XMLString::replicate(other.msg, other.fMemoryManager) : other.msg; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/DOMLSInput.hpp000644 000765 000024 00000022547 13241160337 021466 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLSInput.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMLSINPUT_HPP) #define XERCESC_INCLUDE_GUARD_DOMLSINPUT_HPP #include XERCES_CPP_NAMESPACE_BEGIN class InputSource; /** * This interface represents a single input source for an XML entity. * *

This interface allows an application to encapsulate information about * an input source in a single object, which may include a public identifier, * a system identifier, a byte stream (possibly with a specified encoding), * and/or a character stream.

* *

There are two places that the application will deliver this input source * to the parser: as the argument to the parse method, or as the return value * of the DOMLSResourceResolver.resolveResource method.

* *

The DOMLSParser will use the DOMLSInput object to determine how to * read XML input. If there is a character stream available, the parser will * read that stream directly; if not, the parser will use a byte stream, if * available; if neither a character stream nor a byte stream is available, * the parser will attempt to open a URI connection to the resource identified * by the system identifier.

* *

A DOMLSInput object belongs to the application: the parser shall * never modify it in any way (it may modify a copy if necessary).

* * @see DOMLSParser#parse * @see DOMLSResourceResolver#resolveResource * @since DOM Level 3 */ class CDOM_EXPORT DOMLSInput { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMLSInput() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMLSInput(const DOMLSInput &); DOMLSInput & operator = (const DOMLSInput &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMLSInput() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMLSInput interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * String data to parse. If provided, this will always be treated as a sequence of 16-bit units (UTF-16 encoded characters). * It is not a requirement to have an XML declaration when using stringData. If an XML declaration is present, the value of * the encoding attribute will be ignored. * */ virtual const XMLCh* getStringData() const = 0; /** * Returns the byte stream for this input source. * * @see InputSource */ virtual InputSource* getByteStream() const = 0; /** * An input source can be set to force the parser to assume a particular * encoding for the data that input source reprsents, via the setEncoding() * method. This method returns name of the encoding that is to be forced. * If the encoding has never been forced, it returns a null pointer. * * @return The forced encoding, or null if none was supplied. * @see #setEncoding * @since DOM Level 3 */ virtual const XMLCh* getEncoding() const = 0; /** * Get the public identifier for this input source. * * @return The public identifier, or null if none was supplied. * @see #setPublicId * @since DOM Level 3 */ virtual const XMLCh* getPublicId() const = 0; /** * Get the system identifier for this input source. * *

If the system ID is a URL, it will be fully resolved.

* * @return The system identifier. * @see #setSystemId * @since DOM Level 3 */ virtual const XMLCh* getSystemId() const = 0; /** * Get the base URI to be used for resolving relative URIs to absolute * URIs. If the baseURI is itself a relative URI, the behavior is * implementation dependent. * * @return The base URI. * @see #setBaseURI * @since DOM Level 3 */ virtual const XMLCh* getBaseURI() const = 0; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- /** * Sets the UTF-16 string for this input source. * */ virtual void setStringData(const XMLCh* data) = 0; /** * Sets the byte stream for this input source. * * @see BinInputStream */ virtual void setByteStream(InputSource* stream) = 0; /** * Set the encoding which will be required for use with the XML text read * via a stream opened by this input source. * *

This is usually not set, allowing the encoding to be sensed in the * usual XML way. However, in some cases, the encoding in the file is known * to be incorrect because of intermediate transcoding, for instance * encapsulation within a MIME document. * * @param encodingStr The name of the encoding to force. * @since DOM Level 3 */ virtual void setEncoding(const XMLCh* const encodingStr) = 0; /** * Set the public identifier for this input source. * *

The public identifier is always optional: if the application writer * includes one, it will be provided as part of the location information.

* * @param publicId The public identifier as a string. * @see #getPublicId * @since DOM Level 3 */ virtual void setPublicId(const XMLCh* const publicId) = 0; /** * Set the system identifier for this input source. * *

The system id is always required. The public id may be used to map * to another system id, but the system id must always be present as a fall * back.

* *

If the system ID is a URL, it must be fully resolved.

* * @param systemId The system identifier as a string. * @see #getSystemId * @since DOM Level 3 */ virtual void setSystemId(const XMLCh* const systemId) = 0; /** * Set the base URI to be used for resolving relative URIs to absolute * URIs. If the baseURI is itself a relative URI, the behavior is * implementation dependent. * * @param baseURI The base URI. * @see #getBaseURI * @since DOM Level 3 */ virtual void setBaseURI(const XMLCh* const baseURI) = 0; //@} // ----------------------------------------------------------------------- // Non-standard Extension // ----------------------------------------------------------------------- /** @name Non-standard Extension */ //@{ /** * Indicates if the parser should issue fatal error if this input source * is not found. If set to false, the parser issue warning message instead. * * @param flag True if the parser should issue fatal error if this input source is not found. * If set to false, the parser issue warning message instead. (Default: true) * * @see #getIssueFatalErrorIfNotFound */ virtual void setIssueFatalErrorIfNotFound(bool flag) = 0; /** * Get the flag that indicates if the parser should issue fatal error if this input source * is not found. * * @return True if the parser should issue fatal error if this input source is not found. * False if the parser issue warning message instead. * @see #setIssueFatalErrorIfNotFound */ virtual bool getIssueFatalErrorIfNotFound() const = 0; /** * Called to indicate that this DOMLSInput is no longer in use * and that the implementation may relinquish any resources associated with it. * * Access to a released object will lead to unexpected result. */ virtual void release() = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMTypeInfo.hpp000644 000765 000024 00000022322 13241160337 021654 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(XERCESC_INCLUDE_GUARD_DOMTYPEINFO_HPP) #define XERCESC_INCLUDE_GUARD_DOMTYPEINFO_HPP //------------------------------------------------------------------------------------ // Includes //------------------------------------------------------------------------------------ #include XERCES_CPP_NAMESPACE_BEGIN /** * The DOMTypeInfo interface represent a type used by * DOMElement or DOMAttr nodes, specified in the * schemas associated with the document. The type is a pair of a namespace URI * and name properties, and depends on the document's schema. */ class CDOM_EXPORT DOMTypeInfo { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMTypeInfo() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMTypeInfo(const DOMTypeInfo &); DOMTypeInfo & operator = (const DOMTypeInfo &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMTypeInfo() {}; //@} // ----------------------------------------------------------------------- // Class Types // ----------------------------------------------------------------------- /** @name Public Contants */ //@{ /** * These are the available values for the derivationMethod parameter used by the * method DOMTypeInfo::isDerivedFrom(). It is a set of possible types * of derivation, and the values represent bit positions. If a bit in the derivationMethod * parameter is set to 1, the corresponding type of derivation will be taken into account * when evaluating the derivation between the reference type definition and the other type * definition. When using the isDerivedFrom method, combining all of them in the * derivationMethod parameter is equivalent to invoking the method for each of them separately * and combining the results with the OR boolean function. This specification only defines * the type of derivation for XML Schema. * * In addition to the types of derivation listed below, please note that: * - any type derives from xsd:anyType. * - any simple type derives from xsd:anySimpleType by restriction. * - any complex type does not derive from xsd:anySimpleType by restriction. * *

DERIVATION_EXTENSION: * If the document's schema is an XML Schema [XML Schema Part 1], this constant represents the * derivation by extension. The reference type definition is derived by extension from the other * type definition if the other type definition can be reached recursively following the * {base type definition} property from the reference type definition, and at least one of the * derivation methods involved is an extension.

* *

DERIVATION_LIST: * If the document's schema is an XML Schema [XML Schema Part 1], this constant represents the list. * The reference type definition is derived by list from the other type definition if there exists * two type definitions T1 and T2 such as the reference type definition is derived from T1 by * DERIVATION_RESTRICTION or DERIVATION_EXTENSION, T2 is derived from the other type definition by * DERIVATION_RESTRICTION, T1 has {variety} list, and T2 is the {item type definition}. Note that * T1 could be the same as the reference type definition, and T2 could be the same as the other * type definition.

* *

DERIVATION_RESTRICTION: * If the document's schema is an XML Schema [XML Schema Part 1], this constant represents the * derivation by restriction if complex types are involved, or a restriction if simple types are * involved. * The reference type definition is derived by restriction from the other type definition if the * other type definition is the same as the reference type definition, or if the other type definition * can be reached recursively following the {base type definition} property from the reference type * definition, and all the derivation methods involved are restriction.

* *

DERIVATION_UNION: * If the document's schema is an XML Schema [XML Schema Part 1], this constant represents the union * if simple types are involved. * The reference type definition is derived by union from the other type definition if there exists * two type definitions T1 and T2 such as the reference type definition is derived from T1 by * DERIVATION_RESTRICTION or DERIVATION_EXTENSION, T2 is derived from the other type definition by * DERIVATION_RESTRICTION, T1 has {variety} union, and one of the {member type definitions} is T2. * Note that T1 could be the same as the reference type definition, and T2 could be the same as the * other type definition.

* * @since DOM Level 3 * */ enum DerivationMethods { DERIVATION_RESTRICTION = 0x001, DERIVATION_EXTENSION = 0x002, DERIVATION_UNION = 0x004, DERIVATION_LIST = 0x008 }; //@} //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Returns The name of a type declared for the associated DOMElement * or DOMAttr, or null if unknown. * * @return The name of a type declared for the associated DOMElement * or DOMAttribute, or null if unknown. * @since DOM level 3 */ virtual const XMLCh* getTypeName() const = 0; /** * The namespace of the type declared for the associated DOMElement * or DOMAttr or null if the DOMElement does not have * declaration or if no namespace information is available. * * @return The namespace of the type declared for the associated DOMElement * or DOMAttr or null if the DOMElement does not have * declaration or if no namespace information is available. * @since DOM level 3 */ virtual const XMLCh* getTypeNamespace() const = 0; //@} //@{ /** * This method returns if there is a derivation between the reference type definition, * i.e. the DOMTypeInfo on which the method is being called, and the other type definition, * i.e. the one passed as parameters. * * @param typeNamespaceArg The namespace of the other type definition. * @param typeNameArg The name of the other type definition. * @param derivationMethod The type of derivation and conditions applied between two types, * as described in the list of constants provided in this interface. * @return If the document's schema is a DTD or no schema is associated with the document, * this method will always return false. * If the document's schema is an XML Schema, the method will true if the reference * type definition is derived from the other type definition according to the derivation * parameter. If the value of the parameter is 0 (no bit is set to 1 for the * derivationMethod parameter), the method will return true if the other type definition * can be reached by recursing any combination of {base type definition}, * {item type definition}, or {member type definitions} from the reference type definition. * @since DOM level 3 */ virtual bool isDerivedFrom(const XMLCh* typeNamespaceArg, const XMLCh* typeNameArg, DerivationMethods derivationMethod) const = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif /** * End of file DOMTypeInfo.hpp */ xerces-c-3.2.2/src/xercesc/dom/DOMNodeList.hpp000644 000765 000024 00000007343 13241160337 021646 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNodeList.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMNODELIST_HPP) #define XERCESC_INCLUDE_GUARD_DOMNODELIST_HPP #include XERCES_CPP_NAMESPACE_BEGIN class DOMNode; /** * The DOMNodeList interface provides the abstraction of an ordered * collection of nodes. DOMNodeLists are created by DOMDocument::getElementsByTagName(), * DOMNode::getChildNodes(), * *

The items in the DOMNodeList are accessible via an integral * index, starting from 0. * * DOMNodeLists are "live", in that any changes to the document tree are immediately * reflected in any DOMNodeLists that may have been created for that tree. */ class CDOM_EXPORT DOMNodeList { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMNodeList() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMNodeList(const DOMNodeList &); DOMNodeList & operator = (const DOMNodeList &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMNodeList() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMNodeList interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 1 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Returns the index item in the collection. * * If index is greater than or equal to the number of nodes in * the list, this returns null. * * @param index Index into the collection. * @return The node at the indexth position in the * DOMNodeList, or null if that is not a valid * index. * @since DOM Level 1 */ virtual DOMNode *item(XMLSize_t index) const = 0; /** * Returns the number of nodes in the list. * * The range of valid child node indices is 0 to length-1 inclusive. * @since DOM Level 1 */ virtual XMLSize_t getLength() const = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMPSVITypeInfo.hpp000644 000765 000024 00000007766 13241160337 022375 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(XERCESC_INCLUDE_GUARD_DOMPSVITYPEINFO_HPP) #define XERCESC_INCLUDE_GUARD_DOMPSVITYPEINFO_HPP //------------------------------------------------------------------------------------ // Includes //------------------------------------------------------------------------------------ #include XERCES_CPP_NAMESPACE_BEGIN /** * The DOMPSVITypeInfo interface represent the PSVI info used by * DOMElement or DOMAttr nodes, specified in the * schemas associated with the document. */ class CDOM_EXPORT DOMPSVITypeInfo { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMPSVITypeInfo() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMPSVITypeInfo(const DOMPSVITypeInfo &); DOMPSVITypeInfo & operator = (const DOMPSVITypeInfo &); //@} public: enum PSVIProperty { PSVI_Validity , PSVI_Validation_Attempted , PSVI_Type_Definition_Type , PSVI_Type_Definition_Name , PSVI_Type_Definition_Namespace , PSVI_Type_Definition_Anonymous , PSVI_Nil , PSVI_Member_Type_Definition_Name , PSVI_Member_Type_Definition_Namespace , PSVI_Member_Type_Definition_Anonymous , PSVI_Schema_Default , PSVI_Schema_Normalized_Value , PSVI_Schema_Specified }; // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMPSVITypeInfo() {}; //@} //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Returns the string value of the specified PSVI property associated to a * DOMElement or DOMAttr, or null if not available. * * * @return the string value of the specified PSVI property associated to a * DOMElement or DOMAttr, or null if not available. */ virtual const XMLCh* getStringProperty(PSVIProperty prop) const = 0; /** * Returns the numeric value of the specified PSVI property associated to a * DOMElement or DOMAttr, or null if not available. * * * @return the numeric value of the specified PSVI property associated to a * DOMElement or DOMAttr, or null if not available. */ virtual int getNumericProperty(PSVIProperty prop) const = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif /** * End of file DOMPSVITypeInfo.hpp */ xerces-c-3.2.2/src/xercesc/dom/DOMXPathException.hpp000644 000765 000024 00000006456 13241160337 023034 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMXPathException.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_DOMXPATHEXCEPTION_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * @since DOM Level 3 */ class CDOM_EXPORT DOMXPathException : public DOMException { public: //@{ /** * ExceptionCode *
INVALID_EXPRESSION_ERR The expression has a syntax error or otherwise * is not a legal expression according to the rules of the specific * DOMXPathEvaluator or contains specialized extension functions * or variables not supported by this implementation. *
TYPE_ERR The expression cannot be converted to return the specified type. *
NO_RESULT_ERROR There is no current result in the result object. */ enum ExceptionCode { INVALID_EXPRESSION_ERR = 51, TYPE_ERR = 52, NO_RESULT_ERROR = 53 }; //@} public: // ----------------------------------------------------------------------- // Constructors // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * Default constructor for DOMXPathException. * */ DOMXPathException(); /** * Constructor which takes an error code and a message. * * @param code The error code which indicates the exception * @param messageCode The string containing the error message * @param memoryManager The memory manager used to (de)allocate memory */ DOMXPathException(short code, short messageCode = 0, MemoryManager* const memoryManager = XMLPlatformUtils::fgMemoryManager); /** * Copy constructor. * * @param other The object to be copied. */ DOMXPathException(const DOMXPathException &other); //@} // ----------------------------------------------------------------------- // Destructors // ----------------------------------------------------------------------- /** @name Destructor. */ //@{ /** * Destructor for DOMXPathException. * */ virtual ~DOMXPathException(); //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMXPathException& operator = (const DOMXPathException&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMEntity.hpp000644 000765 000024 00000015125 13241160337 021376 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMEntity.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMENTITY_HPP) #define XERCESC_INCLUDE_GUARD_DOMENTITY_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * This interface represents an entity, either parsed or unparsed, in an XML * document. Note that this models the entity itself not the entity * declaration. DOMEntity declaration modeling has been left for a * later Level of the DOM specification. *

The nodeName attribute that is inherited from * DOMNode contains the name of the entity. *

An XML processor may choose to completely expand entities before the * structure model is passed to the DOM; in this case there will be no * DOMEntityReference nodes in the document tree. *

XML does not mandate that a non-validating XML processor read and * process entity declarations made in the external subset or declared in * external parameter entities. This means that parsed entities declared in * the external subset need not be expanded by some classes of applications, * and that the replacement value of the entity may not be available. When * the replacement value is available, the corresponding DOMEntity * node's child list represents the structure of that replacement text. * Otherwise, the child list is empty. *

The DOM Level 2 does not support editing DOMEntity nodes; if a * user wants to make changes to the contents of an DOMEntity, * every related DOMEntityReference node has to be replaced in the * structure model by a clone of the DOMEntity's contents, and * then the desired changes must be made to each of those clones instead. * DOMEntity nodes and all their descendants are readonly. *

An DOMEntity node does not have any parent.If the entity * contains an unbound namespace prefix, the namespaceURI of * the corresponding node in the DOMEntity node subtree is * null. The same is true for DOMEntityReference * nodes that refer to this entity, when they are created using the * createEntityReference method of the DOMDocument * interface. The DOM Level 2 does not support any mechanism to resolve * namespace prefixes. *

See also the Document Object Model (DOM) Level 2 Core Specification. * * @since DOM Level 1 */ class CDOM_EXPORT DOMEntity: public DOMNode { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMEntity() {} DOMEntity(const DOMEntity &other) : DOMNode(other) {} //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented operators */ //@{ DOMEntity & operator = (const DOMEntity &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMEntity() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMEntity interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 1 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * The public identifier associated with the entity, if specified. * * If the public identifier was not specified, this is null. * * @since DOM Level 1 */ virtual const XMLCh * getPublicId() const = 0; /** * The system identifier associated with the entity, if specified. * * If the system identifier was not specified, this is null. * * @since DOM Level 1 */ virtual const XMLCh * getSystemId() const = 0; /** * For unparsed entities, the name of the notation for the entity. * * For parsed entities, this is null. * * @since DOM Level 1 */ virtual const XMLCh * getNotationName() const = 0; //@} /** @name Functions introduced in DOM Level 3. */ //@{ /** * An attribute specifying the encoding used for this entity at the time of parsing, * when it is an external parsed entity. This is null if it an entity * from the internal subset or if it is not known. * * @since DOM Level 3 */ virtual const XMLCh* getInputEncoding() const = 0; /** * An attribute specifying, as part of the text declaration, the encoding * of this entity, when it is an external parsed entity. This is * null otherwise. * * @since DOM Level 3 */ virtual const XMLCh* getXmlEncoding() const = 0; /** * An attribute specifying, as part of the text declaration, the version * number of this entity, when it is an external parsed entity. This is * null otherwise. * * @since DOM Level 3 */ virtual const XMLCh* getXmlVersion() const = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMText.hpp000644 000765 000024 00000017066 13241160337 021054 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMText.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMTEXT_HPP) #define XERCESC_INCLUDE_GUARD_DOMTEXT_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * The DOMText interface inherits from DOMCharacterData * and represents the textual content (termed character data in XML) of an * DOMElement or DOMAttr. If there is no markup inside * an element's content, the text is contained in a single object * implementing the DOMText interface that is the only child of * the element. If there is markup, it is parsed into the information items * (elements, comments, etc.) and DOMText nodes that form the list * of children of the element. *

When a document is first made available via the DOM, there is only one * DOMText node for each block of text. Users may create adjacent * DOMText nodes that represent the contents of a given element * without any intervening markup, but should be aware that there is no way * to represent the separations between these nodes in XML or HTML, so they * will not (in general) persist between DOM editing sessions. The * normalize() method on DOMNode merges any such * adjacent DOMText objects into a single node for each block of * text. *

See also the Document Object Model (DOM) Level 2 Core Specification. */ class CDOM_EXPORT DOMText: public DOMCharacterData { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMText() {} DOMText(const DOMText &other) : DOMCharacterData(other) {} //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented operators */ //@{ DOMText & operator = (const DOMText &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMText() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMText interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 1 */ //@{ /** * Breaks this node into two nodes at the specified offset, * keeping both in the tree as siblings. After being split, this node * will contain all the content up to the offset point. A * new node of the same type, which contains all the content at and * after the offset point, is returned. If the original * node had a parent node, the new node is inserted as the next sibling * of the original node. When the offset is equal to the * length of this node, the new node has no data. * @param offset The 16-bit unit offset at which to split, starting from * 0. * @return The new node, of the same type as this node. * @exception DOMException * INDEX_SIZE_ERR: Raised if the specified offset is negative or greater * than the number of 16-bit units in data. *
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. * @since DOM Level 1 */ virtual DOMText *splitText(XMLSize_t offset) = 0; //@} /** @name Functions introduced in DOM Level 3 */ //@{ /** * Returns whether this text node contains element content whitespace, * often abusively called "ignorable whitespace". The text node is determined * to contain whitespace in element content during the load of the document * or if validation occurs while using DOMDocument::normalizeDocument(). * * @since DOM Level 3 */ virtual bool getIsElementContentWhitespace() const = 0; /** * Returns all text of DOMText nodes logically-adjacent text * nodes to this node, concatenated in document order. * * @since DOM Level 3 */ virtual const XMLCh* getWholeText() const = 0; /** * Substitutes the a specified text for the text of the current node and * all logically-adjacent text nodes. * *
This method returns the node in the hierarchy which received the * replacement text, which is null if the text was empty or is the * current node if the current node is not read-only or otherwise is a * new node of the same type as the current node inserted at the site of * the replacement. All logically-adjacent text nodes are removed * including the current node unless it was the recipient of the * replacement text. *
Where the nodes to be removed are read-only descendants of an * DOMEntityReference, the DOMEntityReference must * be removed instead of the read-only nodes. If any * DOMEntityReference to be removed has descendants that are * not DOMEntityReference, DOMText, or * DOMCDATASection nodes, the replaceWholeText * method must fail before performing any modification of the document, * raising a DOMException with the code * NO_MODIFICATION_ALLOWED_ERR. * * @param content The content of the replacing DOMText node. * @return The DOMText node created with the specified content. * @exception DOMException * NO_MODIFICATION_ALLOWED_ERR: Raised if one of the DOMText * nodes being replaced is readonly. * @since DOM Level 3 */ virtual DOMText* replaceWholeText(const XMLCh* content) = 0; //@} // ----------------------------------------------------------------------- // Non-standard extension // ----------------------------------------------------------------------- /** @name Non-standard extension */ //@{ /** * Non-standard extension * * Return true if this node contains ignorable whitespaces only. * @return True if this node contains ignorable whitespaces only. */ virtual bool isIgnorableWhitespace() const = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/StDOMNode.hpp000644 000765 000024 00000006215 13241160337 021316 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: StDOMNode.hpp 570480 2007-08-28 16:36:34Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_STDOMNODE_HPP) #define XERCESC_INCLUDE_GUARD_STDOMNODE_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN /* This class is a smart pointer implementation over DOMNode interface and ** classes derived from it. It takes care of reference counting automatically. ** Reference counting is optional so use of this class is experimental. */ template class StDOMNode { T* m_node; static inline void INCREFCOUNT(T *x) { if (x != (T*)0) x->incRefCount(); } static inline void DECREFCOUNT(T *x) { if (x != (T*)0) x->decRefCount(); } public: inline StDOMNode(T* node = (T*)0) : m_node(node) { INCREFCOUNT(m_node); } inline StDOMNode(const StDOMNode& stNode) : m_node(stNode.m_node) { INCREFCOUNT(m_node); } inline ~StDOMNode() { DECREFCOUNT(m_node); } inline T* operator= (T *node) { if (m_node != node) { DECREFCOUNT(m_node); m_node = node; INCREFCOUNT(m_node); } return (m_node); } inline bool operator!= (T* node) const { return (m_node != node); } inline bool operator== (T* node) const { return (m_node == node); } inline T& operator* () { return (*m_node); } inline const T& operator* () const { return (*m_node); } inline T* operator-> () const { return (m_node); } inline operator T*() const { return (m_node); } inline void ClearNode() { operator=((T*)(0)); } }; #if defined(XML_DOMREFCOUNT_EXPERIMENTAL) typedef StDOMNode DOMNodeSPtr; #else typedef DOMNode* DOMNodeSPtr; #endif /* StDOMNode is a smart pointer implementation over DOMNode interface and ** classes derived from it. It takes care of reference counting automatically. ** Reference counting is optional so use of this class is experimental. */ #if defined(XML_DOMREFCOUNT_EXPERIMENTAL) typedef StDOMNode DOMAttrSPtr; #else typedef DOMAttr* DOMAttrSPtr; #endif /* StDOMNode is a smart pointer implementation over DOMNode interface and ** classes derived from it. It takes care of reference counting automatically. ** Reference counting is optional so use of this class is experimental. */ #if defined(XML_DOMREFCOUNT_EXPERIMENTAL) typedef StDOMNode DOMElementSPtr; #else typedef DOMElement* DOMElementSPtr; #endif XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMDocument.hpp000644 000765 000024 00000106647 13241160337 021712 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMDocument.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENT_HPP) #define XERCESC_INCLUDE_GUARD_DOMDOCUMENT_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMConfiguration; class DOMDocumentType; class DOMElement; class DOMDocumentFragment; class DOMComment; class DOMCDATASection; class DOMProcessingInstruction; class DOMAttr; class DOMEntity; class DOMEntityReference; class DOMImplementation; class DOMNodeFilter; class DOMNodeList; class DOMNotation; class DOMText; class DOMNode; /** * The DOMDocument interface represents the entire XML * document. Conceptually, it is the root of the document tree, and provides * the primary access to the document's data. *

Since elements, text nodes, comments, processing instructions, etc. * cannot exist outside the context of a DOMDocument, the * DOMDocument interface also contains the factory methods needed * to create these objects. The DOMNode objects created have a * ownerDocument attribute which associates them with the * DOMDocument within whose context they were created. *

See also the Document Object Model (DOM) Level 2 Core Specification. */ class CDOM_EXPORT DOMDocument: public DOMDocumentRange, public DOMXPathEvaluator, public DOMDocumentTraversal, public DOMNode { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMDocument() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMDocument(const DOMDocument &); DOMDocument & operator = (const DOMDocument &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMDocument() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMDocument interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 1 */ //@{ /** * Creates an element of the type specified. Note that the instance * returned implements the DOMElement interface, so attributes * can be specified directly on the returned object. *
In addition, if there are known attributes with default values, * DOMAttr nodes representing them are automatically created * and attached to the element. *
To create an element with a qualified name and namespace URI, use * the createElementNS method. * @param tagName The name of the element type to instantiate. For XML, * this is case-sensitive. * @return A new DOMElement object with the * nodeName attribute set to tagName, and * localName, prefix, and * namespaceURI set to null. * @exception DOMException * INVALID_CHARACTER_ERR: Raised if the specified name contains an * illegal character. * @since DOM Level 1 */ virtual DOMElement *createElement(const XMLCh *tagName) = 0; /** * Creates an empty DOMDocumentFragment object. * @return A new DOMDocumentFragment. * @since DOM Level 1 */ virtual DOMDocumentFragment *createDocumentFragment() = 0; /** * Creates a DOMText node given the specified string. * @param data The data for the node. * @return The new DOMText object. * @since DOM Level 1 */ virtual DOMText *createTextNode(const XMLCh *data) = 0; /** * Creates a DOMComment node given the specified string. * @param data The data for the node. * @return The new DOMComment object. * @since DOM Level 1 */ virtual DOMComment *createComment(const XMLCh *data) = 0; /** * Creates a DOMCDATASection node whose value is the specified * string. * @param data The data for the DOMCDATASection contents. * @return The new DOMCDATASection object. * @since DOM Level 1 */ virtual DOMCDATASection *createCDATASection(const XMLCh *data) = 0; /** * Creates a DOMProcessingInstruction node given the specified * name and data strings. * @param target The target part of the processing instruction. * @param data The data for the node. * @return The new DOMProcessingInstruction object. * @exception DOMException * INVALID_CHARACTER_ERR: Raised if the specified target contains an * illegal character. * @since DOM Level 1 */ virtual DOMProcessingInstruction *createProcessingInstruction(const XMLCh *target, const XMLCh *data) = 0; /** * Creates an DOMAttr of the given name. Note that the * DOMAttr instance can then be set on an DOMElement * using the setAttributeNode method. *
To create an attribute with a qualified name and namespace URI, use * the createAttributeNS method. * @param name The name of the attribute. * @return A new DOMAttr object with the nodeName * attribute set to name, and localName, * prefix, and namespaceURI set to * null. The value of the attribute is the empty string. * @exception DOMException * INVALID_CHARACTER_ERR: Raised if the specified name contains an * illegal character. * @since DOM Level 1 */ virtual DOMAttr *createAttribute(const XMLCh *name) = 0; /** * Creates an DOMEntityReference object. In addition, if the * referenced entity is known, the child list of the * DOMEntityReference node is made the same as that of the * corresponding DOMEntity node.If any descendant of the * DOMEntity node has an unbound namespace prefix, the * corresponding descendant of the created DOMEntityReference * node is also unbound; (its namespaceURI is * null). The DOM Level 2 does not support any mechanism to * resolve namespace prefixes. * @param name The name of the entity to reference. * @return The new DOMEntityReference object. * @exception DOMException * INVALID_CHARACTER_ERR: Raised if the specified name contains an * illegal character. * @since DOM Level 1 */ virtual DOMEntityReference *createEntityReference(const XMLCh *name) = 0; /** * The Document Type Declaration (see DOMDocumentType) * associated with this document. For XML * documents without a document type declaration this returns * null. The DOM Level 2 does not support editing the * Document Type Declaration. docType cannot be altered in * any way, including through the use of methods inherited from the * DOMNode interface, such as insertNode or * removeNode. * @since DOM Level 1 */ virtual DOMDocumentType *getDoctype() const = 0; /** * The DOMImplementation object that handles this document. A * DOM application may use objects from multiple implementations. * @since DOM Level 1 */ virtual DOMImplementation *getImplementation() const = 0; /** * This is a convenience attribute that allows direct access to the child * node that is the root element of the document. * @since DOM Level 1 */ virtual DOMElement *getDocumentElement() const = 0; /** * Returns a DOMNodeList of all the DOMElement(s) with a * given tag name in the order in which they are encountered in a * preorder traversal of the DOMDocument tree. * * The returned node list is "live", in that changes * to the document tree made after a nodelist was initially * returned will be immediately reflected in the node list. * @param tagname The name of the tag to match on. The special value "*" * matches all tags. * @return A new DOMNodeList object containing all the matched * DOMElement(s). * @since DOM Level 1 */ virtual DOMNodeList *getElementsByTagName(const XMLCh *tagname) const = 0; //@} /** @name Functions introduced in DOM Level 2. */ //@{ /** * Imports a node from another document to this document. The returned * node has no parent; (parentNode is null). * The source node is not altered or removed from the original document; * this method creates a new copy of the source node. *
For all nodes, importing a node creates a node object owned by the * importing document, with attribute values identical to the source * node's nodeName and nodeType, plus the * attributes related to namespaces (prefix, * localName, and namespaceURI). As in the * cloneNode operation on a DOMNode, the source * node is not altered. *
Additional information is copied as appropriate to the * nodeType, attempting to mirror the behavior expected if * a fragment of XML source was copied from one document to * another, recognizing that the two documents may have different DTDs * in the XML case. The following list describes the specifics for each * type of node. *

*
ATTRIBUTE_NODE
*
The ownerElement attribute * is set to null and the specified flag is * set to true on the generated DOMAttr. The * descendants of the source DOMAttr are recursively imported * and the resulting nodes reassembled to form the corresponding subtree. * Note that the deep parameter has no effect on * DOMAttr nodes; they always carry their children with them * when imported.
*
DOCUMENT_FRAGMENT_NODE
*
If the deep option * was set to true, the descendants of the source element * are recursively imported and the resulting nodes reassembled to form * the corresponding subtree. Otherwise, this simply generates an empty * DOMDocumentFragment.
*
DOCUMENT_NODE
*
DOMDocument * nodes cannot be imported.
*
DOCUMENT_TYPE_NODE
*
DOMDocumentType * nodes cannot be imported.
*
ELEMENT_NODE
*
Specified attribute nodes of the * source element are imported, and the generated DOMAttr * nodes are attached to the generated DOMElement. Default * attributes are not copied, though if the document being imported into * defines default attributes for this element name, those are assigned. * If the importNode deep parameter was set to * true, the descendants of the source element are * recursively imported and the resulting nodes reassembled to form the * corresponding subtree.
*
ENTITY_NODE
*
DOMEntity nodes can be * imported, however in the current release of the DOM the * DOMDocumentType is readonly. Ability to add these imported * nodes to a DOMDocumentType will be considered for addition * to a future release of the DOM.On import, the publicId, * systemId, and notationName attributes are * copied. If a deep import is requested, the descendants * of the the source DOMEntity are recursively imported and * the resulting nodes reassembled to form the corresponding subtree.
*
* ENTITY_REFERENCE_NODE
*
Only the DOMEntityReference itself is * copied, even if a deep import is requested, since the * source and destination documents might have defined the entity * differently. If the document being imported into provides a * definition for this entity name, its value is assigned.
*
NOTATION_NODE
*
* DOMNotation nodes can be imported, however in the current * release of the DOM the DOMDocumentType is readonly. Ability * to add these imported nodes to a DOMDocumentType will be * considered for addition to a future release of the DOM.On import, the * publicId and systemId attributes are copied. * Note that the deep parameter has no effect on * DOMNotation nodes since they never have any children.
*
* PROCESSING_INSTRUCTION_NODE
*
The imported node copies its * target and data values from those of the * source node.
*
TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE
*
These three * types of nodes inheriting from DOMCharacterData copy their * data and length attributes from those of * the source node.
*
* @param importedNode The node to import. * @param deep If true, recursively import the subtree under * the specified node; if false, import only the node * itself, as explained above. This has no effect on DOMAttr * , DOMEntityReference, and DOMNotation nodes. * @return The imported node that belongs to this DOMDocument. * @exception DOMException * NOT_SUPPORTED_ERR: Raised if the type of node being imported is not * supported. * @since DOM Level 2 */ virtual DOMNode *importNode(const DOMNode *importedNode, bool deep) = 0; /** * Creates an element of the given qualified name and namespace URI. * @param namespaceURI The namespace URI of the element to create. * @param qualifiedName The qualified name of the element type to * instantiate. * @return A new DOMElement object with the following * attributes: * * * * * * * * * * * * * * * * * * * * * * * * * *
Attribute * Value
DOMNode.nodeName * qualifiedName
DOMNode.namespaceURI * namespaceURI
DOMNode.prefixprefix, extracted * from qualifiedName, or null if there is * no prefix
DOMNode.localNamelocal name, extracted from * qualifiedName
DOMElement.tagName * qualifiedName
* @exception DOMException * INVALID_CHARACTER_ERR: Raised if the specified qualified name * contains an illegal character, per the XML 1.0 specification . *
NAMESPACE_ERR: Raised if the qualifiedName is * malformed per the Namespaces in XML specification, if the * qualifiedName has a prefix and the * namespaceURI is null, or if the * qualifiedName has a prefix that is "xml" and the * namespaceURI is different from " * http://www.w3.org/XML/1998/namespace" . *
NOT_SUPPORTED_ERR: Always thrown if the current document does not * support the "XML" feature, since namespaces were * defined by XML. * @since DOM Level 2 */ virtual DOMElement *createElementNS(const XMLCh *namespaceURI, const XMLCh *qualifiedName) = 0; /** * Creates an attribute of the given qualified name and namespace URI. * @param namespaceURI The namespace URI of the attribute to create. * @param qualifiedName The qualified name of the attribute to * instantiate. * @return A new DOMAttr object with the following attributes: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Attribute * Value
DOMNode.nodeNamequalifiedName
* DOMNode.namespaceURInamespaceURI
* DOMNode.prefixprefix, extracted from * qualifiedName, or null if there is no * prefix
DOMNode.localNamelocal name, extracted from * qualifiedName
DOMAttr.name * qualifiedName
DOMNode.nodeValuethe empty * string
* @exception DOMException * INVALID_CHARACTER_ERR: Raised if the specified qualified name * contains an illegal character, per the XML 1.0 specification . *
NAMESPACE_ERR: Raised if the qualifiedName is * malformed per the Namespaces in XML specification, if the * qualifiedName has a prefix and the * namespaceURI is null, if the * qualifiedName has a prefix that is "xml" and the * namespaceURI is different from " * http://www.w3.org/XML/1998/namespace", or if the * qualifiedName, or its prefix, is "xmlns" and the * namespaceURI is different from " * http://www.w3.org/2000/xmlns/". *
NOT_SUPPORTED_ERR: Always thrown if the current document does not * support the "XML" feature, since namespaces were * defined by XML. * @since DOM Level 2 */ virtual DOMAttr *createAttributeNS(const XMLCh *namespaceURI, const XMLCh *qualifiedName) = 0; /** * Returns a DOMNodeList of all the DOMElement(s) with a * given local name and namespace URI in the order in which they are * encountered in a preorder traversal of the DOMDocument tree. * @param namespaceURI The namespace URI of the elements to match on. The * special value "*" matches all namespaces. * @param localName The local name of the elements to match on. The * special value "*" matches all local names. * @return A new DOMNodeList object containing all the matched * DOMElement(s). * @since DOM Level 2 */ virtual DOMNodeList *getElementsByTagNameNS(const XMLCh *namespaceURI, const XMLCh *localName) const = 0; /** * Returns the DOMElement whose ID is given by * elementId. If no such element exists, returns * null. Behavior is not defined if more than one element * has this ID. The DOM implementation must have * information that says which attributes are of type ID. Attributes * with the name "ID" are not of type ID unless so defined. * Implementations that do not know whether attributes are of type ID or * not are expected to return null. * @param elementId The unique id value for an element. * @return The matching element. * @since DOM Level 2 */ virtual DOMElement * getElementById(const XMLCh *elementId) const = 0; //@} /** @name Functions introduced in DOM Level 3. */ //@{ /** * An attribute specifying the encoding used for this document at the time of the parsing. * This is null when it is not known, such as when the DOMDocument was created in memory. * * @since DOM Level 3 */ virtual const XMLCh* getInputEncoding() const = 0; /** * An attribute specifying, as part of the XML declaration, the encoding of this document. * This is null when unspecified or when it is not known, such as when the * DOMDocument was created in memory. * * @since DOM Level 3 */ virtual const XMLCh* getXmlEncoding() const = 0; /** * An attribute specifying, as part of the XML declaration, whether this document is standalone. * This is false when unspecified. * * @since DOM Level 3 */ virtual bool getXmlStandalone() const = 0; /** * An attribute specifying, as part of the XML declaration, whether this * document is standalone. *
This attribute represents the property [standalone] defined in . * * @since DOM Level 3 */ virtual void setXmlStandalone(bool standalone) = 0; /** * An attribute specifying, as part of the XML declaration, the version * number of this document. This is null when unspecified. *
This attribute represents the property [version] defined in . * * @since DOM Level 3 */ virtual const XMLCh* getXmlVersion() const = 0; /** * An attribute specifying, as part of the XML declaration, the version * number of this document. This is null when unspecified. *
This attribute represents the property [version] defined in . * * @since DOM Level 3 */ virtual void setXmlVersion(const XMLCh* version) = 0; /** * The location of the document or null if undefined. *
Beware that when the DOMDocument supports the feature * "HTML" , the href attribute of the HTML BASE element takes precedence * over this attribute. * * @since DOM Level 3 */ virtual const XMLCh* getDocumentURI() const = 0; /** * The location of the document or null if undefined. *
Beware that when the DOMDocument supports the feature * "HTML" , the href attribute of the HTML BASE element takes precedence * over this attribute. * * @since DOM Level 3 */ virtual void setDocumentURI(const XMLCh* documentURI) = 0; /** * An attribute specifying whether errors checking is enforced or not. * When set to false, the implementation is free to not * test every possible error case normally defined on DOM operations, * and not raise any DOMException. In case of error, the * behavior is undefined. This attribute is true by * defaults. * * @since DOM Level 3 */ virtual bool getStrictErrorChecking() const = 0; /** * An attribute specifying whether errors checking is enforced or not. * When set to false, the implementation is free to not * test every possible error case normally defined on DOM operations, * and not raise any DOMException. In case of error, the * behavior is undefined. This attribute is true by * defaults. * * @since DOM Level 3 */ virtual void setStrictErrorChecking(bool strictErrorChecking) = 0; /** * Rename an existing node. When possible this simply changes the name of * the given node, otherwise this creates a new node with the specified * name and replaces the existing node with the new node as described * below. This only applies to nodes of type ELEMENT_NODE * and ATTRIBUTE_NODE. *
When a new node is created, the following operations are performed: * the new node is created, any registered event listener is registered * on the new node, any user data attached to the old node is removed * from that node, the old node is removed from its parent if it has * one, the children are moved to the new node, if the renamed node is * an DOMElement its attributes are moved to the new node, the * new node is inserted at the position the old node used to have in its * parent's child nodes list if it has one, the user data that was * attached to the old node is attach to the new node, the user data * event NODE_RENAMED is fired. *
When the node being renamed is an DOMAttr that is * attached to an DOMElement, the node is first removed from * the DOMElement attributes map. Then, once renamed, either * by modifying the existing node or creating a new one as described * above, it is put back. * * @param n The node to rename. * @param namespaceURI The new namespaceURI. * @param qualifiedName The new qualified name. * @return The renamed node. This is either the specified node or the new * node that was created to replace the specified node. * @exception DOMException * NOT_SUPPORTED_ERR: Raised when the type of the specified node is * neither ELEMENT_NODE nor ATTRIBUTE_NODE. *
WRONG_DOCUMENT_ERR: Raised when the specified node was created * from a different document than this document. *
NAMESPACE_ERR: Raised if the qualifiedName is * malformed per the Namespaces in XML specification, if the * qualifiedName has a prefix and the * namespaceURI is null, or if the * qualifiedName has a prefix that is "xml" and the * namespaceURI is different from " * http://www.w3.org/XML/1998/namespace" . Also raised, when the node * being renamed is an attribute, if the qualifiedName, * or its prefix, is "xmlns" and the namespaceURI is * different from "http://www.w3.org/2000/xmlns/". * @since DOM Level 3 */ virtual DOMNode* renameNode(DOMNode* n, const XMLCh* namespaceURI, const XMLCh* qualifiedName) = 0; /** * Changes the ownerDocument of a node, its children, as well * as the attached attribute nodes if there are any. If the node has a * parent it is first removed from its parent child list. This * effectively allows moving a subtree from one document to another. The * following list describes the specifics for each type of node. * *
*
* ATTRIBUTE_NODE
*
The ownerElement attribute is set to * null and the specified flag is set to * true on the adopted DOMAttr. The descendants * of the source DOMAttr are recursively adopted.
*
* DOCUMENT_FRAGMENT_NODE
*
The descendants of the source node are * recursively adopted.
*
DOCUMENT_NODE
*
DOMDocument nodes cannot * be adopted.
*
DOCUMENT_TYPE_NODE
*
DOMDocumentType nodes cannot * be adopted.
*
ELEMENT_NODE
*
Specified attribute nodes of the source * element are adopted, and the generated DOMAttr nodes. * Default attributes are discarded, though if the document being * adopted into defines default attributes for this element name, those * are assigned. The descendants of the source element are recursively * adopted.
*
ENTITY_NODE
*
DOMEntity nodes cannot be adopted.
*
* ENTITY_REFERENCE_NODE
*
Only the DOMEntityReference node * itself is adopted, the descendants are discarded, since the source * and destination documents might have defined the entity differently. * If the document being imported into provides a definition for this * entity name, its value is assigned.
*
NOTATION_NODE
*
DOMNotation * nodes cannot be adopted.
*
PROCESSING_INSTRUCTION_NODE, TEXT_NODE, * CDATA_SECTION_NODE, COMMENT_NODE
*
These nodes can all be adopted. No * specifics.
*
* @param source The node to move into this document. * @return The adopted node, or null if this operation * fails, such as when the source node comes from a different * implementation. * @exception DOMException * NOT_SUPPORTED_ERR: Raised if the source node is of type * DOCUMENT, DOCUMENT_TYPE. *
NO_MODIFICATION_ALLOWED_ERR: Raised when the source node is * readonly. * @since DOM Level 3 */ virtual DOMNode* adoptNode(DOMNode* source) = 0; /** * This method acts as if the document was going through a save and load * cycle, putting the document in a "normal" form. The actual result * depends on the features being set. See DOMConfiguration for * details. * *
Noticeably this method normalizes DOMText nodes, makes * the document "namespace wellformed", according to the algorithm * described below in pseudo code, by adding missing namespace * declaration attributes and adding or changing namespace prefixes, * updates the replacement tree of DOMEntityReference nodes, * normalizes attribute values, etc. *
Mutation events, when supported, are generated to reflect the * changes occurring on the document. * Note that this is a partial implementation. Not all the required features are implemented. * Currently DOMAttr and DOMText nodes are normalized. * Features to remove DOMComment and DOMCDATASection work. * @since DOM Level 3 * */ virtual void normalizeDocument() = 0; /** * The configuration used when DOMDocument::normalizeDocument is invoked. * * @return The DOMConfiguration from this DOMDocument * * @since DOM Level 3 */ virtual DOMConfiguration* getDOMConfig() const = 0; //@} // ----------------------------------------------------------------------- // Non-standard extension // ----------------------------------------------------------------------- /** @name Non-standard extension */ //@{ /** * Non-standard extension * * Create a new entity. * @param name The name of the entity to instantiate * */ virtual DOMEntity *createEntity(const XMLCh *name) = 0; /** * Non-standard extension * * Create a DOMDocumentType node. * @return A DOMDocumentType that references the newly * created DOMDocumentType node. * */ virtual DOMDocumentType *createDocumentType(const XMLCh *name) = 0; /*** * Provide default implementation to maintain source code compatibility ***/ virtual DOMDocumentType* createDocumentType(const XMLCh *qName, const XMLCh*, //publicId, const XMLCh* //systemId ) { return createDocumentType(qName); } /** * Non-standard extension. * * Create a Notation. * @param name The name of the notation to instantiate * @return A DOMNotation that references the newly * created DOMNotation node. */ virtual DOMNotation *createNotation(const XMLCh *name) = 0; /** * Non-standard extension. * * Creates an element of the given qualified name and * namespace URI, and also stores line/column number info. * Used by internally XSDXercesDOMParser during schema traversal. * * @see createElementNS(const XMLCh *namespaceURI, const XMLCh *qualifiedName) */ virtual DOMElement *createElementNS(const XMLCh *namespaceURI, const XMLCh *qualifiedName, const XMLFileLoc lineNum, const XMLFileLoc columnNum) = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMRangeException.hpp000644 000765 000024 00000007363 13241160337 023042 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMRangeException.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMRANGEEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_DOMRANGEEXCEPTION_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Range operations may throw a DOMRangeException as specified in * their method descriptions. *

See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. * @since DOM Level 2 */ class CDOM_EXPORT DOMRangeException : public DOMException { public: // ----------------------------------------------------------------------- // Class Types // ----------------------------------------------------------------------- /** @name Public Constants */ //@{ /** * Enumerators for DOM Range Exceptions * *

BAD_BOUNDARYPOINTS_ERR: * If the boundary-points of a Range do not meet specific requirements.

* *

INVALID_NODE_TYPE_ERR: * If the container of an boundary-point of a Range is being set to either * a node of an invalid type or a node with an ancestor of an invalid * type.

* * @since DOM Level 2 */ enum RangeExceptionCode { BAD_BOUNDARYPOINTS_ERR = 111, INVALID_NODE_TYPE_ERR = 112 }; //@} public: // ----------------------------------------------------------------------- // Constructors // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * Default constructor for DOMRangeException. * */ DOMRangeException(); /** * Constructor which takes an error code and a message. * * @param code The error code which indicates the exception * @param messageCode The string containing the error message * @param memoryManager The memory manager used to (de)allocate memory */ DOMRangeException(short code, short messageCode, MemoryManager* const memoryManager); /** * Copy constructor. * * @param other The object to be copied. */ DOMRangeException(const DOMRangeException &other); //@} // ----------------------------------------------------------------------- // Destructors // ----------------------------------------------------------------------- /** @name Destructor. */ //@{ /** * Destructor for DOMRangeException. * */ virtual ~DOMRangeException(); //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMRangeException & operator = (const DOMRangeException &); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMLSParserFilter.hpp000644 000765 000024 00000015527 13241160337 022771 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLSParserFilter.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMLSPARSERFILTER_HPP) #define XERCESC_INCLUDE_GUARD_DOMLSPARSERFILTER_HPP /** * * DOMLSParserFilter.hpp: interface for the DOMLSParserFilter class. * * DOMLSParserFilter provide applications the ability to examine nodes * as they are being created during the parse process. * * DOMLSParserFilter lets the application decide what nodes should be * in the output DOM tree or not. * * @since DOM Level 3 */ #include XERCES_CPP_NAMESPACE_BEGIN class DOMElement; class DOMNode; class CDOM_EXPORT DOMLSParserFilter { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMLSParserFilter() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMLSParserFilter(const DOMLSParserFilter &); DOMLSParserFilter & operator = (const DOMLSParserFilter &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMLSParserFilter() {}; //@} // ----------------------------------------------------------------------- // Class Types // ----------------------------------------------------------------------- /** @name Public Contants */ //@{ /** * Constants returned by acceptNode. * *

FILTER_ACCEPT: * Accept the node.

* *

FILTER_REJECT: * Reject the node and its children.

* *

FILTER_SKIP: * Skip this single node. The children of this node will still be considered.

* *

FILTER_INTERRUPT: * Interrupt the normal processing of the document.

* * @since DOM Level 3 */ enum FilterAction {FILTER_ACCEPT = 1, FILTER_REJECT = 2, FILTER_SKIP = 3, FILTER_INTERRUPT = 4}; // ----------------------------------------------------------------------- // Virtual DOMLSParserFilter interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ /** * This method will be called by the parser at the completion of the parsing of each node. * The node and all of its descendants will exist and be complete. The parent node will also exist, * although it may be incomplete, i.e. it may have additional children that have not yet been parsed. * Attribute nodes are never passed to this function. * From within this method, the new node may be freely modified - children may be added or removed, * text nodes modified, etc. The state of the rest of the document outside this node is not defined, * and the affect of any attempt to navigate to, or to modify any other part of the document is undefined. * For validating parsers, the checks are made on the original document, before any modification by the * filter. No validity checks are made on any document modifications made by the filter. * If this new node is rejected, the parser might reuse the new node and any of its descendants. * * @param node The newly constructed element. At the time this method is called, the element is complete - * it has all of its children (and their children, recursively) and attributes, and is attached * as a child to its parent. * @return One of the FilterAction enum */ virtual FilterAction acceptNode(DOMNode* node) = 0; /** * The parser will call this method after each DOMElement start tag has been scanned, * but before the remainder of the DOMElement is processed. The intent is to allow the element, * including any children, to be efficiently skipped. Note that only element nodes are passed to the * startElement function. * The element node passed to startElement for filtering will include all of the attributes, but none * of the children nodes. The DOMElement may not yet be in place in the document being * constructed (it may not have a parent node.) * A startElement filter function may access or change the attributes for the DOMElement. * Changing namespace declarations will have no effect on namespace resolution by the parser. * * @param node The newly encountered element. At the time this method is called, the element is incomplete - * it will have its attributes, but no children. * @return One of the FilterAction enum */ virtual FilterAction startElement(DOMElement* node) = 0; /** * Tells the DOMLSParser what types of nodes to show to the method DOMLSParserFilter::acceptNode. * If a node is not shown to the filter using this attribute, it is automatically included in the DOM document being built. * See DOMNodeFilter for definition of the constants. The constants SHOW_ATTRIBUTE, SHOW_DOCUMENT, * SHOW_DOCUMENT_TYPE, SHOW_NOTATION, SHOW_ENTITY, and SHOW_DOCUMENT_FRAGMENT are meaningless here. * Those nodes will never be passed to DOMLSParserFilter::acceptNode. * * @return The constants of what types of nodes to show. * @since DOM Level 3 */ virtual DOMNodeFilter::ShowType getWhatToShow() const = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMCDATASection.hpp000644 000765 000024 00000010461 13241160337 022261 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMCDATASection.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMCDATASECTION_HPP) #define XERCESC_INCLUDE_GUARD_DOMCDATASECTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * CDATA sections are used to escape blocks of text containing characters that * would otherwise be regarded as markup. The only delimiter that is * recognized in a CDATA section is the "]]>" string that ends the CDATA * section. CDATA sections cannot be nested. Their primary purpose is for * including material such as XML fragments, without needing to escape all * the delimiters. *

The data attribute of the DOMText node holds * the text that is contained by the CDATA section. Note that this may * contain characters that need to be escaped outside of CDATA sections and * that, depending on the character encoding ("charset") chosen for * serialization, it may be impossible to write out some characters as part * of a CDATA section. *

The DOMCDATASection interface inherits from the * DOMCharacterData interface through the DOMText * interface. Adjacent DOMCDATASection nodes are not merged by use * of the normalize method of the DOMNode interface. * Because no markup is recognized within a DOMCDATASection, * character numeric references cannot be used as an escape mechanism when * serializing. Therefore, action needs to be taken when serializing a * DOMCDATASection with a character encoding where some of the * contained characters cannot be represented. Failure to do so would not * produce well-formed XML.One potential solution in the serialization * process is to end the CDATA section before the character, output the * character using a character reference or entity reference, and open a new * CDATA section for any further characters in the text node. Note, however, * that some code conversion libraries at the time of writing do not return * an error or exception when a character is missing from the encoding, * making the task of ensuring that data is not corrupted on serialization * more difficult. *

See also the Document Object Model (DOM) Level 2 Core Specification. * * @since DOM Level 1 */ class CDOM_EXPORT DOMCDATASection: public DOMText { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMCDATASection() {} DOMCDATASection(const DOMCDATASection &other) : DOMText(other) {} //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented operators */ //@{ DOMCDATASection & operator = (const DOMCDATASection &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMCDATASection() {}; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMXPathResult.hpp000644 000765 000024 00000036540 13241160337 022351 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMXPathResult.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHRESULT_HPP) #define XERCESC_INCLUDE_GUARD_DOMXPATHRESULT_HPP #include XERCES_CPP_NAMESPACE_BEGIN class DOMXPathNSResolver; class DOMXPathExpression; class DOMTypeInfo; class DOMNode; /** * The DOMXPathResult interface represents the result of the * evaluation of an XPath 1.0 or XPath 2.0 expression within the context * of a particular node. Since evaluation of an XPath expression can result * in various result types, this object makes it possible to discover and * manipulate the type and value of the result. * * Note that some function signatures were changed compared to the * DOM Level 3 in order to accommodate XPath 2.0. * * @since DOM Level 3 */ class CDOM_EXPORT DOMXPathResult { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMXPathResult() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMXPathResult(const DOMXPathResult &); DOMXPathResult& operator = (const DOMXPathResult&); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMXPathResult() {}; //@} // ----------------------------------------------------------------------- // Class Types // ----------------------------------------------------------------------- /** @name Public Constants */ //@{ /** *

ANY_TYPE *
[XPath 1.0] This code does not represent a specific type. An evaluation of an XPath * expression will never produce this type. If this type is requested, then * the evaluation returns whatever type naturally results from evaluation * of the expression. * If the natural result is a node set when ANY_TYPE was requested, then * UNORDERED_NODE_ITERATOR_TYPE is always the resulting type. Any other * representation of a node set must be explicitly requested. *

ANY_UNORDERED_NODE_TYPE *
[XPath 1.0] The result is a node set as defined by XPath 1.0 and will be accessed * as a single node, which may be null if the node set is empty. Document * modification does not invalidate the node, but may mean that the result * node no longer corresponds to the current document. This is a convenience * that permits optimization since the implementation can stop once any node * in the resulting set has been found. * If there is more than one node in the actual result, the single node * returned might not be the first in document order. *

BOOLEAN_TYPE *
[XPath 1.0] The result is a boolean as defined by XPath 1.0. Document modification * does not invalidate the boolean, but may mean that reevaluation would not * yield the same boolean. *

FIRST_ORDERED_NODE_TYPE *
[XPath 1.0] The result is a node set as defined by XPath 1.0 and will be accessed * as a single node, which may be null if the node set is empty. Document * modification does not invalidate the node, but may mean that the result * node no longer corresponds to the current document. This is a convenience * that permits optimization since the implementation can stop once the first * node in document order of the resulting set has been found. * If there are more than one node in the actual result, the single node * returned will be the first in document order. *

NUMBER_TYPE *
[XPath 1.0] The result is a number as defined by XPath 1.0. Document modification does * not invalidate the number, but may mean that reevaluation would not yield the * same number. *

ORDERED_NODE_ITERATOR_TYPE *
[XPath 1.0] The result is a node set as defined by XPath 1.0 that will be accessed * iteratively, which will produce document-ordered nodes. Document modification * invalidates the iteration. *

ORDERED_NODE_SNAPSHOT_TYPE *
[XPath 1.0] The result is a node set as defined by XPath 1.0 that will be accessed as a * snapshot list of nodes that will be in original document order. Document * modification does not invalidate the snapshot but may mean that reevaluation would * not yield the same snapshot and nodes in the snapshot may have been altered, moved, * or removed from the document. *

STRING_TYPE *
[XPath 1.0] The result is a string as defined by XPath 1.0. Document modification does not * invalidate the string, but may mean that the string no longer corresponds to the * current document. *

UNORDERED_NODE_ITERATOR_TYPE *
[XPath 1.0] The result is a node set as defined by XPath 1.0 that will be accessed iteratively, * which may not produce nodes in a particular order. Document modification invalidates the iteration. * This is the default type returned if the result is a node set and ANY_TYPE is requested. *

UNORDERED_NODE_SNAPSHOT_TYPE *
[XPath 1.0] The result is a node set as defined by XPath 1.0 that will be accessed as a * snapshot list of nodes that may not be in a particular order. Document modification * does not invalidate the snapshot but may mean that reevaluation would not yield the same * snapshot and nodes in the snapshot may have been altered, moved, or removed from the document. *

FIRST_RESULT_TYPE *
[XPath 2.0] The result is a sequence as defined by XPath 2.0 and will be accessed * as a single current value or there will be no current value if the sequence * is empty. Document modification does not invalidate the value, but may mean * that the result no longer corresponds to the current document. This is a * convenience that permits optimization since the implementation can stop once * the first item in the resulting sequence has been found. If there is more * than one item in the actual result, the single item returned might not be * the first in document order. *

ITERATOR_RESULT_TYPE *
[XPath 2.0] The result is a sequence as defined by XPath 2.0 that will be accessed * iteratively. Document modification invalidates the iteration. *

SNAPSHOT_RESULT_TYPE *
[XPath 2.0] The result is a sequence as defined by XPath 2.0 that will be accessed * as a snapshot list of values. Document modification does not invalidate the * snapshot but may mean that reevaluation would not yield the same snapshot * and any items in the snapshot may have been altered, moved, or removed from * the document. */ enum ResultType { /* XPath 1.0 */ ANY_TYPE = 0, NUMBER_TYPE = 1, STRING_TYPE = 2, BOOLEAN_TYPE = 3, UNORDERED_NODE_ITERATOR_TYPE = 4, ORDERED_NODE_ITERATOR_TYPE = 5, UNORDERED_NODE_SNAPSHOT_TYPE = 6, ORDERED_NODE_SNAPSHOT_TYPE = 7, ANY_UNORDERED_NODE_TYPE = 8, FIRST_ORDERED_NODE_TYPE = 9, /* XPath 2.0 */ FIRST_RESULT_TYPE = 100, ITERATOR_RESULT_TYPE = 101, SNAPSHOT_RESULT_TYPE = 102 }; //@} // ----------------------------------------------------------------------- // Virtual DOMXPathResult interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ /** * Returns the result type of this result * @return ResultType * A code representing the type of this result, as defined by the type constants. */ virtual ResultType getResultType() const = 0; /** * Returns the DOM type info of the current result node or value * (XPath 2 only). * @return typeInfo of type TypeInfo, readonly */ virtual const DOMTypeInfo *getTypeInfo() const = 0; /** * Returns true if the result has a current result and the value is a * node (XPath 2 only). This function is necessary to distinguish * between a string value and a node of type string as returned by * the getTypeInfo() function. * @return isNode of type boolean, readonly */ virtual bool isNode() const = 0; /** * Returns the boolean value of this result * @return booleanValue of type boolean * The value of this boolean result. * @exception DOMXPathException * TYPE_ERR: raised if ResultType is not BOOLEAN_TYPE (XPath 1.0) or * if current result cannot be properly converted to boolean (XPath 2.0). *
* NO_RESULT_ERROR: raised if there is no current result in the result object (XPath 2.0). */ virtual bool getBooleanValue() const = 0; /** * Returns the integer value of this result (XPath 2 only). * @return integerValue of type int * The value of this integer result. * @exception DOMXPathException * TYPE_ERR: raised if current result cannot be properly converted to * int (XPath 2.0). *
* NO_RESULT_ERROR: raised if there is no current result in the result object (XPath 2.0). */ virtual int getIntegerValue() const = 0; /** * Returns the number value of this result * @return numberValue * The value of this number result. If the native double type of the DOM * binding does not directly support the exact IEEE 754 result of the XPath * expression, then it is up to the definition of the binding to specify how * the XPath number is converted to the native binding number. * @exception DOMXPathException * TYPE_ERR: raised if ResultType is not NUMBER_TYPE (XPath 1.0) or * if current result cannot be properly converted to double (XPath 2.0). *
* NO_RESULT_ERROR: raised if there is no current result in the result object (XPath 2.0). */ virtual double getNumberValue() const = 0; /** * Returns the string value of this result * @return stringValue * The value of this string result. * @exception DOMXPathException * TYPE_ERR: raised if ResultType is not STRING_TYPE (XPath 1.0) or * if current result cannot be properly converted to string (XPath 2.0). *
* NO_RESULT_ERROR: raised if there is no current result in the result object (XPath 2.0). */ virtual const XMLCh* getStringValue() const = 0; /** * Returns the node value of this result * @return nodeValue * The value of this node result, which may be null. * @exception DOMXPathException * TYPE_ERR: raised if ResultType is not ANY_UNORDERED_NODE_TYPE, * FIRST_ORDERED_NODE_TYPE, UNORDERED_NODE_ITERATOR_TYPE, * ORDERED_NODE_ITERATOR_TYPE, UNORDERED_NODE_SNAPSHOT_TYPE, or * ORDERED_NODE_SNAPSHOT_TYPE (XPath 1.0) or if current result is * not a node (XPath 2.0). *
* NO_RESULT_ERROR: raised if there is no current result in the result * object. */ virtual DOMNode* getNodeValue() const = 0; /** * Iterates and returns true if the current result is the next item from the * sequence or false if there are no more items. * @return boolean True if the current result is the next item from the sequence * or false if there are no more items. * @exception XPathException * TYPE_ERR: raised if ResultType is not UNORDERED_NODE_ITERATOR_TYPE or * ORDERED_NODE_ITERATOR_TYPE (XPath 1.0) or if ResultType is not * ITERATOR_RESULT_TYPE (XPath 2.0). * @exception DOMException * INVALID_STATE_ERR: The document has been mutated since the result was returned. */ virtual bool iterateNext() = 0; /** * Signifies that the iterator has become invalid. * @return invalidIteratorState * True if ResultType is UNORDERED_NODE_ITERATOR_TYPE or * ORDERED_NODE_ITERATOR_TYPE (XPath 1.0) or ITERATOR_RESULT_TYPE (XPath 2.0) * and the document has been modified since this result was returned. * @exception XPathException * TYPE_ERR: raised if ResultType is not UNORDERED_NODE_ITERATOR_TYPE or * ORDERED_NODE_ITERATOR_TYPE (XPath 1.0) or if ResultType is not * ITERATOR_RESULT_TYPE (XPath 2.0). */ virtual bool getInvalidIteratorState() const = 0; /** * Sets the current result to the indexth item in the snapshot collection. If * index is greater than or equal to the number of items in the list, this method * returns false. Unlike the iterator result, the snapshot does not become * invalid, but may not correspond to the current document if it is mutated. * @param index of type XMLSize_t - Index into the snapshot collection. * @return boolean True if the current result is the next item from the sequence * or false if there are no more items. * @exception XPathException * TYPE_ERR: raised if ResultType is not UNORDERED_NODE_SNAPSHOT_TYPE or * ORDERED_NODE_SNAPSHOT_TYPE (XPath 1.0) or if ResultType is not * SNAPSHOT_RESULT_TYPE (XPath 2.0). */ virtual bool snapshotItem(XMLSize_t index) = 0; /** * The number of items in the result snapshot. Valid values for snapshotItem * indices are 0 to snapshotLength-1 inclusive. * @return snapshotLength of type XMLSize_t * @exception XPathException * TYPE_ERR: raised if ResultType is not UNORDERED_NODE_SNAPSHOT_TYPE or * ORDERED_NODE_SNAPSHOT_TYPE (XPath 1.0) or if ResultType is not * SNAPSHOT_RESULT_TYPE (XPath 2.0). */ virtual XMLSize_t getSnapshotLength() const = 0; //@} // ----------------------------------------------------------------------- // Non-standard Extension // ----------------------------------------------------------------------- /** @name Non-standard Extension */ //@{ /** * Called to indicate that this DOMXPathResult is no longer in use * and that the implementation may relinquish any resources associated with it. * * Access to a released object will lead to unexpected result. */ virtual void release() = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMAttr.hpp000644 000765 000024 00000014250 13241160337 021032 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMAttr.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMATTR_HPP) #define XERCESC_INCLUDE_GUARD_DOMATTR_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMElement; class DOMTypeInfo; /** * The DOMAttr class refers to an attribute of an XML element. * * Typically the allowable values for the * attribute are defined in a documenttype definition. *

DOMAttr objects inherit the DOMNode interface, but * since attributes are not actually child nodes of the elements they are associated with, the * DOM does not consider them part of the document tree. Thus, the * DOMNode attributes parentNode, * previousSibling, and nextSibling have a null * value for DOMAttr objects. The DOM takes the view that * attributes are properties of elements rather than having a separate * identity from the elements they are associated with; this should make it * more efficient to implement such features as default attributes associated * with all elements of a given type. Furthermore, attribute nodes * may not be immediate children of a DOMDocumentFragment. However, * they can be associated with DOMElement nodes contained within a * DOMDocumentFragment. In short, users of the DOM * need to be aware that DOMAttr nodes have some things in common * with other objects inheriting the DOMNode interface, but they * also are quite distinct. * * @since DOM Level 1 */ class CDOM_EXPORT DOMAttr: public DOMNode { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMAttr() {} DOMAttr(const DOMAttr &other) : DOMNode(other) {} //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented operators */ //@{ DOMAttr & operator = (const DOMAttr &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMAttr() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMAttr interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 1 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Returns the name of this attribute. * @since DOM Level 1 */ virtual const XMLCh * getName() const = 0; /** * * Returns true if the attribute received its value explicitly in the * XML document, or if a value was assigned programatically with * the setValue function. Returns false if the attribute value * came from the default value declared in the document's DTD. * @since DOM Level 1 */ virtual bool getSpecified() const = 0; /** * Returns the value of the attribute. * * The value of the attribute is returned as a string. * Character and general entity references are replaced with their values. * @since DOM Level 1 */ virtual const XMLCh * getValue() const = 0; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** * Sets the value of the attribute. A text node with the unparsed contents * of the string will be created. * * @param value The value of the DOM attribute to be set * @since DOM Level 1 */ virtual void setValue(const XMLCh *value) = 0; //@} /** @name Functions introduced in DOM Level 2. */ //@{ /** * The DOMElement node this attribute is attached to or * null if this attribute is not in use. * * @since DOM Level 2 */ virtual DOMElement *getOwnerElement() const = 0; //@} /** @name Functions introduced in DOM Level 3. */ //@{ /** * Returns whether this attribute is known to be of type ID or not. * When it is and its value is unique, the ownerElement of this attribute * can be retrieved using getElementById on DOMDocument. * * @return bool stating if this DOMAttr is an ID * @since DOM level 3 */ virtual bool isId() const = 0; /** * Returns the type information associated with this attribute. * * @return the DOMTypeInfo associated with this attribute * @since DOM level 3 */ virtual const DOMTypeInfo * getSchemaTypeInfo() const = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOM.hpp000644 000765 000024 00000006331 13241160337 020200 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOM.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOM_HPP) #define XERCESC_INCLUDE_GUARD_DOM_HPP // // This is the primary header file for inclusion in application // programs using the C++ XML Document Object Model API. // #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // Introduced in DOM Level 2 #include #include #include #include #include #include #include // Introduced in DOM Level 3 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif xerces-c-3.2.2/src/xercesc/dom/DOMNode.hpp000644 000765 000024 00000115367 13345575021 021025 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNode.hpp 1840502 2018-09-10 23:11:13Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMNODE_HPP) #define XERCESC_INCLUDE_GUARD_DOMNODE_HPP #include XERCES_CPP_NAMESPACE_BEGIN class DOMDocument; class DOMNamedNodeMap; class DOMNodeList; class DOMUserDataHandler; /** * The DOMNode interface is the primary datatype for the entire * Document Object Model. It represents a single node in the document tree. * While all objects implementing the DOMNode interface expose * methods for dealing with children, not all objects implementing the * DOMNode interface may have children. For example, * DOMText nodes may not have children, and adding children to * such nodes results in a DOMException being raised. *

The attributes nodeName, nodeValue and * attributes are included as a mechanism to get at node * information without casting down to the specific derived interface. In * cases where there is no obvious mapping of these attributes for a * specific nodeType (e.g., nodeValue for an * DOMElement or attributes for a DOMComment * ), this returns null. Note that the specialized interfaces * may contain additional and more convenient mechanisms to get and set the * relevant information. *

The values of nodeName, * nodeValue, and attributes vary according to the * node type as follows: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
InterfacenodeNamenodeValueattributes
DOMAttrname of attributevalue of attributenull
DOMCDATASection"\#cdata-section"content of the CDATA Sectionnull
DOMComment"\#comment"content of the commentnull
DOMDocument"\#document"nullnull
DOMDocumentFragment"\#document-fragment"nullnull
DOMDocumentTypedocument type namenullnull
DOMElementtag namenullNamedNodeMap
DOMEntityentity namenullnull
DOMEntityReferencename of entity referencednullnull
DOMNotationnotation namenullnull
DOMProcessingInstructiontargetentire content excluding the targetnull
DOMText"\#text"content of the text nodenull
*

See also the Document Object Model (DOM) Level 2 Core Specification. * * @since DOM Level 1 */ class CDOM_EXPORT DOMNode { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMNode() {} DOMNode(const DOMNode &) {} //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented operators */ //@{ DOMNode & operator = (const DOMNode &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMNode() {}; //@} // ----------------------------------------------------------------------- // Class Types // ----------------------------------------------------------------------- /** @name Public Constants */ //@{ /** * NodeType * * @since DOM Level 1 */ enum NodeType { ELEMENT_NODE = 1, ATTRIBUTE_NODE = 2, TEXT_NODE = 3, CDATA_SECTION_NODE = 4, ENTITY_REFERENCE_NODE = 5, ENTITY_NODE = 6, PROCESSING_INSTRUCTION_NODE = 7, COMMENT_NODE = 8, DOCUMENT_NODE = 9, DOCUMENT_TYPE_NODE = 10, DOCUMENT_FRAGMENT_NODE = 11, NOTATION_NODE = 12 }; /** * DocumentPosition: * *

DOCUMENT_POSITION_CONTAINED_BY: * The node is contained by the reference node. A node which is contained is always following, too.

*

DOCUMENT_POSITION_CONTAINS: * The node contains the reference node. A node which contains is always preceding, too.

*

DOCUMENT_POSITION_DISCONNECTED: * The two nodes are disconnected. Order between disconnected nodes is always implementation-specific.

*

DOCUMENT_POSITION_FOLLOWING: * The node follows the reference node.

*

DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: * The determination of preceding versus following is implementation-specific.

*

DOCUMENT_POSITION_PRECEDING: * The second node precedes the reference node.

* * @since DOM Level 3 */ enum DocumentPosition { DOCUMENT_POSITION_DISCONNECTED = 0x01, DOCUMENT_POSITION_PRECEDING = 0x02, DOCUMENT_POSITION_FOLLOWING = 0x04, DOCUMENT_POSITION_CONTAINS = 0x08, DOCUMENT_POSITION_CONTAINED_BY = 0x10, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20 }; //@} // ----------------------------------------------------------------------- // Virtual DOMNode interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 1 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * The name of this node, depending on its type; see the table above. * @since DOM Level 1 */ virtual const XMLCh * getNodeName() const = 0; /** * Gets the value of this node, depending on its type. * * @exception DOMException * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * @since DOM Level 1 */ virtual const XMLCh * getNodeValue() const = 0; /** * An enum value representing the type of the underlying object. * @since DOM Level 1 */ virtual NodeType getNodeType() const = 0; /** * Gets the parent of this node. * * All nodes, except DOMDocument, * DOMDocumentFragment, and DOMAttr may have a parent. * However, if a node has just been created and not yet added to the tree, * or if it has been removed from the tree, a null DOMNode * is returned. * @since DOM Level 1 */ virtual DOMNode *getParentNode() const = 0; /** * Gets a DOMNodeList that contains all children of this node. * * If there * are no children, this is a DOMNodeList containing no nodes. * The content of the returned DOMNodeList is "live" in the sense * that, for instance, changes to the children of the node object that * it was created from are immediately reflected in the nodes returned by * the DOMNodeList accessors; it is not a static snapshot of the * content of the node. This is true for every DOMNodeList, * including the ones returned by the getElementsByTagName * method. * @since DOM Level 1 */ virtual DOMNodeList *getChildNodes() const = 0; /** * Gets the first child of this node. * * If there is no such node, this returns null. * @since DOM Level 1 */ virtual DOMNode *getFirstChild() const = 0; /** * Gets the last child of this node. * * If there is no such node, this returns null. * @since DOM Level 1 */ virtual DOMNode *getLastChild() const = 0; /** * Gets the node immediately preceding this node. * * If there is no such node, this returns null. * @since DOM Level 1 */ virtual DOMNode *getPreviousSibling() const = 0; /** * Gets the node immediately following this node. * * If there is no such node, this returns null. * @since DOM Level 1 */ virtual DOMNode *getNextSibling() const = 0; /** * Gets a DOMNamedNodeMap containing the attributes of this node (if it * is an DOMElement) or null otherwise. * @since DOM Level 1 */ virtual DOMNamedNodeMap *getAttributes() const = 0; /** * Gets the DOMDocument object associated with this node. * * This is also * the DOMDocument object used to create new nodes. When this * node is a DOMDocument or a DOMDocumentType * which is not used with any DOMDocument yet, this is * null. * * @since DOM Level 1 */ virtual DOMDocument *getOwnerDocument() const = 0; // ----------------------------------------------------------------------- // Node methods // ----------------------------------------------------------------------- /** * Returns a duplicate of this node. * * This function serves as a generic copy constructor for nodes. * * The duplicate node has no parent ( * parentNode returns null.). *
Cloning an DOMElement copies all attributes and their * values, including those generated by the XML processor to represent * defaulted attributes, but this method does not copy any text it contains * unless it is a deep clone, since the text is contained in a child * DOMText node. Cloning any other type of node simply returns a * copy of this node. * @param deep If true, recursively clone the subtree under the * specified node; if false, clone only the node itself (and * its attributes, if it is an DOMElement). * @return The duplicate node. * @since DOM Level 1 */ virtual DOMNode * cloneNode(bool deep) const = 0; /** * Inserts the node newChild before the existing child node * refChild. * * If refChild is null, * insert newChild at the end of the list of children. *
If newChild is a DOMDocumentFragment object, * all of its children are inserted, in the same order, before * refChild. If the newChild is already in the * tree, it is first removed. Note that a DOMNode that * has never been assigned to refer to an actual node is == null. * @param newChild The node to insert. * @param refChild The reference node, i.e., the node before which the new * node must be inserted. * @return The node being inserted. * @exception DOMException * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the newChild node, or if * the node to insert is one of this node's ancestors. *
WRONG_DOCUMENT_ERR: Raised if newChild was created * from a different document than the one that created this node. *
NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the node being * inserted is readonly. *
NOT_FOUND_ERR: Raised if refChild is not a child of * this node. * @since DOM Level 1 */ virtual DOMNode *insertBefore(DOMNode *newChild, DOMNode *refChild) = 0; /** * Replaces the child node oldChild with newChild * in the list of children, and returns the oldChild node. * * If newChild is a DOMDocumentFragment object, * oldChild is replaced by all of the DOMDocumentFragment * children, which are inserted in the same order. * * If the newChild is already in the tree, it is first removed. * @param newChild The new node to put in the child list. * @param oldChild The node being replaced in the list. * @return The node replaced. * @exception DOMException * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the newChild node, or it * the node to put in is one of this node's ancestors. *
WRONG_DOCUMENT_ERR: Raised if newChild was created * from a different document than the one that created this node. *
NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the new node is readonly. *
NOT_FOUND_ERR: Raised if oldChild is not a child of * this node. * @since DOM Level 1 */ virtual DOMNode *replaceChild(DOMNode *newChild, DOMNode *oldChild) = 0; /** * Removes the child node indicated by oldChild from the list * of children, and returns it. * * @param oldChild The node being removed. * @return The node removed. * @exception DOMException * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. *
NOT_FOUND_ERR: Raised if oldChild is not a child of * this node. * @since DOM Level 1 */ virtual DOMNode *removeChild(DOMNode *oldChild) = 0; /** * Adds the node newChild to the end of the list of children of * this node. * * If the newChild is already in the tree, it is * first removed. * @param newChild The node to add.If it is a DOMDocumentFragment * object, the entire contents of the document fragment are moved into * the child list of this node * @return The node added. * @exception DOMException * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the newChild node, or if * the node to append is one of this node's ancestors. *
WRONG_DOCUMENT_ERR: Raised if newChild was created * from a different document than the one that created this node. *
NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the node being * appended is readonly. * @since DOM Level 1 */ virtual DOMNode *appendChild(DOMNode *newChild) = 0; // ----------------------------------------------------------------------- // Query methods // ----------------------------------------------------------------------- /** * This is a convenience method to allow easy determination of whether a * node has any children. * * @return true if the node has any children, * false if the node has no children. * @since DOM Level 1 */ virtual bool hasChildNodes() const = 0; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** * Sets the value of the node. * * Any node which can have a nodeValue will * also accept requests to set it to a string. The exact response to * this varies from node to node -- Attribute, for example, stores * its values in its children and has to replace them with a new Text * holding the replacement value. * * For most types of Node, value is null and attempting to set it * will throw DOMException(NO_MODIFICATION_ALLOWED_ERR). This will * also be thrown if the node is read-only. * @see #getNodeValue * @since DOM Level 1 */ virtual void setNodeValue(const XMLCh *nodeValue) = 0; //@} /** @name Functions introduced in DOM Level 2. */ //@{ /** * Puts all DOMText * nodes in the full depth of the sub-tree underneath this DOMNode, * including attribute nodes, into a "normal" form where only markup (e.g., * tags, comments, processing instructions, CDATA sections, and entity * references) separates DOMText * nodes, i.e., there are neither adjacent DOMText * nodes nor empty DOMText * nodes. This can be used to ensure that the DOM view of a document is the * same as if it were saved and re-loaded, and is useful when operations * (such as XPointer lookups) that depend on a particular document tree * structure are to be used. *

Note: In cases where the document contains DOMCDATASections, * the normalize operation alone may not be sufficient, since XPointers do * not differentiate between DOMText * nodes and DOMCDATASection * nodes.

* * @since DOM Level 2 */ virtual void normalize() = 0; /** * Tests whether the DOM implementation implements a specific * feature and that feature is supported by this node. * * @param feature The string of the feature to test. This is the same * name as what can be passed to the method hasFeature on * DOMImplementation. * @param version This is the version number of the feature to test. In * Level 2, version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return true. * @return Returns true if the specified feature is supported * on this node, false otherwise. * @since DOM Level 2 */ virtual bool isSupported(const XMLCh *feature, const XMLCh *version) const = 0; /** * Get the namespace URI of * this node, or null if it is unspecified. *

* This is not a computed value that is the result of a namespace lookup * based on an examination of the namespace declarations in scope. It is * merely the namespace URI given at creation time. *

* For nodes of any type other than ELEMENT_NODE and * ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, * such as createElement from the DOMDocument * interface, this is always null. * * @since DOM Level 2 */ virtual const XMLCh * getNamespaceURI() const = 0; /** * Get the namespace prefix * of this node, or null if it is unspecified. * * @since DOM Level 2 */ virtual const XMLCh * getPrefix() const = 0; /** * Returns the local part of the qualified name of this node. *

* For nodes created with a DOM Level 1 method, such as * createElement from the DOMDocument interface, * it is null. * * @since DOM Level 2 */ virtual const XMLCh * getLocalName() const = 0; /** * Set the namespace prefix of this node. *

* Note that setting this attribute, when permitted, changes * the nodeName attribute, which holds the qualified * name, as well as the tagName and name * attributes of the DOMElement and DOMAttr * interfaces, when applicable. *

* Note also that changing the prefix of an * attribute, that is known to have a default value, does not make a new * attribute with the default value and the original prefix appear, since the * namespaceURI and localName do not change. * * * @param prefix The prefix of this node. * @exception DOMException * INVALID_CHARACTER_ERR: Raised if the specified prefix contains * an illegal character. *
* NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. *
* NAMESPACE_ERR: Raised if the specified prefix is * malformed, if the namespaceURI of this node is * null, if the specified prefix is "xml" and the * namespaceURI of this node is different from * "http://www.w3.org/XML/1998/namespace", if this node is an attribute * and the specified prefix is "xmlns" and the * namespaceURI of this node is different from * "http://www.w3.org/2000/xmlns/", or if this node is an attribute and * the qualifiedName of this node is "xmlns". * @since DOM Level 2 */ virtual void setPrefix(const XMLCh * prefix) = 0; /** * Returns whether this node (if it is an element) has any attributes. * @return true if this node has any attributes, * false otherwise. * @since DOM Level 2 */ virtual bool hasAttributes() const = 0; //@} /** @name Functions introduced in DOM Level 3. */ //@{ /** * Returns whether this node is the same node as the given one. *
This method provides a way to determine whether two * DOMNode references returned by the implementation reference * the same object. When two DOMNode references are references * to the same object, even if through a proxy, the references may be * used completely interchangeably, such that all attributes have the * same values and calling the same DOM method on either reference * always has exactly the same effect. * * @param other The node to test against. * @return Returns true if the nodes are the same, * false otherwise. * @since DOM Level 3 */ virtual bool isSameNode(const DOMNode* other) const = 0; /** * Tests whether two nodes are equal. *
This method tests for equality of nodes, not sameness (i.e., * whether the two nodes are pointers to the same object) which can be * tested with DOMNode::isSameNode. All nodes that are the same * will also be equal, though the reverse may not be true. *
Two nodes are equal if and only if the following conditions are * satisfied: The two nodes are of the same type.The following string * attributes are equal: nodeName, localName, * namespaceURI, prefix, nodeValue * , baseURI. This is: they are both null, or * they have the same length and are character for character identical. * The attributes DOMNamedNodeMaps are equal. * This is: they are both null, or they have the same * length and for each node that exists in one map there is a node that * exists in the other map and is equal, although not necessarily at the * same index.The childNodes DOMNodeLists are * equal. This is: they are both null, or they have the * same length and contain equal nodes at the same index. This is true * for DOMAttr nodes as for any other type of node. Note that * normalization can affect equality; to avoid this, nodes should be * normalized before being compared. *
For two DOMDocumentType nodes to be equal, the following * conditions must also be satisfied: The following string attributes * are equal: publicId, systemId, * internalSubset.The entities * DOMNamedNodeMaps are equal.The notations * DOMNamedNodeMaps are equal. *
On the other hand, the following do not affect equality: the * ownerDocument attribute, the specified * attribute for DOMAttr nodes, the * isWhitespaceInElementContent attribute for * DOMText nodes, as well as any user data or event listeners * registered on the nodes. * * @param arg The node to compare equality with. * @return If the nodes, and possibly subtrees are equal, * true otherwise false. * @since DOM Level 3 */ virtual bool isEqualNode(const DOMNode* arg) const = 0; /** * Associate an object to a key on this node. The object can later be * retrieved from this node by calling getUserData with the * same key. * * Deletion of the user data remains the responsibility of the * application program; it will not be automatically deleted when * the nodes themselves are reclaimed. * * Both the parameter data and the returned object are * void pointer, it is applications' responsibility to keep track of * their original type. Casting them to the wrong type may result * unexpected behavior. * * @param key The key to associate the object to. * @param data The object to associate to the given key, or * null to remove any existing association to that key. * @param handler The handler to associate to that key, or * null. * @return Returns the void* object previously associated to * the given key on this node, or null if there was none. * @see #getUserData * * @since DOM Level 3 */ virtual void* setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) = 0; /** * Retrieves the object associated to a key on a this node. The object * must first have been set to this node by calling * setUserData with the same key. * * @param key The key the object is associated to. * @return Returns the void* associated to the given key * on this node, or null if there was none. * @see #setUserData * @since DOM Level 3 */ virtual void* getUserData(const XMLCh* key) const = 0; /** * The absolute base URI of this node or null if undefined. * This value is computed according to . However, when the * DOMDocument supports the feature "HTML" , the base URI is * computed using first the value of the href attribute of the HTML BASE * element if any, and the value of the documentURI * attribute from the DOMDocument interface otherwise. * *
When the node is an DOMElement, a DOMDocument * or a a DOMProcessingInstruction, this attribute represents * the properties [base URI] defined in . When the node is a * DOMNotation, an DOMEntity, or an * DOMEntityReference, this attribute represents the * properties [declaration base URI]. * @since DOM Level 3 */ virtual const XMLCh* getBaseURI() const = 0; /** * Compares the reference node, i.e. the node on which this method is being called, * with a node, i.e. the one passed as a parameter, with regard to their position * in the document and according to the document order. * * @param other The node to compare against this node. * @return Returns how the given node is positioned relatively to this * node. * @since DOM Level 3 */ virtual short compareDocumentPosition(const DOMNode* other) const = 0; /** * WARNING: This method is known to be buggy and does * not produce accurate results under a variety of conditions. * *
This attribute returns the text content of this node and its * descendants. No serialization is performed, the returned string * does not contain any markup. No whitespace normalization is * performed and the returned string does not contain the white * spaces in element content. * *
The string returned is made of the text content of this node * depending on its type, as defined below: * * * * * * * * * * * * * * * * * *
Node typeContent
* ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, * DOCUMENT_FRAGMENT_NODEconcatenation of the textContent * attribute value of every child node, excluding COMMENT_NODE and * PROCESSING_INSTRUCTION_NODE nodes
ATTRIBUTE_NODE, TEXT_NODE, * CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE * nodeValue
DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE * null
* @exception DOMException * DOMSTRING_SIZE_ERR: Raised when it would return more characters than * fit in a DOMString variable on the implementation * platform. * @see #setTextContent * @since DOM Level 3 */ virtual const XMLCh* getTextContent() const = 0; /** * This attribute removes any possible children this node may have and, if the * new string is not empty or null, replaced by a single DOMText * node containing the string this attribute is set to. No parsing is * performed, the input string is taken as pure textual content. * * @exception DOMException * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * @see #getTextContent * @since DOM Level 3 */ virtual void setTextContent(const XMLCh* textContent) = 0; /** * Look up the prefix associated to the given namespace URI, starting from this node. * The default namespace declarations are ignored by this method. * * @param namespaceURI The namespace URI to look for. * @return Returns an associated namespace prefix if found, * null if none is found. If more * than one prefix are associated to the namespace prefix, the * returned namespace prefix is implementation dependent. * @since DOM Level 3 */ virtual const XMLCh* lookupPrefix(const XMLCh* namespaceURI) const = 0; /** * This method checks if the specified namespaceURI is the * default namespace or not. * * @param namespaceURI The namespace URI to look for. * @return true if the specified namespaceURI * is the default namespace, false otherwise. * @since DOM Level 3 */ virtual bool isDefaultNamespace(const XMLCh* namespaceURI) const = 0; /** * Look up the namespace URI associated to the given prefix, starting from * this node. * * @param prefix The prefix to look for. If this parameter is * null, the method will return the default namespace URI * if any. * @return Returns the associated namespace URI or null if * none is found. * @since DOM Level 3 */ virtual const XMLCh* lookupNamespaceURI(const XMLCh* prefix) const = 0; /** * This method makes available a DOMNode's specialized interface * * @param feature The name of the feature requested (case-insensitive). * @param version The version of the feature requested. * @return Returns an alternate DOMNode which implements the * specialized APIs of the specified feature, if any, or * null if there is no alternate DOMNode which * implements interfaces associated with that feature. Any alternate * DOMNode returned by this method must delegate to the * primary core DOMNode and not return results inconsistent * with the primary core DOMNode such as key, * attributes, childNodes, etc. * @since DOM Level 3 */ virtual void* getFeature(const XMLCh* feature, const XMLCh* version) const = 0; //@} // ----------------------------------------------------------------------- // Non-standard Extension // ----------------------------------------------------------------------- /** @name Non-standard Extension */ //@{ /** * Called to indicate that this Node (and its associated children) is no longer in use * and that the implementation may relinquish any resources associated with it and * its associated children. * * If this is a document, any nodes it owns (created by DOMDocument::createXXXX()) * are also released. * * Access to a released object will lead to unexpected result. * * @exception DOMException * INVALID_ACCESS_ERR: Raised if this Node has a parent and thus should not be released yet. */ virtual void release() = 0; //@} #if defined(XML_DOMREFCOUNT_EXPERIMENTAL) // ----------------------------------------------------------------------- // Non-standard Extension // ----------------------------------------------------------------------- /** @name Non-standard Extension */ //@{ /** * This is custom function which can be implemented by classes deriving * from DOMNode for implementing reference counting on DOMNodes. Any * implementation which has memory management model which involves * disposing of nodes immediately after being used can override this * function to do that job. */ virtual void decRefCount() {} //@} // ----------------------------------------------------------------------- // Non-standard Extension // ----------------------------------------------------------------------- /** @name Non-standard Extension */ //@{ /** * This is custom function which can be implemented by classes deriving * from DOMNode for implementing reference counting on DOMNodes. */ virtual void incRefCount() {} //@} #endif }; /*** * Utilities macros for getting memory manager within DOM ***/ #define GET_OWNER_DOCUMENT(ptr) \ ((DOMDocumentImpl*)(ptr->getOwnerDocument())) #define GET_DIRECT_MM(ptr) \ (ptr ? ((DOMDocumentImpl*)ptr)->getMemoryManager() : XMLPlatformUtils::fgMemoryManager) #define GET_INDIRECT_MM(ptr) \ (!ptr ? XMLPlatformUtils::fgMemoryManager : \ GET_OWNER_DOCUMENT(ptr) ? GET_OWNER_DOCUMENT(ptr)->getMemoryManager() : \ XMLPlatformUtils::fgMemoryManager) /*** * For DOMNode and its derivatives ***/ #define GetDOMNodeMemoryManager GET_INDIRECT_MM(this) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMNotation.hpp000644 000765 000024 00000007436 13241160337 021723 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNotation.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMNOTATION_HPP) #define XERCESC_INCLUDE_GUARD_DOMNOTATION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * This interface represents a notation declared in the DTD. A notation either * declares, by name, the format of an unparsed entity (see section 4.7 of * the XML 1.0 specification), or is used for formal declaration of * Processing Instruction targets (see section 2.6 of the XML 1.0 * specification). The nodeName attribute inherited from * DOMNode is set to the declared name of the notation. *

The DOM Level 1 does not support editing DOMNotation nodes; * they are therefore readonly. *

A DOMNotation node does not have any parent. * * @since DOM Level 1 */ class CDOM_EXPORT DOMNotation: public DOMNode { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMNotation() {} DOMNotation(const DOMNotation &other) : DOMNode(other) {} //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented operators */ //@{ DOMNotation & operator = (const DOMNotation &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMNotation() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMNotation interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 1 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Get the public identifier of this notation. * * If the public identifier was not * specified, this is null. * @return Returns the public identifier of the notation * @since DOM Level 1 */ virtual const XMLCh *getPublicId() const = 0; /** * Get the system identifier of this notation. * * If the system identifier was not * specified, this is null. * @return Returns the system identifier of the notation * @since DOM Level 1 */ virtual const XMLCh *getSystemId() const = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMLSException.hpp000644 000765 000024 00000010123 13241160337 022310 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLSException.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMLSEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_DOMLSEXCEPTION_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Parser or write operations may throw an LSException if the processing is stopped. * The processing can be stopped due to a DOMError with a severity of * DOMError::DOM_SEVERITY_FATAL_ERROR or a non recovered DOMError::DOM_SEVERITY_ERROR, * or if DOMErrorHandler::handleError() returned false. *

Note: As suggested in the definition of the constants in the DOMError * interface, a DOM implementation may choose to continue after a fatal error, but the * resulting DOM tree is then implementation dependent. *

See also the * Document Object Model (DOM) Level 3 Load and Save Specification. * @since DOM Level 3 */ class MemoryManager; class CDOM_EXPORT DOMLSException : public DOMException { public: // ----------------------------------------------------------------------- // Class Types // ----------------------------------------------------------------------- /** @name Public Contants */ //@{ /** * ExceptionCode * *

PARSE_ERR: * If an attempt was made to load a document, or an XML Fragment, using DOMLSParser * and the processing has been stopped.

* *

SERIALIZE_ERR: * If an attempt was made to serialize a Node using LSSerializer and the processing * has been stopped.

* * @since DOM Level 3 */ enum LSExceptionCode { PARSE_ERR = 81, SERIALIZE_ERR = 82 }; //@} // ----------------------------------------------------------------------- // Constructors // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * Default constructor for DOMLSException. * */ DOMLSException(); /** * Constructor which takes an error code and a message. * * @param code The error code which indicates the exception * @param messageCode The string containing the error message * @param memoryManager The memory manager used to (de)allocate memory */ DOMLSException(short code, short messageCode, MemoryManager* const memoryManager); /** * Copy constructor. * * @param other The object to be copied. */ DOMLSException(const DOMLSException &other); //@} // ----------------------------------------------------------------------- // Destructors // ----------------------------------------------------------------------- /** @name Destructor. */ //@{ /** * Destructor for DOMLSException. * */ virtual ~DOMLSException(); //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMLSException & operator = (const DOMLSException &); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMDocumentTraversal.hpp000644 000765 000024 00000016455 13241160337 023573 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMDocumentTraversal.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTTRAVERSAL_HPP) #define XERCESC_INCLUDE_GUARD_DOMDOCUMENTTRAVERSAL_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMNode; class DOMNodeIterator; class DOMTreeWalker; /** * DOMDocumentTraversal contains methods that create * DOMNodeIterators and DOMTreeWalkers to traverse a * node and its children in document order (depth first, pre-order * traversal, which is equivalent to the order in which the start tags occur * in the text representation of the document). In DOMs which support the * Traversal feature, DOMDocumentTraversal will be implemented by * the same objects that implement the DOMDocument interface. *

See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. * @since DOM Level 2 */ class CDOM_EXPORT DOMDocumentTraversal { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMDocumentTraversal() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMDocumentTraversal(const DOMDocumentTraversal &); DOMDocumentTraversal & operator = (const DOMDocumentTraversal &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMDocumentTraversal() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMDocumentRange interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 2 */ //@{ /** * Creates a NodeIterator object. (DOM2) * * NodeIterators are used to step through a set of nodes, e.g. the set of nodes in a NodeList, the * document subtree governed by a particular node, the results of a query, or any other set of nodes. * The set of nodes to be iterated is determined by the implementation of the NodeIterator. DOM Level 2 * specifies a single NodeIterator implementation for document-order traversal of a document subtree. * Instances of these iterators are created by calling DOMDocumentTraversal.createNodeIterator(). * * To produce a view of the document that has entity references expanded and does not * expose the entity reference node itself, use the whatToShow flags to hide the entity * reference node and set expandEntityReferences to true when creating the iterator. To * produce a view of the document that has entity reference nodes but no entity expansion, * use the whatToShow flags to show the entity reference node and set * expandEntityReferences to false. * * @param root The root node of the DOM tree * @param whatToShow This attribute determines which node types are presented via the iterator. * @param filter The filter used to screen nodes * @param entityReferenceExpansion The value of this flag determines whether the children of entity reference nodes are * visible to the iterator. If false, they will be skipped over. * @since DOM Level 2 */ virtual DOMNodeIterator *createNodeIterator(DOMNode* root, DOMNodeFilter::ShowType whatToShow, DOMNodeFilter* filter, bool entityReferenceExpansion) = 0; /** * Creates a TreeWalker object. (DOM2) * * TreeWalker objects are used to navigate a document tree or subtree using the view of the document defined * by its whatToShow flags and any filters that are defined for the TreeWalker. Any function which performs * navigation using a TreeWalker will automatically support any view defined by a TreeWalker. * * Omitting nodes from the logical view of a subtree can result in a structure that is substantially different from * the same subtree in the complete, unfiltered document. Nodes that are siblings in the TreeWalker view may * be children of different, widely separated nodes in the original view. For instance, consider a Filter that skips * all nodes except for DOMText nodes and the root node of a document. In the logical view that results, all text * nodes will be siblings and appear as direct children of the root node, no matter how deeply nested the * structure of the original document. * * To produce a view of the document that has entity references expanded * and does not expose the entity reference node itself, use the whatToShow * flags to hide the entity reference node and set expandEntityReferences to * true when creating the TreeWalker. To produce a view of the document * that has entity reference nodes but no entity expansion, use the * whatToShow flags to show the entity reference node and set * expandEntityReferences to false * * @param root The root node of the DOM tree * @param whatToShow This attribute determines which node types are presented via the tree-walker. * @param filter The filter used to screen nodes * @param entityReferenceExpansion The value of this flag determines whether the children of entity reference nodes are * visible to the tree-walker. If false, they will be skipped over. * @since DOM Level 2 */ virtual DOMTreeWalker *createTreeWalker(DOMNode* root, DOMNodeFilter::ShowType whatToShow, DOMNodeFilter* filter, bool entityReferenceExpansion) = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMComment.hpp000644 000765 000024 00000005021 13241160340 021510 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMComment.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMCOMMENT_HPP) #define XERCESC_INCLUDE_GUARD_DOMCOMMENT_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * This interface inherits from CharacterData and represents the * content of a comment, i.e., all the characters between the starting ' * <!--' and ending '-->'. *

See also the Document Object Model (DOM) Level 2 Core Specification. * * @since DOM Level 1 */ class CDOM_EXPORT DOMComment: public DOMCharacterData { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMComment() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMComment(const DOMComment &); DOMComment & operator = (const DOMComment &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMComment() {}; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMXPathExpression.hpp000644 000765 000024 00000012502 13241160337 023222 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMXPathExpression.hpp 698579 2008-09-24 14:13:08Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHEXPRESSION_HPP) #define XERCESC_INCLUDE_GUARD_DOMXPATHEXPRESSION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMNode; /** * The DOMXPathExpression interface represents a parsed and resolved XPath expression. * @since DOM Level 3 */ class CDOM_EXPORT DOMXPathExpression { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMXPathExpression() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMXPathExpression(const DOMXPathExpression &); DOMXPathExpression& operator = (const DOMXPathExpression&); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMXPathExpression() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMXPathExpression interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ /** * Evaluates this XPath expression and returns a result. * @param contextNode of type DOMNode The context is context * node for the evaluation of this XPath expression. * If the XPathEvaluator was obtained by casting the Document then this must * be owned by the same document and must be a DOMDocument, DOMElement, * DOMAttribute, DOMText, DOMCDATASection, * DOMComment, DOMProcessingInstruction, or * XPathNamespace. If the context node is a DOMText or a * DOMCDATASection, then the context is interpreted as the whole logical * text node as seen by XPath, unless the node is empty in which case it may not * serve as the XPath context. * @param type If a specific type is specified, then the result * will be coerced to return the specified type relying on XPath conversions and fail * if the desired coercion is not possible. This must be one of the type codes of DOMXPathResult. * @param result of type DOMXPathResult* The result specifies a specific result object which * may be reused and returned by this method. If this is specified as nullor the * implementation does not reuse the specified result, a new result object will be constructed * and returned. * @return DOMXPathResult* The result of the evaluation of the XPath expression. * @exception DOMXPathException * TYPE_ERR: Raised if the result cannot be converted to return the specified type. * @exception DOMException * WRONG_DOCUMENT_ERR: The DOMNode is from a document that is not supported by * the XPathEvaluator that created this DOMXPathExpression. * NOT_SUPPORTED_ERR: The DOMNode is not a type permitted as an XPath context node or the * request type is not permitted by this DOMXPathExpression. */ virtual DOMXPathResult* evaluate(const DOMNode *contextNode, DOMXPathResult::ResultType type, DOMXPathResult* result) const = 0; //@} // ----------------------------------------------------------------------- // Non-standard Extension // ----------------------------------------------------------------------- /** @name Non-standard Extension */ //@{ /** * Called to indicate that this DOMXPathExpression is no longer in use * and that the implementation may relinquish any resources associated with it. * * Access to a released object will lead to unexpected result. */ virtual void release() = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMStringList.hpp000644 000765 000024 00000010552 13241160337 022223 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMStringList.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMSTRINGLIST_HPP) #define XERCESC_INCLUDE_GUARD_DOMSTRINGLIST_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * The DOMStringList interface provides the abstraction of an ordered * collection of strings, without defining or constraining how this collection * is implemented. The items in the DOMStringList are accessible via * an integral index, starting from 0. */ class CDOM_EXPORT DOMStringList { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMStringList() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMStringList(const DOMStringList &); DOMStringList & operator = (const DOMStringList &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMStringList() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMStringList interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Returns the index item in the collection. * * If index is greater than or equal to the number of strings in * the list, this returns null. * * @param index Index into the collection. * @return The string at the indexth position in the * DOMStringList, or null if that is not a valid * index. * @since DOM Level 3 */ virtual const XMLCh *item(XMLSize_t index) const = 0; /** * Returns the number of strings in the list. * * The range of valid child node indices is 0 to length-1 inclusive. * * @since DOM Level 3 */ virtual XMLSize_t getLength() const = 0; /** * Test if a string is part of this DOMStringList * * @return true if the string has been found, false otherwise. * * @since DOM Level 3 */ virtual bool contains(const XMLCh*) const = 0; //@} // ----------------------------------------------------------------------- // Non-standard Extension // ----------------------------------------------------------------------- /** @name Non-standard Extension */ //@{ /** * Called to indicate that this list is no longer in use * and that the implementation may relinquish any resources associated with it and * its associated children. * * Access to a released object will lead to unexpected result. * */ virtual void release() = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMLSSerializer.hpp000644 000765 000024 00000063606 13241160337 022501 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLSSerializer.hpp 883665 2009-11-24 11:41:38Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMLSSERIALIZER_HPP) #define XERCESC_INCLUDE_GUARD_DOMLSSERIALIZER_HPP /** * * DOMLSSerializer provides an API for serializing (writing) a DOM document out in * an XML document. The XML data is written to an output stream, the type of * which depends on the specific language bindings in use. During * serialization of XML data, namespace fixup is done when possible. *

DOMLSSerializer accepts any node type for serialization. For * nodes of type Document or Entity, well formed * XML will be created if possible. The serialized output for these node * types is either as a Document or an External Entity, respectively, and is * acceptable input for an XML parser. For all other types of nodes the * serialized form is not specified, but should be something useful to a * human for debugging or diagnostic purposes. Note: rigorously designing an * external (source) form for stand-alone node types that don't already have * one defined in seems a bit much to take on here. *

Within a Document or Entity being serialized, Nodes are processed as * follows Documents are written including an XML declaration and a DTD * subset, if one exists in the DOM. Writing a document node serializes the * entire document. Entity nodes, when written directly by * write defined in the DOMLSSerializer interface, * output the entity expansion but no namespace fixup is done. The resulting * output will be valid as an external entity. Entity References nodes are * serializes as an entity reference of the form * "&entityName;") in the output. Child nodes (the * expansion) of the entity reference are ignored. CDATA sections * containing content characters that can not be represented in the * specified output encoding are handled according to the * "split-cdata-sections" feature.If the feature is true, CDATA * sections are split, and the unrepresentable characters are serialized as * numeric character references in ordinary content. The exact position and * number of splits is not specified. If the feature is false, * unrepresentable characters in a CDATA section are reported as errors. The * error is not recoverable - there is no mechanism for supplying * alternative characters and continuing with the serialization. All other * node types (DOMElement, DOMText, etc.) are serialized to their corresponding * XML source form. *

Within the character data of a document (outside of markup), any * characters that cannot be represented directly are replaced with * character references. Occurrences of '<' and '&' are replaced by * the predefined entities &lt; and &amp. The other predefined * entities (&gt, &apos, etc.) are not used; these characters can be * included directly. Any character that can not be represented directly in * the output character encoding is serialized as a numeric character * reference. *

Attributes not containing quotes are serialized in quotes. Attributes * containing quotes but no apostrophes are serialized in apostrophes * (single quotes). Attributes containing both forms of quotes are * serialized in quotes, with quotes within the value represented by the * predefined entity &quot;. Any character that can not be represented * directly in the output character encoding is serialized as a numeric * character reference. *

Within markup, but outside of attributes, any occurrence of a character * that cannot be represented in the output character encoding is reported * as an error. An example would be serializing the element * <LaCañada/> with the encoding="us-ascii". *

When requested by setting the normalize-characters feature * on DOMLSSerializer, all data to be serialized, both markup and * character data, is W3C Text normalized according to the rules defined in * . The W3C Text normalization process affects only the data as it is being * written; it does not alter the DOM's view of the document after * serialization has completed. *

Namespaces are fixed up during serialization, the serialization process * will verify that namespace declarations, namespace prefixes and the * namespace URIs associated with Elements and Attributes are consistent. If * inconsistencies are found, the serialized form of the document will be * altered to remove them. The algorithm used for doing the namespace fixup * while seralizing a document is a combination of the algorithms used for * lookupNamespaceURI and lookupPrefix. previous paragraph to be * defined closer here. *

Any changes made affect only the namespace prefixes and declarations * appearing in the serialized data. The DOM's view of the document is not * altered by the serialization operation, and does not reflect any changes * made to namespace declarations or prefixes in the serialized output. *

While serializing a document the serializer will write out * non-specified values (such as attributes whose specified is * false) if the output-default-values feature is * set to true. If the output-default-values flag * is set to false and the use-abstract-schema * feature is set to true the abstract schema will be used to * determine if a value is specified or not, if * use-abstract-schema is not set the specified * flag on attribute nodes is used to determine if attribute values should * be written out. *

Ref to Core spec (1.1.9, XML namespaces, 5th paragraph) entity ref * description about warning about unbound entity refs. Entity refs are * always serialized as &foo;, also mention this in the load part of * this spec. *

When serializing a document the DOMLSSerializer checks to see if the document * element in the document is a DOM Level 1 element or a DOM Level 2 (or * higher) element (this check is done by looking at the localName of the * root element). If the root element is a DOM Level 1 element then the * DOMLSSerializer will issue an error if a DOM Level 2 (or higher) element is * found while serializing. Likewise if the document element is a DOM Level * 2 (or higher) element and the DOMLSSerializer sees a DOM Level 1 element an * error is issued. Mixing DOM Level 1 elements with DOM Level 2 (or higher) * is not supported. *

DOMLSSerializers have a number of named features that can be * queried or set. The name of DOMLSSerializer features must be valid * XML names. Implementation specific features (extensions) should choose an * implementation dependent prefix to avoid name collisions. *

Here is a list of properties that must be recognized by all * implementations. *

*
"normalize-characters"
*
*
*
true
*
[ * optional] (default) Perform the W3C Text Normalization of the characters * in document as they are written out. Only the characters being written * are (potentially) altered. The DOM document itself is unchanged.
*
* false
*
[required] do not perform character normalization.
*
*
* "split-cdata-sections"
*
*
*
true
*
[required] (default) * Split CDATA sections containing the CDATA section termination marker * ']]>' or characters that can not be represented in the output * encoding, and output the characters using numeric character references. * If a CDATA section is split a warning is issued.
*
false
*
[ * required] Signal an error if a CDATASection contains an * unrepresentable character.
*
*
"validation"
*
*
*
true
*
[ * optional] Use the abstract schema to validate the document as it is being * serialized. If validation errors are found the error handler is notified * about the error. Setting this state will also set the feature * use-abstract-schema to true.
*
false
*
[ * required] (default) Don't validate the document as it is being * serialized.
*
*
"expand-entity-references"
*
*
*
true
*
[ * optional] Expand EntityReference nodes when serializing.
*
* false
*
[required] (default) Serialize all * EntityReference nodes as XML entity references.
*
*
* "whitespace-in-element-content"
*
*
*
true
*
[required] ( * default) Output all white spaces in the document.
*
false
*
[ * optional] Only output white space that is not within element content. The * implementation is expected to use the * isWhitespaceInElementContent flag on Text nodes * to determine if a text node should be written out or not.
*
*
* "discard-default-content"
*
*
*
true
*
[required] (default * ) Use whatever information available to the implementation (i.e. XML * schema, DTD, the specified flag on Attr nodes, * and so on) to decide what attributes and content should be serialized or * not. Note that the specified flag on Attr nodes * in itself is not always reliable, it is only reliable when it is set to * false since the only case where it can be set to * false is if the attribute was created by a Level 1 * implementation.
*
false
*
[required] Output all attributes and * all content.
*
*
"format-canonical"
*
*
*
true
*
[optional] * This formatting writes the document according to the rules specified in . * Setting this feature to true will set the feature "format-pretty-print" * to false.
*
false
*
[required] (default) Don't canonicalize the * output.
*
*
"format-pretty-print"
*
*
*
true
*
[optional] * Formatting the output by adding whitespace to produce a pretty-printed, * indented, human-readable form. The exact form of the transformations is * not specified by this specification. Setting this feature to true will * set the feature "format-canonical" to false.
*
false
*
[required] * (default) Don't pretty-print the result.
*
*
"http://apache.org/xml/features/dom/byte-order-mark"
*
*
*
false
*
[optional] * (default) Setting this feature to true will output the correct BOM for the specified * encoding.
*
true
*
[required] * Don't generate a BOM.
*
*
"http://apache.org/xml/features/pretty-print/space-first-level-elements"
*
*
*
true
*
[optional] * (default) Setting this feature to true will add an extra line feed between the elements * that are children of the document root.
*
false
*
[required] * Don't add the extra line feed.
*
*
*

See also the Document Object Model (DOM) Level 3 Load and Save Specification. * * @since DOM Level 3 */ #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMLSOutput; class CDOM_EXPORT DOMLSSerializer { protected : // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMLSSerializer() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMLSSerializer(const DOMLSSerializer &); DOMLSSerializer & operator = (const DOMLSSerializer &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMLSSerializer() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMLSSerializer interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ // ----------------------------------------------------------------------- // Feature methods // ----------------------------------------------------------------------- /** * The DOMConfiguration object used by the LSSerializer when serializing a DOM node. * * In addition to the parameters recognized in on the DOMConfiguration * interface defined in [DOM Level 3 Core], the DOMConfiguration objects * for DOMLSSerializer add or modify the following parameters: * * "canonical-form" * true [optional] * Writes the document according to the rules specified in [Canonical XML]. In addition to * the behavior described in "canonical-form" [DOM Level 3 Core], setting this parameter to * true will set the parameters "format-pretty-print", "discard-default-content", and * "xml-declaration", to false. Setting one of those parameters to true will set this * parameter to false. Serializing an XML 1.1 document when "canonical-form" is true will * generate a fatal error. * false [required] (default) * Do not canonicalize the output. * * "discard-default-content" * true [required] (default) * Use the DOMAttr::getSpecified attribute to decide what attributes should be discarded. * Note that some implementations might use whatever information available to the implementation * (i.e. XML schema, DTD, the DOMAttr::getSpecified attribute, and so on) to determine what * attributes and content to discard if this parameter is set to true. * false [required] * Keep all attributes and all content. * * "format-pretty-print" * true [optional] * Formatting the output by adding whitespace to produce a pretty-printed, indented, * human-readable form. The exact form of the transformations is not specified by this specification. * Pretty-printing changes the content of the document and may affect the validity of the document, * validating implementations should preserve validity. * false [required] (default) * Don't pretty-print the result. * * "ignore-unknown-character-denormalizations" * true [required] (default) * If, while verifying full normalization when [XML 1.1] is supported, a character is encountered * for which the normalization properties cannot be determined, then raise a "unknown-character-denormalization" * warning (instead of raising an error, if this parameter is not set) and ignore any possible * denormalizations caused by these characters. * false [optional] * Report a fatal error if a character is encountered for which the processor cannot determine the * normalization properties. * * "normalize-characters" * This parameter is equivalent to the one defined by DOMConfiguration in [DOM Level 3 Core]. * Unlike in the Core, the default value for this parameter is true. While DOM implementations are not * required to support fully normalizing the characters in the document according to appendix E of [XML 1.1], * this parameter must be activated by default if supported. * * "xml-declaration" * true [required] (default) * If a DOMDocument, DOMElement, or DOMEntity node is serialized, the XML declaration, or text declaration, * should be included. The version (DOMDocument::xmlVersion if the document is a Level 3 document and the * version is non-null, otherwise use the value "1.0"), and the output encoding (see DOMLSSerializer::write * for details on how to find the output encoding) are specified in the serialized XML declaration. * false [required] * Do not serialize the XML and text declarations. Report a "xml-declaration-needed" warning if this will * cause problems (i.e. the serialized data is of an XML version other than [XML 1.0], or an encoding would * be needed to be able to re-parse the serialized data). * * "error-handler" * Contains a DOMErrorHandler object. If an error is encountered in the document, the implementation will call back * the DOMErrorHandler registered using this parameter. The implementation may provide a default DOMErrorHandler * object. When called, DOMError::relatedData will contain the closest node to where the error occurred. * If the implementation is unable to determine the node where the error occurs, DOMError::relatedData will contain * the DOMDocument node. Mutations to the document from within an error handler will result in implementation * dependent behavior. * * @return The pointer to the configuration object. * @since DOM Level 3 */ virtual DOMConfiguration* getDomConfig() = 0; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** * The end-of-line sequence of characters to be used in the XML being * written out. The only permitted values are these: *

*
null
*
* Use a default end-of-line sequence. DOM implementations should choose * the default to match the usual convention for text files in the * environment being used. Implementations must choose a default * sequence that matches one of those allowed by 2.11 "End-of-Line * Handling". However, Xerces-C++ always uses LF when this * property is set to null since otherwise automatic * translation of LF to CR-LF on Windows for text files would * result in such files containing CR-CR-LF. If you need Windows-style * end of line sequences in your output, consider writing to a file * opened in text mode or explicitly set this property to CR-LF.
*
CR
*
The carriage-return character (\#xD).
*
CR-LF
*
The * carriage-return and line-feed characters (\#xD \#xA).
*
LF
*
The line-feed * character (\#xA).
*
*
The default value for this attribute is null. * * @param newLine The end-of-line sequence of characters to be used. * @see getNewLine * @since DOM Level 3 */ virtual void setNewLine(const XMLCh* const newLine) = 0; /** * When the application provides a filter, the serializer will call out * to the filter before serializing each Node. Attribute nodes are never * passed to the filter. The filter implementation can choose to remove * the node from the stream or to terminate the serialization early. * * @param filter The writer filter to be used. * @see getFilter * @since DOM Level 3 */ virtual void setFilter(DOMLSSerializerFilter *filter) = 0; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Return the end-of-line sequence of characters to be used in the XML being * written out. * * @return The end-of-line sequence of characters to be used. * @see setNewLine * @since DOM Level 3 */ virtual const XMLCh* getNewLine() const = 0; /** * Return the WriterFilter used. * * @return The writer filter used. * @see setFilter * @since DOM Level 3 */ virtual DOMLSSerializerFilter* getFilter() const = 0; // ----------------------------------------------------------------------- // Write methods // ----------------------------------------------------------------------- /** * Write out the specified node as described above in the description of * DOMLSSerializer. Writing a Document or Entity node produces a * serialized form that is well formed XML. Writing other node types * produces a fragment of text in a form that is not fully defined by * this document, but that should be useful to a human for debugging or * diagnostic purposes. * * @param nodeToWrite The Document or Entity node to * be written. For other node types, something sensible should be * written, but the exact serialized form is not specified. * @param destination The destination for the data to be written. * @return Returns true if node was * successfully serialized and false in case a failure * occured and the failure wasn't canceled by the error handler. * @since DOM Level 3 */ virtual bool write(const DOMNode* nodeToWrite, DOMLSOutput* const destination) = 0; /** * Write out the specified node as described above in the description of * DOMLSSerializer. Writing a Document or Entity node produces a * serialized form that is well formed XML. Writing other node types * produces a fragment of text in a form that is not fully defined by * this document, but that should be useful to a human for debugging or * diagnostic purposes. * * @param nodeToWrite The Document or Entity node to * be written. For other node types, something sensible should be * written, but the exact serialized form is not specified. * @param uri The destination for the data to be written. * @return Returns true if node was * successfully serialized and false in case a failure * occured and the failure wasn't canceled by the error handler. * @since DOM Level 3 */ virtual bool writeToURI(const DOMNode* nodeToWrite, const XMLCh* uri) = 0; /** * Serialize the specified node as described above in the description of * DOMLSSerializer. The result of serializing the node is * returned as a string. Writing a Document or Entity node produces a * serialized form that is well formed XML. Writing other node types * produces a fragment of text in a form that is not fully defined by * this document, but that should be useful to a human for debugging or * diagnostic purposes. * * @param nodeToWrite The node to be written. * @param manager The memory manager to be used to allocate the result string. * If NULL is used, the memory manager used to construct the serializer will * be used. * @return Returns the serialized data, or null in case a * failure occured and the failure wasn't canceled by the error * handler. The returned string is always in UTF-16. * The encoding information available in DOMLSSerializer is ignored in writeToString(). * @since DOM Level 3 */ virtual XMLCh* writeToString(const DOMNode* nodeToWrite, MemoryManager* manager = NULL) = 0; //@} // ----------------------------------------------------------------------- // Non-standard Extension // ----------------------------------------------------------------------- /** @name Non-standard Extension */ //@{ /** * Called to indicate that this Writer is no longer in use * and that the implementation may relinquish any resources associated with it. * * Access to a released object will lead to unexpected result. */ virtual void release() = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMNodeIterator.hpp000644 000765 000024 00000017662 13241160340 022523 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNodeIterator.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMNODEITERATOR_HPP) #define XERCESC_INCLUDE_GUARD_DOMNODEITERATOR_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * DOMNodeIterators are used to step through a set of nodes, e.g. * the set of nodes in a DOMNodeList, the document subtree * governed by a particular DOMNode, the results of a query, or * any other set of nodes. The set of nodes to be iterated is determined by * the implementation of the DOMNodeIterator. DOM Level 2 * specifies a single DOMNodeIterator implementation for * document-order traversal of a document subtree. Instances of these * DOMNodeIterators are created by calling * DOMDocumentTraversal.createNodeIterator(). *

See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. * @since DOM Level 2 */ class CDOM_EXPORT DOMNodeIterator { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMNodeIterator() {} DOMNodeIterator(const DOMNodeIterator &) {} //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented operators */ //@{ DOMNodeIterator & operator = (const DOMNodeIterator &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMNodeIterator() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMNodeFilter interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 2 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * The root node of the DOMNodeIterator, as specified * when it was created. * @since DOM Level 2 */ virtual DOMNode* getRoot() = 0; /** * Return which node types are presented via the iterator. * This attribute determines which node types are presented via the * DOMNodeIterator. The available set of constants is defined * in the DOMNodeFilter interface. Nodes not accepted by * whatToShow will be skipped, but their children may still * be considered. Note that this skip takes precedence over the filter, * if any. * @since DOM Level 2 * */ virtual DOMNodeFilter::ShowType getWhatToShow() = 0; /** * The DOMNodeFilter used to screen nodes. * * @since DOM Level 2 */ virtual DOMNodeFilter* getFilter() = 0; /** * Return the expandEntityReferences flag. * The value of this flag determines whether the children of entity * reference nodes are visible to the DOMNodeIterator. If * false, these children and their descendants will be rejected. Note * that this rejection takes precedence over whatToShow and * the filter. Also note that this is currently the only situation where * DOMNodeIterators may reject a complete subtree rather than * skipping individual nodes. *
*
To produce a view of the document that has entity references * expanded and does not expose the entity reference node itself, use * the whatToShow flags to hide the entity reference node * and set expandEntityReferences to true when creating the * DOMNodeIterator. To produce a view of the document that has * entity reference nodes but no entity expansion, use the * whatToShow flags to show the entity reference node and * set expandEntityReferences to false. * * @since DOM Level 2 */ virtual bool getExpandEntityReferences() = 0; // ----------------------------------------------------------------------- // Query methods // ----------------------------------------------------------------------- /** * Returns the next node in the set and advances the position of the * DOMNodeIterator in the set. After a * DOMNodeIterator is created, the first call to * nextNode() returns the first node in the set. * @return The next DOMNode in the set being iterated over, or * null if there are no more members in that set. * @exception DOMException * INVALID_STATE_ERR: Raised if this method is called after the * detach method was invoked. * @since DOM Level 2 */ virtual DOMNode* nextNode() = 0; /** * Returns the previous node in the set and moves the position of the * DOMNodeIterator backwards in the set. * @return The previous DOMNode in the set being iterated over, * or null if there are no more members in that set. * @exception DOMException * INVALID_STATE_ERR: Raised if this method is called after the * detach method was invoked. * @since DOM Level 2 */ virtual DOMNode* previousNode() = 0; /** * Detaches the DOMNodeIterator from the set which it iterated * over, releasing any computational resources and placing the * DOMNodeIterator in the INVALID state. After * detach has been invoked, calls to nextNode * or previousNode will raise the exception * INVALID_STATE_ERR. * @since DOM Level 2 */ virtual void detach() = 0; //@} // ----------------------------------------------------------------------- // Non-standard Extension // ----------------------------------------------------------------------- /** @name Non-standard Extension */ //@{ /** * Called to indicate that this NodeIterator is no longer in use * and that the implementation may relinquish any resources associated with it. * (release() will call detach() where appropriate) * * Access to a released object will lead to unexpected result. */ virtual void release() = 0; //@} }; #define GetDOMNodeIteratorMemoryManager GET_DIRECT_MM(fDocument) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMProcessingInstruction.hpp000644 000765 000024 00000010242 13241160340 024465 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMProcessingInstruction.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMPROCESSINGINSTRUCTION_HPP) #define XERCESC_INCLUDE_GUARD_DOMPROCESSINGINSTRUCTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * The DOMProcessingInstruction interface represents a "processing * instruction", used in XML as a way to keep processor-specific information * in the text of the document. * * @since DOM Level 1 */ class CDOM_EXPORT DOMProcessingInstruction: public DOMNode { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMProcessingInstruction() {} DOMProcessingInstruction(const DOMProcessingInstruction &other) : DOMNode(other) {} //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented operators */ //@{ DOMProcessingInstruction & operator = (const DOMProcessingInstruction &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMProcessingInstruction() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMProcessingInstruction interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 1 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * The target of this processing instruction. * * XML defines this as being the * first token following the markup that begins the processing instruction. * * @since DOM Level 1 */ virtual const XMLCh * getTarget() const = 0; /** * The content of this processing instruction. * * This is from the first non * white space character after the target to the character immediately * preceding the ?>. * @exception DOMException * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * @since DOM Level 1 */ virtual const XMLCh * getData() const = 0; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** * Sets the content of this processing instruction. * * This is from the first non * white space character after the target to the character immediately * preceding the ?>. * @param data The string containing the processing instruction * @since DOM Level 1 */ virtual void setData(const XMLCh * data) = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMXPathNamespace.hpp000644 000765 000024 00000011025 13241160337 022756 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMXPathNamespace.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHNAMESPACE_HPP) #define XERCESC_INCLUDE_GUARD_DOMXPATHNAMESPACE_HPP #include XERCES_CPP_NAMESPACE_BEGIN class DOMElement; /** * The DOMXPathNamespace interface is returned by DOMXPathResult * interfaces to represent the XPath namespace node type that DOM lacks. There is no * public constructor for this node type. Attempts to place it into a hierarchy or a * NamedNodeMap result in a DOMException with the code HIERARCHY_REQUEST_ERR. This node * is read only, so methods or setting of attributes that would mutate the node result * in a DOMException with the code NO_MODIFICATION_ALLOWED_ERR. * The core specification describes attributes of the DOMNode interface that * are different for different node types but does not describe XPATH_NAMESPACE_NODE, * so here is a description of those attributes for this node type. All attributes of * DOMNode not described in this section have a null or false value. * ownerDocument matches the ownerDocument of the ownerElement even if the element is later adopted. * nodeName is always the string "#namespace". * prefix is the prefix of the namespace represented by the node. * localName is the same as prefix. * nodeType is equal to XPATH_NAMESPACE_NODE. * namespaceURI is the namespace URI of the namespace represented by the node. * nodeValue is the same as namespaceURI. * adoptNode, cloneNode, and importNode fail on this node type by raising a DOMException with the code NOT_SUPPORTED_ERR. * Note: In future versions of the XPath specification, the definition of a namespace node may * be changed incompatibly, in which case incompatible changes to field values may be required to * implement versions beyond XPath 1.0. * @since DOM Level 3 */ class CDOM_EXPORT DOMXPathNamespace : public DOMNode { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMXPathNamespace() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMXPathNamespace(const DOMXPathNamespace &); DOMXPathNamespace& operator = (const DOMXPathNamespace&); //@} public: enum XPathNodeType { XPATH_NAMESPACE_NODE = 13 }; // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMXPathNamespace() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMXPathNamespace interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ /** * The DOMElement on which the namespace was in scope when * it was requested. This does not change on a returned namespace node * even if the document changes such that the namespace goes out of * scope on that element and this node is no longer found there by XPath. * @since DOM Level 3 */ virtual DOMElement *getOwnerElement() const = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMXPathEvaluator.hpp000644 000765 000024 00000021662 13241160337 023034 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMXPathEvaluator.hpp 698579 2008-09-24 14:13:08Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHEVALUATOR_HPP) #define XERCESC_INCLUDE_GUARD_DOMXPATHEVALUATOR_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMXPathNSResolver; class DOMXPathExpression; class DOMNode; /** * The evaluation of XPath expressions is provided by DOMXPathEvaluator. * In a DOM implementation which supports the XPath feature, the DOMXPathEvaluator * interface will be implemented on the same object which implements the Document interface permitting * it to be obtained by casting or by using the DOM Level 3 getFeature method. In this case the * implementation obtained from the Document supports the XPath DOM module and is compatible * with the XPath 1.0 specification. * Evaluation of expressions with specialized extension functions or variables may not * work in all implementations and is, therefore, not portable. XPathEvaluator implementations * may be available from other sources that could provide specific support for specialized extension * functions or variables as would be defined by other specifications. * @since DOM Level 3 */ class CDOM_EXPORT DOMXPathEvaluator { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMXPathEvaluator() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMXPathEvaluator(const DOMXPathEvaluator &); DOMXPathEvaluator& operator = (const DOMXPathEvaluator&); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMXPathEvaluator() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMXPathEvaluator interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ /** * Creates a parsed XPath expression with resolved namespaces. This is useful * when an expression will be reused in an application since it makes it * possible to compile the expression string into a more efficient internal * form and preresolve all namespace prefixes which occur within the expression. * @param expression of type XMLCh - The XPath expression string to be parsed. * @param resolver of type XPathNSResolver - The resolver permits * translation of all prefixes, including the xml namespace prefix, within the XPath expression * into appropriate namespace URIs. If this is specified as null, any namespace * prefix within the expression will result in DOMException being thrown with the * code NAMESPACE_ERR. * @return DOMXPathExpression The compiled form of the XPath expression. * @exception DOMXPathException * INVALID_EXPRESSION_ERR: Raised if the expression is not legal according to the * rules of the DOMXPathEvaluator. * @exception DOMException * NAMESPACE_ERR: Raised if the expression contains namespace prefixes which cannot * be resolved by the specified XPathNSResolver. * @since DOM Level 3 */ virtual DOMXPathExpression* createExpression(const XMLCh *expression, const DOMXPathNSResolver *resolver) = 0; /** Adapts any DOM node to resolve namespaces so that an XPath expression can be * easily evaluated relative to the context of the node where it appeared within * the document. This adapter works like the DOM Level 3 method lookupNamespaceURI * on nodes in resolving the namespaceURI from a given prefix using the current * information available in the node's hierarchy at the time lookupNamespaceURI * is called. also correctly resolving the implicit xml prefix. * @param nodeResolver of type DOMNode The node to be used as a context * for namespace resolution. If this parameter is null, an unpopulated * DOMXPathNSResolver is returned, which can be populated using the * Xerces-C extension DOMXPathNSResolver::addNamespaceBinding(). * @return DOMXPathNSResolver The object which resolves namespaces * with respect to the definitions in scope for the specified node. */ virtual DOMXPathNSResolver* createNSResolver(const DOMNode *nodeResolver) = 0; /** * Evaluates an XPath expression string and returns a result of the specified * type if possible. * @param expression of type XMLCh The XPath expression string to be parsed * and evaluated. * @param contextNode of type DOMNode The context is context node * for the evaluation * of this XPath expression. If the DOMXPathEvaluator was obtained by * casting the DOMDocument then this must be owned by the same * document and must be a DOMDocument, DOMElement, * DOMAttribute, DOMText, DOMCDATASection, * DOMComment, DOMProcessingInstruction, or * XPathNamespace node. If the context node is a DOMText or * a DOMCDATASection, then the context is interpreted as the whole * logical text node as seen by XPath, unless the node is empty in which case it * may not serve as the XPath context. * @param resolver of type XPathNSResolver The resolver permits * translation of all prefixes, including the xml namespace prefix, within * the XPath expression into appropriate namespace URIs. If this is specified * as null, any namespace prefix within the expression will result in * DOMException being thrown with the code NAMESPACE_ERR. * @param type - If a specific type is specified, then * the result will be returned as the corresponding type. This must be one * of the codes of the DOMXPathResult interface. * @param result of type DOMXPathResult* - The result specifies a specific result object * which may be reused and returned by this method. If this is specified as * null or the implementation does not reuse the specified result, a new result * object will be constructed and returned. * @return DOMXPathResult* The result of the evaluation of the XPath expression. * @exception DOMXPathException * INVALID_EXPRESSION_ERR: Raised if the expression is not legal * according to the rules of the DOMXPathEvaluator * TYPE_ERR: Raised if the result cannot be converted to return the specified type. * @exception DOMException * NAMESPACE_ERR: Raised if the expression contains namespace prefixes * which cannot be resolved by the specified XPathNSResolver. * WRONG_DOCUMENT_ERR: The DOMNode is from a document that is not supported * by this DOMXPathEvaluator. * NOT_SUPPORTED_ERR: The DOMNode is not a type permitted as an XPath context * node or the request type is not permitted by this DOMXPathEvaluator. */ virtual DOMXPathResult* evaluate(const XMLCh *expression, const DOMNode *contextNode, const DOMXPathNSResolver *resolver, DOMXPathResult::ResultType type, DOMXPathResult* result) = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMImplementationLS.hpp000644 000765 000024 00000015736 13241160337 023356 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMImplementationLS.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONLS_HPP) #define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONLS_HPP #include XERCES_CPP_NAMESPACE_BEGIN class DOMLSParser; class DOMLSSerializer; class DOMLSInput; class DOMLSOutput; class MemoryManager; class XMLGrammarPool; /** *

DOMImplementationLS contains the factory methods for * creating Load and Save objects.

* *

An object that implements DOMImplementationLS is obtained by doing a * binding specific cast from DOMImplementation to DOMImplementationLS. * Implementations supporting the Load and Save feature must implement the * DOMImplementationLS interface on whatever object implements the * DOMImplementation interface.

* * @since DOM Level 3 */ class CDOM_EXPORT DOMImplementationLS { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMImplementationLS() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMImplementationLS(const DOMImplementationLS &); DOMImplementationLS & operator = (const DOMImplementationLS &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMImplementationLS() {}; //@} // ----------------------------------------------------------------------- // Public constants // ----------------------------------------------------------------------- /** @name Public constants */ //@{ /** * Create a synchronous or an asynchronous DOMLSParser. * @see createLSParser(const DOMImplementationLSMode mode, const XMLCh* const schemaType) * @since DOM Level 3 * */ enum DOMImplementationLSMode { MODE_SYNCHRONOUS = 1, MODE_ASYNCHRONOUS = 2 }; //@} // ----------------------------------------------------------------------- // Virtual DOMImplementationLS interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ // ----------------------------------------------------------------------- // Factory create methods // ----------------------------------------------------------------------- /** * Create a new DOMLSParser. The newly constructed parser may then be configured * by means of its DOMConfiguration object, and used to parse documents by * means of its parse method. * * @param mode The mode argument is either MODE_SYNCHRONOUS * or MODE_ASYNCHRONOUS, if mode is MODE_SYNCHRONOUS * then the DOMLSParser that is created will operate in synchronous * mode, if it's MODE_ASYNCHRONOUS then the DOMLSParser * that is created will operate in asynchronous mode. * @param schemaType An absolute URI representing the type of the schema * language used during the load of a DOMDocument using the newly * created DOMLSParser. Note that no lexical checking is done on * the absolute URI. In order to create a DOMLSParser for any kind * of schema types (i.e. the DOMLSParser will be free to use any * schema found), use the value NULL. * Note: For W3C XML Schema [XML Schema Part 1], applications must use * the value "http://www.w3.org/2001/XMLSchema". For XML DTD [XML 1.0], * applications must use the value "http://www.w3.org/TR/REC-xml". * Other Schema languages are outside the scope of the W3C and therefore should * recommend an absolute URI in order to use this method. * @param manager Pointer to the memory manager to be used to allocate objects. * @param gramPool The collection of cached grammars. * @return The newly created DOMLSParser object. This * DOMLSParser is either synchronous or asynchronous depending * on the value of the mode argument. * @exception DOMException NOT_SUPPORTED_ERR: Raised if the requested mode * or schema type is not supported. * * @see DOMLSParser * @since DOM Level 3 */ virtual DOMLSParser* createLSParser(const DOMImplementationLSMode mode, const XMLCh* const schemaType, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager, XMLGrammarPool* const gramPool = 0) = 0; /** * Create a new DOMLSSerializer. DOMLSSerializer is used to serialize a DOM tree * back into an XML document. * * @return The newly created DOMLSSerializer object. * * @see DOMLSSerializer * @since DOM Level 3 */ virtual DOMLSSerializer* createLSSerializer(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0; /** * Create a new "empty" DOMLSInput. * * @return The newly created DOMLSInput object. * * @see DOMLSInput * @since DOM Level 3 */ virtual DOMLSInput* createLSInput(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0; /** * Create a new "empty" LSOutput. * * @return The newly created LSOutput object. * * @see LSOutput * @since DOM Level 3 */ virtual DOMLSOutput* createLSOutput(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMLSOutput.hpp000644 000765 000024 00000013022 13241160337 021653 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLSOutput.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMLSOUTPUT_HPP) #define XERCESC_INCLUDE_GUARD_DOMLSOUTPUT_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLFormatTarget; /** * This interface represents an output destination for data. * * @see XMLFormatTarget * @since DOM Level 3 */ class CDOM_EXPORT DOMLSOutput { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMLSOutput() {}; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ DOMLSOutput(const DOMLSOutput &); DOMLSOutput & operator = (const DOMLSOutput &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMLSOutput() {}; //@} // ----------------------------------------------------------------------- // Virtual DOMLSOutput interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Returns the byte stream for this input source. * * @see InputSource */ virtual XMLFormatTarget* getByteStream() const = 0; /** * An input source can be set to force the parser to assume a particular * encoding for the data that input source reprsents, via the setEncoding() * method. This method returns name of the encoding that is to be forced. * If the encoding has never been forced, it returns a null pointer. * * @return The forced encoding, or null if none was supplied. * @see #setEncoding * @since DOM Level 3 */ virtual const XMLCh* getEncoding() const = 0; /** * Get the system identifier for this input source. * *

If the system ID is a URL, it will be fully resolved.

* * @return The system identifier. * @see #setSystemId * @since DOM Level 3 */ virtual const XMLCh* getSystemId() const = 0; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** * Sets the byte stream for this input source. * * @see BinInputStream */ virtual void setByteStream(XMLFormatTarget* stream) = 0; /** * Set the encoding which will be required for use with the XML text read * via a stream opened by this input source. * *

This is usually not set, allowing the encoding to be sensed in the * usual XML way. However, in some cases, the encoding in the file is known * to be incorrect because of intermediate transcoding, for instance * encapsulation within a MIME document. * * @param encodingStr The name of the encoding to force. * @since DOM Level 3 */ virtual void setEncoding(const XMLCh* const encodingStr) = 0; /** * Set the system identifier for this input source. * *

The system id is always required. The public id may be used to map * to another system id, but the system id must always be present as a fall * back.

* *

If the system ID is a URL, it must be fully resolved.

* * @param systemId The system identifier as a string. * @see #getSystemId * @since DOM Level 3 */ virtual void setSystemId(const XMLCh* const systemId) = 0; //@} // ----------------------------------------------------------------------- // Non-standard Extension // ----------------------------------------------------------------------- /** @name Non-standard Extension */ //@{ /** * Called to indicate that this DOMLSOutput is no longer in use * and that the implementation may relinquish any resources associated with it. * * Access to a released object will lead to unexpected result. */ virtual void release() = 0; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/DOMEntityReference.hpp000644 000765 000024 00000007370 13241160337 023220 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMEntityReference.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMENTITYREFERENCE_HPP) #define XERCESC_INCLUDE_GUARD_DOMENTITYREFERENCE_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * DOMEntityReference objects may be inserted into the structure * model when an entity reference is in the source document, or when the * user wishes to insert an entity reference. Note that character references * and references to predefined entities are considered to be expanded by * the HTML or XML processor so that characters are represented by their * Unicode equivalent rather than by an entity reference. Moreover, the XML * processor may completely expand references to entities while building the * structure model, instead of providing DOMEntityReference * objects. If it does provide such objects, then for a given * DOMEntityReference node, it may be that there is no * DOMEntity node representing the referenced entity. If such an * DOMEntity exists, then the subtree of the * DOMEntityReference node is in general a copy of the * DOMEntity node subtree. However, this may not be true when an * entity contains an unbound namespace prefix. In such a case, because the * namespace prefix resolution depends on where the entity reference is, the * descendants of the DOMEntityReference node may be bound to * different namespace URIs. *

As for DOMEntity nodes, DOMEntityReference nodes and * all their descendants are readonly. *

See also the Document Object Model (DOM) Level 2 Core Specification. * * @since DOM Level 1 */ class CDOM_EXPORT DOMEntityReference: public DOMNode { protected: // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ DOMEntityReference() {} DOMEntityReference(const DOMEntityReference &other) : DOMNode(other) {} //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented operators */ //@{ DOMEntityReference & operator = (const DOMEntityReference &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~DOMEntityReference() {}; //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMDeepNodeListPool.c000644 000765 000024 00000035145 13241160337 023673 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: DOMDeepNodeListPool.c 883368 2009-11-23 15:28:19Z amassari $ */ // --------------------------------------------------------------------------- // Include // --------------------------------------------------------------------------- #include #if defined(XERCES_TMPLSINC) #include #endif #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // DOMDeepNodeListPool: Constructors and Destructor // --------------------------------------------------------------------------- template DOMDeepNodeListPool::DOMDeepNodeListPool( const XMLSize_t modulus , const bool adoptElems , const XMLSize_t initSize) : fAdoptedElems(adoptElems) , fBucketList(0) , fHashModulus(modulus) , fIdPtrs(0) , fIdPtrsCount(initSize) , fIdCounter(0) , fMemoryManager(XMLPlatformUtils::fgMemoryManager) { initialize(modulus); // // Allocate the initial id pointers array. We don't have to zero them // out since the fIdCounter value tells us which ones are valid. The // zeroth element is never used (and represents an invalid pool id.) // if (!fIdPtrsCount) fIdPtrsCount = 256; fIdPtrs = (TVal**) fMemoryManager->allocate(fIdPtrsCount * sizeof(TVal*));//new TVal*[fIdPtrsCount]; fIdPtrs[0] = 0; } template DOMDeepNodeListPool::DOMDeepNodeListPool( const XMLSize_t modulus , const bool adoptElems , const THasher& hasher , const XMLSize_t initSize) : fAdoptedElems(adoptElems) , fBucketList(0) , fHashModulus(modulus) , fIdPtrs(0) , fIdPtrsCount(initSize) , fIdCounter(0) , fMemoryManager(XMLPlatformUtils::fgMemoryManager) , fHasher(hasher) { initialize(modulus); // // Allocate the initial id pointers array. We don't have to zero them // out since the fIdCounter value tells us which ones are valid. The // zeroth element is never used (and represents an invalid pool id.) // if (!fIdPtrsCount) fIdPtrsCount = 256; fIdPtrs = (TVal**) fMemoryManager->allocate(fIdPtrsCount * sizeof(TVal*));//new TVal*[fIdPtrsCount]; fIdPtrs[0] = 0; } template DOMDeepNodeListPool::DOMDeepNodeListPool( const XMLSize_t modulus , const XMLSize_t initSize) : fAdoptedElems(true) , fBucketList(0) , fHashModulus(modulus) , fIdPtrs(0) , fIdPtrsCount(initSize) , fIdCounter(0) , fMemoryManager(XMLPlatformUtils::fgMemoryManager) { initialize(modulus); // // Allocate the initial id pointers array. We don't have to zero them // out since the fIdCounter value tells us which ones are valid. The // zeroth element is never used (and represents an invalid pool id.) // if (!fIdPtrsCount) fIdPtrsCount = 256; fIdPtrs = (TVal**) fMemoryManager->allocate(fIdPtrsCount * sizeof(TVal*));//new TVal*[fIdPtrsCount]; fIdPtrs[0] = 0; } template void DOMDeepNodeListPool::initialize(const XMLSize_t modulus) { if (modulus == 0) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::HshTbl_ZeroModulus, fMemoryManager); // Allocate the bucket list and zero them fBucketList = (DOMDeepNodeListPoolTableBucketElem**) fMemoryManager->allocate ( fHashModulus * sizeof(DOMDeepNodeListPoolTableBucketElem*) );//new DOMDeepNodeListPoolTableBucketElem*[fHashModulus]; for (XMLSize_t index = 0; index < fHashModulus; index++) fBucketList[index] = 0; } template DOMDeepNodeListPool::~DOMDeepNodeListPool() { removeAll(); // Then delete the bucket list & hasher & id pointers list fMemoryManager->deallocate(fIdPtrs);//delete [] fIdPtrs; fMemoryManager->deallocate(fBucketList);//delete [] fBucketList; } // --------------------------------------------------------------------------- // DOMDeepNodeListPool: Element management // --------------------------------------------------------------------------- template bool DOMDeepNodeListPool::isEmpty() const { // Just check the bucket list for non-empty elements for (XMLSize_t buckInd = 0; buckInd < fHashModulus; buckInd++) { if (fBucketList[buckInd] != 0) return false; } return true; } template bool DOMDeepNodeListPool::containsKey( const void* const key1 , const XMLCh* const key2 , const XMLCh* const key3) const { XMLSize_t hashVal; const DOMDeepNodeListPoolTableBucketElem* findIt = findBucketElem(key1, key2, key3, hashVal); return (findIt != 0); } template void DOMDeepNodeListPool::removeAll() { if (fIdCounter == 0) return; // Clean up the buckets first for (XMLSize_t buckInd = 0; buckInd < fHashModulus; buckInd++) { // Get the bucket list head for this entry DOMDeepNodeListPoolTableBucketElem* curElem = fBucketList[buckInd]; DOMDeepNodeListPoolTableBucketElem* nextElem; while (curElem) { // Save the next element before we hose this one nextElem = curElem->fNext; // If we adopted the data, then delete it too // (Note: the userdata hash table instance has data type of void *. // This will generate compiler warnings here on some platforms, but they // can be ignored since fAdoptedElements is false. if (fAdoptedElems) delete curElem->fData; // Then delete the current element and move forward fMemoryManager->deallocate(curElem->fKey2);//delete [] curElem->fKey2; fMemoryManager->deallocate(curElem->fKey3);//delete [] curElem->fKey3; delete curElem; curElem = nextElem; } // Clean out this entry fBucketList[buckInd] = 0; } // Reset the id counter fIdCounter = 0; } template void DOMDeepNodeListPool::cleanup() { removeAll(); // Then delete the bucket list & hasher & id pointers list fMemoryManager->deallocate(fIdPtrs);//delete [] fIdPtrs; fMemoryManager->deallocate(fBucketList);//delete [] fBucketList; } // --------------------------------------------------------------------------- // DOMDeepNodeListPool: Getters // --------------------------------------------------------------------------- template TVal* DOMDeepNodeListPool::getByKey(const void* const key1, const XMLCh* const key2, const XMLCh* const key3) { XMLSize_t hashVal; DOMDeepNodeListPoolTableBucketElem* findIt = findBucketElem(key1, key2, key3, hashVal); if (!findIt) return 0; return findIt->fData; } template const TVal* DOMDeepNodeListPool::getByKey(const void* const key1, const XMLCh* const key2, const XMLCh* const key3) const { XMLSize_t hashVal; const DOMDeepNodeListPoolTableBucketElem* findIt = findBucketElem(key1, key2, key3, hashVal); if (!findIt) return 0; return findIt->fData; } template TVal* DOMDeepNodeListPool::getById(const XMLSize_t elemId) { // If its either zero or beyond our current id, its an error if (!elemId || (elemId > fIdCounter)) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Pool_InvalidId, fMemoryManager); return fIdPtrs[elemId]; } template const TVal* DOMDeepNodeListPool::getById(const XMLSize_t elemId) const { // If its either zero or beyond our current id, its an error if (!elemId || (elemId > fIdCounter)) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Pool_InvalidId, fMemoryManager); return fIdPtrs[elemId]; } // --------------------------------------------------------------------------- // DOMDeepNodeListPool: Putters // --------------------------------------------------------------------------- template XMLSize_t DOMDeepNodeListPool::put(void* key1, XMLCh* key2, XMLCh* key3, TVal* const valueToAdopt) { // First see if the key exists already XMLSize_t hashVal; DOMDeepNodeListPoolTableBucketElem* newBucket = findBucketElem(key1, key2, key3, hashVal); // // If so,then update its value. If not, then we need to add it to // the right bucket // if (newBucket) { if (fAdoptedElems) delete newBucket->fData; fMemoryManager->deallocate(newBucket->fKey2);//delete[] newBucket->fKey2; fMemoryManager->deallocate(newBucket->fKey3);//delete[] newBucket->fKey3; newBucket->fData = valueToAdopt; newBucket->fKey1 = key1; newBucket->fKey2 = XMLString::replicate(key2, fMemoryManager); newBucket->fKey3 = XMLString::replicate(key3, fMemoryManager); } else { // Revisit: the gcc compiler 2.95.x is generating an // internal compiler error message. So we use the default // memory manager for now. #if defined (XML_GCC_VERSION) && (XML_GCC_VERSION < 29600) newBucket = new DOMDeepNodeListPoolTableBucketElem ( key1 , key2 , key3 , valueToAdopt , fBucketList[hashVal] , fMemoryManager ); #else newBucket = new (fMemoryManager) DOMDeepNodeListPoolTableBucketElem ( key1 , key2 , key3 , valueToAdopt , fBucketList[hashVal] , fMemoryManager ); #endif fBucketList[hashVal] = newBucket; } // // Give this new one the next available id and add to the pointer list. // Expand the list if that is now required. // if (fIdCounter + 1 == fIdPtrsCount) { // Create a new count 1.5 times larger and allocate a new array XMLSize_t newCount = (XMLSize_t)(fIdPtrsCount * 1.5); TVal** newArray = (TVal**) fMemoryManager->allocate ( newCount * sizeof(TVal*) );//new TVal*[newCount]; // Copy over the old contents to the new array memcpy(newArray, fIdPtrs, fIdPtrsCount * sizeof(TVal*)); // Ok, toss the old array and store the new data fMemoryManager->deallocate(fIdPtrs); //delete [] fIdPtrs; fIdPtrs = newArray; fIdPtrsCount = newCount; } const XMLSize_t retId = ++fIdCounter; fIdPtrs[retId] = valueToAdopt; // Return the id that we gave to this element return retId; } // --------------------------------------------------------------------------- // DOMDeepNodeListPool: Private methods // --------------------------------------------------------------------------- template DOMDeepNodeListPoolTableBucketElem* DOMDeepNodeListPool:: findBucketElem(const void* const key1, const XMLCh* const key2, const XMLCh* const key3, XMLSize_t& hashVal) { // Hash the key hashVal = fHasher.getHashVal(key1, fHashModulus); assert(hashVal < fHashModulus); // Search that bucket for the key DOMDeepNodeListPoolTableBucketElem* curElem = fBucketList[hashVal]; while (curElem) { //key2 and key3 are XMLCh*, compareString takes null pointer vs zero len string the same //but we need them to be treated as different keys in this case if (fHasher.equals(key1, curElem->fKey1) && (XMLString::equals(key2, curElem->fKey2)) && (XMLString::equals(key3, curElem->fKey3))) { if (!key2 || !curElem->fKey2) { if (key2 || curElem->fKey2) { curElem = curElem->fNext; continue; } } if (!key3 || !curElem->fKey3) { if (key3 || curElem->fKey3) { curElem = curElem->fNext; continue; } } return curElem; } curElem = curElem->fNext; } return 0; } template const DOMDeepNodeListPoolTableBucketElem* DOMDeepNodeListPool:: findBucketElem(const void* const key1, const XMLCh* const key2, const XMLCh* const key3, XMLSize_t& hashVal) const { // Hash the key hashVal = fHasher.getHashVal(key1, fHashModulus); assert(hashVal < fHashModulus); // Search that bucket for the key const DOMDeepNodeListPoolTableBucketElem* curElem = fBucketList[hashVal]; while (curElem) { //key2 and key3 are XMLCh*, compareString takes null pointer vs zero len string the same //but we need them to be treated as different keys in this case if (fHasher.equals(key1, curElem->fKey1) && (XMLString::equals(key2, curElem->fKey2)) && (XMLString::equals(key3, curElem->fKey3))) { if (!key2 || !curElem->fKey2) { if (key2 || curElem->fKey2) { curElem = curElem->fNext; continue; } } if (!key3 || !curElem->fKey3) { if (key3 || curElem->fKey3) { curElem = curElem->fNext; continue; } } return curElem; } curElem = curElem->fNext; } return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMStringPool.cpp000644 000765 000024 00000004605 13241160337 023157 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMStringPool.cpp 1528170 2013-10-01 18:23:57Z amassari $ */ #include #include #include "DOMStringPool.hpp" #include "DOMDocumentImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN DOMBuffer:: DOMBuffer(DOMDocumentImpl *doc, XMLSize_t capacity) : fBuffer(0) , fIndex(0) , fCapacity(capacity) , fDoc(doc) { // Buffer is one larger than capacity, to allow for zero term fBuffer = (XMLCh*) doc->allocate((fCapacity+1)*sizeof(XMLCh)); // Keep it null terminated fBuffer[0] = XMLCh(0); } // --------------------------------------------------------------------------- // DOMBuffer: Private helper methods // --------------------------------------------------------------------------- void DOMBuffer::expandCapacity(const XMLSize_t extraNeeded, bool releasePrevious /*= false*/) { //not enough room. Calc new capacity and allocate new buffer const XMLSize_t newCap = (XMLSize_t)((fIndex + extraNeeded) * 1.25); XMLCh* newBuf = (XMLCh*) fDoc->allocate((newCap+1)*sizeof(XMLCh)); // Copy over the old stuff memcpy(newBuf, fBuffer, fCapacity * sizeof(XMLCh)); // If the caller told us to deallocate the old memory, do it; // it may know that nobody could possibly get a pointer to the old memory buffer // (e.g. if the DOM node is being created by the parser). Otherwise leave the old // buffer in document heap; yes, this is a leak, but live with it! if (releasePrevious) fDoc->release(fBuffer); // store new stuff fBuffer = newBuf; fCapacity = newCap; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMLSOutputImpl.hpp000644 000765 000024 00000005120 13241160337 023436 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLSOutputImpl.hpp 641193 2008-03-26 08:06:57Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMLSOUTPUTIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMLSOUTPUTIMPL_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class CDOM_EXPORT DOMLSOutputImpl : public XMemory, public DOMLSOutput { public: DOMLSOutputImpl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~DOMLSOutputImpl(); virtual XMLFormatTarget* getByteStream() const; virtual const XMLCh* getEncoding() const; virtual const XMLCh* getSystemId() const; virtual void setByteStream(XMLFormatTarget* stream); virtual void setEncoding(const XMLCh* const encodingStr); virtual void setSystemId(const XMLCh* const systemId); virtual void release(); private: /** unimplemented copy ctor and assignment operator */ DOMLSOutputImpl(const DOMLSOutputImpl&); DOMLSOutputImpl & operator = (const DOMLSOutputImpl&); protected: // ----------------------------------------------------------------------- // Private data members // // fByteStream // We don't own it // // fEncoding // We own it // // fSystemId // We own it // // ----------------------------------------------------------------------- XMLFormatTarget *fByteStream; XMLCh *fEncoding; XMLCh *fSystemId; MemoryManager* fMemoryManager; }; inline XMLFormatTarget* DOMLSOutputImpl::getByteStream() const { return fByteStream; } inline const XMLCh* DOMLSOutputImpl::getEncoding() const { return fEncoding; } inline const XMLCh* DOMLSOutputImpl::getSystemId() const { return fSystemId; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMEntityImpl.cpp000644 000765 000024 00000024667 13241160337 023167 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMEntityImpl.cpp 1800911 2017-07-05 18:52:15Z scantor $ */ #include #include #include #include "DOMEntityImpl.hpp" #include "DOMDocumentImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN DOMEntityImpl::DOMEntityImpl(DOMDocument *ownerDoc, const XMLCh *eName) : fNode(this, ownerDoc), fParent(this, ownerDoc), fPublicId(0), fSystemId(0), fNotationName(0), fRefEntity(0), fInputEncoding(0), fXmlEncoding(0), fXmlVersion(0), fBaseURI(0), fEntityRefNodeCloned(false) { fName = ((DOMDocumentImpl *)ownerDoc)->getPooledString(eName); fNode.setReadOnly(true, true); } DOMEntityImpl::DOMEntityImpl(const DOMEntityImpl &other, bool deep) : DOMEntity(other), fNode(this, other.fNode), fParent(this, other.fParent), fName(other.fName), fPublicId(other.fPublicId), fSystemId(other.fSystemId), fNotationName(other.fNotationName), fRefEntity(other.fRefEntity), fInputEncoding(other.fInputEncoding), fXmlEncoding(other.fXmlEncoding), fXmlVersion(other.fXmlVersion), fBaseURI(other.fBaseURI), fEntityRefNodeCloned(false) { if (deep) fParent.cloneChildren(&other); fNode.setReadOnly(true, true); } DOMEntityImpl::~DOMEntityImpl() { } DOMNode *DOMEntityImpl::cloneNode(bool deep) const { DOMNode* newNode = new (fParent.fOwnerDocument, DOMMemoryManager::ENTITY_OBJECT) DOMEntityImpl(*this, deep); fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode); return newNode; } const XMLCh * DOMEntityImpl::getNodeName() const { return fName; } DOMNode::NodeType DOMEntityImpl::getNodeType() const { return DOMNode::ENTITY_NODE; } const XMLCh * DOMEntityImpl::getNotationName() const { return fNotationName; } const XMLCh * DOMEntityImpl::getPublicId() const { return fPublicId; } const XMLCh * DOMEntityImpl::getSystemId() const { return fSystemId; } const XMLCh* DOMEntityImpl::getBaseURI() const { return fBaseURI; } void DOMEntityImpl::setNodeValue(const XMLCh *arg) { fNode.setNodeValue(arg); } void DOMEntityImpl::setNotationName(const XMLCh *arg) { DOMDocumentImpl *doc = (DOMDocumentImpl *)fParent.fOwnerDocument; fNotationName = doc->cloneString(arg); } void DOMEntityImpl::setPublicId(const XMLCh *arg) { DOMDocumentImpl *doc = (DOMDocumentImpl *)fParent.fOwnerDocument; fPublicId = doc->cloneString(arg); } void DOMEntityImpl::setSystemId(const XMLCh *arg) { DOMDocumentImpl *doc = (DOMDocumentImpl *)fParent.fOwnerDocument; fSystemId = doc->cloneString(arg); } void DOMEntityImpl::setBaseURI(const XMLCh* baseURI) { if (baseURI && *baseURI) { XMLCh* temp = (XMLCh*) ((DOMDocumentImpl *)fParent.fOwnerDocument)->allocate((XMLString::stringLen(baseURI) + 9)*sizeof(XMLCh)); XMLString::fixURI(baseURI, temp); fBaseURI = temp; } else fBaseURI = 0; } void DOMEntityImpl::setEntityRef(DOMEntityReference* other) { fRefEntity = other; } DOMEntityReference* DOMEntityImpl::getEntityRef() const { return fRefEntity; } void DOMEntityImpl::cloneEntityRefTree() const { if (fEntityRefNodeCloned) return; // cast off const. This method is const because it is // called from a bunch of logically const methods, like // getFirstChild(). DOMEntityImpl *ncThis = (DOMEntityImpl *)this; //lazily clone the entityRef tree to this entity if (fParent.fFirstChild != 0) return; if (!fRefEntity) return; ncThis->fEntityRefNodeCloned = true; ncThis->fNode.setReadOnly(false, true); ncThis->fParent.cloneChildren(fRefEntity); ncThis->fNode.setReadOnly(true, true); } DOMNode * DOMEntityImpl::getFirstChild() const { cloneEntityRefTree(); return fParent.fFirstChild; } DOMNode * DOMEntityImpl::getLastChild() const { cloneEntityRefTree(); return fParent.getLastChild(); } DOMNodeList* DOMEntityImpl::getChildNodes() const { cloneEntityRefTree(); return this->fParent.getChildNodes(); } bool DOMEntityImpl::hasChildNodes() const { cloneEntityRefTree(); return fParent.fFirstChild!=0; } void DOMEntityImpl::release() { if (fNode.isOwned() && !fNode.isToBeReleased()) throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); DOMDocumentImpl* doc = (DOMDocumentImpl*) fParent.fOwnerDocument; if (doc) { fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0); fParent.release(); doc->release(this, DOMMemoryManager::ENTITY_OBJECT); } else { // shouldn't reach here throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); } } // // Functions inherited from Node // DOMNode* DOMEntityImpl::appendChild(DOMNode *newChild) {cloneEntityRefTree(); return fParent.appendChild (newChild); } DOMNamedNodeMap* DOMEntityImpl::getAttributes() const {return fNode.getAttributes (); } const XMLCh* DOMEntityImpl::getLocalName() const {return fNode.getLocalName (); } const XMLCh* DOMEntityImpl::getNamespaceURI() const {return fNode.getNamespaceURI (); } DOMNode* DOMEntityImpl::getNextSibling() const {return fNode.getNextSibling (); } const XMLCh* DOMEntityImpl::getNodeValue() const {return fNode.getNodeValue (); } DOMDocument* DOMEntityImpl::getOwnerDocument() const {return fParent.fOwnerDocument; } const XMLCh* DOMEntityImpl::getPrefix() const {return fNode.getPrefix (); } DOMNode* DOMEntityImpl::getParentNode() const {return fNode.getParentNode (); } DOMNode* DOMEntityImpl::getPreviousSibling() const {return fNode.getPreviousSibling (); } DOMNode* DOMEntityImpl::insertBefore(DOMNode *newChild, DOMNode *refChild) {cloneEntityRefTree(); return fParent.insertBefore (newChild, refChild); } void DOMEntityImpl::normalize() {cloneEntityRefTree(); fParent.normalize (); } DOMNode* DOMEntityImpl::removeChild(DOMNode *oldChild) {cloneEntityRefTree(); return fParent.removeChild (oldChild); } DOMNode* DOMEntityImpl::replaceChild(DOMNode *newChild, DOMNode *oldChild) {cloneEntityRefTree(); return fParent.replaceChild (newChild, oldChild); } bool DOMEntityImpl::isSupported(const XMLCh *feature, const XMLCh *version) const {return fNode.isSupported (feature, version); } void DOMEntityImpl::setPrefix(const XMLCh *prefix) {fNode.setPrefix(prefix); } bool DOMEntityImpl::hasAttributes() const {return fNode.hasAttributes(); } bool DOMEntityImpl::isSameNode(const DOMNode* other) const {return fNode.isSameNode(other); } bool DOMEntityImpl::isEqualNode(const DOMNode* arg) const {cloneEntityRefTree(); return fParent.isEqualNode(arg); } void* DOMEntityImpl::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) {return fNode.setUserData(key, data, handler); } void* DOMEntityImpl::getUserData(const XMLCh* key) const {return fNode.getUserData(key); } short DOMEntityImpl::compareDocumentPosition(const DOMNode* other) const {return fNode.compareDocumentPosition(other); } const XMLCh* DOMEntityImpl::getTextContent() const {return fNode.getTextContent(); } void DOMEntityImpl::setTextContent(const XMLCh* textContent){fNode.setTextContent(textContent); } const XMLCh* DOMEntityImpl::lookupPrefix(const XMLCh* namespaceURI) const {return fNode.lookupPrefix(namespaceURI); } bool DOMEntityImpl::isDefaultNamespace(const XMLCh* namespaceURI) const {return fNode.isDefaultNamespace(namespaceURI); } const XMLCh* DOMEntityImpl::lookupNamespaceURI(const XMLCh* prefix) const {return fNode.lookupNamespaceURI(prefix); } void* DOMEntityImpl::getFeature(const XMLCh* feature, const XMLCh* version) const {return fNode.getFeature(feature, version); } // Macro-in implementation accessors. DOMNODEIMPL_IMPL(DOMEntityImpl); DOMPARENTIMPL_IMPL(DOMEntityImpl); //Introduced in DOM Level 3 const XMLCh* DOMEntityImpl::getInputEncoding() const { return fInputEncoding; } void DOMEntityImpl::setInputEncoding(const XMLCh* actualEncoding){ DOMDocumentImpl *doc = (DOMDocumentImpl *)fParent.fOwnerDocument; fInputEncoding = doc->cloneString(actualEncoding); } const XMLCh* DOMEntityImpl::getXmlEncoding() const { return fXmlEncoding; } void DOMEntityImpl::setXmlEncoding(const XMLCh* encoding){ DOMDocumentImpl *doc = (DOMDocumentImpl *)fParent.fOwnerDocument; fXmlEncoding = doc->cloneString(encoding); } const XMLCh* DOMEntityImpl::getXmlVersion() const { return fXmlVersion; } void DOMEntityImpl::setXmlVersion(const XMLCh* version){ DOMDocumentImpl *doc = (DOMDocumentImpl *)fParent.fOwnerDocument; fXmlVersion = doc->cloneString(version); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMTextImpl.cpp000644 000765 000024 00000036340 13241160337 022626 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMTextImpl.cpp 1800911 2017-07-05 18:52:15Z scantor $ */ #include #include #include #include #include #include #include #include "DOMDocumentImpl.hpp" #include "DOMStringPool.hpp" #include "DOMTextImpl.hpp" #include "DOMCharacterDataImpl.hpp" #include "DOMChildNode.hpp" #include "DOMRangeImpl.hpp" #include "DOMCasts.hpp" #include XERCES_CPP_NAMESPACE_BEGIN class DOMDocument; DOMTextImpl::DOMTextImpl(DOMDocument *ownerDoc, const XMLCh *dat) : fNode(this, ownerDoc), fCharacterData(ownerDoc, dat) { fNode.setIsLeafNode(true); } DOMTextImpl:: DOMTextImpl(DOMDocument *ownerDoc, const XMLCh* dat, XMLSize_t n) : fNode(this, ownerDoc), fCharacterData(ownerDoc, dat, n) { fNode.setIsLeafNode(true); } DOMTextImpl::DOMTextImpl(const DOMTextImpl &other, bool) : DOMText(other) , fNode(this, other.fNode) , fCharacterData(other.fCharacterData) { fNode.setIsLeafNode(true); } DOMTextImpl::~DOMTextImpl() { } DOMNode *DOMTextImpl::cloneNode(bool deep) const { DOMNode* newNode = new (getOwnerDocument(), DOMMemoryManager::TEXT_OBJECT) DOMTextImpl(*this, deep); fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode); return newNode; } const XMLCh * DOMTextImpl::getNodeName() const { static const XMLCh gtext[] = {chPound, chLatin_t, chLatin_e, chLatin_x, chLatin_t, chNull}; return gtext; } DOMNode::NodeType DOMTextImpl::getNodeType() const { return DOMNode::TEXT_NODE; } DOMText *DOMTextImpl::splitText(XMLSize_t offset) { if (fNode.isReadOnly()) { throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); } XMLSize_t len = fCharacterData.fDataBuf->getLen(); if (offset > len) throw DOMException(DOMException::INDEX_SIZE_ERR, 0, GetDOMNodeMemoryManager); DOMDocumentImpl *doc = (DOMDocumentImpl *)getOwnerDocument(); DOMText *newText = doc->createTextNode( this->substringData(offset, len - offset)); DOMNode *parent = getParentNode(); if (parent != 0) parent->insertBefore(newText, getNextSibling()); fCharacterData.fDataBuf->chop(offset); if (doc != 0) { Ranges* ranges = doc->getRanges(); if (ranges != 0) { XMLSize_t sz = ranges->size(); if (sz != 0) { for (XMLSize_t i =0; ielementAt(i)->updateSplitInfo( this, newText, offset); } } } } return newText; } bool DOMTextImpl::isIgnorableWhitespace() const { return fNode.ignorableWhitespace(); } void DOMTextImpl::setIgnorableWhitespace(bool ignorable) { fNode.ignorableWhitespace(ignorable); } bool DOMTextImpl::getIsElementContentWhitespace() const { return isIgnorableWhitespace(); } const XMLCh* DOMTextImpl::getWholeText() const { DOMDocument *doc = getOwnerDocument(); if (!doc) { throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, GetDOMNodeMemoryManager); return 0; } DOMNode* root=doc->getDocumentElement(); DOMTreeWalker* pWalker=doc->createTreeWalker(root!=NULL?root:(DOMNode*)this, DOMNodeFilter::SHOW_ALL, NULL, true); pWalker->setCurrentNode((DOMNode*)this); // Logically-adjacent text nodes are Text or CDATASection nodes that can be visited sequentially in document order or in // reversed document order without entering, exiting, or passing over Element, Comment, or ProcessingInstruction nodes. DOMNode* prevNode; while((prevNode=pWalker->previousNode())!=NULL) { if(prevNode->getNodeType()==ELEMENT_NODE || prevNode->getNodeType()==COMMENT_NODE || prevNode->getNodeType()==PROCESSING_INSTRUCTION_NODE) break; } XMLBuffer buff(1023, GetDOMNodeMemoryManager); DOMNode* nextNode; while((nextNode=pWalker->nextNode())!=NULL) { if(nextNode->getNodeType()==ELEMENT_NODE || nextNode->getNodeType()==COMMENT_NODE || nextNode->getNodeType()==PROCESSING_INSTRUCTION_NODE) break; if(nextNode->getNodeType()==TEXT_NODE || nextNode->getNodeType()==CDATA_SECTION_NODE) buff.append(nextNode->getNodeValue()); } pWalker->release(); XMLCh* wholeString = (XMLCh*)((DOMDocumentImpl*)doc)->allocate((buff.getLen()+1) * sizeof(XMLCh)); XMLString::copyString(wholeString, buff.getRawBuffer()); return wholeString; } DOMText* DOMTextImpl::replaceWholeText(const XMLCh* newText) { DOMDocument *doc = getOwnerDocument(); DOMTreeWalker* pWalker=doc->createTreeWalker(doc->getDocumentElement(), DOMNodeFilter::SHOW_ALL, NULL, true); pWalker->setCurrentNode((DOMNode*)this); // Logically-adjacent text nodes are Text or CDATASection nodes that can be visited sequentially in document order or in // reversed document order without entering, exiting, or passing over Element, Comment, or ProcessingInstruction nodes. DOMNode* pFirstTextNode=this; DOMNode* prevNode; while((prevNode=pWalker->previousNode())!=NULL) { if(prevNode->getNodeType()==ELEMENT_NODE || prevNode->getNodeType()==COMMENT_NODE || prevNode->getNodeType()==PROCESSING_INSTRUCTION_NODE) break; pFirstTextNode=prevNode; } // before doing any change we need to check if we are going to remove an entity reference that doesn't contain just text DOMNode* pCurrentNode=pWalker->getCurrentNode(); DOMNode* nextNode; while((nextNode=pWalker->nextNode())!=NULL) { if(nextNode->getNodeType()==ELEMENT_NODE || nextNode->getNodeType()==COMMENT_NODE || nextNode->getNodeType()==PROCESSING_INSTRUCTION_NODE) break; if(nextNode->getNodeType()==ENTITY_REFERENCE_NODE) { DOMTreeWalker* pInnerWalker=doc->createTreeWalker(nextNode, DOMNodeFilter::SHOW_ALL, NULL, true); while(pInnerWalker->nextNode()) { short nodeType=pInnerWalker->getCurrentNode()->getNodeType(); if(nodeType!=ENTITY_REFERENCE_NODE && nodeType!=TEXT_NODE && nodeType!=CDATA_SECTION_NODE) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); } pInnerWalker->release(); } } DOMText* retVal=NULL; // if the first node in the chain is a text node, replace its content, otherwise create a new node if(newText && *newText) { if(!castToNodeImpl(pFirstTextNode)->isReadOnly() && (pFirstTextNode->getNodeType()==TEXT_NODE || pFirstTextNode->getNodeType()==CDATA_SECTION_NODE)) { pFirstTextNode->setNodeValue(newText); retVal=(DOMText*)pFirstTextNode; } else { if(getNodeType()==TEXT_NODE) retVal=doc->createTextNode(newText); else retVal=doc->createCDATASection(newText); pFirstTextNode->getParentNode()->insertBefore(retVal, pFirstTextNode); } } // now delete all the following text nodes pWalker->setCurrentNode(pCurrentNode); while((nextNode=pWalker->nextNode())!=NULL) { if(nextNode->getNodeType()==ELEMENT_NODE || nextNode->getNodeType()==COMMENT_NODE || nextNode->getNodeType()==PROCESSING_INSTRUCTION_NODE) break; if(nextNode!=retVal) { // keep the tree walker valid pWalker->previousNode(); nextNode->getParentNode()->removeChild(nextNode); nextNode->release(); } } pWalker->release(); return retVal; } void DOMTextImpl::release() { if (fNode.isOwned() && !fNode.isToBeReleased()) throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument(); if (doc) { fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0); fCharacterData.releaseBuffer(); doc->release(this, DOMMemoryManager::TEXT_OBJECT); } else { // shouldn't reach here throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); } } // // Delegation functions // DOMNode* DOMTextImpl::appendChild(DOMNode *newChild) {return fNode.appendChild (newChild); } DOMNamedNodeMap* DOMTextImpl::getAttributes() const {return fNode.getAttributes (); } DOMNodeList* DOMTextImpl::getChildNodes() const {return fNode.getChildNodes (); } DOMNode* DOMTextImpl::getFirstChild() const {return fNode.getFirstChild (); } DOMNode* DOMTextImpl::getLastChild() const {return fNode.getLastChild (); } const XMLCh* DOMTextImpl::getLocalName() const {return fNode.getLocalName (); } const XMLCh* DOMTextImpl::getNamespaceURI() const {return fNode.getNamespaceURI (); } DOMNode* DOMTextImpl::getNextSibling() const {return fChild.getNextSibling (); } const XMLCh* DOMTextImpl::getNodeValue() const {return fCharacterData.getNodeValue (); } DOMDocument* DOMTextImpl::getOwnerDocument() const {return fNode.getOwnerDocument (); } const XMLCh* DOMTextImpl::getPrefix() const {return fNode.getPrefix (); } DOMNode* DOMTextImpl::getParentNode() const {return fChild.getParentNode (this); } DOMNode* DOMTextImpl::getPreviousSibling() const {return fChild.getPreviousSibling (this); } bool DOMTextImpl::hasChildNodes() const {return fNode.hasChildNodes (); } DOMNode* DOMTextImpl::insertBefore(DOMNode *newChild, DOMNode *refChild) {return fNode.insertBefore (newChild, refChild); } void DOMTextImpl::normalize() {fNode.normalize (); } DOMNode* DOMTextImpl::removeChild(DOMNode *oldChild) {return fNode.removeChild (oldChild); } DOMNode* DOMTextImpl::replaceChild(DOMNode *newChild, DOMNode *oldChild) {return fNode.replaceChild (newChild, oldChild); } bool DOMTextImpl::isSupported(const XMLCh *feature, const XMLCh *version) const {return fNode.isSupported (feature, version); } void DOMTextImpl::setPrefix(const XMLCh *prefix) {fNode.setPrefix(prefix); } bool DOMTextImpl::hasAttributes() const {return fNode.hasAttributes(); } bool DOMTextImpl::isSameNode(const DOMNode* other) const {return fNode.isSameNode(other); } bool DOMTextImpl::isEqualNode(const DOMNode* arg) const {return fNode.isEqualNode(arg); } void* DOMTextImpl::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) {return fNode.setUserData(key, data, handler); } void* DOMTextImpl::getUserData(const XMLCh* key) const {return fNode.getUserData(key); } const XMLCh* DOMTextImpl::getBaseURI() const {return fNode.getBaseURI(); } short DOMTextImpl::compareDocumentPosition(const DOMNode* other) const {return fNode.compareDocumentPosition(other); } const XMLCh* DOMTextImpl::getTextContent() const {return fNode.getTextContent(); } void DOMTextImpl::setTextContent(const XMLCh* textContent){fNode.setTextContent(textContent); } const XMLCh* DOMTextImpl::lookupPrefix(const XMLCh* namespaceURI) const {return fNode.lookupPrefix(namespaceURI); } bool DOMTextImpl::isDefaultNamespace(const XMLCh* namespaceURI) const {return fNode.isDefaultNamespace(namespaceURI); } const XMLCh* DOMTextImpl::lookupNamespaceURI(const XMLCh* prefix) const {return fNode.lookupNamespaceURI(prefix); } void* DOMTextImpl::getFeature(const XMLCh* feature, const XMLCh* version) const {return fNode.getFeature(feature, version); } // Macro-in implementation accessors. DOMNODEIMPL_IMPL(DOMTextImpl); DOMCHILDIMPL_IMPL(DOMTextImpl); // // Delegation of CharacerData functions. // const XMLCh* DOMTextImpl::getData() const {return fCharacterData.getData();} XMLSize_t DOMTextImpl::getLength() const {return fCharacterData.getLength();} const XMLCh* DOMTextImpl::substringData(XMLSize_t offset, XMLSize_t count) const {return fCharacterData.substringData(this, offset, count);} void DOMTextImpl::appendData(const XMLCh *arg) {fCharacterData.appendData(this, arg);} void DOMTextImpl::insertData(XMLSize_t offset, const XMLCh *arg) {fCharacterData.insertData(this, offset, arg);} void DOMTextImpl::deleteData(XMLSize_t offset, XMLSize_t count) {fCharacterData.deleteData(this, offset, count);} void DOMTextImpl::replaceData(XMLSize_t offset, XMLSize_t count, const XMLCh *arg) {fCharacterData.replaceData(this, offset, count, arg);} void DOMTextImpl::setData(const XMLCh *data) {fCharacterData.setData(this, data);} void DOMTextImpl::setNodeValue(const XMLCh *nodeValue) {fCharacterData.setNodeValue (this, nodeValue); } void DOMTextImpl::appendData(const XMLCh *arg, XMLSize_t n) {fCharacterData.appendData(this, arg, n);} void DOMTextImpl::appendDataFast(const XMLCh *arg, XMLSize_t n) {fCharacterData.appendDataFast(this, arg, n);} XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMNodeListImpl.cpp000644 000765 000024 00000003355 13241160337 023423 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNodeListImpl.cpp 671894 2008-06-26 13:29:21Z borisk $ */ #include #include "DOMNodeListImpl.hpp" #include "DOMCasts.hpp" XERCES_CPP_NAMESPACE_BEGIN // revisit // this implementation is too stupid - needs a cache of some kind. // DOMNodeListImpl::DOMNodeListImpl(DOMParentNode *node) : fNode(node) { } DOMNodeListImpl:: ~DOMNodeListImpl() { } XMLSize_t DOMNodeListImpl::getLength() const{ XMLSize_t count = 0; if (fNode) { DOMNode *node = fNode->fFirstChild; while(node != 0){ ++count; node = castToChildImpl(node)->nextSibling; } } return count; } DOMNode *DOMNodeListImpl::item(XMLSize_t index) const{ if (fNode) { DOMNode *node = fNode->fFirstChild; for(XMLSize_t i=0; inextSibling; return node; } return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMNodeIDMap.cpp000644 000765 000024 00000015011 13241160337 022610 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNodeIDMap.cpp 678144 2008-07-19 12:08:55Z borisk $ */ #include "DOMAttrImpl.hpp" #include "DOMDocumentImpl.hpp" #include "DOMNodeIDMap.hpp" #include #include #include XERCES_CPP_NAMESPACE_BEGIN static const XMLSize_t gPrimes[] = {997, 9973, 99991, 999983, 0 }; // To do - add a few more. static const float gMaxFill = 0.8f; // The maximum fraction of the total // table entries to consume before exanding. DOMNodeIDMap::DOMNodeIDMap(XMLSize_t initialSize, DOMDocument *doc) : fNumEntries(0) , fDoc(doc) { for (fSizeIndex = 0; gPrimes[fSizeIndex] < initialSize; fSizeIndex++) { if (gPrimes[fSizeIndex] == 0) { // We need a bigger size than the largest available one. // Big trouble. fSizeIndex--; ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::NodeIDMap_GrowErr, ((DOMDocumentImpl *)fDoc)->getMemoryManager()); } } fSize = gPrimes[fSizeIndex]; fMaxEntries = (XMLSize_t)(float(fSize) * gMaxFill); //fTable = new (fDoc) DOMAttr*[fSize]; fTable = (DOMAttr**) ((DOMDocumentImpl *)fDoc)->allocate(sizeof(DOMAttr*) * fSize); XMLSize_t i; for (i=0; i= fMaxEntries) growTable(); fNumEntries++; // // Hash the value string from the ID attribute being added to the table // 0 < Initial hash value < table size. // An initial hash of zero would cause the rehash to fail. // const XMLCh *id=attr->getValue(); XMLSize_t initalHash = XMLString::hash(id, fSize-1); initalHash++; XMLSize_t currentHash = initalHash; // // Loop looking for an empty slot for this ID. // Don't even bother checking to see if the ID is already there - // the table is only filled by the parser from valid documents, which // can not have duplicates. Behavior of invalid docs is not defined. // while (fTable[currentHash]!=0 && fTable[currentHash]!=(DOMAttr *)-1) { currentHash += initalHash; // rehash if (currentHash >= fSize) currentHash = currentHash % fSize; } // // We've found our slot. Stick the pointer to the attr into it. // fTable[currentHash] = attr; } void DOMNodeIDMap::remove(DOMAttr *attr) { // // Hash the value string from the ID attribute being added to the table // 0 < Initial hash value < table size. // An initial hash of zero would cause the rehash to fail. // const XMLCh *id=attr->getValue(); XMLSize_t initalHash = XMLString::hash(id, fSize-1); initalHash++; XMLSize_t currentHash = initalHash; // // Loop looking for a slot pointing to an attr with this id. // DOMAttr *tableSlot; while ((tableSlot= fTable[currentHash])!=0) { if (tableSlot == attr) { // Found the attribute. Set the slot to -1 to indicate // that it was once used, meaning that lookups, while never // matching here, can not stop either, but must rehash again // and continue searching. fTable[currentHash] = (DOMAttr *)-1; return; } currentHash += initalHash; // rehash. if (currentHash >= fSize) currentHash = currentHash % fSize; } // There is no matching entry in the table } DOMAttr *DOMNodeIDMap::find(const XMLCh *id) { // // Get the hashcode for the supplied string. // XMLSize_t initalHash = XMLString::hash(id, fSize-1); initalHash++; XMLSize_t currentHash = initalHash; // // Loop looking for a slot pointing to an attr with this id. // DOMAttr *tableSlot; while ((tableSlot= fTable[currentHash])!=0) { if ((tableSlot != (DOMAttr *)-1) && XMLString::equals(tableSlot->getValue(), id)) return tableSlot; currentHash += initalHash; // rehash if (currentHash >= fSize) currentHash = currentHash % fSize; } // There is no matching entry in the table return 0; } // // Grow the table to the next larger size. // It has gotten too full for efficient operation. // (We never fill it all the way) // void DOMNodeIDMap::growTable() { DOMAttr **oldTable = fTable; XMLSize_t oldSize = fSize; // // Figure the new table size. // #if defined(XERCES_DEBUG) fprintf(stderr, "growing...\n"); #endif fSizeIndex++; fSize = gPrimes[fSizeIndex]; if (fSize == 0) { // We need to grow bigger than the largest available size. // Big trouble. fSizeIndex--; ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::NodeIDMap_GrowErr, ((DOMDocumentImpl *)fDoc)->getMemoryManager()); } // // Allocate the new table. // //fTable = new (fDoc) DOMAttr *[fSize]; fTable = (DOMAttr**) ((DOMDocumentImpl *)fDoc)->allocate(sizeof(DOMAttr*) * fSize); XMLSize_t i; for (i=0; i #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class WrapperForXPathNSResolver : public XercesNamespaceResolver { public: WrapperForXPathNSResolver(XMLStringPool* pool, const DOMXPathNSResolver *resolver, MemoryManager* const manager) : fStringPool(pool), fResolver(resolver), fMemoryManager(manager) { } virtual unsigned int getNamespaceForPrefix(const XMLCh* const prefix) const { if(fResolver==NULL) throw DOMException(DOMException::NAMESPACE_ERR, 0, fMemoryManager); const XMLCh* nsUri=fResolver->lookupNamespaceURI(prefix); if(nsUri==NULL) throw DOMException(DOMException::NAMESPACE_ERR, 0, fMemoryManager); return fStringPool->addOrFind(nsUri); } protected: XMLStringPool* fStringPool; const DOMXPathNSResolver * fResolver; MemoryManager* const fMemoryManager; }; typedef JanitorMemFunCall CleanupType; DOMXPathExpressionImpl::DOMXPathExpressionImpl(const XMLCh *expression, const DOMXPathNSResolver *resolver, MemoryManager* const manager) : fStringPool(NULL), fParsedExpression(NULL), fExpression(NULL), fMoveToRoot(false), fMemoryManager(manager) { if(expression==NULL || *expression==0) throw DOMXPathException(DOMXPathException::INVALID_EXPRESSION_ERR, 0, fMemoryManager); CleanupType cleanup(this, &DOMXPathExpressionImpl::cleanUp); fStringPool = new (fMemoryManager) XMLStringPool(109, fMemoryManager); // XercesPath will complain if the expression starts with '/', add a "." in front of it and start from the document root if(*expression==chForwardSlash) { fExpression=(XMLCh*)fMemoryManager->allocate((XMLString::stringLen(expression)+2)*sizeof(XMLCh)); *fExpression = chPeriod; *(fExpression+1) = chNull; XMLString::catString(fExpression, expression); fMoveToRoot=true; } else fExpression=XMLString::replicate(expression); try { WrapperForXPathNSResolver wrappedResolver(fStringPool, resolver, fMemoryManager); fParsedExpression = new (fMemoryManager) XercesXPath(fExpression, fStringPool, &wrappedResolver, 0, true, fMemoryManager); } catch(const XPathException& ) { throw DOMXPathException(DOMXPathException::INVALID_EXPRESSION_ERR, 0, fMemoryManager); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } DOMXPathExpressionImpl::~DOMXPathExpressionImpl() { cleanUp(); } void DOMXPathExpressionImpl::cleanUp() { XMLString::release(&fExpression, fMemoryManager); delete fParsedExpression; delete fStringPool; } DOMXPathResult* DOMXPathExpressionImpl::evaluate(const DOMNode *contextNode, DOMXPathResult::ResultType type, DOMXPathResult* result) const { if(type!=DOMXPathResult::FIRST_ORDERED_NODE_TYPE && type!=DOMXPathResult::ORDERED_NODE_SNAPSHOT_TYPE && type!=DOMXPathResult::ANY_UNORDERED_NODE_TYPE && type!=DOMXPathResult::UNORDERED_NODE_SNAPSHOT_TYPE) throw DOMXPathException(DOMXPathException::TYPE_ERR, 0, fMemoryManager); if(contextNode==NULL || contextNode->getNodeType()!=DOMNode::ELEMENT_NODE) throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, fMemoryManager); JanitorMemFunCall r_cleanup ( 0, &DOMXPathResultImpl::release); DOMXPathResultImpl* r=(DOMXPathResultImpl*)result; if(r==NULL) { r=new (fMemoryManager) DOMXPathResultImpl(type, fMemoryManager); r_cleanup.reset (r); } else r->reset(type); XPathMatcher matcher(fParsedExpression, fMemoryManager); matcher.startDocumentFragment(); if(fMoveToRoot) { contextNode=contextNode->getOwnerDocument(); if(contextNode==NULL) throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, fMemoryManager); QName qName(contextNode->getNodeName(), 0, fMemoryManager); SchemaElementDecl elemDecl(&qName); RefVectorOf attrList(0, true, fMemoryManager); matcher.startElement(elemDecl, 0, XMLUni::fgZeroLenString, attrList, 0); DOMNode* child=contextNode->getFirstChild(); while(child) { if(child->getNodeType()==DOMNode::ELEMENT_NODE) testNode(&matcher, r, (DOMElement*)child); child=child->getNextSibling(); } matcher.endElement(elemDecl, XMLUni::fgZeroLenString); } else testNode(&matcher, r, (DOMElement*)contextNode); r_cleanup.release (); return r; } bool DOMXPathExpressionImpl::testNode(XPathMatcher* matcher, DOMXPathResultImpl* result, DOMElement *node) const { int uriId=fStringPool->addOrFind(node->getNamespaceURI()); QName qName(node->getNodeName(), uriId, fMemoryManager); SchemaElementDecl elemDecl(&qName); DOMNamedNodeMap* attrMap=node->getAttributes(); XMLSize_t attrCount = attrMap->getLength(); RefVectorOf attrList(attrCount, true, fMemoryManager); for(XMLSize_t i=0;iitem(i); attrList.addElement(new (fMemoryManager) XMLAttr(fStringPool->addOrFind(attr->getNamespaceURI()), attr->getNodeName(), attr->getNodeValue(), XMLAttDef::CData, attr->getSpecified(), fMemoryManager, NULL, true)); } matcher->startElement(elemDecl, uriId, node->getPrefix(), attrList, attrCount); unsigned char nMatch=matcher->isMatched(); if(nMatch!=0 && nMatch!=XPathMatcher::XP_MATCHED_DP) { result->addResult(node); if(result->getResultType()==DOMXPathResult::ANY_UNORDERED_NODE_TYPE || result->getResultType()==DOMXPathResult::FIRST_ORDERED_NODE_TYPE) return true; // abort navigation, we found one result } if(nMatch==0 || nMatch==XPathMatcher::XP_MATCHED_D || nMatch==XPathMatcher::XP_MATCHED_DP) { DOMNode* child=node->getFirstChild(); while(child) { if(child->getNodeType()==DOMNode::ELEMENT_NODE) if(testNode(matcher, result, (DOMElement*)child)) return true; child=child->getNextSibling(); } } matcher->endElement(elemDecl, XMLUni::fgZeroLenString); return false; } void DOMXPathExpressionImpl::release() { DOMXPathExpressionImpl* me = this; delete me; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMNamedNodeMapImpl.cpp000644 000765 000024 00000027403 13241160337 024172 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNamedNodeMapImpl.cpp 678381 2008-07-21 10:15:01Z borisk $ */ #include #include #include #include #include "DOMNodeVector.hpp" #include "DOMNamedNodeMapImpl.hpp" #include "DOMCasts.hpp" #include "DOMDocumentImpl.hpp" #include "DOMNodeImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN DOMNamedNodeMapImpl::DOMNamedNodeMapImpl(DOMNode *ownerNod) { fOwnerNode=ownerNod; memset(fBuckets,0,MAP_SIZE*sizeof(DOMNodeVector*)); } DOMNamedNodeMapImpl::~DOMNamedNodeMapImpl() { } bool DOMNamedNodeMapImpl::readOnly() { return castToNodeImpl(fOwnerNode)->isReadOnly(); } DOMNamedNodeMapImpl *DOMNamedNodeMapImpl::cloneMap(DOMNode *ownerNod) { DOMDocumentImpl *doc = (DOMDocumentImpl *)(castToNodeImpl(ownerNod)->getOwnerDocument()); DOMNamedNodeMapImpl *newmap = new (doc) DOMNamedNodeMapImpl(ownerNod); for(XMLSize_t index=0;indexsize(); newmap->fBuckets[index] = new (doc) DOMNodeVector(doc, size); for (XMLSize_t i = 0; i < size; ++i) { DOMNode *s = fBuckets[index]->elementAt(i); DOMNode *n = s->cloneNode(true); castToNodeImpl(n)->isSpecified(castToNodeImpl(s)->isSpecified()); castToNodeImpl(n)->fOwnerNode = ownerNod; castToNodeImpl(n)->isOwned(true); newmap->fBuckets[index]->addElement(n); } } return newmap; } XMLSize_t DOMNamedNodeMapImpl::getLength() const { XMLSize_t count=0; for(XMLSize_t index=0;indexsize()); return count; } DOMNode * DOMNamedNodeMapImpl::item(XMLSize_t index) const { XMLSize_t count=0; for(XMLSize_t i=0;isize(); if(index>=count && index<(count+thisBucket)) return fBuckets[i]->elementAt(index-count); count+=thisBucket; } return NULL; } DOMNode * DOMNamedNodeMapImpl::getNamedItem(const XMLCh *name) const { XMLSize_t hash=XMLString::hash(name,MAP_SIZE); if(fBuckets[hash]==0) return 0; XMLSize_t i = 0; XMLSize_t size = fBuckets[hash]->size(); for (i = 0; i < size; ++i) { DOMNode *n=fBuckets[hash]->elementAt(i); if(XMLString::equals(name,n->getNodeName())) return n; } return 0; } // // removeNamedItem() - Remove the named item, and return it. // The caller can release the // returned item if it's not used // we can't do it here because the caller would // never see the returned node. // DOMNode * DOMNamedNodeMapImpl::removeNamedItem(const XMLCh *name) { if (this->readOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNamedNodeMapMemoryManager); XMLSize_t hash=XMLString::hash(name,MAP_SIZE); if(fBuckets[hash]==0) throw DOMException(DOMException::NOT_FOUND_ERR, 0, GetDOMNamedNodeMapMemoryManager); DOMDocument *doc = fOwnerNode->getOwnerDocument(); XMLSize_t i = 0; XMLSize_t size = fBuckets[hash]->size(); for (i = 0; i < size; ++i) { DOMNode *n=fBuckets[hash]->elementAt(i); if(XMLString::equals(name,n->getNodeName())) { fBuckets[hash]->removeElementAt(i); castToNodeImpl(n)->fOwnerNode = doc; castToNodeImpl(n)->isOwned(false); return n; } } throw DOMException(DOMException::NOT_FOUND_ERR, 0, GetDOMNamedNodeMapMemoryManager); return 0; } // // setNamedItem() Put the item into the NamedNodeList by name. // If an item with the same name already was // in the list, replace it. Return the old // item, if there was one. // Caller is responsible for arranging for // deletion of the old item if its ref count is // zero. // DOMNode * DOMNamedNodeMapImpl::setNamedItem(DOMNode * arg) { DOMDocument *doc = fOwnerNode->getOwnerDocument(); DOMNodeImpl *argImpl = castToNodeImpl(arg); if(argImpl->getOwnerDocument() != doc) throw DOMException(DOMException::WRONG_DOCUMENT_ERR,0, GetDOMNamedNodeMapMemoryManager); if (this->readOnly()) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNamedNodeMapMemoryManager); if ((arg->getNodeType() == DOMNode::ATTRIBUTE_NODE) && argImpl->isOwned() && (argImpl->fOwnerNode != fOwnerNode)) throw DOMException(DOMException::INUSE_ATTRIBUTE_ERR,0, GetDOMNamedNodeMapMemoryManager); argImpl->fOwnerNode = fOwnerNode; argImpl->isOwned(true); const XMLCh* name=arg->getNodeName(); XMLSize_t hash=XMLString::hash(name,MAP_SIZE); if(fBuckets[hash]==0) fBuckets[hash] = new (doc) DOMNodeVector(doc, 3); XMLSize_t i = 0; XMLSize_t size = fBuckets[hash]->size(); for (i = 0; i < size; ++i) { DOMNode *n=fBuckets[hash]->elementAt(i); if(XMLString::equals(name,n->getNodeName())) { fBuckets[hash]->setElementAt(arg,i); castToNodeImpl(n)->fOwnerNode = doc; castToNodeImpl(n)->isOwned(false); return n; } } fBuckets[hash]->addElement(arg); return 0; } void DOMNamedNodeMapImpl::setReadOnly(bool readOnl, bool deep) { // this->fReadOnly=readOnl; if(deep) { for (XMLSize_t index = 0; index < MAP_SIZE; index++) { if(fBuckets[index]==0) continue; XMLSize_t sz = fBuckets[index]->size(); for (XMLSize_t i=0; ielementAt(i))->setReadOnly(readOnl, deep); } } } //Introduced in DOM Level 2 DOMNode *DOMNamedNodeMapImpl::getNamedItemNS(const XMLCh *namespaceURI, const XMLCh *localName) const { // the map is indexed using the full name of nodes; to search given a namespace and a local name // we have to do a linear search for (XMLSize_t index = 0; index < MAP_SIZE; index++) { if(fBuckets[index]==0) continue; XMLSize_t i = 0; XMLSize_t size = fBuckets[index]->size(); for (i = 0; i < size; ++i) { DOMNode *n=fBuckets[index]->elementAt(i); const XMLCh * nNamespaceURI = n->getNamespaceURI(); const XMLCh * nLocalName = n->getLocalName(); if (!XMLString::equals(nNamespaceURI, namespaceURI)) //URI not match continue; else { if (XMLString::equals(localName, nLocalName) || (nLocalName == 0 && XMLString::equals(localName, n->getNodeName()))) return n; } } } return 0; } // // setNamedItemNS() Put the item into the NamedNodeList by name. // If an item with the same name already was // in the list, replace it. Return the old // item, if there was one. // Caller is responsible for arranging for // deletion of the old item if its ref count is // zero. // DOMNode * DOMNamedNodeMapImpl::setNamedItemNS(DOMNode *arg) { DOMDocument *doc = fOwnerNode->getOwnerDocument(); DOMNodeImpl *argImpl = castToNodeImpl(arg); if (argImpl->getOwnerDocument() != doc) throw DOMException(DOMException::WRONG_DOCUMENT_ERR,0, GetDOMNamedNodeMapMemoryManager); if (this->readOnly()) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNamedNodeMapMemoryManager); if (argImpl->isOwned()) throw DOMException(DOMException::INUSE_ATTRIBUTE_ERR,0, GetDOMNamedNodeMapMemoryManager); argImpl->fOwnerNode = fOwnerNode; argImpl->isOwned(true); const XMLCh* namespaceURI=arg->getNamespaceURI(); const XMLCh* localName=arg->getLocalName(); // the map is indexed using the full name of nodes; to search given a namespace and a local name // we have to do a linear search for (XMLSize_t index = 0; index < MAP_SIZE; index++) { if(fBuckets[index]==0) continue; XMLSize_t i = 0; XMLSize_t size = fBuckets[index]->size(); for (i = 0; i < size; ++i) { DOMNode *n=fBuckets[index]->elementAt(i); const XMLCh * nNamespaceURI = n->getNamespaceURI(); const XMLCh * nLocalName = n->getLocalName(); if (!XMLString::equals(nNamespaceURI, namespaceURI)) //URI not match continue; else { if (XMLString::equals(localName, nLocalName) || (nLocalName == 0 && XMLString::equals(localName, n->getNodeName()))) { fBuckets[index]->setElementAt(arg,i); castToNodeImpl(n)->fOwnerNode = doc; castToNodeImpl(n)->isOwned(false); return n; } } } } // if not found, add it using the full name as key return setNamedItem(arg); } // removeNamedItemNS() - Remove the named item, and return it. // The caller can release the // returned item if it's not used // we can't do it here because the caller would // never see the returned node. DOMNode *DOMNamedNodeMapImpl::removeNamedItemNS(const XMLCh *namespaceURI, const XMLCh *localName) { if (this->readOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNamedNodeMapMemoryManager); // the map is indexed using the full name of nodes; to search given a namespace and a local name // we have to do a linear search for (XMLSize_t index = 0; index < MAP_SIZE; index++) { if(fBuckets[index]==0) continue; DOMDocument *doc = fOwnerNode->getOwnerDocument(); XMLSize_t i = 0; XMLSize_t size = fBuckets[index]->size(); for (i = 0; i < size; ++i) { DOMNode *n=fBuckets[index]->elementAt(i); const XMLCh * nNamespaceURI = n->getNamespaceURI(); const XMLCh * nLocalName = n->getLocalName(); if (!XMLString::equals(nNamespaceURI, namespaceURI)) //URI not match continue; else { if (XMLString::equals(localName, nLocalName) || (nLocalName == 0 && XMLString::equals(localName, n->getNodeName()))) { fBuckets[index]->removeElementAt(i); castToNodeImpl(n)->fOwnerNode = doc; castToNodeImpl(n)->isOwned(false); return n; } } } } throw DOMException(DOMException::NOT_FOUND_ERR, 0, GetDOMNamedNodeMapMemoryManager); return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMNodeIteratorImpl.hpp000644 000765 000024 00000010027 13241160337 024300 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNodeIteratorImpl.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMNODEITERATORIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMNODEITERATORIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // ////////////////////////////////////////////////////////////////////// // DOMNodeIteratorImpl.hpp: interface for the DOMNodeIteratorImpl class. // ////////////////////////////////////////////////////////////////////// #include #include XERCES_CPP_NAMESPACE_BEGIN class CDOM_EXPORT DOMNodeIteratorImpl : public DOMNodeIterator { protected: // // Data // // The root. DOMNode* fRoot; // The Document used to create this iterator DOMDocument* fDocument; // The whatToShow mask. DOMNodeFilter::ShowType fWhatToShow; // The NodeFilter reference. DOMNodeFilter* fNodeFilter; // The expandEntity reference flag. bool fExpandEntityReferences; bool fDetached; // // Iterator state - current node and direction. // // Note: The current node and direction are sufficient to implement // the desired behaviour of the current pointer being _between_ // two nodes. The fCurrentNode is actually the last node returned, // and the // direction is whether the pointer is in front or behind this node. // (usually akin to whether the node was returned via nextNode()) // (eg fForward = true) or previousNode() (eg fForward = false). // The last Node returned. DOMNode* fCurrentNode; // The direction of the iterator on the fCurrentNode. // // nextNode() == fForward = true;
// previousNode() == fForward = false;
//
bool fForward; public: virtual ~DOMNodeIteratorImpl (); DOMNodeIteratorImpl ( DOMDocument* fDocument, DOMNode* root, DOMNodeFilter::ShowType whatToShow, DOMNodeFilter* nodeFilter, bool expandEntityRef); DOMNodeIteratorImpl ( const DOMNodeIteratorImpl& toCopy); DOMNodeIteratorImpl& operator= (const DOMNodeIteratorImpl& other); virtual DOMNode* getRoot (); virtual DOMNodeFilter::ShowType getWhatToShow (); virtual DOMNodeFilter* getFilter (); // Get the expandEntity reference flag. virtual bool getExpandEntityReferences(); virtual DOMNode* nextNode (); virtual DOMNode* previousNode (); virtual void detach (); virtual void release(); void removeNode (DOMNode* node); protected: DOMNode* matchNodeOrParent (DOMNode* node); DOMNode* nextNode (DOMNode* node, bool visitChildren); DOMNode* previousNode (DOMNode* node); bool acceptNode (DOMNode* node); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMElementImpl.hpp000644 000765 000024 00000013615 13241160337 023300 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMElementImpl.hpp 1800911 2017-07-05 18:52:15Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMELEMENTIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMELEMENTIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include #include #include "DOMNodeBase.hpp" #include "DOMChildNode.hpp" #include "DOMNodeImpl.hpp" #include "DOMParentNode.hpp" #include "DOMAttrMapImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN class DOMTypeInfo; class DOMNodeList; class DOMAttrMapImpl; class DOMDocument; class CDOM_EXPORT DOMElementImpl: public DOMElement, public HasDOMNodeImpl, public HasDOMParentImpl, public HasDOMChildImpl { public: DOMNodeImpl fNode; DOMParentNode fParent; DOMChildNode fChild; DOMAttrMapImpl *fAttributes; DOMAttrMapImpl *fDefaultAttributes; const XMLCh *fName; public: DOMElementImpl(DOMDocument *ownerDoc, const XMLCh *name); DOMElementImpl(const DOMElementImpl &other, bool deep=false); virtual ~DOMElementImpl(); public: // Declare functions from DOMNode. They all must be implemented by this class DOMNODE_FUNCTIONS; // Add accessors for implementation bits. DOMNODEIMPL_DECL; DOMPARENTIMPL_DECL; DOMCHILDIMPL_DECL; public: // Functions introduced on Element... virtual const XMLCh* getAttribute(const XMLCh *name) const; virtual DOMAttr* getAttributeNode(const XMLCh *name) const; virtual DOMNodeList* getElementsByTagName(const XMLCh *tagname) const; virtual const XMLCh* getTagName() const; virtual void removeAttribute(const XMLCh *name); virtual DOMAttr* removeAttributeNode(DOMAttr * oldAttr); virtual void setAttribute(const XMLCh *name, const XMLCh *value); virtual DOMAttr* setAttributeNode(DOMAttr *newAttr); virtual void setReadOnly(bool readOnly, bool deep); //Introduced in DOM Level 2 virtual const XMLCh* getAttributeNS(const XMLCh *namespaceURI, const XMLCh *localName) const; virtual void setAttributeNS(const XMLCh *namespaceURI, const XMLCh *qualifiedName, const XMLCh *value); virtual void removeAttributeNS(const XMLCh *namespaceURI, const XMLCh *localName); virtual DOMAttr* getAttributeNodeNS(const XMLCh *namespaceURI, const XMLCh *localName) const; virtual DOMAttr* setAttributeNodeNS(DOMAttr *newAttr); virtual DOMNodeList* getElementsByTagNameNS(const XMLCh *namespaceURI, const XMLCh *localName) const; virtual bool hasAttribute(const XMLCh *name) const; virtual bool hasAttributeNS(const XMLCh *namespaceURI, const XMLCh *localName) const; //Introduced in DOM level 3 virtual void setIdAttribute(const XMLCh* name, bool isId); virtual void setIdAttributeNS(const XMLCh* namespaceURI, const XMLCh* localName, bool isId); virtual void setIdAttributeNode(const DOMAttr *idAttr, bool isId); virtual const DOMTypeInfo * getSchemaTypeInfo() const; // for handling of default attribute virtual DOMAttr* setDefaultAttributeNode(DOMAttr *newAttr); virtual DOMAttr* setDefaultAttributeNodeNS(DOMAttr *newAttr); virtual DOMAttrMapImpl* getDefaultAttributes() const; // helper function for DOM Level 3 renameNode virtual DOMNode* rename(const XMLCh* namespaceURI, const XMLCh* name); // DOMElementTraversal virtual DOMElement * getFirstElementChild() const; virtual DOMElement * getLastElementChild() const; virtual DOMElement * getPreviousElementSibling() const; virtual DOMElement * getNextElementSibling() const; virtual XMLSize_t getChildElementCount() const; protected: // default attribute helper functions virtual void setupDefaultAttributes(); // helper function for DOMElementTraversal methods DOMElement* getFirstElementChild(const DOMNode* n) const; DOMElement* getLastElementChild(const DOMNode* n) const; DOMNode* getNextLogicalSibling(const DOMNode* n) const; DOMNode* getPreviousLogicalSibling(const DOMNode* n) const; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMElementImpl & operator = (const DOMElementImpl &); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMTreeWalkerImpl.hpp000644 000765 000024 00000012612 13241160337 023750 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMTreeWalkerImpl.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMTREEWALKERIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMTREEWALKERIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include XERCES_CPP_NAMESPACE_BEGIN class CDOM_EXPORT DOMTreeWalkerImpl : public DOMTreeWalker { protected: // The whatToShow mask. DOMNodeFilter::ShowType fWhatToShow; // The NodeFilter reference. DOMNodeFilter* fNodeFilter; // The current Node. DOMNode* fCurrentNode; // The root Node. DOMNode* fRoot; // The expandEntity reference flag. bool fExpandEntityReferences; public: // Implementation Note: No state is kept except the data above // (fWhatToShow, fNodeFilter, fCurrentNode, fRoot) such that // setters could be created for these data values and the // implementation will still work. /** Public constructor */ DOMTreeWalkerImpl ( DOMNode* root, DOMNodeFilter::ShowType whatToShow, DOMNodeFilter* nodeFilter, bool expandEntityRef); DOMTreeWalkerImpl (const DOMTreeWalkerImpl& twi); DOMTreeWalkerImpl& operator= (const DOMTreeWalkerImpl& twi); // Return the root node. virtual DOMNode* getRoot (); // Return the whatToShow value. virtual DOMNodeFilter::ShowType getWhatToShow (); // Return the NodeFilter. virtual DOMNodeFilter* getFilter (); // Return the current DOMNode. virtual DOMNode* getCurrentNode (); // Return the current Node. virtual void setCurrentNode (DOMNode* node); // Return the parent Node from the current node, // after applying filter, whatToshow. // If result is not null, set the current Node. virtual DOMNode* parentNode (); // Return the first child Node from the current node, // after applying filter, whatToshow. // If result is not null, set the current Node. virtual DOMNode* firstChild (); // Return the last child Node from the current node, // after applying filter, whatToshow. // If result is not null, set the current Node. virtual DOMNode* lastChild (); // Return the previous sibling Node from the current node, // after applying filter, whatToshow. // If result is not null, set the current Node. virtual DOMNode* previousSibling (); // Return the next sibling Node from the current node, // after applying filter, whatToshow. // If result is not null, set the current Node. virtual DOMNode* nextSibling (); // Return the previous Node from the current node, // after applying filter, whatToshow. // If result is not null, set the current Node. virtual DOMNode* previousNode (); // Return the next Node from the current node, // after applying filter, whatToshow. // If result is not null, set the current Node. virtual DOMNode* nextNode (); // Get the expandEntity reference flag. virtual bool getExpandEntityReferences(); // release the resource virtual void release(); protected: // Internal function. // Return the parent Node, from the input node // after applying filter, whatToshow. // The current node is not consulted or set. DOMNode* getParentNode (DOMNode* node); // Internal function. // Return the nextSibling Node, from the input node // after applying filter, whatToshow. // The current node is not consulted or set. DOMNode* getNextSibling (DOMNode* node); // Internal function. // Return the previous sibling Node, from the input node // after applying filter, whatToshow. // The current node is not consulted or set. DOMNode* getPreviousSibling (DOMNode* node); // Internal function. // Return the first child Node, from the input node // after applying filter, whatToshow. // The current node is not consulted or set. DOMNode* getFirstChild (DOMNode* node); // Internal function. // Return the last child Node, from the input node // after applying filter, whatToshow. // The current node is not consulted or set. DOMNode* getLastChild (DOMNode* node); // The node is accepted if it passes the whatToShow and the filter. short acceptNode (DOMNode* node); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMElementNSImpl.cpp000644 000765 000024 00000020532 13241160337 023530 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMElementNSImpl.cpp 678709 2008-07-22 10:56:56Z borisk $ */ #include #include "DOMElementNSImpl.hpp" #include "DOMDocumentImpl.hpp" #include "DOMTypeInfoImpl.hpp" #include "DOMCasts.hpp" #include #include #include XERCES_CPP_NAMESPACE_BEGIN DOMElementNSImpl::DOMElementNSImpl(DOMDocument *ownerDoc, const XMLCh *nam) : DOMElementImpl(ownerDoc, nam) { this->fNamespaceURI=0; //DOM Level 2 this->fLocalName=0; //DOM Level 2 this->fPrefix=0; this->fSchemaType = 0; } //Introduced in DOM Level 2 DOMElementNSImpl::DOMElementNSImpl(DOMDocument *ownerDoc, const XMLCh *namespaceURI, const XMLCh *qualifiedName) : DOMElementImpl(ownerDoc, qualifiedName) { setName(namespaceURI, qualifiedName); this->fSchemaType = 0; } DOMElementNSImpl::DOMElementNSImpl(DOMDocument *ownerDoc, const XMLCh *namespaceURI, const XMLCh *prefix, const XMLCh *localName, const XMLCh *qualifiedName) : DOMElementImpl(ownerDoc, qualifiedName) { this->fSchemaType = 0; DOMDocumentImpl* docImpl = (DOMDocumentImpl*)fParent.fOwnerDocument; if (prefix == 0 || *prefix == 0) { fPrefix = 0; fLocalName = fName; } else { fPrefix = docImpl->getPooledString(prefix); fLocalName = docImpl->getPooledString(localName); } // DOM Level 3: namespace URI is never empty string. // const XMLCh * URI = DOMNodeImpl::mapPrefix ( fPrefix, (!namespaceURI || !*namespaceURI) ? 0 : namespaceURI, DOMNode::ELEMENT_NODE); fNamespaceURI = (URI == 0) ? 0 : docImpl->getPooledString(URI); } DOMElementNSImpl::DOMElementNSImpl(const DOMElementNSImpl &other, bool deep) : DOMElementImpl(other, deep) { this->fNamespaceURI = other.fNamespaceURI; //DOM Level 2 this->fLocalName = other.fLocalName; //DOM Level 2 this->fPrefix = other.fPrefix; this->fSchemaType = other.fSchemaType; } DOMNode * DOMElementNSImpl::cloneNode(bool deep) const { DOMNode* newNode = new (fParent.fOwnerDocument, DOMMemoryManager::ELEMENT_NS_OBJECT) DOMElementNSImpl(*this, deep); fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode); return newNode; } const XMLCh * DOMElementNSImpl::getNamespaceURI() const { return fNamespaceURI; } const XMLCh * DOMElementNSImpl::getPrefix() const { return fPrefix; } const XMLCh * DOMElementNSImpl::getLocalName() const { return fLocalName; } void DOMElementNSImpl::setPrefix(const XMLCh *prefix) { if (fNode.isReadOnly()) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); if (fNamespaceURI == 0 || fNamespaceURI[0] == chNull) throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager); if (prefix == 0 || *prefix == 0) { fPrefix = 0; fName = fLocalName; return; } DOMDocumentImpl* doc = (DOMDocumentImpl*) fParent.fOwnerDocument; if(!doc->isXMLName(prefix)) throw DOMException(DOMException::INVALID_CHARACTER_ERR,0, GetDOMNodeMemoryManager); const XMLCh * xml = DOMNodeImpl::getXmlString(); const XMLCh * xmlURI = DOMNodeImpl::getXmlURIString(); if (XMLString::equals(prefix, xml) && !XMLString::equals(fNamespaceURI, xmlURI)) throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager); if (XMLString::indexOf(prefix, chColon) != -1) { throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager); } this-> fPrefix = doc->getPooledString(prefix); XMLSize_t prefixLen = XMLString::stringLen(prefix); XMLSize_t newQualifiedNameLen = prefixLen+1+XMLString::stringLen(fLocalName); XMLCh *newName; XMLCh temp[256]; if (newQualifiedNameLen >= 255) newName = (XMLCh*) doc->getMemoryManager()->allocate ( newQualifiedNameLen * sizeof(XMLCh) );//new XMLCh[newQualifiedNameLen]; else newName = temp; // newName = prefix + chColon + fLocalName; XMLString::copyString(newName, prefix); newName[prefixLen] = chColon; XMLString::copyString(&newName[prefixLen+1], fLocalName); fName = doc->getPooledString(newName); if (newQualifiedNameLen >= 255) doc->getMemoryManager()->deallocate(newName);//delete[] newName; } void DOMElementNSImpl::release() { if (fNode.isOwned() && !fNode.isToBeReleased()) throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); DOMDocumentImpl* doc = (DOMDocumentImpl*) fParent.fOwnerDocument; if (doc) { fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0); fParent.release(); doc->release(this, DOMMemoryManager::ELEMENT_NS_OBJECT); } else { // shouldn't reach here throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); } } DOMNode* DOMElementNSImpl::rename(const XMLCh* namespaceURI, const XMLCh* name) { setName(namespaceURI, name); fAttributes->reconcileDefaultAttributes(getDefaultAttributes()); // and fire user data NODE_RENAMED event castToNodeImpl(this)->callUserDataHandlers(DOMUserDataHandler::NODE_RENAMED, this, this); return this; } void DOMElementNSImpl::setName(const XMLCh *namespaceURI, const XMLCh *qualifiedName) { DOMDocumentImpl* ownerDoc = (DOMDocumentImpl *) fParent.fOwnerDocument; this->fName = ownerDoc->getPooledString(qualifiedName); int index = DOMDocumentImpl::indexofQualifiedName(qualifiedName); if (index < 0) throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager); if (index == 0) { //qualifiedName contains no ':' // fPrefix = 0; fLocalName = fName; } else { //0 < index < this->name.length()-1 // fPrefix = ownerDoc->getPooledNString(qualifiedName, index); fLocalName = ownerDoc->getPooledString(fName+index+1); // Before we carry on, we should check if the prefix or localName are valid XMLName if (!ownerDoc->isXMLName(fPrefix) || !ownerDoc->isXMLName(fLocalName)) throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager); } // DOM Level 3: namespace URI is never empty string. // const XMLCh * URI = DOMNodeImpl::mapPrefix ( fPrefix, (!namespaceURI || !*namespaceURI) ? 0 : namespaceURI, DOMNode::ELEMENT_NODE); fNamespaceURI = (URI == 0) ? 0 : ownerDoc->getPooledString(URI); } const DOMTypeInfo *DOMElementNSImpl::getSchemaTypeInfo() const { if(!fSchemaType) return &DOMTypeInfoImpl::g_DtdValidatedElement; return fSchemaType; } void DOMElementNSImpl::setSchemaTypeInfo(const DOMTypeInfoImpl* typeInfo) { fSchemaType = typeInfo; } bool DOMElementNSImpl::isSupported(const XMLCh *feature, const XMLCh *version) const { // check for '+DOMPSVITypeInfo' if(feature && *feature=='+' && XMLString::equals(feature+1, XMLUni::fgXercescInterfacePSVITypeInfo)) return true; return fNode.isSupported (feature, version); } void* DOMElementNSImpl::getFeature(const XMLCh* feature, const XMLCh* version) const { if(XMLString::equals(feature, XMLUni::fgXercescInterfacePSVITypeInfo)) return (DOMPSVITypeInfo*)fSchemaType; return DOMElementImpl::getFeature(feature, version); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMCharacterDataImpl.hpp000644 000765 000024 00000006676 13241160337 024406 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMCharacterDataImpl.hpp 1528170 2013-10-01 18:23:57Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMCHARACTERDATAIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMCHARACTERDATAIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMNode; class DOMDocument; class DOMDocumentImpl; class DOMBuffer; // Instances of DOMCharacterDataImpl appear as members of node types // that implement the DOMCharacterData interfaces. // Operations in those classes are delegated to this class. // class CDOM_EXPORT DOMCharacterDataImpl { public: DOMBuffer* fDataBuf; // for the buffer bid DOMDocumentImpl* fDoc; public: DOMCharacterDataImpl(DOMDocument *doc, const XMLCh *dat); DOMCharacterDataImpl(DOMDocument *doc, const XMLCh* data, XMLSize_t n); DOMCharacterDataImpl(const DOMCharacterDataImpl &other); ~DOMCharacterDataImpl(); const XMLCh * getNodeValue() const; void setNodeValue(const XMLCh * value); void appendData(const DOMNode *node, const XMLCh *data); void appendData(const DOMNode *node, const XMLCh *data, XMLSize_t n); void appendDataFast(const DOMNode *node, const XMLCh *data, XMLSize_t n); void deleteData(const DOMNode *node, XMLSize_t offset, XMLSize_t count); const XMLCh* getData() const; XMLSize_t getLength() const; void insertData(const DOMNode *node, XMLSize_t offset, const XMLCh * data); void replaceData(const DOMNode *node, XMLSize_t offset, XMLSize_t count, const XMLCh * data); void setData(const DOMNode *node, const XMLCh * arg); void setNodeValue(const DOMNode *node, const XMLCh *value); const XMLCh* substringData(const DOMNode *node, XMLSize_t offset, XMLSize_t count) const; void releaseBuffer(); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMCharacterDataImpl & operator = (const DOMCharacterDataImpl &); }; #define GetDOMCharacterDataImplMemoryManager GET_DIRECT_MM(fDoc) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMDocumentFragmentImpl.hpp000644 000765 000024 00000004655 13241160337 025155 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMDocumentFragmentImpl.hpp 1800911 2017-07-05 18:52:15Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTFRAGMENTIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMDOCUMENTFRAGMENTIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include #include "DOMNodeBase.hpp" #include "DOMParentNode.hpp" #include "DOMNodeImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN class CDOM_EXPORT DOMDocumentFragmentImpl: public DOMDocumentFragment, public HasDOMNodeImpl, public HasDOMParentImpl { protected: DOMNodeImpl fNode; DOMParentNode fParent; protected: DOMDocumentFragmentImpl(DOMDocument *); DOMDocumentFragmentImpl(const DOMDocumentFragmentImpl &other, bool deep); friend class DOMDocumentImpl; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMDocumentFragmentImpl & operator = (const DOMDocumentFragmentImpl &); public: virtual ~DOMDocumentFragmentImpl(); public: // Declare all of the functions from DOMNode. DOMNODE_FUNCTIONS; // Add accessors for implementation bits. DOMNODEIMPL_DECL; DOMPARENTIMPL_DECL; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMImplementationListImpl.cpp000644 000765 000024 00000003137 13241160337 025521 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMImplementationListImpl.cpp 671894 2008-06-26 13:29:21Z borisk $ */ #include "DOMImplementationListImpl.hpp" #include XERCES_CPP_NAMESPACE_BEGIN DOMImplementationListImpl::DOMImplementationListImpl() { fList=new RefVectorOf(3, false); } DOMImplementationListImpl:: ~DOMImplementationListImpl() { delete fList; } void DOMImplementationListImpl::add(DOMImplementation* impl) { fList->addElement(impl); } XMLSize_t DOMImplementationListImpl::getLength() const{ return fList->size(); } DOMImplementation *DOMImplementationListImpl::item(XMLSize_t index) const { if(indexsize()) return fList->elementAt(index); return 0; } void DOMImplementationListImpl::release() { delete this; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMNodeVector.cpp000644 000765 000024 00000006246 13241160337 023132 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNodeVector.cpp 678709 2008-07-22 10:56:56Z borisk $ */ // // file: DOMNodeVector.cpp // Implementation of class DOMNodeVector. // (Use of STL vector, or equivalent, would have been nice, // but is not available. 'DOMNode *' is the only type // kept in Vectors in this DOM implementation, so this is // a hardwired implementation for that type. // #include "DOMNodeVector.hpp" #include "DOMDocumentImpl.hpp" #include XERCES_CPP_NAMESPACE_BEGIN DOMNodeVector::DOMNodeVector(DOMDocument *doc) { init(doc, 10); } DOMNodeVector::DOMNodeVector(DOMDocument *doc, XMLSize_t size) { init(doc, size); } void DOMNodeVector::init(DOMDocument *doc, XMLSize_t size) { assert(size > 0); data = (DOMNode**) ((DOMDocumentImpl *)doc)->allocate(sizeof(DOMNode*) * size); assert(data != 0); for (XMLSize_t i=0; igetOwnerDocument(); //DOMNode **newData = new (doc) DOMNode *[newAllocatedSize]; DOMNode **newData = (DOMNode**) ((DOMDocumentImpl *)doc)->allocate(sizeof(DOMNode*) * newAllocatedSize); assert(newData != 0); for (XMLSize_t i=0; iindex; --i) { data[i] = data[i-1]; } data[index] = elem; ++nextFreeSlot; } void DOMNodeVector::removeElementAt(XMLSize_t index) { assert(index < nextFreeSlot); for (XMLSize_t i=index; i for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include XERCES_CPP_NAMESPACE_BEGIN #include "DOMNodeBase.hpp" #include "DOMNodeImpl.hpp" class DOMDocument; class CDOM_EXPORT DOMNotationImpl: public DOMNotation, public HasDOMNodeImpl { public: DOMNodeImpl fNode; const XMLCh * fName; const XMLCh * fPublicId; const XMLCh * fSystemId; const XMLCh * fBaseURI; public: DOMNotationImpl(DOMDocument *ownerDoc, const XMLCh *); DOMNotationImpl(const DOMNotationImpl &other, bool deep=false); virtual ~DOMNotationImpl(); public: // Declare all of the functions from DOMNode. DOMNODE_FUNCTIONS; // Add accessors for implementation bits. DOMNODEIMPL_DECL; public: // // The Public Identifier for this Notation. If no public identifier // was specified, this will be null. virtual const XMLCh * getPublicId() const; // The System Identifier for this Notation. If no system identifier // was specified, this will be null. virtual const XMLCh * getSystemId() const; // NON-DOM: The Public Identifier for this Notation. If no public // identifier was specified, this will be null. virtual void setPublicId(const XMLCh *arg); // NON-DOM: The System Identifier for this Notation. If no system // identifier was specified, this will be null. virtual void setSystemId(const XMLCh *arg); // NON-DOM: set base uri virtual void setBaseURI(const XMLCh *arg); private: // unimplemented DOMNotationImpl& operator= (const DOMNotationImpl& other); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMXPathNSResolverImpl.cpp000644 000765 000024 00000006337 13241160337 024714 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "DOMXPathNSResolverImpl.hpp" #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN DOMXPathNSResolverImpl::DOMXPathNSResolverImpl(const DOMNode *nodeResolver, MemoryManager* const manager) : fNamespaceBindings(0), fResolverNode(nodeResolver), fManager(manager) { fNamespaceBindings = new (fManager) RefHashTableOf(7, true, fManager); } DOMXPathNSResolverImpl::~DOMXPathNSResolverImpl() { delete fNamespaceBindings; } const XMLCh* DOMXPathNSResolverImpl::lookupNamespaceURI(const XMLCh* prefix) const { if(prefix == 0) prefix = XMLUni::fgZeroLenString; if(XMLString::equals(prefix, XMLUni::fgXMLString)) return XMLUni::fgXMLURIName; const KVStringPair *pair = fNamespaceBindings->get((void*)prefix); if(pair) { // An empty namespace URI indicated that this binding was removed // by the user. // if(*pair->getValue() == 0) return NULL; return pair->getValue(); } if(fResolverNode) return fResolverNode->lookupNamespaceURI( *prefix == 0 ? 0 : prefix); // Expects 0 for default namespace. return NULL; } const XMLCh* DOMXPathNSResolverImpl::lookupPrefix(const XMLCh* uri) const { if (uri == 0 || *uri == 0) return 0; if(XMLString::equals(uri, XMLUni::fgXMLURIName)) return XMLUni::fgXMLString; RefHashTableOfEnumerator enumerator((RefHashTableOf*)fNamespaceBindings); while(enumerator.hasMoreElements()) { KVStringPair &pair = enumerator.nextElement(); if(XMLString::equals(pair.getValue(), uri)) { return pair.getKey(); } } if(fResolverNode) { const XMLCh* r = fResolverNode->lookupPrefix(uri); if (r == 0 && fResolverNode->isDefaultNamespace(uri)) r = XMLUni::fgZeroLenString; return r; } return 0; } void DOMXPathNSResolverImpl::addNamespaceBinding(const XMLCh* prefix, const XMLCh* uri) { if(prefix == 0) prefix = XMLUni::fgZeroLenString; if(uri == 0) uri = XMLUni::fgZeroLenString; KVStringPair* pair = new (fManager) KVStringPair(prefix, uri, fManager); fNamespaceBindings->put((void*)pair->getKey(), pair); } void DOMXPathNSResolverImpl::release() { DOMXPathNSResolverImpl* me=(DOMXPathNSResolverImpl*)this; delete me; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMStringListImpl.hpp000644 000765 000024 00000003514 13241160337 024006 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMStringListImpl.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMSTRINGLISTIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMSTRINGLISTIMPL_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class CDOM_EXPORT DOMStringListImpl: public XMemory, public DOMStringList { protected: RefVectorOf *fList; private: // Unused, and unimplemented constructors, operators, etc. DOMStringListImpl(const DOMStringListImpl & other); DOMStringListImpl & operator = (const DOMStringListImpl & other); public: DOMStringListImpl(int nInitialSize, MemoryManager* manager); void add(const XMLCh* impl); virtual ~DOMStringListImpl(); virtual const XMLCh* item(XMLSize_t index) const; virtual XMLSize_t getLength() const; virtual bool contains(const XMLCh* str) const; virtual void release(); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMCDATASectionImpl.cpp000644 000765 000024 00000037107 13241160337 024045 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMCDATASectionImpl.cpp 1800911 2017-07-05 18:52:15Z scantor $ */ #include "DOMCDATASectionImpl.hpp" #include "DOMNodeImpl.hpp" #include "DOMRangeImpl.hpp" #include "DOMDocumentImpl.hpp" #include "DOMCasts.hpp" #include "DOMStringPool.hpp" #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN DOMCDATASectionImpl::DOMCDATASectionImpl(DOMDocument *ownerDoc, const XMLCh *dat) : fNode(this, ownerDoc), fCharacterData(ownerDoc, dat) { fNode.setIsLeafNode(true); } DOMCDATASectionImpl::DOMCDATASectionImpl(DOMDocument *ownerDoc, const XMLCh* data, XMLSize_t n) : fNode(this, ownerDoc), fCharacterData(ownerDoc, data, n) { fNode.setIsLeafNode(true); } DOMCDATASectionImpl::DOMCDATASectionImpl(const DOMCDATASectionImpl &other, bool /*deep*/) : DOMCDATASection(other), fNode(this, other.fNode), fChild(other.fChild), fCharacterData(other.fCharacterData) { // revisit. Something nees to make "deep" work. } DOMCDATASectionImpl::~DOMCDATASectionImpl() { } DOMNode *DOMCDATASectionImpl::cloneNode(bool deep) const { DOMNode* newNode = new (this->getOwnerDocument(), DOMMemoryManager::CDATA_SECTION_OBJECT) DOMCDATASectionImpl(*this, deep); fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode); return newNode; } const XMLCh * DOMCDATASectionImpl::getNodeName() const { static const XMLCh gcdata_section[] = {chPound, chLatin_c, chLatin_d, chLatin_a, chLatin_t, chLatin_a, chDash, chLatin_s, chLatin_e, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, 0}; return gcdata_section; } DOMNode::NodeType DOMCDATASectionImpl::getNodeType() const { return DOMNode::CDATA_SECTION_NODE; } bool DOMCDATASectionImpl::isIgnorableWhitespace() const { return fNode.ignorableWhitespace(); } // // splitText. revist - factor into a common function for use // here and in DOMTextImpl // DOMText *DOMCDATASectionImpl::splitText(XMLSize_t offset) { if (fNode.isReadOnly()) { throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); } XMLSize_t len = fCharacterData.fDataBuf->getLen(); if (offset > len) throw DOMException(DOMException::INDEX_SIZE_ERR, 0, GetDOMNodeMemoryManager); DOMDocumentImpl *doc = (DOMDocumentImpl *)getOwnerDocument(); DOMText *newText = doc->createCDATASection(this->substringData(offset, len - offset)); DOMNode *parent = getParentNode(); if (parent != 0) parent->insertBefore(newText, getNextSibling()); fCharacterData.fDataBuf->chop(offset); if (doc != 0) { Ranges* ranges = doc->getRanges(); if (ranges != 0) { XMLSize_t sz = ranges->size(); if (sz != 0) { for (XMLSize_t i =0; ielementAt(i)->updateSplitInfo( this, newText, offset); } } } } return newText; } bool DOMCDATASectionImpl::getIsElementContentWhitespace() const { return isIgnorableWhitespace(); } const XMLCh* DOMCDATASectionImpl::getWholeText() const { DOMDocument *doc = getOwnerDocument(); if (!doc) { throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, GetDOMNodeMemoryManager); return 0; } DOMNode* root=doc->getDocumentElement(); DOMTreeWalker* pWalker=doc->createTreeWalker(root!=NULL?root:(DOMNode*)this, DOMNodeFilter::SHOW_ALL, NULL, true); pWalker->setCurrentNode((DOMNode*)this); // Logically-adjacent text nodes are Text or CDATASection nodes that can be visited sequentially in document order or in // reversed document order without entering, exiting, or passing over Element, Comment, or ProcessingInstruction nodes. DOMNode* prevNode; while((prevNode=pWalker->previousNode())!=NULL) { if(prevNode->getNodeType()==ELEMENT_NODE || prevNode->getNodeType()==COMMENT_NODE || prevNode->getNodeType()==PROCESSING_INSTRUCTION_NODE) break; } XMLBuffer buff(1023, GetDOMNodeMemoryManager); DOMNode* nextNode; while((nextNode=pWalker->nextNode())!=NULL) { if(nextNode->getNodeType()==ELEMENT_NODE || nextNode->getNodeType()==COMMENT_NODE || nextNode->getNodeType()==PROCESSING_INSTRUCTION_NODE) break; if(nextNode->getNodeType()==TEXT_NODE || nextNode->getNodeType()==CDATA_SECTION_NODE) buff.append(nextNode->getNodeValue()); } pWalker->release(); XMLCh* wholeString = (XMLCh*)((DOMDocumentImpl*)doc)->allocate((buff.getLen()+1) * sizeof(XMLCh)); XMLString::copyString(wholeString, buff.getRawBuffer()); return wholeString; } DOMText* DOMCDATASectionImpl::replaceWholeText(const XMLCh* newText) { DOMDocument *doc = getOwnerDocument(); DOMTreeWalker* pWalker=doc->createTreeWalker(doc->getDocumentElement(), DOMNodeFilter::SHOW_ALL, NULL, true); pWalker->setCurrentNode((DOMNode*)this); // Logically-adjacent text nodes are Text or CDATASection nodes that can be visited sequentially in document order or in // reversed document order without entering, exiting, or passing over Element, Comment, or ProcessingInstruction nodes. DOMNode* pFirstTextNode=this; DOMNode* prevNode; while((prevNode=pWalker->previousNode())!=NULL) { if(prevNode->getNodeType()==ELEMENT_NODE || prevNode->getNodeType()==COMMENT_NODE || prevNode->getNodeType()==PROCESSING_INSTRUCTION_NODE) break; pFirstTextNode=prevNode; } // before doing any change we need to check if we are going to remove an entity reference that doesn't contain just text DOMNode* pCurrentNode=pWalker->getCurrentNode(); DOMNode* nextNode; while((nextNode=pWalker->nextNode())!=NULL) { if(nextNode->getNodeType()==ELEMENT_NODE || nextNode->getNodeType()==COMMENT_NODE || nextNode->getNodeType()==PROCESSING_INSTRUCTION_NODE) break; if(nextNode->getNodeType()==ENTITY_REFERENCE_NODE) { DOMTreeWalker* pInnerWalker=doc->createTreeWalker(nextNode, DOMNodeFilter::SHOW_ALL, NULL, true); while(pInnerWalker->nextNode()) { short nodeType=pInnerWalker->getCurrentNode()->getNodeType(); if(nodeType!=ENTITY_REFERENCE_NODE && nodeType!=TEXT_NODE && nodeType!=CDATA_SECTION_NODE) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); } pInnerWalker->release(); } } DOMText* retVal=NULL; // if the first node in the chain is a text node, replace its content, otherwise create a new node if(newText && *newText) { if(!castToNodeImpl(pFirstTextNode)->isReadOnly() && (pFirstTextNode->getNodeType()==TEXT_NODE || pFirstTextNode->getNodeType()==CDATA_SECTION_NODE)) { pFirstTextNode->setNodeValue(newText); retVal=(DOMText*)pFirstTextNode; } else { if(getNodeType()==TEXT_NODE) retVal=doc->createTextNode(newText); else retVal=doc->createCDATASection(newText); pFirstTextNode->getParentNode()->insertBefore(retVal, pFirstTextNode); } } // now delete all the following text nodes pWalker->setCurrentNode(pCurrentNode); while((nextNode=pWalker->nextNode())!=NULL) { if(nextNode->getNodeType()==ELEMENT_NODE || nextNode->getNodeType()==COMMENT_NODE || nextNode->getNodeType()==PROCESSING_INSTRUCTION_NODE) break; if(nextNode!=retVal) { // keep the tree walker valid pWalker->previousNode(); nextNode->getParentNode()->removeChild(nextNode); nextNode->release(); } } pWalker->release(); return retVal; } void DOMCDATASectionImpl::release() { if (fNode.isOwned() && !fNode.isToBeReleased()) throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument(); if (doc) { fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0); fCharacterData.releaseBuffer(); doc->release(this, DOMMemoryManager::CDATA_SECTION_OBJECT); } else { // shouldn't reach here throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); } } // // Delegation stubs for other DOM_Node inherited functions. // DOMNode* DOMCDATASectionImpl::appendChild(DOMNode *newChild) {return fNode.appendChild (newChild); } DOMNamedNodeMap* DOMCDATASectionImpl::getAttributes() const {return fNode.getAttributes (); } DOMNodeList* DOMCDATASectionImpl::getChildNodes() const {return fNode.getChildNodes (); } DOMNode* DOMCDATASectionImpl::getFirstChild() const {return fNode.getFirstChild (); } DOMNode* DOMCDATASectionImpl::getLastChild() const {return fNode.getLastChild (); } const XMLCh* DOMCDATASectionImpl::getLocalName() const {return fNode.getLocalName (); } const XMLCh* DOMCDATASectionImpl::getNamespaceURI() const {return fNode.getNamespaceURI (); } DOMNode* DOMCDATASectionImpl::getNextSibling() const {return fChild.getNextSibling (); } const XMLCh* DOMCDATASectionImpl::getNodeValue() const {return fCharacterData.getNodeValue (); } DOMDocument* DOMCDATASectionImpl::getOwnerDocument() const {return fNode.getOwnerDocument(); } const XMLCh* DOMCDATASectionImpl::getPrefix() const {return fNode.getPrefix (); } DOMNode* DOMCDATASectionImpl::getParentNode() const {return fChild.getParentNode (this); } DOMNode* DOMCDATASectionImpl::getPreviousSibling() const {return fChild.getPreviousSibling (this); } bool DOMCDATASectionImpl::hasChildNodes() const {return fNode.hasChildNodes (); } DOMNode* DOMCDATASectionImpl::insertBefore(DOMNode *newChild, DOMNode *refChild) {return fNode.insertBefore (newChild, refChild); } void DOMCDATASectionImpl::normalize() {fNode.normalize (); } DOMNode* DOMCDATASectionImpl::removeChild(DOMNode *oldChild) {return fNode.removeChild (oldChild); } DOMNode* DOMCDATASectionImpl::replaceChild(DOMNode *newChild, DOMNode *oldChild) {return fNode.replaceChild (newChild, oldChild); } bool DOMCDATASectionImpl::isSupported(const XMLCh *feature, const XMLCh *version) const {return fNode.isSupported (feature, version); } void DOMCDATASectionImpl::setPrefix(const XMLCh *prefix) {fNode.setPrefix(prefix); } bool DOMCDATASectionImpl::hasAttributes() const {return fNode.hasAttributes(); } bool DOMCDATASectionImpl::isSameNode(const DOMNode* other) const {return fNode.isSameNode(other); } bool DOMCDATASectionImpl::isEqualNode(const DOMNode* arg) const {return fNode.isEqualNode(arg); } void* DOMCDATASectionImpl::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) {return fNode.setUserData(key, data, handler); } void* DOMCDATASectionImpl::getUserData(const XMLCh* key) const {return fNode.getUserData(key); } const XMLCh* DOMCDATASectionImpl::getBaseURI() const {return fNode.getBaseURI(); } short DOMCDATASectionImpl::compareDocumentPosition(const DOMNode* other) const {return fNode.compareDocumentPosition(other); } const XMLCh* DOMCDATASectionImpl::getTextContent() const {return fNode.getTextContent(); } void DOMCDATASectionImpl::setTextContent(const XMLCh* textContent){fNode.setTextContent(textContent); } const XMLCh* DOMCDATASectionImpl::lookupPrefix(const XMLCh* namespaceURI) const {return fNode.lookupPrefix(namespaceURI); } bool DOMCDATASectionImpl::isDefaultNamespace(const XMLCh* namespaceURI) const {return fNode.isDefaultNamespace(namespaceURI); } const XMLCh* DOMCDATASectionImpl::lookupNamespaceURI(const XMLCh* prefix) const {return fNode.lookupNamespaceURI(prefix); } void* DOMCDATASectionImpl::getFeature(const XMLCh* feature, const XMLCh* version) const {return fNode.getFeature(feature, version); } // // Delegation of CharacerData functions. // const XMLCh* DOMCDATASectionImpl::getData() const {return fCharacterData.getData();} XMLSize_t DOMCDATASectionImpl::getLength() const {return fCharacterData.getLength();} const XMLCh* DOMCDATASectionImpl::substringData(XMLSize_t offset, XMLSize_t count) const {return fCharacterData.substringData(this, offset, count);} void DOMCDATASectionImpl::appendData(const XMLCh *arg) {fCharacterData.appendData(this, arg);} void DOMCDATASectionImpl::insertData(XMLSize_t offset, const XMLCh *arg) {fCharacterData.insertData(this, offset, arg);} void DOMCDATASectionImpl::deleteData(XMLSize_t offset, XMLSize_t count) {fCharacterData.deleteData(this, offset, count);} void DOMCDATASectionImpl::replaceData(XMLSize_t offset, XMLSize_t count, const XMLCh *arg) {fCharacterData.replaceData(this, offset, count, arg);} void DOMCDATASectionImpl::setData(const XMLCh *data) {fCharacterData.setData(this, data);} void DOMCDATASectionImpl::setNodeValue(const XMLCh *nodeValue) {fCharacterData.setNodeValue (this, nodeValue); } // Macro-in implementation accessors. DOMNODEIMPL_IMPL(DOMCDATASectionImpl); DOMCHILDIMPL_IMPL(DOMCDATASectionImpl); XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMAttrMapImpl.cpp000644 000765 000024 00000034710 13241160337 023251 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMAttrMapImpl.cpp 678709 2008-07-22 10:56:56Z borisk $ */ #include "DOMCasts.hpp" #include "DOMNodeImpl.hpp" #include "DOMNodeVector.hpp" #include "DOMAttrMapImpl.hpp" #include "DOMAttrImpl.hpp" #include "DOMElementImpl.hpp" #include #include XERCES_CPP_NAMESPACE_BEGIN DOMAttrMapImpl::DOMAttrMapImpl(DOMNode *ownerNod) { this->fOwnerNode=ownerNod; this->fNodes = 0; hasDefaults(false); } DOMAttrMapImpl::DOMAttrMapImpl(DOMNode *ownerNod, const DOMAttrMapImpl *defaults) { this->fOwnerNode=ownerNod; this->fNodes = 0; hasDefaults(false); if (defaults != 0) { if (defaults->getLength() > 0) { hasDefaults(true); cloneContent(defaults); } } } DOMAttrMapImpl::~DOMAttrMapImpl() { } void DOMAttrMapImpl::cloneContent(const DOMAttrMapImpl *srcmap) { if ((srcmap != 0) && (srcmap->fNodes != 0)) { if (fNodes != 0) fNodes->reset(); else { XMLSize_t size = srcmap->fNodes->size(); if(size > 0) { DOMDocumentImpl *doc = (DOMDocumentImpl*)fOwnerNode->getOwnerDocument(); fNodes = new (doc) DOMNodeVector(doc, size); } } for (XMLSize_t i = 0; i < srcmap->fNodes->size(); i++) { DOMNode *n = srcmap->fNodes->elementAt(i); DOMNode *clone = n->cloneNode(true); castToNodeImpl(clone)->isSpecified(castToNodeImpl(n)->isSpecified()); castToNodeImpl(clone)->fOwnerNode = fOwnerNode; castToNodeImpl(clone)->isOwned(true); fNodes->addElement(clone); } } } DOMAttrMapImpl *DOMAttrMapImpl::cloneAttrMap(DOMNode *ownerNode_p) { DOMAttrMapImpl *newmap = new (castToNodeImpl(ownerNode_p)->getOwnerDocument()) DOMAttrMapImpl(ownerNode_p); newmap->cloneContent(this); // newmap->attrDefaults = this->attrDefaults; // revisit return newmap; } void DOMAttrMapImpl::setReadOnly(bool readOnl, bool deep) { // this->fReadOnly=readOnl; if(deep && fNodes!=0) { XMLSize_t sz = fNodes->size(); for (XMLSize_t i=0; ielementAt(i))->setReadOnly(readOnl, deep); } } } bool DOMAttrMapImpl::readOnly() { return castToNodeImpl(fOwnerNode)->isReadOnly(); } int DOMAttrMapImpl::findNamePoint(const XMLCh *name) const { // Binary search int i=0; if(fNodes!=0) { int first=0,last=(int)fNodes->size()-1; while(first<=last) { i=(first+last)/2; int test = XMLString::compareString(name, fNodes->elementAt(i)->getNodeName()); if(test==0) return i; // Name found else if(test<0) last=i-1; else first=i+1; } if(first>i) i=first; } /******************** // Linear search int i = 0; if (fNodes != 0) for (i = 0; i < fNodes.size(); ++i) { int test = name.compareTo(((NodeImpl *) (fNodes.elementAt(i))).getNodeName()); if (test == 0) return i; else if (test < 0) { break; // Found insertpoint } } *******************/ return -1 - i; // not-found has to be encoded. } DOMNode * DOMAttrMapImpl::getNamedItem(const XMLCh *name) const { int i=findNamePoint(name); return (i<0) ? 0 : fNodes->elementAt(i); } DOMNode *DOMAttrMapImpl::setNamedItem(DOMNode *arg) { if (arg->getNodeType() != DOMNode::ATTRIBUTE_NODE) throw DOMException(DOMException::HIERARCHY_REQUEST_ERR, 0, GetDOMNamedNodeMapMemoryManager); DOMDocument *doc = fOwnerNode->getOwnerDocument(); DOMNodeImpl *argImpl = castToNodeImpl(arg); if(argImpl->getOwnerDocument() != doc) throw DOMException(DOMException::WRONG_DOCUMENT_ERR, 0, GetDOMNamedNodeMapMemoryManager); if (this->readOnly()) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNamedNodeMapMemoryManager); if ((arg->getNodeType() == DOMNode::ATTRIBUTE_NODE) && argImpl->isOwned() && (argImpl->fOwnerNode != fOwnerNode)) throw DOMException(DOMException::INUSE_ATTRIBUTE_ERR,0, GetDOMNamedNodeMapMemoryManager); argImpl->fOwnerNode = fOwnerNode; argImpl->isOwned(true); int i=findNamePoint(arg->getNodeName()); DOMNode * previous=0; if(i>=0) { previous = fNodes->elementAt(i); fNodes->setElementAt(arg,i); } else { i=-1-i; // Insert point (may be end of list) if(0==fNodes) { fNodes=new ((DOMDocumentImpl*)doc) DOMNodeVector(doc); } fNodes->insertElementAt(arg,i); } if (previous != 0) { castToNodeImpl(previous)->fOwnerNode = doc; castToNodeImpl(previous)->isOwned(false); } return previous; } //Introduced in DOM Level 2 int DOMAttrMapImpl::findNamePoint(const XMLCh *namespaceURI, const XMLCh *localName) const { if (fNodes == 0) return -1; // This is a linear search through the same fNodes Vector. // The Vector is sorted on the DOM Level 1 nodename. // The DOM Level 2 NS keys are namespaceURI and Localname, // so we must linear search thru it. // In addition, to get this to work with fNodes without any namespace // (namespaceURI and localNames are both 0) we then use the nodeName // as a secondary key. const XMLSize_t len = fNodes -> size(); for (XMLSize_t i = 0; i < len; ++i) { DOMNode *node = fNodes -> elementAt(i); const XMLCh * nNamespaceURI = node->getNamespaceURI(); const XMLCh * nLocalName = node->getLocalName(); if (!XMLString::equals(nNamespaceURI, namespaceURI)) //URI not match continue; else { if (XMLString::equals(localName, nLocalName) || (nLocalName == 0 && XMLString::equals(localName, node->getNodeName()))) return (int)i; } } return -1; //not found } DOMNode *DOMAttrMapImpl::getNamedItemNS(const XMLCh *namespaceURI, const XMLCh *localName) const { int i = findNamePoint(namespaceURI, localName); return i < 0 ? 0 : fNodes -> elementAt(i); } DOMNode *DOMAttrMapImpl::setNamedItemNS(DOMNode* arg) { if (arg->getNodeType() != DOMNode::ATTRIBUTE_NODE) throw DOMException(DOMException::HIERARCHY_REQUEST_ERR, 0, GetDOMNamedNodeMapMemoryManager); DOMDocument *doc = fOwnerNode->getOwnerDocument(); DOMNodeImpl *argImpl = castToNodeImpl(arg); if (argImpl->getOwnerDocument() != doc) throw DOMException(DOMException::WRONG_DOCUMENT_ERR,0, GetDOMNamedNodeMapMemoryManager); if (this->readOnly()) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNamedNodeMapMemoryManager); if (argImpl->isOwned()) throw DOMException(DOMException::INUSE_ATTRIBUTE_ERR,0, GetDOMNamedNodeMapMemoryManager); argImpl->fOwnerNode = fOwnerNode; argImpl->isOwned(true); int i=findNamePoint(arg->getNamespaceURI(), arg->getLocalName()); DOMNode *previous=0; if(i>=0) { previous = fNodes->elementAt(i); fNodes->setElementAt(arg,i); } else { i=findNamePoint(arg->getNodeName()); // Insert point (may be end of list) if (i<0) i = -1 - i; if(0==fNodes) fNodes=new ((DOMDocumentImpl*)doc) DOMNodeVector(doc); fNodes->insertElementAt(arg,i); } if (previous != 0) { castToNodeImpl(previous)->fOwnerNode = doc; castToNodeImpl(previous)->isOwned(false); } return previous; } DOMNode *DOMAttrMapImpl::removeNamedItem(const XMLCh *name) { if (this->readOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNamedNodeMapMemoryManager); int i=findNamePoint(name); DOMNode *removed = 0; if(i<0) throw DOMException(DOMException::NOT_FOUND_ERR, 0, GetDOMNamedNodeMapMemoryManager); removed = fNodes->elementAt(i); fNodes->removeElementAt(i); castToNodeImpl(removed)->fOwnerNode = fOwnerNode->getOwnerDocument(); castToNodeImpl(removed)->isOwned(false); // Replace it if it had a default value // (DOM spec level 1 - Element Interface) if (hasDefaults() && (removed != 0)) { DOMAttrMapImpl* defAttrs = ((DOMElementImpl*)fOwnerNode)->getDefaultAttributes(); DOMAttr* attr = (DOMAttr*)(defAttrs->getNamedItem(name)); if (attr != 0) { DOMAttr* newAttr = (DOMAttr*)attr->cloneNode(true); setNamedItem(newAttr); } } return removed; } DOMNode *DOMAttrMapImpl::removeNamedItemNS(const XMLCh *namespaceURI, const XMLCh *localName) { if (this->readOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNamedNodeMapMemoryManager); int i = findNamePoint(namespaceURI, localName); if (i < 0) throw DOMException(DOMException::NOT_FOUND_ERR, 0, GetDOMNamedNodeMapMemoryManager); DOMNode * removed = fNodes -> elementAt(i); fNodes -> removeElementAt(i); //remove n from nodes castToNodeImpl(removed)->fOwnerNode = fOwnerNode->getOwnerDocument(); castToNodeImpl(removed)->isOwned(false); // Replace it if it had a default value // (DOM spec level 2 - Element Interface) if (hasDefaults() && (removed != 0)) { DOMAttrMapImpl* defAttrs = ((DOMElementImpl*)fOwnerNode)->getDefaultAttributes(); DOMAttr* attr = (DOMAttr*)(defAttrs->getNamedItemNS(namespaceURI, localName)); if (attr != 0) { DOMAttr* newAttr = (DOMAttr*)attr->cloneNode(true); setNamedItemNS(newAttr); } } return removed; } // remove the name using index // avoid calling findNamePoint again if the index is already known DOMNode * DOMAttrMapImpl::removeNamedItemAt(XMLSize_t index) { if (this->readOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNamedNodeMapMemoryManager); DOMNode *removed = item(index); if(!removed) throw DOMException(DOMException::NOT_FOUND_ERR, 0, GetDOMNamedNodeMapMemoryManager); fNodes->removeElementAt(index); castToNodeImpl(removed)->fOwnerNode = fOwnerNode->getOwnerDocument(); castToNodeImpl(removed)->isOwned(false); // Replace it if it had a default value // (DOM spec level 1 - Element Interface) if (hasDefaults() && (removed != 0)) { DOMAttrMapImpl* defAttrs = ((DOMElementImpl*)fOwnerNode)->getDefaultAttributes(); const XMLCh* localName = removed->getLocalName(); DOMAttr* attr = 0; if (localName) attr = (DOMAttr*)(defAttrs->getNamedItemNS(removed->getNamespaceURI(), localName)); else attr = (DOMAttr*)(defAttrs->getNamedItem(((DOMAttr*)removed)->getName())); if (attr != 0) { DOMAttr* newAttr = (DOMAttr*)attr->cloneNode(true); setNamedItem(newAttr); } } return removed; } /** * Get this AttributeMap in sync with the given "defaults" map. * @param defaults The default attributes map to sync with. */ void DOMAttrMapImpl::reconcileDefaultAttributes(const DOMAttrMapImpl* defaults) { // remove any existing default XMLSize_t nsize = getLength(); for (XMLSize_t i = nsize; i > 0; i--) { DOMAttr* attr = (DOMAttr*)item(i-1); if (!attr->getSpecified()) { removeNamedItemAt(i-1); } } hasDefaults(false); // add the new defaults if (defaults) { hasDefaults(true); if (nsize == 0) { cloneContent(defaults); } else { XMLSize_t dsize = defaults->getLength(); for (XMLSize_t n = 0; n < dsize; n++) { DOMAttr* attr = (DOMAttr*)defaults->item(n); DOMAttr* newAttr = (DOMAttr*)attr->cloneNode(true); setNamedItemNS(newAttr); DOMAttrImpl* newAttrImpl = (DOMAttrImpl*) newAttr; newAttrImpl->setSpecified(false); } } } } // reconcileDefaults() /** * Move specified attributes from the given map to this one */ void DOMAttrMapImpl::moveSpecifiedAttributes(DOMAttrMapImpl* srcmap) { XMLSize_t nsize = srcmap->getLength(); for (XMLSize_t i = nsize; i > 0; i--) { DOMAttr* attr = (DOMAttr*)srcmap->item(i-1); if (attr->getSpecified()) { srcmap->removeNamedItemAt(i-1); } if (attr->getLocalName()) setNamedItemNS(attr); else setNamedItem(attr); } } // moveSpecifiedAttributes(AttributeMap):void XMLSize_t DOMAttrMapImpl::getLength() const { return (fNodes != 0) ? fNodes->size() : 0; } DOMNode * DOMAttrMapImpl::item(XMLSize_t index) const { return (fNodes != 0 && index < fNodes->size()) ? fNodes->elementAt(index) : 0; } void DOMAttrMapImpl::setNamedItemFast(DOMNode *arg) { DOMNodeImpl *argImpl = castToNodeImpl(arg); argImpl->fOwnerNode = fOwnerNode; argImpl->isOwned(true); int i = findNamePoint(arg->getNodeName()); if(i >= 0) fNodes->setElementAt(arg, i); else { i= -1 -i; fNodes->insertElementAt(arg, i); } } void DOMAttrMapImpl::setNamedItemNSFast(DOMNode* arg) { DOMNodeImpl *argImpl = castToNodeImpl(arg); argImpl->fOwnerNode = fOwnerNode; argImpl->isOwned(true); int i=findNamePoint(arg->getNamespaceURI(), arg->getLocalName()); if(i >= 0) { fNodes->setElementAt(arg,i); } else { i = findNamePoint(arg->getNodeName()); if (i < 0) i = -1 - i; fNodes->insertElementAt(arg,i); } } void DOMAttrMapImpl::reserve (XMLSize_t n) { if (fNodes == 0) { DOMDocumentImpl* doc = (DOMDocumentImpl*)fOwnerNode->getOwnerDocument(); fNodes = new (doc) DOMNodeVector(doc, n); } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMDocumentImpl.cpp000644 000765 000024 00000150640 13241160337 023460 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMDocumentImpl.cpp 1800911 2017-07-05 18:52:15Z scantor $ */ #include "DOMDocumentImpl.hpp" #include "DOMCasts.hpp" #include "DOMConfigurationImpl.hpp" #include "DOMDocumentTypeImpl.hpp" #include "DOMAttrImpl.hpp" #include "DOMAttrNSImpl.hpp" #include "DOMCDATASectionImpl.hpp" #include "DOMCommentImpl.hpp" #include "DOMDeepNodeListImpl.hpp" #include "DOMDocumentFragmentImpl.hpp" #include "DOMElementImpl.hpp" #include "XSDElementNSImpl.hpp" #include "DOMEntityImpl.hpp" #include "DOMEntityReferenceImpl.hpp" #include "DOMNormalizer.hpp" #include "DOMNotationImpl.hpp" #include "DOMProcessingInstructionImpl.hpp" #include "DOMTextImpl.hpp" #include "DOMTreeWalkerImpl.hpp" #include "DOMNodeIteratorImpl.hpp" #include "DOMNodeIDMap.hpp" #include "DOMRangeImpl.hpp" #include "DOMTypeInfoImpl.hpp" #include "DOMXPathExpressionImpl.hpp" #include "DOMXPathNSResolverImpl.hpp" #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // The chunk size to allocate from the system allocator. static XMLSize_t kInitialHeapAllocSize = 0x4000; static XMLSize_t kMaxHeapAllocSize = 0x80000; static XMLSize_t kMaxSubAllocationSize = 0x0100; // Any request for more bytes // than this will be handled by // allocating directly with system. void XMLInitializer::initializeDOMHeap (XMLSize_t initialHeapAllocSize, XMLSize_t maxHeapAllocSize, XMLSize_t maxSubAllocationSize) { kInitialHeapAllocSize = initialHeapAllocSize; kMaxHeapAllocSize = maxHeapAllocSize; kMaxSubAllocationSize = maxSubAllocationSize; } // // Constructors. Warning - be very careful with the ordering of initialization // of the heap. Ordering depends on the order of declaration // in the .hpp file, not on the order of initializers here // in the constructor. The heap declaration can not be // first - fNode and fParent must be first for the casting // functions in DOMCasts to work correctly. This means that // fNode and fParent constructors used here can not // allocate. // DOMDocumentImpl::DOMDocumentImpl(DOMImplementation* domImpl, MemoryManager* const manager) : fNode(this, this), fParent(this, this), fNodeIDMap(0), fInputEncoding(0), fXmlEncoding(0), fXmlStandalone(false), fXmlVersion(0), fDocumentURI(0), fDOMConfiguration(0), fUserDataTableKeys(17, manager), fUserDataTable(0), fCurrentBlock(0), fCurrentSingletonBlock(0), fFreePtr(0), fFreeBytesRemaining(0), fHeapAllocSize(kInitialHeapAllocSize), fRecycleNodePtr(0), fRecycleBufferPtr(0), fNodeListPool(0), fDocType(0), fDocElement(0), fNameTableSize(257), fNormalizer(0), fRanges(0), fNodeIterators(0), fMemoryManager(manager), fDOMImplementation(domImpl), fChanges(0), errorChecking(true) { fNameTable = (DOMStringPoolEntry**)allocate ( sizeof (DOMStringPoolEntry*) * fNameTableSize); for (XMLSize_t i = 0; i < fNameTableSize; i++) fNameTable[i] = 0; } //DOM Level 2 DOMDocumentImpl::DOMDocumentImpl(const XMLCh *fNamespaceURI, const XMLCh *qualifiedName, DOMDocumentType *doctype, DOMImplementation* domImpl, MemoryManager* const manager) : fNode(this, this), fParent(this, this), fNodeIDMap(0), fInputEncoding(0), fXmlEncoding(0), fXmlStandalone(false), fXmlVersion(0), fDocumentURI(0), fDOMConfiguration(0), fUserDataTableKeys(17, manager), fUserDataTable(0), fCurrentBlock(0), fCurrentSingletonBlock(0), fFreePtr(0), fFreeBytesRemaining(0), fHeapAllocSize(kInitialHeapAllocSize), fRecycleNodePtr(0), fRecycleBufferPtr(0), fNodeListPool(0), fDocType(0), fDocElement(0), fNameTableSize(257), fNormalizer(0), fRanges(0), fNodeIterators(0), fMemoryManager(manager), fDOMImplementation(domImpl), fChanges(0), errorChecking(true) { fNameTable = (DOMStringPoolEntry**)allocate ( sizeof (DOMStringPoolEntry*) * fNameTableSize); for (XMLSize_t i = 0; i < fNameTableSize; i++) fNameTable[i] = 0; try { setDocumentType(doctype); if (qualifiedName) appendChild(createElementNS(fNamespaceURI, qualifiedName)); //root element else if (fNamespaceURI) throw DOMException(DOMException::NAMESPACE_ERR, 0, getMemoryManager()); } catch(const OutOfMemoryException&) { throw; } catch (...) { this->deleteHeap(); throw; } } void DOMDocumentImpl::setDocumentType(DOMDocumentType *doctype) { if (!doctype) return; // New doctypes can be created either with the factory methods on DOMImplementation, in // which case ownerDocument will be 0, or with methods on DocumentImpl, in which case // ownerDocument will be set, but the DocType won't yet be a child of the document. // DOMDocument* doc = doctype->getOwnerDocument(); if (doc != 0 && doc != this) throw DOMException( //one doctype can belong to only one DOMDocumentImpl DOMException::WRONG_DOCUMENT_ERR, 0, getMemoryManager()); DOMDocumentTypeImpl* doctypeImpl = (DOMDocumentTypeImpl*) doctype; doctypeImpl->setOwnerDocument(this); // The doctype can not have any Entities or Notations yet, because they can not // be created except through factory methods on a document. // revisit. What if this doctype is already a child of the document? appendChild(doctype); } DOMDocumentImpl::~DOMDocumentImpl() { // While DOMConfiguration is allocated on the Document's heap, itself // it uses the memory manager directly. This means that while we cannot // delete with operator delete, we need to call its d-tor. // if (fDOMConfiguration) fDOMConfiguration->~DOMConfiguration (); // Clean up the fNodeListPool if (fNodeListPool) fNodeListPool->cleanup(); if (fRanges) delete fRanges; //fRanges->cleanup(); if (fNodeIterators) delete fNodeIterators;//fNodeIterators->cleanup(); if (fUserDataTable) delete fUserDataTable;//fUserDataTable->cleanup(); if (fRecycleNodePtr) { fRecycleNodePtr->deleteAllElements(); delete fRecycleNodePtr; } if (fRecycleBufferPtr) { delete fRecycleBufferPtr; } delete fNormalizer; // Delete the heap for this document. This uncerimoniously yanks the storage // out from under all of the nodes in the document. Destructors are NOT called. this->deleteHeap(); } DOMNode *DOMDocumentImpl::cloneNode(bool deep) const { // Note: the cloned document node goes on the same heap we live in. DOMDocumentImpl *newdoc = new (fMemoryManager) DOMDocumentImpl(fDOMImplementation, fMemoryManager); if(fXmlEncoding && *fXmlEncoding) newdoc->setXmlEncoding(fXmlEncoding); if(fXmlVersion && *fXmlVersion) newdoc->setXmlVersion(fXmlVersion); newdoc->setXmlStandalone(fXmlStandalone); // then the children by _importing_ them if (deep) for (DOMNode *n = this->getFirstChild(); n != 0; n = n->getNextSibling()) { newdoc->appendChild(newdoc->importNode(n, true, true)); } fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newdoc); return newdoc; } const XMLCh * DOMDocumentImpl::getNodeName() const { static const XMLCh nam[] = // "#document" {chPound, chLatin_d, chLatin_o, chLatin_c, chLatin_u, chLatin_m, chLatin_e, chLatin_n, chLatin_t, 0}; return nam; } DOMNode::NodeType DOMDocumentImpl::getNodeType() const { return DOMNode::DOCUMENT_NODE; } // even though ownerDocument refers to this in this implementation // the DOM Level 2 spec says it must be 0, so make it appear so DOMDocument * DOMDocumentImpl::getOwnerDocument() const { return 0; } DOMAttr *DOMDocumentImpl::createAttribute(const XMLCh *nam) { if(!nam || !isXMLName(nam)) throw DOMException(DOMException::INVALID_CHARACTER_ERR,0, getMemoryManager()); return new (this, DOMMemoryManager::ATTR_OBJECT) DOMAttrImpl(this,nam); } DOMCDATASection *DOMDocumentImpl::createCDATASection(const XMLCh *data) { return new (this, DOMMemoryManager::CDATA_SECTION_OBJECT) DOMCDATASectionImpl(this,data); } DOMComment *DOMDocumentImpl::createComment(const XMLCh *data) { return new (this, DOMMemoryManager::COMMENT_OBJECT) DOMCommentImpl(this, data); } DOMDocumentFragment *DOMDocumentImpl::createDocumentFragment() { return new (this, DOMMemoryManager::DOCUMENT_FRAGMENT_OBJECT) DOMDocumentFragmentImpl(this); } DOMDocumentType *DOMDocumentImpl::createDocumentType(const XMLCh *nam) { if (!nam || !isXMLName(nam)) throw DOMException( DOMException::INVALID_CHARACTER_ERR, 0, getMemoryManager()); return new (this, DOMMemoryManager::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(this, nam, false); } DOMDocumentType * DOMDocumentImpl::createDocumentType(const XMLCh *qualifiedName, const XMLCh *publicId, const XMLCh *systemId) { if (!qualifiedName || !isXMLName(qualifiedName)) throw DOMException( DOMException::INVALID_CHARACTER_ERR, 0, getMemoryManager()); return new (this, DOMMemoryManager::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(this, qualifiedName, publicId, systemId, false); } DOMElement *DOMDocumentImpl::createElement(const XMLCh *tagName) { if(!tagName || !isXMLName(tagName)) throw DOMException(DOMException::INVALID_CHARACTER_ERR,0, getMemoryManager()); return new (this, DOMMemoryManager::ELEMENT_OBJECT) DOMElementImpl(this,tagName); } DOMElement *DOMDocumentImpl::createElementNoCheck(const XMLCh *tagName) { return new (this, DOMMemoryManager::ELEMENT_OBJECT) DOMElementImpl(this, tagName); } DOMEntity *DOMDocumentImpl::createEntity(const XMLCh *nam) { if (!nam || !isXMLName(nam)) throw DOMException( DOMException::INVALID_CHARACTER_ERR, 0, getMemoryManager()); return new (this, DOMMemoryManager::ENTITY_OBJECT) DOMEntityImpl(this, nam); } DOMEntityReference *DOMDocumentImpl::createEntityReference(const XMLCh *nam) { if (!nam || !isXMLName(nam)) throw DOMException( DOMException::INVALID_CHARACTER_ERR, 0, getMemoryManager()); return new (this, DOMMemoryManager::ENTITY_REFERENCE_OBJECT) DOMEntityReferenceImpl(this, nam); } DOMEntityReference *DOMDocumentImpl::createEntityReferenceByParser(const XMLCh *nam) { if (!nam || !isXMLName(nam)) throw DOMException( DOMException::INVALID_CHARACTER_ERR, 0, getMemoryManager()); return new (this, DOMMemoryManager::ENTITY_REFERENCE_OBJECT) DOMEntityReferenceImpl(this, nam, false); } DOMNotation *DOMDocumentImpl::createNotation(const XMLCh *nam) { if (!nam || !isXMLName(nam)) throw DOMException( DOMException::INVALID_CHARACTER_ERR, 0, getMemoryManager()); return new (this, DOMMemoryManager::NOTATION_OBJECT) DOMNotationImpl(this, nam); } DOMProcessingInstruction *DOMDocumentImpl::createProcessingInstruction( const XMLCh *target, const XMLCh *data) { if(!target || !isXMLName(target)) throw DOMException(DOMException::INVALID_CHARACTER_ERR,0, getMemoryManager()); return new (this, DOMMemoryManager::PROCESSING_INSTRUCTION_OBJECT) DOMProcessingInstructionImpl(this,target,data); } DOMText *DOMDocumentImpl::createTextNode(const XMLCh *data) { return new (this, DOMMemoryManager::TEXT_OBJECT) DOMTextImpl(this,data); } DOMNodeIterator* DOMDocumentImpl::createNodeIterator ( DOMNode *root, DOMNodeFilter::ShowType whatToShow, DOMNodeFilter* filter, bool entityReferenceExpansion) { if (!root) { throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, getMemoryManager()); return 0; } DOMNodeIteratorImpl* nodeIterator = new (this) DOMNodeIteratorImpl(this, root, whatToShow, filter, entityReferenceExpansion); if (fNodeIterators == 0L) { //fNodeIterators = new (this) NodeIterators(1, false); fNodeIterators = new (fMemoryManager) NodeIterators(1, false, fMemoryManager); } fNodeIterators->addElement(nodeIterator); return nodeIterator; } NodeIterators* DOMDocumentImpl::getNodeIterators() const { return fNodeIterators; } void DOMDocumentImpl::removeNodeIterator(DOMNodeIteratorImpl* nodeIterator) { if (fNodeIterators != 0) { XMLSize_t sz = fNodeIterators->size(); if (sz !=0) { for (XMLSize_t i =0; ielementAt(i) == nodeIterator) { fNodeIterators->removeElementAt(i); break; } } } } } DOMXPathExpression* DOMDocumentImpl::createExpression(const XMLCh * expression, const DOMXPathNSResolver *resolver) { return new (getMemoryManager()) DOMXPathExpressionImpl(expression, resolver, getMemoryManager()); } DOMXPathNSResolver* DOMDocumentImpl::createNSResolver(const DOMNode *nodeResolver) { return new (getMemoryManager()) DOMXPathNSResolverImpl(nodeResolver, getMemoryManager()); } DOMXPathResult* DOMDocumentImpl::evaluate(const XMLCh *expression, const DOMNode *contextNode, const DOMXPathNSResolver *resolver, DOMXPathResult::ResultType type, DOMXPathResult* result) { JanitorMemFunCall expr( createExpression(expression, resolver), &DOMXPathExpression::release); return expr->evaluate(contextNode, type, result); } DOMTreeWalker* DOMDocumentImpl::createTreeWalker ( DOMNode *root, DOMNodeFilter::ShowType whatToShow, DOMNodeFilter* filter, bool entityReferenceExpansion) { if (!root) { throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, getMemoryManager()); return 0; } return new (this) DOMTreeWalkerImpl(root, whatToShow, filter, entityReferenceExpansion); } DOMDocumentType *DOMDocumentImpl::getDoctype() const { return fDocType; } DOMElement *DOMDocumentImpl::getDocumentElement() const { return fDocElement; } DOMNodeList *DOMDocumentImpl::getElementsByTagName(const XMLCh *tagname) const { // cast off the const of this because we will update the fNodeListPool return ((DOMDocumentImpl*)this)->getDeepNodeList(this,tagname); } DOMImplementation *DOMDocumentImpl::getImplementation() const { return fDOMImplementation; } DOMNode *DOMDocumentImpl::insertBefore(DOMNode *newChild, DOMNode *refChild) { // Only one such child permitted if( (newChild->getNodeType() == DOMNode::ELEMENT_NODE && fDocElement!=0) || (newChild->getNodeType() == DOMNode::DOCUMENT_TYPE_NODE && fDocType!=0) ) throw DOMException(DOMException::HIERARCHY_REQUEST_ERR,0, getMemoryManager()); // if the newChild is a documenttype node created from domimplementation, set the ownerDoc first if ((newChild->getNodeType() == DOMNode::DOCUMENT_TYPE_NODE) && !newChild->getOwnerDocument()) ((DOMDocumentTypeImpl*)newChild)->setOwnerDocument(this); fParent.insertBefore(newChild,refChild); // If insert succeeded, cache the kid appropriately if(newChild->getNodeType() == DOMNode::ELEMENT_NODE) fDocElement=(DOMElement *)newChild; else if(newChild->getNodeType() == DOMNode::DOCUMENT_TYPE_NODE) fDocType=(DOMDocumentType *)newChild; return newChild; } DOMNode* DOMDocumentImpl::replaceChild(DOMNode *newChild, DOMNode *oldChild) { DOMDocumentType* tempDocType = fDocType; DOMElement* tempDocElement = fDocElement; if(oldChild->getNodeType() == DOMNode::DOCUMENT_TYPE_NODE) fDocType=0; else if(oldChild->getNodeType() == DOMNode::ELEMENT_NODE) fDocElement=0; try { insertBefore(newChild, oldChild); // changed() already done. if((oldChild->getNodeType() == DOMNode::DOCUMENT_TYPE_NODE) || (oldChild->getNodeType() == DOMNode::ELEMENT_NODE)) return fParent.removeChild(oldChild); else return removeChild(oldChild); } catch(const OutOfMemoryException&) { throw; } catch(...) { fDocType = tempDocType; fDocElement = tempDocElement; throw; } } bool DOMDocumentImpl::isXMLName(const XMLCh *s) { // fXmlVersion points directly to the static constants if (fXmlVersion==XMLUni::fgVersion1_1) return XMLChar1_1::isValidName(s); else return XMLChar1_0::isValidName(s); } DOMNode *DOMDocumentImpl::removeChild(DOMNode *oldChild) { fParent.removeChild(oldChild); // If remove succeeded, un-cache the kid appropriately if(oldChild->getNodeType() == DOMNode::ELEMENT_NODE) fDocElement=0; else if(oldChild->getNodeType() == DOMNode::DOCUMENT_TYPE_NODE) fDocType=0; return oldChild; } void DOMDocumentImpl::setNodeValue(const XMLCh *x) { fNode.setNodeValue(x); } //Introduced in DOM Level 2 DOMNode *DOMDocumentImpl::importNode(const DOMNode *source, bool deep) { return importNode(source, deep, false); } DOMElement *DOMDocumentImpl::createElementNS(const XMLCh *fNamespaceURI, const XMLCh *qualifiedName) { if(!qualifiedName || !isXMLName(qualifiedName)) throw DOMException(DOMException::INVALID_CHARACTER_ERR,0, getMemoryManager()); return new (this, DOMMemoryManager::ELEMENT_NS_OBJECT) DOMElementNSImpl(this, fNamespaceURI, qualifiedName); } DOMElement *DOMDocumentImpl::createElementNS(const XMLCh *fNamespaceURI, const XMLCh *qualifiedName, const XMLFileLoc lineNo, const XMLFileLoc columnNo) { if(!qualifiedName || !isXMLName(qualifiedName)) throw DOMException(DOMException::INVALID_CHARACTER_ERR,0, getMemoryManager()); return new (this) XSDElementNSImpl(this, fNamespaceURI, qualifiedName, lineNo, columnNo); } DOMAttr *DOMDocumentImpl::createAttributeNS(const XMLCh *fNamespaceURI, const XMLCh *qualifiedName) { if(!qualifiedName || !isXMLName(qualifiedName)) throw DOMException(DOMException::INVALID_CHARACTER_ERR,0, getMemoryManager()); return new (this, DOMMemoryManager::ATTR_NS_OBJECT) DOMAttrNSImpl(this, fNamespaceURI, qualifiedName); } DOMNodeList *DOMDocumentImpl::getElementsByTagNameNS(const XMLCh *fNamespaceURI, const XMLCh *fLocalName) const { // cast off the const of this because we will update the fNodeListPool return ((DOMDocumentImpl*)this)->getDeepNodeList(this, fNamespaceURI, fLocalName); } DOMElement *DOMDocumentImpl::getElementById(const XMLCh *elementId) const { if (fNodeIDMap == 0) return 0; DOMAttr *theAttr = fNodeIDMap->find(elementId); if (theAttr == 0) return 0; return theAttr->getOwnerElement(); } const XMLCh* DOMDocumentImpl::getBaseURI() const { return fDocumentURI; } DOMRange* DOMDocumentImpl::createRange() { DOMRangeImpl* range = new (this) DOMRangeImpl(this, fMemoryManager); if (fRanges == 0L) { //fRanges = new (this) Ranges(1, false); fRanges = new (fMemoryManager) Ranges(1, false, fMemoryManager); // XMemory } fRanges->addElement(range); return range; } Ranges* DOMDocumentImpl::getRanges() const { return fRanges; } void DOMDocumentImpl::removeRange(DOMRangeImpl* range) { if (fRanges != 0) { XMLSize_t sz = fRanges->size(); if (sz !=0) { for (XMLSize_t i =0; ielementAt(i) == range) { fRanges->removeElementAt(i); break; } } } } } /** Uses the kidOK lookup table to check whether the proposed tree structure is legal. ????? It feels like there must be a more efficient solution, but for the life of me I can't think what it would be. */ bool DOMDocumentImpl::isKidOK(const DOMNode *parent, const DOMNode *child) { static int kidOK[14]; if (kidOK[DOMNode::ATTRIBUTE_NODE] == 0) { kidOK[DOMNode::DOCUMENT_NODE] = 1 << DOMNode::ELEMENT_NODE | 1 << DOMNode::PROCESSING_INSTRUCTION_NODE | 1 << DOMNode::COMMENT_NODE | 1 << DOMNode::DOCUMENT_TYPE_NODE; kidOK[DOMNode::DOCUMENT_FRAGMENT_NODE] = kidOK[DOMNode::ENTITY_NODE] = kidOK[DOMNode::ENTITY_REFERENCE_NODE] = kidOK[DOMNode::ELEMENT_NODE] = 1 << DOMNode::ELEMENT_NODE | 1 << DOMNode::PROCESSING_INSTRUCTION_NODE | 1 << DOMNode::COMMENT_NODE | 1 << DOMNode::TEXT_NODE | 1 << DOMNode::CDATA_SECTION_NODE | 1 << DOMNode::ENTITY_REFERENCE_NODE; kidOK[DOMNode::ATTRIBUTE_NODE] = 1 << DOMNode::TEXT_NODE | 1 << DOMNode::ENTITY_REFERENCE_NODE; kidOK[DOMNode::PROCESSING_INSTRUCTION_NODE] = kidOK[DOMNode::COMMENT_NODE] = kidOK[DOMNode::TEXT_NODE] = kidOK[DOMNode::CDATA_SECTION_NODE] = kidOK[DOMNode::NOTATION_NODE] = 0; } int p=parent->getNodeType(); int ch = child->getNodeType(); return ((kidOK[p] & 1<getXmlVersion(), XMLUni::fgVersion1_1))? XMLChar1_1::isAllSpaces(child->getNodeValue(), XMLString::stringLen(child->getNodeValue())): XMLChar1_0::isAllSpaces(child->getNodeValue(), XMLString::stringLen(child->getNodeValue()))) ); } void DOMDocumentImpl::changed() { fChanges++; } int DOMDocumentImpl::changes() const{ return fChanges; } // // Delegation for functions inherited from DOMNode // DOMNode* DOMDocumentImpl::appendChild(DOMNode *newChild) {return insertBefore(newChild, 0); } DOMNamedNodeMap* DOMDocumentImpl::getAttributes() const {return fNode.getAttributes (); } DOMNodeList* DOMDocumentImpl::getChildNodes() const {return fParent.getChildNodes (); } DOMNode* DOMDocumentImpl::getFirstChild() const {return fParent.getFirstChild (); } DOMNode* DOMDocumentImpl::getLastChild() const {return fParent.getLastChild (); } const XMLCh* DOMDocumentImpl::getLocalName() const {return fNode.getLocalName (); } const XMLCh* DOMDocumentImpl::getNamespaceURI() const {return fNode.getNamespaceURI (); } DOMNode* DOMDocumentImpl::getNextSibling() const {return fNode.getNextSibling (); } const XMLCh* DOMDocumentImpl::getNodeValue() const {return fNode.getNodeValue (); } const XMLCh* DOMDocumentImpl::getPrefix() const {return fNode.getPrefix (); } DOMNode* DOMDocumentImpl::getParentNode() const {return fNode.getParentNode (); } DOMNode* DOMDocumentImpl::getPreviousSibling() const {return fNode.getPreviousSibling (); } bool DOMDocumentImpl::hasChildNodes() const {return fParent.hasChildNodes (); } void DOMDocumentImpl::normalize() {fParent.normalize (); } void DOMDocumentImpl::setPrefix(const XMLCh *prefix) {fNode.setPrefix(prefix); } bool DOMDocumentImpl::hasAttributes() const {return fNode.hasAttributes(); } bool DOMDocumentImpl::isSameNode(const DOMNode* other) const {return fNode.isSameNode(other);} bool DOMDocumentImpl::isEqualNode(const DOMNode* arg) const {return fParent.isEqualNode(arg);} void* DOMDocumentImpl::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) {return fNode.setUserData(key, data, handler); } void* DOMDocumentImpl::getUserData(const XMLCh* key) const {return fNode.getUserData(key); } short DOMDocumentImpl::compareDocumentPosition(const DOMNode* other) const {return fNode.compareDocumentPosition(other); } const XMLCh* DOMDocumentImpl::getTextContent() const {return fNode.getTextContent(); } void DOMDocumentImpl::setTextContent(const XMLCh* textContent){fNode.setTextContent(textContent); } const XMLCh* DOMDocumentImpl::lookupPrefix(const XMLCh* namespaceURI) const {return fNode.lookupPrefix(namespaceURI); } bool DOMDocumentImpl::isDefaultNamespace(const XMLCh* namespaceURI) const {return fNode.isDefaultNamespace(namespaceURI); } const XMLCh* DOMDocumentImpl::lookupNamespaceURI(const XMLCh* prefix) const {return fNode.lookupNamespaceURI(prefix); } // Macro-in implementation accessors. DOMNODEIMPL_IMPL(DOMDocumentImpl); DOMPARENTIMPL_IMPL(DOMDocumentImpl); //----------------------------------------------------------------------- // // Per Document Heap and Heap Helper functions // // revisit - this stuff should be a class of its own, rather than // just lying around naked in DocumentImpl. // //----------------------------------------------------------------------- XMLCh * DOMDocumentImpl::cloneString(const XMLCh *src) { if (!src) return 0; XMLSize_t len = XMLString::stringLen(src); len = (len + 1) * sizeof(XMLCh); len = (len % 4) + len; XMLCh *newStr = (XMLCh *)this->allocate(len); XMLString::copyString(newStr, src); return newStr; } XMLSize_t DOMDocumentImpl::getMemoryAllocationBlockSize() const { return fHeapAllocSize; } void DOMDocumentImpl::setMemoryAllocationBlockSize(XMLSize_t size) { // the new size must be bigger than the maximum amount of each allocation if(size>kMaxSubAllocationSize) fHeapAllocSize=size; } void DOMDocumentImpl::release(void* oldBuffer) { // only release blocks that are stored in a block by itself XMLSize_t sizeOfHeader = XMLPlatformUtils::alignPointerForNewBlockAllocation(sizeof(void *)); void** cursor = &fCurrentSingletonBlock; while (*cursor != 0) { void **nextBlock = (void **)(*cursor); if ((char*)(*cursor) + sizeOfHeader == oldBuffer) { // found: deallocate and replace the pointer value with the next block void* current = *cursor; *cursor = *nextBlock; fMemoryManager->deallocate(current); break; } cursor = nextBlock; } } void* DOMDocumentImpl::allocate(XMLSize_t amount) { // Align the request size so that suballocated blocks // beyond this one will be maintained at the same alignment. amount = XMLPlatformUtils::alignPointerForNewBlockAllocation(amount); // If the request is for a largish block, hand it off to the system // allocator. The block still must be linked into a special list of // allocated big blocks so that it will be deleted when the time comes. if (amount > kMaxSubAllocationSize) { // The size of the header we add to our raw blocks XMLSize_t sizeOfHeader = XMLPlatformUtils::alignPointerForNewBlockAllocation(sizeof(void *)); // Try to allocate the block void* newBlock = fMemoryManager->allocate(sizeOfHeader + amount); // Link it into the list beyond current block, as current block // is still being subdivided. If there is no current block // then track that we have no bytes to further divide. if (fCurrentSingletonBlock) { *(void **)newBlock = *(void **)fCurrentSingletonBlock; *(void **)fCurrentSingletonBlock = newBlock; } else { *(void **)newBlock = 0; fCurrentSingletonBlock = newBlock; } void *retPtr = (char*)newBlock + sizeOfHeader; return retPtr; } // It's a normal (sub-allocatable) request. // Are we out of room in our current block? if (amount > fFreeBytesRemaining) { // Request doesn't fit in the current block. // The size of the header we add to our raw blocks XMLSize_t sizeOfHeader = XMLPlatformUtils::alignPointerForNewBlockAllocation(sizeof(void *)); // Get a new block from the system allocator. void* newBlock; newBlock = fMemoryManager->allocate(fHeapAllocSize); *(void **)newBlock = fCurrentBlock; fCurrentBlock = newBlock; fFreePtr = (char *)newBlock + sizeOfHeader; fFreeBytesRemaining = fHeapAllocSize - sizeOfHeader; if(fHeapAllocSizedeallocate(fCurrentBlock); fCurrentBlock = nextBlock; } while (fCurrentSingletonBlock != 0) { void *nextBlock = *(void **)fCurrentSingletonBlock; fMemoryManager->deallocate(fCurrentSingletonBlock); fCurrentSingletonBlock = nextBlock; } } DOMNodeList *DOMDocumentImpl::getDeepNodeList(const DOMNode *rootNode, const XMLCh *tagName) { if(!fNodeListPool) { fNodeListPool = new (this) DOMDeepNodeListPool(109, false); } DOMDeepNodeListImpl* retList = fNodeListPool->getByKey(rootNode, tagName, 0); if (!retList) { XMLSize_t id = fNodeListPool->put((void*) rootNode, (XMLCh*) tagName, 0, new (this) DOMDeepNodeListImpl(rootNode, tagName)); retList = fNodeListPool->getById(id); } return retList; } DOMNodeList *DOMDocumentImpl::getDeepNodeList(const DOMNode *rootNode, //DOM Level 2 const XMLCh *namespaceURI, const XMLCh *localName) { if(!fNodeListPool) { fNodeListPool = new (this) DOMDeepNodeListPool(109, false); } DOMDeepNodeListImpl* retList = fNodeListPool->getByKey(rootNode, localName, namespaceURI); if (!retList) { // the pool will adopt the DOMDeepNodeListImpl XMLSize_t id = fNodeListPool->put((void*) rootNode, (XMLCh*) localName, (XMLCh*) namespaceURI, new (this) DOMDeepNodeListImpl(rootNode, namespaceURI, localName)); retList = fNodeListPool->getById(id); } return retList; } //Introduced in DOM Level 3 const XMLCh* DOMDocumentImpl::getInputEncoding() const { return fInputEncoding; } void DOMDocumentImpl::setInputEncoding(const XMLCh* actualEncoding){ fInputEncoding = cloneString(actualEncoding); } const XMLCh* DOMDocumentImpl::getXmlEncoding() const { return fXmlEncoding; } void DOMDocumentImpl::setXmlEncoding(const XMLCh* encoding){ fXmlEncoding = cloneString(encoding); } bool DOMDocumentImpl::getXmlStandalone() const{ return fXmlStandalone; } void DOMDocumentImpl::setXmlStandalone(bool standalone){ fXmlStandalone = standalone; } const XMLCh* DOMDocumentImpl::getXmlVersion() const { return fXmlVersion; } void DOMDocumentImpl::setXmlVersion(const XMLCh* version){ // store the static strings, so that comparisons will be faster if(version==0) fXmlVersion = 0; else if(*version==0) fXmlVersion = XMLUni::fgZeroLenString; else if(XMLString::equals(version, XMLUni::fgVersion1_0)) fXmlVersion = XMLUni::fgVersion1_0; else if(XMLString::equals(version, XMLUni::fgVersion1_1)) fXmlVersion = XMLUni::fgVersion1_1; else throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, getMemoryManager()); } const XMLCh* DOMDocumentImpl::getDocumentURI() const { return fDocumentURI; } void DOMDocumentImpl::setDocumentURI(const XMLCh* documentURI){ if (documentURI && *documentURI) { XMLCh* temp = (XMLCh*) this->allocate((XMLString::stringLen(documentURI) + 9)*sizeof(XMLCh)); XMLString::fixURI(documentURI, temp); fDocumentURI = temp; } else fDocumentURI = 0; } bool DOMDocumentImpl::getStrictErrorChecking() const { return getErrorChecking(); } void DOMDocumentImpl::setStrictErrorChecking(bool strictErrorChecking) { setErrorChecking(strictErrorChecking); } DOMNode* DOMDocumentImpl::adoptNode(DOMNode* sourceNode) { if(sourceNode->getOwnerDocument()!=this) { // cannot take ownership of a node created by another document, as it comes from its memory pool // and would be delete when the original document is deleted return 0; } // if the adopted node is already part of this document (i.e. the source and target document are the same), // this method still has the effect of removing the source node from the child list of its parent, if any switch(sourceNode->getNodeType()) { case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, getMemoryManager()); case ATTRIBUTE_NODE: { DOMAttr* sourceAttr=(DOMAttr*)sourceNode; DOMElement* sourceAttrElem=sourceAttr->getOwnerElement(); if(sourceAttrElem) sourceAttrElem->removeAttributeNode(sourceAttr); fNode.callUserDataHandlers(DOMUserDataHandler::NODE_ADOPTED, sourceNode, sourceNode); break; } default: { DOMNode* sourceNodeParent=sourceNode->getParentNode(); if(sourceNodeParent) sourceNodeParent->removeChild(sourceNode); fNode.callUserDataHandlers(DOMUserDataHandler::NODE_ADOPTED, sourceNode, sourceNode); } } return 0; } void DOMDocumentImpl::normalizeDocument() { if(!fNormalizer) fNormalizer = new (fMemoryManager) DOMNormalizer(fMemoryManager); fNormalizer->normalizeDocument(this); } DOMConfiguration* DOMDocumentImpl::getDOMConfig() const { if(!fDOMConfiguration) ((DOMDocumentImpl*)this)->fDOMConfiguration = new ((DOMDocumentImpl*)this) DOMConfigurationImpl(fMemoryManager); return fDOMConfiguration; } DOMNode *DOMDocumentImpl::importNode(const DOMNode *source, bool deep, bool cloningDoc) { DOMNode *newnode=0; bool oldErrorCheckingFlag = errorChecking; switch (source->getNodeType()) { case DOMNode::ELEMENT_NODE : { DOMElement *newelement; if (source->getLocalName() == 0) newelement = createElement(source->getNodeName()); else { DOMElementNSImpl* nsElem = (DOMElementNSImpl*)createElementNS(source->getNamespaceURI(), source->getNodeName()); DOMTypeInfoImpl* clonedTypeInfo=NULL; // if the source has type informations, copy them DOMPSVITypeInfo* sourcePSVI=(DOMPSVITypeInfo*)source->getFeature(XMLUni::fgXercescInterfacePSVITypeInfo, 0); if(sourcePSVI && sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Schema_Specified)) clonedTypeInfo=new (this) DOMTypeInfoImpl(this, sourcePSVI); else { const DOMTypeInfo * typeInfo=((DOMElement*)source)->getSchemaTypeInfo(); // copy it only if it has valid data if(typeInfo && typeInfo->getTypeName()!=NULL) clonedTypeInfo=new (this) DOMTypeInfoImpl(typeInfo->getTypeNamespace(), typeInfo->getTypeName()); } if(clonedTypeInfo) nsElem->setSchemaTypeInfo(clonedTypeInfo); newelement=nsElem; } DOMNamedNodeMap *srcattr=source->getAttributes(); if(srcattr!=0) for(XMLSize_t i=0;igetLength();++i) { DOMAttr *attr = (DOMAttr *) srcattr->item(i); if (attr -> getSpecified() || cloningDoc) { // not a default attribute or we are in the process of cloning the elements from inside a DOMDocumentType DOMAttr *nattr = (DOMAttr *) importNode(attr, true, cloningDoc); if (attr -> getLocalName() == 0) newelement->setAttributeNode(nattr); else newelement->setAttributeNodeNS(nattr); // if the imported attribute is of ID type, register the new node in fNodeIDMap if (attr->isId()) { castToNodeImpl(nattr)->isIdAttr(true); if (!fNodeIDMap) fNodeIDMap = new (this) DOMNodeIDMap(500, this); fNodeIDMap->add((DOMAttr*)nattr); } } } newnode=newelement; } break; case DOMNode::ATTRIBUTE_NODE : { DOMAttrImpl* newattr=NULL; if (source->getLocalName() == 0) newattr = (DOMAttrImpl*)createAttribute(source->getNodeName()); else { newattr = (DOMAttrImpl*)createAttributeNS(source->getNamespaceURI(), source->getNodeName()); } DOMTypeInfoImpl* clonedTypeInfo=NULL; // if the source has type informations, copy them DOMPSVITypeInfo* sourcePSVI=(DOMPSVITypeInfo*)source->getFeature(XMLUni::fgXercescInterfacePSVITypeInfo, 0); if(sourcePSVI && sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Schema_Specified)) clonedTypeInfo=new (this) DOMTypeInfoImpl(this, sourcePSVI); else { const DOMTypeInfo * typeInfo=((DOMAttr*)source)->getSchemaTypeInfo(); // copy it only if it has valid data if(typeInfo && typeInfo->getTypeName()!=NULL) clonedTypeInfo=new (this) DOMTypeInfoImpl(typeInfo->getTypeNamespace(), typeInfo->getTypeName()); } if(clonedTypeInfo) newattr->setSchemaTypeInfo(clonedTypeInfo); newnode=newattr; } deep = true; // Kids carry value break; case DOMNode::TEXT_NODE : newnode = createTextNode(source->getNodeValue()); break; case DOMNode::CDATA_SECTION_NODE : newnode = createCDATASection(source->getNodeValue()); break; case DOMNode::ENTITY_REFERENCE_NODE : { DOMEntityReferenceImpl* newentityRef = (DOMEntityReferenceImpl*)createEntityReference(source->getNodeName()); newnode=newentityRef; // Only the EntityReference itself is copied, even if a deep import is requested, since the source and // destination documents might have defined the entity differently. deep = false; } break; case DOMNode::ENTITY_NODE : { DOMEntity *srcentity=(DOMEntity *)source; DOMEntityImpl *newentity = (DOMEntityImpl *)createEntity(source->getNodeName()); newentity->setPublicId(srcentity->getPublicId()); newentity->setSystemId(srcentity->getSystemId()); newentity->setNotationName(srcentity->getNotationName()); newentity->setBaseURI(srcentity->getBaseURI()); // Kids carry additional value newnode=newentity; castToNodeImpl(newentity)->setReadOnly(false, true);// allow deep import temporarily } break; case DOMNode::PROCESSING_INSTRUCTION_NODE : newnode = createProcessingInstruction(source->getNodeName(), source->getNodeValue()); break; case DOMNode::COMMENT_NODE : newnode = createComment(source->getNodeValue()); break; case DOMNode::DOCUMENT_TYPE_NODE : { // unless this is used as part of cloning a Document // forbid it for the sake of being compliant to the DOM spec if (!cloningDoc) throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, getMemoryManager()); DOMDocumentType *srcdoctype = (DOMDocumentType *)source; DOMDocumentTypeImpl *newdoctype = (DOMDocumentTypeImpl *) createDocumentType(srcdoctype->getNodeName(), srcdoctype->getPublicId(), srcdoctype->getSystemId()); // Values are on NamedNodeMaps DOMNamedNodeMap *smap = srcdoctype->getEntities(); DOMNamedNodeMap *tmap = newdoctype->getEntities(); if(smap != 0) { for(XMLSize_t i = 0; i < smap->getLength(); i++) { tmap->setNamedItem(importNode(smap->item(i), true, cloningDoc)); } } smap = srcdoctype->getNotations(); tmap = newdoctype->getNotations(); if (smap != 0) { for(XMLSize_t i = 0; i < smap->getLength(); i++) { tmap->setNamedItem(importNode(smap->item(i), true, cloningDoc)); } } const XMLCh* intSubset=srcdoctype->getInternalSubset(); if(intSubset != 0) { newdoctype->setInternalSubset(intSubset); } // detect if the DTD being copied is our own implementation, and use the provided methods try { DOMDocumentTypeImpl* docTypeImpl=(DOMDocumentTypeImpl*)(srcdoctype->getFeature(XMLUni::fgXercescInterfaceDOMDocumentTypeImpl, XMLUni::fgZeroLenString)); if(docTypeImpl) { smap = docTypeImpl->getElements(); tmap = newdoctype->getElements(); if (smap != 0) { for(XMLSize_t i = 0; i < smap->getLength(); i++) { tmap->setNamedItem(importNode(smap->item(i), true, cloningDoc)); } } } } catch(DOMException&) { } newnode = newdoctype; } break; case DOMNode::DOCUMENT_FRAGMENT_NODE : newnode = createDocumentFragment(); // No name, kids carry value break; case DOMNode::NOTATION_NODE : { DOMNotation *srcnotation=(DOMNotation *)source; DOMNotationImpl *newnotation = (DOMNotationImpl *)createNotation(source->getNodeName()); newnotation->setPublicId(srcnotation->getPublicId()); newnotation->setSystemId(srcnotation->getSystemId()); newnotation->setBaseURI(srcnotation->getBaseURI()); newnode=newnotation; // No name, no value break; } case DOMNode::DOCUMENT_NODE : // Document can't be child of Document default: // Unknown node type throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, getMemoryManager()); } // If deep, replicate and attach the kids. if (deep) for (DOMNode *srckid = source->getFirstChild(); srckid != 0; srckid = srckid->getNextSibling()) { newnode->appendChild(importNode(srckid, true, cloningDoc)); } if (newnode->getNodeType() == DOMNode::ENTITY_NODE) { castToNodeImpl(newnode)->setReadOnly(true, true); errorChecking = oldErrorCheckingFlag; } if (cloningDoc) { // we know for sure that the source node is a DOMNodeImpl, as cloningDoc is set to true when // a DOMDocumentImpl is cloned castToNodeImpl(source)->callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, source, newnode); } else fNode.callUserDataHandlers(DOMUserDataHandler::NODE_IMPORTED, source, newnode); return newnode; } // user data utility void* DOMDocumentImpl::setUserData(DOMNodeImpl* n, const XMLCh* key, void* data, DOMUserDataHandler* handler) { void* oldData = 0; unsigned int keyId=fUserDataTableKeys.addOrFind(key); if (!fUserDataTable) { // create the table on heap so that it can be cleaned in destructor fUserDataTable = new (fMemoryManager) RefHash2KeysTableOf ( 109 , true , fMemoryManager ); } else { DOMUserDataRecord* oldDataRecord = fUserDataTable->get((void*)n, keyId); if (oldDataRecord) { oldData = oldDataRecord->getKey(); fUserDataTable->removeKey((void*)n, keyId); } } if (data) { // clone the key first, and create the DOMUserDataRecord // create on the heap and adopted by the hashtable which will delete it upon removal. fUserDataTable->put((void*)n, keyId, new (fMemoryManager) DOMUserDataRecord(data, handler)); } else { RefHash2KeysTableOfEnumerator enumKeys(fUserDataTable, false, fMemoryManager); enumKeys.setPrimaryKey(n); if (!enumKeys.hasMoreElements()) n->hasUserData(false); } return oldData; } void* DOMDocumentImpl::getUserData(const DOMNodeImpl* n, const XMLCh* key) const { if (fUserDataTable) { unsigned int keyId=fUserDataTableKeys.getId(key); if(keyId!=0) { DOMUserDataRecord* dataRecord = fUserDataTable->get((void*)n, keyId); if (dataRecord) return dataRecord->getKey(); } } return 0; } void DOMDocumentImpl::callUserDataHandlers(const DOMNodeImpl* n, DOMUserDataHandler::DOMOperationType operation, const DOMNode* src, DOMNode* dst) const { if (fUserDataTable) { RefHash2KeysTableOfEnumerator userDataEnum(fUserDataTable, false, fMemoryManager); userDataEnum.setPrimaryKey(n); // Create a snapshot of the handlers to be called, as the "handle" callback could be invalidating the enumerator by calling // setUserData on the dst node ValueVectorOf< int > snapshot(3, fMemoryManager); while (userDataEnum.hasMoreElements()) { // get the key void* key; int key2; userDataEnum.nextElementKey(key,key2); snapshot.addElement(key2); } ValueVectorEnumerator< int > snapshotEnum(&snapshot); while(snapshotEnum.hasMoreElements()) { int key2=snapshotEnum.nextElement(); // get the DOMUserDataRecord DOMUserDataRecord* userDataRecord = fUserDataTable->get((void*)n,key2); // get the handler DOMUserDataHandler* handler = userDataRecord->getValue(); if (handler) { // get the data void* data = userDataRecord->getKey(); const XMLCh* userKey = fUserDataTableKeys.getValueForId(key2); handler->handle(operation, userKey, data, src, dst); } } // if the operation is NODE_DELETED, we in fact should remove the data from the table if (operation == DOMUserDataHandler::NODE_DELETED) fUserDataTable->removeKey((void*)n); } } void DOMDocumentImpl::transferUserData(DOMNodeImpl* n1, DOMNodeImpl* n2) { if (fUserDataTable) { fUserDataTable->transferElement((void*)n1, (void*)n2); n1->hasUserData(false); n2->hasUserData(true); } } DOMNode* DOMDocumentImpl::renameNode(DOMNode* n, const XMLCh* namespaceURI, const XMLCh* name) { if (n->getOwnerDocument() != this) throw DOMException(DOMException::WRONG_DOCUMENT_ERR, 0, getMemoryManager()); switch (n->getNodeType()) { case ELEMENT_NODE: return ((DOMElementImpl*)n)->rename(namespaceURI, name); case ATTRIBUTE_NODE: return ((DOMAttrImpl*)n)->rename(namespaceURI, name); default: break; } throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, getMemoryManager()); return 0; } void DOMDocumentImpl::release() { DOMDocument* doc = (DOMDocument*) this; fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0); // notify userdatahandler first, if we have some if (fUserDataTable) releaseDocNotifyUserData(this); // release the docType in case it was created from heap if (fDocType) { castToNodeImpl(fDocType)->isToBeReleased(true); fDocType->release(); } // delete the document memory pool delete doc; } void DOMDocumentImpl::releaseDocNotifyUserData(DOMNode* object) { DOMNode *child = object->getFirstChild(); while( child != 0) { DOMNamedNodeMap *attrlist=child->getAttributes(); if(attrlist!=0) for(XMLSize_t i=0;igetLength();++i) releaseDocNotifyUserData(attrlist->item(i)); releaseDocNotifyUserData(child); child = child->getNextSibling(); } castToNodeImpl(object)->callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0); } void DOMDocumentImpl::release(DOMNode* object, DOMMemoryManager::NodeObjectType type) { if (!fRecycleNodePtr) fRecycleNodePtr = new (fMemoryManager) RefArrayOf (15, fMemoryManager); if (!fRecycleNodePtr->operator[](type)) fRecycleNodePtr->operator[](type) = new (fMemoryManager) RefStackOf (15, false, fMemoryManager); fRecycleNodePtr->operator[](type)->push(object); } void DOMDocumentImpl::releaseBuffer(DOMBuffer* buffer) { if (!fRecycleBufferPtr) fRecycleBufferPtr = new (fMemoryManager) RefStackOf (15, false, fMemoryManager); fRecycleBufferPtr->push(buffer); } DOMBuffer* DOMDocumentImpl::popBuffer(XMLSize_t nMinSize) { if (!fRecycleBufferPtr || fRecycleBufferPtr->empty()) return 0; for(XMLSize_t index=fRecycleBufferPtr->size()-1;index>0;index--) if(fRecycleBufferPtr->elementAt(index)->getCapacity()>=nMinSize) return fRecycleBufferPtr->popAt(index); // if we didn't find a buffer big enough, get the last one return fRecycleBufferPtr->pop(); } void * DOMDocumentImpl::allocate(XMLSize_t amount, DOMMemoryManager::NodeObjectType type) { if (!fRecycleNodePtr) return allocate(amount); DOMNodePtr* ptr = fRecycleNodePtr->operator[](type); if (!ptr || ptr->empty()) return allocate(amount); return (void*) ptr->pop(); } bool DOMDocumentImpl::isSupported(const XMLCh *feature, const XMLCh *version) const { // check for '+DOMMemoryManager' if(feature && *feature=='+' && XMLString::equals(feature+1, XMLUni::fgXercescInterfaceDOMMemoryManager)) return true; if(feature && *feature) { if((*feature==chPlus && XMLString::equals(feature+1, XMLUni::fgXercescInterfaceDOMDocumentImpl)) || XMLString::equals(feature, XMLUni::fgXercescInterfaceDOMDocumentImpl)) return true; } return fNode.isSupported (feature, version); } void* DOMDocumentImpl::getFeature(const XMLCh* feature, const XMLCh* version) const { if(XMLString::equals(feature, XMLUni::fgXercescInterfaceDOMMemoryManager)) return (DOMMemoryManager*)this; if(XMLString::equals(feature, XMLUni::fgXercescInterfaceDOMDocumentImpl)) return (DOMDocumentImpl*)this; return fNode.getFeature(feature,version); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMConfigurationImpl.hpp000644 000765 000024 00000012374 13241160337 024517 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #if !defined(XERCESC_INCLUDE_GUARD_DOMCONFIGURATIONIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMCONFIGURATIONIMPL_HPP //------------------------------------------------------------------------------------ // Includes //------------------------------------------------------------------------------------ #include #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMDocumentImpl; class DOMStringListImpl; class CDOM_EXPORT DOMConfigurationImpl : public DOMConfiguration { private: //unimplemented DOMConfigurationImpl(const DOMConfiguration &); DOMConfigurationImpl & operator = (const DOMConfiguration &); public: //----------------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------------- DOMConfigurationImpl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~DOMConfigurationImpl(); enum DOMConfigurationFeature { FEATURE_CANONICAL_FORM = 0x0001, FEATURE_CDATA_SECTIONS = 0x0002, FEATURE_COMMENTS = 0x0004, FEATURE_DATATYPE_NORMALIZATION = 0x0008, FEATURE_DISCARD_DEFAULT_CONTENT = 0x0010, FEATURE_ENTITIES = 0x0020, FEATURE_INFOSET = 0x0040, FEATURE_NAMESPACES = 0x0080, FEATURE_NAMESPACE_DECLARATIONS = 0x0100, FEATURE_NORMALIZE_CHARACTERS = 0x0200, FEATURE_SPLIT_CDATA_SECTIONS = 0x0400, FEATURE_VALIDATE = 0x0800, FEATURE_VALIDATE_IF_SCHEMA = 0x1000, FEATURE_ELEMENT_CONTENT_WHITESPACE = 0x2000 }; unsigned short featureValues; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- virtual void setParameter(const XMLCh* name, const void* value); virtual void setParameter(const XMLCh* name, bool value); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- virtual const void* getParameter(const XMLCh* name) const; // ----------------------------------------------------------------------- // Query methods // ----------------------------------------------------------------------- virtual bool canSetParameter(const XMLCh* name, const void* value) const; virtual bool canSetParameter(const XMLCh* name, bool value) const; virtual const DOMStringList* getParameterNames() const; // --------------------------------------------------------------------------- // Impl specific methods // --------------------------------------------------------------------------- /* specific get and set methods for non-boolean parameters * */ DOMErrorHandler* getErrorHandler() const; const XMLCh* getSchemaType() const; const XMLCh* getSchemaLocation() const; void setErrorHandler(DOMErrorHandler *erHandler); void setSchemaType(const XMLCh* st); void setSchemaLocation(const XMLCh* sl); // The default values for the boolean parameters // from CANONICAL_FORM to ELEMENT_CONTENT_WHITESPACE // 10010110010110 = 0x2596 static const unsigned short fDEFAULT_VALUES; protected: // implements a simple map between the name and its enum value DOMConfigurationFeature getFeatureFlag(const XMLCh* name) const; // the error handler DOMErrorHandler* fErrorHandler; // the schema type const XMLCh* fSchemaType; // the schema location const XMLCh* fSchemaLocation; // the list of supported parameters DOMStringListImpl* fSupportedParameters; MemoryManager* fMemoryManager; }; XERCES_CPP_NAMESPACE_END #endif /** * End of file DOMConfigurationImpl.hpp */ xerces-c-3.2.2/src/xercesc/dom/impl/DOMLocatorImpl.hpp000644 000765 000024 00000011471 13241160337 023310 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLocatorImpl.hpp 676853 2008-07-15 09:58:05Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMLOCATORIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMLOCATORIMPL_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Introduced in DOM Level 3 * * Implementation of a DOMLocator interface. * * @see DOMLocator#DOMLocator */ class CDOM_EXPORT DOMLocatorImpl : public DOMLocator { public: /** @name Constructors and Destructor */ //@{ /** Constructor */ DOMLocatorImpl(); DOMLocatorImpl ( const XMLFileLoc lineNum , const XMLFileLoc columnNum , DOMNode* const errorNode , const XMLCh* const uri , const XMLFilePos offset = ~(XMLFilePos(0)) , const XMLFilePos utf16Offset = ~(XMLFilePos(0)) ); /** Desctructor */ virtual ~DOMLocatorImpl(); //@} // DOMLocator interface virtual XMLFileLoc getLineNumber() const; virtual XMLFileLoc getColumnNumber() const; virtual XMLFilePos getByteOffset() const; virtual XMLFilePos getUtf16Offset() const; virtual DOMNode* getRelatedNode() const; virtual const XMLCh* getURI() const; // Setter functions void setLineNumber(const XMLFileLoc lineNumber); void setColumnNumber(const XMLFileLoc columnNumber); void setByteOffset(const XMLFilePos offset); void setUtf16Offset(const XMLFilePos offset); void setRelatedNode(DOMNode* const errorNode); void setURI(const XMLCh* const uri); private : /* Unimplemented constructors and operators */ /* Copy constructor */ DOMLocatorImpl(const DOMLocatorImpl&); /* Assignment operator */ DOMLocatorImpl& operator=(const DOMLocatorImpl&); protected: // ----------------------------------------------------------------------- // Private data members // // fLineNum // fColumnNum // Track line/column number of where the error occured // // fByteOffset // Track byte offset in the input source where the error // occured // // fUtf16Offset // Track character offset in the input source where the error // occured // // fRelatedNode // Current node where the error occured // // fURI // The uri where the error occured // ----------------------------------------------------------------------- XMLFileLoc fLineNum; XMLFileLoc fColumnNum; XMLFilePos fByteOffset; XMLFilePos fUtf16Offset; DOMNode* fRelatedNode; const XMLCh* fURI; }; // --------------------------------------------------------------------------- // DOMLocatorImpl: Getter methods // --------------------------------------------------------------------------- inline XMLFileLoc DOMLocatorImpl::getLineNumber() const { return fLineNum; } inline XMLFileLoc DOMLocatorImpl::getColumnNumber() const { return fColumnNum; } inline XMLFilePos DOMLocatorImpl::getByteOffset() const { return fByteOffset; } inline XMLFilePos DOMLocatorImpl::getUtf16Offset() const { return fUtf16Offset; } inline DOMNode* DOMLocatorImpl::getRelatedNode() const { return fRelatedNode; } inline const XMLCh* DOMLocatorImpl::getURI() const { return fURI; } // --------------------------------------------------------------------------- // DOMLocatorImpl: Setter methods // --------------------------------------------------------------------------- inline void DOMLocatorImpl::setLineNumber(const XMLFileLoc lineNumber) { fLineNum = lineNumber; } inline void DOMLocatorImpl::setColumnNumber(const XMLFileLoc columnNumber) { fColumnNum = columnNumber; } inline void DOMLocatorImpl::setByteOffset(const XMLFilePos offset) { fByteOffset = offset; } inline void DOMLocatorImpl::setUtf16Offset(const XMLFilePos offset) { fUtf16Offset = offset; } inline void DOMLocatorImpl::setRelatedNode(DOMNode* const errorNode) { fRelatedNode = errorNode; } inline void DOMLocatorImpl::setURI(const XMLCh* const uri) { fURI = uri; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMCommentImpl.cpp000644 000765 000024 00000023627 13241160337 023310 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMCommentImpl.cpp 1800911 2017-07-05 18:52:15Z scantor $ */ #include "DOMCommentImpl.hpp" #include "DOMCharacterDataImpl.hpp" #include "DOMStringPool.hpp" #include "DOMCasts.hpp" #include "DOMDocumentImpl.hpp" #include "DOMRangeImpl.hpp" #include #include #include XERCES_CPP_NAMESPACE_BEGIN DOMCommentImpl::DOMCommentImpl(DOMDocument *ownerDoc, const XMLCh *dat) : fNode(this, ownerDoc), fCharacterData(ownerDoc, dat) { fNode.setIsLeafNode(true); } DOMCommentImpl::DOMCommentImpl(const DOMCommentImpl &other, bool) : fNode(this, other.fNode), fChild(other.fChild), fCharacterData(other.fCharacterData) { fNode.setIsLeafNode(true); } DOMCommentImpl::~DOMCommentImpl() { } DOMNode * DOMCommentImpl::cloneNode(bool deep) const { DOMNode* newNode = new (getOwnerDocument(), DOMMemoryManager::COMMENT_OBJECT) DOMCommentImpl(*this, deep); fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode); return newNode; } const XMLCh * DOMCommentImpl::getNodeName() const { static const XMLCh gComment[] = {chPound, chLatin_c, chLatin_o, chLatin_m, chLatin_m, chLatin_e,chLatin_n, chLatin_t, 0}; return gComment; } DOMNode::NodeType DOMCommentImpl::getNodeType() const { return DOMNode::COMMENT_NODE; } void DOMCommentImpl::release() { if (fNode.isOwned() && !fNode.isToBeReleased()) throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument(); if (doc) { fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0); fCharacterData.releaseBuffer(); doc->release(this, DOMMemoryManager::COMMENT_OBJECT); } else { // shouldn't reach here throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); } } // Non standard extension for the range to work DOMComment *DOMCommentImpl::splitText(XMLSize_t offset) { if (fNode.isReadOnly()) { throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); } XMLSize_t len = fCharacterData.fDataBuf->getLen(); if (offset > len) throw DOMException(DOMException::INDEX_SIZE_ERR, 0, GetDOMNodeMemoryManager); DOMDocumentImpl *doc = (DOMDocumentImpl *)getOwnerDocument(); DOMComment *newText = doc->createComment(this->substringData(offset, len - offset)); DOMNode *parent = getParentNode(); if (parent != 0) parent->insertBefore(newText, getNextSibling()); fCharacterData.fDataBuf->chop(offset); if (doc != 0) { Ranges* ranges = doc->getRanges(); if (ranges != 0) { XMLSize_t sz = ranges->size(); if (sz != 0) { for (XMLSize_t i =0; ielementAt(i)->updateSplitInfo( this, newText, offset); } } } } return newText; } DOMNode* DOMCommentImpl::appendChild(DOMNode *newChild) {return fNode.appendChild (newChild); } DOMNamedNodeMap* DOMCommentImpl::getAttributes() const {return fNode.getAttributes (); } DOMNodeList* DOMCommentImpl::getChildNodes() const {return fNode.getChildNodes (); } DOMNode* DOMCommentImpl::getFirstChild() const {return fNode.getFirstChild (); } DOMNode* DOMCommentImpl::getLastChild() const {return fNode.getLastChild (); } const XMLCh* DOMCommentImpl::getLocalName() const {return fNode.getLocalName (); } const XMLCh* DOMCommentImpl::getNamespaceURI() const {return fNode.getNamespaceURI (); } DOMNode* DOMCommentImpl::getNextSibling() const {return fChild.getNextSibling (); } const XMLCh* DOMCommentImpl::getNodeValue() const {return fCharacterData.getNodeValue (); } DOMDocument* DOMCommentImpl::getOwnerDocument() const {return fNode.getOwnerDocument (); } const XMLCh* DOMCommentImpl::getPrefix() const {return fNode.getPrefix (); } DOMNode* DOMCommentImpl::getParentNode() const {return fChild.getParentNode (this); } DOMNode* DOMCommentImpl::getPreviousSibling() const {return fChild.getPreviousSibling (this); } bool DOMCommentImpl::hasChildNodes() const {return fNode.hasChildNodes (); } DOMNode* DOMCommentImpl::insertBefore(DOMNode *newChild, DOMNode *refChild) {return fNode.insertBefore (newChild, refChild); } void DOMCommentImpl::normalize() {fNode.normalize (); } DOMNode* DOMCommentImpl::removeChild(DOMNode *oldChild) {return fNode.removeChild (oldChild); } DOMNode* DOMCommentImpl::replaceChild(DOMNode *newChild, DOMNode *oldChild) {return fNode.replaceChild (newChild, oldChild); } bool DOMCommentImpl::isSupported(const XMLCh *feature, const XMLCh *version) const {return fNode.isSupported (feature, version); } void DOMCommentImpl::setPrefix(const XMLCh *prefix) {fNode.setPrefix(prefix); } bool DOMCommentImpl::hasAttributes() const {return fNode.hasAttributes(); } bool DOMCommentImpl::isSameNode(const DOMNode* other) const {return fNode.isSameNode(other); } bool DOMCommentImpl::isEqualNode(const DOMNode* arg) const {return fNode.isEqualNode(arg); } void* DOMCommentImpl::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) {return fNode.setUserData(key, data, handler); } void* DOMCommentImpl::getUserData(const XMLCh* key) const {return fNode.getUserData(key); } const XMLCh* DOMCommentImpl::getBaseURI() const {return fNode.getBaseURI(); } short DOMCommentImpl::compareDocumentPosition(const DOMNode* other) const {return fNode.compareDocumentPosition(other); } const XMLCh* DOMCommentImpl::getTextContent() const {return fNode.getTextContent(); } void DOMCommentImpl::setTextContent(const XMLCh* textContent){fNode.setTextContent(textContent); } const XMLCh* DOMCommentImpl::lookupPrefix(const XMLCh* namespaceURI) const {return fNode.lookupPrefix(namespaceURI); } bool DOMCommentImpl::isDefaultNamespace(const XMLCh* namespaceURI) const {return fNode.isDefaultNamespace(namespaceURI); } const XMLCh* DOMCommentImpl::lookupNamespaceURI(const XMLCh* prefix) const {return fNode.lookupNamespaceURI(prefix); } void* DOMCommentImpl::getFeature(const XMLCh* feature, const XMLCh* version) const {return fNode.getFeature(feature, version); } // // Delegation of CharacerData functions. // const XMLCh* DOMCommentImpl::getData() const {return fCharacterData.getData();} XMLSize_t DOMCommentImpl::getLength() const {return fCharacterData.getLength();} const XMLCh* DOMCommentImpl::substringData(XMLSize_t offset, XMLSize_t count) const {return fCharacterData.substringData(this, offset, count);} void DOMCommentImpl::appendData(const XMLCh *arg) {fCharacterData.appendData(this, arg);} void DOMCommentImpl::insertData(XMLSize_t offset, const XMLCh *arg) {fCharacterData.insertData(this, offset, arg);} void DOMCommentImpl::deleteData(XMLSize_t offset, XMLSize_t count) {fCharacterData.deleteData(this, offset, count);} void DOMCommentImpl::replaceData(XMLSize_t offset, XMLSize_t count, const XMLCh *arg) {fCharacterData.replaceData(this, offset, count, arg);} void DOMCommentImpl::setData(const XMLCh *data) {fCharacterData.setData(this, data);} void DOMCommentImpl::setNodeValue(const XMLCh *nodeValue) {fCharacterData.setNodeValue (this, nodeValue); } // Macro-in implementation accessors. DOMNODEIMPL_IMPL(DOMCommentImpl); DOMCHILDIMPL_IMPL(DOMCommentImpl); XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMNormalizer.hpp000644 000765 000024 00000013021 13241160337 023176 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNormalizer.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMNORMALIZER_HPP) #define XERCESC_INCLUDE_GUARD_DOMNORMALIZER_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMConfigurationImpl; class DOMErrorHandler; class DOMDocumentImpl; class DOMNode; class DOMElementImpl; class DOMAttr; class DOMNamedNodeMap; class DOMNormalizer : public XMemory { //the following are the data structures maintain the stack of namespace information class InScopeNamespaces : public XMemory { class Scope : public XMemory { public: Scope(Scope *baseScopeWithBindings); ~Scope(); void addOrChangeBinding(const XMLCh *prefix, const XMLCh *uri, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); const XMLCh* getUri(const XMLCh *prefix) const; const XMLCh* getPrefix(const XMLCh* uri) const; Scope *fBaseScopeWithBindings; private: RefHashTableOf *fPrefixHash; RefHashTableOf *fUriHash; // unimplemented Scope ( const Scope& toCopy); Scope& operator= (const Scope& other); }; public: InScopeNamespaces(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~InScopeNamespaces(); void addOrChangeBinding(const XMLCh *prefix, const XMLCh *uri, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); void addScope(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); void removeScope(); bool isValidBinding(const XMLCh* prefix, const XMLCh* uri) const; const XMLCh* getOrDeclarePrefix(const XMLCh* uri); const XMLCh* getPrefix(const XMLCh* uri) const; const XMLCh* getUri(const XMLCh* prefix) const; XMLSize_t size(); private: RefVectorOf *fScopes; Scope *lastScopeWithBindings; // unimplemented InScopeNamespaces ( const InScopeNamespaces& toCopy); InScopeNamespaces& operator= (const InScopeNamespaces& other); }; public: DOMNormalizer(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~DOMNormalizer(); /** * Main entry method to normalize a document */ void normalizeDocument(DOMDocumentImpl *doc); private: // unimplemented DOMNormalizer ( const DOMNormalizer& toCopy); DOMNormalizer& operator= (const DOMNormalizer& other); protected: /** * Recursively normalizes a node */ DOMNode * normalizeNode(DOMNode *node) const; /** * Helper method that fixes up the namespace declarations according to the * DOM Level 3 psydocode */ void namespaceFixUp(DOMElementImpl *ele) const; /** * Converts an integer to an XMLCh - max 15 digits long. */ const XMLCh * integerToXMLCh(unsigned int i) const; /** * Adds a namespace attribute or replaces the value of existing namespace * attribute with the given prefix and value for URI. * In case prefix is empty will add/update default namespace declaration. */ void addOrChangeNamespaceDecl(const XMLCh* prefix, const XMLCh* uri, DOMElementImpl *element) const; /** * Adds a custom namespace in the form "NSx" where x is an integer that * has not yet used in the document */ const XMLCh* addCustomNamespaceDecl(const XMLCh* uri, DOMElementImpl *element) const; /** * Report an error */ void error(const XMLErrs::Codes code, const DOMNode *node) const; // // fDocument - the document we are operating on // // fDOMConfiguration - the configuration from the document // // fErrorHandler - the errorhandler to be used when reporting errors during normalization // // fNSScope - the data stucture that holds the prefix-uri information // // fNewNamespaceCount - the number of custom namespace declarations we have created // DOMDocumentImpl *fDocument; DOMConfigurationImpl *fConfiguration; DOMErrorHandler *fErrorHandler; InScopeNamespaces *fNSScope; unsigned int fNewNamespaceCount; MemoryManager* fMemoryManager; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/XSDElementNSImpl.hpp000644 000765 000024 00000004677 13241160337 023570 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSDElementNSImpl.hpp 672232 2008-06-27 10:16:38Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSDELEMENTNSIMPL_HPP) #define XERCESC_INCLUDE_GUARD_XSDELEMENTNSIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It is used by TraverseSchema to store line/column information. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include "DOMElementNSImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN class CDOM_EXPORT XSDElementNSImpl: public DOMElementNSImpl { protected: XMLFileLoc fLineNo; //Line number XMLFileLoc fColumnNo; //Column number public: XSDElementNSImpl(DOMDocument *ownerDoc, const XMLCh *name); XSDElementNSImpl(DOMDocument *ownerDoc, //DOM Level 2 const XMLCh *namespaceURI, const XMLCh *qualifiedName, const XMLFileLoc lineNo, const XMLFileLoc columnNo); XSDElementNSImpl(const XSDElementNSImpl &other, bool deep=false); virtual DOMNode * cloneNode(bool deep) const; XMLFileLoc getLineNo() const { return fLineNo; } XMLFileLoc getColumnNo() const { return fColumnNo; } private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSDElementNSImpl& operator=(const XSDElementNSImpl&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMLSInputImpl.hpp000644 000765 000024 00000007224 13241160337 023244 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLSInputImpl.hpp 641193 2008-03-26 08:06:57Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMLSINPUTIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMLSINPUTIMPL_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class CDOM_EXPORT DOMLSInputImpl : public XMemory, public DOMLSInput { public: DOMLSInputImpl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~DOMLSInputImpl(); virtual const XMLCh* getStringData() const; virtual InputSource* getByteStream() const; virtual const XMLCh* getEncoding() const; virtual const XMLCh* getPublicId() const; virtual const XMLCh* getSystemId() const; virtual const XMLCh* getBaseURI() const; virtual void setStringData(const XMLCh* data); virtual void setByteStream(InputSource* stream); virtual void setEncoding(const XMLCh* const encodingStr); virtual void setPublicId(const XMLCh* const publicId); virtual void setSystemId(const XMLCh* const systemId); virtual void setBaseURI(const XMLCh* const baseURI); virtual void setIssueFatalErrorIfNotFound(bool flag); virtual bool getIssueFatalErrorIfNotFound() const; virtual void release(); private: /** unimplemented copy ctor and assignment operator */ DOMLSInputImpl(const DOMLSInputImpl&); DOMLSInputImpl & operator = (const DOMLSInputImpl&); protected: // ----------------------------------------------------------------------- // Private data members // // fStringData // We don't own it // // fByteStream // We don't own it // // fEncoding // We own it // // fPublicId // We own it // // fSystemId // We own it // // fBaseURI // We own it // // ----------------------------------------------------------------------- const XMLCh *fStringData; InputSource *fByteStream; XMLCh *fEncoding; XMLCh *fPublicId; XMLCh *fSystemId; XMLCh *fBaseURI; bool fIssueFatalErrorIfNotFound; MemoryManager* fMemoryManager; }; inline const XMLCh* DOMLSInputImpl::getStringData() const { return fStringData; } inline InputSource* DOMLSInputImpl::getByteStream() const { return fByteStream; } inline const XMLCh* DOMLSInputImpl::getEncoding() const { return fEncoding; } inline const XMLCh* DOMLSInputImpl::getPublicId() const { return fPublicId; } inline const XMLCh* DOMLSInputImpl::getSystemId() const { return fSystemId; } inline const XMLCh* DOMLSInputImpl::getBaseURI() const { return fBaseURI; } inline bool DOMLSInputImpl::getIssueFatalErrorIfNotFound() const { return fIssueFatalErrorIfNotFound; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMTypeInfoImpl.cpp000644 000765 000024 00000023221 13241160337 023431 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "DOMTypeInfoImpl.hpp" #include "DOMDocumentImpl.hpp" #include #include XERCES_CPP_NAMESPACE_BEGIN /*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedElement; /*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdNotValidatedAttribute; /*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedCDATAAttribute(XMLUni::fgInfosetURIName, XMLUni::fgCDATAString); /*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedIDAttribute(XMLUni::fgInfosetURIName, XMLUni::fgIDString); /*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedIDREFAttribute(XMLUni::fgInfosetURIName, XMLUni::fgIDRefString); /*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedIDREFSAttribute(XMLUni::fgInfosetURIName, XMLUni::fgIDRefsString); /*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedENTITYAttribute(XMLUni::fgInfosetURIName, XMLUni::fgEntityString); /*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedENTITIESAttribute(XMLUni::fgInfosetURIName, XMLUni::fgEntitiesString); /*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedNMTOKENAttribute(XMLUni::fgInfosetURIName, XMLUni::fgNmTokenString); /*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedNMTOKENSAttribute(XMLUni::fgInfosetURIName, XMLUni::fgNmTokensString); /*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedNOTATIONAttribute(XMLUni::fgInfosetURIName, XMLUni::fgNotationString); /*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedENUMERATIONAttribute(XMLUni::fgInfosetURIName, XMLUni::fgEnumerationString); DOMTypeInfoImpl::DOMTypeInfoImpl(const XMLCh* namespaceUri/*=0*/, const XMLCh* name/*=0*/) : fBitFields(0), fTypeName(name), fTypeNamespace(namespaceUri), fMemberTypeName(0), fMemberTypeNamespace(0), fDefaultValue(0), fNormalizedValue(0) { // by setting the fBitField to 0 we are also setting: // - [validity]=VALIDITY_NOTKNOWN // - [validitation attempted]=VALIDATION_NONE // - [schema specified]=false } DOMTypeInfoImpl::DOMTypeInfoImpl(DOMDocumentImpl* ownerDoc, const DOMPSVITypeInfo* sourcePSVI) : fBitFields(0), fTypeName(0), fTypeNamespace(0), fMemberTypeName(0), fMemberTypeNamespace(0), fDefaultValue(0), fNormalizedValue(0) { setNumericProperty(DOMPSVITypeInfo::PSVI_Validity, sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Validity)); setNumericProperty(DOMPSVITypeInfo::PSVI_Validation_Attempted, sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Validation_Attempted)); setNumericProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Type, sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Type)); setNumericProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Anonymous, sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Anonymous)); setNumericProperty(DOMPSVITypeInfo::PSVI_Nil, sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Nil)); setNumericProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Anonymous, sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Anonymous)); setNumericProperty(DOMPSVITypeInfo::PSVI_Schema_Specified, sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Schema_Specified)); setStringProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Name, ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Name))); setStringProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Namespace, ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Namespace))); setStringProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Name, ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Name))); setStringProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Namespace, ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Namespace))); setStringProperty(DOMPSVITypeInfo::PSVI_Schema_Default, ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Schema_Default))); setStringProperty(DOMPSVITypeInfo::PSVI_Schema_Normalized_Value, ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Schema_Normalized_Value))); } const XMLCh* DOMTypeInfoImpl::getTypeName() const { // if it's a DTD, return the data that was stored if(!getNumericProperty(PSVI_Schema_Specified)) return fTypeName; // if [validity] is "invalid" or "notKnown", the {target namespace} and {name} properties of the declared type if available, otherwise null. if(!getNumericProperty(PSVI_Validity)) return fTypeName; if(fMemberTypeName) return fMemberTypeName; return fTypeName; } const XMLCh* DOMTypeInfoImpl::getTypeNamespace() const { // if it's a DTD, return the data that was stored if(!getNumericProperty(PSVI_Schema_Specified)) return fTypeNamespace; // if [validity] is "invalid" or "notKnown", the {target namespace} and {name} properties of the declared type if available, otherwise null. if(!getNumericProperty(PSVI_Validity)) return fTypeNamespace; if(fMemberTypeName) // we check on the name, as the URI can be NULL return fMemberTypeNamespace; return fTypeNamespace; } bool DOMTypeInfoImpl::isDerivedFrom(const XMLCh* typeNamespaceArg, const XMLCh* typeNameArg, DerivationMethods) const { // if it's a DTD, return false if(!getNumericProperty(PSVI_Schema_Specified)) return false; if(XMLString::equals(typeNamespaceArg, getTypeNamespace()) && XMLString::equals(typeNameArg, getTypeName())) return true; // TODO: need a pointer to the Grammar object return false; } const XMLCh* DOMTypeInfoImpl::getStringProperty(PSVIProperty prop) const { switch(prop) { case PSVI_Type_Definition_Name: return fTypeName; case PSVI_Type_Definition_Namespace: return fTypeNamespace; case PSVI_Member_Type_Definition_Name: return fMemberTypeName; case PSVI_Member_Type_Definition_Namespace: return fMemberTypeNamespace; case PSVI_Schema_Default: return fDefaultValue; case PSVI_Schema_Normalized_Value: return fNormalizedValue; default: assert(false); /* it's not a string property */ } return 0; } int DOMTypeInfoImpl::getNumericProperty(PSVIProperty prop) const { switch(prop) { case PSVI_Validity: return (PSVIItem::VALIDITY_STATE)(fBitFields & 0x0003); case PSVI_Validation_Attempted: return (PSVIItem::ASSESSMENT_TYPE)((fBitFields >> 2) & 0x0003); case PSVI_Type_Definition_Type: return (fBitFields & (1 << 5))?XSTypeDefinition::COMPLEX_TYPE:XSTypeDefinition::SIMPLE_TYPE; case PSVI_Type_Definition_Anonymous: return (fBitFields & (1 << 6))?true:false; case PSVI_Nil: return (fBitFields & (1 << 7))?true:false; case PSVI_Member_Type_Definition_Anonymous: return (fBitFields & (1 << 8))?true:false; case PSVI_Schema_Specified: return (fBitFields & (1 << 9))?true:false; default: assert(false); /* it's not a numeric property */ } return 0; } void DOMTypeInfoImpl::setStringProperty(PSVIProperty prop, const XMLCh* value) { switch(prop) { case PSVI_Type_Definition_Name: fTypeName=value; break; case PSVI_Type_Definition_Namespace: fTypeNamespace=value; break; case PSVI_Member_Type_Definition_Name: fMemberTypeName=value; break; case PSVI_Member_Type_Definition_Namespace: fMemberTypeNamespace=value; break; case PSVI_Schema_Default: fDefaultValue=value; break; case PSVI_Schema_Normalized_Value: fNormalizedValue=value; break; default: assert(false); /* it's not a string property */ } } void DOMTypeInfoImpl::setNumericProperty(PSVIProperty prop, int value) { switch(prop) { case PSVI_Validity: fBitFields |= (value & 0x0003); break; case PSVI_Validation_Attempted: fBitFields |= ((value & 0x0003) << 2); break; case PSVI_Type_Definition_Type: fBitFields |= (value==XSTypeDefinition::COMPLEX_TYPE)?(1 << 5):0; break; case PSVI_Type_Definition_Anonymous: fBitFields |= (value!=0)?(1 << 6):0; break; case PSVI_Nil: fBitFields |= (value!=0)?(1 << 7):0; break; case PSVI_Member_Type_Definition_Anonymous: fBitFields |= (value!=0)?(1 << 8):0; break; case PSVI_Schema_Specified: fBitFields |= (value!=0)?(1 << 9):0; break; default: assert(false); /* it's not a numeric property */ } } XERCES_CPP_NAMESPACE_END /** * End of file DOMTypeInfo.cpp */ xerces-c-3.2.2/src/xercesc/dom/impl/DOMDeepNodeListImpl.hpp000644 000765 000024 00000005353 13241160337 024226 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMDeepNodeListImpl.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMDEEPNODELISTIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMDEEPNODELISTIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMNode; class CDOM_EXPORT DOMDeepNodeListImpl: public DOMNodeList { protected: const DOMNode* fRootNode; const XMLCh* fTagName; bool fMatchAll; int fChanges; DOMNode* fCurrentNode; XMLSize_t fCurrentIndexPlus1; //DOM Level 2 const XMLCh* fNamespaceURI; bool fMatchAllURI; bool fMatchURIandTagname; //match both namespaceURI and tagName public: DOMDeepNodeListImpl(const DOMNode *rootNode, const XMLCh *tagName); DOMDeepNodeListImpl(const DOMNode *rootNode, //DOM Level 2 const XMLCh *namespaceURI, const XMLCh *localName); virtual ~DOMDeepNodeListImpl(); virtual XMLSize_t getLength() const; virtual DOMNode* item(XMLSize_t index) const; DOMNode* cacheItem(XMLSize_t index); protected: DOMNode* nextMatchingElementAfter(DOMNode *current); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMDeepNodeListImpl(const DOMDeepNodeListImpl &); DOMDeepNodeListImpl & operator = (const DOMDeepNodeListImpl &); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMAttrNSImpl.hpp000644 000765 000024 00000006457 13241160337 023070 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMAttrNSImpl.hpp 678709 2008-07-22 10:56:56Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMATTRNSIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMATTRNSIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include "DOMAttrImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN class CDOM_EXPORT DOMAttrNSImpl: public DOMAttrImpl { protected: //Introduced in DOM Level 2 const XMLCh * fNamespaceURI; //namespace URI of this node const XMLCh * fLocalName; //local part of qualified name const XMLCh * fPrefix; // prefix part of qualified name // revisit - can return local part // by pointing into the qualified (L1) name. public: DOMAttrNSImpl(DOMDocument *ownerDoc, const XMLCh *name); DOMAttrNSImpl(DOMDocument *ownerDoc, //DOM Level 2 const XMLCh *namespaceURI, const XMLCh *qualifiedName); DOMAttrNSImpl(const DOMAttrNSImpl &other, bool deep=false); // Fast construction without any checks for name validity. Used in // parsing. Note that if prefix is not specified and localName is // 'xmlns', this constructor expects proper namespaceURI. // DOMAttrNSImpl(DOMDocument *ownerDoc, const XMLCh *namespaceURI, const XMLCh *prefix, // Null or empty - no prefix. const XMLCh *localName, const XMLCh *qualifiedName); virtual DOMNode * cloneNode(bool deep) const; //Introduced in DOM Level 2 virtual const XMLCh * getNamespaceURI() const; virtual const XMLCh * getPrefix() const; virtual const XMLCh * getLocalName() const; virtual void setPrefix(const XMLCh *prefix); virtual void release(); // helper function for DOM Level 3 renameNode virtual DOMNode* rename(const XMLCh* namespaceURI, const XMLCh* name); void setName(const XMLCh* namespaceURI, const XMLCh* name); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMAttrNSImpl & operator = (const DOMAttrNSImpl &); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMAttrImpl.hpp000644 000765 000024 00000010623 13241160337 022615 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMAttrImpl.hpp 1800911 2017-07-05 18:52:15Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMATTRIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMATTRIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include "DOMNodeBase.hpp" #include "DOMParentNode.hpp" #include "DOMNodeImpl.hpp" #include "DOMDocumentImpl.hpp" #include #include #include "DOMNodeIDMap.hpp" XERCES_CPP_NAMESPACE_BEGIN class DOMElementImpl; class DOMTypeInfoImpl; class CDOM_EXPORT DOMAttrImpl: public DOMAttr, public HasDOMNodeImpl, public HasDOMParentImpl { public: DOMNodeImpl fNode; DOMParentNode fParent; const XMLCh *fName; protected: const DOMTypeInfoImpl *fSchemaType; public: DOMAttrImpl(DOMDocument *ownerDocument, const XMLCh *aName); DOMAttrImpl(const DOMAttrImpl &other, bool deep=false); virtual ~DOMAttrImpl(); public: // Add all functions that are pure virtual in DOMNODE DOMNODE_FUNCTIONS; // Add accessors for implementation bits. DOMNODEIMPL_DECL; DOMPARENTIMPL_DECL; public: virtual const XMLCh * getName() const; virtual bool getSpecified() const; virtual const XMLCh * getValue() const; virtual void setSpecified(bool arg); virtual void setValue(const XMLCh * value); virtual DOMElement * getOwnerElement() const; virtual bool isId() const; virtual const DOMTypeInfo* getSchemaTypeInfo() const; void setOwnerElement(DOMElement *ownerElem); //internal use only // helper function for DOM Level 3 renameNode virtual DOMNode* rename(const XMLCh* namespaceURI, const XMLCh* name); //helper function for DOM Level 3 TypeInfo virtual void setSchemaTypeInfo(const DOMTypeInfoImpl* typeInfo); // helper method that sets this attr to an idnode and places it into the document map virtual void addAttrToIDNodeMap(); // helper to remove this attr from from the id map if it is in there virtual void removeAttrFromIDNodeMap(); public: // Set attribute value fast. Assumptions: // // - node is not read-only // - no ID management is performed // - this attribute does not have a value // virtual void setValueFast (const XMLCh * value); protected: void getTextValue(DOMNode* node, XMLBuffer& buf) const; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMAttrImpl& operator=(const DOMAttrImpl&); }; inline void DOMAttrImpl::removeAttrFromIDNodeMap() { if (fNode.isIdAttr()) { ((DOMDocumentImpl *)fParent.fOwnerDocument)->getNodeIDMap()->remove(this); fNode.isIdAttr(false); } } inline void DOMAttrImpl::addAttrToIDNodeMap() { if (fNode.isIdAttr()) return; fNode.isIdAttr(true); // REVIST For now, we don't worry about what happens if the new // name conflicts as per setValue DOMDocumentImpl *doc = (DOMDocumentImpl *)(fParent.fOwnerDocument); if (doc->fNodeIDMap == 0) doc->fNodeIDMap = new (doc) DOMNodeIDMap(500, doc); doc->getNodeIDMap()->add(this); } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMRangeImpl.cpp000644 000765 000024 00000173067 13241160337 022746 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMRangeImpl.cpp 1801099 2017-07-06 19:37:56Z scantor $ */ #include "DOMRangeImpl.hpp" #include "DOMDocumentImpl.hpp" #include "DOMDocumentFragmentImpl.hpp" #include "DOMCommentImpl.hpp" #include "DOMProcessingInstructionImpl.hpp" #include "DOMCasts.hpp" #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN //--------------------- // C'tor and D'tor //--------------------- DOMRangeImpl::DOMRangeImpl(DOMDocument* doc, MemoryManager* const manager) : fStartContainer(doc), fStartOffset(0), fEndContainer(doc), fEndOffset(0), fCollapsed(true), fDocument(doc), fDetached(false), fRemoveChild(0), fMemoryManager(manager) { } DOMRangeImpl::DOMRangeImpl(const DOMRangeImpl& other) : DOMRange(other), fStartContainer(other.fStartContainer), fStartOffset(other.fStartOffset), fEndContainer(other.fEndContainer), fEndOffset(other.fEndOffset), fCollapsed(other.fCollapsed), fDocument(other.fDocument), fDetached(other.fDetached), fRemoveChild(other.fRemoveChild), fMemoryManager(other.fMemoryManager) { } DOMRangeImpl::~DOMRangeImpl() { } //------------------------------- // Public getter functions //------------------------------- DOMNode* DOMRangeImpl::getStartContainer() const { if (fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } return fStartContainer; } XMLSize_t DOMRangeImpl::getStartOffset() const { if (fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } return fStartOffset; } DOMNode* DOMRangeImpl::getEndContainer() const { if (fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } return fEndContainer; } XMLSize_t DOMRangeImpl::getEndOffset() const { if (fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } return fEndOffset; } bool DOMRangeImpl::getCollapsed() const { if (fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } return ((fStartContainer == fEndContainer) && (fStartOffset == fEndOffset)); } //------------------------------- // Public setter functions //------------------------------- void DOMRangeImpl::setStartContainer(const DOMNode* node) { if (fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } fStartContainer = (DOMNode*) node; } void DOMRangeImpl::setStartOffset(XMLSize_t offset) { if (fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } fStartOffset = offset; } void DOMRangeImpl::setEndContainer(const DOMNode* node) { if (fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } fEndContainer = (DOMNode*) node; } void DOMRangeImpl::setEndOffset(XMLSize_t offset) { if (fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } fEndOffset = offset; } void DOMRangeImpl::setStart(const DOMNode* refNode, XMLSize_t offset) { validateNode(refNode); checkIndex(refNode, offset); // error if not the same owner document if (fDocument != refNode->getOwnerDocument()) { if ( refNode != fDocument ) { collapse(true); //collapse the range positions to start fCollapsed = true; throw DOMException( DOMException::WRONG_DOCUMENT_ERR, 0, fMemoryManager); } } fStartContainer = (DOMNode*) refNode; fStartOffset = offset; // they may be of same document, but not same root container // collapse if not the same root container if (!commonAncestorOf(refNode, fEndContainer)) collapse(true); //compare the start and end boundary point //collapse if start point is after the end point if(compareBoundaryPoints(DOMRange::END_TO_START, this) == 1) collapse(true); //collapse the range positions to start else fCollapsed = false; } void DOMRangeImpl::setEnd(const DOMNode* refNode, XMLSize_t offset) { validateNode(refNode); checkIndex(refNode, offset); // error if not the same owner document if (fDocument != refNode->getOwnerDocument()) { if ( refNode != fDocument ) { collapse(false); //collapse the range positions to end fCollapsed = true; throw DOMException( DOMException::WRONG_DOCUMENT_ERR, 0, fMemoryManager); } } fEndContainer = (DOMNode*) refNode; fEndOffset = offset; // they may be of same document, but not same root container // collapse if not the same root container if (!commonAncestorOf(refNode, fStartContainer)) collapse(false); //compare the start and end boundary point //collapse if start point is after the end point if(compareBoundaryPoints(DOMRange::END_TO_START, this) == 1) collapse(false); //collapse the range positions to end else fCollapsed = false; } void DOMRangeImpl::setStartBefore(const DOMNode* refNode) { if( fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } if ( !hasLegalRootContainer(refNode) || !isLegalContainedNode(refNode)) { throw DOMRangeException( DOMRangeException::INVALID_NODE_TYPE_ERR, 0, fMemoryManager); } // error if not the same owner document if (fDocument != refNode->getOwnerDocument()) { if ( refNode != fDocument ) { collapse(true); //collapse the range positions to start fCollapsed = true; throw DOMException( DOMException::WRONG_DOCUMENT_ERR, 0, fMemoryManager); } } fStartContainer = refNode->getParentNode(); XMLSize_t i = 0; for (DOMNode* n = (DOMNode*) refNode; n!=0; n = n->getPreviousSibling()) { i++; } if (i == 0) fStartOffset = 0; else fStartOffset = i-1; // they may be of same document, but not same root container // collapse if not the same root container if (!commonAncestorOf(refNode, fEndContainer)) collapse(true); //compare the start and end boundary point //collapse if start point is after the end point if(compareBoundaryPoints(DOMRange::END_TO_START, this) == 1) collapse(true); //collapse the range positions to start else fCollapsed = false; } void DOMRangeImpl::setStartAfter(const DOMNode* refNode) { if( fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } if ( !hasLegalRootContainer(refNode) || !isLegalContainedNode(refNode)) { throw DOMRangeException( DOMRangeException::INVALID_NODE_TYPE_ERR, 0, fMemoryManager); } // error if not the same owner document if (fDocument != refNode->getOwnerDocument()) { if ( refNode != fDocument ) { collapse(true); //collapse the range positions to start fCollapsed = true; throw DOMException( DOMException::WRONG_DOCUMENT_ERR, 0, fMemoryManager); } } fStartContainer = refNode->getParentNode(); XMLSize_t i = 0; for (DOMNode* n = (DOMNode*) refNode; n!=0; n = n->getPreviousSibling()) { i++; } fStartOffset = i; // they may be of same document, but not same root container // collapse if not the same root container if (!commonAncestorOf(refNode, fEndContainer)) collapse(true); //compare the start and end boundary point //collapse if start point is after the end point if(compareBoundaryPoints(DOMRange::END_TO_START, this) == 1) collapse(true); //collapse the range positions to start else fCollapsed = false; } void DOMRangeImpl::setEndBefore(const DOMNode* refNode) { if( fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } if ( !hasLegalRootContainer(refNode) || !isLegalContainedNode(refNode)) { throw DOMRangeException( DOMRangeException::INVALID_NODE_TYPE_ERR, 0, fMemoryManager); } // error if not the same owner document if (fDocument != refNode->getOwnerDocument()) { if ( refNode != fDocument ) { collapse(false); //collapse the range positions to end fCollapsed = true; throw DOMException( DOMException::WRONG_DOCUMENT_ERR, 0, fMemoryManager); } } fEndContainer = refNode->getParentNode(); XMLSize_t i = 0; for (DOMNode* n = (DOMNode*) refNode; n!=0; n = n->getPreviousSibling(), i++) ; if (i< 1) fEndOffset = 0; else fEndOffset = i-1; // they may be of same document, but not same root container // collapse if not the same root container if (!commonAncestorOf(refNode, fStartContainer)) collapse(false); //compare the start and end boundary point //collapse if start point is after the end point if(compareBoundaryPoints(DOMRange::END_TO_START, this) == 1) collapse(false); //collapse the range positions to end else fCollapsed = false; } void DOMRangeImpl::setEndAfter(const DOMNode* refNode) { if( fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } if ( !hasLegalRootContainer(refNode) || !isLegalContainedNode(refNode)) { throw DOMRangeException( DOMRangeException::INVALID_NODE_TYPE_ERR, 0, fMemoryManager); } // error if not the same owner document if (fDocument != refNode->getOwnerDocument()) { if ( refNode != fDocument ) { collapse(false); //collapse the range positions to end fCollapsed = true; throw DOMException( DOMException::WRONG_DOCUMENT_ERR, 0, fMemoryManager); } } fEndContainer = refNode->getParentNode(); XMLSize_t i = 0; for (DOMNode* n = (DOMNode*) refNode; n!=0; n = n->getPreviousSibling(), i++) ; if (i ==0) fEndOffset = 0; else fEndOffset = i; // they may be of same document, but not same root container // collapse if not the same root container if (!commonAncestorOf(refNode, fStartContainer)) collapse(false); //compare the start and end boundary point //collapse if start point is after the end point if(compareBoundaryPoints(DOMRange::END_TO_START, this) == 1) collapse(false); //collapse the range positions to end else fCollapsed = false; } //------------------------------- // Public Misc. functions //------------------------------- void DOMRangeImpl::detach() { if( fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } ((DOMDocumentImpl *)fDocument)->removeRange(this); fDetached = true; //0ify nodes fStartContainer = 0; fStartOffset = 0; fEndContainer = 0; fEndOffset = 0; fCollapsed = true; fRemoveChild = 0; } void DOMRangeImpl::collapse(bool toStart) { if( fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } if (toStart) { fEndContainer = fStartContainer; fEndOffset = fStartOffset; } else { fStartContainer = fEndContainer; fStartOffset = fEndOffset; } fCollapsed = true; } void DOMRangeImpl::selectNode(const DOMNode* refNode) { validateNode(refNode); if ( !isLegalContainedNode(refNode)) { throw DOMRangeException( DOMRangeException::INVALID_NODE_TYPE_ERR, 0, fMemoryManager); } //First check for the text type node short type = refNode->getNodeType(); if((type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { //The node itself is the container. fStartContainer = (DOMNode*) refNode; fEndContainer = (DOMNode*) refNode; //Select all the contents of the node fStartOffset = 0; if (type == DOMNode::PROCESSING_INSTRUCTION_NODE) fEndOffset = XMLString::stringLen(((DOMProcessingInstruction*)refNode)->getData()); else fEndOffset = ((DOMText *)refNode)->getLength(); return; } DOMNode* parent = refNode->getParentNode(); if (parent != 0 ) // REVIST: what to do if it IS 0? { fStartContainer = parent; fEndContainer = parent; XMLSize_t i = 0; for (DOMNode* n = parent->getFirstChild(); n!=0 && n!=refNode; n = n->getNextSibling()) { i++; } fStartOffset = i; fEndOffset = fStartOffset+1; } } void DOMRangeImpl::selectNodeContents(const DOMNode* node) { validateNode(node); fStartContainer = (DOMNode*) node; fEndContainer = (DOMNode*) node; fStartOffset = 0; short type = node->getNodeType(); if((type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE)) { fEndOffset = ((DOMText *)node)->getLength(); return; } if (type == DOMNode::PROCESSING_INSTRUCTION_NODE) { fEndOffset = XMLString::stringLen(((DOMProcessingInstruction*)node)->getData()); return; } DOMNode* first = node->getFirstChild(); if (first == 0) { fEndOffset = 0; return; } XMLSize_t i = 0; for (DOMNode* n = first; n!=0; n = n->getNextSibling()) { i++; } fEndOffset = i; } void DOMRangeImpl::surroundContents(DOMNode* newParent) { if (newParent==0) return; //check for elimination criteria if( fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } if (newParent->getOwnerDocument() !=fDocument) { throw DOMException( DOMException::WRONG_DOCUMENT_ERR, 0, fMemoryManager); } int type = newParent->getNodeType(); if ( !isLegalContainedNode(newParent) || type == DOMNode::DOCUMENT_TYPE_NODE) { throw DOMRangeException( DOMRangeException::INVALID_NODE_TYPE_ERR, 0, fMemoryManager); } DOMNode* realStart = fStartContainer; DOMNode* realEnd = fEndContainer; type = fStartContainer->getNodeType(); if((type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { realStart = fStartContainer->getParentNode(); } type = fEndContainer->getNodeType(); if((type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { realEnd = fEndContainer->getParentNode(); } if (realStart != realEnd) { throw DOMRangeException( DOMRangeException::BAD_BOUNDARYPOINTS_ERR, 0, fMemoryManager); } DOMDocumentFragment* frag = (DOMDocumentFragment*) extractContents(); insertNode(newParent); newParent->appendChild(frag); selectNode(newParent); } short DOMRangeImpl::compareBoundaryPoints(DOMRange::CompareHow how, const DOMRange* srcRange) const { if (fDocument != ((DOMRangeImpl*)srcRange)->fDocument) { throw DOMException( DOMException::WRONG_DOCUMENT_ERR, 0, fMemoryManager); } if( fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } DOMNode* pointA; DOMNode* pointB; XMLSize_t offsetA, offsetB; switch (how) { case (DOMRange::START_TO_START) : pointB = srcRange->getStartContainer(); pointA = fStartContainer; offsetB = srcRange->getStartOffset(); offsetA = fStartOffset; break; case (DOMRange::START_TO_END) : pointB = srcRange->getStartContainer(); pointA = fEndContainer; offsetB = srcRange->getStartOffset(); offsetA = fEndOffset; break; case (DOMRange::END_TO_START) : pointB = srcRange->getEndContainer(); pointA = fStartContainer; offsetB = srcRange->getEndOffset(); offsetA = fStartOffset; break; case (DOMRange::END_TO_END) : pointB = srcRange->getEndContainer(); pointA = fEndContainer; offsetB = srcRange->getEndOffset(); offsetA = fEndOffset; break; default: throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } // case 1: same container if (pointA == pointB) { if (offsetA < offsetB) return -1; //A before B if (offsetA == offsetB) return 0; //A equal to B return 1; // A after B } // case 2: Child C of container A is ancestor of B for (DOMNode* node = pointA->getFirstChild(); node != 0; node=node->getNextSibling()) { if (isAncestorOf(node, pointB)) { XMLSize_t index = indexOf(node, pointA); if (offsetA <= index) return -1; return 1; } } // case 3: Child C of container B is ancestor of A for (DOMNode* nd = pointB->getFirstChild(); nd != 0; nd=nd->getNextSibling()) { if (isAncestorOf(nd, pointA)) { XMLSize_t index = indexOf(nd, pointB); if (index < offsetB ) return -1; return 1; //B strictly before A } } // case 4: preorder traversal of context tree. // Instead of literally walking the context tree in pre-order, // we use relative node depth walking which is usually faster int depthDiff = 0; DOMNode* n = 0; for ( n = pointB; n != 0; n = n->getParentNode() ) depthDiff++; for ( n = pointA; n != 0; n = n->getParentNode() ) depthDiff--; while (depthDiff > 0) { pointB = pointB->getParentNode(); depthDiff--; } while (depthDiff < 0) { pointA = pointA->getParentNode(); depthDiff++; } for (DOMNode* pB = pointB->getParentNode(), *pA = pointA->getParentNode(); pB != pA; pB = pB->getParentNode(), pA = pA->getParentNode() ) { pointB = pB; pointA = pA; } for ( n = pointB->getNextSibling(); n != 0; n = n->getNextSibling() ) { if (n == pointA) { return 1; } } return -1; } void DOMRangeImpl:: deleteContents() { traverseContents(DELETE_CONTENTS); } DOMDocumentFragment* DOMRangeImpl::extractContents() { checkReadOnly(fStartContainer, fEndContainer, fStartOffset, fEndOffset); return traverseContents(EXTRACT_CONTENTS); } DOMDocumentFragment* DOMRangeImpl::cloneContents() const { // cast off const. return ((DOMRangeImpl *)this)->traverseContents(CLONE_CONTENTS); } void DOMRangeImpl::insertNode(DOMNode* newNode) { if (newNode == 0) return; //don't have to do anything if( fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } int type = newNode->getNodeType(); if (type == DOMNode::ATTRIBUTE_NODE || type == DOMNode::ENTITY_NODE || type == DOMNode::NOTATION_NODE || type == DOMNode::DOCUMENT_NODE) { throw DOMRangeException( DOMRangeException::INVALID_NODE_TYPE_ERR, 0, fMemoryManager); } // Prevent cycles in the tree. //isKidOK() is not checked here as its taken care by insertBefore() function if (isAncestorOf( newNode, fStartContainer)) { throw DOMException( DOMException::HIERARCHY_REQUEST_ERR, 0, fMemoryManager); } for (DOMNode* aNode = fStartContainer; aNode!=0; aNode = aNode->getParentNode()) { if (castToNodeImpl(newNode)->isReadOnly()) { throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, fMemoryManager); } } if (fDocument != newNode->getOwnerDocument()) { throw DOMException( DOMException::WRONG_DOCUMENT_ERR, 0, fMemoryManager); } DOMNode* parent; DOMNode* next; type = fStartContainer->getNodeType(); if((type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { //set 'parent' and 'next' here parent = fStartContainer->getParentNode(); //split the text nodes if (fStartOffset > 0) { if (type == DOMNode::COMMENT_NODE) ((DOMCommentImpl*)fStartContainer)->splitText(fStartOffset); else if (type == DOMNode::PROCESSING_INSTRUCTION_NODE) ((DOMProcessingInstructionImpl*)fStartContainer)->splitText(fStartOffset); else ((DOMText*)fStartContainer)->splitText(fStartOffset); } //update the new start information later. After inserting the first newNode if (fStartOffset == 0) next = fStartContainer; else next = fStartContainer->getNextSibling(); } // end of text handling else { parent = fStartContainer; next = fStartContainer->getFirstChild(); for(XMLSize_t i = 0; (i < fStartOffset) && (next != 0); i++) { next=next->getNextSibling(); } } if (parent != 0) { if (next != 0) parent->insertBefore(newNode, next); else parent->appendChild(newNode); } } DOMRange* DOMRangeImpl::cloneRange() const { if( fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } DOMRange* range = fDocument->createRange(); range->setStart(fStartContainer, fStartOffset); range->setEnd(fEndContainer, fEndOffset); return range; } const XMLCh* DOMRangeImpl::toString() const { if( fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } if ((fStartContainer == fEndContainer) && (fEndOffset == fStartOffset)) return XMLUni::fgZeroLenString; DOMNode* node = fStartContainer; DOMNode* stopNode = fEndContainer; XMLBuffer retStringBuf(1023, ((DOMDocumentImpl *)fDocument)->getMemoryManager()); short type = fStartContainer->getNodeType(); if((type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { if (fStartContainer == fEndContainer) { XMLCh* tempString; XMLCh temp[4000]; if ((fEndOffset-fStartOffset) >= 3999) tempString = (XMLCh*) fMemoryManager->allocate ( (fEndOffset - fStartOffset + 1) * sizeof(XMLCh) );//new XMLCh[fEndOffset-fStartOffset+1]; else tempString = temp; XMLString::subString(tempString, fStartContainer->getNodeValue(), fStartOffset, fEndOffset, ((DOMDocumentImpl *)fDocument)->getMemoryManager()); const XMLCh* retString = ((DOMDocumentImpl *)fDocument)->getPooledString(tempString); if ((fEndOffset-fStartOffset) >= 3999) fMemoryManager->deallocate(tempString);//delete[] tempString; return retString; } else { XMLSize_t length = XMLString::stringLen(fStartContainer->getNodeValue()); if (length != fStartOffset) { XMLCh* tempString; XMLCh temp[4000]; if ((length - fStartOffset) >= 3999) tempString = (XMLCh*) fMemoryManager->allocate ( (length - fStartOffset + 1) * sizeof(XMLCh) );//new XMLCh[length - fStartOffset+1]; else tempString = temp; XMLString::subString(tempString, fStartContainer->getNodeValue(), fStartOffset, length, ((DOMDocumentImpl *)fDocument)->getMemoryManager()); retStringBuf.append(tempString); if ((length - fStartOffset) >= 3999) fMemoryManager->deallocate(tempString);//delete[] tempString; } node = nextNode(node, true); } }else { //fStartContainer is not a TextNode node=node->getFirstChild(); if (fStartOffset>0) { //find a first node within a range, specified by fStartOffset XMLSize_t counter = 0; while (countergetNextSibling(); counter++; } } if (node == 0) { node = nextNode(fStartContainer,false); } } type = fEndContainer->getNodeType(); if((type != DOMNode::TEXT_NODE && type != DOMNode::CDATA_SECTION_NODE && type != DOMNode::COMMENT_NODE && type != DOMNode::PROCESSING_INSTRUCTION_NODE)) { int i=(int)fEndOffset; stopNode = fEndContainer->getFirstChild(); while( i>0 && stopNode!=0 ){ --i; stopNode = stopNode->getNextSibling(); } if ( stopNode == 0 ) stopNode = nextNode( fEndContainer, false ); } while (node != stopNode) { //look into all kids of the Range if (node == 0) break; type = node->getNodeType(); if((type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { retStringBuf.append(node->getNodeValue()); } node = nextNode(node, true); } type = fEndContainer->getNodeType(); if((type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { if (fEndOffset != 0) { XMLCh* tempString; XMLCh temp[4000]; if (fEndOffset >= 3999) tempString = (XMLCh*) fMemoryManager->allocate ( (fEndOffset+1) * sizeof(XMLCh) );//new XMLCh[fEndOffset+1]; else tempString = temp; XMLString::subString(tempString, fEndContainer->getNodeValue(), 0, fEndOffset, ((DOMDocumentImpl *)fDocument)->getMemoryManager()); retStringBuf.append(tempString); if (fEndOffset >= 3999) fMemoryManager->deallocate(tempString);//delete[] tempString; } } return ((DOMDocumentImpl *)fDocument)->getPooledString(retStringBuf.getRawBuffer()); } DOMDocument* DOMRangeImpl::getDocument() { return fDocument; } const DOMNode* DOMRangeImpl::getCommonAncestorContainer() const { return commonAncestorOf(fStartContainer, fEndContainer); } void DOMRangeImpl::release() { detach(); // for performance reason, do not recycle pointer // chance that this is allocated again and again is not usual } //--------------------- //private functions //--------------------- bool DOMRangeImpl::isValidAncestorType(const DOMNode* node) const { for (DOMNode* aNode = (DOMNode*) node; aNode!=0; aNode = aNode->getParentNode()) { short type = aNode->getNodeType(); if ( type == DOMNode::ENTITY_NODE || type == DOMNode::NOTATION_NODE || type == DOMNode::DOCUMENT_TYPE_NODE) return false; } return true; } bool DOMRangeImpl::isAncestorOf(const DOMNode* a, const DOMNode* b) { for (DOMNode* node = (DOMNode*) b; node != 0; node=node->getParentNode()) { if (node == a) return true; } return false; } bool DOMRangeImpl::hasLegalRootContainer(const DOMNode* node) const { if ( node==0 ) return false; DOMNode* rootContainer = (DOMNode*)node; for (; rootContainer->getParentNode()!=0; rootContainer = rootContainer->getParentNode()) ; switch( rootContainer->getNodeType() ) { case DOMNode::ATTRIBUTE_NODE: case DOMNode::DOCUMENT_NODE: case DOMNode::DOCUMENT_FRAGMENT_NODE: return true; default: return false; } } bool DOMRangeImpl::isLegalContainedNode(const DOMNode* node ) const { if ( node==0 ) return false; switch( node->getNodeType() ) { case DOMNode::DOCUMENT_NODE: case DOMNode::DOCUMENT_FRAGMENT_NODE: case DOMNode::ATTRIBUTE_NODE: case DOMNode::ENTITY_NODE: case DOMNode::NOTATION_NODE: return false; default: return true; } } XMLSize_t DOMRangeImpl::indexOf(const DOMNode* child, const DOMNode* parent) const { XMLSize_t i = 0; if (child->getParentNode() != parent) return (XMLSize_t)-1; for(DOMNode* node = child->getPreviousSibling(); node!= 0; node=node->getPreviousSibling()) { i++; } return i; } void DOMRangeImpl::validateNode(const DOMNode* node) const { if( fDetached) { throw DOMException( DOMException::INVALID_STATE_ERR, 0, fMemoryManager); } if ( !isValidAncestorType(node)) { throw DOMRangeException(DOMRangeException::INVALID_NODE_TYPE_ERR, 0, fMemoryManager); } } const DOMNode* DOMRangeImpl::commonAncestorOf(const DOMNode* pointA, const DOMNode* pointB) const { if (fDetached) throw DOMException(DOMException::INVALID_STATE_ERR, 0, fMemoryManager); //if the containers are same then it itself is its common ancestor. if (pointA == pointB) return pointA; typedef RefVectorOf VectorNodes; VectorNodes startV(1, false, ((DOMDocumentImpl *)fDocument)->getMemoryManager()); DOMNode* node; for (node=(DOMNode*)pointA; node != 0; node=node->getParentNode()) { startV.addElement(node); } VectorNodes endV(1, false, ((DOMDocumentImpl *)fDocument)->getMemoryManager()); for (node=(DOMNode*)pointB; node != 0; node=node->getParentNode()) { endV.addElement(node); } XMLSize_t s = startV.size(); XMLSize_t e = endV.size(); DOMNode* commonAncestor = 0; while (s>0 && e>0) { if (startV.elementAt(s-1) == endV.elementAt(e-1)) { commonAncestor = startV.elementAt(s-1); } else break; --s; --e; } return commonAncestor; } void DOMRangeImpl::checkIndex(const DOMNode* node, XMLSize_t offset) const { short type = node->getNodeType(); if((type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { if (offset > XMLString::stringLen(node->getNodeValue())) throw DOMException( DOMException::INDEX_SIZE_ERR, 0, fMemoryManager ); else return; } DOMNode* child = node->getFirstChild(); XMLSize_t i = 0; for (; child != 0; i++) { child = child->getNextSibling(); } if (i < offset) { throw DOMException( DOMException::INDEX_SIZE_ERR, 0, fMemoryManager ); } } DOMNode* DOMRangeImpl::nextNode(const DOMNode* node, bool visitChildren) const { if (node == 0) return 0; DOMNode* result; if (visitChildren) { result = node->getFirstChild(); if (result != 0) { return result; } } // if hasSibling, return sibling result = node->getNextSibling(); if (result != 0) { return result; } // return parent's 1st sibling. DOMNode* parent = node->getParentNode(); while ( (parent != 0) && (parent != fDocument) ) { result = parent->getNextSibling(); if (result != 0) { return result; } else { parent = parent->getParentNode(); } } // end of list, return 0 return 0; } /** This is the master routine invoked to visit the nodes * selected by this range. For each such node, different * actions are taken depending on the value of the TraversalType argument. */ DOMDocumentFragment* DOMRangeImpl::traverseContents(TraversalType how) { if (fDetached) throw DOMException(DOMException::INVALID_STATE_ERR, 0, fMemoryManager); if (fStartContainer == 0 || fEndContainer == 0) { return 0; // REVIST: Throw exception? } /* Traversal is accomplished by first determining the relationship between the endpoints of the range. For each of four significant relationships, we will delegate the traversal call to a method that can make appropriate assumptions. */ // case 1: same container if ( fStartContainer == fEndContainer ) return traverseSameContainer( how ); // case 2: Child C of start container is ancestor of end container // This can be quickly tested by walking the parent chain of // end container int endContainerDepth = 0; for ( DOMNode* c = fEndContainer, *p = c->getParentNode(); p != 0; c = p, p = p->getParentNode()) { if (p == fStartContainer) return traverseCommonStartContainer( c, how ); ++endContainerDepth; } // case 3: Child C of end container is ancestor of start container // This can be quickly tested by walking the parent chain of A int startContainerDepth = 0; for ( DOMNode* c2 = fStartContainer, *p2 = c2->getParentNode(); p2 != 0; c2 = p2, p2 = p2->getParentNode()) { if (p2 == fEndContainer) return traverseCommonEndContainer( c2, how ); ++startContainerDepth; } // case 4: There is a common ancestor container. Find the // ancestor siblings that are children of that container. int depthDiff = startContainerDepth - endContainerDepth; DOMNode* startNode = fStartContainer; while (depthDiff > 0) { startNode = startNode->getParentNode(); depthDiff--; } DOMNode* endNode = fEndContainer; while (depthDiff < 0) { endNode = endNode->getParentNode(); depthDiff++; } // ascend the ancestor hierarchy until we have a common parent. for( DOMNode* sp = startNode->getParentNode(), *ep = endNode->getParentNode(); sp!=ep; sp = sp->getParentNode(), ep = ep->getParentNode() ) { startNode = sp; endNode = ep; } return traverseCommonAncestors( startNode, endNode, how ); } /** * Visits the nodes selected by this range when we know * a-priori that the start and end containers are the same. * */ DOMDocumentFragment* DOMRangeImpl::traverseSameContainer( int how ) { DOMDocumentFragment* frag = 0; if ( how!=DELETE_CONTENTS) frag = fDocument->createDocumentFragment(); // If selection is empty, just return the fragment if ( fStartOffset==fEndOffset ) return frag; DOMNode* cloneCurrent = 0; // Text node needs special case handling short type = fStartContainer->getNodeType(); if((type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { cloneCurrent = fStartContainer->cloneNode(false); if (fEndOffset == fStartOffset) { cloneCurrent->setNodeValue(XMLUni::fgZeroLenString); } else { XMLCh* tempString; XMLCh temp[4000]; if (fEndOffset >= 3999) tempString = (XMLCh*) fMemoryManager->allocate ( (fEndOffset+1) * sizeof(XMLCh) );//new XMLCh[fEndOffset+1]; else tempString = temp; XMLString::subString(tempString, cloneCurrent->getNodeValue(), fStartOffset, fEndOffset, ((DOMDocumentImpl *)fDocument)->getMemoryManager()); cloneCurrent->setNodeValue(((DOMDocumentImpl *)fDocument)->getPooledString(tempString)); if (fEndOffset >= 3999) fMemoryManager->deallocate(tempString);//delete[] tempString; } // set the original text node to its new value if ( how != CLONE_CONTENTS ) { if(type == DOMNode::PROCESSING_INSTRUCTION_NODE) { ((DOMProcessingInstructionImpl*)fStartContainer)->deleteData(fStartOffset, fEndOffset-fStartOffset); } else ((DOMCharacterData*)fStartContainer)->deleteData(fStartOffset, fEndOffset-fStartOffset); } if ( how != DELETE_CONTENTS) frag->appendChild(cloneCurrent); } else { // Copy nodes between the start/end offsets. DOMNode* n = getSelectedNode( fStartContainer, (int)fStartOffset ); if (fEndOffset > fStartOffset) { XMLSize_t cnt = fEndOffset - fStartOffset; while( cnt > 0 && n) { DOMNode* sibling = n->getNextSibling(); DOMNode* xferNode = traverseFullySelected( n, how ); if ( frag!=0 ) frag->appendChild( xferNode ); --cnt; n = sibling; } } } // Nothing is partially selected, so collapse to start point if ( how != CLONE_CONTENTS ) collapse(true); return frag; } /** * Visits the nodes selected by this range when we know * a-priori that the start and end containers are not the * same, but the start container is an ancestor of the end container * */ DOMDocumentFragment* DOMRangeImpl::traverseCommonStartContainer( DOMNode*endAncestor, int how ) { DOMDocumentFragment* frag = 0; if ( how!=DELETE_CONTENTS) frag = fDocument->createDocumentFragment(); DOMNode*n = traverseRightBoundary( endAncestor, how ); if ( frag!=0 ) frag->appendChild( n ); XMLSize_t endIdx = indexOf( endAncestor, fStartContainer ); if ( endIdx <= fStartOffset ) { // Collapse to just before the endAncestor, which // is partially selected. if ( how != CLONE_CONTENTS ) { setEndBefore( endAncestor ); collapse( false ); } return frag; } n = endAncestor->getPreviousSibling(); int cnt = (int)endIdx - (int)fStartOffset; while( cnt > 0 ) { DOMNode* sibling = n->getPreviousSibling(); DOMNode* xferNode = traverseFullySelected( n, how ); if ( frag!=0 ) frag->insertBefore( xferNode, frag->getFirstChild() ); --cnt; n = sibling; } // Collapse to just before the endAncestor, which // is partially selected. if ( how != CLONE_CONTENTS ) { setEndBefore( endAncestor ); collapse( false ); } return frag; } /** * Visits the nodes selected by this range when we know * a-priori that the start and end containers are not the * same, but the end container is an ancestor of the start container * */ DOMDocumentFragment* DOMRangeImpl::traverseCommonEndContainer( DOMNode*startAncestor, int how ) { DOMDocumentFragment* frag = 0; if ( how!=DELETE_CONTENTS) frag = fDocument->createDocumentFragment(); DOMNode* n = traverseLeftBoundary( startAncestor, how ); if ( frag!=0 ) frag->appendChild( n ); XMLSize_t startIdx = indexOf( startAncestor, fEndContainer ); ++startIdx; // Because we already traversed it.... int cnt = (int)fEndOffset - (int)startIdx; n = startAncestor->getNextSibling(); while( cnt > 0 ) { DOMNode* sibling = n->getNextSibling(); DOMNode* xferNode = traverseFullySelected( n, how ); if ( frag!=0 ) frag->appendChild( xferNode ); --cnt; n = sibling; } if ( how != CLONE_CONTENTS ) { setStartAfter( startAncestor ); collapse( true ); } return frag; } /** * Visits the nodes selected by this range when we know * a-priori that the start and end containers are not * the same, and we also know that neither the start * nor end container is an ancestor of the other. */ DOMDocumentFragment* DOMRangeImpl::traverseCommonAncestors( DOMNode*startAncestor, DOMNode*endAncestor, int how ) { DOMDocumentFragment* frag = 0; if ( how!=DELETE_CONTENTS) frag = fDocument->createDocumentFragment(); DOMNode*n = traverseLeftBoundary( startAncestor, how ); if ( frag!=0 ) frag->appendChild( n ); DOMNode*commonParent = startAncestor->getParentNode(); XMLSize_t startOffset = indexOf( startAncestor, commonParent ); XMLSize_t endOffset = indexOf( endAncestor, commonParent ); ++startOffset; int cnt = (int)endOffset - (int)startOffset; DOMNode* sibling = startAncestor->getNextSibling(); while( cnt > 0 ) { DOMNode* nextSibling = sibling->getNextSibling(); n = traverseFullySelected( sibling, how ); if ( frag!=0 ) frag->appendChild( n ); sibling = nextSibling; --cnt; } n = traverseRightBoundary( endAncestor, how ); if ( frag!=0 ) frag->appendChild( n ); if ( how != CLONE_CONTENTS ) { setStartAfter( startAncestor ); collapse( true ); } return frag; } /** * Traverses the "right boundary" of this range and * operates on each "boundary node" according to the * how parameter. It is a-priori assumed * by this method that the right boundary does * not contain the range's start container. * * A "right boundary" is best visualized by thinking * of a sample tree: * A * /|\ * / | \ * / | \ * B C D * /|\ /|\ * E F G H I J * * Imagine first a range that begins between the * "E" and "F" nodes and ends between the * "I" and "J" nodes. The start container is * "B" and the end container is "D". Given this setup, * the following applies: * * Partially Selected Nodes: B, D
* Fully Selected Nodes: F, G, C, H, I * * The "right boundary" is the highest subtree node * that contains the ending container. The root of * this subtree is always partially selected. * * In this example, the nodes that are traversed * as "right boundary" nodes are: H, I, and D. * */ DOMNode* DOMRangeImpl::traverseRightBoundary( DOMNode*root, int how ) { DOMNode*next = getSelectedNode( fEndContainer, (int)fEndOffset-1 ); bool isFullySelected = ( next!=fEndContainer ); if ( next==root ) return traverseNode( next, isFullySelected, false, how ); DOMNode*parent = next->getParentNode(); DOMNode*clonedParent = traverseNode( parent, false, false, how ); while( parent!=0 ) { while( next!=0 ) { DOMNode* prevSibling = next->getPreviousSibling(); DOMNode* clonedChild = traverseNode( next, isFullySelected, false, how ); if ( how!=DELETE_CONTENTS ) { clonedParent->insertBefore( clonedChild, clonedParent->getFirstChild() ); } isFullySelected = true; next = prevSibling; } if ( parent==root ) return clonedParent; next = parent->getPreviousSibling(); parent = parent->getParentNode(); DOMNode* clonedGrandParent = traverseNode( parent, false, false, how ); if ( how!=DELETE_CONTENTS ) clonedGrandParent->appendChild( clonedParent ); clonedParent = clonedGrandParent; } // should never occur return 0; } /** * Traverses the "left boundary" of this range and * operates on each "boundary node" according to the * how parameter. It is a-priori assumed * by this method that the left boundary does * not contain the range's end container. * * A "left boundary" is best visualized by thinking * of a sample tree: * * A * /|\ * / | \ * / | \ * B C D * /|\ /|\ * E F G H I J * * Imagine first a range that begins between the * "E" and "F" nodes and ends between the * "I" and "J" nodes. The start container is * "B" and the end container is "D". Given this setup, * the following applies: * * Partially Selected Nodes: B, D
* Fully Selected Nodes: F, G, C, H, I * * The "left boundary" is the highest subtree node * that contains the starting container. The root of * this subtree is always partially selected. * * In this example, the nodes that are traversed * as "left boundary" nodes are: F, G, and B. * */ DOMNode* DOMRangeImpl::traverseLeftBoundary( DOMNode*root, int how ) { DOMNode*next = getSelectedNode( getStartContainer(), (int)getStartOffset() ); bool isFullySelected = ( next!=getStartContainer() ); if ( next==root ) return traverseNode( next, isFullySelected, true, how ); DOMNode* parent = next->getParentNode(); DOMNode* clonedParent = traverseNode( parent, false, true, how ); while( parent!=0 ) { while( next!=0 ) { DOMNode* nextSibling = next->getNextSibling(); DOMNode* clonedChild = traverseNode( next, isFullySelected, true, how ); if ( how!=DELETE_CONTENTS ) clonedParent->appendChild(clonedChild); isFullySelected = true; next = nextSibling; } if ( parent==root ) return clonedParent; next = parent->getNextSibling(); parent = parent->getParentNode(); DOMNode* clonedGrandParent = traverseNode( parent, false, true, how ); if ( how!=DELETE_CONTENTS ) clonedGrandParent->appendChild( clonedParent ); clonedParent = clonedGrandParent; } // should never occur return 0; } /** * Utility method for traversing a single node. * Does not properly handle a text node containing both the * start and end offsets. Such nodes should * have been previously detected and been routed to traverseTextNode. * */ DOMNode* DOMRangeImpl::traverseNode( DOMNode* n, bool isFullySelected, bool isLeft, int how ) { if ( isFullySelected ) return traverseFullySelected( n, how ); short type = n->getNodeType(); if((type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) return traverseTextNode( n, isLeft, how ); return traversePartiallySelected( n, how ); } /** * Utility method for traversing a single node when * we know a-priori that the node if fully * selected. * */ DOMNode* DOMRangeImpl::traverseFullySelected( DOMNode* n, int how ) { switch( how ) { case CLONE_CONTENTS: return n->cloneNode( true ); case EXTRACT_CONTENTS: return n; case DELETE_CONTENTS: // revisit: // should I release the removed node? // not released in case user still referencing it externally n->getParentNode()->removeChild(n); return 0; } return 0; } /** * Utility method for traversing a single node when * we know a-priori that the node if partially * selected and is not a text node. * */ DOMNode* DOMRangeImpl::traversePartiallySelected( DOMNode*n, int how ) { switch( how ) { case DELETE_CONTENTS: return 0; case CLONE_CONTENTS: case EXTRACT_CONTENTS: return n->cloneNode( false ); } return 0; } /** * Utility method for traversing a text node that we know * a-priori to be on a left or right boundary of the range. * This method does not properly handle text nodes that contain * both the start and end points of the range. * */ DOMNode* DOMRangeImpl::traverseTextNode( DOMNode*n, bool isLeft, int how ) { XMLCh* txtValue = XMLString::replicate(n->getNodeValue(), fMemoryManager); ArrayJanitor janValue(txtValue, fMemoryManager); if ( isLeft ) { XMLSize_t startLen = XMLString::stringLen(fStartContainer->getNodeValue()); XMLSize_t offset = getStartOffset(); if (offset == 0) { if ( how != CLONE_CONTENTS ) n->setNodeValue(XMLUni::fgZeroLenString); } else { XMLCh* oldNodeValue; XMLCh oldTemp[4000]; if (offset >= 3999) { oldNodeValue = (XMLCh*) fMemoryManager->allocate ( (offset+1) * sizeof(XMLCh) );//new XMLCh[offset+1]; } else { oldNodeValue = oldTemp; } XMLString::subString(oldNodeValue, txtValue, 0, offset, ((DOMDocumentImpl *)fDocument)->getMemoryManager()); if ( how != CLONE_CONTENTS ) n->setNodeValue( ((DOMDocumentImpl *)fDocument)->getPooledString(oldNodeValue) ); if (offset>= 3999) fMemoryManager->deallocate(oldNodeValue);//delete[] oldNodeValue; } if ( how==DELETE_CONTENTS ) return 0; DOMNode* newNode = n->cloneNode( false ); if (startLen == offset) { newNode->setNodeValue(XMLUni::fgZeroLenString); } else { XMLCh* newNodeValue; XMLCh newTemp[4000]; if (offset >= 3999) { newNodeValue = (XMLCh*) fMemoryManager->allocate ( (offset+1) * sizeof(XMLCh) );//new XMLCh[offset+1]; } else { newNodeValue = newTemp; } XMLString::subString(newNodeValue, txtValue, offset, startLen, ((DOMDocumentImpl *)fDocument)->getMemoryManager()); newNode->setNodeValue( ((DOMDocumentImpl *)fDocument)->getPooledString(newNodeValue) ); if (offset>= 3999) fMemoryManager->deallocate(newNodeValue);//delete[] newNodeValue; } return newNode; } else { XMLSize_t endLen = XMLString::stringLen(fEndContainer->getNodeValue()); XMLSize_t offset = getEndOffset(); if (endLen == offset) { if ( how != CLONE_CONTENTS ) n->setNodeValue(XMLUni::fgZeroLenString); } else { XMLCh* oldNodeValue; XMLCh oldTemp[4000]; if (offset >= 3999) { oldNodeValue = (XMLCh*) fMemoryManager->allocate ( (offset+1) * sizeof(XMLCh) );//new XMLCh[offset+1]; } else { oldNodeValue = oldTemp; } XMLString::subString(oldNodeValue, txtValue, offset, endLen, ((DOMDocumentImpl *)fDocument)->getMemoryManager()); if ( how != CLONE_CONTENTS ) n->setNodeValue( ((DOMDocumentImpl *)fDocument)->getPooledString(oldNodeValue) ); if (offset>= 3999) fMemoryManager->deallocate(oldNodeValue);//delete[] oldNodeValue; } if ( how==DELETE_CONTENTS ) return 0; DOMNode* newNode = n->cloneNode( false ); if (offset == 0) { newNode->setNodeValue(XMLUni::fgZeroLenString); } else { XMLCh* newNodeValue; XMLCh newTemp[4000]; if (offset >= 3999) { newNodeValue = (XMLCh*) fMemoryManager->allocate ( (offset+1) * sizeof(XMLCh) );//new XMLCh[offset+1]; } else { newNodeValue = newTemp; } XMLString::subString(newNodeValue, txtValue, 0, offset, ((DOMDocumentImpl *)fDocument)->getMemoryManager()); newNode->setNodeValue( ((DOMDocumentImpl *)fDocument)->getPooledString(newNodeValue) ); if (offset>= 3999) fMemoryManager->deallocate(newNodeValue);//delete[] newNodeValue; } return newNode; } } /** * Utility method to retrieve a child node by index. This method * assumes the caller is trying to find out which node is * selected by the given index. Note that if the index is * greater than the number of children, this implies that the * first node selected is the parent node itself. * */ DOMNode* DOMRangeImpl::getSelectedNode( DOMNode*container, int offset ) { short type = container->getNodeType(); if((type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) return container; // This case is an important convenience for // traverseRightBoundary() if ( offset<0 ) return container; DOMNode*child = container->getFirstChild(); while( child!=0 && offset > 0 ) { --offset; child = child->getNextSibling(); } if ( child!=0 ) return child; return container; } void DOMRangeImpl::checkReadOnly(DOMNode* start, DOMNode* end, XMLSize_t startOffset, XMLSize_t endOffset) { if ((start == 0) || (end == 0) ) return; DOMNode*sNode = 0; short type = start->getNodeType(); if ( type == DOMNode::DOCUMENT_TYPE_NODE ) { throw DOMException( DOMException::HIERARCHY_REQUEST_ERR, 0, fMemoryManager); } if((type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { if (castToNodeImpl(start)->isReadOnly()) { throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, fMemoryManager); } //if both start and end are text check and return if (start == end) return; sNode = start; } else { //set the start and end nodes to check sNode = start->getFirstChild(); for(XMLSize_t i = 0; igetNextSibling(); } DOMNode* eNode; type = end->getNodeType(); if ( type == DOMNode::DOCUMENT_TYPE_NODE ) { throw DOMException( DOMException::HIERARCHY_REQUEST_ERR, 0, fMemoryManager); } if((type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { eNode = end; //need to check only till this node } else { //need to check all the kids that fall before the end offset value eNode = end->getFirstChild(); if (endOffset > 0) { for (XMLSize_t i = 0; igetNextSibling(); } } //recursivly search if any node is readonly recurseTreeAndCheck(sNode, eNode); } void DOMRangeImpl::recurseTreeAndCheck(DOMNode* start, DOMNode* end) { for(DOMNode* node=start; node != 0 && node !=end; node=node->getNextSibling()) { if ( node->getNodeType()== DOMNode::DOCUMENT_TYPE_NODE ) { throw DOMException( DOMException::HIERARCHY_REQUEST_ERR, 0, fMemoryManager); } if (castToNodeImpl(node)->isReadOnly()) { throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, fMemoryManager); } if (node->hasChildNodes()) { node = node->getFirstChild(); recurseTreeAndCheck(node, end); } } } DOMNode* DOMRangeImpl::removeChild(DOMNode* parent, DOMNode* child) { fRemoveChild = child; //only a precaution measure not to update this range data before removal DOMNode*n = parent->removeChild(child); fRemoveChild = 0; return n; } // // Mutation functions // /* This function is called from DOM. * The text has already been replaced. * Fix-up any offsets. */ void DOMRangeImpl::receiveReplacedText(DOMNode* node) { if (node == 0) return; short type = fStartContainer->getNodeType(); if (node == fStartContainer && (type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { fStartOffset = 0; } type = fEndContainer->getNodeType(); if (node == fEndContainer && (type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { fEndOffset = 0; } } /** This function is called from DOM. * The text has already been deleted. * Fix-up any offsets. */ void DOMRangeImpl::updateRangeForDeletedText(DOMNode* node, XMLSize_t offset, XMLSize_t count) { if (node == 0) return; short type = fStartContainer->getNodeType(); if (node == fStartContainer && (type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { if (fStartOffset > offset+count) { fStartOffset = fStartOffset-count; } else if (fStartOffset > offset) { fStartOffset = offset; } } type = fEndContainer->getNodeType(); if (node == fEndContainer && (type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { if (fEndOffset > offset+count) { fEndOffset = fEndOffset-count; } else if (fEndOffset > offset) { fEndOffset = offset; } } } /** This function is called from DOM. * The text has already beeen inserted. * Fix-up any offsets. */ void DOMRangeImpl::updateRangeForInsertedText(DOMNode* node, XMLSize_t offset, XMLSize_t count) { if (node == 0) return; short type = fStartContainer->getNodeType(); if (node == fStartContainer && (type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { if (fStartOffset > offset) { fStartOffset = offset; } } type = fEndContainer->getNodeType(); if (node == fEndContainer && (type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { if (fEndOffset > offset) { fEndOffset = fEndOffset+count; } } } /** This function must be called by the DOM _BEFORE_ * a node is deleted, because at that time it is * connected in the DOM tree, which we depend on. */ void DOMRangeImpl::updateRangeForDeletedNode(DOMNode* node) { if (node == 0) return; if (fRemoveChild == node) return; if (node->getParentNode() == fStartContainer) { XMLSize_t index = indexOf(node, fStartContainer); if ( fStartOffset > index) { fStartOffset--; } } if (node->getParentNode() == fEndContainer) { XMLSize_t index = indexOf(node, fEndContainer); if ( fEndOffset > index) { fEndOffset--; } } if (node->getParentNode() != fStartContainer || node->getParentNode() != fEndContainer) { if (isAncestorOf(node, fStartContainer)) { DOMNode* tpNode = node->getParentNode(); setStartContainer( tpNode ); fStartOffset = indexOf( node, tpNode); } if (isAncestorOf(node, fEndContainer)) { DOMNode* tpNode = node->getParentNode(); setEndContainer( tpNode ); fEndOffset = indexOf( node, tpNode); } } } void DOMRangeImpl::updateRangeForInsertedNode(DOMNode* node) { if (node == 0) return; if (node->getParentNode() == fStartContainer) { XMLSize_t index = indexOf(node, fStartContainer); if (index < fStartOffset) { fStartOffset++; } } if (node->getParentNode() == fEndContainer) { XMLSize_t index = indexOf(node, fEndContainer); if (index < fEndOffset) { fEndOffset++; } } } void DOMRangeImpl::updateSplitInfo(DOMNode* oldNode, DOMNode* startNode, XMLSize_t offset) { if (startNode == 0) return; short type = fStartContainer->getNodeType(); if (oldNode == fStartContainer && (type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { if (fStartOffset > offset) { fStartOffset = fStartOffset - offset; fStartContainer = startNode; } } type = fEndContainer->getNodeType(); if (oldNode == fEndContainer && (type == DOMNode::TEXT_NODE || type == DOMNode::CDATA_SECTION_NODE || type == DOMNode::COMMENT_NODE || type == DOMNode::PROCESSING_INSTRUCTION_NODE)) { if (fEndOffset > offset) { fEndContainer = startNode; fEndOffset = fEndOffset - offset; } } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp000644 000765 000024 00000174462 13241160337 024262 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLSSerializerImpl.cpp 1824086 2018-02-13 00:54:01Z scantor $ */ #include "DOMLSSerializerImpl.hpp" #include "DOMLSOutputImpl.hpp" #include "DOMErrorImpl.hpp" #include "DOMLocatorImpl.hpp" #include "DOMImplementationImpl.hpp" #include "DOMStringListImpl.hpp" #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local const data // // --------------------------------------------------------------------------- static const int INVALID_FEATURE_ID = -1; static const int CANONICAL_FORM_ID = 0x0; static const int DISCARD_DEFAULT_CONTENT_ID = 0x1; static const int ENTITIES_ID = 0x2; static const int FORMAT_PRETTY_PRINT_ID = 0x3; static const int NORMALIZE_CHARACTERS_ID = 0x4; static const int SPLIT_CDATA_SECTIONS_ID = 0x5; static const int VALIDATION_ID = 0x6; static const int WHITESPACE_IN_ELEMENT_CONTENT_ID = 0x7; static const int BYTE_ORDER_MARK_ID = 0x8; static const int XML_DECLARATION = 0x9; static const int FORMAT_PRETTY_PRINT_1ST_LEVEL_ID = 0xA; // feature true false // ================================================================================ //canonical-form [optional] Not Supported [required] (default) //discard-default-content [required] (default) [required] //entity [required] (default) [optional] //format-pretty-print [optional] Partially Supported [required] (default) //normalize-characters [optional] Not Supported [required] (default) //split-cdata-sections [required] (default) [required] //validation [optional] Not Supported [required] (default) //whitespace-in-element-content [requierd] (default) [optional] Not Supported // // // Each feature has 2 entries in this array, // the first for "true", // the second for "false". // static const bool featuresSupported[] = { false, true, // canonical-form true, true, // discard-default-content true, true, // entity true, true, // format-pretty-print false, true, // normalize-characters true, true, // split-cdata-sections false, true, // validation true, false, // whitespace-in-element-content true, true, // http://apache.org/xml/features/dom/byte-order-mark true, true, // xml-declaration true, true // http://apache.org/xml/features/pretty-print/space-first-level-elements }; // default end-of-line sequence static const XMLCh gEOLSeq[] = { chLF, chNull }; //UTF-8 static const XMLCh gUTF8[] = { chLatin_U, chLatin_T, chLatin_F, chDash, chDigit_8, chNull }; // static const XMLCh gEndPI[] = { chQuestion, chCloseAngle, chNull }; // static const XMLCh gXMLDecl_endtag[] = { chQuestion, chCloseAngle, chNull }; // static const XMLCh gEndCDATA[] = { // chCloseSquare, chCloseAngle, chCloseAngle, chNull // test only: ]>> chCloseSquare, chCloseSquare, chCloseAngle, chNull }; // static const XMLCh gEndComment[] = { chDash, chDash, chCloseAngle, chNull }; //setUnRepFlags(XMLFormatter::UnRep_Fail); \ try \ { \ action; \ } \ catch(TranscodingException const &e) \ { \ reportError(nodeToWrite, DOMError::DOM_SEVERITY_FATAL_ERROR, e.getMessage()); \ throw e; \ } DOMLSSerializerImpl::~DOMLSSerializerImpl() { fMemoryManager->deallocate(fNewLine);//delete [] fNewLine; delete fNamespaceStack; delete fSupportedParameters; // we don't own/adopt error handler and filter } DOMLSSerializerImpl::DOMLSSerializerImpl(MemoryManager* const manager) :fFeatures(0) ,fNewLine(0) ,fErrorHandler(0) ,fFilter(0) ,fDocumentVersion(XMLUni::fgVersion1_0) ,fSupportedParameters(0) ,fEncodingUsed(0) ,fNewLineUsed(0) ,fFormatter(0) ,fErrorCount(0) ,fCurrentLine(0) ,fLineFeedInTextNodePrinted(false) ,fLastWhiteSpaceInTextNode(0) ,fIsXml11(false) ,fNamespaceStack(0) ,fMemoryManager(manager) { fNamespaceStack=new (fMemoryManager) RefVectorOf< RefHashTableOf >(1,true, fMemoryManager); // // set features to default setting // setFeature(CANONICAL_FORM_ID, false); setFeature(DISCARD_DEFAULT_CONTENT_ID, true ); setFeature(ENTITIES_ID, true ); setFeature(FORMAT_PRETTY_PRINT_ID, false); setFeature(NORMALIZE_CHARACTERS_ID, false); setFeature(SPLIT_CDATA_SECTIONS_ID, true ); setFeature(VALIDATION_ID, false); setFeature(WHITESPACE_IN_ELEMENT_CONTENT_ID, true ); setFeature(BYTE_ORDER_MARK_ID, false); setFeature(XML_DECLARATION, true ); setFeature(FORMAT_PRETTY_PRINT_1ST_LEVEL_ID, true ); fSupportedParameters=new (fMemoryManager) DOMStringListImpl(12, fMemoryManager); fSupportedParameters->add(XMLUni::fgDOMErrorHandler); fSupportedParameters->add(XMLUni::fgDOMWRTCanonicalForm); fSupportedParameters->add(XMLUni::fgDOMWRTDiscardDefaultContent); fSupportedParameters->add(XMLUni::fgDOMWRTEntities); fSupportedParameters->add(XMLUni::fgDOMWRTFormatPrettyPrint); fSupportedParameters->add(XMLUni::fgDOMWRTNormalizeCharacters); fSupportedParameters->add(XMLUni::fgDOMWRTSplitCdataSections); fSupportedParameters->add(XMLUni::fgDOMWRTValidation); fSupportedParameters->add(XMLUni::fgDOMWRTWhitespaceInElementContent); fSupportedParameters->add(XMLUni::fgDOMWRTBOM); fSupportedParameters->add(XMLUni::fgDOMXMLDeclaration); fSupportedParameters->add(XMLUni::fgDOMWRTXercesPrettyPrint); } bool DOMLSSerializerImpl::canSetParameter(const XMLCh* featName , const void* /*value*/) const { if(XMLString::compareIStringASCII(featName, XMLUni::fgDOMErrorHandler)==0) return true; return false; } bool DOMLSSerializerImpl::canSetParameter(const XMLCh* featName , bool state) const { int featureId = INVALID_FEATURE_ID; return checkFeature(featName, false, featureId) ? canSetFeature(featureId, state) : false; } void DOMLSSerializerImpl::setParameter(const XMLCh* featName , const void* value) { if(XMLString::compareIStringASCII(featName, XMLUni::fgDOMErrorHandler)==0) fErrorHandler = (DOMErrorHandler*)value; else throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, fMemoryManager); } void DOMLSSerializerImpl::setParameter(const XMLCh* featName , bool state) { int featureId = INVALID_FEATURE_ID; checkFeature(featName, true, featureId); if (!canSetFeature(featureId, state)) throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, fMemoryManager); setFeature(featureId, state); // // setting "canonical-form" to true will set the parameters "format-pretty-print", // "discard-default-content", and "xml-declaration", to false // if ((featureId == CANONICAL_FORM_ID) && state) { setFeature(FORMAT_PRETTY_PRINT_ID, false); setFeature(FORMAT_PRETTY_PRINT_1ST_LEVEL_ID, false); setFeature(DISCARD_DEFAULT_CONTENT_ID, false); setFeature(XML_DECLARATION, false); } // Setting one of those parameters to true will set "canonical-form" to false. if ((featureId == FORMAT_PRETTY_PRINT_ID || featureId == DISCARD_DEFAULT_CONTENT_ID || featureId == XML_DECLARATION) && state) setFeature(CANONICAL_FORM_ID, false); } const void* DOMLSSerializerImpl::getParameter(const XMLCh* featName) const { if(XMLString::compareIStringASCII(featName, XMLUni::fgDOMErrorHandler)==0) { return (void*)fErrorHandler; } else { int featureId = INVALID_FEATURE_ID; checkFeature(featName, true, featureId); return (void*)getFeature(featureId); } } const DOMStringList* DOMLSSerializerImpl::getParameterNames() const { return fSupportedParameters; } void DOMLSSerializerImpl::setNewLine(const XMLCh* const newLine) { fMemoryManager->deallocate(fNewLine);//delete [] fNewLine; fNewLine = XMLString::replicate(newLine, fMemoryManager); } const XMLCh* DOMLSSerializerImpl::getNewLine() const { return fNewLine; } void DOMLSSerializerImpl::setFilter(DOMLSSerializerFilter *filter) { fFilter = filter; } DOMLSSerializerFilter* DOMLSSerializerImpl::getFilter() const { return fFilter; } // // // bool DOMLSSerializerImpl::write(const DOMNode* nodeToWrite, DOMLSOutput* const destination) { XMLFormatTarget* pTarget=destination->getByteStream(); Janitor janTarget(0); if(!pTarget) { const XMLCh* szSystemId=destination->getSystemId(); if(!szSystemId) { //TODO: report error "missing target" return false; } pTarget=new LocalFileFormatTarget(szSystemId, fMemoryManager); janTarget.reset(pTarget); } /** * When writing to a LSOutput, the encoding is found by looking at the encoding information * that is reachable through the LSOutput and the item to be written (or its owner document) in this order: * * 1. LSOutput.encoding, * 2. Document.inputEncoding, * 3. Document.xmlEncoding. * * If no encoding is reachable through the above properties, a default encoding of "UTF-8" will be used. * If the specified encoding is not supported an "unsupported-encoding" fatal error is raised. */ fEncodingUsed = gUTF8; const DOMDocument *docu = (nodeToWrite->getNodeType() == DOMNode::DOCUMENT_NODE)? (const DOMDocument*)nodeToWrite : nodeToWrite->getOwnerDocument(); const XMLCh* lsEncoding=destination->getEncoding(); if (lsEncoding && *lsEncoding) { fEncodingUsed = lsEncoding; } else if (docu) { const XMLCh* tmpEncoding = docu->getInputEncoding(); if ( tmpEncoding && *tmpEncoding) { fEncodingUsed = tmpEncoding; } else { tmpEncoding = docu->getXmlEncoding(); if ( tmpEncoding && *tmpEncoding) { fEncodingUsed = tmpEncoding; } } } /** * The end-of-line sequence of characters to be used in the XML being * written out. The only permitted values are these: * . null * * Use a default end-of-line sequence. DOM implementations should choose * the default to match the usual convention for text files in the * environment being used. Implementations must choose a default * sequence that matches one of those allowed by 2.11 "End-of-Line * Handling". * * CR The carriage-return character (#xD) * CR-LF The carriage-return and line-feed characters (#xD #xA) * LF The line-feed character (#xA) * * The default value for this attribute is null */ fNewLineUsed = (fNewLine && *fNewLine)? fNewLine : gEOLSeq; /** * get Document Version */ fDocumentVersion = (docu && docu->getXmlVersion() && *(docu->getXmlVersion()))?docu->getXmlVersion():XMLUni::fgVersion1_0; fIsXml11 = XMLString::equals(fDocumentVersion, XMLUni::fgVersion1_1); fErrorCount = 0; fLineFeedInTextNodePrinted = false; fLastWhiteSpaceInTextNode = 0; try { fFormatter = new (fMemoryManager) XMLFormatter( fEncodingUsed ,fDocumentVersion ,pTarget ,XMLFormatter::NoEscapes ,XMLFormatter::UnRep_CharRef ,fMemoryManager); } catch (const TranscodingException& e) { reportError(nodeToWrite, DOMError::DOM_SEVERITY_FATAL_ERROR, e.getMessage()); return false; } try { Janitor janName(fFormatter); processNode(nodeToWrite); pTarget->flush(); } // // The serialize engine (processNode) throws an exception to abort // serialization if // // . A fatal error occurs which renders the output ill-formed, or // . Instructed by the application's error handler // catch (const TranscodingException&) { pTarget->flush(); return false; } catch (const XMLDOMMsg::Codes) { pTarget->flush(); return false; } catch(const OutOfMemoryException&) { throw; } catch (...) { pTarget->flush(); throw; } // // true if node was successfully serialized and // false in case a failure occured and the // failure wasn't canceled by the error handler. // return ((fErrorCount == 0)? true : false); } bool DOMLSSerializerImpl::writeToURI(const DOMNode* nodeToWrite, const XMLCh* uri) { DOMLSOutputImpl output(fMemoryManager); output.setSystemId(uri); return write(nodeToWrite, &output); } // // We don't throw DOMSTRING_SIZE_ERR since we are no longer // using DOMString. // XMLCh* DOMLSSerializerImpl::writeToString(const DOMNode* nodeToWrite, MemoryManager* manager /*= NULL*/) { if(manager==NULL) manager = fMemoryManager; MemBufFormatTarget destination(1023, manager); bool retVal; bool bBOMFlag=getFeature(BYTE_ORDER_MARK_ID); setFeature(BYTE_ORDER_MARK_ID, false); try { DOMLSOutputImpl output(manager); output.setByteStream(&destination); output.setEncoding(XMLUni::fgUTF16EncodingString); retVal = write(nodeToWrite, &output); } catch(const OutOfMemoryException&) { throw; } catch (...) { // // there is a possibility that memory allocation // exception thrown in XMLBuffer class // setFeature(BYTE_ORDER_MARK_ID, bBOMFlag); return 0; } setFeature(BYTE_ORDER_MARK_ID, bBOMFlag); return (retVal ? XMLString::replicate(reinterpret_cast(destination.getRawBuffer()), manager) : 0); } // // Characters not representable in output encoding, // // 1. CHARACTER DATA (outside of markup) --- no error // ordinary character -> numeric character reference // '<' and '&' -> < and & // // 2. Within MARKUP, but outside of attributes // reported as an error --- ERROR // markup: // start tag done // end tag done // empty element tag done // entity references done // character references // REVISIT // comments done // CDATA section delimiters done, done // document type declarartions done // processing instructions (PI) done // // 3. With in ATTRIBUTE // -> numeric character reference // no quotes -> in quotes // with quotes, no apostrophe -> in apostrophe // with quotes and apostrophe -> in quotes and " // // 4. CDATA sections // "split_cdata_section" true --- char ref // false --- ERROR // // --------------------------------------------------------------------------- // Stream out a DOM node, and, recursively, all of its children. This // function is the heart of writing a DOM tree out as XML source. Give it // a document node and it will do the whole thing. // --------------------------------------------------------------------------- void DOMLSSerializerImpl::processNode(const DOMNode* const nodeToWrite, int level) { // Get the name and value out for convenience const XMLCh* nodeName = nodeToWrite->getNodeName(); const XMLCh* nodeValue = nodeToWrite->getNodeValue(); XMLSize_t lent = XMLString::stringLen(nodeValue); switch (nodeToWrite->getNodeType()) { case DOMNode::TEXT_NODE: { if (checkFilter(nodeToWrite) != DOMNodeFilter::FILTER_ACCEPT) break; ensureValidString(nodeToWrite, nodeValue); if (getFeature(FORMAT_PRETTY_PRINT_ID)) { fLineFeedInTextNodePrinted = false; fLastWhiteSpaceInTextNode = 0; if(XMLChar1_0::isAllSpaces(nodeValue, XMLString::stringLen(nodeValue))) { // skips whitespace-only text nodes unless whitespace-in-element is set. if (!getFeature(WHITESPACE_IN_ELEMENT_CONTENT_ID)) { break; } else { // // we need to trace if newline(s) have been printed out // to avoid generate extra newline for pretty printing, // as well as the number of whitespaces after the last // newline character to do indentation properly. // int pos = XMLString::lastIndexOf(nodeValue, chLF); if (-1 != pos) { fLineFeedInTextNodePrinted = true; fLastWhiteSpaceInTextNode = (unsigned int)(lent - pos); } else { // for those platforms using chCR alone as // a newline character pos = XMLString::lastIndexOf(nodeValue, chCR); if (-1 != pos) { fLineFeedInTextNodePrinted = true; fLastWhiteSpaceInTextNode = (unsigned int)(lent - pos); } } } } } setURCharRef(); // character data fFormatter->formatBuf(nodeValue, lent, XMLFormatter::CharEscapes); break; } case DOMNode::PROCESSING_INSTRUCTION_NODE: { if (checkFilter(nodeToWrite) != DOMNodeFilter::FILTER_ACCEPT) break; ensureValidString(nodeToWrite, nodeName); ensureValidString(nodeToWrite, nodeValue); if(level == 1 && getFeature(FORMAT_PRETTY_PRINT_1ST_LEVEL_ID)) printNewLine(); printNewLine(); printIndent(level); TRY_CATCH_THROW ( *fFormatter << XMLFormatter::NoEscapes << gStartPI << nodeName; if (lent > 0) { *fFormatter << chSpace << nodeValue; } *fFormatter << gEndPI; ) break; } case DOMNode::DOCUMENT_NODE: // Not to be shown to Filter { // output BOM if needed processBOM(); setURCharRef(); const DOMDocument *docu = (const DOMDocument*)nodeToWrite; //[23] XMLDecl ::= '' //[24] VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"') //[80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName //[32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"')) // if (getFeature(XML_DECLARATION)) { // use the version and encoding resolved *fFormatter << gXMLDecl_VersionInfo << fDocumentVersion << gXMLDecl_separator; *fFormatter << gXMLDecl_EncodingDecl << fEncodingUsed << gXMLDecl_separator; const XMLCh* st = (docu->getXmlStandalone())? XMLUni::fgYesString : XMLUni::fgNoString; *fFormatter << gXMLDecl_SDDecl << st << gXMLDecl_separator; *fFormatter << gXMLDecl_endtag; } DOMNodeSPtr child = nodeToWrite->getFirstChild(); while( child != 0) { processNode(child, level); child = child->getNextSibling(); } printNewLine(); break; } case DOMNode::DOCUMENT_FRAGMENT_NODE: { setURCharRef(); DOMNode *child = nodeToWrite->getFirstChild(); while( child != 0) { processNode(child, level); child = child->getNextSibling(); } printNewLine(); break; } case DOMNode::ELEMENT_NODE: { DOMNodeFilter::FilterAction filterAction = checkFilter(nodeToWrite); if ( filterAction == DOMNodeFilter::FILTER_REJECT) break; if (!fLineFeedInTextNodePrinted) { if(level == 1 && getFeature(FORMAT_PRETTY_PRINT_1ST_LEVEL_ID)) printNewLine(); printNewLine(); } else { fLineFeedInTextNodePrinted = false; } printIndent(level); //track the line number the current node begins on int nodeLine = fCurrentLine; // add an entry in the namespace stack RefHashTableOf* namespaceMap=NULL; if ( filterAction == DOMNodeFilter::FILTER_ACCEPT) { // this element attributes child elements // accept yes yes yes // skip no no yes // TRY_CATCH_THROW ( // The name has to be representable without any escapes *fFormatter << XMLFormatter::NoEscapes << chOpenAngle << nodeName; ) // Output any attributes on this element setURCharRef(); DOMNamedNodeMap *attributes = nodeToWrite->getAttributes(); XMLSize_t attrCount = attributes->getLength(); // check if the namespace for the current node is already defined const XMLCh* prefix = nodeToWrite->getPrefix(); const XMLCh* uri = nodeToWrite->getNamespaceURI(); if((uri && uri[0]) || ((prefix==0 || prefix[0]==0) && isDefaultNamespacePrefixDeclared())) { if(prefix==0 || prefix[0]==0) prefix=XMLUni::fgZeroLenString; if(!isNamespaceBindingActive(prefix, uri)) { if(namespaceMap==NULL) { namespaceMap=new (fMemoryManager) RefHashTableOf(12, false, fMemoryManager); fNamespaceStack->addElement(namespaceMap); } namespaceMap->put((void*)prefix,(XMLCh*)uri); *fFormatter << XMLFormatter::NoEscapes << chSpace << XMLUni::fgXMLNSString; if(!XMLString::equals(prefix,XMLUni::fgZeroLenString)) *fFormatter << chColon << prefix; *fFormatter << chEqual << chDoubleQuote << XMLFormatter::AttrEscapes << uri << XMLFormatter::NoEscapes << chDoubleQuote; } } bool discard = getFeature(DISCARD_DEFAULT_CONTENT_ID); for (XMLSize_t i = 0; i < attrCount; i++) { DOMAttrSPtr attribute = (DOMAttr*)attributes->item(i); // Not to be shown to Filter // //"discard-default-content" // true // [required] (default) // Use whatever information available to the implementation // (i.e. XML schema, DTD, the specified flag on Attr nodes, // and so on) to decide what attributes and content should be // discarded or not. // Note that the specified flag on Attr nodes in itself is // not always reliable, it is only reliable when it is set // to false since the only case where it can be set to false // is if the attribute was created by the implementation. // The default content won't be removed if an implementation // does not have any information available. // false // [required] // Keep all attributes and all content. // if (discard && !((DOMAttr*)attribute )->getSpecified()) continue; // // Again the name has to be completely representable. But the // attribute can have refs and requires the attribute style // escaping. // // if this attribute is a namespace declaration, add it to the namespace map for the current level const XMLCh* ns = attribute->getNamespaceURI(); if (ns != 0 ) { if(XMLString::equals(ns, XMLUni::fgXMLNSURIName)) { if(namespaceMap==NULL) { namespaceMap=new (fMemoryManager) RefHashTableOf(12, false, fMemoryManager); fNamespaceStack->addElement(namespaceMap); } const XMLCh* nsPrefix = attribute->getLocalName(); if(XMLString::equals(attribute->getNodeName(),XMLUni::fgXMLNSString)) nsPrefix = XMLUni::fgZeroLenString; if(namespaceMap->containsKey((void*)nsPrefix)) continue; namespaceMap->put((void*)attribute->getLocalName(),(XMLCh*)attribute->getNodeValue()); } else if(!XMLString::equals(ns, XMLUni::fgXMLURIName)) { // check if the namespace for the current node is already defined const XMLCh* prefix = attribute->getPrefix(); if(prefix && prefix[0]) { const XMLCh* uri = attribute->getNamespaceURI(); if(!isNamespaceBindingActive(prefix, uri)) { if(namespaceMap==NULL) { namespaceMap=new (fMemoryManager) RefHashTableOf(12, false, fMemoryManager); fNamespaceStack->addElement(namespaceMap); } namespaceMap->put((void*)prefix,(XMLCh*)uri); *fFormatter << XMLFormatter::NoEscapes << chSpace << XMLUni::fgXMLNSString << chColon << prefix << chEqual << chDoubleQuote << XMLFormatter::AttrEscapes << uri << XMLFormatter::NoEscapes << chDoubleQuote; } } } } if (XMLString::equals(ns, XMLUni::fgXMLNSURIName) || checkFilter(attribute) == DOMNodeFilter::FILTER_ACCEPT) { *fFormatter << XMLFormatter::NoEscapes << chSpace << attribute->getNodeName() << chEqual << chDoubleQuote << XMLFormatter::AttrEscapes; if (getFeature(ENTITIES_ID)) { DOMNodeSPtr child = attribute->getFirstChild(); while( child != 0) { if(child->getNodeType()==DOMNode::TEXT_NODE) { ensureValidString(attribute, child->getNodeValue()); *fFormatter << child->getNodeValue(); } else if(child->getNodeType()==DOMNode::ENTITY_REFERENCE_NODE) *fFormatter << XMLFormatter::NoEscapes << chAmpersand << child->getNodeName() << chSemiColon << XMLFormatter::AttrEscapes; child = child->getNextSibling(); } } else { ensureValidString(attribute, attribute->getNodeValue()); *fFormatter << attribute->getNodeValue(); } *fFormatter << XMLFormatter::NoEscapes << chDoubleQuote; } } // end of for } // end of FILTER_ACCEPT level++; // FILTER_SKIP may start from here // // Test for the presence of children, which includes both // text content and nested elements. // DOMNodeSPtr child = nodeToWrite->getFirstChild(); if (child != 0) { // There are children. Close start-tag, and output children. // No escapes are legal here if (filterAction == DOMNodeFilter::FILTER_ACCEPT) *fFormatter << XMLFormatter::NoEscapes << chCloseAngle; while( child != 0) { processNode(child, level); child = child->getNextSibling(); } level--; if (filterAction == DOMNodeFilter::FILTER_ACCEPT) { //if we are not on the same line as when we started //this node then print a new line and indent if(nodeLine != fCurrentLine) { if (!fLineFeedInTextNodePrinted) { printNewLine(); } else { fLineFeedInTextNodePrinted = false; } if(nodeLine != fCurrentLine && level == 0 && getFeature(FORMAT_PRETTY_PRINT_1ST_LEVEL_ID)) printNewLine(); printIndent(level); } TRY_CATCH_THROW ( *fFormatter << XMLFormatter::NoEscapes << gEndElement << nodeName << chCloseAngle; ) } } else { level--; // // There were no children. Output the short form close of // the element start tag, making it an empty-element tag. // if (filterAction == DOMNodeFilter::FILTER_ACCEPT) { TRY_CATCH_THROW ( *fFormatter << XMLFormatter::NoEscapes << chForwardSlash << chCloseAngle; ) } } // remove the namespace map at this level if(namespaceMap!=NULL) fNamespaceStack->removeLastElement(); break; } case DOMNode::ATTRIBUTE_NODE: { if (checkFilter(nodeToWrite) != DOMNodeFilter::FILTER_ACCEPT) break; const XMLCh* localName = nodeToWrite->getLocalName(); // check if this is a DOM Level 1 Node if(localName == 0) *fFormatter << XMLFormatter::NoEscapes << nodeToWrite->getNodeName(); else *fFormatter << XMLFormatter::NoEscapes << chOpenCurly << nodeToWrite->getNamespaceURI() << chCloseCurly << localName; *fFormatter << chEqual << chDoubleQuote << XMLFormatter::AttrEscapes; if (getFeature(ENTITIES_ID)) { DOMNodeSPtr child = nodeToWrite->getFirstChild(); while( child != 0) { if(child->getNodeType()==DOMNode::TEXT_NODE) { ensureValidString(nodeToWrite, child->getNodeValue()); *fFormatter << child->getNodeValue(); } else if(child->getNodeType()==DOMNode::ENTITY_REFERENCE_NODE) *fFormatter << XMLFormatter::NoEscapes << chAmpersand << child->getNodeName() << chSemiColon << XMLFormatter::AttrEscapes; child = child->getNextSibling(); } } else { ensureValidString(nodeToWrite, nodeValue); *fFormatter << nodeValue; } *fFormatter << XMLFormatter::NoEscapes << chDoubleQuote; break; } case DOMNode::ENTITY_REFERENCE_NODE: { //"entities" //true //[required] (default) //Keep EntityReference and Entity nodes in the document. //false //[optional] //Remove all EntityReference and Entity nodes from the document, // putting the entity expansions directly in their place. // Text nodes are into "normal" form. //Only EntityReference nodes to non-defined entities are kept in the document. if (checkFilter(nodeToWrite) != DOMNodeFilter::FILTER_ACCEPT) break; if (getFeature(ENTITIES_ID)) { TRY_CATCH_THROW ( *fFormatter << XMLFormatter::NoEscapes << chAmpersand << nodeName << chSemiColon; ) } else { // check if the referenced entity is defined or not if (nodeToWrite->getOwnerDocument()->getDoctype()->getEntities()->getNamedItem(nodeName)) { DOMNodeSPtr child; for (child = nodeToWrite->getFirstChild(); child != 0; child = child->getNextSibling()) { processNode(child, level); } } else { TRY_CATCH_THROW ( *fFormatter< unrep-char // =============================================================== // true split split // false fails fails // case DOMNode::CDATA_SECTION_NODE: { if (checkFilter(nodeToWrite) != DOMNodeFilter::FILTER_ACCEPT) break; if (getFeature(SPLIT_CDATA_SECTIONS_ID)) { // it is fairly complicated and we process this // in a separate function. procCdataSection(nodeValue, nodeToWrite); } else { ensureValidString(nodeToWrite, nodeValue); // search for "]]>", the node value is not supposed to have this if (XMLString::patternMatch(nodeValue, gEndCDATA) != -1) { reportError(nodeToWrite, DOMError::DOM_SEVERITY_FATAL_ERROR, XMLDOMMsg::Writer_NestedCDATA); } TRY_CATCH_THROW ( // transcoder throws exception for unrep chars *fFormatter << XMLFormatter::NoEscapes << gStartCDATA << nodeValue << gEndCDATA; ) } break; } case DOMNode::COMMENT_NODE: { if (checkFilter(nodeToWrite) != DOMNodeFilter::FILTER_ACCEPT) break; ensureValidString(nodeToWrite, nodeValue); // Figure out if we want pretty-printing for this comment. // If this comment node does not have any element siblings // (i.e., it is a text node) then we don't want to add any // whitespaces since that might be significant to the // application. Otherwise we want pretty-printing. // bool pretty = (level == 0); // Document-level comments. if (!pretty) { // See if we have any element siblings. // const DOMNode* s = nodeToWrite->getNextSibling (); while (s != 0 && s->getNodeType () != DOMNode::ELEMENT_NODE) s = s->getNextSibling (); if (s != 0) pretty = true; else { s = nodeToWrite->getPreviousSibling (); while (s != 0 && s->getNodeType () != DOMNode::ELEMENT_NODE) s = s->getPreviousSibling (); if (s != 0) pretty = true; } } if (pretty) { if(level == 1 && getFeature(FORMAT_PRETTY_PRINT_1ST_LEVEL_ID)) printNewLine(); printNewLine(); printIndent(level); } TRY_CATCH_THROW ( *fFormatter << XMLFormatter::NoEscapes << gStartComment << nodeValue << gEndComment; ) break; } case DOMNode::DOCUMENT_TYPE_NODE: // Not to be shown to Filter { const DOMDocumentType *doctype = (const DOMDocumentType *)nodeToWrite; fFormatter->setEscapeFlags(XMLFormatter::NoEscapes); printNewLine(); printIndent(level); TRY_CATCH_THROW ( *fFormatter << gStartDoctype << nodeName; const XMLCh *id = doctype->getPublicId(); if (id && *id) { *fFormatter << chSpace << gPublic << id << chDoubleQuote; id = doctype->getSystemId(); if (id && *id) { *fFormatter << chSpace << chDoubleQuote << id << chDoubleQuote; } else { // // 4.2.2 External Entities // [Definition: If the entity is not internal, // it is an external entity, declared as follows:] // External Entity Declaration // [75] ExternalID ::= 'SYSTEM' S SystemLiteral // | 'PUBLIC' S PubidLiteral S SystemLiteral // reportError(nodeToWrite, DOMError::DOM_SEVERITY_FATAL_ERROR, XMLDOMMsg::Writer_NotRecognizedType); // systemLiteral not found } } else { id = doctype->getSystemId(); if (id && *id) { *fFormatter << chSpace << gSystem << id << chDoubleQuote; } } id = doctype->getInternalSubset(); if (id && *id) { *fFormatter << chSpace << chOpenSquare << id << chCloseSquare; } *fFormatter << chCloseAngle; ) // end of TRY_CATCH_THROW break; } case DOMNode::ENTITY_NODE: // Not to be shown to Filter { // // REVISIT: how does the feature "entities" impact // entity node? // printNewLine(); printIndent(level); fFormatter->setEscapeFlags(XMLFormatter::NoEscapes); *fFormatter << gStartEntity << nodeName; const XMLCh * id = ((const DOMEntity*)nodeToWrite)->getPublicId(); if (id) *fFormatter << gPublic << id << chDoubleQuote; id = ((const DOMEntity*)nodeToWrite)->getSystemId(); if (id) *fFormatter << gSystem << id << chDoubleQuote; id = ((const DOMEntity*)nodeToWrite)->getNotationName(); if (id) *fFormatter << gNotation << id << chDoubleQuote; *fFormatter << chCloseAngle; break; } default: /*** This is an implementation specific behaviour, we abort if a user derived class has not dealt with this node type. ***/ { if(!customNodeSerialize(nodeToWrite, level)) { reportError(nodeToWrite, DOMError::DOM_SEVERITY_FATAL_ERROR, XMLDOMMsg::Writer_NotRecognizedType); // UnreognizedNodeType; } } break; } } bool DOMLSSerializerImpl::customNodeSerialize(const DOMNode* const, int) { return false; } // // DOMNodeFilter::FilterAction DOMLSSerializerImpl::checkFilter(const DOMNode* const node) const { if (!fFilter || ((fFilter->getWhatToShow() & (1 << (node->getNodeType() - 1))) == 0)) return DOMNodeFilter::FILTER_ACCEPT; // // if and only if there is a filter, and it is interested // in the node type, then we pass the node to the filter // for examination // return (DOMNodeFilter::FilterAction) fFilter->acceptNode(node); } bool DOMLSSerializerImpl::checkFeature(const XMLCh* const featName , bool toThrow , int& featureId) const { // check for null and/or empty feature name if (!featName || !*featName) { if (toThrow) throw DOMException(DOMException::NOT_FOUND_ERR, 0, fMemoryManager); return false; } featureId = INVALID_FEATURE_ID; if (XMLString::equals(featName, XMLUni::fgDOMWRTCanonicalForm)) featureId = CANONICAL_FORM_ID; else if (XMLString::equals(featName, XMLUni::fgDOMWRTDiscardDefaultContent)) featureId = DISCARD_DEFAULT_CONTENT_ID; else if (XMLString::equals(featName, XMLUni::fgDOMWRTEntities)) featureId = ENTITIES_ID; else if (XMLString::equals(featName, XMLUni::fgDOMWRTFormatPrettyPrint)) featureId = FORMAT_PRETTY_PRINT_ID; else if (XMLString::equals(featName, XMLUni::fgDOMWRTNormalizeCharacters)) featureId = NORMALIZE_CHARACTERS_ID; else if (XMLString::equals(featName, XMLUni::fgDOMWRTSplitCdataSections)) featureId = SPLIT_CDATA_SECTIONS_ID; else if (XMLString::equals(featName, XMLUni::fgDOMWRTValidation)) featureId = VALIDATION_ID; else if (XMLString::equals(featName, XMLUni::fgDOMWRTWhitespaceInElementContent)) featureId = WHITESPACE_IN_ELEMENT_CONTENT_ID; else if (XMLString::equals(featName, XMLUni::fgDOMWRTBOM)) featureId = BYTE_ORDER_MARK_ID; else if (XMLString::equals(featName, XMLUni::fgDOMXMLDeclaration)) featureId = XML_DECLARATION; else if (XMLString::equals(featName, XMLUni::fgDOMWRTXercesPrettyPrint)) featureId = FORMAT_PRETTY_PRINT_1ST_LEVEL_ID; //feature name not resolvable if (featureId == INVALID_FEATURE_ID) { if (toThrow) throw DOMException(DOMException::NOT_FOUND_ERR, 0, fMemoryManager); return false; } return true; } bool DOMLSSerializerImpl::reportError(const DOMNode* const errorNode , DOMError::ErrorSeverity errorType , const XMLCh* const errorMsg) { bool toContinueProcess = true; // default value for no error handler if (fErrorHandler) { DOMLocatorImpl locator(0, 0, (DOMNode*) errorNode, 0); DOMErrorImpl domError(errorType , errorMsg, &locator); try { toContinueProcess = fErrorHandler->handleError(domError); } catch(...) { } } if (errorType != DOMError::DOM_SEVERITY_WARNING) fErrorCount++; return toContinueProcess; } bool DOMLSSerializerImpl::reportError(const DOMNode* const errorNode , DOMError::ErrorSeverity errorType , XMLDOMMsg::Codes toEmit) { const XMLSize_t msgSize = 1023; XMLCh errText[msgSize + 1]; DOMImplementationImpl::getMsgLoader4DOM()->loadMsg(toEmit, errText, msgSize); bool toContinueProcess = true; // default value for no error handler if (fErrorHandler) { DOMLocatorImpl locator(0, 0, (DOMNode*) errorNode, 0); DOMErrorImpl domError(errorType , errText, &locator); try { toContinueProcess = fErrorHandler->handleError(domError); } catch(...) { } } if (errorType != DOMError::DOM_SEVERITY_WARNING) fErrorCount++; if (errorType == DOMError::DOM_SEVERITY_FATAL_ERROR || !toContinueProcess) throw DOMLSException(DOMLSException::SERIALIZE_ERR, toEmit, fMemoryManager); return toContinueProcess; } // // // void DOMLSSerializerImpl::procCdataSection(const XMLCh* const nodeValue , const DOMNode* const nodeToWrite) { static const XMLSize_t offset = XMLString::stringLen(gEndCDATA); /*** * Append a ']]>' at the end */ XMLSize_t len = XMLString::stringLen(nodeValue); XMLCh* repNodeValue = (XMLCh*) fMemoryManager->allocate ( (len + offset + 1) * sizeof(XMLCh) );//new XMLCh [len + offset + 1]; XMLString::copyString(repNodeValue, nodeValue); XMLString::catString(repNodeValue, gEndCDATA); ArrayJanitor jName(repNodeValue, fMemoryManager); XMLCh* curPtr = (XMLCh*) repNodeValue; XMLCh* nextPtr = 0; int endTagPos = -1; bool endTagFound = true; while (endTagFound) { endTagPos = XMLString::patternMatch(curPtr, gEndCDATA); if (endTagPos != -1) { nextPtr = curPtr + endTagPos + offset; // skip the ']]>' *(curPtr + endTagPos) = chNull; //nullify the first ']' if (XMLSize_t(endTagPos) != len) reportError(nodeToWrite, DOMError::DOM_SEVERITY_WARNING, XMLDOMMsg::Writer_NestedCDATA); len = len - endTagPos - offset; } else { endTagFound = false; } /*** to check ]]>]]> ***/ if (endTagPos == 0) { TRY_CATCH_THROW ( *fFormatter << XMLFormatter::NoEscapes << gStartCDATA << gEndCDATA; ) } else { procUnrepCharInCdataSection(curPtr, nodeToWrite); } if (endTagFound) { *(nextPtr - offset) = chCloseSquare; //restore the first ']' curPtr = nextPtr; } } } // // // void DOMLSSerializerImpl::procUnrepCharInCdataSection(const XMLCh* const nodeValue , const DOMNode* const nodeToWrite) { // // We have to check each character and see if it could be represented. // As long as it can, we just keep up with where we started and how // many chars we've checked. When we hit an unrepresentable one, we // stop, transcode everything we've collected, then start handling // the unrepresentables via char refs. We repeat this until we get all // the chars done. // const XMLCh* srcPtr = nodeValue; const XMLCh* endPtr = nodeValue + XMLString::stringLen(nodeValue); // Set up the common part of the buffer that we build char refs into XMLCh tmpBuf[32]; tmpBuf[0] = chAmpersand; tmpBuf[1] = chPound; tmpBuf[2] = chLatin_x; while (srcPtr < endPtr) { const XMLCh* tmpPtr = srcPtr; while (tmpPtr < endPtr) { if (fFormatter->getTranscoder()->canTranscodeTo(*tmpPtr)) tmpPtr++; else break; } if (tmpPtr > srcPtr) { TRY_CATCH_THROW ( *fFormatter << XMLFormatter::NoEscapes << gStartCDATA; ) // We got at least some chars that can be done normally fFormatter->formatBuf ( srcPtr , tmpPtr - srcPtr , XMLFormatter::NoEscapes , XMLFormatter::UnRep_Fail ); TRY_CATCH_THROW ( *fFormatter << XMLFormatter::NoEscapes << gEndCDATA; ) // Update the source pointer to our new spot srcPtr = tmpPtr; } else { // // We hit something unrepresentable. So continue forward doing // char refs until we hit something representable again or the // end of input. // // one warning for consective unrep chars reportError(nodeToWrite, DOMError::DOM_SEVERITY_WARNING, XMLDOMMsg::Writer_NotRepresentChar); while (srcPtr < endPtr) { // Build a char ref for the current char XMLString::binToText(*srcPtr, &tmpBuf[3], 8, 16, fMemoryManager); const XMLSize_t bufLen = XMLString::stringLen(tmpBuf); tmpBuf[bufLen] = chSemiColon; tmpBuf[bufLen+1] = chNull; // And now call recursively back to our caller to format this fFormatter->formatBuf ( tmpBuf , bufLen + 1 , XMLFormatter::NoEscapes , XMLFormatter::UnRep_Fail ); // Move up the source pointer and break out if needed srcPtr++; if (fFormatter->getTranscoder()->canTranscodeTo(*srcPtr)) break; } } } } void DOMLSSerializerImpl::processNode(const DOMNode* const nodeToWrite) { processNode(nodeToWrite, 0); } bool DOMLSSerializerImpl::canSetFeature(const int featureId , bool val) const { return featuresSupported[2*featureId + (val? 0: 1)]; } void DOMLSSerializerImpl::printNewLine() { if (getFeature(FORMAT_PRETTY_PRINT_ID)) { fCurrentLine++; *fFormatter << fNewLineUsed; } } void DOMLSSerializerImpl::printIndent(unsigned int level) { if (getFeature(FORMAT_PRETTY_PRINT_ID)) { if (fLastWhiteSpaceInTextNode) { unsigned int indentLevel = fLastWhiteSpaceInTextNode/2; // two chSpaces equals one indent level fLastWhiteSpaceInTextNode = 0; // if fLastWhiteSpaceInTextNode/2 is greater than level, then // it means too many spaces have been written to the // output stream and we can no longer indent properly if(indentLevel < level) level -= indentLevel; else level = 0; } for(unsigned int i = 0; i < level; i++) *fFormatter << chSpace << chSpace; } } void DOMLSSerializerImpl::release() { DOMLSSerializerImpl* writer = (DOMLSSerializerImpl*) this; delete writer; } void DOMLSSerializerImpl::processBOM() { // if the feature is not set, don't output bom if (!getFeature(BYTE_ORDER_MARK_ID)) return; if ((XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF8EncodingString) == 0) || (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF8EncodingString2) == 0) ) { fFormatter->writeBOM(BOM_utf8, 3); } else if ((XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16LEncodingString) == 0) || (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16LEncodingString2) == 0) ) { fFormatter->writeBOM(BOM_utf16le, 2); } else if ((XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16BEncodingString) == 0) || (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16BEncodingString2) == 0) ) { fFormatter->writeBOM(BOM_utf16be, 2); } else if ((XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16EncodingString) == 0) || (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16EncodingString2) == 0) || (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16EncodingString3) == 0) || (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16EncodingString4) == 0) || (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16EncodingString5) == 0) || (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16EncodingString6) == 0) || (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16EncodingString7) == 0) ) { if (XMLPlatformUtils::fgXMLChBigEndian) fFormatter->writeBOM(BOM_utf16be, 2); else fFormatter->writeBOM(BOM_utf16le, 2); } else if ((XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4LEncodingString) == 0) || (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4LEncodingString2) == 0) ) { fFormatter->writeBOM(BOM_ucs4le, 4); } else if ((XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4BEncodingString) == 0) || (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4BEncodingString2) == 0) ) { fFormatter->writeBOM(BOM_ucs4be, 4); } else if ((XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4EncodingString) == 0) || (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4EncodingString2) == 0) || (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4EncodingString3) == 0) || (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4EncodingString4) == 0) || (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4EncodingString5) == 0) ) { if (XMLPlatformUtils::fgXMLChBigEndian) fFormatter->writeBOM(BOM_ucs4be, 4); else fFormatter->writeBOM(BOM_ucs4le, 4); } } bool DOMLSSerializerImpl::isDefaultNamespacePrefixDeclared() const { for(XMLSize_t i=fNamespaceStack->size();i>0;i--) { RefHashTableOf* curNamespaceMap=fNamespaceStack->elementAt(i-1); const XMLCh* thisUri=curNamespaceMap->get((void*)XMLUni::fgZeroLenString); if(thisUri) return true; } return false; } bool DOMLSSerializerImpl::isNamespaceBindingActive(const XMLCh* prefix, const XMLCh* uri) const { for(XMLSize_t i=fNamespaceStack->size();i>0;i--) { RefHashTableOf* curNamespaceMap=fNamespaceStack->elementAt(i-1); const XMLCh* thisUri=curNamespaceMap->get((void*)prefix); // if the prefix has been declared, check if it binds to the correct namespace, otherwise, reports it isn't bound if(thisUri) return XMLString::equals(thisUri,uri); } return false; } void DOMLSSerializerImpl::ensureValidString(const DOMNode* nodeToWrite, const XMLCh* string) { // XERCESC-1854: prevent illegal characters from being written // XERCESC-2130: allow surrogates if(string==0) return; const XMLCh* cursor=string; while(*cursor!=0) { if((fIsXml11 && !XMLChar1_1::isXMLChar(*cursor)) || (!fIsXml11 && !XMLChar1_0::isXMLChar(*cursor))) { if((*cursor >= 0xD800) && (*cursor <= 0xDBFF)) { XMLCh leadingSurrogate = *cursor; cursor++; if(0==*cursor || (fIsXml11 && !XMLChar1_1::isXMLChar(leadingSurrogate, *cursor)) || (!fIsXml11 && !XMLChar1_0::isXMLChar(leadingSurrogate, *cursor))) { reportError(nodeToWrite, DOMError::DOM_SEVERITY_FATAL_ERROR, XMLDOMMsg::INVALID_CHARACTER_ERR); return; // leave if reportError does not throw } } else { reportError(nodeToWrite, DOMError::DOM_SEVERITY_FATAL_ERROR, XMLDOMMsg::INVALID_CHARACTER_ERR); } } cursor++; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMErrorImpl.hpp000644 000765 000024 00000011176 13241160337 023000 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMErrorImpl.hpp 676853 2008-07-15 09:58:05Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMERRORIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMERRORIMPL_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * Introduced in DOM Level 3 * Implementation of a DOMError interface. * * @see DOMError#DOMError */ class CDOM_EXPORT DOMErrorImpl : public DOMError { public: /** @name Constructors and Destructor */ //@{ /** Constructors */ DOMErrorImpl(const ErrorSeverity severity); DOMErrorImpl ( const ErrorSeverity severity , const XMLCh* const message , DOMLocator* const location ); DOMErrorImpl ( const ErrorSeverity severity , const XMLCh* type , const XMLCh* message , void* relatedData ); /** Desctructor */ virtual ~DOMErrorImpl(); //@} // DOMError interface virtual ErrorSeverity getSeverity() const; virtual const XMLCh* getMessage() const; virtual DOMLocator* getLocation() const; virtual void* getRelatedException() const; virtual const XMLCh* getType() const; virtual void* getRelatedData() const; // Setters void setSeverity(const ErrorSeverity severity); void setMessage(const XMLCh* const message); void setLocation(DOMLocator* const location); void setAdoptLocation(const bool value); void setRelatedException(void* exc) const; void setType(const XMLCh* type); void setRelatedData(void* relatedData); private: /* Unimplemented constructors and operators */ /* Copy constructor */ DOMErrorImpl(const DOMErrorImpl&); /* Assignment operator */ DOMErrorImpl& operator=(const DOMErrorImpl&); protected: // ----------------------------------------------------------------------- // Private data members // // fAdoptLocation // Indicates whether we own the DOMLocator object or not. // // fSeverity // The type of the error. // // fMessage // The error message. // // fLocation // The location info of the error. // // fType // The type of the error. // // fRelatedData // The data related to this error. // // ----------------------------------------------------------------------- bool fAdoptLocation; ErrorSeverity fSeverity; const XMLCh* fMessage; DOMLocator* fLocation; const XMLCh* fType; void* fRelatedData; }; // --------------------------------------------------------------------------- // DOMErrorImpl: Getter methods // --------------------------------------------------------------------------- inline DOMError::ErrorSeverity DOMErrorImpl::getSeverity() const { return fSeverity; } inline const XMLCh* DOMErrorImpl::getMessage() const { return fMessage; } inline DOMLocator* DOMErrorImpl::getLocation() const { return fLocation; } inline void* DOMErrorImpl::getRelatedException() const { return 0; } inline const XMLCh* DOMErrorImpl::getType() const { return fType; } inline void* DOMErrorImpl::getRelatedData() const { return fRelatedData; } // --------------------------------------------------------------------------- // DOMErrorImpl: Setter methods // --------------------------------------------------------------------------- inline void DOMErrorImpl::setSeverity(const ErrorSeverity severity) { fSeverity = severity; } inline void DOMErrorImpl::setMessage(const XMLCh* const message) { fMessage = message; } inline void DOMErrorImpl::setAdoptLocation(const bool value) { fAdoptLocation = value; } inline void DOMErrorImpl::setType(const XMLCh* type) { fType = type; } inline void DOMErrorImpl::setRelatedData(void* relatedData) { fRelatedData = relatedData; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMChildNode.cpp000644 000765 000024 00000005061 13241160337 022705 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMChildNode.cpp 1800911 2017-07-05 18:52:15Z scantor $ */ // This class only adds the ability to have siblings #include #include "DOMNodeImpl.hpp" #include "DOMChildNode.hpp" #include "DOMCasts.hpp" XERCES_CPP_NAMESPACE_BEGIN DOMChildNode::DOMChildNode() { this->previousSibling = 0; this->nextSibling = 0; } // This only makes a shallow copy, cloneChildren must also be called for a // deep clone DOMChildNode::DOMChildNode(const DOMChildNode &) { // Need to break the association w/ original siblings and parent this->previousSibling = 0; this->nextSibling = 0; } DOMChildNode::~DOMChildNode() { } DOMNode * DOMChildNode::getNextSibling() const { return nextSibling; } // // Note: for getParentNode and getPreviousSibling(), below, an // extra paramter "thisNode" is required. This is because there // is no way to cast from a DOMChildNode pointer back to the // DOMNodeImpl that it is part of. Our "this" may or may not // be preceded by a fParent in the object layout, and there's no // practical way to tell, so we just take an extra parameter instead. DOMNode * DOMChildNode::getParentNode(const DOMNode *thisNode) const { // if we have an owner, ownerNode is our parent, otherwise it's // our ownerDocument and we don't have a parent const DOMNodeImpl *thisNodeImpl = castToNodeImpl(thisNode); return thisNodeImpl->isOwned() ? thisNodeImpl->fOwnerNode : 0; } DOMNode * DOMChildNode::getPreviousSibling(const DOMNode *thisNode) const { // if we are the firstChild, previousSibling actually refers to our // parent's lastChild, but we hide that return castToNodeImpl(thisNode)->isFirstChild() ? 0 : previousSibling; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMProcessingInstructionImpl.hpp000644 000765 000024 00000006422 13241160337 026263 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMProcessingInstructionImpl.hpp 1800911 2017-07-05 18:52:15Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMPROCESSINGINSTRUCTIONIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMPROCESSINGINSTRUCTIONIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include #include "DOMNodeBase.hpp" #include "DOMCharacterDataImpl.hpp" #include "DOMNodeImpl.hpp" #include "DOMChildNode.hpp" XERCES_CPP_NAMESPACE_BEGIN class DocumentImpl; class CDOM_EXPORT DOMProcessingInstructionImpl: public DOMProcessingInstruction, public HasDOMNodeImpl, public HasDOMChildImpl { protected: DOMNodeImpl fNode; DOMChildNode fChild; // use fCharacterData to store its data so that those character utitlites can be used DOMCharacterDataImpl fCharacterData; XMLCh *fTarget; const XMLCh *fBaseURI; public: DOMProcessingInstructionImpl(DOMDocument *ownerDoc, const XMLCh * target, const XMLCh *data); DOMProcessingInstructionImpl(const DOMProcessingInstructionImpl &other, bool deep=false); virtual ~DOMProcessingInstructionImpl(); public: // Declare all of the functions from DOMNode. DOMNODE_FUNCTIONS; // Add accessors for implementation bits. DOMNODEIMPL_DECL; DOMCHILDIMPL_DECL; public: virtual const XMLCh *getData() const; virtual const XMLCh *getTarget() const; virtual void setData(const XMLCh *arg); // NON-DOM: set base uri virtual void setBaseURI(const XMLCh* baseURI); // Non standard extension for the range to work void deleteData(XMLSize_t offset, XMLSize_t count); const XMLCh* substringData(XMLSize_t offset, XMLSize_t count) const; DOMProcessingInstruction* splitText(XMLSize_t offset); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMProcessingInstructionImpl & operator = (const DOMProcessingInstructionImpl &); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMEntityReferenceImpl.cpp000644 000765 000024 00000024761 13241160337 025001 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMEntityReferenceImpl.cpp 1800911 2017-07-05 18:52:15Z scantor $ */ #include "DOMDocumentImpl.hpp" #include "DOMDocumentTypeImpl.hpp" #include "DOMEntityImpl.hpp" #include "DOMEntityReferenceImpl.hpp" #include #include #include XERCES_CPP_NAMESPACE_BEGIN DOMEntityReferenceImpl::DOMEntityReferenceImpl(DOMDocument *ownerDoc, const XMLCh *entityName) : fNode(this, ownerDoc), fParent(this, ownerDoc), fBaseURI(0) { fName = ((DOMDocumentImpl*)fParent.fOwnerDocument)->getPooledString(entityName); // EntityReference behaves as a read-only node, since its contents // reflect the Entity it refers to -- but see setNodeName(). //retrieve the corresponding entity content if (ownerDoc) { if (ownerDoc->getDoctype()) { if (ownerDoc->getDoctype()->getEntities()) { DOMEntityImpl* entity = (DOMEntityImpl*)ownerDoc->getDoctype()->getEntities()->getNamedItem(entityName); if (entity) { fBaseURI = entity->getBaseURI(); DOMEntityReference* refEntity = entity->getEntityRef(); if (refEntity) { fParent.cloneChildren(refEntity); } } } } } fNode.setReadOnly(true, true); } DOMEntityReferenceImpl::DOMEntityReferenceImpl(DOMDocument *ownerDoc, const XMLCh *entityName, bool cloneChild) : fNode(this, ownerDoc), fParent(this, ownerDoc), fBaseURI(0) { fName = ((DOMDocumentImpl*)fParent.fOwnerDocument)->getPooledString(entityName); // EntityReference behaves as a read-only node, since its contents // reflect the Entity it refers to -- but see setNodeName(). //retrieve the corresponding entity content if (ownerDoc) { if (ownerDoc->getDoctype()) { if (ownerDoc->getDoctype()->getEntities()) { DOMEntityImpl* entity = (DOMEntityImpl*)ownerDoc->getDoctype()->getEntities()->getNamedItem(entityName); if (entity) { fBaseURI = entity->getBaseURI(); if (cloneChild) { DOMEntityReference* refEntity = entity->getEntityRef(); if (refEntity) { fParent.cloneChildren(refEntity); } } } } } } fNode.setReadOnly(true, true); } DOMEntityReferenceImpl::DOMEntityReferenceImpl(const DOMEntityReferenceImpl &other, bool deep) : DOMEntityReference(other), fNode(this, other.fNode), fParent(this, other.fParent), fChild(other.fChild), fName(other.fName), fBaseURI(other.fBaseURI) { if (deep) fParent.cloneChildren(&other); fNode.setReadOnly(true, true); } DOMEntityReferenceImpl::~DOMEntityReferenceImpl() { } DOMNode *DOMEntityReferenceImpl::cloneNode(bool deep) const { DOMNode* newNode = new (fParent.fOwnerDocument, DOMMemoryManager::ENTITY_REFERENCE_OBJECT) DOMEntityReferenceImpl(*this, deep); fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode); return newNode; } const XMLCh * DOMEntityReferenceImpl::getNodeName() const { return fName; } DOMNode::NodeType DOMEntityReferenceImpl::getNodeType() const { return DOMNode::ENTITY_REFERENCE_NODE; } /** * EntityReferences never have a nodeValue. * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) */ void DOMEntityReferenceImpl::setNodeValue(const XMLCh *x) { fNode.setNodeValue(x); } /** * EntityRef is already, and must be, a read-only node. Attempts to change * that will throw a NO_MODIFICATION_ALLOWED_ERR DOMException. *

* If you want to alter its contents, edit the Entity definition. * * @param readOnly boolean */ void DOMEntityReferenceImpl::setReadOnly(bool readOnl,bool deep) { if(((DOMDocumentImpl *)fParent.fOwnerDocument)->getErrorChecking() && readOnl==false) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); fNode.setReadOnly(readOnl,deep); } void DOMEntityReferenceImpl::release() { if (fNode.isOwned() && !fNode.isToBeReleased()) throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); DOMDocumentImpl* doc = (DOMDocumentImpl*) fParent.fOwnerDocument; if (doc) { fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0); fParent.release(); doc->release(this, DOMMemoryManager::ENTITY_REFERENCE_OBJECT); } else { // shouldn't reach here throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); } } const XMLCh* DOMEntityReferenceImpl::getBaseURI() const { return fBaseURI; } // // Delegate functions from Node to the appropriate implementation. // DOMNode* DOMEntityReferenceImpl::appendChild(DOMNode *newChild) {return fParent.appendChild (newChild); } DOMNamedNodeMap* DOMEntityReferenceImpl::getAttributes() const {return fNode.getAttributes (); } DOMNodeList* DOMEntityReferenceImpl::getChildNodes() const {return fParent.getChildNodes (); } DOMNode* DOMEntityReferenceImpl::getFirstChild() const {return fParent.getFirstChild (); } DOMNode* DOMEntityReferenceImpl::getLastChild() const {return fParent.getLastChild (); } const XMLCh* DOMEntityReferenceImpl::getLocalName() const {return fNode.getLocalName (); } const XMLCh* DOMEntityReferenceImpl::getNamespaceURI() const {return fNode.getNamespaceURI (); } DOMNode* DOMEntityReferenceImpl::getNextSibling() const {return fChild.getNextSibling (); } const XMLCh* DOMEntityReferenceImpl::getNodeValue() const {return fNode.getNodeValue (); } DOMDocument* DOMEntityReferenceImpl::getOwnerDocument() const {return fParent.fOwnerDocument; } const XMLCh* DOMEntityReferenceImpl::getPrefix() const {return fNode.getPrefix (); } DOMNode* DOMEntityReferenceImpl::getParentNode() const {return fChild.getParentNode (this); } DOMNode* DOMEntityReferenceImpl::getPreviousSibling() const {return fChild.getPreviousSibling (this); } bool DOMEntityReferenceImpl::hasChildNodes() const {return fParent.hasChildNodes (); } DOMNode* DOMEntityReferenceImpl::insertBefore(DOMNode *newChild, DOMNode *refChild) {return fParent.insertBefore (newChild, refChild); } void DOMEntityReferenceImpl::normalize() {fParent.normalize (); } DOMNode* DOMEntityReferenceImpl::removeChild(DOMNode *oldChild) {return fParent.removeChild (oldChild); } DOMNode* DOMEntityReferenceImpl::replaceChild(DOMNode *newChild, DOMNode *oldChild) {return fParent.replaceChild (newChild, oldChild); } bool DOMEntityReferenceImpl::isSupported(const XMLCh *feature, const XMLCh *version) const {return fNode.isSupported (feature, version); } void DOMEntityReferenceImpl::setPrefix(const XMLCh *prefix) {fNode.setPrefix(prefix); } bool DOMEntityReferenceImpl::hasAttributes() const {return fNode.hasAttributes(); } bool DOMEntityReferenceImpl::isSameNode(const DOMNode* other) const {return fNode.isSameNode(other); } bool DOMEntityReferenceImpl::isEqualNode(const DOMNode* arg) const {return fParent.isEqualNode(arg); } void* DOMEntityReferenceImpl::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) {return fNode.setUserData(key, data, handler); } void* DOMEntityReferenceImpl::getUserData(const XMLCh* key) const {return fNode.getUserData(key); } short DOMEntityReferenceImpl::compareDocumentPosition(const DOMNode* other) const {return fNode.compareDocumentPosition(other); } const XMLCh* DOMEntityReferenceImpl::getTextContent() const {return fNode.getTextContent(); } void DOMEntityReferenceImpl::setTextContent(const XMLCh* textContent){fNode.setTextContent(textContent); } const XMLCh* DOMEntityReferenceImpl::lookupPrefix(const XMLCh* namespaceURI) const {return fNode.lookupPrefix(namespaceURI); } bool DOMEntityReferenceImpl::isDefaultNamespace(const XMLCh* namespaceURI) const {return fNode.isDefaultNamespace(namespaceURI); } const XMLCh* DOMEntityReferenceImpl::lookupNamespaceURI(const XMLCh* prefix) const {return fNode.lookupNamespaceURI(prefix); } void* DOMEntityReferenceImpl::getFeature(const XMLCh* feature, const XMLCh* version) const {return fNode.getFeature(feature, version); } // Macro-in implementation accessors. DOMNODEIMPL_IMPL(DOMEntityReferenceImpl); DOMPARENTIMPL_IMPL(DOMEntityReferenceImpl); DOMCHILDIMPL_IMPL(DOMEntityReferenceImpl); XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMParentNode.hpp000644 000765 000024 00000010134 13241160337 023115 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMParentNode.hpp 1800911 2017-07-05 18:52:15Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMPARENTNODE_HPP) #define XERCESC_INCLUDE_GUARD_DOMPARENTNODE_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // /** * ParentNode provides the capability of having child * nodes. Not every node in the DOM can have children, so only nodes that can * should include this class and pay the price for it. *

* While we have a direct reference to the first child, the last child is * stored as the previous sibling of the first child. First child nodes are * marked as being so, and getNextSibling hides this fact. * **/ #include #include "DOMNodeListImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN class DOMChildNode; class DOMDocument; class DOMNode; class DOMNodeList; class CDOM_EXPORT DOMParentNode { public: DOMNode *fContainingNode; // the impl object that we're contained by DOMDocument *fOwnerDocument; // Document this node belongs to DOMNode *fFirstChild; DOMNodeListImpl fChildNodeList; // for GetChildNodes() public: DOMParentNode(DOMNode* containingNode, DOMDocument *ownerDocument); DOMParentNode(DOMNode* containingNode, const DOMParentNode &other); ~DOMParentNode(); private: // Make sure this can't be called to corrupt the containing node ptr. DOMParentNode(const DOMParentNode &other); DOMNode* getContainingNode(); const DOMNode* getContainingNode() const; const DOMNodeImpl* getContainingNodeImpl() const; public: DOMDocument * getOwnerDocument() const; void setOwnerDocument(DOMDocument* doc); // Track changes to the node tree structure under this node. An optimization // for NodeLists. int changes() const; void changed(); DOMNode* appendChild(DOMNode *newChild); DOMNodeList* getChildNodes() const; DOMNode* getFirstChild() const; DOMNode* getLastChild() const; bool hasChildNodes() const; DOMNode* insertBefore(DOMNode *newChild, DOMNode *refChild); DOMNode* item(unsigned int index) const; DOMNode* removeChild(DOMNode *oldChild); DOMNode* replaceChild(DOMNode *newChild, DOMNode *oldChild); // Append certain types of nodes fast. Used to speed up XML to DOM // parsing. See the function implementation for detail. virtual DOMNode* appendChildFast(DOMNode *newChild); //Introduced in DOM Level 2 void normalize(); //Introduced in DOM Level 3 bool isEqualNode(const DOMNode* arg) const; // NON-DOM // unlike getOwnerDocument this never returns null, even for Document nodes DOMDocument * getDocument() const; void release(); public: void cloneChildren(const DOMNode *other); DOMNode * lastChild() const; void lastChild(DOMNode *); private: // unimplemented DOMParentNode& operator= (const DOMParentNode& other); }; #define GetDOMParentNodeMemoryManager GET_DIRECT_MM(fOwnerDocument) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMNodeImpl.hpp000644 000765 000024 00000042772 13241160337 022602 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNodeImpl.hpp 1800911 2017-07-05 18:52:15Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMNODEIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMNODEIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // /** * A DOMNodeImpl doesn't have any children, and can therefore only be directly * inherited by classes of nodes that never have any, such as Text nodes. For * other types, such as Element, classes must inherit from ParentNode. *

* All nodes in a single document must originate * in that document. (Note that this is much tighter than "must be * same implementation") Nodes are all aware of their ownerDocument, * and attempts to mismatch will throw WRONG_DOCUMENT_ERR. *

* However, to save memory not all nodes always have a direct reference * to their ownerDocument. When a node is owned by another node it relies * on its owner to store its ownerDocument. Parent nodes always store it * though, so there is never more than one level of indirection. * And when a node doesn't have an owner, ownerNode refers to its * ownerDocument. **/ #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMNamedNodeMap; class DOMNodeList; class DOMNode; class DOMDocument; class DOMElement; class CDOM_EXPORT DOMNodeImpl { public: // data DOMNode *fContainingNode; // the impl object that we're contained by DOMNode *fOwnerNode; // typically the parent but not always! unsigned short flags; static const unsigned short READONLY; static const unsigned short SYNCDATA; static const unsigned short SYNCCHILDREN; static const unsigned short OWNED; static const unsigned short FIRSTCHILD; static const unsigned short SPECIFIED; static const unsigned short IGNORABLEWS; static const unsigned short SETVALUE; static const unsigned short ID_ATTR; static const unsigned short USERDATA; static const unsigned short LEAFNODETYPE; static const unsigned short CHILDNODE; static const unsigned short TOBERELEASED; public: DOMNodeImpl(DOMNode* containingNode, DOMNode *ownerDocument); DOMNodeImpl(DOMNode* containingNode, const DOMNodeImpl &other); ~DOMNodeImpl(); private: // Make sure this can't be called to corrupt the containing node ptr. DOMNodeImpl(const DOMNodeImpl &other); DOMNode* getContainingNode(); const DOMNode* getContainingNode() const; public: DOMNode * appendChild(DOMNode *newChild); DOMNamedNodeMap * getAttributes() const; DOMNodeList * getChildNodes() const; DOMNode * getFirstChild() const; DOMNode * getLastChild() const; const XMLCh * getLocalName() const; const XMLCh * getNamespaceURI() const; DOMNode * getNextSibling() const; const XMLCh * getNodeValue() const; DOMDocument * getOwnerDocument() const; DOMNode * getParentNode() const; const XMLCh * getPrefix() const; DOMNode * getPreviousSibling() const; bool hasChildNodes() const; DOMNode * insertBefore(DOMNode *newChild, DOMNode *refChild); void normalize(); DOMNode * removeChild(DOMNode *oldChild); DOMNode * replaceChild(DOMNode *newChild, DOMNode *oldChild); void setNodeValue(const XMLCh *value); void setPrefix(const XMLCh *fPrefix); void setReadOnly(bool readOnly, bool deep); bool isSupported(const XMLCh *feature, const XMLCh *version) const; bool hasAttributes() const; // Introduced in DOM Level 3 void* setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler); void* getUserData(const XMLCh* key) const; bool isSameNode(const DOMNode* other) const; bool isEqualNode(const DOMNode* arg) const; const XMLCh* getBaseURI() const ; short compareDocumentPosition(const DOMNode* other) const; const XMLCh* getTextContent() const ; const XMLCh* getTextContent(XMLCh* pzBuffer, XMLSize_t& rnBufferLength) const; void setTextContent(const XMLCh* textContent) ; const XMLCh* lookupPrefix(const XMLCh* namespaceURI) const ; bool isDefaultNamespace(const XMLCh* namespaceURI) const ; const XMLCh* lookupNamespaceURI(const XMLCh* prefix) const ; void* getFeature(const XMLCh* feature, const XMLCh* version) const; // Helper functions for DOM Level 3 void release(); void callUserDataHandlers(DOMUserDataHandler::DOMOperationType operation, const DOMNode* src, DOMNode* dst) const; //reverses the bit pattern given by compareDocumentPosition short reverseTreeOrderBitPattern(short pattern) const; const DOMNode* getTreeParentNode(const DOMNode* node) const; //Utility, not part of DOM Level 2 API static bool isKidOK(DOMNode *parent, DOMNode *child); static const XMLCh *mapPrefix(const XMLCh *prefix, const XMLCh *namespaceURI, short nType); static const XMLCh *getXmlnsString(); static const XMLCh *getXmlnsURIString(); static const XMLCh *getXmlString(); static const XMLCh *getXmlURIString(); public: // should really be protected - ALH DOMNode* getElementAncestor (const DOMNode* currentNode) const; const XMLCh* lookupPrefix(const XMLCh* const namespaceURI, DOMElement *el) const ; void setOwnerDocument(DOMDocument *doc); /* * Flags setters and getters */ inline bool isReadOnly() const { return (flags & READONLY) != 0; } inline void isReadOnly(bool value) { flags = (value ? flags | READONLY : flags & ~READONLY); } inline bool needsSyncData() const { return (flags & SYNCDATA) != 0; } inline void needsSyncData(bool value) { flags = (value ? flags | SYNCDATA : flags & ~SYNCDATA); } inline bool needsSyncChildren() const { return (flags & SYNCCHILDREN) != 0; } inline void needsSyncChildren(bool value) { flags = (value ? flags | SYNCCHILDREN : flags & ~SYNCCHILDREN); } // For Attributes, true if the attr node is attached to an element. // For all other node types, true if the node has a parent node. inline bool isOwned() const { return (flags & OWNED) != 0; } inline void isOwned(bool value) { flags = (value ? flags | OWNED : flags & ~OWNED); } inline bool isFirstChild() const { return (flags & FIRSTCHILD) != 0; } inline void isFirstChild(bool value) { flags = (value ? flags | FIRSTCHILD : flags & ~FIRSTCHILD); } inline bool isSpecified() const { return (flags & SPECIFIED) != 0; } inline void isSpecified(bool value) { flags = (value ? flags | SPECIFIED : flags & ~SPECIFIED); } inline bool ignorableWhitespace() const { return (flags & IGNORABLEWS) != 0; } inline void ignorableWhitespace(bool value) { flags = (value ? flags | IGNORABLEWS : flags & ~IGNORABLEWS); } inline bool setValue() const { return (flags & SETVALUE) != 0; } inline void setValue(bool value) { flags = (value ? flags | SETVALUE : flags & ~SETVALUE); } inline bool isIdAttr() const { return (flags & ID_ATTR) != 0; } inline void isIdAttr(bool value) { flags = (value ? flags | ID_ATTR : flags & ~ID_ATTR); } inline bool hasUserData() const { return (flags & USERDATA) != 0; } inline void hasUserData(bool value) { flags = (value ? flags | USERDATA : flags & ~USERDATA); } // // LeafNode is set true for node types that can not be ParentNodes (can't have children) // This knowledge is used to allow casting from any unknown node type to the // IDParentImpl or IDChildImpl parts of the node. // inline bool isLeafNode() const { return (flags & LEAFNODETYPE) != 0; } inline void setIsLeafNode(bool value) { flags = (value ? flags | LEAFNODETYPE : flags & ~LEAFNODETYPE); } // // ChildNode is set true for node types that can be children of other nodes, and // therefore include a DOMChildNode data member. Note that all of the leaf // node types (above flag) are also ChildNodes, but not all ChildNodes are // leaf nodes. inline bool isChildNode() const { return (flags & CHILDNODE) != 0; } inline void setIsChildNode(bool value) { flags = (value ? flags | CHILDNODE : flags & ~CHILDNODE); } // True if this node has to be released regardless if it has a owner or not // This is true if called from fParent->release() inline bool isToBeReleased() const { return (flags & TOBERELEASED) != 0; } inline void isToBeReleased(bool value) { flags = (value ? flags | TOBERELEASED : flags & ~TOBERELEASED); } }; // This macro lists all of the pure virtual functions declared in DOMNode that must // be implemented by all node types. Since there is no inheritance of implementation, // using this macro in the class declaration of the node types make it easier to // accurately get all of the functions declared. // #define DOMNODE_FUNCTIONS \ virtual DOMNode* appendChild(DOMNode *newChild) ;\ virtual DOMNode* cloneNode(bool deep) const ;\ virtual DOMNamedNodeMap* getAttributes() const ;\ virtual DOMNodeList* getChildNodes() const ;\ virtual DOMNode* getFirstChild() const ;\ virtual DOMNode* getLastChild() const ;\ virtual const XMLCh* getLocalName() const ;\ virtual const XMLCh* getNamespaceURI() const ;\ virtual DOMNode* getNextSibling() const ;\ virtual const XMLCh* getNodeName() const ;\ virtual NodeType getNodeType() const ;\ virtual const XMLCh* getNodeValue() const ;\ virtual DOMDocument* getOwnerDocument() const ;\ virtual const XMLCh* getPrefix() const ;\ virtual DOMNode* getParentNode() const ;\ virtual DOMNode* getPreviousSibling() const ;\ virtual bool hasChildNodes() const ;\ virtual DOMNode* insertBefore(DOMNode *newChild, DOMNode *refChild) ;\ virtual void normalize() ;\ virtual DOMNode* removeChild(DOMNode *oldChild) ;\ virtual DOMNode* replaceChild(DOMNode *newChild, DOMNode *oldChild) ;\ virtual void setNodeValue(const XMLCh *nodeValue) ;\ virtual bool isSupported(const XMLCh *feature, const XMLCh *version) const ;\ virtual bool hasAttributes() const ;\ virtual void setPrefix(const XMLCh * prefix) ;\ virtual void* setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) ;\ virtual void* getUserData(const XMLCh* key) const ;\ virtual bool isSameNode(const DOMNode* other) const;\ virtual bool isEqualNode(const DOMNode* arg) const;\ virtual const XMLCh* getBaseURI() const ;\ virtual short compareDocumentPosition(const DOMNode* other) const ;\ virtual const XMLCh* getTextContent() const ;\ const XMLCh* getTextContent(XMLCh* pzBuffer, unsigned int& rnBufferLength) const;\ virtual void setTextContent(const XMLCh* textContent) ;\ virtual const XMLCh* lookupPrefix(const XMLCh* namespaceURI) const ;\ virtual bool isDefaultNamespace(const XMLCh* namespaceURI) const;\ virtual const XMLCh* lookupNamespaceURI(const XMLCh* prefix) const ;\ virtual void* getFeature(const XMLCh* feature, const XMLCh* version) const ;\ virtual void release() /* * Here are dummy stubs for most of the functions introduced by DOMNode. * Each subclass of DOMNode will have something like this that delegates each * function to the appropriate implementation. * Functions that must be supplied by every node class are omitted. * DOMNode* xxx::appendChild(DOMNode *newChild) {return fParent.appendChild (newChild); }; DOMNamedNodeMap* xxx::getAttributes() const {return fNode.getAttributes (); }; DOMNodeList* xxx::getChildNodes() const {return fParent.getChildNodes (); }; DOMNode* xxx::getFirstChild() const {return fParent.getFirstChild (); }; DOMNode* xxx::getLastChild() const {return fParent.getLastChild (); }; const XMLCh* xxx::getLocalName() const {return fNode.getLocalName (); }; const XMLCh* xxx::getNamespaceURI() const {return fNode.getNamespaceURI (); }; DOMNode* xxx::getNextSibling() const {return fChild.getNextSibling (); }; const XMLCh* xxx::getNodeValue() const {return fNode.getNodeValue (); }; DOMDocument* xxx::getOwnerDocument() const {return fNode.getOwnerDocument (); }; const XMLCh* xxx::getPrefix() const {return fNode.getPrefix (); }; DOMNode* xxx::getParentNode() const {return fChild.getParentNode (this); }; DOMNode* xxx::getPreviousSibling() const {return fChild.getPreviousSibling (this); }; bool xxx::hasChildNodes() const {return fParent.hasChildNodes (); }; DOMNode* xxx::insertBefore(DOMNode *newChild, DOMNode *refChild) {return fParent.insertBefore (newChild, refChild); }; void xxx::normalize() {fParent.normalize(); }; DOMNode* xxx::removeChild(DOMNode *oldChild) {return fParent.removeChild (oldChild); }; DOMNode* xxx::replaceChild(DOMNode *newChild, DOMNode *oldChild) {return fParent.replaceChild (newChild, oldChild); }; bool xxx::isSupported(const XMLCh *feature, const XMLCh *version) const {return fNode.isSupported (feature, version); }; void xxx::setPrefix(const XMLCh *prefix) {fNode.setPrefix(prefix); }; bool xxx::hasAttributes() const {return fNode.hasAttributes(); }; bool xxx::isSameNode(const DOMNode* other) const {return fNode.isSameNode(other); }; bool xxx::isEqualNode(const DOMNode* arg) const {return fNode.isEqualNode(arg); }; void* xxx::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) {return fNode.setUserData(key, data, handler); }; void* xxx::getUserData(const XMLCh* key) const {return fNode.getUserData(key); }; const XMLCh* xxx::getBaseURI() const {return fNode.getBaseURI(); }; short xxx::compareDocumentPosition(const DOMNode* other) const {return fNode.compareDocumentPosition(other); }; const XMLCh* xxx::getTextContent() const {return fNode.getTextContent(); }; void xxx::setTextContent(const XMLCh* textContent){fNode.setTextContent(textContent); }; const XMLCh* xxx::lookupPrefix(const XMLCh* namespaceURI) const {return fNode.lookupPrefix(namespaceURI); }; bool xxx::isDefaultNamespace(const XMLCh* namespaceURI) const {return fNode.isDefaultNamespace(namespaceURI); }; const XMLCh* xxx::lookupNamespaceURI(const XMLCh* prefix) const {return fNode.lookupNamespaceURI(prefix); }; void* xxx::getFeature(const XMLCh* feature, const XMLCh* version) const {return fNode.getFeature(feature, version); }; */ XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMDocumentTypeImpl.hpp000644 000765 000024 00000007521 13241160337 024326 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMDocumentTypeImpl.hpp 1800911 2017-07-05 18:52:15Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTTYPEIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMDOCUMENTTYPEIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include #include "DOMNodeBase.hpp" #include "DOMNodeImpl.hpp" #include "DOMChildNode.hpp" #include "DOMParentNode.hpp" XERCES_CPP_NAMESPACE_BEGIN class DOMNamedNodeMapImpl; class CDOM_EXPORT DOMDocumentTypeImpl: public DOMDocumentType, public HasDOMNodeImpl, public HasDOMParentImpl, public HasDOMChildImpl { protected: DOMNodeImpl fNode; DOMParentNode fParent; DOMChildNode fChild; const XMLCh * fName; DOMNamedNodeMapImpl* fEntities; DOMNamedNodeMapImpl* fNotations; DOMNamedNodeMapImpl* fElements; const XMLCh * fPublicId; const XMLCh * fSystemId; const XMLCh * fInternalSubset; bool fIntSubsetReading; bool fIsCreatedFromHeap; virtual void setPublicId(const XMLCh * value); virtual void setSystemId(const XMLCh * value); virtual void setInternalSubset(const XMLCh *value); bool isIntSubsetReading() const; friend class AbstractDOMParser; friend class DOMDocumentImpl; public: DOMDocumentTypeImpl(DOMDocument *, const XMLCh *, bool); DOMDocumentTypeImpl(DOMDocument *, const XMLCh *qualifiedName, //DOM Level 2 const XMLCh *publicId, const XMLCh *systemId, bool); DOMDocumentTypeImpl(const DOMDocumentTypeImpl &other, bool heap, bool deep=false); virtual ~DOMDocumentTypeImpl(); public: // Declare all of the functions from DOMNode. DOMNODE_FUNCTIONS; // Add accessors for implementation bits. DOMNODEIMPL_DECL; DOMPARENTIMPL_DECL; DOMCHILDIMPL_DECL; public: virtual void setOwnerDocument(DOMDocument *doc); virtual DOMNamedNodeMap * getEntities() const; virtual const XMLCh * getName() const; virtual DOMNamedNodeMap * getNotations() const; virtual DOMNamedNodeMap * getElements() const; virtual void setReadOnly(bool readOnly, bool deep); //Introduced in DOM Level 2 virtual const XMLCh * getPublicId() const; virtual const XMLCh * getSystemId() const; virtual const XMLCh * getInternalSubset() const; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMDocumentTypeImpl & operator = (const DOMDocumentTypeImpl &); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMXPathResultImpl.hpp000644 000765 000024 00000004272 13241160337 024131 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMXPathResultImpl.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHRESULTIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMXPATHRESULTIMPL_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class CDOM_EXPORT DOMXPathResultImpl : public XMemory, public DOMXPathResult { public: DOMXPathResultImpl(ResultType type, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~DOMXPathResultImpl(); virtual ResultType getResultType() const; virtual const DOMTypeInfo *getTypeInfo() const; virtual bool isNode() const; virtual bool getBooleanValue() const; virtual int getIntegerValue() const; virtual double getNumberValue() const; virtual const XMLCh* getStringValue() const; virtual DOMNode* getNodeValue() const; virtual bool iterateNext(); virtual bool getInvalidIteratorState() const; virtual bool snapshotItem(XMLSize_t); virtual XMLSize_t getSnapshotLength() const; virtual void release(); public: void reset(ResultType type); void addResult(DOMNode* node); protected: ResultType fType; MemoryManager* const fMemoryManager; RefVectorOf* fSnapshot; XMLSize_t fIndex; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMImplementationImpl.cpp000644 000765 000024 00000023041 13241160337 024661 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMImplementationImpl.cpp 671894 2008-06-26 13:29:21Z borisk $ */ #include "DOMImplementationImpl.hpp" #include "DOMDocumentImpl.hpp" #include "DOMDocumentTypeImpl.hpp" #include "DOMLSSerializerImpl.hpp" #include "DOMLSInputImpl.hpp" #include "DOMLSOutputImpl.hpp" #include "DOMImplementationListImpl.hpp" #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // ------------------------------------------------------------ // Static constants // ------------------------------------------------------------ static const XMLCh g1_0[] = // Points to "1.0" {chDigit_1, chPeriod, chDigit_0, chNull}; static const XMLCh g2_0[] = // Points to "2.0" {chDigit_2, chPeriod, chDigit_0, chNull}; static const XMLCh g3_0[] = // Points to "3.0" {chDigit_3, chPeriod, chDigit_0, chNull}; static const XMLCh gTrav[] = // Points to "Traversal" {chLatin_T, chLatin_r, chLatin_a, chLatin_v, chLatin_e, chLatin_r, chLatin_s, chLatin_a, chLatin_l, chNull}; static const XMLCh gCore[] = // Points to "Core" {chLatin_C, chLatin_o, chLatin_r, chLatin_e, chNull}; static const XMLCh gRange[] = // Points to "Range" {chLatin_R, chLatin_a, chLatin_n, chLatin_g, chLatin_e, chNull}; static const XMLCh gLS[] = // Points to "LS" {chLatin_L, chLatin_S, chNull}; static const XMLCh gXPath[] = // Points to "XPath" {chLatin_X, chLatin_P, chLatin_a, chLatin_t, chLatin_h, chNull}; static XMLMsgLoader *sMsgLoader = 0; static DOMImplementationImpl *gDomimp = 0; void XMLInitializer::initializeDOMImplementationImpl() { sMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgXMLDOMMsgDomain); if (!sMsgLoader) XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain); gDomimp = new DOMImplementationImpl; } void XMLInitializer::terminateDOMImplementationImpl() { delete gDomimp; gDomimp = 0; delete sMsgLoader; sMsgLoader = 0; } // // XMLMsgLoader* DOMImplementationImpl::getMsgLoader4DOM() { return sMsgLoader; } DOMImplementationImpl *DOMImplementationImpl::getDOMImplementationImpl() { return gDomimp; } // ------------------------------------------------------------ // DOMImplementation Virtual interface // ------------------------------------------------------------ bool DOMImplementationImpl::hasFeature(const XMLCh * feature, const XMLCh * version) const { if (!feature) return false; // ignore the + modifier if(*feature==chPlus) feature++; bool anyVersion = (version == 0 || !*version); bool version1_0 = XMLString::equals(version, g1_0); bool version2_0 = XMLString::equals(version, g2_0); bool version3_0 = XMLString::equals(version, g3_0); // Currently, we support only XML Level 1 version 1.0 if (XMLString::compareIStringASCII(feature, XMLUni::fgXMLString) == 0 && (anyVersion || version1_0 || version2_0)) return true; if (XMLString::compareIStringASCII(feature, gCore) == 0 && (anyVersion || version1_0 || version2_0 || version3_0)) return true; if (XMLString::compareIStringASCII(feature, gTrav) == 0 && (anyVersion || version2_0)) return true; if (XMLString::compareIStringASCII(feature, gRange) == 0 && (anyVersion || version2_0)) return true; if (XMLString::compareIStringASCII(feature, gLS) == 0 && (anyVersion || version3_0)) return true; if (XMLString::compareIStringASCII(feature, gXPath) == 0 && (anyVersion || version3_0)) return true; return false; } //Introduced in DOM Level 2 DOMDocumentType *DOMImplementationImpl::createDocumentType(const XMLCh *qualifiedName, const XMLCh * publicId, const XMLCh *systemId) { // assume XML 1.0 since we do not know its version yet. if(!XMLChar1_0::isValidName(qualifiedName)) throw DOMException(DOMException::INVALID_CHARACTER_ERR, 0); //to do: do we need to create with user's memorymanager??? DOMDocumentTypeImpl* docType = new DOMDocumentTypeImpl(0, qualifiedName, publicId, systemId, true); return docType; } DOMDocument *DOMImplementationImpl::createDocument(const XMLCh *namespaceURI, const XMLCh *qualifiedName, DOMDocumentType *doctype, MemoryManager* const manager) { return new (manager) DOMDocumentImpl(namespaceURI, qualifiedName, doctype, this, manager); } //Introduced in DOM Level 3 void* DOMImplementationImpl::getFeature(const XMLCh*, const XMLCh*) const { return 0; } // Non-standard extension DOMDocument *DOMImplementationImpl::createDocument(MemoryManager* const manager) { return new (manager) DOMDocumentImpl(this, manager); } // // DOMImplementation::getImplementation. DOMImplementation is supposed to // be a pure interface class. This one static // function is the hook that lets things get started. DOMImplementation *DOMImplementation::getImplementation() { return (DOMImplementation*) DOMImplementationImpl::getDOMImplementationImpl(); } bool DOMImplementation::loadDOMExceptionMsg ( const short msgToLoad , XMLCh* const toFill , const XMLSize_t maxChars ) { // Figure out which exception range this code is and load the corresponding // message. // if (msgToLoad <= 50) { // DOMException return sMsgLoader->loadMsg(XMLDOMMsg::DOMEXCEPTION_ERRX+msgToLoad, toFill, maxChars); } else if (msgToLoad <= 80) { // DOMXPathException return sMsgLoader->loadMsg(XMLDOMMsg::DOMXPATHEXCEPTION_ERRX+msgToLoad-DOMXPathException::INVALID_EXPRESSION_ERR+1, toFill, maxChars); } else if (msgToLoad <= 110) { // DOMXLSException return sMsgLoader->loadMsg(XMLDOMMsg::DOMLSEXCEPTION_ERRX+msgToLoad-DOMLSException::PARSE_ERR+1, toFill, maxChars); } else { // DOMRangeException return sMsgLoader->loadMsg(XMLDOMMsg::DOMRANGEEXCEPTION_ERRX+msgToLoad-DOMRangeException::BAD_BOUNDARYPOINTS_ERR+1, toFill, maxChars); } } // ------------------------------------------------------------ // DOMImplementationLS Virtual interface // ------------------------------------------------------------ //Introduced in DOM Level 3 DOMLSParser* DOMImplementationImpl::createLSParser( const DOMImplementationLSMode mode, const XMLCh* const /*schemaType*/, MemoryManager* const manager, XMLGrammarPool* const gramPool) { if (mode == DOMImplementationLS::MODE_ASYNCHRONOUS) throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, manager); // TODO: schemaType return new (manager) DOMLSParserImpl(0, manager, gramPool); } DOMLSSerializer* DOMImplementationImpl::createLSSerializer(MemoryManager* const manager) { return new (manager) DOMLSSerializerImpl(manager); } DOMLSInput* DOMImplementationImpl::createLSInput(MemoryManager* const manager) { return new (manager) DOMLSInputImpl(manager); } DOMLSOutput* DOMImplementationImpl::createLSOutput(MemoryManager* const manager) { return new (manager) DOMLSOutputImpl(manager); } // ------------------------------------------------------------ // DOMImplementationSource Virtual interface // ------------------------------------------------------------ DOMImplementation* DOMImplementationImpl::getDOMImplementation(const XMLCh* features) const { DOMImplementation* impl = DOMImplementation::getImplementation(); XMLStringTokenizer tokenizer(features, XMLPlatformUtils::fgMemoryManager); const XMLCh* feature = 0; while (feature || tokenizer.hasMoreTokens()) { if (!feature) feature = tokenizer.nextToken(); const XMLCh* version = 0; const XMLCh* token = tokenizer.nextToken(); if (token && XMLString::isDigit(token[0])) version = token; if (!impl->hasFeature(feature, version)) return 0; if (!version) feature = token; } return impl; } DOMImplementationList* DOMImplementationImpl::getDOMImplementationList(const XMLCh* features) const { DOMImplementationListImpl* list = new DOMImplementationListImpl; DOMImplementation* myImpl=getDOMImplementation(features); if(myImpl) list->add(myImpl); return list; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMNodeBase.hpp000644 000765 000024 00000020277 13241160337 022547 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id:$ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMNODEBASE_HPP) #define XERCESC_INCLUDE_GUARD_DOMNODEBASE_HPP #include XERCES_CPP_NAMESPACE_BEGIN class DOMNodeImpl; class DOMParentNode; class DOMChildNode; // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // /** * Virtual base class with accessors for shared characteristics of DOM implementation * types, this is a workaround for the current class design that allows the various * implementation classes to punch into the internals of each others members without * using unsafe casts that depend on object layout. */ class CDOM_EXPORT HasDOMNodeImpl { protected: // ----------------------------------------------------------------------- // Hidden constructor // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ HasDOMNodeImpl() {} //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented operators */ //@{ HasDOMNodeImpl & operator= (const HasDOMNodeImpl &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~HasDOMNodeImpl() {}; //@} // ----------------------------------------------------------------------- // Virtual HasDOMNodeImpl interface // ----------------------------------------------------------------------- //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Gets the embedded DOMNodeImpl member. */ virtual DOMNodeImpl *getNodeImpl() = 0; /** * Gets the embedded DOMNodeImpl member. */ virtual const DOMNodeImpl *getNodeImpl() const = 0; //@} }; /** * Virtual base class with accessors for shared characteristics of DOM implementation * types, this is a workaround for the current class design that allows the various * implementation classes to punch into the internals of each others members without * using unsafe casts that depend on object layout. */ class CDOM_EXPORT HasDOMParentImpl { protected: // ----------------------------------------------------------------------- // Hidden constructor // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ HasDOMParentImpl() {} //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented operators */ //@{ HasDOMParentImpl & operator= (const HasDOMParentImpl &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~HasDOMParentImpl() {}; //@} // ----------------------------------------------------------------------- // Virtual HasDOMParentImpl interface // ----------------------------------------------------------------------- //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Gets the embedded DOMParentNode member. */ virtual DOMParentNode *getParentNodeImpl() = 0; /** * Gets the embedded DOMParentNode member. */ virtual const DOMParentNode *getParentNodeImpl() const = 0; //@} }; /** * Virtual base class with accessors for shared characteristics of DOM implementation * types, this is a workaround for the current class design that allows the various * implementation classes to punch into the internals of each others members without * using unsafe casts that depend on object layout. */ class CDOM_EXPORT HasDOMChildImpl { protected: // ----------------------------------------------------------------------- // Hidden constructor // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ HasDOMChildImpl() {} //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- /** @name Unimplemented operators */ //@{ HasDOMChildImpl & operator= (const HasDOMChildImpl &); //@} public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~HasDOMChildImpl() {}; //@} // ----------------------------------------------------------------------- // Virtual HasDOMChildImpl interface // ----------------------------------------------------------------------- //@{ // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Gets the embedded DOMChildNode member. */ virtual DOMChildNode *getChildNodeImpl() = 0; /** * Gets the embedded DOMChildNode member. */ virtual const DOMChildNode *getChildNodeImpl() const = 0; //@} }; #define DOMNODEIMPL_DECL \ virtual DOMNodeImpl* getNodeImpl(); \ virtual const DOMNodeImpl* getNodeImpl() const; #define DOMNODEIMPL_IMPL(classname) \ DOMNodeImpl* classname::getNodeImpl() {return &fNode;} \ const DOMNodeImpl* classname::getNodeImpl() const {return &fNode;} #define DOMPARENTIMPL_DECL \ virtual DOMParentNode* getParentNodeImpl(); \ virtual const DOMParentNode* getParentNodeImpl() const; #define DOMPARENTIMPL_IMPL(classname) \ DOMParentNode* classname::getParentNodeImpl() {return &fParent;} \ const DOMParentNode* classname::getParentNodeImpl() const {return &fParent;} #define DOMCHILDIMPL_DECL \ virtual DOMChildNode* getChildNodeImpl(); \ virtual const DOMChildNode* getChildNodeImpl() const; #define DOMCHILDIMPL_IMPL(classname) \ DOMChildNode* classname::getChildNodeImpl() {return &fChild;} \ const DOMChildNode* classname::getChildNodeImpl() const {return &fChild;} XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMCDATASectionImpl.hpp000644 000765 000024 00000007207 13241160337 024050 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMCDATASectionImpl.hpp 1800911 2017-07-05 18:52:15Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMCDATASECTIONIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMCDATASECTIONIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include #include "DOMNodeBase.hpp" #include "DOMNodeImpl.hpp" #include "DOMChildNode.hpp" #include "DOMParentNode.hpp" #include "DOMCharacterDataImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN class CDOM_EXPORT DOMCDATASectionImpl: public DOMCDATASection, public HasDOMNodeImpl, public HasDOMChildImpl { protected: DOMNodeImpl fNode; DOMChildNode fChild; DOMCharacterDataImpl fCharacterData; public: DOMCDATASectionImpl(DOMDocument *ownerDoc, const XMLCh* data); DOMCDATASectionImpl(DOMDocument *ownerDoc, const XMLCh* data, XMLSize_t n); DOMCDATASectionImpl(const DOMCDATASectionImpl &other, bool deep = false); virtual ~DOMCDATASectionImpl(); // Functions inherited from TEXT virtual DOMText* splitText(XMLSize_t offset); // DOM Level 3 virtual bool getIsElementContentWhitespace() const; virtual const XMLCh* getWholeText() const; virtual DOMText* replaceWholeText(const XMLCh* content); // non-standard extension virtual bool isIgnorableWhitespace() const; public: // Declare all of the functions from DOMNode. DOMNODE_FUNCTIONS; // Add accessors for implementation bits. DOMNODEIMPL_DECL; DOMCHILDIMPL_DECL; public: // Functions introduced by DOMCharacterData virtual const XMLCh* getData() const; virtual XMLSize_t getLength() const; virtual const XMLCh* substringData(XMLSize_t offset, XMLSize_t count) const; virtual void appendData(const XMLCh *arg); virtual void insertData(XMLSize_t offset, const XMLCh *arg); virtual void deleteData(XMLSize_t offset, XMLSize_t count); virtual void replaceData(XMLSize_t offset, XMLSize_t count, const XMLCh *arg); virtual void setData(const XMLCh *data); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMCDATASectionImpl & operator = (const DOMCDATASectionImpl &); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMStringListImpl.cpp000644 000765 000024 00000003404 13241160337 023777 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMStringListImpl.cpp 671894 2008-06-26 13:29:21Z borisk $ */ #include "DOMStringListImpl.hpp" #include XERCES_CPP_NAMESPACE_BEGIN DOMStringListImpl::DOMStringListImpl(int nInitialSize, MemoryManager* manager) { fList=new (manager) RefVectorOf(nInitialSize, false, manager); } DOMStringListImpl::~DOMStringListImpl() { delete fList; } void DOMStringListImpl::add(const XMLCh* str) { fList->addElement((XMLCh*)str); } XMLSize_t DOMStringListImpl::getLength() const{ return fList->size(); } const XMLCh* DOMStringListImpl::item(XMLSize_t index) const{ if(indexsize()) return fList->elementAt(index); return 0; } bool DOMStringListImpl::contains(const XMLCh* str) const{ for(XMLSize_t i=0;isize();i++) if(XMLString::equals(fList->elementAt(i), str)) return true; return false; } void DOMStringListImpl::release() { delete this; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMAttrMapImpl.hpp000644 000765 000024 00000011017 13241160337 023251 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMAttrMapImpl.hpp 678709 2008-07-22 10:56:56Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMATTRMAPIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMATTRMAPIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMNode; class DOMNodeVector; class CDOM_EXPORT DOMAttrMapImpl : public DOMNamedNodeMap { protected: DOMNodeVector* fNodes; DOMNode* fOwnerNode; // the node this map belongs to bool attrDefaults; virtual void cloneContent(const DOMAttrMapImpl *srcmap); bool readOnly(); // revisit. Look at owner node read-only. public: DOMAttrMapImpl(DOMNode *ownerNod); // revisit. This "copy" constructor is used for cloning an Element with Attributes, // and for setting up default attributes. It's probably not right // for one or the other or both. DOMAttrMapImpl(DOMNode *ownerNod, const DOMAttrMapImpl *defaults); DOMAttrMapImpl(); virtual ~DOMAttrMapImpl(); virtual DOMAttrMapImpl *cloneAttrMap(DOMNode *ownerNode); virtual bool hasDefaults(); virtual void hasDefaults(bool value); virtual int findNamePoint(const XMLCh *name) const; virtual int findNamePoint(const XMLCh *namespaceURI, const XMLCh *localName) const; virtual DOMNode* removeNamedItemAt(XMLSize_t index); virtual void setReadOnly(bool readOnly, bool deep); virtual XMLSize_t getLength() const; virtual DOMNode* item(XMLSize_t index) const; virtual DOMNode* getNamedItem(const XMLCh *name) const; virtual DOMNode* setNamedItem(DOMNode *arg); virtual DOMNode* removeNamedItem(const XMLCh *name); virtual DOMNode* getNamedItemNS(const XMLCh *namespaceURI, const XMLCh *localName) const; virtual DOMNode* setNamedItemNS(DOMNode *arg); virtual DOMNode* removeNamedItemNS(const XMLCh *namespaceURI, const XMLCh *localName); // Fast versions of the above functions which bypass validity checks. // It also assumes that fNode is not 0 (call reserve) and that there // is no previous node with this name. These are used in parsing. // void setNamedItemFast(DOMNode *arg); void setNamedItemNSFast(DOMNode *arg); // Tries to reserve space for the specified number of elements. // Currently only works on newly-created instances (fNodes == 0). // void reserve (XMLSize_t); void reconcileDefaultAttributes(const DOMAttrMapImpl* defaults); void moveSpecifiedAttributes(DOMAttrMapImpl* srcmap); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMAttrMapImpl(const DOMAttrMapImpl &); DOMAttrMapImpl & operator = (const DOMAttrMapImpl &); }; // --------------------------------------------------------------------------- // DOMAttrMapImpl: Getters & Setters // --------------------------------------------------------------------------- inline bool DOMAttrMapImpl::hasDefaults() { return attrDefaults; } inline void DOMAttrMapImpl::hasDefaults(bool value) { attrDefaults = value; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMDocumentImpl.hpp000644 000765 000024 00000051410 13241160337 023460 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMDocumentImpl.hpp 1800911 2017-07-05 18:52:15Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMDOCUMENTIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include #include #include #include #include #include #include #include #include "DOMNodeBase.hpp" #include "DOMNodeImpl.hpp" #include "DOMStringPool.hpp" #include "DOMParentNode.hpp" #include "DOMDeepNodeListPool.hpp" XERCES_CPP_NAMESPACE_BEGIN class DOMAttrImpl; class DOMCDATASectionImpl; class DOMCommentImpl; class DOMConfiguration; class DOMDeepNodeListImpl; class DOMDocumentFragmentImpl; class DOMDocumentTypeImpl; class DOMElementImpl; class DOMEntityImpl; class DOMEntityReferenceImpl; class DOMNotationImpl; class DOMProcessingInstructionImpl; class DOMTextImpl; class DOMNodeIteratorImpl; class DOMNormalizer; class DOMTreeWalkerImpl; class DOMNodeFilter; class DOMNodeFilterImpl; class DOMImplementation; class DOMNodeIDMap; class DOMRangeImpl; class DOMBuffer; class MemoryManager; class XPathNSResolver; class XPathExpression; typedef RefVectorOf Ranges; typedef RefVectorOf NodeIterators; typedef KeyRefPair DOMUserDataRecord; typedef RefStackOf DOMNodePtr; class CDOM_EXPORT DOMDocumentImpl: public XMemory, public DOMMemoryManager, public DOMDocument, public HasDOMNodeImpl, public HasDOMParentImpl { public: // ----------------------------------------------------------------------- // data // ----------------------------------------------------------------------- DOMNodeImpl fNode; // Implements common node functionality. DOMParentNode fParent; // Implements common parent node functionality DOMNodeIDMap* fNodeIDMap; // for use by GetElementsById(). public: DOMDocumentImpl(DOMImplementation* domImpl, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); DOMDocumentImpl(const XMLCh* namespaceURI, //DOM Level 2 const XMLCh* qualifiedName, DOMDocumentType* doctype, DOMImplementation* domImpl, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); virtual ~DOMDocumentImpl(); void setDocumentType(DOMDocumentType *doctype); public: // Add all functions that are pure virtual in DOMNODE DOMNODE_FUNCTIONS; // Add accessors for implementation bits. DOMNODEIMPL_DECL; DOMPARENTIMPL_DECL; public: // Add all functions that are pure virtual in DOMDocument virtual DOMAttr* createAttribute(const XMLCh *name); virtual DOMCDATASection* createCDATASection(const XMLCh *data); virtual DOMComment* createComment(const XMLCh *data); virtual DOMDocumentFragment* createDocumentFragment(); virtual DOMDocumentType* createDocumentType(const XMLCh *name); virtual DOMDocumentType* createDocumentType(const XMLCh *qName, const XMLCh *publicId, const XMLCh *systemId); virtual DOMElement* createElement(const XMLCh * tagName); virtual DOMElement* createElementNoCheck(const XMLCh *tagName); virtual DOMEntity* createEntity(const XMLCh * name); virtual DOMEntityReference* createEntityReference(const XMLCh * name); virtual DOMNotation* createNotation(const XMLCh * name); virtual DOMProcessingInstruction* createProcessingInstruction(const XMLCh * target, const XMLCh * data); virtual DOMText* createTextNode(const XMLCh * data); virtual DOMDocumentType* getDoctype() const; virtual DOMElement* getDocumentElement() const; virtual DOMNodeList* getElementsByTagName(const XMLCh * tagname) const; virtual DOMImplementation* getImplementation() const; bool isXMLName(const XMLCh * s); virtual DOMNodeIterator* createNodeIterator(DOMNode *root, DOMNodeFilter::ShowType whatToShow, DOMNodeFilter* filter, bool entityReferenceExpansion); virtual DOMTreeWalker* createTreeWalker(DOMNode *root, DOMNodeFilter::ShowType whatToShow, DOMNodeFilter* filter, bool entityReferenceExpansion); virtual DOMRange* createRange(); virtual Ranges* getRanges() const; //non-standard api virtual NodeIterators* getNodeIterators() const; //non-standard api virtual void removeRange(DOMRangeImpl* range); //non-standard api virtual void removeNodeIterator(DOMNodeIteratorImpl* nodeIterator); //non-standard api virtual DOMXPathExpression* createExpression(const XMLCh *expression, const DOMXPathNSResolver *resolver); virtual DOMXPathNSResolver* createNSResolver(const DOMNode *nodeResolver); virtual DOMXPathResult* evaluate(const XMLCh *expression, const DOMNode *contextNode, const DOMXPathNSResolver *resolver, DOMXPathResult::ResultType type, DOMXPathResult* result); // Extension to be called by the Parser DOMEntityReference* createEntityReferenceByParser(const XMLCh * name); // Add all functions that are pure virtual in DOMMemoryManager virtual XMLSize_t getMemoryAllocationBlockSize() const; virtual void setMemoryAllocationBlockSize(XMLSize_t size); virtual void* allocate(XMLSize_t amount); virtual void* allocate(XMLSize_t amount, DOMMemoryManager::NodeObjectType type); // try to remove the block from the list of allocated memory virtual void release(void* oldBuffer); virtual void release(DOMNode* object, DOMMemoryManager::NodeObjectType type); virtual XMLCh* cloneString(const XMLCh *src); // // Functions to keep track of document mutations, so that node list chached // information can be invalidated. One global changes counter per document. // virtual void changed(); virtual int changes() const; /** * Sets whether the DOM implementation performs error checking * upon operations. Turning off error checking only affects * the following DOM checks: *

    *
  • Checking strings to make sure that all characters are * legal XML characters *
  • Hierarchy checking such as allowed children, checks for * cycles, etc. *
*

* Turning off error checking does not turn off the * following checks: *

    *
  • Read only checks *
  • Checks related to DOM events *
*/ inline void setErrorChecking(bool check) { errorChecking = check; } /** * Returns true if the DOM implementation performs error checking. */ inline bool getErrorChecking() const { return errorChecking; } //Introduced in DOM Level 2 virtual DOMNode* importNode(const DOMNode *source, bool deep); virtual DOMElement* createElementNS(const XMLCh *namespaceURI, const XMLCh *qualifiedName); virtual DOMElement* createElementNS(const XMLCh *namespaceURI, const XMLCh *qualifiedName, const XMLFileLoc lineNo, const XMLFileLoc columnNo); virtual DOMAttr* createAttributeNS(const XMLCh *namespaceURI, const XMLCh *qualifiedName); virtual DOMNodeList* getElementsByTagNameNS(const XMLCh *namespaceURI, const XMLCh *localName) const; virtual DOMElement* getElementById(const XMLCh *elementId) const; //Introduced in DOM Level 3 virtual const XMLCh* getInputEncoding() const; virtual const XMLCh* getXmlEncoding() const; virtual bool getXmlStandalone() const; virtual void setXmlStandalone(bool standalone); virtual const XMLCh* getXmlVersion() const; virtual void setXmlVersion(const XMLCh* version); virtual const XMLCh* getDocumentURI() const; virtual void setDocumentURI(const XMLCh* documentURI); virtual bool getStrictErrorChecking() const; virtual void setStrictErrorChecking(bool strictErrorChecking); virtual DOMNode* adoptNode(DOMNode* source); virtual void normalizeDocument(); virtual DOMConfiguration* getDOMConfig() const; void setInputEncoding(const XMLCh* actualEncoding); void setXmlEncoding(const XMLCh* encoding); // helper functions to prevent storing userdata pointers on every node. void* setUserData(DOMNodeImpl* n, const XMLCh* key, void* data, DOMUserDataHandler* handler); void* getUserData(const DOMNodeImpl* n, const XMLCh* key) const; void callUserDataHandlers(const DOMNodeImpl* n, DOMUserDataHandler::DOMOperationType operation, const DOMNode* src, DOMNode* dst) const; void transferUserData(DOMNodeImpl* n1, DOMNodeImpl* n2); DOMNode* renameNode(DOMNode* n, const XMLCh* namespaceURI, const XMLCh* name); //Return the index > 0 of ':' in the given qualified name qName="prefix:localName". //Return 0 if there is no ':', or -1 if qName is malformed such as ":abcd". static int indexofQualifiedName(const XMLCh * qName); static bool isKidOK(const DOMNode *parent, const DOMNode *child); inline DOMNodeIDMap* getNodeIDMap() {return fNodeIDMap;}; // // Memory Management Functions. All memory is allocated by and owned by // a document, and is not recovered until the // document itself is deleted. // const XMLCh* getPooledString(const XMLCh*); const XMLCh* getPooledNString(const XMLCh*, XMLSize_t); void deleteHeap(); void releaseDocNotifyUserData(DOMNode* object); void releaseBuffer(DOMBuffer* buffer); DOMBuffer* popBuffer(XMLSize_t nMinSize); MemoryManager* getMemoryManager() const; // Factory methods for getting/creating node lists. // Because nothing is ever deleted, the implementation caches and recycles // previously used instances of DOMDeepNodeList // DOMNodeList* getDeepNodeList(const DOMNode *rootNode, const XMLCh *tagName); DOMNodeList* getDeepNodeList(const DOMNode *rootNode, //DOM Level 2 const XMLCh *namespaceURI, const XMLCh *localName); protected: //Internal helper functions virtual DOMNode* importNode(const DOMNode *source, bool deep, bool cloningNode); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMDocumentImpl(const DOMDocumentImpl &); DOMDocumentImpl & operator = (const DOMDocumentImpl &); protected: // ----------------------------------------------------------------------- // data // ----------------------------------------------------------------------- // New data introduced in DOM Level 3 const XMLCh* fInputEncoding; const XMLCh* fXmlEncoding; bool fXmlStandalone; const XMLCh* fXmlVersion; const XMLCh* fDocumentURI; DOMConfiguration* fDOMConfiguration; XMLStringPool fUserDataTableKeys; RefHash2KeysTableOf* fUserDataTable; // Per-Document heap Variables. // The heap consists of one or more biggish blocks which are // sub-allocated for individual allocations of nodes, strings, etc. // The big blocks form a linked list, allowing them to be located for deletion. // // There is no provision for deleting suballocated blocks, other than // deleting the entire heap when the document is deleted. // // There is no header on individual sub-allocated blocks. // The header on big blocks consists only of a single back pointer to // the previously allocated big block (our linked list of big blocks) // // // revisit - this heap should be encapsulated into its own // class, rather than hanging naked on Document. // void* fCurrentBlock; void* fCurrentSingletonBlock; char* fFreePtr; XMLSize_t fFreeBytesRemaining, fHeapAllocSize; // To recycle the DOMNode pointer RefArrayOf* fRecycleNodePtr; // To recycle DOMBuffer pointer RefStackOf* fRecycleBufferPtr; // Pool of DOMNodeList for getElementsByTagName DOMDeepNodeListPool* fNodeListPool; // Other data DOMDocumentType* fDocType; DOMElement* fDocElement; DOMStringPoolEntry** fNameTable; XMLSize_t fNameTableSize; DOMNormalizer* fNormalizer; Ranges* fRanges; NodeIterators* fNodeIterators; MemoryManager* fMemoryManager; // configurable memory manager DOMImplementation* fDOMImplementation; int fChanges; bool errorChecking; // Bypass error checking. }; inline MemoryManager* DOMDocumentImpl::getMemoryManager() const { return fMemoryManager; } inline const XMLCh* DOMDocumentImpl::getPooledString(const XMLCh *in) { if (in == 0) return 0; XMLSize_t n = XMLString::stringLen(in); DOMStringPoolEntry **pspe; DOMStringPoolEntry *spe; XMLSize_t inHash = XMLString::hash(in, fNameTableSize); pspe = &fNameTable[inHash]; while (*pspe != 0) { if ((*pspe)->fLength == n && XMLString::equals((*pspe)->fString, in)) return (*pspe)->fString; pspe = &((*pspe)->fNext); } // This string hasn't been seen before. Add it to the pool. // // Compute size to allocate. Note that there's 1 char of string // declared in the struct, so we don't need to add one again to // account for the trailing null. // XMLSize_t sizeToAllocate = sizeof(DOMStringPoolEntry) + n*sizeof(XMLCh); *pspe = spe = (DOMStringPoolEntry *)allocate(sizeToAllocate); spe->fLength = n; spe->fNext = 0; XMLString::copyString((XMLCh*)spe->fString, in); return spe->fString; } inline const XMLCh* DOMDocumentImpl::getPooledNString(const XMLCh *in, XMLSize_t n) { if (in == 0) return 0; DOMStringPoolEntry **pspe; DOMStringPoolEntry *spe; XMLSize_t inHash = XMLString::hashN(in, n, fNameTableSize); pspe = &fNameTable[inHash]; while (*pspe != 0) { if ((*pspe)->fLength == n && XMLString::equalsN((*pspe)->fString, in, n)) return (*pspe)->fString; pspe = &((*pspe)->fNext); } // This string hasn't been seen before. Add it to the pool. // // Compute size to allocate. Note that there's 1 char of string // declared in the struct, so we don't need to add one again to // account for the trailing null. // XMLSize_t sizeToAllocate = sizeof(DOMStringPoolEntry) + n*sizeof(XMLCh); *pspe = spe = (DOMStringPoolEntry *)allocate(sizeToAllocate); spe->fLength = n; spe->fNext = 0; XMLString::copyNString((XMLCh*)spe->fString, in, n); return spe->fString; } inline int DOMDocumentImpl::indexofQualifiedName(const XMLCh* name) { int i = 0; int colon = -1; int colon_count = 0; for (; *name != 0; ++i, ++name) { if (*name == chColon) { ++colon_count; colon = i; } } if (i == 0 || colon == 0 || colon == (i - 1) || colon_count > 1) return -1; return colon != -1 ? colon : 0; } XERCES_CPP_NAMESPACE_END // --------------------------------------------------------------------------- // // Operator new. Global overloaded version, lets any object be allocated on // the heap owned by a document. // // --------------------------------------------------------------------------- inline void * operator new(size_t amt, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocumentImpl *doc, XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager::NodeObjectType type) { void *p = doc->allocate(amt, type); return p; } inline void * operator new(size_t amt, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager::NodeObjectType type) { XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager* mgr=(XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager*)doc->getFeature(XERCES_CPP_NAMESPACE_QUALIFIER XMLUni::fgXercescInterfaceDOMMemoryManager,0); void* p=0; if(mgr) p = mgr->allocate(amt, type); return p; } inline void * operator new(size_t amt, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocumentImpl *doc) { void* p = doc->allocate(amt); return p; } inline void * operator new(size_t amt, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc) { XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager* mgr=(XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager*)doc->getFeature(XERCES_CPP_NAMESPACE_QUALIFIER XMLUni::fgXercescInterfaceDOMMemoryManager,0); void* p=0; if(mgr) p = mgr->allocate(amt); return p; } // --------------------------------------------------------------------------- // For DOM: // Bypass compiler warning: // no matching operator delete found; memory will not be freed if initialization throws an exception // --------------------------------------------------------------------------- #if !defined(XERCES_NO_MATCHING_DELETE_OPERATOR) inline void operator delete(void* /*ptr*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocumentImpl * /*doc*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager::NodeObjectType /*type*/) { return; } inline void operator delete(void* /*ptr*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * /*doc*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager::NodeObjectType /*type*/) { return; } inline void operator delete(void* /*ptr*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocumentImpl * /*doc*/) { return; } inline void operator delete(void* /*ptr*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * /*doc*/) { return; } #endif #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMConfigurationImpl.cpp000644 000765 000024 00000026176 13241160337 024517 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "DOMConfigurationImpl.hpp" #include "DOMStringListImpl.hpp" #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN const unsigned short DOMConfigurationImpl::fDEFAULT_VALUES = 0x2596; DOMConfigurationImpl::DOMConfigurationImpl(MemoryManager* const manager): featureValues(fDEFAULT_VALUES), fErrorHandler(0), fSchemaType(0), fSchemaLocation(0), fSupportedParameters(0), fMemoryManager(manager) { fSupportedParameters=new (fMemoryManager) DOMStringListImpl(17, fMemoryManager); fSupportedParameters->add(XMLUni::fgDOMErrorHandler); fSupportedParameters->add(XMLUni::fgDOMSchemaType); fSupportedParameters->add(XMLUni::fgDOMSchemaLocation); fSupportedParameters->add(XMLUni::fgDOMCanonicalForm); fSupportedParameters->add(XMLUni::fgDOMCDATASections); fSupportedParameters->add(XMLUni::fgDOMComments); fSupportedParameters->add(XMLUni::fgDOMDatatypeNormalization); fSupportedParameters->add(XMLUni::fgDOMWRTDiscardDefaultContent); fSupportedParameters->add(XMLUni::fgDOMEntities); fSupportedParameters->add(XMLUni::fgDOMInfoset); fSupportedParameters->add(XMLUni::fgDOMNamespaces); fSupportedParameters->add(XMLUni::fgDOMNamespaceDeclarations); fSupportedParameters->add(XMLUni::fgDOMNormalizeCharacters); fSupportedParameters->add(XMLUni::fgDOMSplitCDATASections); fSupportedParameters->add(XMLUni::fgDOMValidate); fSupportedParameters->add(XMLUni::fgDOMValidateIfSchema); fSupportedParameters->add(XMLUni::fgDOMElementContentWhitespace); } DOMConfigurationImpl::~DOMConfigurationImpl() { delete fSupportedParameters; } void DOMConfigurationImpl::setParameter(const XMLCh* name, const void* value) { if(!canSetParameter(name, value)) { throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, fMemoryManager); } if(XMLString::compareIStringASCII(name, XMLUni::fgDOMErrorHandler)==0) { fErrorHandler = (DOMErrorHandler*)value; } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMSchemaType)==0) { fSchemaType = (XMLCh*)value; } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMSchemaLocation)==0) { fSchemaLocation = (XMLCh*)value; } else { // canSetParameter above should take care of this case throw DOMException(DOMException::NOT_FOUND_ERR, 0, fMemoryManager); } } void DOMConfigurationImpl::setParameter(const XMLCh* name, bool value) { if(!canSetParameter(name, value)) { throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, fMemoryManager); } DOMConfigurationFeature whichFlag = getFeatureFlag(name); if(value) { featureValues |= whichFlag; } else { featureValues &= ~whichFlag; } } // -------------------------------------- // Getter Methods // -------------------------------------- const void* DOMConfigurationImpl::getParameter(const XMLCh* name) const { DOMConfigurationFeature whichFlag; try { whichFlag = getFeatureFlag(name); if(featureValues & whichFlag) { return (void*)true; } else { return (void*)false; } } catch (DOMException&) { // must not be a boolean parameter if(XMLString::compareIStringASCII(name, XMLUni::fgDOMErrorHandler)==0) { return fErrorHandler; } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMSchemaType)==0) { return fSchemaType; } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMSchemaLocation)==0) { return fSchemaLocation; } else { throw DOMException(DOMException::NOT_FOUND_ERR, 0, fMemoryManager); } } } // ----------------------------------------- // Query Methods // ----------------------------------------- bool DOMConfigurationImpl::canSetParameter(const XMLCh* name, const void* /*value*/) const { /** * canSetParameter(name, value) returns false in two conditions: * 1) if a [required] feature has no supporting code, then return false in * both the true and false outcomes (This is in order to be either fully * spec compliant, or not at all) * 2) if an [optional] feature has no supporting code, then return false **/ if(XMLString::compareIStringASCII(name, XMLUni::fgDOMErrorHandler)==0) { return true; // required // } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMSchemaType)==0) { return false; // optional // } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMSchemaLocation)==0) { return false; // optional // } return false; } bool DOMConfigurationImpl::canSetParameter(const XMLCh* name, bool booleanValue) const { /** * canSetParameter(name, value) returns false in two conditions: * 1) if a [required] feature has no supporting code, then return false in * both the true and false outcomes (This is in order to be either fully * spec compliant, or not at all) * 2) if an [optional] feature has no supporting code, then return false **/ DOMConfigurationFeature whichFlag = getFeatureFlag(name); switch (whichFlag) { case FEATURE_CANONICAL_FORM: if(booleanValue) return false; // optional // else return true; // required // case FEATURE_CDATA_SECTIONS: return true; case FEATURE_COMMENTS: return true; case FEATURE_DATATYPE_NORMALIZATION: if(booleanValue) return false; // required // else return true; // required // case FEATURE_DISCARD_DEFAULT_CONTENT: if(booleanValue) return false; // required // else return true; // required // case FEATURE_ENTITIES: if(booleanValue) return true; // required // else return true; // required // case FEATURE_INFOSET: if(booleanValue) return false; // required // else return true; // no effect// case FEATURE_NAMESPACES: return true; case FEATURE_NAMESPACE_DECLARATIONS: if(booleanValue) return true; // optional // else return false; // required // case FEATURE_NORMALIZE_CHARACTERS: if(booleanValue) return false; // optional // else return true; // required // case FEATURE_SPLIT_CDATA_SECTIONS: //we dont report an error in the false case so we cant claim we do it if(booleanValue) return false; // required // else return false; // required // case FEATURE_VALIDATE: if(booleanValue) return false; // optional // else return true; // required // case FEATURE_VALIDATE_IF_SCHEMA: if(booleanValue) return false; // optional // else return true; // required // case FEATURE_ELEMENT_CONTENT_WHITESPACE: if(booleanValue) return true; // required // else return false; // optional // } // should never be here return false; } const DOMStringList* DOMConfigurationImpl::getParameterNames() const { return fSupportedParameters; } // ------------------------------------------- // Impl methods // ------------------------------------------- DOMConfigurationImpl::DOMConfigurationFeature DOMConfigurationImpl::getFeatureFlag(const XMLCh* name) const { if(XMLString::compareIStringASCII(name, XMLUni::fgDOMCanonicalForm)==0) { return FEATURE_CANONICAL_FORM; } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMCDATASections )==0) { return FEATURE_CDATA_SECTIONS; } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMComments)==0) { return FEATURE_COMMENTS; } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMDatatypeNormalization)==0) { return FEATURE_DATATYPE_NORMALIZATION; } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMWRTDiscardDefaultContent)==0) { return FEATURE_DISCARD_DEFAULT_CONTENT; } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMEntities)==0) { return FEATURE_ENTITIES; } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMInfoset)==0) { return FEATURE_INFOSET; } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMNamespaces)==0) { return FEATURE_NAMESPACES; } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMNamespaceDeclarations)==0) { return FEATURE_NAMESPACE_DECLARATIONS; } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMNormalizeCharacters)==0) { return FEATURE_NORMALIZE_CHARACTERS; } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMSplitCDATASections)==0) { return FEATURE_SPLIT_CDATA_SECTIONS; } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMValidate)==0) { return FEATURE_VALIDATE; } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMValidateIfSchema)==0) { return FEATURE_VALIDATE_IF_SCHEMA; } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMElementContentWhitespace)==0) { return FEATURE_ELEMENT_CONTENT_WHITESPACE; } else { throw DOMException(DOMException::NOT_FOUND_ERR, 0, fMemoryManager); } } DOMErrorHandler* DOMConfigurationImpl::getErrorHandler() const { return fErrorHandler; } const XMLCh* DOMConfigurationImpl::getSchemaType() const { return fSchemaType; } const XMLCh* DOMConfigurationImpl::getSchemaLocation() const { return fSchemaLocation; } void DOMConfigurationImpl::setErrorHandler(DOMErrorHandler *erHandler) { fErrorHandler = erHandler; } void DOMConfigurationImpl::setSchemaType(const XMLCh* st) { fSchemaType = st; } void DOMConfigurationImpl::setSchemaLocation(const XMLCh* sl) { fSchemaLocation = sl; } XERCES_CPP_NAMESPACE_END /** * End of file DOMConfigurationImpl.cpp */ xerces-c-3.2.2/src/xercesc/dom/impl/DOMLocatorImpl.cpp000644 000765 000024 00000003502 13241160337 023277 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLocatorImpl.cpp 676853 2008-07-15 09:58:05Z borisk $ */ #include "DOMLocatorImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // DOMLocatorImpl: Constructors and Destructor // --------------------------------------------------------------------------- DOMLocatorImpl::DOMLocatorImpl() : fLineNum(0) , fColumnNum(0) , fByteOffset(~(XMLFilePos(0))) , fUtf16Offset(~(XMLFilePos(0))) , fRelatedNode(0) , fURI(0) { } DOMLocatorImpl::DOMLocatorImpl(const XMLFileLoc lineNum, const XMLFileLoc columnNum, DOMNode* const errorNode, const XMLCh* const uri, const XMLFilePos byteOffset, const XMLFilePos utf16Offset) : fLineNum(lineNum) , fColumnNum(columnNum) , fByteOffset(byteOffset) , fUtf16Offset(utf16Offset) , fRelatedNode(errorNode) , fURI(uri) { } DOMLocatorImpl::~DOMLocatorImpl() { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMImplementationRegistry.cpp000644 000765 000024 00000007505 13241160337 025577 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMImplementationRegistry.cpp 676911 2008-07-15 13:27:32Z amassari $ */ #include #include #include #include #include #include #include #include "DOMImplementationImpl.hpp" #include "DOMImplementationListImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN // Points to the singleton instance of a registry of DOMImplementationSource. // static RefVectorOf* gDOMImplSrcVector = 0; // Global mutex that is used to synchronize access to the vector. // static XMLMutex* gDOMImplSrcVectorMutex = 0; void XMLInitializer::initializeDOMImplementationRegistry() { gDOMImplSrcVectorMutex = new XMLMutex(XMLPlatformUtils::fgMemoryManager); gDOMImplSrcVector = new RefVectorOf(3, false); } void XMLInitializer::terminateDOMImplementationRegistry() { delete gDOMImplSrcVector; gDOMImplSrcVector = 0; delete gDOMImplSrcVectorMutex; gDOMImplSrcVectorMutex = 0; } // ----------------------------------------------------------------------- // DOMImplementationRegistry Functions // ----------------------------------------------------------------------- DOMImplementation *DOMImplementationRegistry::getDOMImplementation(const XMLCh* features) { XMLMutexLock lock(gDOMImplSrcVectorMutex); XMLSize_t len = gDOMImplSrcVector->size(); // Put our defined source there if (len == 0) { gDOMImplSrcVector->addElement((DOMImplementationSource*)DOMImplementationImpl::getDOMImplementationImpl()); len = gDOMImplSrcVector->size(); } for (XMLSize_t i = len; i > 0; i--) { DOMImplementationSource* source = gDOMImplSrcVector->elementAt(i-1); DOMImplementation* impl = source->getDOMImplementation(features); if (impl) return impl; } return 0; } DOMImplementationList* DOMImplementationRegistry::getDOMImplementationList(const XMLCh* features) { DOMImplementationListImpl* list = new DOMImplementationListImpl; XMLMutexLock lock(gDOMImplSrcVectorMutex); XMLSize_t len = gDOMImplSrcVector->size(); // Put our defined source there if (len == 0) gDOMImplSrcVector->addElement((DOMImplementationSource*)DOMImplementationImpl::getDOMImplementationImpl()); len = gDOMImplSrcVector->size(); for (XMLSize_t i = len; i > 0; i--) { DOMImplementationSource* source = gDOMImplSrcVector->elementAt(i-1); DOMImplementationList* oneList = source->getDOMImplementationList(features); XMLSize_t oneListLen=oneList->getLength(); for(XMLSize_t j=0; jadd(oneList->item(j)); oneList->release(); } return list; } void DOMImplementationRegistry::addSource (DOMImplementationSource* source) { XMLMutexLock lock(gDOMImplSrcVectorMutex); gDOMImplSrcVector->addElement(source); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMDeepNodeListPool.hpp000644 000765 000024 00000016573 13241160337 024244 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMDeepNodeListPool.hpp 883368 2009-11-23 15:28:19Z amassari $ */ // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #if !defined(XERCESC_INCLUDE_GUARD_DOMDEEPNODELISTPOOL_HPP) #define XERCESC_INCLUDE_GUARD_DOMDEEPNODELISTPOOL_HPP #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // // This should really be a nested class, but some of the compilers we // have to support cannot deal with that! // template struct DOMDeepNodeListPoolTableBucketElem : public XMemory { DOMDeepNodeListPoolTableBucketElem ( void* key1 , XMLCh* key2 , XMLCh* key3 , TVal* const value , DOMDeepNodeListPoolTableBucketElem* next , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) : fData(value) , fNext(next) , fKey1(key1) , fKey2(0) , fKey3(0) { if (key2) fKey2 = XMLString::replicate(key2, manager); if (key3) fKey3 = XMLString::replicate(key3, manager); } TVal* fData; DOMDeepNodeListPoolTableBucketElem* fNext; void* fKey1; XMLCh* fKey2; XMLCh* fKey3; ~DOMDeepNodeListPoolTableBucketElem() {}; }; template class DOMDeepNodeListPool { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- DOMDeepNodeListPool ( const XMLSize_t modulus , const XMLSize_t initSize = 128 ); DOMDeepNodeListPool ( const XMLSize_t modulus , const bool adoptElems , const XMLSize_t initSize = 128 ); DOMDeepNodeListPool ( const XMLSize_t modulus , const bool adoptElems , const THasher& hasher , const XMLSize_t initSize = 128 ); ~DOMDeepNodeListPool(); // ----------------------------------------------------------------------- // Element management // ----------------------------------------------------------------------- bool isEmpty() const; bool containsKey(const void* const key1, const XMLCh* const key2, const XMLCh* const key3) const; void removeAll(); void cleanup(); // ----------------------------------------------------------------------- // Getters // ----------------------------------------------------------------------- TVal* getByKey(const void* const key1, const XMLCh* const key2, const XMLCh* const key3); const TVal* getByKey(const void* const key1, const XMLCh* const key2, const XMLCh* const key3) const; TVal* getById(const XMLSize_t elemId); const TVal* getById(const XMLSize_t elemId) const; // ----------------------------------------------------------------------- // Putters // ----------------------------------------------------------------------- XMLSize_t put(void* key1, XMLCh* key2, XMLCh* key3, TVal* const valueToAdopt); private: // ----------------------------------------------------------------------- // Private methods // ----------------------------------------------------------------------- DOMDeepNodeListPoolTableBucketElem* findBucketElem(const void* const key1, const XMLCh* const key2, const XMLCh* const key3, XMLSize_t& hashVal); const DOMDeepNodeListPoolTableBucketElem* findBucketElem(const void* const key1, const XMLCh* const key2, const XMLCh* const key3, XMLSize_t& hashVal) const; void initialize(const XMLSize_t modulus); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMDeepNodeListPool(const DOMDeepNodeListPool &); DOMDeepNodeListPool & operator = (const DOMDeepNodeListPool &); // ----------------------------------------------------------------------- // Data members // // fAdoptedElems // Indicates whether the values added are adopted or just referenced. // If adopted, then they are deleted when they are removed from the // hash table. // // fBucketList // This is the array that contains the heads of all of the list // buckets, one for each possible hash value. // // fHashModulus // The modulus used for this hash table, to hash the keys. This is // also the number of elements in the bucket list. // // fHash // The hasher for the key1 data type. // // fIdPtrs // fIdPtrsCount // This is the array of pointers to the bucket elements in order of // their assigned ids. So taking id N and referencing this array // gives you the element with that id. The count field indicates // the current size of this list. When fIdCounter+1 reaches this // value the list must be expanded. // // fIdCounter // This is used to give out unique ids to added elements. It starts // at zero (which means empty), and is bumped up for each newly added // element. So the first element is 1, the next is 2, etc... This // means that this value is set to the top index of the fIdPtrs array. // ----------------------------------------------------------------------- bool fAdoptedElems; DOMDeepNodeListPoolTableBucketElem** fBucketList; XMLSize_t fHashModulus; TVal** fIdPtrs; XMLSize_t fIdPtrsCount; XMLSize_t fIdCounter; MemoryManager* fMemoryManager; THasher fHasher; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMCommentImpl.hpp000644 000765 000024 00000006021 13241160337 023302 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMCommentImpl.hpp 1800911 2017-07-05 18:52:15Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMCOMMENTIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMCOMMENTIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include #include "DOMNodeBase.hpp" #include "DOMNodeImpl.hpp" #include "DOMChildNode.hpp" #include "DOMCharacterDataImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN class CDOM_EXPORT DOMCommentImpl: public DOMComment, public HasDOMNodeImpl, public HasDOMChildImpl { public: DOMNodeImpl fNode; DOMChildNode fChild; DOMCharacterDataImpl fCharacterData; public: DOMCommentImpl(DOMDocument *, const XMLCh *); DOMCommentImpl(const DOMCommentImpl &other, bool deep); virtual ~DOMCommentImpl(); public: // Declare all of the functions from DOMNode. DOMNODE_FUNCTIONS; // Add accessors for implementation bits. DOMNODEIMPL_DECL; DOMCHILDIMPL_DECL; public: // Functions from DOMCharacterData virtual void appendData(const XMLCh *data); virtual void deleteData(XMLSize_t offset, XMLSize_t count); virtual const XMLCh * getData() const; virtual XMLSize_t getLength() const; virtual void insertData(XMLSize_t offset, const XMLCh * data); virtual void replaceData(XMLSize_t offset, XMLSize_t count, const XMLCh * data); virtual void setData(const XMLCh * arg); virtual const XMLCh * substringData(XMLSize_t offset, XMLSize_t count) const; // Non standard extension for the range to work DOMComment* splitText(XMLSize_t offset); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMCommentImpl & operator = (const DOMCommentImpl &); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMNormalizer.cpp000644 000765 000024 00000040572 13241160337 023204 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "DOMConfigurationImpl.hpp" #include "DOMDocumentImpl.hpp" #include "DOMElementImpl.hpp" #include "DOMErrorImpl.hpp" #include "DOMEntityReferenceImpl.hpp" #include "DOMNormalizer.hpp" #include "DOMTextImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN static XMLMsgLoader* gMsgLoader = 0; void XMLInitializer::initializeDOMNormalizer() { gMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgXMLErrDomain); if (!gMsgLoader) XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain); } void XMLInitializer::terminateDOMNormalizer() { delete gMsgLoader; gMsgLoader = 0; } // // DOMNormalizer::DOMNormalizer(MemoryManager* const manager) : fDocument(0) , fConfiguration(0) , fErrorHandler(0) , fNSScope(0) , fNewNamespaceCount(1) , fMemoryManager(manager) { fNSScope = new (fMemoryManager) InScopeNamespaces(fMemoryManager); } DOMNormalizer::~DOMNormalizer() { delete fNSScope; } void DOMNormalizer::normalizeDocument(DOMDocumentImpl *doc) { fDocument = doc; fConfiguration = (DOMConfigurationImpl*)doc->getDOMConfig(); DOMConfigurationImpl *dci = (DOMConfigurationImpl*)fDocument->getDOMConfig(); if(dci) fErrorHandler = dci->getErrorHandler(); else fErrorHandler = 0; DOMNode *child = 0; DOMNode *next = 0; ((DOMNormalizer *)this)->fNewNamespaceCount = 1; for(child = doc->getFirstChild();child != 0; child = next) { next = child->getNextSibling(); child = normalizeNode(child); if(child != 0) { next = child; } } } DOMNode * DOMNormalizer::normalizeNode(DOMNode *node) const { switch(node->getNodeType()) { case DOMNode::ELEMENT_NODE: { fNSScope->addScope(fMemoryManager); DOMNamedNodeMap *attrMap = node->getAttributes(); if(fConfiguration->featureValues & DOMConfigurationImpl::FEATURE_NAMESPACES) { namespaceFixUp((DOMElementImpl*)node); } else { //this is done in namespace fixup so no need to do it if namespace is on if(attrMap) { for(XMLSize_t i = 0; i < attrMap->getLength(); i++) { attrMap->item(i)->normalize(); } } } DOMNode *child = node->getFirstChild(); DOMNode *next = 0; for (; child != 0; child = next) { next = child->getNextSibling(); child = normalizeNode(child); if(child != 0) { next = child; } } fNSScope->removeScope(); break; } case DOMNode::COMMENT_NODE: { if (!(fConfiguration->featureValues & DOMConfigurationImpl::FEATURE_COMMENTS)) { DOMNode *prevSibling = node->getPreviousSibling(); DOMNode *parent = node->getParentNode(); // remove the comment node parent->removeChild(node); if (prevSibling != 0 && prevSibling->getNodeType() == DOMNode::TEXT_NODE) { DOMNode *nextSibling = prevSibling->getNextSibling(); if (nextSibling != 0 && nextSibling->getNodeType() == DOMNode::TEXT_NODE) { ((DOMTextImpl*)nextSibling)->insertData(0, prevSibling->getNodeValue()); parent->removeChild(prevSibling); return nextSibling; } } } break; } case DOMNode::CDATA_SECTION_NODE: { if (!(fConfiguration->featureValues & DOMConfigurationImpl::FEATURE_CDATA_SECTIONS)) { // convert CDATA to TEXT nodes DOMText *text = fDocument->createTextNode(node->getNodeValue()); DOMNode *parent = node->getParentNode(); DOMNode *prevSibling = node->getPreviousSibling(); node = parent->replaceChild(text, node); if (prevSibling != 0 && prevSibling->getNodeType() == DOMNode::TEXT_NODE) { text->insertData(0, prevSibling->getNodeValue()); parent->removeChild(prevSibling); } return text; // Don't advance; } break; } case DOMNode::TEXT_NODE: { DOMNode *next = node->getNextSibling(); if(next != 0 && next->getNodeType() == DOMNode::TEXT_NODE) { ((DOMText*)node)->appendData(next->getNodeValue()); node->getParentNode()->removeChild(next); return node; } else { const XMLCh* nv = node->getNodeValue(); if (nv == 0 || *nv == 0) { node->getParentNode()->removeChild(node); } } } default: break; } return 0; } void DOMNormalizer::namespaceFixUp(DOMElementImpl *ele) const { DOMAttrMapImpl *attrMap = ele->fAttributes; XMLSize_t len = attrMap->getLength(); //get the ns info from the attrs for(XMLSize_t i = 0; i < len; i++) { DOMAttr *at = (DOMAttr*)attrMap->item(i); //normalize the attr whatever happens at->normalize(); const XMLCh *uri = at->getNamespaceURI(); const XMLCh *value = at->getNodeValue(); if(XMLString::equals(XMLUni::fgXMLNSURIName, uri)) { if(XMLString::equals(XMLUni::fgXMLNSURIName, value)) { error(XMLErrs::NSDeclInvalid, ele); } else { const XMLCh *prefix = at->getPrefix(); if(XMLString::equals(prefix, XMLUni::fgXMLNSString)) { fNSScope->addOrChangeBinding(at->getLocalName(), value, fMemoryManager); } else { fNSScope->addOrChangeBinding(XMLUni::fgZeroLenString, value, fMemoryManager); } } } } const XMLCh* prefix = ele->getPrefix(); prefix ? prefix : prefix = XMLUni::fgZeroLenString; const XMLCh* uri = ele->getNamespaceURI(); uri ? uri : uri = XMLUni::fgZeroLenString; if(!XMLString::equals(uri, XMLUni::fgZeroLenString)) { if(!fNSScope->isValidBinding(prefix, uri)) { addOrChangeNamespaceDecl(prefix, uri, ele); fNSScope->addOrChangeBinding(prefix, uri, fMemoryManager); } } else { if(ele->getLocalName() == 0) { error(XMLErrs::DOMLevel1Node, ele); } else if(!fNSScope->isValidBinding(XMLUni::fgZeroLenString, XMLUni::fgZeroLenString)) { addOrChangeNamespaceDecl(XMLUni::fgZeroLenString, XMLUni::fgZeroLenString, ele); fNSScope->addOrChangeBinding(XMLUni::fgZeroLenString, XMLUni::fgZeroLenString, fMemoryManager); } } //fix up non ns attrs len = attrMap->getLength(); // hp aCC complains this i is a redefinition of the i on line 283 for(XMLSize_t j = 0; j < len; j++) { DOMAttr *at = (DOMAttr*)attrMap->item(j); const XMLCh *uri = at->getNamespaceURI(); const XMLCh* prefix = at->getPrefix(); if(!XMLString::equals(XMLUni::fgXMLNSURIName, uri)) { if(uri != 0) { if(prefix == 0 || !fNSScope->isValidBinding(prefix, uri)) { const XMLCh* newPrefix = fNSScope->getPrefix(uri); if(newPrefix != 0) { at->setPrefix(newPrefix); } else { if(prefix != 0 && !fNSScope->getUri(prefix)) { fNSScope->addOrChangeBinding(prefix, uri, fMemoryManager); addOrChangeNamespaceDecl(prefix, uri, ele); } else { newPrefix = addCustomNamespaceDecl(uri, ele); fNSScope->addOrChangeBinding(newPrefix, uri, fMemoryManager); at->setPrefix(newPrefix); } } } } else if(at->getLocalName() == 0) { error(XMLErrs::DOMLevel1Node, at); } } } } const XMLCh * DOMNormalizer::integerToXMLCh(unsigned int i) const { XMLCh *buf = (XMLCh*) fMemoryManager->allocate(15 * sizeof(XMLCh));//new XMLCh[15]; XMLCh *pos = buf + sizeof(buf) - sizeof(XMLCh); *pos = chNull; do { switch(i % 10) { case 0 : *--pos = chDigit_0;break; case 1 : *--pos = chDigit_1;break; case 2 : *--pos = chDigit_2;break; case 3 : *--pos = chDigit_3;break; case 4 : *--pos = chDigit_4;break; case 5 : *--pos = chDigit_5;break; case 6 : *--pos = chDigit_6;break; case 7 : *--pos = chDigit_7;break; case 8 : *--pos = chDigit_8;break; case 9 : *--pos = chDigit_9;break; default:; } i /= 10; } while (i); const XMLCh *copy = fDocument->getPooledString(pos); fMemoryManager->deallocate(buf);//delete[] buf; return copy; } void DOMNormalizer::addOrChangeNamespaceDecl(const XMLCh* prefix, const XMLCh* uri, DOMElementImpl* element) const { if (XMLString::equals(prefix, XMLUni::fgZeroLenString)) { element->setAttributeNS(XMLUni::fgXMLNSURIName, XMLUni::fgXMLNSString, uri); } else { XMLBuffer buf(1023, fMemoryManager); buf.set(XMLUni::fgXMLNSString); buf.append(chColon); buf.append(prefix); element->setAttributeNS(XMLUni::fgXMLNSURIName, buf.getRawBuffer(), uri); } } const XMLCh* DOMNormalizer::addCustomNamespaceDecl(const XMLCh* uri, DOMElementImpl *element) const { XMLBuffer preBuf(1023, fMemoryManager); preBuf.append(chLatin_N); preBuf.append(chLatin_S); preBuf.append(integerToXMLCh(fNewNamespaceCount)); ((DOMNormalizer *)this)->fNewNamespaceCount++; while(fNSScope->getUri(preBuf.getRawBuffer())) { preBuf.reset(); preBuf.append(chLatin_N); preBuf.append(chLatin_S); preBuf.append(integerToXMLCh(fNewNamespaceCount)); ((DOMNormalizer *)this)->fNewNamespaceCount++; } XMLBuffer buf(1023, fMemoryManager); buf.set(XMLUni::fgXMLNSString); buf.append(chColon); buf.append(preBuf.getRawBuffer()); element->setAttributeNS(XMLUni::fgXMLNSURIName, buf.getRawBuffer(), uri); return element->getAttributeNodeNS(XMLUni::fgXMLNSURIName, preBuf.getRawBuffer())->getLocalName(); } XMLSize_t DOMNormalizer::InScopeNamespaces::size() { return fScopes->size(); } DOMNormalizer::InScopeNamespaces::InScopeNamespaces(MemoryManager* const manager) : lastScopeWithBindings(0) { fScopes = new (manager) RefVectorOf(10, true, manager); } DOMNormalizer::InScopeNamespaces::~InScopeNamespaces() { delete fScopes; } void DOMNormalizer::InScopeNamespaces::addOrChangeBinding(const XMLCh *prefix, const XMLCh *uri, MemoryManager* const manager) { XMLSize_t s = fScopes->size(); if(!s) addScope(manager); Scope *curScope = fScopes->elementAt(s - 1); curScope->addOrChangeBinding(prefix, uri, manager); lastScopeWithBindings = curScope; } void DOMNormalizer::InScopeNamespaces::addScope(MemoryManager* const manager) { Scope *s = new (manager) Scope(lastScopeWithBindings); fScopes->addElement(s); } void DOMNormalizer::InScopeNamespaces::removeScope() { lastScopeWithBindings = fScopes->elementAt(fScopes->size() - 1)->fBaseScopeWithBindings; Scope *s = fScopes->orphanElementAt(fScopes->size() - 1); delete s; } bool DOMNormalizer::InScopeNamespaces::isValidBinding(const XMLCh* prefix, const XMLCh* uri) const { const XMLCh* actual = fScopes->elementAt(fScopes->size() - 1)->getUri(prefix); if(actual == 0 || !XMLString::equals(actual, uri)) return false; return true; } const XMLCh* DOMNormalizer::InScopeNamespaces::getPrefix(const XMLCh* uri) const { return fScopes->elementAt(fScopes->size() - 1)->getPrefix(uri); } const XMLCh* DOMNormalizer::InScopeNamespaces::getUri(const XMLCh* prefix) const { return fScopes->elementAt(fScopes->size() - 1)->getUri(prefix); } DOMNormalizer::InScopeNamespaces::Scope::Scope(Scope *baseScopeWithBindings) : fBaseScopeWithBindings(baseScopeWithBindings), fPrefixHash(0), fUriHash(0) { } DOMNormalizer::InScopeNamespaces::Scope::~Scope() { delete fPrefixHash; delete fUriHash; } void DOMNormalizer::InScopeNamespaces::Scope::addOrChangeBinding(const XMLCh *prefix, const XMLCh *uri, MemoryManager* const manager) { //initialize and copy forward now we need to if(!fUriHash) { fPrefixHash = new (manager) RefHashTableOf(10, (bool) false, manager); fUriHash = new (manager) RefHashTableOf(10, (bool) false, manager); if(fBaseScopeWithBindings) { RefHashTableOfEnumerator preEnumer(fBaseScopeWithBindings->fPrefixHash, false, manager); while(preEnumer.hasMoreElements()) { const XMLCh* prefix = (XMLCh*) preEnumer.nextElementKey(); const XMLCh* uri = fBaseScopeWithBindings->fPrefixHash->get((void*)prefix); //have to cast here because otherwise we have delete problems under windows :( fPrefixHash->put((void *)prefix, (XMLCh*)uri); } RefHashTableOfEnumerator uriEnumer(fBaseScopeWithBindings->fUriHash, false, manager); while(uriEnumer.hasMoreElements()) { const XMLCh* uri = (XMLCh*) uriEnumer.nextElementKey(); const XMLCh* prefix = fBaseScopeWithBindings->fUriHash->get((void*)uri); //have to cast here because otherwise we have delete problems under windows :( fUriHash->put((void *)uri, (XMLCh*)prefix); } } } const XMLCh *oldUri = fPrefixHash->get(prefix); if(oldUri) { fUriHash->removeKey(oldUri); } fPrefixHash->put((void *)prefix, (XMLCh*)uri); fUriHash->put((void *)uri, (XMLCh*)prefix); } const XMLCh* DOMNormalizer::InScopeNamespaces::Scope::getUri(const XMLCh *prefix) const { const XMLCh* uri = 0; if(fPrefixHash) { uri = fPrefixHash->get(prefix); } else if(fBaseScopeWithBindings) { uri = fBaseScopeWithBindings->getUri(prefix); } return uri ? uri : 0; } const XMLCh* DOMNormalizer::InScopeNamespaces::Scope::getPrefix(const XMLCh* uri) const { const XMLCh* prefix = 0; if(fUriHash) { prefix = fUriHash->get(uri); } else if(fBaseScopeWithBindings) { prefix = fBaseScopeWithBindings->getPrefix(uri); } return prefix ? prefix : 0; } void DOMNormalizer::error(const XMLErrs::Codes code, const DOMNode *node) const { if (fErrorHandler) { // Load the message into alocal and replace any tokens found in // the text. const XMLSize_t maxChars = 2047; XMLCh errText[maxChars + 1]; if (!gMsgLoader->loadMsg(code, errText, maxChars)) { // Should probably load a default message here } DOMErrorImpl domError( XMLErrs::DOMErrorType (code), 0, errText, (void*)node); bool toContinueProcess = true; try { toContinueProcess = fErrorHandler->handleError(domError); } catch(...) { } if (!toContinueProcess) throw (XMLErrs::Codes) code; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMDeepNodeListImpl.cpp000644 000765 000024 00000015333 13241160337 024220 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMDeepNodeListImpl.cpp 678381 2008-07-21 10:15:01Z borisk $ */ #include "DOMDeepNodeListImpl.hpp" #include "DOMElementImpl.hpp" #include "DOMDocumentImpl.hpp" #include "DOMCasts.hpp" #include "DOMNodeImpl.hpp" #include #include XERCES_CPP_NAMESPACE_BEGIN static const XMLCh kAstr[] = {chAsterisk, chNull}; DOMDeepNodeListImpl::DOMDeepNodeListImpl(const DOMNode *rootNode, const XMLCh *tagName) : fRootNode(rootNode) , fChanges(0) , fCurrentNode(0) , fCurrentIndexPlus1(0) , fNamespaceURI(0) , fMatchAllURI(false) , fMatchURIandTagname(false) { fTagName = ((DOMDocumentImpl *)(castToNodeImpl(rootNode)->getOwnerDocument()))->getPooledString(tagName); fMatchAll = XMLString::equals(fTagName, kAstr); } //DOM Level 2 DOMDeepNodeListImpl::DOMDeepNodeListImpl(const DOMNode *rootNode, const XMLCh *namespaceURI, const XMLCh *localName) : fRootNode(rootNode) , fChanges(0) , fCurrentNode(0) , fCurrentIndexPlus1(0) , fMatchAllURI(false) , fMatchURIandTagname(true) { DOMDocumentImpl* doc = (DOMDocumentImpl *)castToNodeImpl(rootNode)->getOwnerDocument(); fTagName = doc->getPooledString(localName); fMatchAll = XMLString::equals(fTagName, kAstr); fMatchAllURI = XMLString::equals(namespaceURI, kAstr); fNamespaceURI = doc->getPooledString(namespaceURI); } DOMDeepNodeListImpl::~DOMDeepNodeListImpl() { } XMLSize_t DOMDeepNodeListImpl::getLength() const { // Reset cache to beginning of list item(0); // Preload all matching elements. (Stops when we run out of subtree!) item(INT_MAX); return fCurrentIndexPlus1; } DOMNode *DOMDeepNodeListImpl::item(XMLSize_t index) const { return ((DOMDeepNodeListImpl*)this)->cacheItem(index); } // Start from the first child and count forward, 0-based. index>length-1 // should return 0. // // Attempts to do only work actually requested, cache work already // done, and to flush that cache when the tree has changed. // // LIMITATION: ????? Unable to tell relevant tree-changes from // irrelevant ones. Doing so in a really useful manner would seem // to involve a tree-walk in its own right, or maintaining our data // in a parallel tree. DOMNode *DOMDeepNodeListImpl::cacheItem(XMLSize_t index) { XMLSize_t currentIndexPlus1 = fCurrentIndexPlus1; DOMNode *currentNode = fCurrentNode; if (castToParentImpl(fRootNode)->changes() != fChanges) { // Tree changed. Do it all from scratch! currentIndexPlus1 = 0; currentNode = (DOMNode *)fRootNode; fChanges = castToParentImpl(fRootNode)->changes(); } else if (currentIndexPlus1 > index+1) { // Interested in something before cached node. Do it all from scratch! currentIndexPlus1 = 0; currentNode = (DOMNode *)fRootNode; } else if (index+1 == currentIndexPlus1) { // What luck! User is interested in cached node. return currentNode; } DOMNode *nextNode = 0; // revisit - ???? How efficient is this loop? ???? // Start at the place in the tree at which we're // currently pointing and count off nodes until we // reach the node of interest or the end of the tree. while (currentIndexPlus1 < index+1 && currentNode != 0) { nextNode = nextMatchingElementAfter(currentNode); if (nextNode == 0) break; currentNode = nextNode; currentIndexPlus1++; } fCurrentNode = currentNode; fCurrentIndexPlus1 = currentIndexPlus1; // If we found a node at the requested index, make that the current node if (nextNode != 0) { return currentNode; } // If we didn't find a node at the requested index, return 0 return 0; } /* Iterative tree-walker. When you have a Parent link, there's often no need to resort to recursion. NOTE THAT only Element nodes are matched since we're specifically supporting getElementsByTagName(). */ DOMNode *DOMDeepNodeListImpl::nextMatchingElementAfter(DOMNode *current) { DOMNode *next; while (current != 0) { // Look down to first child. if (current->hasChildNodes()) { current = current->getFirstChild(); } // Look right to sibling (but not from root!) else { if (current != fRootNode && 0 != (next = current->getNextSibling())) { current = next; } // Look up and right (but not past root!) else { next = 0; for (; current != fRootNode; // Stop on return to starting point current = current->getParentNode()) { next = current->getNextSibling(); if (next != 0) break; } current = next; } } // Have we found an Element with the right tagName? // ("*" matches anything.) if (current != 0 && current != fRootNode && current->getNodeType() == DOMNode::ELEMENT_NODE) { DOMElement *currElement = (DOMElement *)current; if (!fMatchURIandTagname) { //DOM Level 1 if (fMatchAll || XMLString::equals(currElement->getTagName(), fTagName)) return current; } else { //DOM Level 2 if (!fMatchAllURI && !XMLString::equals(current->getNamespaceURI(), fNamespaceURI)) continue; if (fMatchAll || XMLString::equals(current->getLocalName(), fTagName)) return current; } } // Otherwise continue walking the tree } // Fell out of tree-walk; no more instances found return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMTypeInfoImpl.hpp000644 000765 000024 00000010551 13241160337 023440 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #if !defined(XERCESC_INCLUDE_GUARD_DOMTYPEINFOIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMTYPEINFOIMPL_HPP //------------------------------------------------------------------------------------ // Includes //------------------------------------------------------------------------------------ #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMDocumentImpl; class CDOM_EXPORT DOMTypeInfoImpl : public DOMTypeInfo, public DOMPSVITypeInfo { public: //----------------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------------- DOMTypeInfoImpl(const XMLCh* namespaceUri=0, const XMLCh* name=0); DOMTypeInfoImpl(DOMDocumentImpl* ownerDoc, const DOMPSVITypeInfo* sourcePSVI); static DOMTypeInfoImpl g_DtdValidatedElement; static DOMTypeInfoImpl g_DtdNotValidatedAttribute; static DOMTypeInfoImpl g_DtdValidatedCDATAAttribute; static DOMTypeInfoImpl g_DtdValidatedIDAttribute; static DOMTypeInfoImpl g_DtdValidatedIDREFAttribute; static DOMTypeInfoImpl g_DtdValidatedIDREFSAttribute; static DOMTypeInfoImpl g_DtdValidatedENTITYAttribute; static DOMTypeInfoImpl g_DtdValidatedENTITIESAttribute; static DOMTypeInfoImpl g_DtdValidatedNMTOKENAttribute; static DOMTypeInfoImpl g_DtdValidatedNMTOKENSAttribute; static DOMTypeInfoImpl g_DtdValidatedNOTATIONAttribute; static DOMTypeInfoImpl g_DtdValidatedENUMERATIONAttribute; // ----------------------------------------------------------------------- // DOMTypeInfo interface // ----------------------------------------------------------------------- virtual const XMLCh* getTypeName() const; virtual const XMLCh* getTypeNamespace() const; virtual bool isDerivedFrom(const XMLCh* typeNamespaceArg, const XMLCh* typeNameArg, DerivationMethods derivationMethod) const; // ----------------------------------------------------------------------- // DOMPSVITypeInfo interface // ----------------------------------------------------------------------- virtual const XMLCh* getStringProperty(PSVIProperty prop) const; virtual int getNumericProperty(PSVIProperty prop) const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- virtual void setStringProperty(PSVIProperty prop, const XMLCh* value); virtual void setNumericProperty(PSVIProperty prop, int value); protected: int fBitFields; const XMLCh* fTypeName; const XMLCh* fTypeNamespace; const XMLCh* fMemberTypeName; const XMLCh* fMemberTypeNamespace; const XMLCh* fDefaultValue; const XMLCh* fNormalizedValue; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMTypeInfoImpl (const DOMTypeInfoImpl&); DOMTypeInfoImpl & operator = (const DOMTypeInfoImpl &); }; XERCES_CPP_NAMESPACE_END #endif /** * End of file DOMTypeInfo.hpp */ xerces-c-3.2.2/src/xercesc/dom/impl/DOMLSInputImpl.cpp000644 000765 000024 00000004746 13241160337 023245 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLSInputImpl.cpp 752848 2009-03-12 12:44:40Z amassari $ */ #include "DOMLSInputImpl.hpp" #include XERCES_CPP_NAMESPACE_BEGIN DOMLSInputImpl::DOMLSInputImpl(MemoryManager* const manager /*= XMLPlatformUtils::fgMemoryManager*/) :fStringData(0) ,fByteStream(0) ,fEncoding(0) ,fPublicId(0) ,fSystemId(0) ,fBaseURI(0) ,fIssueFatalErrorIfNotFound(true) ,fMemoryManager(manager) { } DOMLSInputImpl::~DOMLSInputImpl() { fMemoryManager->deallocate(fEncoding); fMemoryManager->deallocate(fPublicId); fMemoryManager->deallocate(fSystemId); fMemoryManager->deallocate(fBaseURI); } void DOMLSInputImpl::setStringData(const XMLCh* data) { fStringData=data; setEncoding(XMLUni::fgXMLChEncodingString); } void DOMLSInputImpl::setByteStream(InputSource* stream) { fByteStream=stream; } void DOMLSInputImpl::setEncoding(const XMLCh* const encodingStr) { fMemoryManager->deallocate(fEncoding); fEncoding = XMLString::replicate(encodingStr, fMemoryManager); } void DOMLSInputImpl::setPublicId(const XMLCh* const publicId) { fMemoryManager->deallocate(fPublicId); fPublicId = XMLString::replicate(publicId, fMemoryManager); } void DOMLSInputImpl::setSystemId(const XMLCh* const systemId) { fMemoryManager->deallocate(fSystemId); fSystemId = XMLString::replicate(systemId, fMemoryManager); } void DOMLSInputImpl::setBaseURI(const XMLCh* const baseURI) { fMemoryManager->deallocate(fBaseURI); fBaseURI = XMLString::replicate(baseURI, fMemoryManager); } void DOMLSInputImpl::setIssueFatalErrorIfNotFound(bool flag) { fIssueFatalErrorIfNotFound=flag; } void DOMLSInputImpl::release() { delete this; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMAttrNSImpl.cpp000644 000765 000024 00000017431 13241160337 023055 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMAttrNSImpl.cpp 901107 2010-01-20 08:45:02Z borisk $ */ #include #include "DOMAttrNSImpl.hpp" #include "DOMDocumentImpl.hpp" #include #include #include #include "assert.h" XERCES_CPP_NAMESPACE_BEGIN DOMAttrNSImpl::DOMAttrNSImpl(DOMDocument *ownerDoc, const XMLCh *nam) : DOMAttrImpl(ownerDoc, nam) { this->fNamespaceURI=0; //DOM Level 2 this->fLocalName=0; //DOM Level 2 this->fPrefix=0; } //Introduced in DOM Level 2 DOMAttrNSImpl::DOMAttrNSImpl(DOMDocument *ownerDoc, const XMLCh *namespaceURI, const XMLCh *qualifiedName) : DOMAttrImpl(ownerDoc, qualifiedName) { setName(namespaceURI, qualifiedName); } DOMAttrNSImpl:: DOMAttrNSImpl(DOMDocument *ownerDoc, const XMLCh *namespaceURI, const XMLCh *prefix, const XMLCh *localName, const XMLCh *qualifiedName) : DOMAttrImpl(ownerDoc, qualifiedName) { DOMDocumentImpl* docImpl = (DOMDocumentImpl*)fParent.fOwnerDocument; if (prefix == 0 || *prefix == 0) { fPrefix = 0; fLocalName = fName; } else { fPrefix = docImpl->getPooledString(prefix); fLocalName = docImpl->getPooledString(localName); } // DOM Level 3: namespace URI is never empty string. // const XMLCh * URI = DOMNodeImpl::mapPrefix ( fPrefix, (!namespaceURI || !*namespaceURI) ? 0 : namespaceURI, DOMNode::ATTRIBUTE_NODE ); this -> fNamespaceURI = (URI == 0) ? 0 : docImpl->getPooledString(URI); } DOMAttrNSImpl::DOMAttrNSImpl(const DOMAttrNSImpl &other, bool deep) : DOMAttrImpl(other, deep) { this->fNamespaceURI = other.fNamespaceURI; //DOM Level 2 this->fLocalName = other.fLocalName; //DOM Level 2 this->fPrefix = other.fPrefix; } DOMNode * DOMAttrNSImpl::cloneNode(bool deep) const { DOMNode* newNode = new (fParent.fOwnerDocument, DOMMemoryManager::ATTR_NS_OBJECT) DOMAttrNSImpl(*this, deep); fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode); return newNode; } const XMLCh * DOMAttrNSImpl::getNamespaceURI() const { return fNamespaceURI; } const XMLCh * DOMAttrNSImpl::getPrefix() const { return fPrefix; } const XMLCh * DOMAttrNSImpl::getLocalName() const { return fLocalName; } void DOMAttrNSImpl::setPrefix(const XMLCh *prefix) { const XMLCh * xmlns = DOMNodeImpl::getXmlnsString(); if (fNode.isReadOnly()) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); if (fNamespaceURI == 0 || fNamespaceURI[0] == chNull || XMLString::equals(fLocalName, xmlns)) throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager); if (prefix == 0 || prefix[0] == chNull) { fName = fLocalName; fPrefix = 0; return; } DOMDocumentImpl* doc = (DOMDocumentImpl*) fParent.fOwnerDocument; if (!doc->isXMLName(prefix)) throw DOMException(DOMException::INVALID_CHARACTER_ERR,0, GetDOMNodeMemoryManager); const XMLCh * xml = DOMNodeImpl::getXmlString(); const XMLCh * xmlURI = DOMNodeImpl::getXmlURIString(); const XMLCh * xmlnsURI = DOMNodeImpl::getXmlnsURIString(); if ((XMLString::equals(prefix, xml) && !XMLString::equals(fNamespaceURI, xmlURI)) || (XMLString::equals(prefix, xmlns) && !XMLString::equals(fNamespaceURI, xmlnsURI))) throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager); if (XMLString::indexOf(prefix, chColon) != -1) { throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager); } this-> fPrefix = doc->getPooledString(prefix); XMLSize_t prefixLen = XMLString::stringLen(prefix); XMLSize_t newQualifiedNameLen = prefixLen+1+XMLString::stringLen(fLocalName); XMLCh* newName; XMLCh temp[256]; if (newQualifiedNameLen >= 255) newName = (XMLCh*) doc->getMemoryManager()->allocate ( newQualifiedNameLen * sizeof(XMLCh) );//new XMLCh[newQualifiedNameLen]; else newName = temp; // newName = prefix + chColon + fLocalName; XMLString::copyString(newName, prefix); newName[prefixLen] = chColon; XMLString::copyString(&newName[prefixLen+1], fLocalName); fName = doc->getPooledString(newName); if (newQualifiedNameLen >= 255) doc->getMemoryManager()->deallocate(newName);//delete[] newName; } void DOMAttrNSImpl::release() { if (fNode.isOwned() && !fNode.isToBeReleased()) throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); DOMDocumentImpl* doc = (DOMDocumentImpl*)fParent.fOwnerDocument; if (doc) { fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0); fParent.release(); doc->release(this, DOMMemoryManager::ATTR_NS_OBJECT); } else { // shouldn't reach here throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); } } DOMNode* DOMAttrNSImpl::rename(const XMLCh* namespaceURI, const XMLCh* name) { DOMElement* el = getOwnerElement(); if (el) el->removeAttributeNode(this); setName(namespaceURI, name); if (el) el->setAttributeNodeNS(this); return this; } void DOMAttrNSImpl::setName(const XMLCh* namespaceURI, const XMLCh* qualifiedName) { DOMDocumentImpl* ownerDoc = (DOMDocumentImpl *)fParent.fOwnerDocument; const XMLCh * xmlns = DOMNodeImpl::getXmlnsString(); const XMLCh * xmlnsURI = DOMNodeImpl::getXmlnsURIString(); this->fName = ownerDoc->getPooledString(qualifiedName); int index = DOMDocumentImpl::indexofQualifiedName(qualifiedName); if (index < 0) throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager); bool xmlnsAlone = false; //true if attribute name is "xmlns" if (index == 0) { //qualifiedName contains no ':' if (XMLString::equals(this->fName, xmlns)) { if (!XMLString::equals(namespaceURI, xmlnsURI)) throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager); xmlnsAlone = true; } fPrefix = 0; fLocalName = fName; } else { fPrefix = ownerDoc->getPooledNString(fName, index); fLocalName = ownerDoc->getPooledString(fName+index+1); // Before we carry on, we should check if the prefix or localName are valid XMLName if (!ownerDoc->isXMLName(fPrefix) || !ownerDoc->isXMLName(fLocalName)) throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager); } // DOM Level 3: namespace URI is never empty string. const XMLCh * URI = xmlnsAlone ? xmlnsURI : DOMNodeImpl::mapPrefix ( fPrefix, (!namespaceURI || !*namespaceURI) ? 0 : namespaceURI, DOMNode::ATTRIBUTE_NODE ); this -> fNamespaceURI = (URI == 0) ? 0 : ownerDoc->getPooledString(URI); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/XSDElementNSImpl.cpp000644 000765 000024 00000004101 13241160337 023541 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSDElementNSImpl.cpp 678381 2008-07-21 10:15:01Z borisk $ */ #include #include #include "DOMDocumentImpl.hpp" #include "XSDElementNSImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN XSDElementNSImpl::XSDElementNSImpl(DOMDocument *ownerDoc, const XMLCh *nam) : DOMElementNSImpl(ownerDoc, nam) , fLineNo(0) , fColumnNo(0) { } //Introduced in DOM Level 2 XSDElementNSImpl::XSDElementNSImpl(DOMDocument *ownerDoc, const XMLCh *namespaceURI, const XMLCh *qualifiedName, const XMLFileLoc lineNo, const XMLFileLoc columnNo) : DOMElementNSImpl(ownerDoc, namespaceURI, qualifiedName) , fLineNo(lineNo) , fColumnNo(columnNo) { } XSDElementNSImpl::XSDElementNSImpl(const XSDElementNSImpl &other, bool deep) : DOMElementNSImpl(other, deep) { this->fLineNo = other.fLineNo; this->fColumnNo =other.fColumnNo; } DOMNode * XSDElementNSImpl::cloneNode(bool deep) const { DOMNode* newNode = new (fParent.fOwnerDocument) XSDElementNSImpl(*this, deep); fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode); return newNode; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMRangeImpl.hpp000644 000765 000024 00000015113 13241160337 022736 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMRangeImpl.hpp 641193 2008-03-26 08:06:57Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMRANGEIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMRANGEIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMNode; class DOMDocumentFragment; class DOMDocument; class DOMText; class MemoryManager; class CDOM_EXPORT DOMRangeImpl: public DOMRange { protected: enum TraversalType { EXTRACT_CONTENTS = 1, CLONE_CONTENTS = 2, DELETE_CONTENTS = 3 }; enum TraversePoint { BEFORE = -1, START = 0, AFTER = 1 }; //private data DOMNode* fStartContainer; XMLSize_t fStartOffset; DOMNode* fEndContainer; XMLSize_t fEndOffset; bool fCollapsed; DOMDocument* fDocument; bool fDetached; DOMNode* fRemoveChild; MemoryManager* fMemoryManager; public: //c'tor DOMRangeImpl(DOMDocument* doc, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); DOMRangeImpl(const DOMRangeImpl& other); //d'tor ~DOMRangeImpl(); //getter functions virtual DOMNode* getStartContainer() const; virtual XMLSize_t getStartOffset() const; virtual DOMNode* getEndContainer() const; virtual XMLSize_t getEndOffset() const; virtual bool getCollapsed() const; virtual const DOMNode* getCommonAncestorContainer() const; //setter functions virtual void setStart(const DOMNode *parent, XMLSize_t offset); virtual void setEnd(const DOMNode *parent, XMLSize_t offset); virtual void setStartBefore(const DOMNode *refNode); virtual void setStartAfter(const DOMNode *refNode); virtual void setEndBefore(const DOMNode *refNode); virtual void setEndAfter(const DOMNode *refNode); //misc functions virtual void collapse(bool toStart); virtual void selectNode(const DOMNode *node); virtual void selectNodeContents(const DOMNode *node); //Functions related to comparing range Boundrary-Points virtual short compareBoundaryPoints(CompareHow how, const DOMRange* range) const; virtual void deleteContents(); virtual DOMDocumentFragment* extractContents(); virtual DOMDocumentFragment* cloneContents() const; virtual void insertNode(DOMNode* node); //Misc functions virtual void surroundContents(DOMNode *node); virtual DOMRange* cloneRange() const; virtual const XMLCh* toString() const; virtual void detach(); virtual void release(); //getter functions DOMDocument* getDocument(); // functions to inform all existing valid ranges about a change void updateSplitInfo(DOMNode* oldNode, DOMNode* startNode, XMLSize_t offset); void updateRangeForInsertedNode(DOMNode* node); void receiveReplacedText(DOMNode* node); void updateRangeForDeletedText(DOMNode* node, XMLSize_t offset, XMLSize_t count); void updateRangeForInsertedText(DOMNode* node, XMLSize_t offset, XMLSize_t count); void updateRangeForDeletedNode(DOMNode* node); protected: //setter functions void setStartContainer(const DOMNode* node); void setStartOffset(XMLSize_t offset) ; void setEndContainer(const DOMNode* node); void setEndOffset(XMLSize_t offset) ; //misc functions void validateNode(const DOMNode* node) const; bool isValidAncestorType(const DOMNode* node) const; bool hasLegalRootContainer(const DOMNode* node) const; bool isLegalContainedNode(const DOMNode* node ) const; void checkIndex(const DOMNode* node, XMLSize_t offset) const; static bool isAncestorOf(const DOMNode* a, const DOMNode* b); XMLSize_t indexOf(const DOMNode* child, const DOMNode* parent) const; const DOMNode* commonAncestorOf(const DOMNode* pointA, const DOMNode* pointB) const; DOMNode* nextNode(const DOMNode* node, bool visitChildren) const; DOMDocumentFragment* traverseContents(TraversalType type); void checkReadOnly(DOMNode* start, DOMNode* end, XMLSize_t starOffset, XMLSize_t endOffset); void recurseTreeAndCheck(DOMNode* start, DOMNode* end); DOMNode* removeChild(DOMNode* parent, DOMNode* child); DOMDocumentFragment* traverseSameContainer( int how ); DOMDocumentFragment* traverseCommonStartContainer( DOMNode *endAncestor, int how ); DOMDocumentFragment* traverseCommonEndContainer( DOMNode *startAncestor, int how ); DOMDocumentFragment* traverseCommonAncestors( DOMNode *startAncestor, DOMNode *endAncestor, int how ); DOMNode* traverseRightBoundary( DOMNode *root, int how ); DOMNode* traverseLeftBoundary( DOMNode *root, int how ); DOMNode* traverseNode( DOMNode *n, bool isFullySelected, bool isLeft, int how ); DOMNode* traverseFullySelected( DOMNode *n, int how ); DOMNode* traversePartiallySelected( DOMNode *n, int how ); DOMNode* traverseTextNode( DOMNode *n, bool isLeft, int how ); DOMNode* getSelectedNode( DOMNode *container, int offset ); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMRangeImpl & operator = (const DOMRangeImpl &); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMAttrImpl.cpp000644 000765 000024 00000030677 13241160337 022623 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMAttrImpl.cpp 1800911 2017-07-05 18:52:15Z scantor $ */ #include #include #include "DOMAttrImpl.hpp" #include "DOMStringPool.hpp" #include "DOMDocumentImpl.hpp" #include "DOMCasts.hpp" #include "DOMTypeInfoImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN DOMAttrImpl::DOMAttrImpl(DOMDocument *ownerDoc, const XMLCh *aName) : fNode(this, ownerDoc), fParent(this, ownerDoc), fSchemaType(0) { DOMDocumentImpl *docImpl = (DOMDocumentImpl *)ownerDoc; fName = docImpl->getPooledString(aName); fNode.isSpecified(true); } DOMAttrImpl::DOMAttrImpl(const DOMAttrImpl &other, bool /*deep*/) : DOMAttr(other) , fNode(this, other.fNode) , fParent(this, other.fParent) , fName(other.fName) , fSchemaType(other.fSchemaType) { if (other.fNode.isSpecified()) fNode.isSpecified(true); else fNode.isSpecified(false); if (other.fNode.isIdAttr()) { fNode.isIdAttr(true); DOMDocumentImpl *doc = (DOMDocumentImpl *)fParent.fOwnerDocument; doc->getNodeIDMap()->add(this); } fParent.cloneChildren(&other); } DOMAttrImpl::~DOMAttrImpl() { } DOMNode * DOMAttrImpl::cloneNode(bool deep) const { DOMNode* newNode = new (fParent.fOwnerDocument, DOMDocumentImpl::ATTR_OBJECT) DOMAttrImpl(*this, deep); fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode); return newNode; } const XMLCh * DOMAttrImpl::getNodeName() const{ return fName; } DOMNode::NodeType DOMAttrImpl::getNodeType() const { return DOMNode::ATTRIBUTE_NODE; } const XMLCh * DOMAttrImpl::getName() const { return fName; } const XMLCh * DOMAttrImpl::getNodeValue() const { return getValue(); } bool DOMAttrImpl::getSpecified() const { return fNode.isSpecified(); } const XMLCh * DOMAttrImpl::getValue() const { if (fParent.fFirstChild == 0) { return XMLUni::fgZeroLenString; // return ""; } // Simple case where attribute value is just a single text node DOMNode *node = castToChildImpl(fParent.fFirstChild)->nextSibling; if (node == 0 && fParent.fFirstChild->getNodeType() == DOMNode::TEXT_NODE) { return fParent.fFirstChild->getNodeValue(); } // // Complicated case where attribute value is a DOM tree // // According to the spec, the child nodes of the Attr node may be either // Text or EntityReference nodes. // // The parser will not create such thing, this is for those created by users. // // In such case, we have to visit each child to retrieve the text // DOMDocumentImpl* doc = (DOMDocumentImpl*)fParent.fOwnerDocument; XMLBuffer buf(1023, doc->getMemoryManager()); for (node = fParent.fFirstChild; node != 0; node = castToChildImpl(node)->nextSibling) getTextValue(node, buf); return doc->getPooledString(buf.getRawBuffer()); } void DOMAttrImpl::getTextValue(DOMNode* node, XMLBuffer& buf) const { if (node->getNodeType() == DOMNode::TEXT_NODE) buf.append(node->getNodeValue()); else if (node->getNodeType() == DOMNode::ENTITY_REFERENCE_NODE) { for (node = node->getFirstChild(); node != 0; node = castToChildImpl(node)->nextSibling) { getTextValue(node, buf); } } return; } void DOMAttrImpl::setNodeValue(const XMLCh *val) { setValue(val); } void DOMAttrImpl::setSpecified(bool arg) { fNode.isSpecified(arg); } void DOMAttrImpl::setValue(const XMLCh *val) { if (fNode.isReadOnly()) { throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); } // If this attribute was of type ID and in the map, take it out, // then put it back in with the new name. For now, we don't worry // about what happens if the new name conflicts // DOMDocumentImpl *doc = (DOMDocumentImpl *)fParent.fOwnerDocument; if (fNode.isIdAttr()) doc->getNodeIDMap()->remove(this); DOMNode *kid; while ((kid = fParent.fFirstChild) != 0) // Remove existing kids { DOMNode* node = removeChild(kid); if (node) node->release(); } if (val != 0) // Create and add the new one fParent.appendChildFast(doc->createTextNode(val)); fNode.isSpecified(true); fParent.changed(); if (fNode.isIdAttr()) doc->getNodeIDMap()->add(this); } void DOMAttrImpl::setValueFast(const XMLCh *val) { if (val != 0) fParent.appendChildFast(fParent.fOwnerDocument->createTextNode(val)); fNode.isSpecified (true); } //Introduced in DOM Level 2 DOMElement *DOMAttrImpl::getOwnerElement() const { // if we have an owner, ownerNode is our ownerElement, otherwise it's // our ownerDocument and we don't have an ownerElement return (DOMElement *) (fNode.isOwned() ? fNode.fOwnerNode : 0); } //internal use by parser only void DOMAttrImpl::setOwnerElement(DOMElement *ownerElem) { fNode.fOwnerNode = ownerElem; // revisit. Is this backwards? isOwned(true)? fNode.isOwned(false); } //For DOM Level 3 void DOMAttrImpl::release() { if (fNode.isOwned() && !fNode.isToBeReleased()) throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); DOMDocumentImpl* doc = (DOMDocumentImpl*)fParent.fOwnerDocument; if (doc) { fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0); fParent.release(); doc->release(this, DOMMemoryManager::ATTR_OBJECT); } else { // shouldn't reach here throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); } } bool DOMAttrImpl::isId() const { return fNode.isIdAttr(); } DOMNode* DOMAttrImpl::rename(const XMLCh* namespaceURI, const XMLCh* name) { DOMElement* el = getOwnerElement(); DOMDocumentImpl* doc = (DOMDocumentImpl*)fParent.fOwnerDocument; if (el) el->removeAttributeNode(this); if (!namespaceURI || !*namespaceURI) { fName = doc->getPooledString(name); if (el) el->setAttributeNode(this); // and fire user data NODE_RENAMED event castToNodeImpl(this)->callUserDataHandlers(DOMUserDataHandler::NODE_RENAMED, this, this); return this; } else { // create a new AttrNS DOMAttr* newAttr = doc->createAttributeNS(namespaceURI, name); // transfer the userData doc->transferUserData(castToNodeImpl(this), castToNodeImpl(newAttr)); // move children to new node DOMNode* child = getFirstChild(); while (child) { removeChild(child); newAttr->appendChild(child); child = getFirstChild(); } // reattach attr to element if (el) el->setAttributeNodeNS(newAttr); // and fire user data NODE_RENAMED event castToNodeImpl(newAttr)->callUserDataHandlers(DOMUserDataHandler::NODE_RENAMED, this, newAttr); return newAttr; } } const DOMTypeInfo *DOMAttrImpl::getSchemaTypeInfo() const { if(!fSchemaType) return &DOMTypeInfoImpl::g_DtdNotValidatedAttribute; return fSchemaType; } void DOMAttrImpl::setSchemaTypeInfo(const DOMTypeInfoImpl* typeInfo) { fSchemaType = typeInfo; } bool DOMAttrImpl::isSupported(const XMLCh *feature, const XMLCh *version) const { // check for '+DOMPSVITypeInfo' if(feature && *feature=='+' && XMLString::equals(feature+1, XMLUni::fgXercescInterfacePSVITypeInfo)) return true; return fNode.isSupported (feature, version); } void* DOMAttrImpl::getFeature(const XMLCh* feature, const XMLCh* version) const { if(XMLString::equals(feature, XMLUni::fgXercescInterfacePSVITypeInfo)) return (DOMPSVITypeInfo*)fSchemaType; return fNode.getFeature(feature, version); } DOMNode* DOMAttrImpl::appendChild(DOMNode *newChild) {return fParent.appendChild (newChild); } DOMNamedNodeMap* DOMAttrImpl::getAttributes() const {return fNode.getAttributes (); } DOMNodeList* DOMAttrImpl::getChildNodes() const {return fParent.getChildNodes (); } DOMNode* DOMAttrImpl::getFirstChild() const {return fParent.getFirstChild (); } DOMNode* DOMAttrImpl::getLastChild() const {return fParent.getLastChild (); } const XMLCh* DOMAttrImpl::getLocalName() const {return fNode.getLocalName (); } const XMLCh* DOMAttrImpl::getNamespaceURI() const {return fNode.getNamespaceURI (); } DOMNode* DOMAttrImpl::getNextSibling() const {return fNode.getNextSibling (); } DOMDocument* DOMAttrImpl::getOwnerDocument() const {return fParent.fOwnerDocument; } const XMLCh* DOMAttrImpl::getPrefix() const {return fNode.getPrefix (); } DOMNode* DOMAttrImpl::getParentNode() const {return fNode.getParentNode (); } DOMNode* DOMAttrImpl::getPreviousSibling() const {return fNode.getPreviousSibling (); } bool DOMAttrImpl::hasChildNodes() const {return fParent.hasChildNodes (); } DOMNode* DOMAttrImpl::insertBefore(DOMNode *newChild, DOMNode *refChild) {return fParent.insertBefore (newChild, refChild); } void DOMAttrImpl::normalize() {fParent.normalize (); } DOMNode* DOMAttrImpl::removeChild(DOMNode *oldChild) {return fParent.removeChild (oldChild); } DOMNode* DOMAttrImpl::replaceChild(DOMNode *newChild, DOMNode *oldChild) {return fParent.replaceChild (newChild, oldChild); } void DOMAttrImpl::setPrefix(const XMLCh *prefix) {fNode.setPrefix(prefix); } bool DOMAttrImpl::hasAttributes() const {return fNode.hasAttributes(); } bool DOMAttrImpl::isSameNode(const DOMNode* other) const {return fNode.isSameNode(other); } bool DOMAttrImpl::isEqualNode(const DOMNode* arg) const {return fParent.isEqualNode(arg); } void* DOMAttrImpl::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) {return fNode.setUserData(key, data, handler); } void* DOMAttrImpl::getUserData(const XMLCh* key) const {return fNode.getUserData(key); } const XMLCh* DOMAttrImpl::getBaseURI() const {return fNode.getBaseURI(); } short DOMAttrImpl::compareDocumentPosition(const DOMNode* other) const {return fNode.compareDocumentPosition(other); } const XMLCh* DOMAttrImpl::getTextContent() const {return fNode.getTextContent(); } void DOMAttrImpl::setTextContent(const XMLCh* textContent){fNode.setTextContent(textContent); } const XMLCh* DOMAttrImpl::lookupPrefix(const XMLCh* namespaceURI) const {return fNode.lookupPrefix(namespaceURI); } bool DOMAttrImpl::isDefaultNamespace(const XMLCh* namespaceURI) const {return fNode.isDefaultNamespace(namespaceURI); } const XMLCh* DOMAttrImpl::lookupNamespaceURI(const XMLCh* prefix) const {return fNode.lookupNamespaceURI(prefix); } // Macro-in implementation accessors. DOMNODEIMPL_IMPL(DOMAttrImpl); DOMPARENTIMPL_IMPL(DOMAttrImpl); XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMErrorImpl.cpp000644 000765 000024 00000004773 13241160337 023000 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMErrorImpl.cpp 671894 2008-06-26 13:29:21Z borisk $ */ #include "DOMErrorImpl.hpp" #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // DOMErrorImpl: Constructors and Destructor // --------------------------------------------------------------------------- DOMErrorImpl::DOMErrorImpl(const ErrorSeverity severity) : fAdoptLocation(false) , fSeverity(severity) , fMessage(0) , fLocation(0) , fType(0) , fRelatedData(0) { } DOMErrorImpl::DOMErrorImpl(const ErrorSeverity severity, const XMLCh* const message, DOMLocator* const location) : fAdoptLocation(false) , fSeverity(severity) , fMessage(message) , fLocation(location) , fType(0) , fRelatedData(0) { } DOMErrorImpl::DOMErrorImpl(const ErrorSeverity severity, const XMLCh* type, const XMLCh* message, void* relatedData) : fAdoptLocation(false) , fSeverity(severity) , fMessage(message) , fLocation(0) , fType(type) , fRelatedData(relatedData) { } DOMErrorImpl::~DOMErrorImpl() { if (fAdoptLocation) delete fLocation; } // --------------------------------------------------------------------------- // DOMErrorImpl: Setter methods // --------------------------------------------------------------------------- void DOMErrorImpl::setLocation(DOMLocator* const location) { if (fAdoptLocation) delete fLocation; fLocation = location; } void DOMErrorImpl::setRelatedException(void*) const { throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMLSSerializerImpl.hpp000644 000765 000024 00000020704 13241160337 024254 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLSSerializerImpl.hpp 1226891 2012-01-03 17:34:38Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMLSSERIALIZERMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMLSSERIALIZERMPL_HPP #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMStringListImpl; class CDOM_EXPORT DOMLSSerializerImpl : public XMemory, public DOMLSSerializer, public DOMConfiguration { public: /** @name Constructor and Destructor */ //@{ /** * Constructor. */ DOMLSSerializerImpl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Destructor. */ ~DOMLSSerializerImpl(); //@} /** @name Implementation of DOMLSSerializer interface */ //@{ virtual DOMConfiguration* getDomConfig(); virtual void setNewLine(const XMLCh* const newLine); virtual const XMLCh* getNewLine() const; virtual void setFilter(DOMLSSerializerFilter *filter); virtual DOMLSSerializerFilter* getFilter() const; virtual bool write(const DOMNode* nodeToWrite, DOMLSOutput* const destination); virtual bool writeToURI(const DOMNode* nodeToWrite, const XMLCh* uri); /** * The caller is responsible for the release of the returned string */ virtual XMLCh* writeToString(const DOMNode* nodeToWrite, MemoryManager* manager = NULL); virtual void release(); //@} /** @name Implementation of DOMConfiguration interface */ //@{ virtual void setParameter(const XMLCh* name, const void* value); virtual void setParameter(const XMLCh* name, bool value); virtual const void* getParameter(const XMLCh* name) const; virtual bool canSetParameter(const XMLCh* name, const void* value) const; virtual bool canSetParameter(const XMLCh* name, bool value) const; virtual const DOMStringList* getParameterNames() const; //@} private: /** unimplemented copy ctor and assignment operator */ DOMLSSerializerImpl(const DOMLSSerializerImpl&); DOMLSSerializerImpl & operator = (const DOMLSSerializerImpl&); protected: /** helper **/ void processNode(const DOMNode* const); void procCdataSection(const XMLCh* const nodeValue , const DOMNode* const nodeToWrite); void procUnrepCharInCdataSection(const XMLCh* const nodeValue , const DOMNode* const nodeToWrite); protected: /** * Overidden by derived classes to extend the abilities of the standard writer * always returns false in the default implementation * @return true if the method deals with nodeToWrite */ virtual bool customNodeSerialize(const DOMNode* const nodeToWrite, int level); DOMNodeFilter::FilterAction checkFilter(const DOMNode* const) const; bool checkFeature(const XMLCh* const featName , bool state , int& featureId) const; bool reportError(const DOMNode* const errorNode , DOMError::ErrorSeverity errorType , const XMLCh* const errorMsg); bool reportError(const DOMNode* const errorNode , DOMError::ErrorSeverity errorType , XMLDOMMsg::Codes toEmit); bool canSetFeature(const int featureId , bool val) const; void setFeature(const int featureId , bool val); bool getFeature(const int featureId) const; void printNewLine(); void setURCharRef(); bool isDefaultNamespacePrefixDeclared() const; bool isNamespaceBindingActive(const XMLCh* prefix, const XMLCh* uri) const; void ensureValidString(const DOMNode* nodeToWrite, const XMLCh* string); void printIndent(unsigned int level); //does the actual work for processNode while keeping track of the level void processNode(const DOMNode* const nodeToWrite, int level); void processBOM(); // ----------------------------------------------------------------------- // Private data members // // fFeatures // // fNewLine // own it // // fErrorHandler // don't own it // // fFilter // don't own it // // fDocumentVersion // The XML Version of the document to be serialized. // // fSupportedParameters // A list of the parameters that can be set, including the ones // specific of Xerces // // fEncodingUsed (session var) // the actual encoding used in write(), // it does not own any data(memory). // // fNewLineUsed (session var) // the actual "end of line" sequence used in write(), // it does not own any data(memory). // // fFormatter (session var) // the formatter used in write() // // fErrorCount // the count of error encountered in the serialization, // which neither the error handler, nor the serializer itself, // treat as fatal. And the serializer will return true/false // based on this value. // // fCurrentLine // the current line. Used to track the line number the current // node begins on // // ----------------------------------------------------------------------- int fFeatures; XMLCh *fNewLine; DOMErrorHandler *fErrorHandler; DOMLSSerializerFilter *fFilter; const XMLCh *fDocumentVersion; DOMStringListImpl *fSupportedParameters; //session vars const XMLCh *fEncodingUsed; const XMLCh *fNewLineUsed; XMLFormatter *fFormatter; int fErrorCount; int fCurrentLine; bool fLineFeedInTextNodePrinted; unsigned int fLastWhiteSpaceInTextNode; bool fIsXml11; RefVectorOf< RefHashTableOf >* fNamespaceStack; MemoryManager* fMemoryManager; }; inline DOMConfiguration* DOMLSSerializerImpl::getDomConfig() { return this; } inline void DOMLSSerializerImpl::setFeature(const int featureId , bool val) { (val)? fFeatures |= (1<setUnRepFlags(XMLFormatter::UnRep_CharRef); } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMChildNode.hpp000644 000765 000024 00000004260 13241160337 022712 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMChildNode.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMCHILDNODE_HPP) #define XERCESC_INCLUDE_GUARD_DOMCHILDNODE_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // /** * ChildNode adds to NodeImpl the capability of being a child, this is having * siblings. **/ #include XERCES_CPP_NAMESPACE_BEGIN class DOMDocument; class DOMNode; class CDOM_EXPORT DOMChildNode { public: DOMNode *previousSibling; DOMNode *nextSibling; DOMChildNode(); DOMChildNode(const DOMChildNode &other); ~DOMChildNode(); DOMNode * getNextSibling() const; DOMNode * getParentNode(const DOMNode *thisNode) const; DOMNode * getPreviousSibling(const DOMNode *thisNode) const; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMChildNode & operator = (const DOMChildNode &); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMProcessingInstructionImpl.cpp000644 000765 000024 00000025655 13241160337 026267 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMProcessingInstructionImpl.cpp 1800911 2017-07-05 18:52:15Z scantor $ */ #include "DOMProcessingInstructionImpl.hpp" #include "DOMDocumentImpl.hpp" #include "DOMNodeImpl.hpp" #include "DOMStringPool.hpp" #include "DOMRangeImpl.hpp" #include #include XERCES_CPP_NAMESPACE_BEGIN DOMProcessingInstructionImpl::DOMProcessingInstructionImpl(DOMDocument *ownerDoc, const XMLCh *targt, const XMLCh *dat) : fNode(this, ownerDoc), fCharacterData(ownerDoc, dat), fBaseURI(0) { fNode.setIsLeafNode(true); this->fTarget = ((DOMDocumentImpl *)ownerDoc)->cloneString(targt); } DOMProcessingInstructionImpl::DOMProcessingInstructionImpl( const DOMProcessingInstructionImpl &other, bool /*deep*/) : DOMProcessingInstruction(other), fNode(this, other.fNode), fChild(other.fChild), fCharacterData(other.fCharacterData), fTarget(other.fTarget), fBaseURI(other.fBaseURI) { fNode.setIsLeafNode(true); } DOMProcessingInstructionImpl::~DOMProcessingInstructionImpl() { } DOMNode *DOMProcessingInstructionImpl::cloneNode(bool deep) const { DOMNode* newNode = new (getOwnerDocument(), DOMMemoryManager::PROCESSING_INSTRUCTION_OBJECT) DOMProcessingInstructionImpl(*this, deep); fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode); return newNode; } const XMLCh * DOMProcessingInstructionImpl::getNodeName() const { return fTarget; } DOMNode::NodeType DOMProcessingInstructionImpl::getNodeType() const { return DOMNode::PROCESSING_INSTRUCTION_NODE; } /** A PI's "target" states what processor channel the PI's data should be directed to. It is defined differently in HTML and XML. In XML, a PI's "target" is the first (whitespace-delimited) token following the "release(this, DOMMemoryManager::PROCESSING_INSTRUCTION_OBJECT); } else { // shouldn't reach here throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); } } void DOMProcessingInstructionImpl::setBaseURI(const XMLCh* baseURI) { this->fBaseURI = ((DOMDocumentImpl *)getOwnerDocument())->cloneString(baseURI); } const XMLCh* DOMProcessingInstructionImpl::getBaseURI() const { return fBaseURI? fBaseURI : fNode.fOwnerNode->getBaseURI(); } // Non standard extension for the range to work DOMProcessingInstruction *DOMProcessingInstructionImpl::splitText(XMLSize_t offset) { if (fNode.isReadOnly()) { throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); } XMLSize_t len = fCharacterData.fDataBuf->getLen(); if (offset > len) throw DOMException(DOMException::INDEX_SIZE_ERR, 0, GetDOMNodeMemoryManager); DOMDocumentImpl *doc = (DOMDocumentImpl *)getOwnerDocument(); DOMProcessingInstruction *newText = doc->createProcessingInstruction( fTarget, this->substringData(offset, len - offset)); DOMNode *parent = getParentNode(); if (parent != 0) parent->insertBefore(newText, getNextSibling()); fCharacterData.fDataBuf->chop(offset); if (doc != 0) { Ranges* ranges = doc->getRanges(); if (ranges != 0) { XMLSize_t sz = ranges->size(); if (sz != 0) { for (XMLSize_t i =0; ielementAt(i)->updateSplitInfo( this, newText, offset); } } } } return newText; } // // Delegation stubs for inherited functions // DOMNode* DOMProcessingInstructionImpl::appendChild(DOMNode *newChild) {return fNode.appendChild (newChild); } DOMNamedNodeMap* DOMProcessingInstructionImpl::getAttributes() const {return fNode.getAttributes (); } DOMNodeList* DOMProcessingInstructionImpl::getChildNodes() const {return fNode.getChildNodes (); } DOMNode* DOMProcessingInstructionImpl::getFirstChild() const {return fNode.getFirstChild (); } DOMNode* DOMProcessingInstructionImpl::getLastChild() const {return fNode.getLastChild (); } const XMLCh* DOMProcessingInstructionImpl::getLocalName() const {return fNode.getLocalName (); } const XMLCh* DOMProcessingInstructionImpl::getNamespaceURI() const {return fNode.getNamespaceURI (); } DOMNode* DOMProcessingInstructionImpl::getNextSibling() const {return fChild.getNextSibling (); } const XMLCh* DOMProcessingInstructionImpl::getNodeValue() const {return fCharacterData.getNodeValue (); } DOMDocument* DOMProcessingInstructionImpl::getOwnerDocument() const {return fNode.getOwnerDocument (); } const XMLCh* DOMProcessingInstructionImpl::getPrefix() const {return fNode.getPrefix (); } DOMNode* DOMProcessingInstructionImpl::getParentNode() const {return fChild.getParentNode (this); } DOMNode* DOMProcessingInstructionImpl::getPreviousSibling() const {return fChild.getPreviousSibling (this); } bool DOMProcessingInstructionImpl::hasChildNodes() const {return fNode.hasChildNodes (); } DOMNode* DOMProcessingInstructionImpl::insertBefore(DOMNode *newChild, DOMNode *refChild) {return fNode.insertBefore (newChild, refChild); } void DOMProcessingInstructionImpl::normalize() {fNode.normalize (); } DOMNode* DOMProcessingInstructionImpl::removeChild(DOMNode *oldChild) {return fNode.removeChild (oldChild); } DOMNode* DOMProcessingInstructionImpl::replaceChild(DOMNode *newChild, DOMNode *oldChild) {return fNode.replaceChild (newChild, oldChild); } bool DOMProcessingInstructionImpl::isSupported(const XMLCh *feature, const XMLCh *version) const {return fNode.isSupported (feature, version); } void DOMProcessingInstructionImpl::setPrefix(const XMLCh *prefix) {fNode.setPrefix(prefix); } bool DOMProcessingInstructionImpl::hasAttributes() const {return fNode.hasAttributes(); } bool DOMProcessingInstructionImpl::isSameNode(const DOMNode* other) const {return fNode.isSameNode(other); } bool DOMProcessingInstructionImpl::isEqualNode(const DOMNode* arg) const {return fNode.isEqualNode(arg); } void* DOMProcessingInstructionImpl::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) {return fNode.setUserData(key, data, handler); } void* DOMProcessingInstructionImpl::getUserData(const XMLCh* key) const {return fNode.getUserData(key); } short DOMProcessingInstructionImpl::compareDocumentPosition(const DOMNode* other) const {return fNode.compareDocumentPosition(other); } const XMLCh* DOMProcessingInstructionImpl::getTextContent() const {return fNode.getTextContent(); } void DOMProcessingInstructionImpl::setTextContent(const XMLCh* textContent){fNode.setTextContent(textContent); } const XMLCh* DOMProcessingInstructionImpl::lookupPrefix(const XMLCh* namespaceURI) const {return fNode.lookupPrefix(namespaceURI); } bool DOMProcessingInstructionImpl::isDefaultNamespace(const XMLCh* namespaceURI) const {return fNode.isDefaultNamespace(namespaceURI); } const XMLCh* DOMProcessingInstructionImpl::lookupNamespaceURI(const XMLCh* prefix) const {return fNode.lookupNamespaceURI(prefix); } void* DOMProcessingInstructionImpl::getFeature(const XMLCh* feature, const XMLCh* version) const {return fNode.getFeature(feature, version); } // Macro-in implementation accessors. DOMNODEIMPL_IMPL(DOMProcessingInstructionImpl); DOMCHILDIMPL_IMPL(DOMProcessingInstructionImpl); // // Delegation of CharacerData functions. // const XMLCh* DOMProcessingInstructionImpl::getData() const {return fCharacterData.getData();} void DOMProcessingInstructionImpl::deleteData(XMLSize_t offset, XMLSize_t count) {fCharacterData.deleteData(this, offset, count);} const XMLCh* DOMProcessingInstructionImpl::substringData(XMLSize_t offset, XMLSize_t count) const {return fCharacterData.substringData(this, offset, count);} void DOMProcessingInstructionImpl::setData(const XMLCh *data) {fCharacterData.setData(this, data);} void DOMProcessingInstructionImpl::setNodeValue(const XMLCh *nodeValue) {fCharacterData.setNodeValue (this, nodeValue); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMParentNode.cpp000644 000765 000024 00000040247 13241160337 023120 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMParentNode.cpp 1800911 2017-07-05 18:52:15Z scantor $ */ #include #include #include #include "DOMDocumentImpl.hpp" #include "DOMRangeImpl.hpp" #include "DOMNodeIteratorImpl.hpp" #include "DOMParentNode.hpp" #include "DOMCasts.hpp" XERCES_CPP_NAMESPACE_BEGIN DOMParentNode::DOMParentNode(DOMNode* containingNode, DOMDocument *ownerDoc) : fContainingNode(containingNode), fOwnerDocument(ownerDoc), fFirstChild(0), fChildNodeList(this) { if (!fContainingNode) { throw DOMException(DOMException::INVALID_STATE_ERR, 0, GetDOMNodeMemoryManager); } } // This only makes a shallow copy, cloneChildren must also be called for a // deep clone DOMParentNode::DOMParentNode(DOMNode* containingNode, const DOMParentNode &other) : fContainingNode(containingNode), fChildNodeList(this) { if (!fContainingNode) { throw DOMException(DOMException::INVALID_STATE_ERR, 0, GetDOMNodeMemoryManager); } this->fOwnerDocument = other.fOwnerDocument; // Need to break the association w/ original kids this->fFirstChild = 0; } DOMParentNode::~DOMParentNode() { } DOMNode* DOMParentNode::getContainingNode() { return fContainingNode; } const DOMNode* DOMParentNode::getContainingNode() const { return fContainingNode; } const DOMNodeImpl* DOMParentNode::getContainingNodeImpl() const { const HasDOMNodeImpl* p = dynamic_cast(getContainingNode()); if (!p || !p->getNodeImpl()) { throw DOMException(DOMException::INVALID_STATE_ERR, 0, GetDOMNodeMemoryManager); } return p->getNodeImpl(); } void DOMParentNode::changed() { ((DOMDocumentImpl*)fOwnerDocument)->changed(); } int DOMParentNode::changes() const { return ((DOMDocumentImpl*)fOwnerDocument)->changes(); } DOMNode * DOMParentNode::appendChild(DOMNode *newChild) { return insertBefore(newChild, 0); } void DOMParentNode::cloneChildren(const DOMNode *other) { // for (DOMNode *mykid = other.getFirstChild(); for (DOMNode *mykid = other->getFirstChild(); mykid != 0; mykid = mykid->getNextSibling()) { appendChild(mykid->cloneNode(true)); } } DOMDocument * DOMParentNode::getOwnerDocument() const { return fOwnerDocument; } // unlike getOwnerDocument this is not overriden by DocumentImpl to return 0 DOMDocument * DOMParentNode::getDocument() const { return fOwnerDocument; } void DOMParentNode::setOwnerDocument(DOMDocument* doc) { fOwnerDocument = doc; } DOMNodeList *DOMParentNode::getChildNodes() const { const DOMNodeList *ret = &fChildNodeList; return (DOMNodeList *)ret; // cast off const. } DOMNode * DOMParentNode::getFirstChild() const { return fFirstChild; } DOMNode * DOMParentNode::getLastChild() const { return lastChild(); } DOMNode * DOMParentNode::lastChild() const { // last child is stored as the previous sibling of first child if (fFirstChild == 0) { return 0; } DOMChildNode *firstChild = castToChildImpl(fFirstChild); DOMNode *ret = firstChild->previousSibling; return ret; } // // revisit. Is this function used anywhere? I don't see it. // void DOMParentNode::lastChild(DOMNode *node) { // store lastChild as previous sibling of first child if (fFirstChild != 0) { DOMChildNode *firstChild = castToChildImpl(fFirstChild); firstChild->previousSibling = node; } } bool DOMParentNode::hasChildNodes() const { return fFirstChild!=0; } DOMNode *DOMParentNode::insertBefore(DOMNode *newChild, DOMNode *refChild) { //not really in the specs, but better than nothing if(newChild==NULL) throw DOMException(DOMException::HIERARCHY_REQUEST_ERR,0, GetDOMParentNodeMemoryManager); const DOMNodeImpl *thisNodeImpl = getContainingNodeImpl(); if (thisNodeImpl->isReadOnly()) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMParentNodeMemoryManager); if (newChild->getOwnerDocument() != fOwnerDocument) throw DOMException(DOMException::WRONG_DOCUMENT_ERR, 0, GetDOMParentNodeMemoryManager); // Prevent cycles in the tree //only need to do this if the node has children if(newChild->hasChildNodes()) { bool treeSafe=true; for(DOMNode *a=getContainingNode()->getParentNode(); treeSafe && a!=0; a=a->getParentNode()) treeSafe=(newChild!=a); if(!treeSafe) throw DOMException(DOMException::HIERARCHY_REQUEST_ERR,0, GetDOMParentNodeMemoryManager); } // refChild must in fact be a child of this node (or 0) if (refChild!=0 && refChild->getParentNode() != getContainingNode()) throw DOMException(DOMException::NOT_FOUND_ERR,0, GetDOMParentNodeMemoryManager); // if the new node has to be placed before itself, we don't have to do anything // (even worse, we would crash if we continue, as we assume they are two distinct nodes) if (refChild!=0 && newChild->isSameNode(refChild)) return newChild; if (newChild->getNodeType() == DOMNode::DOCUMENT_FRAGMENT_NODE) { // SLOW BUT SAFE: We could insert the whole subtree without // juggling so many next/previous pointers. (Wipe out the // parent's child-list, patch the parent pointers, set the // ends of the list.) But we know some subclasses have special- // case behavior they add to insertBefore(), so we don't risk it. // This approch also takes fewer bytecodes. // NOTE: If one of the children is not a legal child of this // node, throw HIERARCHY_REQUEST_ERR before _any_ of the children // have been transferred. (Alternative behaviors would be to // reparent up to the first failure point or reparent all those // which are acceptable to the target node, neither of which is // as robust. PR-DOM-0818 isn't entirely clear on which it // recommends????? // No need to check kids for right-document; if they weren't, // they wouldn't be kids of that DocFrag. for(DOMNode *kid=newChild->getFirstChild(); // Prescan kid!=0; kid=kid->getNextSibling()) { if (!DOMDocumentImpl::isKidOK(getContainingNode(), kid)) throw DOMException(DOMException::HIERARCHY_REQUEST_ERR,0, GetDOMParentNodeMemoryManager); } while(newChild->hasChildNodes()) // Move getContainingNode()->insertBefore(newChild->getFirstChild(),refChild); } else if (!DOMDocumentImpl::isKidOK(getContainingNode(), newChild)) throw DOMException(DOMException::HIERARCHY_REQUEST_ERR,0, GetDOMParentNodeMemoryManager); else { DOMNode *oldparent=newChild->getParentNode(); if(oldparent!=0) oldparent->removeChild(newChild); // Attach up castToNodeImpl(newChild)->fOwnerNode = getContainingNode(); castToNodeImpl(newChild)->isOwned(true); // Attach before and after // Note: fFirstChild.previousSibling == lastChild!! if (fFirstChild == 0) { // this our first and only child fFirstChild = newChild; castToNodeImpl(newChild)->isFirstChild(true); // castToChildImpl(newChild)->previousSibling = newChild; DOMChildNode *newChild_ci = castToChildImpl(newChild); newChild_ci->previousSibling = newChild; } else { if (refChild == 0) { // this is an append DOMNode *lastChild = castToChildImpl(fFirstChild)->previousSibling; castToChildImpl(lastChild)->nextSibling = newChild; castToChildImpl(newChild)->previousSibling = lastChild; castToChildImpl(fFirstChild)->previousSibling = newChild; } else { // this is an insert if (refChild == fFirstChild) { // at the head of the list castToNodeImpl(fFirstChild)->isFirstChild(false); castToChildImpl(newChild)->nextSibling = fFirstChild; castToChildImpl(newChild)->previousSibling = castToChildImpl(fFirstChild)->previousSibling; castToChildImpl(fFirstChild)->previousSibling = newChild; fFirstChild = newChild; castToNodeImpl(newChild)->isFirstChild(true); } else { // somewhere in the middle DOMNode *prev = castToChildImpl(refChild)->previousSibling; castToChildImpl(newChild)->nextSibling = refChild; castToChildImpl(prev)->nextSibling = newChild; castToChildImpl(refChild)->previousSibling = newChild; castToChildImpl(newChild)->previousSibling = prev; } } } } changed(); if (fOwnerDocument != 0) { Ranges* ranges = ((DOMDocumentImpl*)fOwnerDocument)->getRanges(); if ( ranges != 0) { XMLSize_t sz = ranges->size(); if (sz != 0) { for (XMLSize_t i =0; ielementAt(i)->updateRangeForInsertedNode(newChild); } } } } return newChild; } DOMNode *DOMParentNode::removeChild(DOMNode *oldChild) { if (getContainingNodeImpl()->isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMParentNodeMemoryManager); if (oldChild == 0 || oldChild->getParentNode() != getContainingNode()) throw DOMException(DOMException::NOT_FOUND_ERR, 0, GetDOMParentNodeMemoryManager); if (fOwnerDocument != 0) { //notify iterators NodeIterators* nodeIterators = ((DOMDocumentImpl*)fOwnerDocument)->getNodeIterators(); if (nodeIterators != 0) { XMLSize_t sz = nodeIterators->size(); if (sz != 0) { for (XMLSize_t i =0; ielementAt(i) != 0) nodeIterators->elementAt(i)->removeNode(oldChild); } } } //fix other ranges for change before deleting the node Ranges* ranges = ((DOMDocumentImpl*)fOwnerDocument)->getRanges(); if (ranges != 0) { XMLSize_t sz = ranges->size(); if (sz != 0) { for (XMLSize_t i =0; ielementAt(i) != 0) ranges->elementAt(i)->updateRangeForDeletedNode(oldChild); } } } } // Patch linked list around oldChild // Note: lastChild == fFirstChild->previousSibling if (oldChild == fFirstChild) { // removing first child castToNodeImpl(oldChild)->isFirstChild(false); fFirstChild = castToChildImpl(oldChild)->nextSibling; if (fFirstChild != 0) { castToNodeImpl(fFirstChild)->isFirstChild(true); castToChildImpl(fFirstChild)->previousSibling = castToChildImpl(oldChild)->previousSibling; } } else { DOMNode *prev = castToChildImpl(oldChild)->previousSibling; DOMNode *next = castToChildImpl(oldChild)->nextSibling; castToChildImpl(prev)->nextSibling = next; if (next == 0) { // removing last child castToChildImpl(fFirstChild)->previousSibling = prev; } else { // removing some other child in the middle castToChildImpl(next)->previousSibling = prev; } } // Remove oldChild's references to tree castToNodeImpl(oldChild)->fOwnerNode = fOwnerDocument; castToNodeImpl(oldChild)->isOwned(false); castToChildImpl(oldChild)->nextSibling = 0; castToChildImpl(oldChild)->previousSibling = 0; changed(); return oldChild; } DOMNode *DOMParentNode::replaceChild(DOMNode *newChild, DOMNode *oldChild) { insertBefore(newChild, oldChild); // changed() already done. return removeChild(oldChild); } DOMNode * DOMParentNode::appendChildFast(DOMNode *newChild) { // This function makes the following assumptions: // // - newChild != 0 // - newChild is not read-only // - newChild is not a document fragment // - owner documents of this node and newChild are the same // - appending newChild to this node cannot result in a cycle // - DOMDocumentImpl::isKidOK (this, newChild) return true (that is, // appending newChild to this node results in a valid structure) // - newChild->getParentNode() is 0 // - there are no ranges set for this document // // Attach up castToNodeImpl(newChild)->fOwnerNode = getContainingNode(); castToNodeImpl(newChild)->isOwned(true); // Attach before and after // Note: fFirstChild.previousSibling == lastChild!! if (fFirstChild != 0) { DOMNode *lastChild = castToChildImpl(fFirstChild)->previousSibling; castToChildImpl(lastChild)->nextSibling = newChild; castToChildImpl(newChild)->previousSibling = lastChild; castToChildImpl(fFirstChild)->previousSibling = newChild; } else { // this our first and only child fFirstChild = newChild; castToNodeImpl(newChild)->isFirstChild(true); // castToChildImpl(newChild)->previousSibling = newChild; DOMChildNode *newChild_ci = castToChildImpl(newChild); newChild_ci->previousSibling = newChild; } return newChild; } //Introduced in DOM Level 2 void DOMParentNode::normalize() { DOMNode *kid, *next; for (kid = fFirstChild; kid != 0; kid = next) { next = castToChildImpl(kid)->nextSibling; // If kid and next are both Text nodes (but _not_ CDATASection, // which is a subclass of Text), they can be merged. if (next != 0 && kid->getNodeType() == DOMNode::TEXT_NODE && next->getNodeType() == DOMNode::TEXT_NODE ) { ((DOMTextImpl *) kid)->appendData(((DOMTextImpl *) next)->getData()); // revisit: // should I release the removed node? // not released in case user still referencing it externally removeChild(next); next = kid; // Don't advance; there might be another. } // Otherwise it might be an Element, which is handled recursively else if (kid->getNodeType() == DOMNode::ELEMENT_NODE) kid->normalize(); } // changed() will have occurred when the removeChild() was done, // so does not have to be reissued. } //Introduced in DOM Level 3 bool DOMParentNode::isEqualNode(const DOMNode* arg) const { if (arg && getContainingNodeImpl()->isSameNode(arg)) return true; if (arg && getContainingNodeImpl()->isEqualNode(arg)) { DOMNode *kid, *argKid; for (kid = fFirstChild, argKid = arg->getFirstChild(); kid != 0 && argKid != 0; kid = kid->getNextSibling(), argKid = argKid->getNextSibling()) { if (!kid->isEqualNode(argKid)) return false; } return (kid || argKid) ? false : true; } return false; } //Non-standard extension void DOMParentNode::release() { DOMNode *kid, *next; for (kid = fFirstChild; kid != 0; kid = next) { next = castToChildImpl(kid)->nextSibling; // set is Owned false before releasing its child castToNodeImpl(kid)->isToBeReleased(true); kid->release(); } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMEntityReferenceImpl.hpp000644 000765 000024 00000005406 13241160337 025001 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMEntityReferenceImpl.hpp 1800911 2017-07-05 18:52:15Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMENTITYREFERENCEIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMENTITYREFERENCEIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include #include "DOMNodeBase.hpp" #include "DOMParentNode.hpp" #include "DOMChildNode.hpp" #include "DOMNodeImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN class CDOM_EXPORT DOMEntityReferenceImpl: public DOMEntityReference, public HasDOMNodeImpl, public HasDOMParentImpl, public HasDOMChildImpl { protected: DOMNodeImpl fNode; DOMParentNode fParent; DOMChildNode fChild; const XMLCh *fName; const XMLCh *fBaseURI; friend class XercesDOMParser; public: DOMEntityReferenceImpl(DOMDocument *ownerDoc, const XMLCh *entityName); DOMEntityReferenceImpl(DOMDocument *ownerDoc, const XMLCh *entityName, bool cloneChild); DOMEntityReferenceImpl(const DOMEntityReferenceImpl &other, bool deep=false); virtual ~DOMEntityReferenceImpl(); public: // Declare all of the functions from DOMNode. DOMNODE_FUNCTIONS; // Add accessors for implementation bits. DOMNODEIMPL_DECL; DOMPARENTIMPL_DECL; DOMCHILDIMPL_DECL; public: virtual void setReadOnly(bool readOnly,bool deep); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMEntityReferenceImpl & operator = (const DOMEntityReferenceImpl &); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMNodeImpl.cpp000644 000765 000024 00000103643 13241160337 022570 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNodeImpl.cpp 1800911 2017-07-05 18:52:15Z scantor $ */ // This class doesn't support having any children, and implements the behavior // of an empty NodeList as far getChildNodes is concerned. // The ParentNode subclass overrides this behavior. #include "DOMCasts.hpp" #include "DOMDocumentTypeImpl.hpp" #include "DOMElementImpl.hpp" #include "DOMAttrImpl.hpp" #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN //Though DOMNodeImpl does not derivate from DOMNode, it shares //the same GetDOMNodeMemoryManager const unsigned short DOMNodeImpl::READONLY = 0x1<<0; const unsigned short DOMNodeImpl::SYNCDATA = 0x1<<1; const unsigned short DOMNodeImpl::SYNCCHILDREN = 0x1<<2; const unsigned short DOMNodeImpl::OWNED = 0x1<<3; const unsigned short DOMNodeImpl::FIRSTCHILD = 0x1<<4; const unsigned short DOMNodeImpl::SPECIFIED = 0x1<<5; const unsigned short DOMNodeImpl::IGNORABLEWS = 0x1<<6; const unsigned short DOMNodeImpl::SETVALUE = 0x1<<7; const unsigned short DOMNodeImpl::ID_ATTR = 0x1<<8; const unsigned short DOMNodeImpl::USERDATA = 0x1<<9; const unsigned short DOMNodeImpl::LEAFNODETYPE = 0x1<<10; const unsigned short DOMNodeImpl::CHILDNODE = 0x1<<11; const unsigned short DOMNodeImpl::TOBERELEASED = 0x1<<12; // // static DOMNodeListImpl *gEmptyNodeList = 0; // Singleton empty node list. void XMLInitializer::initializeDOMNodeListImpl() { gEmptyNodeList = new DOMNodeListImpl(0); } void XMLInitializer::terminateDOMNodeListImpl() { delete gEmptyNodeList; gEmptyNodeList = 0; } // ----------------------------------------------------------------------- // DOMNodeImpl Functions // ----------------------------------------------------------------------- DOMNodeImpl::DOMNodeImpl(DOMNode* containingNode, DOMNode *ownerNode) : fContainingNode(containingNode), fOwnerNode(ownerNode) { if (!fContainingNode) { throw DOMException(DOMException::INVALID_STATE_ERR, 0, GetDOMNodeMemoryManager); } this->flags = 0; // as long as we do not have any owner, fOwnerNode is our ownerDocument } // This only makes a shallow copy, cloneChildren must also be called for a // deep clone DOMNodeImpl::DOMNodeImpl(DOMNode* containingNode, const DOMNodeImpl &other) : fContainingNode(containingNode) { if (!fContainingNode) { throw DOMException(DOMException::INVALID_STATE_ERR, 0, GetDOMNodeMemoryManager); } this->flags = other.flags; this->isReadOnly(false); // Need to break the association w/ original parent this->fOwnerNode = other.getOwnerDocument(); this->isOwned(false); } DOMNodeImpl::~DOMNodeImpl() { } DOMNode* DOMNodeImpl::getContainingNode() { return fContainingNode; } const DOMNode* DOMNodeImpl::getContainingNode() const { return fContainingNode; } DOMNode * DOMNodeImpl::appendChild(DOMNode *) { // Only node types that don't allow children will use this default function. // Others will go to DOMParentNode::appendChild. throw DOMException(DOMException::HIERARCHY_REQUEST_ERR,0, GetDOMNodeMemoryManager); return 0; // return insertBefore(newChild, 0); } DOMNamedNodeMap * DOMNodeImpl::getAttributes() const { return 0; // overridden in ElementImpl } DOMNodeList *DOMNodeImpl::getChildNodes() const { return gEmptyNodeList; } DOMNode * DOMNodeImpl::getFirstChild() const { return 0; // overridden in ParentNode } DOMNode * DOMNodeImpl::getLastChild() const { return 0; // overridden in ParentNode } DOMNode * DOMNodeImpl::getNextSibling() const { return 0; // overridden in ChildNode } const XMLCh * DOMNodeImpl::getNodeValue() const { return 0; // Overridden by anything that has a value } // // Unlike the external getOwnerDocument, this one returns the owner document // for document nodes as well as all of the other node types. // DOMDocument *DOMNodeImpl::getOwnerDocument() const { if (!this->isLeafNode()) { const DOMNode *ep = getContainingNode(); const DOMParentNode* parent = castToParentImpl(getContainingNode()); return parent ? parent->fOwnerDocument : 0; } // Leaf node types - those that cannot have children, like Text. if (isOwned()) { DOMDocument* ownerDoc = fOwnerNode->getOwnerDocument(); if (!ownerDoc) { assert (fOwnerNode->getNodeType() == DOMNode::DOCUMENT_NODE); return (DOMDocument *)fOwnerNode; } else { return ownerDoc; } } else { assert (fOwnerNode->getNodeType() == DOMNode::DOCUMENT_NODE); return (DOMDocument *)fOwnerNode; } } void DOMNodeImpl::setOwnerDocument(DOMDocument *doc) { // if we have an owner we rely on it to have it right // otherwise fOwnerNode is our ownerDocument if (!isOwned()) { // revisit. Problem with storage for doctype nodes that were created // on the system heap in advance of having a document. fOwnerNode = doc; } } DOMNode * DOMNodeImpl::getParentNode() const { return 0; // overridden in ChildNode } DOMNode* DOMNodeImpl::getPreviousSibling() const { return 0; // overridden in ChildNode } bool DOMNodeImpl::hasChildNodes() const { return false; } DOMNode *DOMNodeImpl::insertBefore(DOMNode *, DOMNode *) { throw DOMException(DOMException::HIERARCHY_REQUEST_ERR, 0, GetDOMNodeMemoryManager); return 0; } DOMNode *DOMNodeImpl::removeChild(DOMNode *) { throw DOMException(DOMException::NOT_FOUND_ERR, 0, GetDOMNodeMemoryManager); return 0; } DOMNode *DOMNodeImpl::replaceChild(DOMNode *, DOMNode *) { throw DOMException(DOMException::HIERARCHY_REQUEST_ERR,0, GetDOMNodeMemoryManager); return 0; } void DOMNodeImpl::setNodeValue(const XMLCh *) { // Default behavior is to do nothing, overridden in some subclasses } void DOMNodeImpl::setReadOnly(bool readOnl, bool deep) { this->isReadOnly(readOnl); if (deep) { for (DOMNode *mykid = getContainingNode()->getFirstChild(); mykid != 0; mykid = mykid->getNextSibling()) { short kidNodeType = mykid->getNodeType(); switch (kidNodeType) { case DOMNode::ENTITY_REFERENCE_NODE: break; case DOMNode::ELEMENT_NODE: ((DOMElementImpl*) mykid)->setReadOnly(readOnl, true); break; case DOMNode::DOCUMENT_TYPE_NODE: ((DOMDocumentTypeImpl*) mykid)->setReadOnly(readOnl, true); break; default: castToNodeImpl(mykid)->setReadOnly(readOnl, true); break; } } } } //Introduced in DOM Level 2 void DOMNodeImpl::normalize() { // does nothing by default, overridden by subclasses } bool DOMNodeImpl::isSupported(const XMLCh *feature, const XMLCh *version) const { return DOMImplementation::getImplementation()->hasFeature(feature, version); } const XMLCh *DOMNodeImpl::getNamespaceURI() const { return 0; } const XMLCh *DOMNodeImpl::getPrefix() const { return 0; } const XMLCh *DOMNodeImpl::getLocalName() const { return 0; } void DOMNodeImpl::setPrefix(const XMLCh *) { throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager); } bool DOMNodeImpl::hasAttributes() const { return 0; // overridden in ElementImpl } const XMLCh *DOMNodeImpl::getXmlString() {return XMLUni::fgXMLString;} const XMLCh *DOMNodeImpl::getXmlURIString() {return XMLUni::fgXMLURIName;} const XMLCh *DOMNodeImpl::getXmlnsString() {return XMLUni::fgXMLNSString;} const XMLCh *DOMNodeImpl::getXmlnsURIString() {return XMLUni::fgXMLNSURIName;} //Return a URI mapped from the given prefix and namespaceURI as below // prefix namespaceURI output //--------------------------------------------------- // "xml" xmlURI xmlURI // "xml" otherwise NAMESPACE_ERR // "xmlns" xmlnsURI xmlnsURI (nType = ATTRIBUTE_NODE only) // "xmlns" otherwise NAMESPACE_ERR (nType = ATTRIBUTE_NODE only) // != null null or "" NAMESPACE_ERR // else any namesapceURI const XMLCh* DOMNodeImpl::mapPrefix(const XMLCh *prefix, const XMLCh *namespaceURI, short nType) { if (prefix == 0) return namespaceURI; if (XMLString::equals(prefix, XMLUni::fgXMLString)) { if (XMLString::equals(namespaceURI, XMLUni::fgXMLURIName)) return XMLUni::fgXMLURIName; throw DOMException(DOMException::NAMESPACE_ERR, 0); } else if (nType == DOMNode::ATTRIBUTE_NODE && XMLString::equals(prefix, XMLUni::fgXMLNSString)) { if (XMLString::equals(namespaceURI, XMLUni::fgXMLNSURIName)) return XMLUni::fgXMLNSURIName; throw DOMException(DOMException::NAMESPACE_ERR, 0); } else if (namespaceURI == 0 || *namespaceURI == 0) throw DOMException(DOMException::NAMESPACE_ERR, 0); return namespaceURI; } //Introduced in DOM Level 3 void* DOMNodeImpl::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) { if (!data && !hasUserData()) return 0; hasUserData(true); return ((DOMDocumentImpl*)getOwnerDocument())->setUserData(this, key, data, handler); } void* DOMNodeImpl::getUserData(const XMLCh* key) const { if (hasUserData()) return ((DOMDocumentImpl*)getOwnerDocument())->getUserData(this, key); return 0; } void DOMNodeImpl::callUserDataHandlers(DOMUserDataHandler::DOMOperationType operation, const DOMNode* src, DOMNode* dst) const { DOMDocumentImpl* doc=(DOMDocumentImpl*)getOwnerDocument(); if (doc) doc->callUserDataHandlers(this, operation, src, dst); } bool DOMNodeImpl::isSameNode(const DOMNode* other) const { return (getContainingNode() == other); } bool DOMNodeImpl::isEqualNode(const DOMNode* arg) const { if (!arg) return false; if (isSameNode(arg)) { return true; } const DOMNode* thisNode = getContainingNode(); if (arg->getNodeType() != thisNode->getNodeType()) { return false; } // the compareString will check null string as well if (!XMLString::equals(thisNode->getNodeName(), arg->getNodeName())) { return false; } if (!XMLString::equals(thisNode->getLocalName(),arg->getLocalName())) { return false; } if (!XMLString::equals(thisNode->getNamespaceURI(), arg->getNamespaceURI())) { return false; } if (!XMLString::equals(thisNode->getPrefix(), arg->getPrefix())) { return false; } if (!XMLString::equals(thisNode->getNodeValue(), arg->getNodeValue())) { return false; } return true; } const XMLCh* DOMNodeImpl::lookupPrefix(const XMLCh* namespaceURI) const { // REVISIT: When Namespaces 1.1 comes out this may not be true // Prefix can't be bound to null namespace if (namespaceURI == 0) { return 0; } const DOMNode *thisNode = getContainingNode(); short type = thisNode->getNodeType(); switch (type) { case DOMNode::ELEMENT_NODE: { return lookupPrefix(namespaceURI, (DOMElement*)thisNode); } case DOMNode::DOCUMENT_NODE:{ return ((DOMDocument*)thisNode)->getDocumentElement()->lookupPrefix(namespaceURI); } case DOMNode::ENTITY_NODE : case DOMNode::NOTATION_NODE: case DOMNode::DOCUMENT_FRAGMENT_NODE: case DOMNode::DOCUMENT_TYPE_NODE: // type is unknown return 0; case DOMNode::ATTRIBUTE_NODE:{ if (fOwnerNode->getNodeType() == DOMNode::ELEMENT_NODE) { return fOwnerNode->lookupPrefix(namespaceURI); } return 0; } default:{ DOMNode *ancestor = getElementAncestor(thisNode); if (ancestor != 0) { return ancestor->lookupPrefix(namespaceURI); } return 0; } } } DOMNode* DOMNodeImpl::getElementAncestor (const DOMNode* currentNode) const { DOMNode* parent = currentNode->getParentNode(); while(parent != 0) { short type = parent->getNodeType(); if (type == DOMNode::ELEMENT_NODE) { return parent; } parent=parent->getParentNode(); } return 0; } const XMLCh* DOMNodeImpl::lookupPrefix(const XMLCh* const namespaceURI, DOMElement *originalElement) const { const DOMNode *thisNode = getContainingNode(); const XMLCh* ns = thisNode->getNamespaceURI(); // REVISIT: if no prefix is available is it null or empty string, or // could be both? const XMLCh* prefix = thisNode->getPrefix(); if (ns != 0 && XMLString::equals(ns,namespaceURI) && prefix != 0) { const XMLCh* foundNamespace = originalElement->lookupNamespaceURI(prefix); if (foundNamespace != 0 && XMLString::equals(foundNamespace, namespaceURI)) { return prefix; } } if (thisNode->hasAttributes()) { DOMNamedNodeMap *nodeMap = thisNode->getAttributes(); if(nodeMap != 0) { XMLSize_t length = nodeMap->getLength(); for (XMLSize_t i = 0;i < length;i++) { DOMNode *attr = nodeMap->item(i); const XMLCh* attrPrefix = attr->getPrefix(); const XMLCh* value = attr->getNodeValue(); ns = attr->getNamespaceURI(); if (ns != 0 && XMLString::equals(ns, XMLUni::fgXMLNSURIName)) { // DOM Level 2 nodes if ((attrPrefix != 0 && XMLString::equals(attrPrefix, XMLUni::fgXMLNSString)) && XMLString::equals(value, namespaceURI)) { const XMLCh* localname= attr->getLocalName(); const XMLCh* foundNamespace = originalElement->lookupNamespaceURI(localname); if (foundNamespace != 0 && XMLString::equals(foundNamespace, namespaceURI)) { return localname; } } } } } } DOMNode *ancestor = getElementAncestor(thisNode); if (ancestor != 0) { return castToNodeImpl(ancestor)->lookupPrefix(namespaceURI, originalElement); } return 0; } const XMLCh* DOMNodeImpl::lookupNamespaceURI(const XMLCh* specifiedPrefix) const { const DOMNode *thisNode = getContainingNode(); short type = thisNode->getNodeType(); switch (type) { case DOMNode::ELEMENT_NODE : { const XMLCh* ns = thisNode->getNamespaceURI(); const XMLCh* prefix = thisNode->getPrefix(); if (ns != 0) { // REVISIT: is it possible that prefix is empty string? if (specifiedPrefix == 0 && prefix == specifiedPrefix) { // looking for default namespace return ns; } else if (prefix != 0 && XMLString::equals(prefix, specifiedPrefix)) { // non default namespace return ns; } } if (thisNode->hasAttributes()) { DOMNamedNodeMap *nodeMap = thisNode->getAttributes(); if(nodeMap != 0) { XMLSize_t length = nodeMap->getLength(); for (XMLSize_t i = 0;i < length;i++) { DOMNode *attr = nodeMap->item(i); const XMLCh *attrPrefix = attr->getPrefix(); const XMLCh *value = attr->getNodeValue(); ns = attr->getNamespaceURI(); if (ns != 0 && XMLString::equals(ns, XMLUni::fgXMLNSURIName)) { // at this point we are dealing with DOM Level 2 nodes only if (specifiedPrefix == 0 && XMLString::equals(attr->getNodeName(), XMLUni::fgXMLNSString)) { // default namespace return value; } else if (attrPrefix != 0 && XMLString::equals(attrPrefix, XMLUni::fgXMLNSString) && XMLString::equals(attr->getLocalName(), specifiedPrefix)) { // non default namespace return value; } } } } } DOMNode *ancestor = getElementAncestor(thisNode); if (ancestor != 0) { return ancestor->lookupNamespaceURI(specifiedPrefix); } return 0; } case DOMNode::DOCUMENT_NODE : { return((DOMDocument*)thisNode)->getDocumentElement()->lookupNamespaceURI(specifiedPrefix); } case DOMNode::ENTITY_NODE : case DOMNode::NOTATION_NODE: case DOMNode::DOCUMENT_FRAGMENT_NODE: case DOMNode::DOCUMENT_TYPE_NODE: // type is unknown return 0; case DOMNode::ATTRIBUTE_NODE:{ if (fOwnerNode->getNodeType() == DOMNode::ELEMENT_NODE) { return fOwnerNode->lookupNamespaceURI(specifiedPrefix); } return 0; } default:{ DOMNode *ancestor = getElementAncestor(getContainingNode()); if (ancestor != 0) { return ancestor->lookupNamespaceURI(specifiedPrefix); } return 0; } } } const XMLCh* DOMNodeImpl::getBaseURI() const{ const DOMNode *thisNode = getContainingNode(); DOMNode* parent = thisNode->getParentNode(); if (parent) return parent->getBaseURI(); else return 0; } const DOMNode* DOMNodeImpl::getTreeParentNode(const DOMNode* node) const { const DOMNode* parent=node->getParentNode(); if(parent) return parent; short nodeType=node->getNodeType(); switch(nodeType) { case DOMNode::ATTRIBUTE_NODE: return ((const DOMAttr*)node)->getOwnerElement(); case DOMNode::NOTATION_NODE: case DOMNode::ENTITY_NODE: return node->getOwnerDocument()->getDoctype(); } return 0; } short DOMNodeImpl::compareDocumentPosition(const DOMNode* other) const { const DOMNode* thisNode = getContainingNode(); // If the two nodes being compared are the same node, then no flags are set on the return. if (thisNode == other) return 0; //if this is a custom node, we don't really know what to do, just return //user should provide its own compareDocumentPosition logic, and shouldn't reach here if(thisNode->getNodeType() > 12) { return 0; } //if it is a custom node we must ask it for the order if(other->getNodeType() > 12) { return reverseTreeOrderBitPattern(other->compareDocumentPosition(thisNode)); } // Otherwise, the order of two nodes is determined by looking for common containers -- // containers which contain both. A node directly contains any child nodes. // A node also directly contains any other nodes attached to it such as attributes // contained in an element or entities and notations contained in a document type. // Nodes contained in contained nodes are also contained, but less-directly as // the number of intervening containers increases. // If one of the nodes being compared contains the other node, then the container precedes // the contained node, and reversely the contained node follows the container. For example, // when comparing an element against its own attribute or child, the element node precedes // its attribute node and its child node, which both follow it. const DOMNode* tmpNode; const DOMNode* myRoot = getContainingNode(); int myDepth=0; while((tmpNode=getTreeParentNode(myRoot))!=0) { myRoot=tmpNode; if(myRoot==other) return DOMNode::DOCUMENT_POSITION_CONTAINS | DOMNode::DOCUMENT_POSITION_PRECEDING; myDepth++; } const DOMNode* hisRoot = other; int hisDepth=0; while((tmpNode=getTreeParentNode(hisRoot))!=0) { hisRoot=tmpNode; if(hisRoot==thisNode) return DOMNode::DOCUMENT_POSITION_CONTAINED_BY | DOMNode::DOCUMENT_POSITION_FOLLOWING; hisDepth++; } // If there is no common container node, then the order is based upon order between the // root container of each node that is in no container. In this case, the result is // disconnected and implementation-specific. This result is stable as long as these // outer-most containing nodes remain in memory and are not inserted into some other // containing node. This would be the case when the nodes belong to different documents // or fragments, and cloning the document or inserting a fragment might change the order. if(myRoot!=hisRoot) return DOMNode::DOCUMENT_POSITION_DISCONNECTED | DOMNode::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC | (myRoot hisDepth) { for (int i= 0 ; i < myDepth - hisDepth; i++) myRoot = getTreeParentNode(myRoot); } else { for (int i = 0; i < hisDepth - myDepth; i++) hisRoot = getTreeParentNode(hisRoot); } // We now have nodes at the same depth in the tree. Find a common ancestor. const DOMNode *myNodeP=myRoot; const DOMNode *hisNodeP=hisRoot; while(myRoot!=hisRoot) { myNodeP = myRoot; hisNodeP = hisRoot; myRoot = getTreeParentNode(myRoot); hisRoot = getTreeParentNode(hisRoot); } short myNodeType=myNodeP->getNodeType(); short hisNodeType=hisNodeP->getNodeType(); bool bMyNodeIsChild=(myNodeType!=DOMNode::ATTRIBUTE_NODE && myNodeType!=DOMNode::ENTITY_NODE && myNodeType!=DOMNode::NOTATION_NODE); bool bHisNodeIsChild=(hisNodeType!=DOMNode::ATTRIBUTE_NODE && hisNodeType!=DOMNode::ENTITY_NODE && hisNodeType!=DOMNode::NOTATION_NODE); // If these two determining nodes are both child nodes, then the natural DOM order of these // determining nodes within the containing node is returned as the order of the corresponding nodes. // This would be the case, for example, when comparing two child elements of the same element. if(bMyNodeIsChild && bHisNodeIsChild) { while(myNodeP != 0) { myNodeP = myNodeP->getNextSibling(); if(myNodeP == hisNodeP) return DOMNode::DOCUMENT_POSITION_FOLLOWING; } return DOMNode::DOCUMENT_POSITION_PRECEDING; } // If one of the two determining nodes is a child node and the other is not, then the corresponding // node of the child node follows the corresponding node of the non-child node. This would be the case, // for example, when comparing an attribute of an element with a child element of the same element. else if(!bMyNodeIsChild && bHisNodeIsChild) return DOMNode::DOCUMENT_POSITION_FOLLOWING; else if(bMyNodeIsChild && !bHisNodeIsChild) return DOMNode::DOCUMENT_POSITION_PRECEDING; else { // If neither of the two determining node is a child node and one determining node has a greater value // of nodeType than the other, then the corresponding node precedes the other. This would be the case, // for example, when comparing an entity of a document type against a notation of the same document type. if(myNodeType!=hisNodeType) return (myNodeTypeallocate((nBufferLength+1) * sizeof(XMLCh)); getTextContent(pzBuffer, nBufferLength); pzBuffer[nBufferLength] = 0; return pzBuffer; } const XMLCh* DOMNodeImpl::getTextContent(XMLCh* pzBuffer, XMLSize_t& rnBufferLength) const { XMLSize_t nRemainingBuffer = rnBufferLength; rnBufferLength = 0; if (pzBuffer) *pzBuffer = 0; const DOMNode *thisNode = getContainingNode(); switch (thisNode->getNodeType()) { case DOMNode::ELEMENT_NODE: case DOMNode::ENTITY_NODE: case DOMNode::ENTITY_REFERENCE_NODE: case DOMNode::DOCUMENT_FRAGMENT_NODE: { DOMNode* current = thisNode->getFirstChild(); while (current != NULL) { if (current->getNodeType() != DOMNode::COMMENT_NODE && current->getNodeType() != DOMNode::PROCESSING_INSTRUCTION_NODE) { if (pzBuffer) { XMLSize_t nContentLength = nRemainingBuffer; castToNodeImpl(current)->getTextContent(pzBuffer + rnBufferLength, nContentLength); rnBufferLength += nContentLength; nRemainingBuffer -= nContentLength; } else { XMLSize_t nContentLength = 0; castToNodeImpl(current)->getTextContent(NULL, nContentLength); rnBufferLength += nContentLength; } } current = current->getNextSibling(); } } break; case DOMNode::ATTRIBUTE_NODE: case DOMNode::TEXT_NODE: case DOMNode::CDATA_SECTION_NODE: case DOMNode::COMMENT_NODE: case DOMNode::PROCESSING_INSTRUCTION_NODE: { const XMLCh* pzValue = thisNode->getNodeValue(); XMLSize_t nStrLen = XMLString::stringLen(pzValue); if (pzBuffer) { XMLSize_t nContentLength = (nRemainingBuffer >= nStrLen) ? nStrLen : nRemainingBuffer; XMLString::copyNString(pzBuffer + rnBufferLength, pzValue, nContentLength); rnBufferLength += nContentLength; nRemainingBuffer -= nContentLength; } else { rnBufferLength += nStrLen; } } break; /*** DOCUMENT_NODE DOCUMENT_TYPE_NODE NOTATION_NODE ***/ default: break; } return pzBuffer; } void DOMNodeImpl::setTextContent(const XMLCh* textContent) { DOMNode *thisNode = getContainingNode(); switch (thisNode->getNodeType()) { case DOMNode::ELEMENT_NODE: case DOMNode::ENTITY_NODE: case DOMNode::ENTITY_REFERENCE_NODE: case DOMNode::DOCUMENT_FRAGMENT_NODE: { if (isReadOnly()) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); // Remove all childs DOMNode* current = thisNode->getFirstChild(); while (current != NULL) { thisNode->removeChild(current); current = thisNode->getFirstChild(); } if (textContent != NULL) { // Add textnode containing data current = ((DOMDocumentImpl*)thisNode->getOwnerDocument())->createTextNode(textContent); thisNode->appendChild(current); } } break; case DOMNode::ATTRIBUTE_NODE: case DOMNode::TEXT_NODE: case DOMNode::CDATA_SECTION_NODE: case DOMNode::COMMENT_NODE: case DOMNode::PROCESSING_INSTRUCTION_NODE: if (isReadOnly()) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); thisNode->setNodeValue(textContent); break; case DOMNode::DOCUMENT_NODE: case DOMNode::DOCUMENT_TYPE_NODE: case DOMNode::NOTATION_NODE: break; default: throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, GetDOMNodeMemoryManager); } } bool DOMNodeImpl::isDefaultNamespace(const XMLCh* namespaceURI) const { const DOMNode *thisNode = getContainingNode(); short type = thisNode->getNodeType(); switch (type) { case DOMNode::ELEMENT_NODE: { const XMLCh *prefix = thisNode->getPrefix(); // REVISIT: is it possible that prefix is empty string? if (prefix == 0 || !*prefix) { return XMLString::equals(namespaceURI, thisNode->getNamespaceURI()); } if (thisNode->hasAttributes()) { DOMElement *elem = (DOMElement *)thisNode; DOMNode *attr = elem->getAttributeNodeNS(XMLUni::fgXMLNSURIName, XMLUni::fgXMLNSString); if (attr != 0) { const XMLCh *value = attr->getNodeValue(); return XMLString::equals(namespaceURI, value); } } DOMNode *ancestor = getElementAncestor(thisNode); if (ancestor != 0) { return ancestor->isDefaultNamespace(namespaceURI); } return false; } case DOMNode::DOCUMENT_NODE:{ return ((DOMDocument*)thisNode)->getDocumentElement()->isDefaultNamespace(namespaceURI); } case DOMNode::ENTITY_NODE : case DOMNode::NOTATION_NODE: case DOMNode::DOCUMENT_FRAGMENT_NODE: case DOMNode::DOCUMENT_TYPE_NODE: // type is unknown return false; case DOMNode::ATTRIBUTE_NODE:{ if (fOwnerNode->getNodeType() == DOMNode::ELEMENT_NODE) { return fOwnerNode->isDefaultNamespace(namespaceURI); } return false; } default:{ DOMNode *ancestor = getElementAncestor(thisNode); if (ancestor != 0) { return ancestor->isDefaultNamespace(namespaceURI); } return false; } } } void* DOMNodeImpl::getFeature(const XMLCh*, const XMLCh*) const { return 0; } // non-standard extension void DOMNodeImpl::release() { // shouldn't reach here throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp000644 000765 000024 00000046173 13241160337 024327 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMDocumentTypeImpl.cpp 1800911 2017-07-05 18:52:15Z scantor $ */ #include "DOMDocumentTypeImpl.hpp" #include #include #include #include #include #include #include #include #include #include "DOMNamedNodeMapImpl.hpp" #include "DOMDocumentImpl.hpp" #include "DOMCasts.hpp" XERCES_CPP_NAMESPACE_BEGIN static DOMDocument* sDocument = 0; static XMLMutex* sDocumentMutex = 0; void XMLInitializer::initializeDOMDocumentTypeImpl() { sDocumentMutex = new XMLMutex(XMLPlatformUtils::fgMemoryManager); static const XMLCh gCoreStr[] = { chLatin_C, chLatin_o, chLatin_r, chLatin_e, chNull }; DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(gCoreStr); sDocument = impl->createDocument(); // document type object (DTD). } void XMLInitializer::terminateDOMDocumentTypeImpl() { sDocument->release(); sDocument = 0; delete sDocumentMutex; sDocumentMutex = 0; } DOMDocumentTypeImpl::DOMDocumentTypeImpl(DOMDocument *ownerDoc, const XMLCh *dtName, bool heap) : fNode(this, ownerDoc), fParent(this, ownerDoc), fName(0), fEntities(0), fNotations(0), fElements(0), fPublicId(0), fSystemId(0), fInternalSubset(0), fIntSubsetReading(false), fIsCreatedFromHeap(heap) { if (ownerDoc) { fName = ((DOMDocumentImpl *)ownerDoc)->getPooledString(dtName); fEntities = new (ownerDoc) DOMNamedNodeMapImpl(this); fNotations= new (ownerDoc) DOMNamedNodeMapImpl(this); fElements = new (ownerDoc) DOMNamedNodeMapImpl(this); } else { XMLMutexLock lock(sDocumentMutex); DOMDocument* doc = sDocument; fName = ((DOMDocumentImpl *)doc)->getPooledString(dtName); fEntities = new (doc) DOMNamedNodeMapImpl(this); fNotations= new (doc) DOMNamedNodeMapImpl(this); fElements = new (doc) DOMNamedNodeMapImpl(this); } } //Introduced in DOM Level 2 DOMDocumentTypeImpl::DOMDocumentTypeImpl(DOMDocument *ownerDoc, const XMLCh *qualifiedName, const XMLCh *pubId, const XMLCh *sysId, bool heap) : fNode(this, ownerDoc), fParent(this, ownerDoc), fName(0), fEntities(0), fNotations(0), fElements(0), fPublicId(0), fSystemId(0), fInternalSubset(0), fIntSubsetReading(false), fIsCreatedFromHeap(heap) { int index = DOMDocumentImpl::indexofQualifiedName(qualifiedName); if (index < 0) throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager); else if (index > 0) { // we have to make sure the qualifiedName has correct prefix and localName // although we don't really to store them separately XMLCh* newName; XMLCh temp[256]; if (index >= 255) newName = (XMLCh*) XMLPlatformUtils::fgMemoryManager->allocate ( (XMLString::stringLen(qualifiedName)+1) * sizeof(XMLCh) );//new XMLCh[XMLString::stringLen(qualifiedName)+1]; else newName = temp; XMLString::copyNString(newName, qualifiedName, index); newName[index] = chNull; // Before we carry on, we should check if the prefix or localName are valid XMLName if (ownerDoc) { if (!((DOMDocumentImpl*)ownerDoc)->isXMLName(newName) || !((DOMDocumentImpl*)ownerDoc)->isXMLName(qualifiedName+index+1)) throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager); } else { // document is not there yet, so assume XML 1.0 if (!XMLChar1_0::isValidName(newName) || !XMLChar1_0::isValidName(qualifiedName+index+1)) throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager); } if (index >= 255) XMLPlatformUtils::fgMemoryManager->deallocate(newName);//delete[] newName; } if (ownerDoc) { DOMDocumentImpl *docImpl = (DOMDocumentImpl *)ownerDoc; fPublicId = docImpl->cloneString(pubId); fSystemId = docImpl->cloneString(sysId); fName = ((DOMDocumentImpl *)ownerDoc)->getPooledString(qualifiedName); fEntities = new (ownerDoc) DOMNamedNodeMapImpl(this); fNotations= new (ownerDoc) DOMNamedNodeMapImpl(this); fElements = new (ownerDoc) DOMNamedNodeMapImpl(this); } else { XMLMutexLock lock(sDocumentMutex); DOMDocument* doc = sDocument; fPublicId = ((DOMDocumentImpl*) doc)->cloneString(pubId); fSystemId = ((DOMDocumentImpl*) doc)->cloneString(sysId); fName = ((DOMDocumentImpl*) doc)->getPooledString(qualifiedName); fEntities = new (doc) DOMNamedNodeMapImpl(this); fNotations= new (doc) DOMNamedNodeMapImpl(this); fElements = new (doc) DOMNamedNodeMapImpl(this); } } DOMDocumentTypeImpl::DOMDocumentTypeImpl(const DOMDocumentTypeImpl &other, bool heap, bool deep) : fNode(this, other.fNode), fParent(this, other.fParent), fChild(other.fChild), fName(0), fEntities(0), fNotations(0), fElements(0), fPublicId(0), fSystemId(0), fInternalSubset(0), fIntSubsetReading(other.fIntSubsetReading), fIsCreatedFromHeap(heap) { fName = other.fName; //DOM Level 2 fPublicId = other.fPublicId; fSystemId = other.fSystemId; fInternalSubset = other.fInternalSubset; if ((DOMDocumentImpl *)this->fNode.getOwnerDocument() && deep) fParent.cloneChildren(&other); fEntities = other.fEntities->cloneMap(this); fNotations= other.fNotations->cloneMap(this); fElements = other.fElements->cloneMap(this); } DOMDocumentTypeImpl::~DOMDocumentTypeImpl() { } DOMNode *DOMDocumentTypeImpl::cloneNode(bool deep) const { DOMNode* newNode = 0; DOMDocument* doc = castToNodeImpl(this)->getOwnerDocument(); if (doc != 0) newNode = new (doc, DOMMemoryManager::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(*this, false, deep); else { XMLMutexLock lock(sDocumentMutex); newNode = new (sDocument, DOMMemoryManager::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(*this, false, deep); } fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode); return newNode; } /** * NON-DOM * set the ownerDocument of this node and its children */ void DOMDocumentTypeImpl::setOwnerDocument(DOMDocument *doc) { if (castToNodeImpl(this)->getOwnerDocument()) { fNode.setOwnerDocument(doc); fParent.setOwnerDocument(doc); } else { if (doc) { DOMDocumentImpl *docImpl = (DOMDocumentImpl *)doc; fPublicId = docImpl->cloneString(fPublicId); fSystemId = docImpl->cloneString(fSystemId); fInternalSubset = docImpl->cloneString(fInternalSubset); fName = docImpl->getPooledString(fName); fNode.setOwnerDocument(doc); fParent.setOwnerDocument(doc); DOMNamedNodeMapImpl* entitiesTemp = fEntities->cloneMap(this); DOMNamedNodeMapImpl* notationsTemp = fNotations->cloneMap(this); DOMNamedNodeMapImpl* elementsTemp = fElements->cloneMap(this); fEntities = entitiesTemp; fNotations = notationsTemp; fElements = elementsTemp; } } } const XMLCh * DOMDocumentTypeImpl::getNodeName() const { return fName; } DOMNode::NodeType DOMDocumentTypeImpl::getNodeType() const { return DOMNode::DOCUMENT_TYPE_NODE; } DOMNamedNodeMap *DOMDocumentTypeImpl::getEntities() const { return fEntities; } const XMLCh * DOMDocumentTypeImpl::getName() const { return fName; } DOMNamedNodeMap *DOMDocumentTypeImpl::getNotations() const { return fNotations; } DOMNamedNodeMap *DOMDocumentTypeImpl::getElements() const { return fElements; } void DOMDocumentTypeImpl::setNodeValue(const XMLCh *val) { fNode.setNodeValue(val); } void DOMDocumentTypeImpl::setReadOnly(bool readOnl, bool deep) { fNode.setReadOnly(readOnl,deep); if (fEntities) fEntities->setReadOnly(readOnl,true); if (fNotations) fNotations->setReadOnly(readOnl,true); } //Introduced in DOM Level 2 const XMLCh * DOMDocumentTypeImpl::getPublicId() const { return fPublicId; } const XMLCh * DOMDocumentTypeImpl::getSystemId() const { return fSystemId; } const XMLCh * DOMDocumentTypeImpl::getInternalSubset() const { return fInternalSubset; } bool DOMDocumentTypeImpl::isIntSubsetReading() const { return fIntSubsetReading; } //set functions void DOMDocumentTypeImpl::setPublicId(const XMLCh *value) { // revist. Why shouldn't 0 be assigned like any other value? if (value == 0) return; DOMDocumentImpl* doc = (DOMDocumentImpl *)castToNodeImpl(this)->getOwnerDocument(); if (doc != 0) fPublicId = doc->cloneString(value); else { XMLMutexLock lock(sDocumentMutex); fPublicId = ((DOMDocumentImpl *)sDocument)->cloneString(value); } } void DOMDocumentTypeImpl::setSystemId(const XMLCh *value) { DOMDocumentImpl* doc = (DOMDocumentImpl *)castToNodeImpl(this)->getOwnerDocument(); if (doc != 0) fSystemId = doc->cloneString(value); else { XMLMutexLock lock(sDocumentMutex); fSystemId = ((DOMDocumentImpl *)sDocument)->cloneString(value); } } void DOMDocumentTypeImpl::setInternalSubset(const XMLCh *value) { DOMDocumentImpl* doc = (DOMDocumentImpl *)castToNodeImpl(this)->getOwnerDocument(); if (doc != 0) fInternalSubset = doc->cloneString(value); else { XMLMutexLock lock(sDocumentMutex); fInternalSubset = ((DOMDocumentImpl *)sDocument)->cloneString(value); } } void DOMDocumentTypeImpl::release() { if (fNode.isOwned()) { if (fNode.isToBeReleased()) { // we are calling from documnet.release() which will notify the user data handler if (fIsCreatedFromHeap) { DOMDocumentType* docType = this; delete docType; } } else throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); } else { if (fIsCreatedFromHeap) { fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0); DOMDocumentType* docType = this; delete docType; } else { DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument(); if (doc) { fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0); doc->release(this, DOMMemoryManager::DOCUMENT_TYPE_OBJECT); } else { // shouldn't reach here throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); } } } } // // Delegation for functions inherited from Node // DOMNode* DOMDocumentTypeImpl::appendChild(DOMNode *newChild) {return fParent.appendChild (newChild); } DOMNamedNodeMap* DOMDocumentTypeImpl::getAttributes() const {return fNode.getAttributes (); } DOMNodeList* DOMDocumentTypeImpl::getChildNodes() const {return fParent.getChildNodes (); } DOMNode* DOMDocumentTypeImpl::getFirstChild() const {return fParent.getFirstChild (); } DOMNode* DOMDocumentTypeImpl::getLastChild() const {return fParent.getLastChild (); } const XMLCh* DOMDocumentTypeImpl::getLocalName() const {return fNode.getLocalName (); } const XMLCh* DOMDocumentTypeImpl::getNamespaceURI() const {return fNode.getNamespaceURI (); } DOMNode* DOMDocumentTypeImpl::getNextSibling() const {return fChild.getNextSibling (); } const XMLCh* DOMDocumentTypeImpl::getNodeValue() const {return fNode.getNodeValue (); } DOMDocument* DOMDocumentTypeImpl::getOwnerDocument() const {return fParent.fOwnerDocument; } const XMLCh* DOMDocumentTypeImpl::getPrefix() const {return fNode.getPrefix (); } DOMNode* DOMDocumentTypeImpl::getParentNode() const {return fChild.getParentNode (this); } DOMNode* DOMDocumentTypeImpl::getPreviousSibling() const {return fChild.getPreviousSibling (this); } bool DOMDocumentTypeImpl::hasChildNodes() const {return fParent.hasChildNodes (); } DOMNode* DOMDocumentTypeImpl::insertBefore(DOMNode *newChild, DOMNode *refChild) {return fParent.insertBefore (newChild, refChild); } void DOMDocumentTypeImpl::normalize() {fParent.normalize (); } DOMNode* DOMDocumentTypeImpl::removeChild(DOMNode *oldChild) {return fParent.removeChild (oldChild); } DOMNode* DOMDocumentTypeImpl::replaceChild(DOMNode *newChild, DOMNode *oldChild) {return fParent.replaceChild (newChild, oldChild); } void DOMDocumentTypeImpl::setPrefix(const XMLCh *prefix) {fNode.setPrefix(prefix); } bool DOMDocumentTypeImpl::hasAttributes() const {return fNode.hasAttributes(); } bool DOMDocumentTypeImpl::isSameNode(const DOMNode* other) const {return fNode.isSameNode(other); } void* DOMDocumentTypeImpl::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) {return fNode.setUserData(key, data, handler); } void* DOMDocumentTypeImpl::getUserData(const XMLCh* key) const {return fNode.getUserData(key); } const XMLCh* DOMDocumentTypeImpl::getBaseURI() const {return fNode.getBaseURI(); } short DOMDocumentTypeImpl::compareDocumentPosition(const DOMNode* other) const {return fNode.compareDocumentPosition(other); } const XMLCh* DOMDocumentTypeImpl::getTextContent() const {return fNode.getTextContent(); } void DOMDocumentTypeImpl::setTextContent(const XMLCh* textContent){fNode.setTextContent(textContent); } const XMLCh* DOMDocumentTypeImpl::lookupPrefix(const XMLCh* namespaceURI) const {return fNode.lookupPrefix(namespaceURI); } bool DOMDocumentTypeImpl::isDefaultNamespace(const XMLCh* namespaceURI) const {return fNode.isDefaultNamespace(namespaceURI); } const XMLCh* DOMDocumentTypeImpl::lookupNamespaceURI(const XMLCh* prefix) const {return fNode.lookupNamespaceURI(prefix); } // Macro-in implementation accessors. DOMNODEIMPL_IMPL(DOMDocumentTypeImpl); DOMPARENTIMPL_IMPL(DOMDocumentTypeImpl); DOMCHILDIMPL_IMPL(DOMDocumentTypeImpl); bool DOMDocumentTypeImpl::isEqualNode(const DOMNode* arg) const { if (isSameNode(arg)) { return true; } if (!fNode.isEqualNode(arg)) { return false; } DOMDocumentType* argDT = (DOMDocumentType*) arg; // check the string values if (!getPublicId()) { if (argDT->getPublicId()) { return false; } } else if (!XMLString::equals(getPublicId(), argDT->getPublicId())) { return false; } if (!getSystemId()) { if (argDT->getSystemId()) { return false; } } else if (!XMLString::equals(getSystemId(), argDT->getSystemId())) { return false; } if (!getInternalSubset()) { if (argDT->getInternalSubset()) { return false; } } else if (!XMLString::equals(getInternalSubset(), argDT->getInternalSubset())) { return false; } // check the notations if (getNotations()) { if (!argDT->getNotations()) return false; DOMNamedNodeMap* map1 = getNotations(); DOMNamedNodeMap* map2 = argDT->getNotations(); XMLSize_t len = map1->getLength(); if (len != map2->getLength()) { return false; } for (XMLSize_t i = 0; i < len; i++) { DOMNode* n1 = map1->item(i); DOMNode* n2 = map2->getNamedItem(n1->getNodeName()); if (!n2 || !n1->isEqualNode(n2)) { return false; } } } else { if (argDT->getNotations()) return false; } // check the entities if (getEntities()) { if (!argDT->getEntities()) return false; DOMNamedNodeMap* map1 = getEntities(); DOMNamedNodeMap* map2 = argDT->getEntities(); XMLSize_t len = map1->getLength(); if (len != map2->getLength()) { return false; } for (XMLSize_t i = 0; i < len; i++) { DOMNode* n1 = map1->item(i); DOMNode* n2 = map2->getNamedItem(n1->getNodeName()); if (!n2 || !n1->isEqualNode(n2)) { return false; } } } else { if (argDT->getEntities()) return false; } return fParent.isEqualNode(arg); } bool DOMDocumentTypeImpl::isSupported(const XMLCh *feature, const XMLCh *version) const { // check for 'DOMDocumentTypeImpl' or '+DOMDocumentTypeImpl' if(feature && *feature) { if((*feature==chPlus && XMLString::equals(feature+1, XMLUni::fgXercescInterfaceDOMDocumentTypeImpl)) || XMLString::equals(feature, XMLUni::fgXercescInterfaceDOMDocumentTypeImpl)) return true; } return fNode.isSupported (feature, version); } void* DOMDocumentTypeImpl::getFeature(const XMLCh* feature, const XMLCh* version) const { if(XMLString::equals(feature, XMLUni::fgXercescInterfaceDOMDocumentTypeImpl)) return (DOMDocumentTypeImpl*)this; return fNode.getFeature(feature,version); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMXPathResultImpl.cpp000644 000765 000024 00000007342 13241160337 024125 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "DOMXPathResultImpl.hpp" #include #include XERCES_CPP_NAMESPACE_BEGIN DOMXPathResultImpl::DOMXPathResultImpl(ResultType type, MemoryManager* const manager) : fType(type), fMemoryManager(manager), fIndex (0) { fSnapshot = new (fMemoryManager) RefVectorOf(13, false, fMemoryManager); } DOMXPathResultImpl::~DOMXPathResultImpl() { delete fSnapshot; } // // DOMXPathResult::ResultType DOMXPathResultImpl::getResultType() const { return fType; } const DOMTypeInfo* DOMXPathResultImpl::getTypeInfo() const { throw DOMXPathException(DOMXPathException::TYPE_ERR, 0, fMemoryManager); } bool DOMXPathResultImpl::isNode() const { throw DOMXPathException(DOMXPathException::TYPE_ERR, 0, fMemoryManager); } bool DOMXPathResultImpl::getBooleanValue() const { throw DOMXPathException(DOMXPathException::TYPE_ERR, 0, fMemoryManager); } int DOMXPathResultImpl::getIntegerValue() const { throw DOMXPathException(DOMXPathException::TYPE_ERR, 0, fMemoryManager); } double DOMXPathResultImpl::getNumberValue() const { throw DOMXPathException(DOMXPathException::TYPE_ERR, 0, fMemoryManager); } const XMLCh* DOMXPathResultImpl::getStringValue() const { throw DOMXPathException(DOMXPathException::TYPE_ERR, 0, fMemoryManager); } DOMNode* DOMXPathResultImpl::getNodeValue() const { if(fType == ANY_UNORDERED_NODE_TYPE || fType == FIRST_ORDERED_NODE_TYPE) { return fSnapshot->size() > 0 ? fSnapshot->elementAt(0) : 0; } else if (fType==UNORDERED_NODE_SNAPSHOT_TYPE || fType==ORDERED_NODE_SNAPSHOT_TYPE) { return fIndex < fSnapshot->size() ? fSnapshot->elementAt(fIndex) : 0; } else throw DOMXPathException(DOMXPathException::TYPE_ERR, 0, fMemoryManager); } bool DOMXPathResultImpl::iterateNext() { throw DOMXPathException(DOMXPathException::TYPE_ERR, 0, fMemoryManager); } bool DOMXPathResultImpl::getInvalidIteratorState() const { throw DOMXPathException(DOMXPathException::TYPE_ERR, 0, fMemoryManager); } bool DOMXPathResultImpl::snapshotItem(XMLSize_t index) { if(fType==UNORDERED_NODE_SNAPSHOT_TYPE || fType==ORDERED_NODE_SNAPSHOT_TYPE) { fIndex = index; return fIndex < fSnapshot->size(); } else throw DOMXPathException(DOMXPathException::TYPE_ERR, 0, fMemoryManager); } XMLSize_t DOMXPathResultImpl::getSnapshotLength() const { if(fType==UNORDERED_NODE_SNAPSHOT_TYPE || fType==ORDERED_NODE_SNAPSHOT_TYPE) return fSnapshot->size(); else throw DOMXPathException(DOMXPathException::TYPE_ERR, 0, fMemoryManager); } void DOMXPathResultImpl::release() { DOMXPathResultImpl* me = this; delete me; } // // void DOMXPathResultImpl::reset(ResultType type) { fType = type; fSnapshot->removeAllElements(); fIndex = 0; } void DOMXPathResultImpl::addResult(DOMNode* node) { fSnapshot->addElement(node); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMImplementationImpl.hpp000644 000765 000024 00000010606 13241160337 024671 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMImplementationImpl.hpp 1801211 2017-07-07 20:54:04Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLMsgLoader; class CDOM_EXPORT DOMImplementationImpl: public XMemory, public DOMImplementation, public DOMImplementationSource { private: DOMImplementationImpl(const DOMImplementationImpl &); DOMImplementationImpl & operator = (const DOMImplementationImpl &); friend class XMLInitializer; protected: DOMImplementationImpl() {}; public: virtual ~DOMImplementationImpl() {}; static DOMImplementationImpl* getDOMImplementationImpl(); static XMLMsgLoader* getMsgLoader4DOM(); // ------------------------------------------------------------ // DOMImplementation Virtual interface // ------------------------------------------------------------ virtual bool hasFeature(const XMLCh * feature, const XMLCh * version) const; // Introduced in DOM Level 2 virtual DOMDocumentType* createDocumentType(const XMLCh *qualifiedName, const XMLCh * publicId, const XMLCh *systemId); virtual DOMDocument* createDocument(const XMLCh *namespaceURI, const XMLCh *qualifiedName, DOMDocumentType *doctype, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); // DOM Level 3 virtual void* getFeature(const XMLCh* feature, const XMLCh* version) const; // Non-standard extension virtual DOMDocument* createDocument(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); // ------------------------------------------------------------ // DOMImplementationLS Virtual interface // ------------------------------------------------------------ // Introduced in DOM Level 3 virtual DOMLSParser* createLSParser(const DOMImplementationLSMode mode, const XMLCh* const schemaType, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager, XMLGrammarPool* const gramPool = 0); virtual DOMLSSerializer* createLSSerializer(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); virtual DOMLSInput* createLSInput(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); virtual DOMLSOutput* createLSOutput(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); // ------------------------------------------------------------ // DOMImplementationSource Virtual interface // ------------------------------------------------------------ virtual DOMImplementation* getDOMImplementation(const XMLCh* features) const; virtual DOMImplementationList* getDOMImplementationList(const XMLCh* features) const; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMStringPool.hpp000644 000765 000024 00000014612 13241160337 023163 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMStringPool.hpp 1528170 2013-10-01 18:23:57Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMSTRINGPOOL_HPP) #define XERCESC_INCLUDE_GUARD_DOMSTRINGPOOL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include XERCES_CPP_NAMESPACE_BEGIN class DOMDocumentImpl; // // DStringPoolEntry - one of these structs is allocated for each // XMLCh String in the pool. Each slot in the // hash table array itself is a pointer to the head // of a singly-linked list of these structs. // // Although this struct is declared with a string length of one, // the factory method allocates enough storage to hold the full // string length. // struct DOMStringPoolEntry { DOMStringPoolEntry *fNext; XMLSize_t fLength; XMLCh fString[1]; }; // // DOMBuffer is a lightweight text buffer // The buffer is not nul terminated until some asks to see the raw buffer // contents. This also avoids overhead during append operations. class DOMBuffer { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- DOMBuffer(DOMDocumentImpl *doc, XMLSize_t capacity = 31); ~DOMBuffer() { } // ----------------------------------------------------------------------- // Buffer Management // ----------------------------------------------------------------------- void append (const XMLCh* const chars); void append (const XMLCh* const chars, const XMLSize_t count); void appendInPlace (const XMLCh* const chars, const XMLSize_t count); void set (const XMLCh* const chars); void set (const XMLCh* const chars, const XMLSize_t count); const XMLCh* getRawBuffer() const { fBuffer[fIndex] = 0; return fBuffer; } void reset() { fIndex = 0; fBuffer[0] = 0; } void chop ( const XMLSize_t count ) { fBuffer[count] = 0; fIndex = count; } // ----------------------------------------------------------------------- // Getters // ----------------------------------------------------------------------- XMLSize_t getLen() const { return fIndex; } XMLSize_t getCapacity() const { return fCapacity; } // ----------------------------------------------------------------------- // Private helpers // ----------------------------------------------------------------------- void expandCapacity(const XMLSize_t extraNeeded, bool releasePrevious = false); private : // ----------------------------------------------------------------------- // Private data members // // fBuffer // The pointer to the buffer data. Its grown as needed. Its always // one larger than fCapacity, to leave room for the null terminator. // // fIndex // The current index into the buffer, as characters are appended // to it. If its zero, then the buffer is empty. // // fCapacity // The current capacity of the buffer. Its actually always one // larger, to leave room for the null terminator. // // fDoc // For allocating memory // ----------------------------------------------------------------------- XMLCh* fBuffer; XMLSize_t fIndex; XMLSize_t fCapacity; DOMDocumentImpl* fDoc; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMBuffer(const DOMBuffer &); DOMBuffer & operator = (const DOMBuffer &); }; inline void DOMBuffer:: append (const XMLCh* const chars) { XMLSize_t count = XMLString::stringLen(chars); if (fIndex + count >= fCapacity) expandCapacity(count); memcpy(&fBuffer[fIndex], chars, count * sizeof(XMLCh)); fIndex += count; // Keep it null terminated fBuffer[fIndex] = 0; } inline void DOMBuffer:: append (const XMLCh* const chars, const XMLSize_t count) { if (fIndex + count >= fCapacity) expandCapacity(count); memcpy(&fBuffer[fIndex], chars, count * sizeof(XMLCh)); fIndex += count; // Keep it null terminated fBuffer[fIndex] = 0; } inline void DOMBuffer:: appendInPlace (const XMLCh* const chars, const XMLSize_t count) { if (fIndex + count >= fCapacity) expandCapacity(count, true); memcpy(&fBuffer[fIndex], chars, count * sizeof(XMLCh)); fIndex += count; // Keep it null terminated fBuffer[fIndex] = 0; } inline void DOMBuffer:: set (const XMLCh* const chars) { XMLSize_t count = XMLString::stringLen(chars); fIndex = 0; if (count >= fCapacity) expandCapacity(count); memcpy(fBuffer, chars, count * sizeof(XMLCh)); fIndex = count; // Keep it null terminated fBuffer[fIndex] = 0; } inline void DOMBuffer:: set (const XMLCh* const chars, const XMLSize_t count) { fIndex = 0; if (count >= fCapacity) expandCapacity(count); memcpy(fBuffer, chars, count * sizeof(XMLCh)); fIndex = count; // Keep it null terminated fBuffer[fIndex] = 0; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMTextImpl.hpp000644 000765 000024 00000007512 13241160337 022632 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMTextImpl.hpp 1800911 2017-07-05 18:52:15Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMTEXTIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMTEXTIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include #include "DOMNodeBase.hpp" #include "DOMChildNode.hpp" #include "DOMNodeImpl.hpp" #include "DOMCharacterDataImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN class CDOM_EXPORT DOMTextImpl: public DOMText, public HasDOMNodeImpl, public HasDOMChildImpl { public: DOMNodeImpl fNode; DOMChildNode fChild; DOMCharacterDataImpl fCharacterData; public: DOMTextImpl(DOMDocument* ownerDoc, const XMLCh* data); DOMTextImpl(DOMDocument *ownerDoc, const XMLCh* data, XMLSize_t n); DOMTextImpl(const DOMTextImpl& other, bool deep=false); virtual ~DOMTextImpl(); virtual DOMText* splitText(XMLSize_t offset); // DOM Level 3 virtual bool getIsElementContentWhitespace() const; virtual const XMLCh* getWholeText() const; virtual DOMText* replaceWholeText(const XMLCh* content); // non-standard extension virtual bool isIgnorableWhitespace() const; public: // Declare the functions coming from DOMNode. DOMNODE_FUNCTIONS; // Add accessors for implementation bits. DOMNODEIMPL_DECL; DOMCHILDIMPL_DECL; public: // All of the functions coming from DOMCharacterData virtual const XMLCh* getData() const; virtual XMLSize_t getLength() const; virtual const XMLCh* substringData(XMLSize_t offset, XMLSize_t count) const; virtual void appendData(const XMLCh *arg); virtual void insertData(XMLSize_t offset, const XMLCh *arg); virtual void deleteData(XMLSize_t offset, XMLSize_t count); virtual void replaceData(XMLSize_t offset, XMLSize_t count, const XMLCh *arg); virtual void setData(const XMLCh *data); // Non-standard extension. // virtual void appendData(const XMLCh *arg, XMLSize_t n); void appendDataFast(const XMLCh *arg, XMLSize_t n); protected: virtual void setIgnorableWhitespace(bool ignorable); friend class AbstractDOMParser; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMTextImpl & operator = (const DOMTextImpl &); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMEntityImpl.hpp000644 000765 000024 00000007376 13241160337 023172 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMEntityImpl.hpp 1800911 2017-07-05 18:52:15Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMENTITYIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMENTITYIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include "DOMNodeBase.hpp" #include "DOMNodeImpl.hpp" #include "DOMParentNode.hpp" #include XERCES_CPP_NAMESPACE_BEGIN class DOMEntityReference; class CDOM_EXPORT DOMEntityImpl: public DOMEntity, public HasDOMNodeImpl, public HasDOMParentImpl { protected: DOMNodeImpl fNode; DOMParentNode fParent; const XMLCh * fName; const XMLCh * fPublicId; const XMLCh * fSystemId; const XMLCh * fNotationName; DOMEntityReference* fRefEntity; // New data introduced in DOM Level 3 const XMLCh* fInputEncoding; const XMLCh* fXmlEncoding; const XMLCh* fXmlVersion; const XMLCh* fBaseURI; bool fEntityRefNodeCloned; // helper function void cloneEntityRefTree() const; friend class XercesDOMParser; public: DOMEntityImpl(DOMDocument *doc, const XMLCh *eName); DOMEntityImpl(const DOMEntityImpl &other, bool deep=false); virtual ~DOMEntityImpl(); public: // Declare all of the functions from DOMNode. DOMNODE_FUNCTIONS; // Add accessors for implementation bits. DOMNODEIMPL_DECL; DOMPARENTIMPL_DECL; public: virtual const XMLCh * getPublicId() const; virtual const XMLCh * getSystemId() const; virtual const XMLCh * getNotationName() const; virtual void setNotationName(const XMLCh *arg); virtual void setPublicId(const XMLCh *arg); virtual void setSystemId(const XMLCh *arg); //DOM Level 2 additions. Non standard functions virtual void setEntityRef(DOMEntityReference *); virtual DOMEntityReference* getEntityRef() const; //Introduced in DOM Level 3 virtual const XMLCh* getInputEncoding() const; virtual const XMLCh* getXmlEncoding() const; virtual const XMLCh* getXmlVersion() const; virtual void setBaseURI(const XMLCh *arg); void setInputEncoding(const XMLCh* actualEncoding); void setXmlEncoding(const XMLCh* encoding); void setXmlVersion(const XMLCh* version); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMEntityImpl & operator = (const DOMEntityImpl &); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMLSOutputImpl.cpp000644 000765 000024 00000003423 13241160337 023435 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMLSOutputImpl.cpp 471747 2006-11-06 14:31:56Z amassari $ */ #include "DOMLSOutputImpl.hpp" #include XERCES_CPP_NAMESPACE_BEGIN DOMLSOutputImpl::DOMLSOutputImpl(MemoryManager* const manager /*= XMLPlatformUtils::fgMemoryManager*/) :fByteStream(0) ,fEncoding(0) ,fSystemId(0) ,fMemoryManager(manager) { } DOMLSOutputImpl::~DOMLSOutputImpl() { fMemoryManager->deallocate(fEncoding); fMemoryManager->deallocate(fSystemId); } void DOMLSOutputImpl::setByteStream(XMLFormatTarget* stream) { fByteStream=stream; } void DOMLSOutputImpl::setEncoding(const XMLCh* const encodingStr) { fMemoryManager->deallocate(fEncoding); fEncoding = XMLString::replicate(encodingStr, fMemoryManager); } void DOMLSOutputImpl::setSystemId(const XMLCh* const systemId) { fMemoryManager->deallocate(fSystemId); fSystemId = XMLString::replicate(systemId, fMemoryManager); } void DOMLSOutputImpl::release() { delete this; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMXPathExpressionImpl.hpp000644 000765 000024 00000004451 13241160337 025011 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMXPathExpressionImpl.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHEXPRESSIONIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMXPATHEXPRESSIONIMPL_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMElement; class XercesXPath; class XPathMatcher; class DOMXPathResultImpl; class DOMXPathNSResolver; class XMLStringPool; class CDOM_EXPORT DOMXPathExpressionImpl : public XMemory, public DOMXPathExpression { public: DOMXPathExpressionImpl(const XMLCh *expression, const DOMXPathNSResolver *resolver, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); virtual ~DOMXPathExpressionImpl(); virtual DOMXPathResult* evaluate(const DOMNode *contextNode, DOMXPathResult::ResultType type, DOMXPathResult* result) const; virtual void release(); protected: bool testNode(XPathMatcher* matcher, DOMXPathResultImpl* result, DOMElement *node) const; void cleanUp(); XMLStringPool* fStringPool; XercesXPath* fParsedExpression; XMLCh* fExpression; bool fMoveToRoot; MemoryManager* const fMemoryManager; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMNodeListImpl.hpp000644 000765 000024 00000004573 13241160337 023433 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNodeListImpl.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMNODELISTIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMNODELISTIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // // NodeList implementation class - // This is for NodeLists returned by GetChildNodes only, not for // node lists returned by GetElementsByTagName // // Every node type capable of having children has (as an embedded member) // an instance of this class. To hold down the size overhead on each node, a // cache of extended data for active node lists is maintained // separately. // #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMParentNode; class DOMNode; class CDOM_EXPORT DOMNodeListImpl: public DOMNodeList { protected: DOMParentNode *fNode; private: // Unused, and unimplemented constructors, operators, etc. DOMNodeListImpl(); DOMNodeListImpl(const DOMNodeListImpl & other); DOMNodeListImpl & operator = (const DOMNodeListImpl & other); public: DOMNodeListImpl(DOMParentNode *node); virtual ~DOMNodeListImpl(); virtual DOMNode * item(XMLSize_t index) const; virtual XMLSize_t getLength() const; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMNodeIDMap.hpp000644 000765 000024 00000006366 13241160337 022632 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNodeIDMap.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMNODEIDMAP_HPP) #define XERCESC_INCLUDE_GUARD_DOMNODEIDMAP_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include XERCES_CPP_NAMESPACE_BEGIN // // Class DOMNodeIDMap is a hash table that is used in the implementation of // of DOM_Document::getElementsByID(). // // Why Yet Another HashTable implementation? Becuase it can be significantly // smaller when tuned for this exact usage, and the generic RefHashTableOf // from the xerces utils project is not a paricularly good fit. // class DOMAttr; class DOMDocument; class DOMNodeIDMap { public: DOMNodeIDMap(XMLSize_t initialSize, DOMDocument *doc); // Create a new hash table, sized to hold "initialSize" // Entries. It will automatically grow if need be. ~DOMNodeIDMap(); private: DOMNodeIDMap(const DOMNodeIDMap &other); // No copy, assignement, comparison. DOMNodeIDMap &operator = (const DOMNodeIDMap &other); bool operator == (const DOMNodeIDMap &other); public: void add(DOMAttr *attr); // Add the specified attribute to the table. void remove(DOMAttr *other); // Remove the specified attribute. // Does nothing if the node is not in the table. DOMAttr *find(const XMLCh *ID); // Find the attribute node in the table with this ID private: void growTable(); private: DOMAttr **fTable; XMLSize_t fSizeIndex; // Index of the current table size in the // array of possible table sizes. XMLSize_t fSize; // The current size of the table array // (number of slots, not bytes.) XMLSize_t fNumEntries; // The number of entries used. XMLSize_t fMaxEntries; // The max number of entries to use before // growing the table. DOMDocument *fDoc; // The owning document. }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMNamedNodeMapImpl.hpp000644 000765 000024 00000005631 13241160337 024176 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNamedNodeMapImpl.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMNAMEDNODEMAPIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMNAMEDNODEMAPIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMNodeVector; class DOMNode; #define MAP_SIZE 193 class CDOM_EXPORT DOMNamedNodeMapImpl: public DOMNamedNodeMap { protected: DOMNodeVector* fBuckets[MAP_SIZE]; DOMNode* fOwnerNode; // the node this map belongs to //bool fReadOnly; // revisit - flag on owner node instead? bool readOnly(); // revisit. Look at owner node read-only. public: DOMNamedNodeMapImpl(DOMNode *ownerNode); virtual ~DOMNamedNodeMapImpl(); virtual DOMNamedNodeMapImpl *cloneMap(DOMNode *ownerNode); virtual void setReadOnly(bool readOnly, bool deep); virtual XMLSize_t getLength() const; virtual DOMNode* item(XMLSize_t index) const; virtual DOMNode* getNamedItem(const XMLCh *name) const; virtual DOMNode* setNamedItem(DOMNode *arg); virtual DOMNode* removeNamedItem(const XMLCh *name); //Introduced in DOM Level 2 virtual DOMNode* getNamedItemNS(const XMLCh *namespaceURI, const XMLCh *localName) const; virtual DOMNode* setNamedItemNS(DOMNode *arg); virtual DOMNode* removeNamedItemNS(const XMLCh *namespaceURI, const XMLCh *localName); private: // unimplemented DOMNamedNodeMapImpl(const DOMNamedNodeMapImpl &); DOMNamedNodeMapImpl & operator = (const DOMNamedNodeMapImpl &); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMElementNSImpl.hpp000644 000765 000024 00000006765 13241160337 023551 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMElementNSImpl.hpp 678709 2008-07-22 10:56:56Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMELEMENTNSIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMELEMENTNSIMPL_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include "DOMElementImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN class DOMTypeInfoImpl; class CDOM_EXPORT DOMElementNSImpl: public DOMElementImpl { protected: //Introduced in DOM Level 2 const XMLCh * fNamespaceURI; //namespace URI of this node const XMLCh * fLocalName; //local part of qualified name const XMLCh * fPrefix; const DOMTypeInfoImpl *fSchemaType; public: DOMElementNSImpl(DOMDocument *ownerDoc, const XMLCh *name); DOMElementNSImpl(DOMDocument *ownerDoc, //DOM Level 2 const XMLCh *namespaceURI, const XMLCh *qualifiedName); DOMElementNSImpl(const DOMElementNSImpl &other, bool deep=false); // Fast construction without any checks for name validity. Used in // parsing. // DOMElementNSImpl(DOMDocument *ownerDoc, const XMLCh *namespaceURI, const XMLCh *prefix, // Null or empty - no prefix. const XMLCh *localName, const XMLCh *qualifiedName); virtual DOMNode * cloneNode(bool deep) const; virtual bool isSupported(const XMLCh *feature, const XMLCh *version) const; virtual void* getFeature(const XMLCh* feature, const XMLCh* version) const; //Introduced in DOM Level 2 virtual const XMLCh *getNamespaceURI() const; virtual const XMLCh *getPrefix() const; virtual const XMLCh *getLocalName() const; virtual void setPrefix(const XMLCh *prefix); virtual void release(); //Introduced in DOM Level 3 virtual const DOMTypeInfo * getSchemaTypeInfo() const; // helper function for DOM Level 3 renameNode virtual DOMNode* rename(const XMLCh* namespaceURI, const XMLCh* name); void setName(const XMLCh* namespaceURI, const XMLCh* name); //helper function for DOM Level 3 TypeInfo virtual void setSchemaTypeInfo(const DOMTypeInfoImpl* typeInfo); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DOMElementNSImpl & operator = (const DOMElementNSImpl &); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMElementImpl.cpp000644 000765 000024 00000070265 13241160337 023277 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMElementImpl.cpp 1800911 2017-07-05 18:52:15Z scantor $ */ #include "DOMElementImpl.hpp" #include #include #include #include #include #include "DOMAttrMapImpl.hpp" #include "DOMAttrImpl.hpp" #include "DOMDocumentImpl.hpp" #include "DOMParentNode.hpp" #include "DOMCasts.hpp" #include "DOMElementNSImpl.hpp" #include "DOMTypeInfoImpl.hpp" #include "DOMDocumentTypeImpl.hpp" #include XERCES_CPP_NAMESPACE_BEGIN class DOMAttr; DOMElementImpl::DOMElementImpl(DOMDocument *ownerDoc, const XMLCh *eName) : fNode(this, ownerDoc), fParent(this, ownerDoc), fAttributes(0), fDefaultAttributes(0) { DOMDocumentImpl *docImpl = (DOMDocumentImpl *)ownerDoc; fName = docImpl->getPooledString(eName); setupDefaultAttributes(); if (!fDefaultAttributes) { fDefaultAttributes = new (docImpl) DOMAttrMapImpl(this); fAttributes = new (docImpl) DOMAttrMapImpl(this); } else { fAttributes = new (docImpl) DOMAttrMapImpl(this, fDefaultAttributes); } } DOMElementImpl::DOMElementImpl(const DOMElementImpl &other, bool deep) : DOMElement(other), fNode(this, other.fParent.fOwnerDocument), fParent(this, other.fParent.fOwnerDocument), fAttributes(0), fDefaultAttributes(0) { fName = other.fName; if (deep) fParent.cloneChildren(&other); if (other.getAttributes()) { fAttributes = ((DOMAttrMapImpl *)other.getAttributes())->cloneAttrMap(this); } if (other.getDefaultAttributes()) { fDefaultAttributes = ((DOMAttrMapImpl *)other.getDefaultAttributes())->cloneAttrMap(this); } if (!fDefaultAttributes) setupDefaultAttributes(); if (!fDefaultAttributes) fDefaultAttributes = new (fParent.fOwnerDocument) DOMAttrMapImpl(this); if (!fAttributes) { if (!fDefaultAttributes) { fAttributes = new (fParent.fOwnerDocument) DOMAttrMapImpl(this); } else { fAttributes = new (fParent.fOwnerDocument) DOMAttrMapImpl(this, fDefaultAttributes); } } } DOMElementImpl::~DOMElementImpl() { } DOMNode *DOMElementImpl::cloneNode(bool deep) const { DOMNode* newNode = new (fParent.fOwnerDocument, DOMMemoryManager::ELEMENT_OBJECT) DOMElementImpl(*this, deep); fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode); return newNode; } const XMLCh * DOMElementImpl::getNodeName() const { return fName; } DOMNode::NodeType DOMElementImpl::getNodeType() const { return DOMNode::ELEMENT_NODE; } const XMLCh * DOMElementImpl::getAttribute(const XMLCh *nam) const { DOMNode * attr = fAttributes->getNamedItem(nam); if (attr) return attr->getNodeValue(); return XMLUni::fgZeroLenString; } DOMAttr *DOMElementImpl::getAttributeNode(const XMLCh *nam) const { return (DOMAttr *)fAttributes->getNamedItem(nam); } DOMNamedNodeMap *DOMElementImpl::getAttributes() const { DOMElementImpl *ncThis = (DOMElementImpl *)this; // cast off const return ncThis->fAttributes; } DOMNodeList *DOMElementImpl::getElementsByTagName(const XMLCh *tagname) const { DOMDocumentImpl *docImpl = (DOMDocumentImpl *)fParent.fOwnerDocument; return docImpl->getDeepNodeList(this,tagname); } const XMLCh * DOMElementImpl::getTagName() const { return fName; } void DOMElementImpl::removeAttribute(const XMLCh *nam) { if (fNode.isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); int i = fAttributes->findNamePoint(nam); if (i >= 0) { DOMNode *att = fAttributes->removeNamedItemAt(i); ((DOMAttrImpl *)att)->removeAttrFromIDNodeMap(); att->release(); } } DOMAttr *DOMElementImpl::removeAttributeNode(DOMAttr *oldAttr) { if (fNode.isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); DOMNode* found = 0; // Since there is no removeAttributeNodeNS, check if this oldAttr has NS or not const XMLCh* localName = oldAttr->getLocalName(); int i = 0; if (localName) i = fAttributes->findNamePoint(oldAttr->getNamespaceURI(), localName); else i = fAttributes->findNamePoint(oldAttr->getName()); if (i >= 0) { // If it is in fact the right object, remove it. found = fAttributes->item(i); if (found == oldAttr) { fAttributes->removeNamedItemAt(i); ((DOMAttrImpl *)oldAttr)->removeAttrFromIDNodeMap(); } else throw DOMException(DOMException::NOT_FOUND_ERR, 0, GetDOMNodeMemoryManager); } else throw DOMException(DOMException::NOT_FOUND_ERR, 0, GetDOMNodeMemoryManager); return (DOMAttr *)found; } void DOMElementImpl::setAttribute(const XMLCh *nam, const XMLCh *val) { if (fNode.isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); DOMAttr* newAttr = getAttributeNode(nam); if (!newAttr) { newAttr = fParent.fOwnerDocument->createAttribute(nam); fAttributes->setNamedItem(newAttr); } newAttr->setNodeValue(val); } void DOMElementImpl::setIdAttribute(const XMLCh* name, bool isId) { if (fNode.isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); DOMAttr *attr = getAttributeNode(name); if (!attr) throw DOMException(DOMException::NOT_FOUND_ERR, 0, GetDOMNodeMemoryManager); if(isId) ((DOMAttrImpl *)attr)->addAttrToIDNodeMap(); else ((DOMAttrImpl *)attr)->removeAttrFromIDNodeMap(); } void DOMElementImpl::setIdAttributeNS(const XMLCh* namespaceURI, const XMLCh* localName, bool isId) { if (fNode.isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); DOMAttr *attr = getAttributeNodeNS(namespaceURI, localName); if (!attr) throw DOMException(DOMException::NOT_FOUND_ERR, 0, GetDOMNodeMemoryManager); if(isId) ((DOMAttrImpl *)attr)->addAttrToIDNodeMap(); else ((DOMAttrImpl *)attr)->removeAttrFromIDNodeMap(); } void DOMElementImpl::setIdAttributeNode(const DOMAttr *idAttr, bool isId) { if (fNode.isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); DOMAttr *attr; const XMLCh* localName = idAttr->getLocalName(); if (localName) attr = getAttributeNodeNS(idAttr->getNamespaceURI(), idAttr->getLocalName()); else attr = getAttributeNode(idAttr->getName()); if(!attr) throw DOMException(DOMException::NOT_FOUND_ERR, 0, GetDOMNodeMemoryManager); if(isId) ((DOMAttrImpl *)attr)->addAttrToIDNodeMap(); else ((DOMAttrImpl *)attr)->removeAttrFromIDNodeMap(); } DOMAttr * DOMElementImpl::setAttributeNode(DOMAttr *newAttr) { if (fNode.isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); if (newAttr->getNodeType() != DOMNode::ATTRIBUTE_NODE) throw DOMException(DOMException::WRONG_DOCUMENT_ERR, 0, GetDOMNodeMemoryManager); // revisit. Exception doesn't match test. // This will throw INUSE if necessary DOMAttr *oldAttr = (DOMAttr *) fAttributes->setNamedItem(newAttr); return oldAttr; } void DOMElementImpl::setNodeValue(const XMLCh *x) { fNode.setNodeValue(x); } void DOMElementImpl::setReadOnly(bool readOnl, bool deep) { fNode.setReadOnly(readOnl,deep); fAttributes->setReadOnly(readOnl,true); } //Introduced in DOM Level 2 const XMLCh * DOMElementImpl::getAttributeNS(const XMLCh *fNamespaceURI, const XMLCh *fLocalName) const { DOMAttr * attr= (DOMAttr *)(fAttributes->getNamedItemNS(fNamespaceURI, fLocalName)); return (attr==0) ? XMLUni::fgZeroLenString : attr->getValue(); } void DOMElementImpl::setAttributeNS(const XMLCh *fNamespaceURI, const XMLCh *qualifiedName, const XMLCh *fValue) { if (fNode.isReadOnly()) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); int index = DOMDocumentImpl::indexofQualifiedName(qualifiedName); if (index < 0) throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager); DOMAttr* newAttr = getAttributeNodeNS(fNamespaceURI, qualifiedName+index); if (!newAttr) { newAttr = fParent.fOwnerDocument->createAttributeNS(fNamespaceURI, qualifiedName); fAttributes->setNamedItemNS(newAttr); } newAttr->setNodeValue(fValue); } void DOMElementImpl::removeAttributeNS(const XMLCh *fNamespaceURI, const XMLCh *fLocalName) { if (fNode.isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); int i = fAttributes->findNamePoint(fNamespaceURI, fLocalName); if (i >= 0) { DOMNode *att = fAttributes->removeNamedItemAt(i); att->release(); } } DOMAttr *DOMElementImpl::getAttributeNodeNS(const XMLCh *fNamespaceURI, const XMLCh *fLocalName) const { return (DOMAttr *)fAttributes->getNamedItemNS(fNamespaceURI, fLocalName); } DOMAttr *DOMElementImpl::setAttributeNodeNS(DOMAttr *newAttr) { if (fNode.isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); if (newAttr -> getOwnerDocument() != fParent.fOwnerDocument) throw DOMException(DOMException::WRONG_DOCUMENT_ERR, 0, GetDOMNodeMemoryManager); // This will throw INUSE if necessary DOMAttr *oldAttr = (DOMAttr *) fAttributes->setNamedItemNS(newAttr); return oldAttr; } DOMNodeList *DOMElementImpl::getElementsByTagNameNS(const XMLCh *namespaceURI, const XMLCh *localName) const { DOMDocumentImpl *docImpl = (DOMDocumentImpl *)fParent.fOwnerDocument; return docImpl->getDeepNodeList(this, namespaceURI, localName); } bool DOMElementImpl::hasAttributes() const { return (fAttributes != 0 && fAttributes->getLength() != 0); } bool DOMElementImpl::hasAttribute(const XMLCh *name) const { return (getAttributeNode(name) != 0); } bool DOMElementImpl::hasAttributeNS(const XMLCh *namespaceURI, const XMLCh *localName) const { return (getAttributeNodeNS(namespaceURI, localName) != 0); } // util functions for default attributes // returns the default attribute map for this node from the owner document DOMAttrMapImpl *DOMElementImpl::getDefaultAttributes() const { return fDefaultAttributes; } // initially set up the default attribute information based on doctype information void DOMElementImpl::setupDefaultAttributes() { DOMDocument *tmpdoc = fParent.fOwnerDocument; if ((fNode.fOwnerNode == 0) || (tmpdoc == 0) || (tmpdoc->getDoctype() == 0)) return; DOMNode *eldef = ((DOMDocumentTypeImpl*)tmpdoc->getDoctype())->getElements()->getNamedItem(getNodeName()); DOMAttrMapImpl* defAttrs = (eldef == 0) ? 0 : (DOMAttrMapImpl *)(eldef->getAttributes()); if (defAttrs) fDefaultAttributes = new (tmpdoc) DOMAttrMapImpl(this, defAttrs); } DOMAttr * DOMElementImpl::setDefaultAttributeNode(DOMAttr *newAttr) { if (fNode.isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); if (newAttr->getNodeType() != DOMNode::ATTRIBUTE_NODE) throw DOMException(DOMException::WRONG_DOCUMENT_ERR, 0, GetDOMNodeMemoryManager); // revisit. Exception doesn't match test. // This will throw INUSE if necessary DOMAttr *oldAttr = (DOMAttr *) fDefaultAttributes->setNamedItem(newAttr); fAttributes->hasDefaults(true); return oldAttr; } DOMAttr *DOMElementImpl::setDefaultAttributeNodeNS(DOMAttr *newAttr) { if (fNode.isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager); if (newAttr -> getOwnerDocument() != fParent.fOwnerDocument) throw DOMException(DOMException::WRONG_DOCUMENT_ERR, 0, GetDOMNodeMemoryManager); // This will throw INUSE if necessary DOMAttr *oldAttr = (DOMAttr *) fDefaultAttributes->setNamedItemNS(newAttr); fAttributes->hasDefaults(true); return oldAttr; } void DOMElementImpl::release() { if (fNode.isOwned() && !fNode.isToBeReleased()) throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); DOMDocumentImpl* doc = (DOMDocumentImpl*) fParent.fOwnerDocument; if (doc) { fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0); // release children fParent.release(); // release attributes fAttributes->hasDefaults(false); XMLSize_t count; while((count = fAttributes->getLength()) != 0) { DOMNode* attr = fAttributes->removeNamedItemAt(count-1); attr->release(); } doc->release(this, DOMMemoryManager::ELEMENT_OBJECT); } else { // shouldn't reach here throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); } } const XMLCh* DOMElementImpl::getBaseURI() const { const XMLCh* baseURI = fNode.fOwnerNode->getBaseURI(); if (fAttributes) { const XMLCh baseString[] = { chLatin_b, chLatin_a, chLatin_s, chLatin_e, chNull }; DOMNode* attrNode = fAttributes->getNamedItemNS(DOMNodeImpl::getXmlURIString(), baseString); if (attrNode==NULL) { const XMLCh xmlBaseString[] = { chLatin_x, chLatin_m, chLatin_l, chColon, chLatin_b, chLatin_a, chLatin_s, chLatin_e, chNull }; attrNode = fAttributes->getNamedItem(xmlBaseString); } if (attrNode) { const XMLCh* uri = attrNode->getNodeValue(); if (uri && *uri) {// attribute value is always empty string // if there is a base URI for the parent node, use it to resolve relative URI if(baseURI) { try { DOMDocumentImpl* doc = (DOMDocumentImpl *)fParent.fOwnerDocument; XMLUri temp(baseURI, doc->getMemoryManager()); XMLUri temp2(&temp, uri, doc->getMemoryManager()); uri = doc->cloneString(temp2.getUriText()); } catch(const OutOfMemoryException&) { throw; } catch (...){ // REVISIT: what should happen in this case? return 0; } } return uri; } } } return baseURI; } // // Functions inherited from Node // DOMNode* DOMElementImpl::appendChild(DOMNode *newChild) {return fParent.appendChild (newChild); } DOMNodeList* DOMElementImpl::getChildNodes() const {return fParent.getChildNodes (); } DOMNode* DOMElementImpl::getFirstChild() const {return fParent.getFirstChild (); } DOMNode* DOMElementImpl::getLastChild() const {return fParent.getLastChild (); } const XMLCh* DOMElementImpl::getLocalName() const {return fNode.getLocalName (); } const XMLCh* DOMElementImpl::getNamespaceURI() const {return fNode.getNamespaceURI (); } DOMNode* DOMElementImpl::getNextSibling() const {return fChild.getNextSibling (); } const XMLCh* DOMElementImpl::getNodeValue() const {return fNode.getNodeValue (); } DOMDocument* DOMElementImpl::getOwnerDocument() const {return fParent.fOwnerDocument; } const XMLCh* DOMElementImpl::getPrefix() const {return fNode.getPrefix (); } DOMNode* DOMElementImpl::getParentNode() const {return fChild.getParentNode (this); } DOMNode* DOMElementImpl::getPreviousSibling() const {return fChild.getPreviousSibling (this); } bool DOMElementImpl::hasChildNodes() const {return fParent.hasChildNodes (); } DOMNode* DOMElementImpl::insertBefore(DOMNode *newChild, DOMNode *refChild) {return fParent.insertBefore (newChild, refChild); } void DOMElementImpl::normalize() {fParent.normalize (); } DOMNode* DOMElementImpl::removeChild(DOMNode *oldChild) {return fParent.removeChild (oldChild); } DOMNode* DOMElementImpl::replaceChild(DOMNode *newChild, DOMNode *oldChild) {return fParent.replaceChild (newChild, oldChild); } bool DOMElementImpl::isSupported(const XMLCh *feature, const XMLCh *version) const {return fNode.isSupported (feature, version); } void DOMElementImpl::setPrefix(const XMLCh *prefix) {fNode.setPrefix(prefix); } bool DOMElementImpl::isSameNode(const DOMNode* other) const {return fNode.isSameNode(other); } void* DOMElementImpl::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) {return fNode.setUserData(key, data, handler); } void* DOMElementImpl::getUserData(const XMLCh* key) const {return fNode.getUserData(key); } short DOMElementImpl::compareDocumentPosition(const DOMNode* other) const {return fNode.compareDocumentPosition(other); } const XMLCh* DOMElementImpl::getTextContent() const {return fNode.getTextContent(); } void DOMElementImpl::setTextContent(const XMLCh* textContent){fNode.setTextContent(textContent); } const XMLCh* DOMElementImpl::lookupPrefix(const XMLCh* namespaceURI) const {return fNode.lookupPrefix(namespaceURI); } bool DOMElementImpl::isDefaultNamespace(const XMLCh* namespaceURI) const {return fNode.isDefaultNamespace(namespaceURI); } const XMLCh* DOMElementImpl::lookupNamespaceURI(const XMLCh* prefix) const {return fNode.lookupNamespaceURI(prefix); } void* DOMElementImpl::getFeature(const XMLCh* feature, const XMLCh* version) const {return fNode.getFeature(feature, version); } // Macro-in implementation accessors. DOMNODEIMPL_IMPL(DOMElementImpl); DOMPARENTIMPL_IMPL(DOMElementImpl); DOMCHILDIMPL_IMPL(DOMElementImpl); bool DOMElementImpl::isEqualNode(const DOMNode* arg) const { if (isSameNode(arg)) { return true; } if (!fNode.isEqualNode(arg)) { return false; } bool hasAttrs = hasAttributes(); if (hasAttrs != arg->hasAttributes()) { return false; } if (hasAttrs) { DOMNamedNodeMap* map1 = getAttributes(); DOMNamedNodeMap* map2 = arg->getAttributes(); XMLSize_t len = map1->getLength(); if (len != map2->getLength()) { return false; } for (XMLSize_t i = 0; i < len; i++) { DOMNode* n1 = map1->item(i); if (!n1->getLocalName()) { // DOM Level 1 Node DOMNode* n2 = map2->getNamedItem(n1->getNodeName()); if (!n2 || !n1->isEqualNode(n2)) { return false; } } else { DOMNode* n2 = map2->getNamedItemNS(n1->getNamespaceURI(), n1->getLocalName()); if (!n2 || !n1->isEqualNode(n2)) { return false; } } } } return fParent.isEqualNode(arg); } DOMNode* DOMElementImpl::rename(const XMLCh* namespaceURI, const XMLCh* name) { DOMDocumentImpl* doc = (DOMDocumentImpl*) fParent.fOwnerDocument; if (!namespaceURI || !*namespaceURI) { fName = doc->getPooledString(name); fAttributes->reconcileDefaultAttributes(getDefaultAttributes()); // and fire user data NODE_RENAMED event castToNodeImpl(this)->callUserDataHandlers(DOMUserDataHandler::NODE_RENAMED, this, this); return this; } else { // create a new ElementNS DOMElementNSImpl* newElem = (DOMElementNSImpl*)doc->createElementNS(namespaceURI, name); // transfer the userData doc->transferUserData(castToNodeImpl(this), castToNodeImpl(newElem)); // remove old node from parent if any DOMNode* parent = getParentNode(); DOMNode* nextSib = getNextSibling(); if (parent) { parent->removeChild(this); } // move children to new node DOMNode* child = getFirstChild(); while (child) { removeChild(child); newElem->appendChild(child); child = getFirstChild(); } // insert new node where old one was if (parent) { parent->insertBefore(newElem, nextSib); } // move specified attributes to new node newElem->fAttributes->moveSpecifiedAttributes(fAttributes); // and fire user data NODE_RENAMED event castToNodeImpl(newElem)->callUserDataHandlers(DOMUserDataHandler::NODE_RENAMED, this, newElem); return newElem; } } const DOMTypeInfo *DOMElementImpl::getSchemaTypeInfo() const { return &DOMTypeInfoImpl::g_DtdValidatedElement; } // DOMElementTraversal DOMElement * DOMElementImpl::getFirstElementChild() const { DOMNode* n = getFirstChild(); while (n != NULL) { switch (n->getNodeType()) { case DOMNode::ELEMENT_NODE: return (DOMElement*) n; case DOMNode::ENTITY_REFERENCE_NODE: { DOMElement* e = getFirstElementChild(n); if (e != NULL) return e; } break; default: break; } n = n->getNextSibling(); } return NULL; } DOMElement * DOMElementImpl::getLastElementChild() const { DOMNode* n = getLastChild(); while (n != NULL) { switch (n->getNodeType()) { case DOMNode::ELEMENT_NODE: return (DOMElement*) n; case DOMNode::ENTITY_REFERENCE_NODE: { DOMElement* e = getLastElementChild(n); if (e != NULL) return e; } break; default: break; } n = n->getPreviousSibling(); } return NULL; } DOMElement * DOMElementImpl::getNextElementSibling() const { DOMNode* n = getNextLogicalSibling(this); while (n != NULL) { switch (n->getNodeType()) { case DOMNode::ELEMENT_NODE: return (DOMElement*) n; case DOMNode::ENTITY_REFERENCE_NODE: { DOMElement* e = getFirstElementChild(n); if (e != NULL) return e; } break; default: break; } n = getNextLogicalSibling(n); } return NULL; } DOMElement * DOMElementImpl::getPreviousElementSibling() const { DOMNode* n = getPreviousLogicalSibling(this); while (n != NULL) { switch (n->getNodeType()) { case DOMNode::ELEMENT_NODE: return (DOMElement*) n; case DOMNode::ENTITY_REFERENCE_NODE: { DOMElement* e = getLastElementChild(n); if (e != NULL) return e; } break; default: break; } n = getPreviousLogicalSibling(n); } return NULL; } XMLSize_t DOMElementImpl::getChildElementCount() const { XMLSize_t count = 0; DOMElement* child = getFirstElementChild(); while (child != NULL) { ++count; child = child->getNextElementSibling(); } return count; } // Returns the first element node found from a // non-recursive in order traversal of the given node. DOMElement* DOMElementImpl::getFirstElementChild(const DOMNode* n) const { const DOMNode* top = n; while (n != NULL) { if (n->getNodeType() == DOMNode::ELEMENT_NODE) { return (DOMElement*) n; } DOMNode* next = n->getFirstChild(); while (next == NULL) { if (top == n) { break; } next = n->getNextSibling(); if (next == NULL) { n = n->getParentNode(); if (n == NULL || top == n) { return NULL; } } } n = next; } return NULL; } // Returns the first element node found from a // non-recursive reverse order traversal of the given node. DOMElement* DOMElementImpl::getLastElementChild(const DOMNode* n) const { const DOMNode* top = n; while (n != NULL) { if (n->getNodeType() == DOMNode::ELEMENT_NODE) { return (DOMElement*) n; } DOMNode* next = n->getLastChild(); while (next == NULL) { if (top == n) { break; } next = n->getPreviousSibling(); if (next == NULL) { n = n->getParentNode(); if (n == NULL || top == n) { return NULL; } } } n = next; } return NULL; } // Returns the next logical sibling with respect to the given node. DOMNode* DOMElementImpl::getNextLogicalSibling(const DOMNode* n) const { DOMNode* next = n->getNextSibling(); // If "n" has no following sibling and its parent is an entity reference node we // need to continue the search through the following siblings of the entity // reference as these are logically siblings of the given node. if (next == NULL) { DOMNode* parent = n->getParentNode(); while (parent != NULL && parent->getNodeType() == DOMNode::ENTITY_REFERENCE_NODE) { next = parent->getNextSibling(); if (next != NULL) { break; } parent = parent->getParentNode(); } } return next; } // Returns the previous logical sibling with respect to the given node. DOMNode* DOMElementImpl::getPreviousLogicalSibling(const DOMNode* n) const { DOMNode* prev = n->getPreviousSibling(); // If "n" has no previous sibling and its parent is an entity reference node we // need to continue the search through the previous siblings of the entity // reference as these are logically siblings of the given node. if (prev == NULL) { DOMNode* parent = n->getParentNode(); while (parent != NULL && parent->getNodeType() == DOMNode::ENTITY_REFERENCE_NODE) { prev = parent->getPreviousSibling(); if (prev != NULL) { break; } parent = parent->getParentNode(); } } return prev; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMNodeIteratorImpl.cpp000644 000765 000024 00000024557 13241160337 024310 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNodeIteratorImpl.cpp 671894 2008-06-26 13:29:21Z borisk $ */ ////////////////////////////////////////////////////////////////////// // DOMNodeIteratorImpl.cpp: implementation of the DOMNodeIteratorImpl class. // ////////////////////////////////////////////////////////////////////// #include "DOMNodeIteratorImpl.hpp" #include "DOMDocumentImpl.hpp" #include #include XERCES_CPP_NAMESPACE_BEGIN ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// DOMNodeIteratorImpl::DOMNodeIteratorImpl (DOMDocument* doc, DOMNode* root, DOMNodeFilter::ShowType whatToShow, DOMNodeFilter* nodeFilter, bool expandEntityRef) : fRoot(root), fDocument(doc), fWhatToShow(whatToShow), fNodeFilter(nodeFilter), fExpandEntityReferences(expandEntityRef), fDetached(false), fCurrentNode(0), fForward(true) { } DOMNodeIteratorImpl::DOMNodeIteratorImpl ( const DOMNodeIteratorImpl& toCopy) : DOMNodeIterator(toCopy), fRoot(toCopy.fRoot), fDocument(toCopy.fDocument), fWhatToShow(toCopy.fWhatToShow), fNodeFilter(toCopy.fNodeFilter), fExpandEntityReferences(toCopy.fExpandEntityReferences), fDetached(toCopy.fDetached), fCurrentNode(toCopy.fCurrentNode), fForward(toCopy.fForward) { } DOMNodeIteratorImpl& DOMNodeIteratorImpl::operator= (const DOMNodeIteratorImpl& other) { fRoot = other.fRoot; fCurrentNode = other.fRoot; fWhatToShow = other.fWhatToShow; fNodeFilter = other.fNodeFilter; fForward = other.fForward; fDetached = other.fDetached; fExpandEntityReferences = other.fExpandEntityReferences; fDocument = other.fDocument; return *this; } DOMNodeIteratorImpl::~DOMNodeIteratorImpl () { fDetached = false; } void DOMNodeIteratorImpl::detach () { fDetached = true; ((DOMDocumentImpl *)fDocument)->removeNodeIterator(this); } DOMNode* DOMNodeIteratorImpl::getRoot() { return fRoot; } // Implementation Note: Note that the iterator looks at whatToShow // and filter values at each call, and therefore one _could_ add // setters for these values and alter them while iterating! /** Return the whatToShow value */ DOMNodeFilter::ShowType DOMNodeIteratorImpl::getWhatToShow () { return fWhatToShow; } /** Return the filter */ DOMNodeFilter* DOMNodeIteratorImpl::getFilter () { return fNodeFilter; } /** Get the expandEntity reference flag. */ bool DOMNodeIteratorImpl::getExpandEntityReferences() { return fExpandEntityReferences; } /** Return the next DOMNode* in the Iterator. The node is the next node in * depth-first order which also passes the filter, and whatToShow. * A 0 return means either that */ DOMNode* DOMNodeIteratorImpl::nextNode () { if (fDetached) throw DOMException(DOMException::INVALID_STATE_ERR, 0, GetDOMNodeIteratorMemoryManager); // if root is 0 there is no next node-> if (!fRoot) return 0; DOMNode* aNextNode = fCurrentNode; bool accepted = false; // the next node has not been accepted. while (!accepted) { // if last direction is not forward, repeat node-> if (!fForward && (aNextNode != 0)) { //System.out.println("nextNode():!fForward:"+fCurrentNode.getNodeName()); aNextNode = fCurrentNode; } else { // else get the next node via depth-first aNextNode = nextNode(aNextNode, true); } fForward = true; //REVIST: should direction be set forward before 0 check? // nothing in the list. return 0. if (!aNextNode) return 0; // does node pass the filters and whatToShow? accepted = acceptNode(aNextNode); if (accepted) { // if so, then the node is the current node-> fCurrentNode = aNextNode; return fCurrentNode; } } // no nodes, or no accepted nodes. return 0; } /** Return the previous Node in the Iterator. The node is the next node in * _backwards_ depth-first order which also passes the filter, and whatToShow. */ DOMNode* DOMNodeIteratorImpl::previousNode () { if (fDetached) throw DOMException(DOMException::INVALID_STATE_ERR, 0, GetDOMNodeIteratorMemoryManager); // if the root is 0, or the current node is 0, return 0. if (!fRoot || !fCurrentNode) return 0; DOMNode* aPreviousNode = fCurrentNode; bool accepted = false; while (!accepted) { if (fForward && (aPreviousNode != 0)) { //repeat last node-> aPreviousNode = fCurrentNode; } else { // get previous node in backwards depth first order. aPreviousNode = previousNode(aPreviousNode); } // we are going backwards fForward = false; // if the new previous node is 0, we're at head or past the root, // so return 0. if (!aPreviousNode) return 0; // check if node passes filters and whatToShow. accepted = acceptNode(aPreviousNode); if (accepted) { // if accepted, update the current node, and return it. fCurrentNode = aPreviousNode; return fCurrentNode; } } // there are no nodes? return 0; } /** The node is accepted if it passes the whatToShow and the filter. */ bool DOMNodeIteratorImpl::acceptNode (DOMNode* node) { if (fDetached) throw DOMException(DOMException::INVALID_STATE_ERR, 0, GetDOMNodeIteratorMemoryManager); if (fNodeFilter == 0) { return ((fWhatToShow & (1 << (node->getNodeType() - 1))) != 0); } else { return ((fWhatToShow & (1 << (node->getNodeType() - 1))) != 0) && fNodeFilter->acceptNode(node) == DOMNodeFilter::FILTER_ACCEPT; } } /** Return node, if matches or any parent if matches. */ DOMNode* DOMNodeIteratorImpl::matchNodeOrParent (DOMNode* node) { for (DOMNode* n = fCurrentNode; n != fRoot; n = n->getParentNode()) { if (node == n) return n; } return 0; } /** The method nextNode(DOMNode, bool) returns the next node * from the actual DOM tree. * * The bool visitChildren determines whether to visit the children. * The result is the nextNode. */ DOMNode* DOMNodeIteratorImpl::nextNode (DOMNode* node, bool visitChildren) { if (fDetached) throw DOMException(DOMException::INVALID_STATE_ERR, 0, GetDOMNodeIteratorMemoryManager); if (!node) return fRoot; DOMNode* result = 0; // only check children if we visit children. if (visitChildren) { //if hasChildren, return 1st child. if ((fExpandEntityReferences || node->getNodeType()!=DOMNode::ENTITY_REFERENCE_NODE) && node->hasChildNodes()) { result = node->getFirstChild(); return result; } } // if hasSibling, return sibling if (node != fRoot) { result = node->getNextSibling(); if (result != 0) return result; // return parent's 1st sibling. DOMNode* parent = node->getParentNode(); while ((parent != 0) && parent != fRoot) { result = parent->getNextSibling(); if (result != 0) { return result; } else { parent = parent->getParentNode(); } } // while (parent != 0 && parent != fRoot) { } // end of list, return 0 return 0; } /** The method previousNode(DOMNode) returns the previous node * from the actual DOM tree. */ DOMNode* DOMNodeIteratorImpl::previousNode (DOMNode* node) { if (fDetached) throw DOMException(DOMException::INVALID_STATE_ERR, 0, GetDOMNodeIteratorMemoryManager); DOMNode* result = 0; // if we're at the root, return 0. if (node == fRoot) return 0; // get sibling result = node->getPreviousSibling(); if (!result) { //if 1st sibling, return parent result = node->getParentNode(); return result; } // if sibling has children, keep getting last child of child. if (result->hasChildNodes()) { while ((fExpandEntityReferences || result->getNodeType()!=DOMNode::ENTITY_REFERENCE_NODE) && result->hasChildNodes()) { result = result->getLastChild(); } } return result; } /** Fix-up the iterator on a remove. Called by DOM or otherwise, * before an actual DOM remove. */ void DOMNodeIteratorImpl::removeNode (DOMNode* node) { if (fDetached) throw DOMException(DOMException::INVALID_STATE_ERR, 0, GetDOMNodeIteratorMemoryManager); // Implementation note: Fix-up means setting the current node properly // after a remove. if (!node) return; DOMNode* deleted = matchNodeOrParent(node); if (!deleted) return; if (fForward) { fCurrentNode = previousNode(deleted); } else // if (!fForward) { DOMNode* next = nextNode(deleted, false); if (next != 0) { // normal case: there _are_ nodes following this in the iterator. fCurrentNode = next; } else { // the last node in the iterator is to be removed, // so we set the current node to be the previous one. fCurrentNode = previousNode(deleted); fForward = true; } } } void DOMNodeIteratorImpl::release() { detach(); // for performance reason, do not recycle pointer // chance that this is allocated again and again is not usual } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMTreeWalkerImpl.cpp000644 000765 000024 00000027022 13241160337 023744 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMTreeWalkerImpl.cpp 671894 2008-06-26 13:29:21Z borisk $ */ #include "DOMTreeWalkerImpl.hpp" #include "DOMDocumentImpl.hpp" #include #include XERCES_CPP_NAMESPACE_BEGIN /** constructor */ DOMTreeWalkerImpl::DOMTreeWalkerImpl ( DOMNode* root, DOMNodeFilter::ShowType whatToShow, DOMNodeFilter* nodeFilter, bool expandEntityRef) : fWhatToShow(whatToShow), fNodeFilter(nodeFilter), fCurrentNode(root), fRoot(root), fExpandEntityReferences(expandEntityRef) { } DOMTreeWalkerImpl::DOMTreeWalkerImpl (const DOMTreeWalkerImpl& twi) : DOMTreeWalker(twi), fWhatToShow(twi.fWhatToShow), fNodeFilter(twi.fNodeFilter), fCurrentNode(twi.fCurrentNode), fRoot(twi.fRoot), fExpandEntityReferences(twi.fExpandEntityReferences) { } DOMTreeWalkerImpl& DOMTreeWalkerImpl::operator= (const DOMTreeWalkerImpl& twi) { if (this != &twi) { fCurrentNode = twi.fCurrentNode; fRoot = twi.fRoot; fWhatToShow = twi.fWhatToShow; fNodeFilter = twi.fNodeFilter; fExpandEntityReferences = twi.fExpandEntityReferences; } return *this; } /** Return the root node */ DOMNode* DOMTreeWalkerImpl::getRoot () { return fRoot; } /** Return the whatToShow value */ DOMNodeFilter::ShowType DOMTreeWalkerImpl::getWhatToShow () { return fWhatToShow; } /** Return the NodeFilter */ DOMNodeFilter* DOMTreeWalkerImpl::getFilter () { return fNodeFilter; } /** Get the expandEntity reference flag. */ bool DOMTreeWalkerImpl::getExpandEntityReferences() { return fExpandEntityReferences; } /** Return the current Node. */ DOMNode* DOMTreeWalkerImpl::getCurrentNode () { return fCurrentNode; } /** Return the current Node. */ void DOMTreeWalkerImpl::setCurrentNode (DOMNode* node) { if (!node) throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, GetDOMTreeWalkerMemoryManager); fCurrentNode = node; } /** Return the parent Node from the current node, * after applying filter, whatToshow. * If result is not null, set the current Node. */ DOMNode* DOMTreeWalkerImpl::parentNode () { if (!fCurrentNode) return 0; DOMNode* node = getParentNode(fCurrentNode); if (node != 0) { fCurrentNode = node; } return node; } /** Return the first child Node from the current node, * after applying filter, whatToshow. * If result is not null, set the current Node. */ DOMNode* DOMTreeWalkerImpl::firstChild () { if (!fCurrentNode) return 0; if(!fExpandEntityReferences && fCurrentNode->getNodeType()==DOMNode::ENTITY_REFERENCE_NODE) return 0; DOMNode* node = getFirstChild(fCurrentNode); if (node != 0) { fCurrentNode = node; } return node; } /** Return the last child Node from the current node, * after applying filter, whatToshow. * If result is not null, set the current Node. */ DOMNode* DOMTreeWalkerImpl::lastChild () { if (!fCurrentNode) return 0; if(!fExpandEntityReferences && fCurrentNode->getNodeType()==DOMNode::ENTITY_REFERENCE_NODE) return 0; DOMNode* node = getLastChild(fCurrentNode); if (node != 0) { fCurrentNode = node; } return node; } /** Return the previous sibling Node from the current node, * after applying filter, whatToshow. * If result is not null, set the current Node. */ DOMNode* DOMTreeWalkerImpl::previousSibling () { if (!fCurrentNode) return 0; DOMNode* node = getPreviousSibling(fCurrentNode); if (node != 0) { fCurrentNode = node; } return node; } /** Return the next sibling Node from the current node, * after applying filter, whatToshow. * If result is not null, set the current Node. */ DOMNode* DOMTreeWalkerImpl::nextSibling () { if (!fCurrentNode) return 0; DOMNode* node = getNextSibling(fCurrentNode); if (node != 0) { fCurrentNode = node; } return node; } /** Return the previous Node from the current node, * after applying filter, whatToshow. * If result is not null, set the current Node. */ DOMNode* DOMTreeWalkerImpl::previousNode () { if (!fCurrentNode) return 0; // get sibling DOMNode* node = getPreviousSibling(fCurrentNode); if (node == 0) { node = getParentNode(fCurrentNode); if ( node != 0) { fCurrentNode = node; } return node; } else { // get the lastChild of result. DOMNode* lastChild = getLastChild(node); // if there is a lastChild which passes filters return it. if (lastChild != 0) { fCurrentNode = lastChild; } else { fCurrentNode = node; } return fCurrentNode; } } /** Return the next Node from the current node, * after applying filter, whatToshow. * If result is not null, set the current Node. */ DOMNode* DOMTreeWalkerImpl::nextNode () { if (!fCurrentNode) return 0; DOMNode* node = getFirstChild(fCurrentNode); if (node != 0) { fCurrentNode = node; return node; } else { node = getNextSibling(fCurrentNode); if (node != 0) { fCurrentNode = node; return node; } else { // return parent's 1st sibling. DOMNode* parent = getParentNode(fCurrentNode); while ( parent != 0) { node = getNextSibling(parent); if (node != 0) { fCurrentNode = node; return node; } else { parent = getParentNode(parent); } } return node; } } } /** Internal function. * Return the parent Node, from the input node * after applying filter, whatToshow. * The current node is not consulted or set. */ DOMNode* DOMTreeWalkerImpl::getParentNode (DOMNode* node) { if (!node || node == fRoot) return 0; DOMNode* newNode = node->getParentNode(); if (!newNode) return 0; short accept = acceptNode(newNode); if (accept == DOMNodeFilter::FILTER_ACCEPT) return newNode; return getParentNode(newNode); } /** Internal function. * Return the nextSibling Node, from the input node * after applying filter, whatToshow. * The current node is not consulted or set. */ DOMNode* DOMTreeWalkerImpl::getNextSibling (DOMNode* node) { if (!node || node == fRoot) return 0; DOMNode* newNode = node->getNextSibling(); if (!newNode) { newNode = node->getParentNode(); if (!newNode || node == fRoot) return 0; short parentAccept = acceptNode(newNode); if (parentAccept == DOMNodeFilter::FILTER_SKIP) { return getNextSibling(newNode); } return 0; } short accept = acceptNode(newNode); if (accept == DOMNodeFilter::FILTER_ACCEPT) return newNode; else if (accept == DOMNodeFilter::FILTER_SKIP) { DOMNode* fChild = getFirstChild(newNode); if (!fChild && !newNode->hasChildNodes()) { return getNextSibling(newNode); } return fChild; } return getNextSibling(newNode); } /** Internal function. * Return the previous sibling Node, from the input node * after applying filter, whatToshow. * The current node is not consulted or set. */ DOMNode* DOMTreeWalkerImpl::getPreviousSibling (DOMNode* node) { if (!node || node == fRoot) return 0; DOMNode* newNode = node->getPreviousSibling(); if (!newNode) { newNode = node->getParentNode(); if (!newNode || node == fRoot) return 0; short parentAccept = acceptNode(newNode); if (parentAccept == DOMNodeFilter::FILTER_SKIP) { return getPreviousSibling(newNode); } return 0; } short accept = acceptNode(newNode); if (accept == DOMNodeFilter::FILTER_ACCEPT) return newNode; else if (accept == DOMNodeFilter::FILTER_SKIP) { DOMNode* fChild = getLastChild(newNode); if (!fChild && !newNode->hasChildNodes()) { return getPreviousSibling(newNode); } return fChild; } return getPreviousSibling(newNode); } /** Internal function. * Return the first child Node, from the input node * after applying filter, whatToshow. * The current node is not consulted or set. */ DOMNode* DOMTreeWalkerImpl::getFirstChild (DOMNode* node) { if (!node) return 0; if(!fExpandEntityReferences && node->getNodeType()==DOMNode::ENTITY_REFERENCE_NODE) return 0; DOMNode* newNode = node->getFirstChild(); if (!newNode) return 0; short accept = acceptNode(newNode); if (accept == DOMNodeFilter::FILTER_ACCEPT) return newNode; else if (accept == DOMNodeFilter::FILTER_SKIP && newNode->hasChildNodes()) { return getFirstChild(newNode); } return getNextSibling(newNode); } /** Internal function. * Return the last child Node, from the input node * after applying filter, whatToshow. * The current node is not consulted or set. */ DOMNode* DOMTreeWalkerImpl::getLastChild (DOMNode* node) { if (!node) return 0; if(!fExpandEntityReferences && node->getNodeType()==DOMNode::ENTITY_REFERENCE_NODE) return 0; DOMNode* newNode = node->getLastChild(); if (!newNode) return 0; short accept = acceptNode(newNode); if (accept == DOMNodeFilter::FILTER_ACCEPT) return newNode; else if (accept == DOMNodeFilter::FILTER_SKIP && newNode->hasChildNodes()) { return getLastChild(newNode); } return getPreviousSibling(newNode); } /** The node is accepted if it passes the whatToShow and the filter. */ short DOMTreeWalkerImpl::acceptNode (DOMNode* node) { if (fNodeFilter == 0) { if ( ( fWhatToShow & (1 << (node->getNodeType() - 1))) != 0) { return DOMNodeFilter::FILTER_ACCEPT; } else { return DOMNodeFilter::FILTER_SKIP; } } else { // REVISIT: This logic is unclear from the spec! if ((fWhatToShow & (1 << (node->getNodeType() - 1))) != 0 ) { return fNodeFilter->acceptNode(node); } else { // what to show has failed! if (fNodeFilter->acceptNode(node) == DOMNodeFilter::FILTER_REJECT) { return DOMNodeFilter::FILTER_REJECT; } else { return DOMNodeFilter::FILTER_SKIP; } } } } void DOMTreeWalkerImpl::release() { // for performance reason, do not recycle pointer // chance that this is allocated again and again is not usual } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMCharacterDataImpl.cpp000644 000765 000024 00000022524 13241160337 024367 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMCharacterDataImpl.cpp 1528170 2013-10-01 18:23:57Z amassari $ */ #include "DOMCharacterDataImpl.hpp" #include #include #include "DOMRangeImpl.hpp" #include "DOMDocumentImpl.hpp" #include "DOMCasts.hpp" #include "DOMStringPool.hpp" #include XERCES_CPP_NAMESPACE_BEGIN DOMCharacterDataImpl::DOMCharacterDataImpl(DOMDocument *doc, const XMLCh *dat) { fDoc = (DOMDocumentImpl*)doc; XMLSize_t len=XMLString::stringLen(dat); fDataBuf = fDoc->popBuffer(len+1); if (!fDataBuf) fDataBuf = new (fDoc) DOMBuffer(fDoc, len+15); fDataBuf->set(dat, len); } DOMCharacterDataImpl:: DOMCharacterDataImpl(DOMDocument *doc, const XMLCh* dat, XMLSize_t len) { fDoc = (DOMDocumentImpl*)doc; fDataBuf = fDoc->popBuffer(len+1); if (!fDataBuf) fDataBuf = new (fDoc) DOMBuffer(fDoc, len+15); fDataBuf->set(dat, len); } DOMCharacterDataImpl::DOMCharacterDataImpl(const DOMCharacterDataImpl &other) { fDoc = (DOMDocumentImpl*)other.fDoc; XMLSize_t len=other.getLength(); fDataBuf = fDoc->popBuffer(len+1); if (!fDataBuf) fDataBuf = new (fDoc) DOMBuffer(fDoc, len+15); fDataBuf->set(other.fDataBuf->getRawBuffer(), len); } DOMCharacterDataImpl::~DOMCharacterDataImpl() { } const XMLCh * DOMCharacterDataImpl::getNodeValue() const { return fDataBuf->getRawBuffer(); } void DOMCharacterDataImpl::setNodeValue(const DOMNode *node, const XMLCh *value) { if (castToNodeImpl(node)->isReadOnly()) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMCharacterDataImplMemoryManager); fDataBuf->set(value); DOMDocumentImpl *doc = (DOMDocumentImpl *)node->getOwnerDocument(); if (doc != 0) { Ranges* ranges = doc->getRanges(); if (ranges != 0) { XMLSize_t sz = ranges->size(); if (sz != 0) { for (XMLSize_t i =0; ielementAt(i)->receiveReplacedText((DOMNode*)node); } } } } } void DOMCharacterDataImpl::appendData(const DOMNode *node, const XMLCh *dat) { if(castToNodeImpl(node)->isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMCharacterDataImplMemoryManager); fDataBuf->append(dat); } void DOMCharacterDataImpl::appendData(const DOMNode *node, const XMLCh *dat, XMLSize_t n) { if(castToNodeImpl(node)->isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMCharacterDataImplMemoryManager); fDataBuf->append(dat, n); } void DOMCharacterDataImpl::appendDataFast(const DOMNode *node, const XMLCh *dat, XMLSize_t n) { // This function makes the following assumptions: // // - this node is not read-only // - nobody has ever received a pointer to the current content of fDataBuf, // so it can be safely released fDataBuf->appendInPlace(dat, n); } void DOMCharacterDataImpl::deleteData(const DOMNode *node, XMLSize_t offset, XMLSize_t count) { if (castToNodeImpl(node)->isReadOnly()) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMCharacterDataImplMemoryManager); // Note: the C++ XMLCh * operation throws the correct DOMExceptions // when parameter values are bad. // XMLSize_t len = this->fDataBuf->getLen(); if (offset > len) throw DOMException(DOMException::INDEX_SIZE_ERR, 0, GetDOMCharacterDataImplMemoryManager); // Cap the value of delLength to avoid trouble with overflows // in the following length computations. if (count > len) count = len; // If the length of data to be deleted would extend off the end // of the string, cut it back to stop at the end of string. if (offset + count >= len) count = len - offset; XMLSize_t newLen = len - count; XMLCh* newString; XMLCh temp[4096]; if (newLen >= 4095) newString = (XMLCh*) XMLPlatformUtils::fgMemoryManager->allocate ( (newLen+1) * sizeof(XMLCh) );//new XMLCh[newLen+1]; else newString = temp; XMLString::copyNString(newString, fDataBuf->getRawBuffer(), offset); XMLString::copyString(newString+offset, fDataBuf->getRawBuffer()+offset+count); fDataBuf->set(newString); if (newLen >= 4095) XMLPlatformUtils::fgMemoryManager->deallocate(newString);//delete[] newString; // We don't delete the old string (doesn't work), or alter // the old string (may be shared) // It just hangs around, possibly orphaned. DOMDocumentImpl *doc = (DOMDocumentImpl *)node->getOwnerDocument(); if (doc != 0) { Ranges* ranges = doc->getRanges(); if (ranges != 0) { XMLSize_t sz = ranges->size(); if (sz != 0) { for (XMLSize_t i =0; ielementAt(i)->updateRangeForDeletedText( (DOMNode*)node, offset, count); } } } } } const XMLCh *DOMCharacterDataImpl::getData() const { return fDataBuf->getRawBuffer(); } // // getCharDataLength - return the length of the character data string. // XMLSize_t DOMCharacterDataImpl::getLength() const { return fDataBuf->getLen(); } void DOMCharacterDataImpl::insertData(const DOMNode *node, XMLSize_t offset, const XMLCh *dat) { if (castToNodeImpl(node)->isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMCharacterDataImplMemoryManager); // Note: the C++ XMLCh * operation throws the correct DOMExceptions // when parameter values are bad. // XMLSize_t len = fDataBuf->getLen(); if (offset > len) throw DOMException(DOMException::INDEX_SIZE_ERR, 0, GetDOMCharacterDataImplMemoryManager); XMLSize_t datLen = XMLString::stringLen(dat); XMLSize_t newLen = len + datLen; XMLCh* newString; XMLCh temp[4096]; if (newLen >= 4095) newString = (XMLCh*) XMLPlatformUtils::fgMemoryManager->allocate ( (newLen + 1) * sizeof(XMLCh) );//new XMLCh[newLen+1]; else newString = temp; XMLString::copyNString(newString, fDataBuf->getRawBuffer(), offset); XMLString::copyNString(newString+offset, dat, datLen); XMLString::copyString(newString+offset+datLen, fDataBuf->getRawBuffer()+offset); fDataBuf->set(newString); if (newLen >= 4095) XMLPlatformUtils::fgMemoryManager->deallocate(newString);//delete[] newString; DOMDocumentImpl *doc = (DOMDocumentImpl *)node->getOwnerDocument(); if (doc != 0) { Ranges* ranges = doc->getRanges(); if (ranges != 0) { XMLSize_t sz = ranges->size(); if (sz != 0) { for (XMLSize_t i =0; ielementAt(i)->updateRangeForInsertedText( (DOMNode*)node, offset, datLen); } } } } } void DOMCharacterDataImpl::replaceData(const DOMNode *node, XMLSize_t offset, XMLSize_t count, const XMLCh *dat) { if (castToNodeImpl(node)->isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMCharacterDataImplMemoryManager); deleteData(node, offset, count); insertData(node, offset, dat); } void DOMCharacterDataImpl::setData(const DOMNode *node, const XMLCh *arg) { setNodeValue(node, arg); } const XMLCh * DOMCharacterDataImpl::substringData(const DOMNode *node, XMLSize_t offset, XMLSize_t count) const { // Note: the C++ XMLCh * operation throws the correct DOMExceptions // when parameter values are bad. // XMLSize_t len = fDataBuf->getLen(); if (offset > len) throw DOMException(DOMException::INDEX_SIZE_ERR, 0, GetDOMCharacterDataImplMemoryManager); DOMDocumentImpl *doc = (DOMDocumentImpl *)node->getOwnerDocument(); XMLCh* newString; XMLCh temp[4096]; if (len >= 4095) newString = (XMLCh*) doc->getMemoryManager()->allocate ( (len + 1) * sizeof(XMLCh) );//new XMLCh[len+1]; else newString = temp; XMLString::copyNString(newString, fDataBuf->getRawBuffer()+offset, count); newString[count] = chNull; const XMLCh* retString = doc->getPooledString(newString); if (len >= 4095) doc->getMemoryManager()->deallocate(newString);//delete[] newString; return retString; } void DOMCharacterDataImpl::releaseBuffer() { fDoc->releaseBuffer(fDataBuf); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMCasts.hpp000644 000765 000024 00000007564 13241160337 022150 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMCasts.hpp 1800911 2017-07-05 18:52:15Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMCASTS_HPP) #define XERCESC_INCLUDE_GUARD_DOMCASTS_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // // // Define inline casting functions to convert from // (DOMNode*) to the embedded instances of DOMNodeImpl, // DOMParentNode, and DOMChildNode. // // Each type of embedded object corresponds to a HasXXX virtual // interface class that a given DOM implementation class will // support to expose its embedded object(s) to other implementation // classes. // // This replaces the previous implementation that relied upon unsafe // casts and member offsets that rely on unspecified behavior in C++, // with a hopefully small cost in memory and performance. // #include #include "DOMNodeBase.hpp" #include "DOMElementImpl.hpp" #include "DOMTextImpl.hpp" XERCES_CPP_NAMESPACE_BEGIN static inline const DOMNodeImpl *castToNodeImpl(const DOMNode *p) { const HasDOMNodeImpl* pE = dynamic_cast(p); if (!pE || !pE->getNodeImpl()) { throw DOMException(DOMException::INVALID_STATE_ERR, 0, XMLPlatformUtils::fgMemoryManager); } return pE->getNodeImpl(); } static inline DOMNodeImpl *castToNodeImpl(DOMNode *p) { HasDOMNodeImpl *pE = dynamic_cast(p); if (!pE || !pE->getNodeImpl()) { throw DOMException(DOMException::INVALID_STATE_ERR, 0, XMLPlatformUtils::fgMemoryManager); } return pE->getNodeImpl(); } static inline const DOMParentNode *castToParentImpl(const DOMNode *p) { const HasDOMParentImpl *pE = dynamic_cast(p); if (!pE || !pE->getParentNodeImpl()) { throw DOMException(DOMException::INVALID_STATE_ERR, 0, XMLPlatformUtils::fgMemoryManager); } return pE->getParentNodeImpl(); } static inline DOMParentNode *castToParentImpl(DOMNode *p) { HasDOMParentImpl *pE = dynamic_cast(p); if (!pE || !pE->getParentNodeImpl()) { throw DOMException(DOMException::INVALID_STATE_ERR, 0, XMLPlatformUtils::fgMemoryManager); } return pE->getParentNodeImpl(); } static inline const DOMChildNode *castToChildImpl(const DOMNode *p) { const HasDOMChildImpl *pE = dynamic_cast(p); if (!pE || !pE->getChildNodeImpl()) { throw DOMException(DOMException::INVALID_STATE_ERR, 0, XMLPlatformUtils::fgMemoryManager); } return pE->getChildNodeImpl(); } static inline DOMChildNode *castToChildImpl(DOMNode *p) { HasDOMChildImpl *pE = dynamic_cast(p); if (!pE || !pE->getChildNodeImpl()) { throw DOMException(DOMException::INVALID_STATE_ERR, 0, XMLPlatformUtils::fgMemoryManager); } return pE->getChildNodeImpl(); } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMDocumentFragmentImpl.cpp000644 000765 000024 00000017614 13241160337 025147 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMDocumentFragmentImpl.cpp 1800911 2017-07-05 18:52:15Z scantor $ */ #include "DOMDocumentFragmentImpl.hpp" #include "DOMDocumentImpl.hpp" #include "DOMCasts.hpp" #include #include #include XERCES_CPP_NAMESPACE_BEGIN DOMDocumentFragmentImpl::DOMDocumentFragmentImpl(DOMDocument *masterDoc) : fNode(this, masterDoc), fParent(this, masterDoc) { } DOMDocumentFragmentImpl::DOMDocumentFragmentImpl(const DOMDocumentFragmentImpl &other, bool deep) : fNode(this, other.fNode), fParent(this, other.fParent) { if (deep) castToParentImpl(this)->cloneChildren(&other); } DOMDocumentFragmentImpl::~DOMDocumentFragmentImpl() { } DOMNode *DOMDocumentFragmentImpl::cloneNode(bool deep) const { DOMNode* newNode = new (castToNodeImpl(this)->getOwnerDocument(), DOMMemoryManager::DOCUMENT_FRAGMENT_OBJECT) DOMDocumentFragmentImpl(*this, deep); fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode); return newNode; } const XMLCh * DOMDocumentFragmentImpl::getNodeName() const { static const XMLCh name[] = {chPound, chLatin_d, chLatin_o, chLatin_c, chLatin_u, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chDash, chLatin_f, chLatin_r, chLatin_a, chLatin_g, chLatin_m, chLatin_e, chLatin_n, chLatin_t, 0}; return name; } DOMNode::NodeType DOMDocumentFragmentImpl::getNodeType() const { return DOMNode::DOCUMENT_FRAGMENT_NODE; } void DOMDocumentFragmentImpl::setNodeValue(const XMLCh *x) { fNode.setNodeValue(x); } void DOMDocumentFragmentImpl::release() { if (fNode.isOwned() && !fNode.isToBeReleased()) throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument(); if (doc) { fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0); fParent.release(); doc->release(this, DOMMemoryManager::DOCUMENT_FRAGMENT_OBJECT); } else { // shouldn't reach here throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); } } // // Delegation stubs for inherited functions. // DOMNode* DOMDocumentFragmentImpl::appendChild(DOMNode *newChild) {return fParent.appendChild (newChild); } DOMNamedNodeMap* DOMDocumentFragmentImpl::getAttributes() const {return fNode.getAttributes (); } DOMNodeList* DOMDocumentFragmentImpl::getChildNodes() const {return fParent.getChildNodes (); } DOMNode* DOMDocumentFragmentImpl::getFirstChild() const {return fParent.getFirstChild (); } DOMNode* DOMDocumentFragmentImpl::getLastChild() const {return fParent.getLastChild (); } const XMLCh* DOMDocumentFragmentImpl::getLocalName() const {return fNode.getLocalName (); } const XMLCh* DOMDocumentFragmentImpl::getNamespaceURI() const {return fNode.getNamespaceURI (); } DOMNode* DOMDocumentFragmentImpl::getNextSibling() const {return fNode.getNextSibling (); } const XMLCh* DOMDocumentFragmentImpl::getNodeValue() const {return fNode.getNodeValue (); } DOMDocument* DOMDocumentFragmentImpl::getOwnerDocument() const {return fParent.fOwnerDocument; } const XMLCh* DOMDocumentFragmentImpl::getPrefix() const {return fNode.getPrefix (); } DOMNode* DOMDocumentFragmentImpl::getParentNode() const {return fNode.getParentNode (); } DOMNode* DOMDocumentFragmentImpl::getPreviousSibling() const {return fNode.getPreviousSibling (); } bool DOMDocumentFragmentImpl::hasChildNodes() const {return fParent.hasChildNodes (); } DOMNode* DOMDocumentFragmentImpl::insertBefore(DOMNode *newChild, DOMNode *refChild) {return fParent.insertBefore (newChild, refChild); } void DOMDocumentFragmentImpl::normalize() {fParent.normalize (); } DOMNode* DOMDocumentFragmentImpl::removeChild(DOMNode *oldChild) {return fParent.removeChild (oldChild); } DOMNode* DOMDocumentFragmentImpl::replaceChild(DOMNode *newChild, DOMNode *oldChild) {return fParent.replaceChild (newChild, oldChild); } bool DOMDocumentFragmentImpl::isSupported(const XMLCh *feature, const XMLCh *version) const {return fNode.isSupported (feature, version); } void DOMDocumentFragmentImpl::setPrefix(const XMLCh *prefix) {fNode.setPrefix(prefix); } bool DOMDocumentFragmentImpl::hasAttributes() const {return fNode.hasAttributes(); } bool DOMDocumentFragmentImpl::isSameNode(const DOMNode* other) const {return fNode.isSameNode(other); } bool DOMDocumentFragmentImpl::isEqualNode(const DOMNode* arg) const {return fParent.isEqualNode(arg); } void* DOMDocumentFragmentImpl::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) {return fNode.setUserData(key, data, handler); } void* DOMDocumentFragmentImpl::getUserData(const XMLCh* key) const {return fNode.getUserData(key); } const XMLCh* DOMDocumentFragmentImpl::getBaseURI() const {return fNode.getBaseURI(); } short DOMDocumentFragmentImpl::compareDocumentPosition(const DOMNode* other) const {return fNode.compareDocumentPosition(other); } const XMLCh* DOMDocumentFragmentImpl::getTextContent() const {return fNode.getTextContent(); } void DOMDocumentFragmentImpl::setTextContent(const XMLCh* textContent){fNode.setTextContent(textContent); } const XMLCh* DOMDocumentFragmentImpl::lookupPrefix(const XMLCh* namespaceURI) const {return fNode.lookupPrefix(namespaceURI); } bool DOMDocumentFragmentImpl::isDefaultNamespace(const XMLCh* namespaceURI) const {return fNode.isDefaultNamespace(namespaceURI); } const XMLCh* DOMDocumentFragmentImpl::lookupNamespaceURI(const XMLCh* prefix) const {return fNode.lookupNamespaceURI(prefix); } void* DOMDocumentFragmentImpl::getFeature(const XMLCh* feature, const XMLCh* version) const {return fNode.getFeature(feature, version); } // Macro-in implementation accessors. DOMNODEIMPL_IMPL(DOMDocumentFragmentImpl); DOMPARENTIMPL_IMPL(DOMDocumentFragmentImpl); XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMImplementationListImpl.hpp000644 000765 000024 00000003544 13241160337 025530 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMImplementationListImpl.hpp 671894 2008-06-26 13:29:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONLISTIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONLISTIMPL_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMImplementation; class CDOM_EXPORT DOMImplementationListImpl: public DOMImplementationList { protected: RefVectorOf *fList; private: // Unused, and unimplemented constructors, operators, etc. DOMImplementationListImpl(const DOMImplementationListImpl & other); DOMImplementationListImpl & operator = (const DOMImplementationListImpl & other); public: DOMImplementationListImpl(); void add(DOMImplementation* impl); virtual ~DOMImplementationListImpl(); virtual DOMImplementation * item(XMLSize_t index) const; virtual XMLSize_t getLength() const; virtual void release(); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMNodeVector.hpp000644 000765 000024 00000005074 13241160337 023135 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNodeVector.hpp 676796 2008-07-15 05:04:13Z dbertoni $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMNODEVECTOR_HPP) #define XERCESC_INCLUDE_GUARD_DOMNODEVECTOR_HPP // // This file is part of the internal implementation of the C++ XML DOM. // It should NOT be included or used directly by application programs. // // Applications should include the file for the entire // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class // name is substituded for the *. // #include XERCES_CPP_NAMESPACE_BEGIN class DOMNode; class DOMDocument; class DOMNodeVector { private: DOMNode **data; XMLSize_t allocatedSize; XMLSize_t nextFreeSlot; void init(DOMDocument *doc, XMLSize_t size); void checkSpace(); // unimplemented DOMNodeVector ( const DOMNodeVector& toCopy); DOMNodeVector& operator= (const DOMNodeVector& other); public: DOMNodeVector(DOMDocument *doc); DOMNodeVector(DOMDocument *doc, XMLSize_t size); ~DOMNodeVector(); XMLSize_t size(); DOMNode* elementAt(XMLSize_t index); DOMNode* lastElement(); void addElement(DOMNode *); void insertElementAt(DOMNode *, XMLSize_t index); void setElementAt(DOMNode *val, XMLSize_t index); void removeElementAt(XMLSize_t index); void reset(); }; inline DOMNode *DOMNodeVector::elementAt(XMLSize_t index) { if (index >= nextFreeSlot) return 0; return data[index]; } inline DOMNode *DOMNodeVector::lastElement() { if (nextFreeSlot == 0) return 0; return data[nextFreeSlot-1]; } inline XMLSize_t DOMNodeVector::size() { return nextFreeSlot; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/dom/impl/DOMNotationImpl.cpp000644 000765 000024 00000020206 13241160337 023467 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMNotationImpl.cpp 1800911 2017-07-05 18:52:15Z scantor $ */ #include "DOMDocumentImpl.hpp" #include "DOMNotationImpl.hpp" #include #include XERCES_CPP_NAMESPACE_BEGIN DOMNotationImpl::DOMNotationImpl(DOMDocument *ownerDoc, const XMLCh *nName) : fNode(this, ownerDoc), fName(0), fPublicId(0), fSystemId(0), fBaseURI(0) { fNode.setIsLeafNode(true); fName = ((DOMDocumentImpl *)ownerDoc)->getPooledString(nName); } DOMNotationImpl::DOMNotationImpl(const DOMNotationImpl &other, bool /*deep*/) : DOMNotation(other), fNode(this, other.fNode), fName(other.fName), fPublicId(other.fPublicId), fSystemId(other.fSystemId), fBaseURI(other.fBaseURI) { fNode.setIsLeafNode(true); } DOMNotationImpl::~DOMNotationImpl() { } DOMNode *DOMNotationImpl::cloneNode(bool deep) const { DOMNode* newNode = new (getOwnerDocument(), DOMMemoryManager::NOTATION_OBJECT) DOMNotationImpl(*this, deep); fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode); return newNode; } const XMLCh * DOMNotationImpl::getNodeName() const { return fName; } DOMNode::NodeType DOMNotationImpl::getNodeType() const { return DOMNode::NOTATION_NODE; } const XMLCh * DOMNotationImpl::getPublicId() const { return fPublicId; } const XMLCh * DOMNotationImpl::getSystemId() const { return fSystemId; } void DOMNotationImpl::setNodeValue(const XMLCh *arg) { fNode.setNodeValue(arg); } void DOMNotationImpl::setPublicId(const XMLCh *arg) { if(fNode.isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR,0, GetDOMNodeMemoryManager); fPublicId = ((DOMDocumentImpl *)getOwnerDocument())->cloneString(arg); } void DOMNotationImpl::setSystemId(const XMLCh *arg) { if(fNode.isReadOnly()) throw DOMException( DOMException::NO_MODIFICATION_ALLOWED_ERR,0, GetDOMNodeMemoryManager); fSystemId = ((DOMDocumentImpl *)getOwnerDocument())->cloneString(arg); } void DOMNotationImpl::release() { if (fNode.isOwned() && !fNode.isToBeReleased()) throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument(); if (doc) { fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0); doc->release(this, DOMMemoryManager::NOTATION_OBJECT); } else { // shouldn't reach here throw DOMException(DOMException::INVALID_ACCESS_ERR,0, GetDOMNodeMemoryManager); } } void DOMNotationImpl::setBaseURI(const XMLCh* baseURI) { if (baseURI && *baseURI) { XMLCh* temp = (XMLCh*) ((DOMDocumentImpl *)getOwnerDocument())->allocate((XMLString::stringLen(baseURI) + 9)*sizeof(XMLCh)); XMLString::fixURI(baseURI, temp); fBaseURI = temp; } else fBaseURI = 0; } const XMLCh* DOMNotationImpl::getBaseURI() const { return fBaseURI; } DOMNode* DOMNotationImpl::appendChild(DOMNode *newChild) {return fNode.appendChild (newChild); } DOMNamedNodeMap* DOMNotationImpl::getAttributes() const {return fNode.getAttributes (); } DOMNodeList* DOMNotationImpl::getChildNodes() const {return fNode.getChildNodes (); } DOMNode* DOMNotationImpl::getFirstChild() const {return fNode.getFirstChild (); } DOMNode* DOMNotationImpl::getLastChild() const {return fNode.getLastChild (); } const XMLCh* DOMNotationImpl::getLocalName() const {return fNode.getLocalName (); } const XMLCh* DOMNotationImpl::getNamespaceURI() const {return fNode.getNamespaceURI (); } DOMNode* DOMNotationImpl::getNextSibling() const {return fNode.getNextSibling (); } const XMLCh* DOMNotationImpl::getNodeValue() const {return fNode.getNodeValue (); } DOMDocument* DOMNotationImpl::getOwnerDocument() const {return fNode.getOwnerDocument (); } const XMLCh* DOMNotationImpl::getPrefix() const {return fNode.getPrefix (); } DOMNode* DOMNotationImpl::getParentNode() const {return fNode.getParentNode (); } DOMNode* DOMNotationImpl::getPreviousSibling() const {return fNode.getPreviousSibling (); } bool DOMNotationImpl::hasChildNodes() const {return fNode.hasChildNodes (); } DOMNode* DOMNotationImpl::insertBefore(DOMNode *newChild, DOMNode *refChild) {return fNode.insertBefore (newChild, refChild); } void DOMNotationImpl::normalize() {fNode.normalize (); } DOMNode* DOMNotationImpl::removeChild(DOMNode *oldChild) {return fNode.removeChild (oldChild); } DOMNode* DOMNotationImpl::replaceChild(DOMNode *newChild, DOMNode *oldChild) {return fNode.replaceChild (newChild, oldChild); } bool DOMNotationImpl::isSupported(const XMLCh *feature, const XMLCh *version) const {return fNode.isSupported (feature, version); } void DOMNotationImpl::setPrefix(const XMLCh *prefix) {fNode.setPrefix(prefix); } bool DOMNotationImpl::hasAttributes() const {return fNode.hasAttributes(); } bool DOMNotationImpl::isSameNode(const DOMNode* other) const {return fNode.isSameNode(other); } bool DOMNotationImpl::isEqualNode(const DOMNode* arg) const {return fNode.isEqualNode(arg); } void* DOMNotationImpl::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) {return fNode.setUserData(key, data, handler); } void* DOMNotationImpl::getUserData(const XMLCh* key) const {return fNode.getUserData(key); } short DOMNotationImpl::compareDocumentPosition(const DOMNode* other) const {return fNode.compareDocumentPosition(other); } const XMLCh* DOMNotationImpl::getTextContent() const {return fNode.getTextContent(); } void DOMNotationImpl::setTextContent(const XMLCh* textContent){fNode.setTextContent(textContent); } const XMLCh* DOMNotationImpl::lookupPrefix(const XMLCh* namespaceURI) const {return fNode.lookupPrefix(namespaceURI); } bool DOMNotationImpl::isDefaultNamespace(const XMLCh* namespaceURI) const {return fNode.isDefaultNamespace(namespaceURI); } const XMLCh* DOMNotationImpl::lookupNamespaceURI(const XMLCh* prefix) const {return fNode.lookupNamespaceURI(prefix); } void* DOMNotationImpl::getFeature(const XMLCh* feature, const XMLCh* version) const {return fNode.getFeature(feature, version); } // Macro-in implementation accessors. DOMNODEIMPL_IMPL(DOMNotationImpl); XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/dom/impl/DOMXPathNSResolverImpl.hpp000644 000765 000024 00000003776 13241160337 024725 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DOMXPathNSResolverImpl.hpp 657774 2008-05-19 09:59:33Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHNSRESOLVERIMPL_HPP) #define XERCESC_INCLUDE_GUARD_DOMXPATHNSRESOLVERIMPL_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class DOMNode; class CDOM_EXPORT DOMXPathNSResolverImpl : public XMemory, public DOMXPathNSResolver { public: DOMXPathNSResolverImpl(const DOMNode* nodeResolver = 0, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~DOMXPathNSResolverImpl(); virtual const XMLCh* lookupNamespaceURI(const XMLCh* prefix) const; virtual const XMLCh* lookupPrefix(const XMLCh* URI) const; virtual void addNamespaceBinding(const XMLCh* prefix, const XMLCh* uri); virtual void release(); protected: RefHashTableOf* fNamespaceBindings; const DOMNode* fResolverNode; MemoryManager* fManager; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax2/Attributes.hpp000644 000765 000024 00000026052 13241160335 022005 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Attributes.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_ATTRIBUTES_HPP) #define XERCESC_INCLUDE_GUARD_ATTRIBUTES_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Interface for an element's attribute specifications. * * The SAX2 parser implements this interface and passes an instance * to the SAX2 application as the last argument of each startElement * event. * * The instance provided will return valid results only during the * scope of the startElement invocation (to save it for future * use, the application must make a copy: the AttributesImpl * helper class provides a convenient constructor for doing so). * * An Attributes includes only attributes that have been * specified or defaulted: \#IMPLIED attributes will not be included. * * There are two ways for the SAX application to obtain information * from the Attributes. First, it can iterate through the entire * list: * * * public void startElement (String uri, String localpart, String qName, Attributes atts) {
*  for (XMLSize_t i = 0; i < atts.getLength(); i++) {
*   String Qname = atts.getQName(i);
*   String URI = atts.getURI(i)
*   String local = atts.GetLocalName(i)
*   String type = atts.getType(i);
*   String value = atts.getValue(i);
*   [...]
*  }
* } *
* * (Note that the result of getLength() will be zero if there * are no attributes.) * * As an alternative, the application can request the value or * type of specific attributes: * * * public void startElement (String uri, String localpart, String qName, Attributes atts) {
*  String identifier = atts.getValue("id");
*  String label = atts.getValue("label");
*  [...]
* } *
* * The AttributesImpl helper class provides a convenience * implementation for use by parser or application writers. * * @see Sax2DocumentHandler#startElement * @see AttributesImpl#AttributesImpl */ class SAX2_EXPORT Attributes { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ /** Default constructor */ Attributes() { } /** Destructor */ virtual ~Attributes() { } //@} /** @name The virtual attribute list interface */ //@{ /** * Return the number of attributes in this list. * * The SAX parser may provide attributes in any * arbitrary order, regardless of the order in which they were * declared or specified. The number of attributes may be * zero. * * @return The number of attributes in the list. */ virtual XMLSize_t getLength() const = 0; /** * Return the namespace URI of an attribute in this list (by position). * * The QNames must be unique: the SAX parser shall not include the * same attribute twice. Attributes without values (those declared * \#IMPLIED without a value specified in the start tag) will be * omitted from the list. * * @param index The index of the attribute in the list (starting at 0). * @return The URI of the indexed attribute, or null * if the index is out of range. * @see #getLength */ virtual const XMLCh* getURI(const XMLSize_t index) const = 0; /** * Return the local name of an attribute in this list (by position). * * The QNames must be unique: the SAX parser shall not include the * same attribute twice. Attributes without values (those declared * \#IMPLIED without a value specified in the start tag) will be * omitted from the list. * * @param index The index of the attribute in the list (starting at 0). * @return The local name of the indexed attribute, or null * if the index is out of range. * @see #getLength */ virtual const XMLCh* getLocalName(const XMLSize_t index) const = 0; /** * Return the qName of an attribute in this list (by position). * * The QNames must be unique: the SAX parser shall not include the * same attribute twice. Attributes without values (those declared * \#IMPLIED without a value specified in the start tag) will be * omitted from the list. * * @param index The index of the attribute in the list (starting at 0). * @return The qName of the indexed attribute, or null * if the index is out of range. * @see #getLength */ virtual const XMLCh* getQName(const XMLSize_t index) const = 0; /** * Return the type of an attribute in the list (by position). * * The attribute type is one of the strings "CDATA", "ID", * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", * or "NOTATION" (always in upper case). * * If the parser has not read a declaration for the attribute, * or if the parser does not report attribute types, then it must * return the value "CDATA" as stated in the XML 1.0 Recommendation * (clause 3.3.3, "Attribute-Value Normalization"). * * For an enumerated attribute that is not a notation, the * parser will report the type as "NMTOKEN". * * @param index The index of the attribute in the list (starting at 0). * @return The attribute type as a string, or * null if the index is out of range. * @see #getLength * @see #getType */ virtual const XMLCh* getType(const XMLSize_t index) const = 0; /** * Return the value of an attribute in the list (by position). * * If the attribute value is a list of tokens (IDREFS, * ENTITIES, or NMTOKENS), the tokens will be concatenated * into a single string separated by whitespace. * * @param index The index of the attribute in the list (starting at 0). * @return The attribute value as a string, or * null if the index is out of range. * @see #getLength * @see #getValue */ virtual const XMLCh* getValue(const XMLSize_t index) const = 0; //////////////////////////////////////////////////////////////////// // Name-based query. //////////////////////////////////////////////////////////////////// /** * Look up the index of an attribute by Namespace name. Non-standard * extension. * * @param uri The Namespace URI, or the empty string if * the name has no Namespace URI. * @param localPart The attribute's local name. * @param index Reference to the variable where the index will be stored. * @return true if the attribute is found and false otherwise. */ virtual bool getIndex(const XMLCh* const uri, const XMLCh* const localPart, XMLSize_t& index) const = 0 ; /** * Look up the index of an attribute by Namespace name. * * @param uri The Namespace URI, or the empty string if * the name has no Namespace URI. * @param localPart The attribute's local name. * @return The index of the attribute, or -1 if it does not * appear in the list. */ virtual int getIndex(const XMLCh* const uri, const XMLCh* const localPart ) const = 0 ; /** * Look up the index of an attribute by XML 1.0 qualified name. * Non-standard extension. * * @param qName The qualified (prefixed) name. * @param index Reference to the variable where the index will be stored. * @return true if the attribute is found and false otherwise. */ virtual bool getIndex(const XMLCh* const qName, XMLSize_t& index) const = 0 ; /** * Look up the index of an attribute by XML 1.0 qualified name. * * @param qName The qualified (prefixed) name. * @return The index of the attribute, or -1 if it does not * appear in the list. */ virtual int getIndex(const XMLCh* const qName ) const = 0 ; /** * Look up an attribute's type by Namespace name. * *

See #getType for a description of the possible types.

* * @param uri The Namespace URI, or the empty String if the * name has no Namespace URI. * @param localPart The local name of the attribute. * @return The attribute type as a string, or null if the * attribute is not in the list or if Namespace * processing is not being performed. */ virtual const XMLCh* getType(const XMLCh* const uri, const XMLCh* const localPart ) const = 0 ; /** * Look up an attribute's type by XML 1.0 qualified name. * *

See #getType for a description of the possible types.

* * @param qName The XML 1.0 qualified name. * @return The attribute type as a string, or null if the * attribute is not in the list or if qualified names * are not available. */ virtual const XMLCh* getType(const XMLCh* const qName) const = 0; /** * Look up an attribute's value by Namespace name. * *

See #getValue for a description of the possible values.

* * @param uri The Namespace URI, or the empty String if the * name has no Namespace URI. * @param localPart The local name of the attribute. * @return The attribute value as a string, or null if the * attribute is not in the list. */ virtual const XMLCh* getValue(const XMLCh* const uri, const XMLCh* const localPart ) const = 0 ; /** * Look up an attribute's value by XML 1.0 qualified name. * *

See #getValue for a description of the possible values.

* * @param qName The XML 1.0 qualified name. * @return The attribute value as a string, or null if the * attribute is not in the list or if qualified names * are not available. */ virtual const XMLCh* getValue(const XMLCh* const qName) const = 0; //@} private : /* Constructors and operators */ /* Copy constructor */ Attributes(const Attributes&); /* Assignment operator */ Attributes& operator=(const Attributes&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax2/SAX2XMLFilter.hpp000644 000765 000024 00000005021 13241160335 022114 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SAX2XMLFilter.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_SAX2XMLFILTER_HPP) #define XERCESC_INCLUDE_GUARD_SAX2XMLFILTER_HPP #include XERCES_CPP_NAMESPACE_BEGIN class SAX2_EXPORT SAX2XMLFilter : public SAX2XMLReader { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ /** The default constructor */ SAX2XMLFilter() { } /** The destructor */ virtual ~SAX2XMLFilter() { } //@} //----------------------------------------------------------------------- // The XMLFilter interface //----------------------------------------------------------------------- /** @name Implementation of SAX 2.0 XMLFilter interface's. */ //@{ /** * This method returns the parent XMLReader object. * * @return A pointer to the parent XMLReader object. */ virtual SAX2XMLReader* getParent() const = 0 ; /** * Sets the parent XMLReader object; parse requests will be forwarded to this * object, and callback notifications coming from it will be postprocessed * * @param parent The new XMLReader parent. * @see SAX2XMLReader#SAX2XMLReader */ virtual void setParent(SAX2XMLReader* parent) = 0; //@} private : /* The copy constructor, you cannot call this directly */ SAX2XMLFilter(const SAX2XMLFilter&); /* The assignment operator, you cannot call this directly */ SAX2XMLFilter& operator=(const SAX2XMLFilter&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax2/sax2Dummy.cpp000644 000765 000024 00000002165 13241160335 021542 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: sax2Dummy.cpp 471747 2006-11-06 14:31:56Z amassari $ */ #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/sax2/DeclHandler.hpp000644 000765 000024 00000012730 13241160335 022022 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DeclHandler.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DECLHANDLER_HPP) #define XERCESC_INCLUDE_GUARD_DECLHANDLER_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Receive notification of DTD declaration events. * *

This is an optional extension handler for SAX2 to provide more * complete information about DTD declarations in an XML document. * XML readers are not required to recognize this handler, and it is not * part of core-only SAX2 distributions.

* *

Note that data-related DTD declarations (unparsed entities and * notations) are already reported through the DTDHandler interface.

* *

If you are using the declaration handler together with a lexical * handler, all of the events will occur between the startDTD and the endDTD * events.

* * @see SAX2XMLReader#setLexicalHandler * @see SAX2XMLReader#setDeclarationHandler */ class SAX2_EXPORT DeclHandler { public: /** @name Constructors and Destructor */ //@{ /** Default constructor */ DeclHandler() { } /** Destructor */ virtual ~DeclHandler() { } //@} /** @name The virtual declaration handler interface */ //@{ /** * Report an element type declaration. * *

The content model will consist of the string "EMPTY", the string * "ANY", or a parenthesised group, optionally followed by an occurrence * indicator. The model will be normalized so that all parameter entities * are fully resolved and all whitespace is removed,and will include the * enclosing parentheses. Other normalization (such as removing redundant * parentheses or simplifying occurrence indicators) is at the discretion * of the parser.

* * @param name The element type name. * @param model The content model as a normalized string. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void elementDecl ( const XMLCh* const name , const XMLCh* const model ) = 0; /** * Report an attribute type declaration. * *

The Parser will call this method to report each occurrence of * a comment in the XML document.

* *

The application must not attempt to read from the array * outside of the specified range.

* * @param eName The name of the associated element. * @param aName The name of the attribute. * @param type A string representing the attribute type. * @param mode A string representing the attribute defaulting mode ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if none of these applies. * @param value A string representing the attribute's default value, or null if there is none. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void attributeDecl ( const XMLCh* const eName , const XMLCh* const aName , const XMLCh* const type , const XMLCh* const mode , const XMLCh* const value ) = 0; /** * Report an internal entity declaration. * *

Only the effective (first) declaration for each entity will be * reported. All parameter entities in the value will be expanded, but * general entities will not.

* * @param name The name of the entity. If it is a parameter entity, the name will begin with '%'. * @param value The replacement text of the entity. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void internalEntityDecl ( const XMLCh* const name , const XMLCh* const value ) = 0; /** * Report a parsed external entity declaration. * *

Only the effective (first) declaration for each entity will * be reported.

* * @param name The name of the entity. If it is a parameter entity, the name will begin with '%'. * @param publicId The The declared public identifier of the entity, or null if none was declared. * @param systemId The declared system identifier of the entity. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void externalEntityDecl ( const XMLCh* const name , const XMLCh* const publicId , const XMLCh* const systemId ) = 0; //@} private : /* Unimplemented Constructors and operators */ /* Copy constructor */ DeclHandler(const DeclHandler&); /** Assignment operator */ DeclHandler& operator=(const DeclHandler&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax2/SAX2XMLReader.hpp000644 000765 000024 00000105253 13241160335 022101 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SAX2XMLReader.hpp 983783 2010-08-09 19:20:46Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_SAX2XMLREADER_HPP) #define XERCESC_INCLUDE_GUARD_SAX2XMLREADER_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class ContentHandler ; class DTDHandler; class EntityResolver; class ErrorHandler; class InputSource; class LexicalHandler; class DeclHandler; class XMLDocumentHandler; class SAX2_EXPORT SAX2XMLReader { public: // ----------------------------------------------------------------------- // Class types // ----------------------------------------------------------------------- /** @name Public constants */ //@{ /** ValScheme enum used in setValidationScheme * Val_Never: Do not report validation errors. * Val_Always: The parser will always report validation errors. * Val_Auto: The parser will report validation errors only if a grammar is specified. * * The schemes map to these feature values: * Val_Never: * parser->setFeature(XMLUni::fgSAX2CoreValidation, false); * * Val_Always: * parser->setFeature(XMLUni::fgSAX2CoreValidation, true); * parser->setFeature(XMLUni::fgXercesDynamic, false); * * Val_Auto: * parser->setFeature(XMLUni::fgSAX2CoreValidation, true); * parser->setFeature(XMLUni::fgXercesDynamic, true); * * @see #setFeature */ enum ValSchemes { Val_Never , Val_Always , Val_Auto }; //@} // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ /** The default constructor */ SAX2XMLReader() { } /** The destructor */ virtual ~SAX2XMLReader() { } //@} //----------------------------------------------------------------------- // The XMLReader interface //----------------------------------------------------------------------- /** @name Implementation of SAX 2.0 XMLReader interface's. */ //@{ /** * This method returns the installed content handler. * * @return A pointer to the installed content handler object. */ virtual ContentHandler* getContentHandler() const = 0 ; /** * This method returns the installed DTD handler. * * @return A pointer to the installed DTD handler object. */ virtual DTDHandler* getDTDHandler() const = 0; /** * This method returns the installed entity resolver. * * @return A pointer to the installed entity resolver object. */ virtual EntityResolver* getEntityResolver() const = 0 ; /** * This method returns the installed error handler. * * @return A pointer to the installed error handler object. */ virtual ErrorHandler* getErrorHandler() const = 0 ; /** * Query the current state of any feature in a SAX2 XMLReader. * * @param name The unique identifier (URI) of the feature being set. * @return The current state of the feature. * @exception SAXNotRecognizedException If the requested feature is not known. */ virtual bool getFeature(const XMLCh* const name) const = 0; /** * Query the current value of a property in a SAX2 XMLReader. * * The parser owns the returned pointer. The memory allocated for * the returned pointer will be destroyed when the parser is deleted. * * To ensure accessibility of the returned information after the parser * is deleted, callers need to copy and store the returned information * somewhere else; otherwise you may get unexpected result. Since the returned * pointer is a generic void pointer, see the SAX2 Programming Guide to learn * exactly what type of property value each property returns for replication. * * @param name The unique identifier (URI) of the property being set. * @return The current value of the property. The pointer spans the same * life-time as the parser. A null pointer is returned if nothing * was specified externally. * @exception SAXNotRecognizedException If the requested property is not known. */ virtual void* getProperty(const XMLCh* const name) const = 0 ; /** * Allow an application to register a document event handler. * * If the application does not register a document handler, all * document events reported by the SAX parser will be silently * ignored (this is the default behaviour implemented by * HandlerBase). * * Applications may register a new or different handler in the * middle of a parse, and the SAX parser must begin using the new * handler immediately. * * @param handler The document handler. * @see ContentHandler#ContentHandler * @see HandlerBase#HandlerBase */ virtual void setContentHandler(ContentHandler* const handler) = 0; /** * Allow an application to register a DTD event handler. * * If the application does not register a DTD handler, all DTD * events reported by the SAX parser will be silently ignored (this * is the default behaviour implemented by HandlerBase). * * Applications may register a new or different handler in the middle * of a parse, and the SAX parser must begin using the new handler * immediately. * * @param handler The DTD handler. * @see DTDHandler#DTDHandler * @see HandlerBase#HandlerBase */ virtual void setDTDHandler(DTDHandler* const handler) = 0; /** * Allow an application to register a custom entity resolver. * * If the application does not register an entity resolver, the * SAX parser will resolve system identifiers and open connections * to entities itself (this is the default behaviour implemented in * DefaultHandler). * * Applications may register a new or different entity resolver * in the middle of a parse, and the SAX parser must begin using * the new resolver immediately. * * @param resolver The object for resolving entities. * @see EntityResolver#EntityResolver * @see DefaultHandler#DefaultHandler */ virtual void setEntityResolver(EntityResolver* const resolver) = 0; /** * Allow an application to register an error event handler. * * If the application does not register an error event handler, * all error events reported by the SAX parser will be silently * ignored, except for fatalError, which will throw a SAXException * (this is the default behaviour implemented by HandlerBase). * * Applications may register a new or different handler in the * middle of a parse, and the SAX parser must begin using the new * handler immediately. * * @param handler The error handler. * @see ErrorHandler#ErrorHandler * @see SAXException#SAXException * @see HandlerBase#HandlerBase */ virtual void setErrorHandler(ErrorHandler* const handler) = 0; /** * Set the state of any feature in a SAX2 XMLReader. * Supported features in SAX2 for xerces-c are: *
(See the SAX2 Programming Guide for detail description). * *
http://xml.org/sax/features/validation (default: true) *
http://xml.org/sax/features/namespaces (default: true) *
http://xml.org/sax/features/namespace-prefixes (default: false) *
http://apache.org/xml/features/validation/dynamic (default: false) *
http://apache.org/xml/features/validation/reuse-grammar (default: false) *
http://apache.org/xml/features/validation/schema (default: true) *
http://apache.org/xml/features/validation/schema-full-checking (default: false) *
http://apache.org/xml/features/validating/load-schema (default: true) *
http://apache.org/xml/features/nonvalidating/load-external-dtd (default: true) *
http://apache.org/xml/features/continue-after-fatal-error (default: false) *
http://apache.org/xml/features/validation-error-as-fatal (default: false) * * @param name The unique identifier (URI) of the feature. * @param value The requested state of the feature (true or false). * @exception SAXNotRecognizedException If the requested feature is not known. * @exception SAXNotSupportedException Feature modification is not supported during parse * */ virtual void setFeature(const XMLCh* const name, const bool value) = 0; /** * Set the value of any property in a SAX2 XMLReader. * Supported properties in SAX2 for xerces-c are: *
(See the SAX2 Programming Guide for detail description). * *
http://apache.org/xml/properties/schema/external-schemaLocation *
http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation *
http://apache.org/xml/properties/security-manager *
http://apache.org/xml/properties/low-water-mark *
http://apache.org/xml/properties/scannerName * * It takes a void pointer as the property value. Application is required to initialize this void * pointer to a correct type. See the SAX2 Programming Guide * to learn exactly what type of property value each property expects for processing. * Passing a void pointer that was initialized with a wrong type will lead to unexpected result. * If the same property is set more than once, the last one takes effect. * * @param name The unique identifier (URI) of the property being set. * @param value The requested value for the property. See * the SAX2 Programming Guide to learn * exactly what type of property value each property expects for processing. * Passing a void pointer that was initialized with a wrong type will lead * to unexpected result. * @exception SAXNotRecognizedException If the requested property is not known. * @exception SAXNotSupportedException Property modification is not supported during parse */ virtual void setProperty(const XMLCh* const name, void* value) = 0 ; /** * Parse an XML document. * * The application can use this method to instruct the SAX parser * to begin parsing an XML document from any valid input * source (a character stream, a byte stream, or a URI). * * Applications may not invoke this method while a parse is in * progress (they should create a new Parser instead for each * additional XML document). Once a parse is complete, an * application may reuse the same Parser object, possibly with a * different input source. * * @param source The input source for the top-level of the * XML document. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @exception XMLException An exception from the parser or client * handler code. * @see InputSource#InputSource * @see #setEntityResolver * @see #setDTDHandler * @see #setContentHandler * @see #setErrorHandler */ virtual void parse ( const InputSource& source ) = 0; /** * Parse an XML document from a system identifier (URI). * * This method is a shortcut for the common case of reading a * document from a system identifier. It is the exact equivalent * of the following: * * parse(new URLInputSource(systemId)); * * If the system identifier is a URL, it must be fully resolved * by the application before it is passed to the parser. * * @param systemId The system identifier (URI). * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @exception XMLException An exception from the parser or client * handler code. * @see #parse(const InputSource&) */ virtual void parse ( const XMLCh* const systemId ) = 0; /** * Parse an XML document from a system identifier (URI). * * This method is a shortcut for the common case of reading a * document from a system identifier. It is the exact equivalent * of the following: * * parse(new URLInputSource(systemId)); * * If the system identifier is a URL, it must be fully resolved * by the application before it is passed to the parser. * * @param systemId The system identifier (URI). * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @exception XMLException An exception from the parser or client * handler code. * @see #parse(const InputSource&) */ virtual void parse ( const char* const systemId ) = 0; //@} // ----------------------------------------------------------------------- // SAX 2.0-ext // ----------------------------------------------------------------------- /** @name SAX 2.0-ext */ //@{ /** * This method returns the installed declaration handler. * * @return A pointer to the installed declaration handler object. */ virtual DeclHandler* getDeclarationHandler() const = 0 ; /** * This method returns the installed lexical handler. * * @return A pointer to the installed lexical handler object. */ virtual LexicalHandler* getLexicalHandler() const = 0 ; /** * Allow an application to register a declaration event handler. * * If the application does not register a declaration handler, * all events reported by the SAX parser will be silently * ignored. (this is the default behaviour implemented by DefaultHandler). * * Applications may register a new or different handler in the * middle of a parse, and the SAX parser must begin using the new * handler immediately. * * @param handler The DTD declaration handler. * @see DeclHandler#DeclHandler * @see SAXException#SAXException * @see DefaultHandler#DefaultHandler */ virtual void setDeclarationHandler(DeclHandler* const handler) = 0; /** * Allow an application to register a lexical event handler. * * If the application does not register a lexical handler, * all events reported by the SAX parser will be silently * ignored. (this is the default behaviour implemented by HandlerBase). * * Applications may register a new or different handler in the * middle of a parse, and the SAX parser must begin using the new * handler immediately. * * @param handler The error handler. * @see LexicalHandler#LexicalHandler * @see SAXException#SAXException * @see HandlerBase#HandlerBase */ virtual void setLexicalHandler(LexicalHandler* const handler) = 0; //@} // ----------------------------------------------------------------------- // Getter Methods // ----------------------------------------------------------------------- /** @name Getter Methods (Xerces-C specific) */ //@{ /** * This method is used to get the current validator. * * SAX2XMLReader assumes responsibility for the validator. It will be * deleted when the XMLReader is destroyed. * * @return A pointer to the validator. An application should not deleted * the object returned. * */ virtual XMLValidator* getValidator() const = 0; /** Get error count from the last parse operation. * * This method returns the error count from the last parse * operation. Note that this count is actually stored in the * scanner, so this method simply returns what the * scanner reports. * * @return number of errors encountered during the latest * parse operation. */ virtual XMLSize_t getErrorCount() const = 0 ; /** * This method returns the state of the parser's * exit-on-First-Fatal-Error flag. * *

Or you can query the feature "http://apache.org/xml/features/continue-after-fatal-error" * which indicates the opposite state.

* * @return true, if the parser is currently configured to * exit on the first fatal error, false otherwise. * * @see #setExitOnFirstFatalError * @see #getFeature */ virtual bool getExitOnFirstFatalError() const = 0; /** * This method returns the state of the parser's * validation-constraint-fatal flag. * *

Or you can query the feature "http://apache.org/xml/features/validation-error-as-fatal" * which means the same thing. * * @return true, if the parser is currently configured to * set validation constraint errors as fatal, false * otherwise. * * @see #setValidationConstraintFatal * @see #getFeature */ virtual bool getValidationConstraintFatal() const = 0; /** * Retrieve the grammar that is associated with the specified namespace key * * @param nameSpaceKey Namespace key * @return Grammar associated with the Namespace key. */ virtual Grammar* getGrammar(const XMLCh* const nameSpaceKey) = 0; /** * Retrieve the grammar where the root element is declared. * * @return Grammar where root element declared */ virtual Grammar* getRootGrammar() = 0; /** * Returns the string corresponding to a URI id from the URI string pool. * * @param uriId id of the string in the URI string pool. * @return URI string corresponding to the URI id. */ virtual const XMLCh* getURIText(unsigned int uriId) const = 0; /** * Returns the current src offset within the input source. * To be used only while parsing is in progress. * * @return offset within the input source */ virtual XMLFilePos getSrcOffset() const = 0; //@} // ----------------------------------------------------------------------- // Setter Methods // ----------------------------------------------------------------------- /** @name Setter Methods (Xerces-C specific) */ //@{ /** * This method is used to set a validator. * * SAX2XMLReader assumes responsibility for the validator. It will be * deleted when the XMLReader is destroyed. * * @param valueToAdopt A pointer to the validator that the reader should use. * */ virtual void setValidator(XMLValidator* valueToAdopt) = 0; /** * This method allows users to set the parser's behaviour when it * encounters the first fatal error. If set to true, the parser * will exit at the first fatal error. If false, then it will * report the error and continue processing. * *

The default value is 'true' and the parser exits on the * first fatal error.

* *

Or you can set the feature "http://apache.org/xml/features/continue-after-fatal-error" * which has the opposite behaviour.

* *

If both the feature above and this function are used, the latter takes effect.

* * @param newState The value specifying whether the parser should * continue or exit when it encounters the first * fatal error. * * @see #getExitOnFirstFatalError * @see #setFeature */ virtual void setExitOnFirstFatalError(const bool newState) = 0; /** * This method allows users to set the parser's behaviour when it * encounters a validation constraint error. If set to true, and the * the parser will treat validation error as fatal and will exit depends on the * state of "getExitOnFirstFatalError". If false, then it will * report the error and continue processing. * * Note: setting this true does not mean the validation error will be printed with * the word "Fatal Error". It is still printed as "Error", but the parser * will exit if "setExitOnFirstFatalError" is set to true. * *

The default value is 'false'.

* *

Or you can set the feature "http://apache.org/xml/features/validation-error-as-fatal" * which means the same thing.

* *

If both the feature above and this function are used, the latter takes effect.

* * @param newState If true, the parser will exit if "setExitOnFirstFatalError" * is set to true. * * @see #getValidationConstraintFatal * @see #setExitOnFirstFatalError * @see #setFeature */ virtual void setValidationConstraintFatal(const bool newState) = 0; //@} // ----------------------------------------------------------------------- // Progressive scan methods // ----------------------------------------------------------------------- /** @name Progressive scan methods */ //@{ /** Begin a progressive parse operation * * This method is used to start a progressive parse on a XML file. * To continue parsing, subsequent calls must be to the parseNext * method. * * It scans through the prolog and returns a token to be used on * subsequent scanNext() calls. If the return value is true, then the * token is legal and ready for further use. If it returns false, then * the scan of the prolog failed and the token is not going to work on * subsequent scanNext() calls. * * @param systemId A pointer to a Unicode string representing the path * to the XML file to be parsed. * @param toFill A token maintaing state information to maintain * internal consistency between invocation of 'parseNext' * calls. * * @return 'true', if successful in parsing the prolog. It indicates the * user can go ahead with parsing the rest of the file. It * returns 'false' to indicate that the parser could parse the * prolog (which means the token will not be valid.) * * @see #parseNext * @see #parseFirst(char*,...) * @see #parseFirst(InputSource&,...) */ virtual bool parseFirst ( const XMLCh* const systemId , XMLPScanToken& toFill ) = 0; /** Begin a progressive parse operation * * This method is used to start a progressive parse on a XML file. * To continue parsing, subsequent calls must be to the parseNext * method. * * It scans through the prolog and returns a token to be used on * subsequent scanNext() calls. If the return value is true, then the * token is legal and ready for further use. If it returns false, then * the scan of the prolog failed and the token is not going to work on * subsequent scanNext() calls. * * @param systemId A pointer to a regular native string representing * the path to the XML file to be parsed. * @param toFill A token maintaing state information to maintain * internal consistency between invocation of 'parseNext' * calls. * * @return 'true', if successful in parsing the prolog. It indicates the * user can go ahead with parsing the rest of the file. It * returns 'false' to indicate that the parser could not parse * the prolog. * * @see #parseNext * @see #parseFirst(XMLCh*,...) * @see #parseFirst(InputSource&,...) */ virtual bool parseFirst ( const char* const systemId , XMLPScanToken& toFill ) = 0; /** Begin a progressive parse operation * * This method is used to start a progressive parse on a XML file. * To continue parsing, subsequent calls must be to the parseNext * method. * * It scans through the prolog and returns a token to be used on * subsequent scanNext() calls. If the return value is true, then the * token is legal and ready for further use. If it returns false, then * the scan of the prolog failed and the token is not going to work on * subsequent scanNext() calls. * * @param source A const reference to the InputSource object which * points to the XML file to be parsed. * @param toFill A token maintaing state information to maintain * internal consistency between invocation of 'parseNext' * calls. * * @return 'true', if successful in parsing the prolog. It indicates the * user can go ahead with parsing the rest of the file. It * returns 'false' to indicate that the parser could not parse * the prolog. * * @see #parseNext * @see #parseFirst(XMLCh*,...) * @see #parseFirst(char*,...) */ virtual bool parseFirst ( const InputSource& source , XMLPScanToken& toFill ) = 0; /** Continue a progressive parse operation * * This method is used to continue with progressive parsing of * XML files started by a call to 'parseFirst' method. * * It parses the XML file and stops as soon as it comes across * a XML token (as defined in the XML specification). Relevant * callback handlers are invoked as required by the SAX * specification. * * @param token A token maintaing state information to maintain * internal consistency between invocation of 'parseNext' * calls. * * @return 'true', if successful in parsing the next XML token. * It indicates the user can go ahead with parsing the rest * of the file. It returns 'false' to indicate that the parser * could not find next token as per the XML specification * production rule. * * @see #parseFirst(XMLCh*,...) * @see #parseFirst(char*,...) * @see #parseFirst(InputSource&,...) */ virtual bool parseNext(XMLPScanToken& token) = 0; /** Reset the parser after a progressive parse * * If a progressive parse loop exits before the end of the document * is reached, the parser has no way of knowing this. So it will leave * open any files or sockets or memory buffers that were in use at * the time that the parse loop exited. * * The next parse operation will cause these open files and such to * be closed, but the next parse operation might occur at some unknown * future point. To avoid this problem, you should reset the parser if * you exit the loop early. * * If you exited because of an error, then this cleanup will be done * for you. Its only when you exit the file prematurely of your own * accord, because you've found what you wanted in the file most * likely. * * @param token A token maintaing state information to maintain * internal consistency between invocation of 'parseNext' * calls. */ virtual void parseReset(XMLPScanToken& token) = 0; //@} // ----------------------------------------------------------------------- // Grammar preparsing interface // ----------------------------------------------------------------------- /** @name Grammar preparsing interface's. */ //@{ /** * Preparse schema grammar (XML Schema, DTD, etc.) via an input source * object. * * This method invokes the preparsing process on a schema grammar XML * file specified by the SAX InputSource parameter. If the 'toCache' flag * is enabled, the parser will cache the grammars for re-use. If a grammar * key is found in the pool, no caching of any grammar will take place. * * * @param source A const reference to the SAX InputSource object which * points to the schema grammar file to be preparsed. * @param grammarType The grammar type (Schema or DTD). * @param toCache If true, we cache the preparsed grammar, * otherwise, no caching. Default is false. * @return The preparsed schema grammar object (SchemaGrammar or * DTDGrammar). That grammar object is owned by the parser. * * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @exception XMLException An exception from the parser or client * handler code. * @exception DOMException A DOM exception as per DOM spec. * * @see InputSource#InputSource */ virtual Grammar* loadGrammar(const InputSource& source, const Grammar::GrammarType grammarType, const bool toCache = false) = 0; /** * Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL * * This method invokes the preparsing process on a schema grammar XML * file specified by the file path parameter. If the 'toCache' flag * is enabled, the parser will cache the grammars for re-use. If a grammar * key is found in the pool, no caching of any grammar will take place. * * * @param systemId A const XMLCh pointer to the Unicode string which * contains the path to the XML grammar file to be * preparsed. * @param grammarType The grammar type (Schema or DTD). * @param toCache If true, we cache the preparsed grammar, * otherwise, no caching. Default is false. * @return The preparsed schema grammar object (SchemaGrammar or * DTDGrammar). That grammar object is owned by the parser. * * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @exception XMLException An exception from the parser or client * handler code. * @exception DOMException A DOM exception as per DOM spec. */ virtual Grammar* loadGrammar(const XMLCh* const systemId, const Grammar::GrammarType grammarType, const bool toCache = false) = 0; /** * Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL * * This method invokes the preparsing process on a schema grammar XML * file specified by the file path parameter. If the 'toCache' flag * is enabled, the parser will cache the grammars for re-use. If a grammar * key is found in the pool, no caching of any grammar will take place. * * * @param systemId A const char pointer to a native string which contains * the path to the XML grammar file to be preparsed. * @param grammarType The grammar type (Schema or DTD). * @param toCache If true, we cache the preparsed grammar, * otherwise, no caching. Default is false. * @return The preparsed schema grammar object (SchemaGrammar or * DTDGrammar). That grammar object is owned by the parser. * * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @exception XMLException An exception from the parser or client * handler code. * @exception DOMException A DOM exception as per DOM spec. */ virtual Grammar* loadGrammar(const char* const systemId, const Grammar::GrammarType grammarType, const bool toCache = false) = 0; /** * Clear the cached grammar pool */ virtual void resetCachedGrammarPool() = 0; /** Set maximum input buffer size * * This method allows users to limit the size of buffers used in parsing * XML character data. The effect of setting this size is to limit the * size of a ContentHandler::characters() call. * * The parser's default input buffer size is 1 megabyte. * * @param bufferSize The maximum input buffer size */ virtual void setInputBufferSize(const XMLSize_t bufferSize); //@} // ----------------------------------------------------------------------- // Advanced document handler list maintenance methods // ----------------------------------------------------------------------- /** @name Advanced document handler list maintenance methods */ //@{ /** * This method installs the specified 'advanced' document callback * handler, thereby allowing the user to customize the processing, * if they choose to do so. Any number of advanced callback handlers * maybe installed. * *

The methods in the advanced callback interface represent * Xerces-C extensions. There is no specification for this interface.

* * @param toInstall A pointer to the users advanced callback handler. * * @see #removeAdvDocHandler */ virtual void installAdvDocHandler(XMLDocumentHandler* const toInstall) = 0; /** * This method removes the 'advanced' document handler callback from * the underlying parser scanner. If no handler is installed, advanced * callbacks are not invoked by the scanner. * @param toRemove A pointer to the advanced callback handler which * should be removed. * * @see #installAdvDocHandler */ virtual bool removeAdvDocHandler(XMLDocumentHandler* const toRemove) = 0; //@} private : /* The copy constructor, you cannot call this directly */ SAX2XMLReader(const SAX2XMLReader&); /* The assignment operator, you cannot call this directly */ SAX2XMLReader& operator=(const SAX2XMLReader&); }; inline void SAX2XMLReader::setInputBufferSize(const XMLSize_t /*bufferSize*/) { } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax2/DefaultHandler.hpp000644 000765 000024 00000060717 13241160335 022547 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DefaultHandler.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DEFAULTHANDLER_HPP) #define XERCESC_INCLUDE_GUARD_DEFAULTHANDLER_HPP #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class Locator; class Attributes; /** * Default base class for SAX2 handlers. * *

This class implements the default behaviour for SAX2 * interfaces: EntityResolver, DTDHandler, ContentHandler, * ErrorHandler, LexicalHandler, and DeclHandler.

* *

Application writers can extend this class when they need to * implement only part of an interface; parser writers can * instantiate this class to provide default handlers when the * application has not supplied its own.

* *

Note that the use of this class is optional.

* * @see EntityResolver#EntityResolver * @see DTDHandler#DTDHandler * @see ContentHandler#ContentHandler * @see ErrorHandler#ErrorHandler * @see LexicalHandler#LexicalHandler * @see DeclHandler#DeclHandler */ class SAX2_EXPORT DefaultHandler : public EntityResolver, public DTDHandler, public ContentHandler, public ErrorHandler, public LexicalHandler, public DeclHandler { public: /** @name Default handlers for the DocumentHandler interface */ //@{ /** * Receive notification of character data inside an element. * *

By default, do nothing. Application writers may override this * method to take specific actions for each chunk of character data * (such as adding the data to a node or buffer, or printing it to * a file).

* * @param chars The characters. * @param length The number of characters to use from the * character array. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see DocumentHandler#characters */ virtual void characters ( const XMLCh* const chars , const XMLSize_t length ); /** * Receive notification of the end of the document. * *

By default, do nothing. Application writers may override this * method in a subclass to take specific actions at the beginning * of a document (such as finalising a tree or closing an output * file).

* * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see DocumentHandler#endDocument */ virtual void endDocument(); /** * Receive notification of the end of an element. * *

By default, do nothing. Application writers may override this * method in a subclass to take specific actions at the end of * each element (such as finalising a tree node or writing * output to a file).

* * @param uri The URI of the associated namespace for this element * @param localname The local part of the element name * @param qname The QName of this element * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see DocumentHandler#endElement */ virtual void endElement ( const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname ); /** * Receive notification of ignorable whitespace in element content. * *

By default, do nothing. Application writers may override this * method to take specific actions for each chunk of ignorable * whitespace (such as adding data to a node or buffer, or printing * it to a file).

* * @param chars The whitespace characters. * @param length The number of characters to use from the * character array. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see DocumentHandler#ignorableWhitespace */ virtual void ignorableWhitespace ( const XMLCh* const chars , const XMLSize_t length ); /** * Receive notification of a processing instruction. * *

By default, do nothing. Application writers may override this * method in a subclass to take specific actions for each * processing instruction, such as setting status variables or * invoking other methods.

* * @param target The processing instruction target. * @param data The processing instruction data, or null if * none is supplied. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see DocumentHandler#processingInstruction */ virtual void processingInstruction ( const XMLCh* const target , const XMLCh* const data ); /** * Reset the Document object on its reuse * * @see DocumentHandler#resetDocument */ virtual void resetDocument(); //@} /** @name Default implementation of DocumentHandler interface */ //@{ /** * Receive a Locator object for document events. * *

By default, do nothing. Application writers may override this * method in a subclass if they wish to store the locator for use * with other document events.

* * @param locator A locator for all SAX document events. * @see DocumentHandler#setDocumentLocator * @see Locator */ virtual void setDocumentLocator(const Locator* const locator); /** * Receive notification of the beginning of the document. * *

By default, do nothing. Application writers may override this * method in a subclass to take specific actions at the beginning * of a document (such as allocating the root node of a tree or * creating an output file).

* * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see DocumentHandler#startDocument */ virtual void startDocument(); /** * Receive notification of the start of an element. * *

By default, do nothing. Application writers may override this * method in a subclass to take specific actions at the start of * each element (such as allocating a new tree node or writing * output to a file).

* * @param uri The URI of the associated namespace for this element * @param localname the local part of the element name * @param qname the QName of this element * @param attrs The specified or defaulted attributes. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see DocumentHandler#startElement */ virtual void startElement ( const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname , const Attributes& attrs ); /** * Receive notification of the start of an namespace prefix mapping. * *

By default, do nothing. Application writers may override this * method in a subclass to take specific actions at the start of * each namespace prefix mapping.

* * @param prefix The namespace prefix used * @param uri The namespace URI used. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see DocumentHandler#startPrefixMapping */ virtual void startPrefixMapping ( const XMLCh* const prefix, const XMLCh* const uri ) ; /** * Receive notification of the end of an namespace prefix mapping. * *

By default, do nothing. Application writers may override this * method in a subclass to take specific actions at the end of * each namespace prefix mapping.

* * @param prefix The namespace prefix used * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see DocumentHandler#endPrefixMapping */ virtual void endPrefixMapping ( const XMLCh* const prefix ) ; /** * Receive notification of a skipped entity * *

The parser will invoke this method once for each entity * skipped. All processors may skip external entities, * depending on the values of the features:
* http://xml.org/sax/features/external-general-entities
* http://xml.org/sax/features/external-parameter-entities

* *

Introduced with SAX2

* * @param name The name of the skipped entity. If it is a parameter entity, * the name will begin with %, and if it is the external DTD subset, * it will be the string [dtd]. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void skippedEntity ( const XMLCh* const name ) ; //@} /** @name Default implementation of the EntityResolver interface. */ //@{ /** * Resolve an external entity. * *

Always return null, so that the parser will use the system * identifier provided in the XML document. This method implements * the SAX default behaviour: application writers can override it * in a subclass to do special translations such as catalog lookups * or URI redirection.

* * @param publicId The public identifier, or null if none is * available. * @param systemId The system identifier provided in the XML * document. * @return The new input source, or null to require the * default behaviour. * The returned InputSource is owned by the parser which is * responsible to clean up the memory. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see EntityResolver#resolveEntity */ virtual InputSource* resolveEntity ( const XMLCh* const publicId , const XMLCh* const systemId ); //@} /** @name Default implementation of the ErrorHandler interface */ //@{ /** * Receive notification of a recoverable parser error. * *

The default implementation does nothing. Application writers * may override this method in a subclass to take specific actions * for each error, such as inserting the message in a log file or * printing it to the console.

* * @param exc The warning information encoded as an exception. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see ErrorHandler#warning * @see SAXParseException#SAXParseException */ virtual void error(const SAXParseException& exc); /** * Report a fatal XML parsing error. * *

The default implementation throws a SAXParseException. * Application writers may override this method in a subclass if * they need to take specific actions for each fatal error (such as * collecting all of the errors into a single report): in any case, * the application must stop all regular processing when this * method is invoked, since the document is no longer reliable, and * the parser may no longer report parsing events.

* * @param exc The error information encoded as an exception. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see ErrorHandler#fatalError * @see SAXParseException#SAXParseException */ virtual void fatalError(const SAXParseException& exc); /** * Receive notification of a parser warning. * *

The default implementation does nothing. Application writers * may override this method in a subclass to take specific actions * for each warning, such as inserting the message in a log file or * printing it to the console.

* * @param exc The warning information encoded as an exception. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see ErrorHandler#warning * @see SAXParseException#SAXParseException */ virtual void warning(const SAXParseException& exc); /** * Reset the Error handler object on its reuse * * @see ErrorHandler#resetErrors */ virtual void resetErrors(); //@} /** @name Default implementation of DTDHandler interface. */ //@{ /** * Receive notification of a notation declaration. * *

By default, do nothing. Application writers may override this * method in a subclass if they wish to keep track of the notations * declared in a document.

* * @param name The notation name. * @param publicId The notation public identifier, or null if not * available. * @param systemId The notation system identifier. * @see DTDHandler#notationDecl */ virtual void notationDecl ( const XMLCh* const name , const XMLCh* const publicId , const XMLCh* const systemId ); /** * Reset the DTD object on its reuse * * @see DTDHandler#resetDocType */ virtual void resetDocType(); /** * Receive notification of an unparsed entity declaration. * *

By default, do nothing. Application writers may override this * method in a subclass to keep track of the unparsed entities * declared in a document.

* * @param name The entity name. * @param publicId The entity public identifier, or null if not * available. * @param systemId The entity system identifier. * @param notationName The name of the associated notation. * @see DTDHandler#unparsedEntityDecl */ virtual void unparsedEntityDecl ( const XMLCh* const name , const XMLCh* const publicId , const XMLCh* const systemId , const XMLCh* const notationName ); //@} /** @name Default implementation of LexicalHandler interface. */ //@{ /** * Receive notification of comments. * *

The Parser will call this method to report each occurrence of * a comment in the XML document.

* *

The application must not attempt to read from the array * outside of the specified range.

* * @param chars The characters from the XML document. * @param length The number of characters to read from the array. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void comment ( const XMLCh* const chars , const XMLSize_t length ); /** * Receive notification of the end of a CDATA section. * *

The SAX parser will invoke this method at the end of * each CDATA parsed.

* * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void endCDATA (); /** * Receive notification of the end of the DTD declarations. * *

The SAX parser will invoke this method at the end of the * DTD

* * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void endDTD (); /** * Receive notification of the end of an entity. * *

The SAX parser will invoke this method at the end of an * entity

* * @param name The name of the entity that is ending. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void endEntity (const XMLCh* const name); /** * Receive notification of the start of a CDATA section. * *

The SAX parser will invoke this method at the start of * each CDATA parsed.

* * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void startCDATA (); /** * Receive notification of the start of the DTD declarations. * *

The SAX parser will invoke this method at the start of the * DTD

* * @param name The document type name. * @param publicId The declared public identifier for the external DTD subset, or null if none was declared. * @param systemId The declared system identifier for the external DTD subset, or null if none was declared. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void startDTD ( const XMLCh* const name , const XMLCh* const publicId , const XMLCh* const systemId ); /** * Receive notification of the start of an entity. * *

The SAX parser will invoke this method at the start of an * entity

* * @param name The name of the entity that is starting. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void startEntity (const XMLCh* const name); //@} /** @name Default implementation of DeclHandler interface. */ //@{ /** * Report an element type declaration. * *

The content model will consist of the string "EMPTY", the string * "ANY", or a parenthesised group, optionally followed by an occurrence * indicator. The model will be normalized so that all parameter entities * are fully resolved and all whitespace is removed,and will include the * enclosing parentheses. Other normalization (such as removing redundant * parentheses or simplifying occurrence indicators) is at the discretion * of the parser.

* * @param name The element type name. * @param model The content model as a normalized string. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void elementDecl ( const XMLCh* const name , const XMLCh* const model ); /** * Report an attribute type declaration. * *

Only the effective (first) declaration for an attribute will * be reported.

* * @param eName The name of the associated element. * @param aName The name of the attribute. * @param type A string representing the attribute type. * @param mode A string representing the attribute defaulting mode ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if none of these applies. * @param value A string representing the attribute's default value, or null if there is none. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void attributeDecl ( const XMLCh* const eName , const XMLCh* const aName , const XMLCh* const type , const XMLCh* const mode , const XMLCh* const value ); /** * Report an internal entity declaration. * *

Only the effective (first) declaration for each entity will be * reported. All parameter entities in the value will be expanded, but * general entities will not.

* * @param name The name of the entity. If it is a parameter entity, the name will begin with '%'. * @param value The replacement text of the entity. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void internalEntityDecl ( const XMLCh* const name , const XMLCh* const value ); /** * Report a parsed external entity declaration. * *

Only the effective (first) declaration for each entity will * be reported.

* * @param name The name of the entity. If it is a parameter entity, the name will begin with '%'. * @param publicId The The declared public identifier of the entity, or null if none was declared. * @param systemId The declared system identifier of the entity. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void externalEntityDecl ( const XMLCh* const name , const XMLCh* const publicId , const XMLCh* const systemId ); //@} DefaultHandler() {}; virtual ~DefaultHandler() {}; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DefaultHandler(const DefaultHandler&); DefaultHandler& operator=(const DefaultHandler&); }; // --------------------------------------------------------------------------- // HandlerBase: Inline default implementations // --------------------------------------------------------------------------- inline void DefaultHandler::characters(const XMLCh* const ,const XMLSize_t) { } inline void DefaultHandler::endDocument() { } inline void DefaultHandler::endElement(const XMLCh* const , const XMLCh* const , const XMLCh* const) { } inline void DefaultHandler::error(const SAXParseException&) { } inline void DefaultHandler::fatalError(const SAXParseException& exc) { throw exc; } inline void DefaultHandler::ignorableWhitespace( const XMLCh* const , const XMLSize_t) { } inline void DefaultHandler::notationDecl( const XMLCh* const , const XMLCh* const , const XMLCh* const) { } inline void DefaultHandler::processingInstruction( const XMLCh* const , const XMLCh* const) { } inline void DefaultHandler::resetErrors() { } inline void DefaultHandler::resetDocument() { } inline void DefaultHandler::resetDocType() { } inline InputSource* DefaultHandler::resolveEntity( const XMLCh* const , const XMLCh* const) { return 0; } inline void DefaultHandler::unparsedEntityDecl(const XMLCh* const , const XMLCh* const , const XMLCh* const , const XMLCh* const) { } inline void DefaultHandler::setDocumentLocator(const Locator* const) { } inline void DefaultHandler::startDocument() { } inline void DefaultHandler::startElement( const XMLCh* const , const XMLCh* const , const XMLCh* const , const Attributes& ) { } inline void DefaultHandler::warning(const SAXParseException&) { } inline void DefaultHandler::startPrefixMapping ( const XMLCh* const ,const XMLCh* const) { } inline void DefaultHandler::endPrefixMapping ( const XMLCh* const) { } inline void DefaultHandler::skippedEntity ( const XMLCh* const) { } inline void DefaultHandler::comment( const XMLCh* const , const XMLSize_t) { } inline void DefaultHandler::endCDATA () { } inline void DefaultHandler::endDTD () { } inline void DefaultHandler::endEntity (const XMLCh* const) { } inline void DefaultHandler::startCDATA () { } inline void DefaultHandler::startDTD( const XMLCh* const , const XMLCh* const , const XMLCh* const) { } inline void DefaultHandler::startEntity (const XMLCh* const) { } inline void DefaultHandler::attributeDecl(const XMLCh* const, const XMLCh* const, const XMLCh* const, const XMLCh* const, const XMLCh* const) { } inline void DefaultHandler::elementDecl(const XMLCh* const, const XMLCh* const) { } inline void DefaultHandler::externalEntityDecl(const XMLCh* const, const XMLCh* const, const XMLCh* const) { } inline void DefaultHandler::internalEntityDecl(const XMLCh* const, const XMLCh* const) { } XERCES_CPP_NAMESPACE_END #endif // ! DEFAULTHANDLER_HPP xerces-c-3.2.2/src/xercesc/sax2/LexicalHandler.hpp000644 000765 000024 00000012263 13241160335 022535 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: LexicalHandler.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_LEXICALHANDLER_HPP) #define XERCESC_INCLUDE_GUARD_LEXICALHANDLER_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Receive notification of lexical events. * *

This is an extension handler for that provides lexical information * about an XML document. It does not provide information about document * content. For those events, an application must register an instance of * a ContentHandler.

* *

The order of events in this interface is very important, and * mirrors the order of information in the document itself. For * example, startDTD() and endDTD() events will occur before the * first element in the document.

* * @see SAX2XMLReader#setLexicalHandler * @see SAX2XMLReader#setContentHandler */ class SAX2_EXPORT LexicalHandler { public: /** @name Constructors and Destructor */ //@{ /** Default constructor */ LexicalHandler() { } /** Destructor */ virtual ~LexicalHandler() { } //@} /** @name The virtual document handler interface */ //@{ /** * Receive notification of comments. * *

The Parser will call this method to report each occurrence of * a comment in the XML document.

* *

The application must not attempt to read from the array * outside of the specified range.

* * @param chars The characters from the XML document. * @param length The number of characters to read from the array. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void comment ( const XMLCh* const chars , const XMLSize_t length ) = 0; /** * Receive notification of the end of a CDATA section. * *

The SAX parser will invoke this method at the end of * each CDATA parsed.

* * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void endCDATA () = 0; /** * Receive notification of the end of the DTD declarations. * *

The SAX parser will invoke this method at the end of the * DTD

* * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void endDTD () = 0; /** * Receive notification of the end of an entity. * *

The SAX parser will invoke this method at the end of an * entity

* * @param name The name of the entity that is ending. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void endEntity (const XMLCh* const name) = 0; /** * Receive notification of the start of a CDATA section. * *

The SAX parser will invoke this method at the start of * each CDATA parsed.

* * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void startCDATA () = 0; /** * Receive notification of the start of the DTD declarations. * *

The SAX parser will invoke this method at the start of the * DTD

* * @param name The document type name. * @param publicId The declared public identifier for the external DTD subset, or null if none was declared. * @param systemId The declared system identifier for the external DTD subset, or null if none was declared. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void startDTD ( const XMLCh* const name , const XMLCh* const publicId , const XMLCh* const systemId ) = 0; /** * Receive notification of the start of an entity. * *

The SAX parser will invoke this method at the start of an * entity

* * @param name The name of the entity that is starting. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void startEntity (const XMLCh* const name) = 0; //@} private : /* Unimplemented Constructors and operators */ /* Copy constructor */ LexicalHandler(const LexicalHandler&); /** Assignment operator */ LexicalHandler& operator=(const LexicalHandler&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax2/ContentHandler.hpp000644 000765 000024 00000030044 13241160335 022563 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ContentHandler.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_CONTENTHANDLER_HPP) #define XERCESC_INCLUDE_GUARD_CONTENTHANDLER_HPP #include XERCES_CPP_NAMESPACE_BEGIN class Attributes; class Locator; /** * Receive notification of general document events. * *

This is the main interface that most SAX2 applications * implement: if the application needs to be informed of basic parsing * events, it implements this interface and registers an instance with * the SAX2 parser using the setDocumentHandler method. The parser * uses the instance to report basic document-related events like * the start and end of elements and character data.

* *

The order of events in this interface is very important, and * mirrors the order of information in the document itself. For * example, all of an element's content (character data, processing * instructions, and/or subelements) will appear, in order, between * the startElement event and the corresponding endElement event.

* *

Application writers who do not want to implement the entire * interface while can derive a class from Sax2HandlerBase, which implements * the default functionality; parser writers can instantiate * Sax2HandlerBase to obtain a default handler. The application can find * the location of any document event using the Locator interface * supplied by the Parser through the setDocumentLocator method.

* * @see Parser#setDocumentHandler * @see Locator#Locator * @see Sax2HandlerBase#Sax2HandlerBase */ class SAX2_EXPORT ContentHandler { public: /** @name Constructors and Destructor */ //@{ /** Default constructor */ ContentHandler() { } /** Destructor */ virtual ~ContentHandler() { } //@} /** @name The virtual document handler interface */ //@{ /** * Receive notification of character data. * *

The Parser will call this method to report each chunk of * character data. SAX parsers may return all contiguous character * data in a single chunk, or they may split it into several * chunks; however, all of the characters in any single event * must come from the same external entity, so that the Locator * provides useful information.

* *

The application must not attempt to read from the array * outside of the specified range.

* *

Note that some parsers will report whitespace using the * ignorableWhitespace() method rather than this one (validating * parsers must do so).

* * @param chars The characters from the XML document. * @param length The number of characters to read from the array. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see #ignorableWhitespace * @see Locator#Locator */ virtual void characters ( const XMLCh* const chars , const XMLSize_t length ) = 0; /** * Receive notification of the end of a document. * *

The SAX parser will invoke this method only once, and it will * be the last method invoked during the parse. The parser shall * not invoke this method until it has either abandoned parsing * (because of an unrecoverable error) or reached the end of * input.

* * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void endDocument () = 0; /** * Receive notification of the end of an element. * *

The SAX parser will invoke this method at the end of every * element in the XML document; there will be a corresponding * startElement() event for every endElement() event (even when the * element is empty).

* * @param uri The URI of the associated namespace for this element * @param localname The local part of the element name * @param qname The QName of this element * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void endElement ( const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname ) = 0; /** * Receive notification of ignorable whitespace in element content. * *

Validating Parsers must use this method to report each chunk * of ignorable whitespace (see the W3C XML 1.0 recommendation, * section 2.10): non-validating parsers may also use this method * if they are capable of parsing and using content models.

* *

SAX parsers may return all contiguous whitespace in a single * chunk, or they may split it into several chunks; however, all of * the characters in any single event must come from the same * external entity, so that the Locator provides useful * information.

* *

The application must not attempt to read from the array * outside of the specified range.

* * @param chars The characters from the XML document. * @param length The number of characters to read from the array. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see #characters */ virtual void ignorableWhitespace ( const XMLCh* const chars , const XMLSize_t length ) = 0; /** * Receive notification of a processing instruction. * *

The Parser will invoke this method once for each processing * instruction found: note that processing instructions may occur * before or after the main document element.

* *

A SAX parser should never report an XML declaration (XML 1.0, * section 2.8) or a text declaration (XML 1.0, section 4.3.1) * using this method.

* * @param target The processing instruction target. * @param data The processing instruction data, or null if * none was supplied. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void processingInstruction ( const XMLCh* const target , const XMLCh* const data ) = 0; /** * Receive an object for locating the origin of SAX document events. * * SAX parsers are strongly encouraged (though not absolutely * required) to supply a locator: if it does so, it must supply * the locator to the application by invoking this method before * invoking any of the other methods in the DocumentHandler * interface. * * The locator allows the application to determine the end * position of any document-related event, even if the parser is * not reporting an error. Typically, the application will * use this information for reporting its own errors (such as * character content that does not match an application's * business rules). The information returned by the locator * is probably not sufficient for use with a search engine. * * Note that the locator will return correct information only * during the invocation of the events in this interface. The * application should not attempt to use it at any other time. * * @param locator An object that can return the location of * any SAX document event. The object is only * 'on loan' to the client code and they are not * to attempt to delete or modify it in any way! * * @see Locator#Locator */ virtual void setDocumentLocator(const Locator* const locator) = 0; /** * Receive notification of the beginning of a document. * *

The SAX parser will invoke this method only once, before any * other methods in this interface or in DTDHandler (except for * setDocumentLocator).

* * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void startDocument() = 0; /** * Receive notification of the beginning of an element. * *

The Parser will invoke this method at the beginning of every * element in the XML document; there will be a corresponding * endElement() event for every startElement() event (even when the * element is empty). All of the element's content will be * reported, in order, before the corresponding endElement() * event.

* *

Note that the attribute list provided will * contain only attributes with explicit values (specified or * defaulted): \#IMPLIED attributes will be omitted.

* * @param uri The URI of the associated namespace for this element * @param localname The local part of the element name * @param qname The QName of this element * @param attrs The attributes attached to the element, if any. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see #endElement * @see Attributes#Attributes */ virtual void startElement ( const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname, const Attributes& attrs ) = 0; /** * Receive notification of the start of an namespace prefix mapping. * *

By default, do nothing. Application writers may override this * method in a subclass to take specific actions at the start of * each namespace prefix mapping.

* * @param prefix The namespace prefix used * @param uri The namespace URI used. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void startPrefixMapping ( const XMLCh* const prefix, const XMLCh* const uri ) = 0 ; /** * Receive notification of the end of an namespace prefix mapping. * *

By default, do nothing. Application writers may override this * method in a subclass to take specific actions at the end of * each namespace prefix mapping.

* * @param prefix The namespace prefix used * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void endPrefixMapping ( const XMLCh* const prefix ) = 0 ; /** * Receive notification of a skipped entity * *

The parser will invoke this method once for each entity * skipped. All processors may skip external entities, * depending on the values of the features:
* http://xml.org/sax/features/external-general-entities
* http://xml.org/sax/features/external-parameter-entities

* *

Note: Xerces (specifically) never skips any entities, regardless * of the above features. This function is never called in the * Xerces implementation of SAX2.

* *

Introduced with SAX2

* * @param name The name of the skipped entity. If it is a parameter entity, * the name will begin with %, and if it is the external DTD subset, * it will be the string [dtd]. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void skippedEntity ( const XMLCh* const name ) = 0 ; //@} private : /* Unimplemented Constructors and operators */ /* Copy constructor */ ContentHandler(const ContentHandler&); /** Assignment operator */ ContentHandler& operator=(const ContentHandler&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax2/XMLReaderFactory.hpp000644 000765 000024 00000004573 13241160335 022776 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLReaderFactory.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLREADERFACTORY_HPP) #define XERCESC_INCLUDE_GUARD_XMLREADERFACTORY_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class MemoryManager; class XMLGrammarPool; /** * Creates a SAX2 parser (SAX2XMLReader). * *

Note: The parser object returned by XMLReaderFactory is owned by the * calling users, and it's the responsibility of the users to delete that * parser object, once they no longer need it.

* * @see SAX2XMLReader#SAX2XMLReader */ class SAX2_EXPORT XMLReaderFactory { protected: // really should be private, but that causes compiler warnings. XMLReaderFactory() ; ~XMLReaderFactory() ; public: static SAX2XMLReader * createXMLReader( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager , XMLGrammarPool* const gramPool = 0 ) ; static SAX2XMLReader * createXMLReader(const XMLCh* className) ; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLReaderFactory(const XMLReaderFactory&); XMLReaderFactory& operator=(const XMLReaderFactory&); }; inline SAX2XMLReader * XMLReaderFactory::createXMLReader(const XMLCh *) { throw SAXNotSupportedException(); // unimplemented return 0; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/XSAXMLScanner.hpp000644 000765 000024 00000007162 13241160334 023144 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSAXMLScanner.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSAXMLSCANNER_HPP) #define XERCESC_INCLUDE_GUARD_XSAXMLSCANNER_HPP #include XERCES_CPP_NAMESPACE_BEGIN // // This is a scanner class, which processes/validates contents of XML Schema // Annotations. It's intended for internal use only. // class XMLPARSER_EXPORT XSAXMLScanner : public SGXMLScanner { public : // ----------------------------------------------------------------------- // Destructor // ----------------------------------------------------------------------- virtual ~XSAXMLScanner(); // ----------------------------------------------------------------------- // XMLScanner public virtual methods // ----------------------------------------------------------------------- virtual const XMLCh* getName() const; protected: // ----------------------------------------------------------------------- // Constructors // ----------------------------------------------------------------------- /** * The grammar representing the XML Schema annotation (xsaGrammar) is * passed in by the caller. The scanner will own it and is responsible * for deleting it. */ XSAXMLScanner ( GrammarResolver* const grammarResolver , XMLStringPool* const uriStringPool , SchemaGrammar* const xsaGrammar , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); friend class TraverseSchema; // ----------------------------------------------------------------------- // XMLScanner virtual methods // ----------------------------------------------------------------------- virtual void scanReset(const InputSource& src); // ----------------------------------------------------------------------- // SGXMLScanner virtual methods // ----------------------------------------------------------------------- virtual bool scanStartTag(bool& gotData); virtual void scanEndTag(bool& gotData); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSAXMLScanner(); XSAXMLScanner(const XSAXMLScanner&); XSAXMLScanner& operator=(const XSAXMLScanner&); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void scanRawAttrListforNameSpaces(XMLSize_t attCount); void switchGrammar(const XMLCh* const newGrammarNameSpace, bool laxValidate); }; inline const XMLCh* XSAXMLScanner::getName() const { return XMLUni::fgXSAXMLScanner; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/ReaderMgr.hpp000644 000765 000024 00000036216 13241160334 022470 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ReaderMgr.hpp 833045 2009-11-05 13:21:27Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_READERMGR_HPP) #define XERCESC_INCLUDE_GUARD_READERMGR_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLEntityDecl; class XMLEntityHandler; class XMLDocumentHandler; class XMLScanner; // --------------------------------------------------------------------------- // This class is used by the scanner. The scanner must deal with expansion // of entities, some of which are totally different files (external parsed // entities.) It does so by pushing readers onto a stack. The top reader is // the one it wants to read out of, but that one must be popped when it is // empty. To keep that logic from being all over the place, the scanner // talks to the reader manager, which handles the stack and popping off // used up readers. // --------------------------------------------------------------------------- class XMLPARSER_EXPORT ReaderMgr : public XMemory , public Locator { public : // ----------------------------------------------------------------------- // Class specific types // ----------------------------------------------------------------------- struct LastExtEntityInfo : public XMemory { const XMLCh* systemId; const XMLCh* publicId; XMLFileLoc lineNumber; XMLFileLoc colNumber; }; // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- ReaderMgr(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~ReaderMgr(); // ----------------------------------------------------------------------- // Convenience scanning methods // // This are all convenience methods that work in terms of the core // character spooling methods. // ----------------------------------------------------------------------- bool atEOF() const; bool getName(XMLBuffer& toFill); bool getQName(XMLBuffer& toFill, int* colonPosition); bool getNameToken(XMLBuffer& toFill); XMLCh getNextChar(); bool getNextCharIfNot(const XMLCh chNotToGet, XMLCh& chGotten); void movePlainContentChars(XMLBuffer &dest); void getSpaces(XMLBuffer& toFill); void getUpToCharOrWS(XMLBuffer& toFill, const XMLCh toCheck); bool isEmpty() const; bool lookingAtChar(const XMLCh toCheck); bool lookingAtSpace(); XMLCh peekNextChar(); bool skipIfQuote(XMLCh& chGotten); void skipPastChar(const XMLCh toSkip); void skipPastSpaces(bool& skippedSomething, bool inDecl = false); void skipPastSpaces(); void skipToChar(const XMLCh toSkipTo); bool skippedChar(const XMLCh toSkip); bool skippedSpace(); bool skippedString(const XMLCh* const toSkip); bool skippedStringLong(const XMLCh* const toSkip); void skipQuotedString(const XMLCh quoteCh); XMLCh skipUntilIn(const XMLCh* const listToSkip); XMLCh skipUntilInOrWS(const XMLCh* const listToSkip); bool peekString(const XMLCh* const toPeek); // ----------------------------------------------------------------------- // Control methods // ----------------------------------------------------------------------- void cleanStackBackTo(const XMLSize_t readerNum); XMLReader* createReader ( const InputSource& src , const bool xmlDecl , const XMLReader::RefFrom refFrom , const XMLReader::Types type , const XMLReader::Sources source , const bool calcSrsOfs = true , XMLSize_t lowWaterMark = 100 ); XMLReader* createReader ( const XMLCh* const sysId , const XMLCh* const pubId , const bool xmlDecl , const XMLReader::RefFrom refFrom , const XMLReader::Types type , const XMLReader::Sources source , InputSource*& srcToFill , const bool calcSrcOfs = true , XMLSize_t lowWaterMark = 100 , const bool disableDefaultEntityResolution = false ); XMLReader* createReader ( const XMLCh* const baseURI , const XMLCh* const sysId , const XMLCh* const pubId , const bool xmlDecl , const XMLReader::RefFrom refFrom , const XMLReader::Types type , const XMLReader::Sources source , InputSource*& srcToFill , const bool calcSrcOfs = true , XMLSize_t lowWaterMark = 100 , const bool disableDefaultEntityResolution = false ); XMLReader* createIntEntReader ( const XMLCh* const sysId , const XMLReader::RefFrom refFrom , const XMLReader::Types type , const XMLCh* const dataBuf , const XMLSize_t dataLen , const bool copyBuf , const bool calcSrcOfs = true , XMLSize_t lowWaterMark = 100 ); bool isScanningPERefOutOfLiteral() const; bool pushReader ( XMLReader* const reader , XMLEntityDecl* const entity ); void reset(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- const XMLCh* getCurrentEncodingStr() const; const XMLEntityDecl* getCurrentEntity() const; XMLEntityDecl* getCurrentEntity(); const XMLReader* getCurrentReader() const; XMLReader* getCurrentReader(); XMLSize_t getCurrentReaderNum() const; XMLSize_t getReaderDepth() const; void getLastExtEntityInfo(LastExtEntityInfo& lastInfo) const; XMLFilePos getSrcOffset() const; bool getThrowEOE() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setEntityHandler(XMLEntityHandler* const newHandler); void setThrowEOE(const bool newValue); void setXMLVersion(const XMLReader::XMLVersion version); void setStandardUriConformant(const bool newValue); // ----------------------------------------------------------------------- // Implement the SAX Locator interface // ----------------------------------------------------------------------- virtual const XMLCh* getPublicId() const; virtual const XMLCh* getSystemId() const; virtual XMLFileLoc getLineNumber() const; virtual XMLFileLoc getColumnNumber() const; private : // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- const XMLReader* getLastExtEntity(const XMLEntityDecl*& itsEntity) const; bool popReader(); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ReaderMgr(const ReaderMgr&); ReaderMgr& operator=(const ReaderMgr&); // ----------------------------------------------------------------------- // Private data members // // fCurEntity // This is the current top of stack entity. We pull it off the stack // and store it here for efficiency. // // fCurReader // This is the current top of stack reader. We pull it off the // stack and store it here for efficiency. // // fEntityHandler // This is the installed entity handler. Its installed via the // scanner but he passes it on to us since we need it the most, in // process of creating external entity readers. // // fEntityStack // We need to keep up with which of the pushed readers are pushed // entity values that are being spooled. This is done to avoid the // problem of recursive definitions. This stack consists of refs to // EntityDecl objects for the pushed entities. // // fNextReaderNum // This is the reader serial number value. Each new reader that is // created from this reader is given a successive number. This lets // us catch things like partial markup errors and such. // // fReaderStack // This is the stack of reader references. We own all the readers // and destroy them when they are used up. // // fThrowEOE // This flag controls whether we throw an exception when we hit an // end of entity. The scanner doesn't really need to know about ends // of entities in the int/ext subsets, so it will turn this flag off // until it gets into the content usually. // // fXMLVersion // Enum to indicate if each Reader should be created as XML 1.1 or // XML 1.0 conformant // // fStandardUriConformant // This flag controls whether we force conformant URI // ----------------------------------------------------------------------- XMLEntityDecl* fCurEntity; XMLReader* fCurReader; XMLEntityHandler* fEntityHandler; RefStackOf* fEntityStack; unsigned int fNextReaderNum; RefStackOf* fReaderStack; bool fThrowEOE; XMLReader::XMLVersion fXMLVersion; bool fStandardUriConformant; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // ReaderMgr: Inlined methods // // NOTE: We cannot put these in alphabetical and type order as we usually // do because some of the compilers we have to support are too stupid to // understand out of order inlines! // --------------------------------------------------------------------------- inline XMLSize_t ReaderMgr::getCurrentReaderNum() const { return fCurReader->getReaderNum(); } inline const XMLReader* ReaderMgr::getCurrentReader() const { return fCurReader; } inline XMLReader* ReaderMgr::getCurrentReader() { return fCurReader; } inline bool ReaderMgr::getName(XMLBuffer& toFill) { toFill.reset(); return fCurReader->getName(toFill, false); } inline bool ReaderMgr::getQName(XMLBuffer& toFill, int *colonPosition) { toFill.reset(); return fCurReader->getQName(toFill, colonPosition); } inline bool ReaderMgr::getNameToken(XMLBuffer& toFill) { toFill.reset(); return fCurReader->getName(toFill, true); } inline bool ReaderMgr::getNextCharIfNot(const XMLCh chNotToGet, XMLCh& chGotten) { return fCurReader->getNextCharIfNot(chNotToGet, chGotten); } inline void ReaderMgr::movePlainContentChars(XMLBuffer &dest) { fCurReader->movePlainContentChars(dest); } inline bool ReaderMgr::getThrowEOE() const { return fThrowEOE; } inline XMLFilePos ReaderMgr::getSrcOffset() const { return fCurReader? fCurReader->getSrcOffset() : 0; } inline bool ReaderMgr::lookingAtChar(const XMLCh chToCheck) { return (chToCheck == peekNextChar()); } inline bool ReaderMgr::lookingAtSpace() { XMLCh c = peekNextChar(); return fCurReader->isWhitespace(c); } inline void ReaderMgr::setThrowEOE(const bool newValue) { fThrowEOE = newValue; } inline void ReaderMgr::setStandardUriConformant(const bool newValue) { fStandardUriConformant = newValue; } inline bool ReaderMgr::skippedString(const XMLCh* const toSkip) { return fCurReader->skippedString(toSkip); } inline bool ReaderMgr::skippedStringLong(const XMLCh* const toSkip) { return fCurReader->skippedStringLong(toSkip); } inline void ReaderMgr::skipToChar(const XMLCh toSkipTo) { XMLCh nextCh = 0; do { // Get chars until we find the one to skip nextCh = getNextChar(); } // Break out at end of input or the char to skip while((nextCh != toSkipTo) && nextCh!=0); } inline void ReaderMgr::skipPastChar(const XMLCh toSkipPast) { XMLCh nextCh = 0; do { // Get chars until we find the one to skip nextCh = getNextChar(); } while((nextCh != toSkipPast) && nextCh!=0); } inline bool ReaderMgr::peekString(const XMLCh* const toPeek) { return fCurReader->peekString(toPeek); } inline void ReaderMgr::setEntityHandler(XMLEntityHandler* const newHandler) { fEntityHandler = newHandler; } inline void ReaderMgr::setXMLVersion(const XMLReader::XMLVersion version) { fXMLVersion = version; fCurReader->setXMLVersion(version); } // // This is a simple class to temporarily change the 'throw at end of entity' // flag of the reader manager. There are some places where we need to // turn this on and off on a scoped basis. // class XMLPARSER_EXPORT ThrowEOEJanitor { public : // ----------------------------------------------------------------------- // Constructors and destructor // ----------------------------------------------------------------------- ThrowEOEJanitor(ReaderMgr* mgrTarget, const bool newValue) : fOld(mgrTarget->getThrowEOE()) , fMgr(mgrTarget) { mgrTarget->setThrowEOE(newValue); } ~ThrowEOEJanitor() { fMgr->setThrowEOE(fOld); }; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ThrowEOEJanitor(const ThrowEOEJanitor&); ThrowEOEJanitor& operator=(const ThrowEOEJanitor&); // ----------------------------------------------------------------------- // Private data members // // fOld // The previous value of the flag, which we replaced during ctor, // and will replace during dtor. // // fMgr // A pointer to the reader manager we are going to set/reset the // flag on. // ----------------------------------------------------------------------- bool fOld; ReaderMgr* fMgr; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/XProtoType.cpp000644 000765 000024 00000006457 13241160334 022714 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XProtoType.cpp 834826 2009-11-11 10:03:53Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN /*** * * write the length of the class name * write the class name * ***/ void XProtoType::store(XSerializeEngine& serEng) const { XMLSize_t strLen = XMLString::stringLen((char*)fClassName); serEng << (unsigned long)strLen; serEng.write(fClassName, strLen * sizeof(XMLByte)); } /*** * * To verify that the content in the binary stream * is the same as this class * ***/ void XProtoType::load(XSerializeEngine& serEng , XMLByte* const inName , MemoryManager* const manager) { if (!inName) { ThrowXMLwithMemMgr(XSerializationException , XMLExcepts::XSer_ProtoType_Null_ClassName, manager); } // read and check class name length XMLSize_t inNameLen = XMLString::stringLen((char*)inName); XMLSize_t classNameLen = 0; serEng >> (unsigned long&)classNameLen; if (classNameLen != inNameLen) { XMLCh value1[17]; XMLCh value2[17]; XMLString::sizeToText(inNameLen, value1, 16, 10, manager); XMLString::sizeToText(classNameLen, value2, 16, 10, manager); ThrowXMLwithMemMgr2(XSerializationException , XMLExcepts::XSer_ProtoType_NameLen_Dif , value1 , value2 , manager); } // read and check class name XMLByte className[256]; serEng.read(className, classNameLen*sizeof(XMLByte)); className[classNameLen] = '\0'; if ( !XMLString::equals((char*)className, (char*)inName)) { //we don't have class name exceed this length in xerces XMLCh name1[256]; XMLCh name2[256]; XMLCh *tmp = XMLString::transcode((char*)inName, manager); XMLString::copyNString(name1, tmp, 255); manager->deallocate(tmp); tmp = XMLString::transcode((char*)className, manager); XMLString::copyNString(name2, tmp, 255); manager->deallocate(tmp); ThrowXMLwithMemMgr2(XSerializationException , XMLExcepts::XSer_ProtoType_Name_Dif , name1 , name2 , manager); } return; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/DGXMLScanner.cpp000644 000765 000024 00000375612 13241160334 023006 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DGXMLScanner.cpp 1517488 2013-08-26 10:33:26Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN typedef JanitorMemFunCall CleanupType; typedef JanitorMemFunCall ReaderMgrResetType; // --------------------------------------------------------------------------- // DGXMLScanner: Constructors and Destructor // --------------------------------------------------------------------------- DGXMLScanner::DGXMLScanner(XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager) : XMLScanner(valToAdopt, grammarResolver, manager) , fAttrNSList(0) , fDTDValidator(0) , fDTDGrammar(0) , fDTDElemNonDeclPool(0) , fElemCount(0) , fAttDefRegistry(0) , fUndeclaredAttrRegistry(0) { CleanupType cleanup(this, &DGXMLScanner::cleanUp); try { commonInit(); } catch(const OutOfMemoryException&) { // Don't cleanup when out of memory, since executing the // code can cause problems. cleanup.release(); throw; } cleanup.release(); } DGXMLScanner::DGXMLScanner( XMLDocumentHandler* const docHandler , DocTypeHandler* const docTypeHandler , XMLEntityHandler* const entityHandler , XMLErrorReporter* const errHandler , XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager) : XMLScanner(docHandler, docTypeHandler, entityHandler, errHandler, valToAdopt, grammarResolver, manager) , fAttrNSList(0) , fDTDValidator(0) , fDTDGrammar(0) , fDTDElemNonDeclPool(0) , fElemCount(0) , fAttDefRegistry(0) , fUndeclaredAttrRegistry(0) { CleanupType cleanup(this, &DGXMLScanner::cleanUp); try { commonInit(); } catch(const OutOfMemoryException&) { // Don't cleanup when out of memory, since executing the // code can cause problems. cleanup.release(); throw; } cleanup.release(); } DGXMLScanner::~DGXMLScanner() { cleanUp(); } // --------------------------------------------------------------------------- // XMLScanner: Getter methods // --------------------------------------------------------------------------- NameIdPool* DGXMLScanner::getEntityDeclPool() { if(!fGrammar) return 0; return ((DTDGrammar*)fGrammar)->getEntityDeclPool(); } const NameIdPool* DGXMLScanner::getEntityDeclPool() const { if(!fGrammar) return 0; return ((DTDGrammar*)fGrammar)->getEntityDeclPool(); } // --------------------------------------------------------------------------- // DGXMLScanner: Main entry point to scan a document // --------------------------------------------------------------------------- void DGXMLScanner::scanDocument(const InputSource& src) { // Bump up the sequence id for this parser instance. This will invalidate // any previous progressive scan tokens. fSequenceId++; ReaderMgrResetType resetReaderMgr(&fReaderMgr, &ReaderMgr::reset); try { // Reset the scanner and its plugged in stuff for a new run. This // resets all the data structures, creates the initial reader and // pushes it on the stack, and sets up the base document path. scanReset(src); // If we have a document handler, then call the start document if (fDocHandler) fDocHandler->startDocument(); // Scan the prolog part, which is everything before the root element // including the DTD subsets. scanProlog(); // If we got to the end of input, then its not a valid XML file. // Else, go on to scan the content. if (fReaderMgr.atEOF()) { emitError(XMLErrs::EmptyMainEntity); } else { // Scan content, and tell it its not an external entity if (scanContent()) { // Do post-parse validation if required if (fValidate) { // We handle ID reference semantics at this level since // its required by XML 1.0. checkIDRefs(); // Then allow the validator to do any extra stuff it wants // fValidator->postParseValidation(); } // That went ok, so scan for any miscellaneous stuff if (!fReaderMgr.atEOF()) scanMiscellaneous(); } } // If we have a document handler, then call the end document if (fDocHandler) fDocHandler->endDocument(); } // NOTE: // // In all of the error processing below, the emitError() call MUST come // before the flush of the reader mgr, or it will fail because it tries // to find out the position in the XML source of the error. catch(const XMLErrs::Codes) { // This is a 'first failure' exception, so fall through } catch(const XMLValid::Codes) { // This is a 'first fatal error' type exit, so fall through } catch(const XMLException& excToCatch) { // Emit the error and catch any user exception thrown from here. Make // sure in all cases we flush the reader manager. fInException = true; try { if (excToCatch.getErrorType() == XMLErrorReporter::ErrType_Warning) emitError ( XMLErrs::XMLException_Warning , excToCatch.getCode() , excToCatch.getMessage() ); else if (excToCatch.getErrorType() >= XMLErrorReporter::ErrType_Fatal) emitError ( XMLErrs::XMLException_Fatal , excToCatch.getCode() , excToCatch.getMessage() ); else emitError ( XMLErrs::XMLException_Error , excToCatch.getCode() , excToCatch.getMessage() ); } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } } bool DGXMLScanner::scanNext(XMLPScanToken& token) { // Make sure this token is still legal if (!isLegalToken(token)) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Scan_BadPScanToken, fMemoryManager); // Find the next token and remember the reader id XMLSize_t orgReader; XMLTokens curToken; ReaderMgrResetType resetReaderMgr(&fReaderMgr, &ReaderMgr::reset); bool retVal = true; try { while (true) { // We have to handle any end of entity exceptions that happen here. // We could be at the end of X nested entities, each of which will // generate an end of entity exception as we try to move forward. try { curToken = senseNextToken(orgReader); break; } catch(const EndOfEntityException& toCatch) { // Send an end of entity reference event if (fDocHandler) fDocHandler->endEntityReference(toCatch.getEntity()); } } if (curToken == Token_CharData) { scanCharData(fCDataBuf); } else if (curToken == Token_EOF) { if (!fElemStack.isEmpty()) { const ElemStack::StackElem* topElem = fElemStack.popTop(); emitError ( XMLErrs::EndedWithTagsOnStack , topElem->fThisElement->getFullName() ); } retVal = false; } else { // Its some sort of markup bool gotData = true; switch(curToken) { case Token_CData : // Make sure we are within content if (fElemStack.isEmpty()) emitError(XMLErrs::CDATAOutsideOfContent); scanCDSection(); break; case Token_Comment : scanComment(); break; case Token_EndTag : scanEndTag(gotData); break; case Token_PI : scanPI(); break; case Token_StartTag : if (fDoNamespaces) scanStartTagNS(gotData); else scanStartTag(gotData); break; default : fReaderMgr.skipToChar(chOpenAngle); break; } if (orgReader != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialMarkupInEntity); // If we hit the end, then do the miscellaneous part if (!gotData) { // Do post-parse validation if required if (fValidate) { // We handle ID reference semantics at this level since // its required by XML 1.0. checkIDRefs(); // Then allow the validator to do any extra stuff it wants // fValidator->postParseValidation(); } // That went ok, so scan for any miscellaneous stuff scanMiscellaneous(); if (fDocHandler) fDocHandler->endDocument(); } } } // NOTE: // // In all of the error processing below, the emitError() call MUST come // before the flush of the reader mgr, or it will fail because it tries // to find out the position in the XML source of the error. catch(const XMLErrs::Codes) { // This is a 'first failure' exception, so return failure retVal = false; } catch(const XMLValid::Codes) { // This is a 'first fatal error' type exit, so return failure retVal = false; } catch(const XMLException& excToCatch) { // Emit the error and catch any user exception thrown from here. Make // sure in all cases we flush the reader manager. fInException = true; try { if (excToCatch.getErrorType() == XMLErrorReporter::ErrType_Warning) emitError ( XMLErrs::XMLException_Warning , excToCatch.getCode() , excToCatch.getMessage() ); else if (excToCatch.getErrorType() >= XMLErrorReporter::ErrType_Fatal) emitError ( XMLErrs::XMLException_Fatal , excToCatch.getCode() , excToCatch.getMessage() ); else emitError ( XMLErrs::XMLException_Error , excToCatch.getCode() , excToCatch.getMessage() ); } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } retVal = false; } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } // If we are not at the end, release the object that will // reset the ReaderMgr. if (retVal) resetReaderMgr.release(); return retVal; } // --------------------------------------------------------------------------- // DGXMLScanner: Private scanning methods // --------------------------------------------------------------------------- // This method will kick off the scanning of the primary content of the // document, i.e. the elements. bool DGXMLScanner::scanContent() { // Go into a loop until we hit the end of the root element, or we fall // out because there is no root element. // // We have to do kind of a deeply nested double loop here in order to // avoid doing the setup/teardown of the exception handler on each // round. Doing it this way we only do it when an exception actually // occurs. bool gotData = true; bool inMarkup = false; while (gotData) { try { while (gotData) { // Sense what the next top level token is. According to what // this tells us, we will call something to handle that kind // of thing. XMLSize_t orgReader; const XMLTokens curToken = senseNextToken(orgReader); // Handle character data and end of file specially. Char data // is not markup so we don't want to handle it in the loop // below. if (curToken == Token_CharData) { // Scan the character data and call appropriate events. Let // him use our local character data buffer for efficiency. scanCharData(fCDataBuf); continue; } else if (curToken == Token_EOF) { // The element stack better be empty at this point or we // ended prematurely before all elements were closed. if (!fElemStack.isEmpty()) { const ElemStack::StackElem* topElem = fElemStack.popTop(); emitError ( XMLErrs::EndedWithTagsOnStack , topElem->fThisElement->getFullName() ); } // Its the end of file, so clear the got data flag gotData = false; continue; } // We are in some sort of markup now inMarkup = true; // According to the token we got, call the appropriate // scanning method. switch(curToken) { case Token_CData : // Make sure we are within content if (fElemStack.isEmpty()) emitError(XMLErrs::CDATAOutsideOfContent); scanCDSection(); break; case Token_Comment : scanComment(); break; case Token_EndTag : scanEndTag(gotData); break; case Token_PI : scanPI(); break; case Token_StartTag : if (fDoNamespaces) scanStartTagNS(gotData); else scanStartTag(gotData); break; default : fReaderMgr.skipToChar(chOpenAngle); break; } if (orgReader != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialMarkupInEntity); // And we are back out of markup again inMarkup = false; } } catch(const EndOfEntityException& toCatch) { // If we were in some markup when this happened, then its a // partial markup error. if (inMarkup) emitError(XMLErrs::PartialMarkupInEntity); // Send an end of entity reference event if (fDocHandler) fDocHandler->endEntityReference(toCatch.getEntity()); inMarkup = false; } } // It went ok, so return success return true; } void DGXMLScanner::scanEndTag(bool& gotData) { // Assume we will still have data until proven otherwise. It will only // ever be false if this is the end of the root element. gotData = true; // Check if the element stack is empty. If so, then this is an unbalanced // element (i.e. more ends than starts, perhaps because of bad text // causing one to be skipped.) if (fElemStack.isEmpty()) { emitError(XMLErrs::MoreEndThanStartTags); fReaderMgr.skipPastChar(chCloseAngle); ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Scan_UnbalancedStartEnd, fMemoryManager); } // Pop the stack of the element we are supposed to be ending. Remember // that we don't own this. The stack just keeps them and reuses them. unsigned int uriId = (fDoNamespaces) ? fElemStack.getCurrentURI() : fEmptyNamespaceId; // Pop the stack of the element we are supposed to be ending. Remember // that we don't own this. The stack just keeps them and reuses them. const ElemStack::StackElem* topElem = fElemStack.popTop(); XMLElementDecl *tempElement = topElem->fThisElement; // See if it was the root element, to avoid multiple calls below const bool isRoot = fElemStack.isEmpty(); // Make sure that its the end of the element that we expect if (!fReaderMgr.skippedStringLong(tempElement->getFullName())) { emitError ( XMLErrs::ExpectedEndOfTagX , tempElement->getFullName() ); fReaderMgr.skipPastChar(chCloseAngle); return; } // Make sure we are back on the same reader as where we started if (topElem->fReaderNum != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialTagMarkupError); // Skip optional whitespace fReaderMgr.skipPastSpaces(); // Make sure we find the closing bracket if (!fReaderMgr.skippedChar(chCloseAngle)) { emitError ( XMLErrs::UnterminatedEndTag , topElem->fThisElement->getFullName() ); } // If validation is enabled, then lets pass him the list of children and // this element and let him validate it. if (fValidate) { // // XML1.0-3rd // Validity Constraint: // The declaration matches EMPTY and the element has no content (not even // entity references, comments, PIs or white space). // if ( (topElem->fCommentOrPISeen) && (((DTDElementDecl*) topElem->fThisElement)->getModelType() == DTDElementDecl::Empty)) { fValidator->emitError ( XMLValid::EmptyElemHasContent , topElem->fThisElement->getFullName() ); } // // XML1.0-3rd // Validity Constraint: // // The declaration matches children and the sequence of child elements // belongs to the language generated by the regular expression in the // content model, with optional white space, comments and PIs // (i.e. markup matching production [27] Misc) between the start-tag and // the first child element, between child elements, or between the last // child element and the end-tag. // // Note that // a CDATA section containing only white space or // a reference to an entity whose replacement text is character references // expanding to white space do not match the nonterminal S, and hence // cannot appear in these positions; however, // a reference to an internal entity with a literal value consisting // of character references expanding to white space does match S, // since its replacement text is the white space resulting from expansion // of the character references. // if ( (topElem->fReferenceEscaped) && (((DTDElementDecl*) topElem->fThisElement)->getModelType() == DTDElementDecl::Children)) { fValidator->emitError ( XMLValid::ElemChildrenHasInvalidWS , topElem->fThisElement->getFullName() ); } XMLSize_t failure; bool res = fValidator->checkContent ( topElem->fThisElement , topElem->fChildren , topElem->fChildCount , &failure ); if (!res) { // One of the elements is not valid for the content. NOTE that // if no children were provided but the content model requires // them, it comes back with a zero value. But we cannot use that // to index the child array in this case, and have to put out a // special message. if (!topElem->fChildCount) { fValidator->emitError ( XMLValid::EmptyNotValidForContent , topElem->fThisElement->getFormattedContentModel() ); } else if (failure >= topElem->fChildCount) { fValidator->emitError ( XMLValid::NotEnoughElemsForCM , topElem->fThisElement->getFormattedContentModel() ); } else { fValidator->emitError ( XMLValid::ElementNotValidForContent , topElem->fChildren[failure]->getRawName() , topElem->fThisElement->getFormattedContentModel() ); } } } // If we have a doc handler, tell it about the end tag if (fDocHandler) { fDocHandler->endElement ( *topElem->fThisElement , uriId , isRoot , (fDoNamespaces) ? topElem->fThisElement->getElementName()->getPrefix() : XMLUni::fgZeroLenString ); } // If this was the root, then done with content gotData = !isRoot; } // This method handles the high level logic of scanning the DOCType // declaration. This calls the DTDScanner and kicks off both the scanning of // the internal subset and the scanning of the external subset, if any. // // When we get here the 'resetDocType(); // There must be some space after DOCTYPE bool skippedSomething; fReaderMgr.skipPastSpaces(skippedSomething); if (!skippedSomething) { emitError(XMLErrs::ExpectedWhitespace); // Just skip the Doctype declaration and return fReaderMgr.skipPastChar(chCloseAngle); return; } // Get a buffer for the root element XMLBufBid bbRootName(&fBufMgr); // Get a name from the input, which should be the name of the root // element of the upcoming content. int colonPosition; bool validName = fDoNamespaces ? fReaderMgr.getQName(bbRootName.getBuffer(), &colonPosition) : fReaderMgr.getName(bbRootName.getBuffer()); if (!validName) { if (bbRootName.isEmpty()) emitError(XMLErrs::NoRootElemInDOCTYPE); else emitError(XMLErrs::InvalidRootElemInDOCTYPE, bbRootName.getRawBuffer()); fReaderMgr.skipPastChar(chCloseAngle); return; } // Store the root element name for later check setRootElemName(bbRootName.getRawBuffer()); // This element obviously is not going to exist in the element decl // pool yet, but we need to call docTypeDecl. So force it into // the element decl pool, marked as being there because it was in // the DOCTYPE. Later, when its declared, the status will be updated. // // Only do this if we are not reusing the validator! If we are reusing, // then look it up instead. It has to exist! MemoryManager* const rootDeclMgr = fUseCachedGrammar ? fMemoryManager : fGrammarPoolMemoryManager; DTDElementDecl* rootDecl = new (rootDeclMgr) DTDElementDecl ( bbRootName.getRawBuffer() , fEmptyNamespaceId , DTDElementDecl::Any , rootDeclMgr ); Janitor rootDeclJanitor(rootDecl); rootDecl->setCreateReason(DTDElementDecl::AsRootElem); rootDecl->setExternalElemDeclaration(true); if(!fUseCachedGrammar) { fGrammar->putElemDecl(rootDecl); rootDeclJanitor.release(); } else { // put this in the undeclared pool so it gets deleted... XMLElementDecl* elemDecl = fDTDElemNonDeclPool->getByKey(bbRootName.getRawBuffer()); if (elemDecl) { rootDecl->setId(elemDecl->getId()); } else { rootDecl->setId(fDTDElemNonDeclPool->put((DTDElementDecl*)rootDecl)); rootDeclJanitor.release(); } } // Skip any spaces after the name fReaderMgr.skipPastSpaces(); // And now if we are looking at a >, then we are done. It is not // required to have an internal or external subset, though why you // would not escapes me. if (fReaderMgr.skippedChar(chCloseAngle)) { // If we have a doc type handler and advanced callbacks are enabled, // call the doctype event. if (fDocTypeHandler) fDocTypeHandler->doctypeDecl(*rootDecl, 0, 0, false); return; } // either internal/external subset if (fValScheme == Val_Auto && !fValidate) fValidate = true; bool hasIntSubset = false; bool hasExtSubset = false; XMLCh* sysId = 0; XMLCh* pubId = 0; DTDScanner dtdScanner ( (DTDGrammar*) fGrammar , fDocTypeHandler , fGrammarPoolMemoryManager , fMemoryManager ); dtdScanner.setScannerInfo(this, &fReaderMgr, &fBufMgr); // If the next character is '[' then we have no external subset cause // there is no system id, just the opening character of the internal // subset. Else, has to be an id. // // Just look at the next char, don't eat it. if (fReaderMgr.peekNextChar() == chOpenSquare) { hasIntSubset = true; } else { // Indicate we have an external subset hasExtSubset = true; fHasNoDTD = false; // Get buffers for the ids XMLBufBid bbPubId(&fBufMgr); XMLBufBid bbSysId(&fBufMgr); // Get the external subset id if (!dtdScanner.scanId(bbPubId.getBuffer(), bbSysId.getBuffer(), DTDScanner::IDType_External)) { fReaderMgr.skipPastChar(chCloseAngle); return; } // Get copies of the ids we got pubId = XMLString::replicate(bbPubId.getRawBuffer(), fMemoryManager); sysId = XMLString::replicate(bbSysId.getRawBuffer(), fMemoryManager); // Skip spaces and check again for the opening of an internal subset fReaderMgr.skipPastSpaces(); // Just look at the next char, don't eat it. if (fReaderMgr.peekNextChar() == chOpenSquare) { hasIntSubset = true; } } // Insure that the ids get cleaned up, if they got allocated ArrayJanitor janSysId(sysId, fMemoryManager); ArrayJanitor janPubId(pubId, fMemoryManager); // If we have a doc type handler and advanced callbacks are enabled, // call the doctype event. if (fDocTypeHandler) fDocTypeHandler->doctypeDecl(*rootDecl, pubId, sysId, hasIntSubset, hasExtSubset); // Ok, if we had an internal subset, we are just past the [ character // and need to parse that first. if (hasIntSubset) { // Eat the opening square bracket fReaderMgr.getNextChar(); checkInternalDTD(hasExtSubset, sysId, pubId); // And try to scan the internal subset. If we fail, try to recover // by skipping forward tot he close angle and returning. if (!dtdScanner.scanInternalSubset()) { fReaderMgr.skipPastChar(chCloseAngle); return; } // Do a sanity check that some expanded PE did not propogate out of // the doctype. This could happen if it was terminated early by bad // syntax. if (fReaderMgr.getReaderDepth() > 1) { emitError(XMLErrs::PEPropogated); // Ask the reader manager to pop back down to the main level fReaderMgr.cleanStackBackTo(1); } fReaderMgr.skipPastSpaces(); } // And that should leave us at the closing > of the DOCTYPE line if (!fReaderMgr.skippedChar(chCloseAngle)) { // Do a special check for the common scenario of an extra ] char at // the end. This is easy to recover from. if (fReaderMgr.skippedChar(chCloseSquare) && fReaderMgr.skippedChar(chCloseAngle)) { emitError(XMLErrs::ExtraCloseSquare); } else { emitError(XMLErrs::UnterminatedDOCTYPE); fReaderMgr.skipPastChar(chCloseAngle); } } // If we had an external subset, then we need to deal with that one // next. If we are reusing the validator, then don't scan it. if (hasExtSubset) { InputSource* srcUsed=0; Janitor janSrc(srcUsed); // If we had an internal subset and we're using the cached grammar, it // means that the ignoreCachedDTD is set, so we ignore the cached // grammar if (fUseCachedGrammar && !hasIntSubset) { srcUsed = resolveSystemId(sysId, pubId); if (srcUsed) { janSrc.reset(srcUsed); Grammar* grammar = fGrammarResolver->getGrammar(srcUsed->getSystemId()); if (grammar && grammar->getGrammarType() == Grammar::DTDGrammarType) { fDTDGrammar = (DTDGrammar*) grammar; fGrammar = fDTDGrammar; fValidator->setGrammar(fGrammar); // If we don't report at least the external subset boundaries, // an advanced document handler cannot know when the DTD end, // since we've already sent a doctype decl that indicates there's // there's an external subset. if (fDocTypeHandler) { fDocTypeHandler->startExtSubset(); fDocTypeHandler->endExtSubset(); } return; } } } if (fLoadExternalDTD || fValidate) { // And now create a reader to read this entity XMLReader* reader; if(srcUsed) { reader = fReaderMgr.createReader ( *srcUsed , false , XMLReader::RefFrom_NonLiteral , XMLReader::Type_General , XMLReader::Source_External , fCalculateSrcOfs , fLowWaterMark ); } else { reader = fReaderMgr.createReader ( sysId , pubId , false , XMLReader::RefFrom_NonLiteral , XMLReader::Type_General , XMLReader::Source_External , srcUsed , fCalculateSrcOfs , fLowWaterMark , fDisableDefaultEntityResolution ); janSrc.reset(srcUsed); } // If it failed then throw an exception if (!reader) ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Gen_CouldNotOpenDTD, srcUsed ? srcUsed->getSystemId() : sysId, fMemoryManager); if (fToCacheGrammar) { unsigned int stringId = fGrammarResolver->getStringPool()->addOrFind(srcUsed->getSystemId()); const XMLCh* sysIdStr = fGrammarResolver->getStringPool()->getValueForId(stringId); fGrammarResolver->orphanGrammar(XMLUni::fgDTDEntityString); ((XMLDTDDescription*) (fGrammar->getGrammarDescription()))->setSystemId(sysIdStr); fGrammarResolver->putGrammar(fGrammar); } // In order to make the processing work consistently, we have to // make this look like an external entity. So create an entity // decl and fill it in and push it with the reader, as happens // with an external entity. Put a janitor on it to insure it gets // cleaned up. The reader manager does not adopt them. const XMLCh gDTDStr[] = { chLatin_D, chLatin_T, chLatin_D , chNull }; DTDEntityDecl* declDTD = new (fMemoryManager) DTDEntityDecl(gDTDStr, false, fMemoryManager); declDTD->setSystemId(sysId); declDTD->setIsExternal(true); Janitor janDecl(declDTD); // Mark this one as a throw at end reader->setThrowAtEnd(true); // And push it onto the stack, with its pseudo name fReaderMgr.pushReader(reader, declDTD); // Tell it its not in an include section dtdScanner.scanExtSubsetDecl(false, true); } } } bool DGXMLScanner::scanStartTag(bool& gotData) { // Assume we will still have data until proven otherwise. It will only // ever be false if this is the root and its empty. gotData = true; // Get the QName. In this case, we are not doing namespaces, so we just // use it as is and don't have to break it into parts. bool validName = fReaderMgr.getName(fQNameBuf); if (!validName) { if (fQNameBuf.isEmpty()) emitError(XMLErrs::ExpectedElementName); else emitError(XMLErrs::InvalidElementName, fQNameBuf.getRawBuffer()); fReaderMgr.skipToChar(chOpenAngle); return false; } // Assume it won't be an empty tag bool isEmpty = false; // See if its the root element const bool isRoot = fElemStack.isEmpty(); // Lets try to look up the element in the validator's element decl pool // We can pass bogus values for the URI id and the base name. We know that // this can only be called if we are doing a DTD style validator and that // he will only look at the QName. // // We *do not* tell him to fault in a decl if he does not find one - NG. bool wasAdded = false; const XMLCh* qnameRawBuf = fQNameBuf.getRawBuffer(); XMLElementDecl* elemDecl = fGrammar->getElemDecl ( fEmptyNamespaceId , 0 , qnameRawBuf , Grammar::TOP_LEVEL_SCOPE ); // look in the undeclared pool: if(!elemDecl) { elemDecl = fDTDElemNonDeclPool->getByKey(qnameRawBuf); } if(!elemDecl) { wasAdded = true; elemDecl = new (fMemoryManager) DTDElementDecl ( qnameRawBuf , fEmptyNamespaceId , DTDElementDecl::Any , fMemoryManager ); elemDecl->setId(fDTDElemNonDeclPool->put((DTDElementDecl*)elemDecl)); } if (fValidate) { if (wasAdded) { // This is to tell the reuse Validator that this element was // faulted-in, was not an element in the validator pool originally elemDecl->setCreateReason(XMLElementDecl::JustFaultIn); fValidator->emitError ( XMLValid::ElementNotDefined , qnameRawBuf ); } // If its not marked declared, then emit an error else if (!elemDecl->isDeclared()) { fValidator->emitError ( XMLValid::ElementNotDefined , qnameRawBuf ); } fValidator->validateElement(elemDecl); } // Expand the element stack and add the new element fElemStack.addLevel(elemDecl, fReaderMgr.getCurrentReaderNum()); // If this is the first element and we are validating, check the root // element. if (isRoot) { fRootGrammar = fGrammar; if (fValidate) { // If a DocType exists, then check if it matches the root name there. if (fRootElemName && !XMLString::equals(qnameRawBuf, fRootElemName)) fValidator->emitError(XMLValid::RootElemNotLikeDocType); } } else if (fValidate) { // If the element stack is not empty, then add this element as a // child of the previous top element. If its empty, this is the root // elem and is not the child of anything. fElemStack.addChild(elemDecl->getElementName(), true); } // Skip any whitespace after the name fReaderMgr.skipPastSpaces(); // We loop until we either see a /> or >, handling attribute/value // pairs until we get there. XMLSize_t attCount = 0; XMLSize_t curAttListSize = fAttrList->size(); wasAdded = false; fElemCount++; while (true) { // And get the next non-space character XMLCh nextCh = fReaderMgr.peekNextChar(); // If the next character is not a slash or closed angle bracket, // then it must be whitespace, since whitespace is required // between the end of the last attribute and the name of the next // one. if (attCount) { if ((nextCh != chForwardSlash) && (nextCh != chCloseAngle)) { if (fReaderMgr.getCurrentReader()->isWhitespace(nextCh)) { // Ok, skip by them and peek another char fReaderMgr.skipPastSpaces(); nextCh = fReaderMgr.peekNextChar(); } else { // Emit the error but keep on going emitError(XMLErrs::ExpectedWhitespace); } } } // Ok, here we first check for any of the special case characters. // If its not one, then we do the normal case processing, which // assumes that we've hit an attribute value, Otherwise, we do all // the special case checks. if (!fReaderMgr.getCurrentReader()->isSpecialStartTagChar(nextCh)) { // Assume its going to be an attribute, so get a name from // the input. validName = fReaderMgr.getName(fAttNameBuf); if (!validName) { if (fAttNameBuf.isEmpty()) emitError(XMLErrs::ExpectedAttrName); else emitError(XMLErrs::InvalidAttrName, fAttNameBuf.getRawBuffer()); fReaderMgr.skipPastChar(chCloseAngle); return false; } // And next must be an equal sign if (!scanEq()) { static const XMLCh tmpList[] = { chSingleQuote, chDoubleQuote, chCloseAngle , chOpenAngle, chForwardSlash, chNull }; emitError(XMLErrs::ExpectedEqSign); // Try to sync back up by skipping forward until we either // hit something meaningful. const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList); if ((chFound == chCloseAngle) || (chFound == chForwardSlash)) { // Jump back to top for normal processing of these continue; } else if ((chFound == chSingleQuote) || (chFound == chDoubleQuote) || fReaderMgr.getCurrentReader()->isWhitespace(chFound)) { // Just fall through assuming that the value is to follow } else if (chFound == chOpenAngle) { // Assume a malformed tag and that new one is starting emitError(XMLErrs::UnterminatedStartTag, elemDecl->getFullName()); return false; } else { // Something went really wrong return false; } } // See if this attribute is declared for this element. If we are // not validating of course it will not be at first, but we will // fault it into the pool (to avoid lots of redundant errors.) XMLCh * namePtr = fAttNameBuf.getRawBuffer(); XMLAttDef* attDef = ((DTDElementDecl *)elemDecl)->getAttDef(namePtr); // Skip any whitespace before the value and then scan the att // value. This will come back normalized with entity refs and // char refs expanded. fReaderMgr.skipPastSpaces(); if (!scanAttValue(attDef, namePtr, fAttValueBuf)) { static const XMLCh tmpList[] = { chCloseAngle, chOpenAngle, chForwardSlash, chNull }; emitError(XMLErrs::ExpectedAttrValue); // It failed, so lets try to get synced back up. We skip // forward until we find some whitespace or one of the // chars in our list. const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList); if ((chFound == chCloseAngle) || (chFound == chForwardSlash) || fReaderMgr.getCurrentReader()->isWhitespace(chFound)) { // Just fall through and process this attribute, though // the value will be "". } else if (chFound == chOpenAngle) { // Assume a malformed tag and that new one is starting emitError(XMLErrs::UnterminatedStartTag, elemDecl->getFullName()); return false; } else { // Something went really wrong return false; } } // Add this attribute to the attribute list that we use to // pass them to the handler. We reuse its existing elements // but expand it as required. // Note that we want to this first since this will // make a copy of the namePtr; we can then make use of // that copy in the hashtable lookup that checks // for duplicates. This will mean we may have to update // the type of the XMLAttr later. XMLAttr* curAtt; const XMLCh* attrValue = fAttValueBuf.getRawBuffer(); if (attCount >= curAttListSize) { curAtt = new (fMemoryManager) XMLAttr(fMemoryManager); fAttrList->addElement(curAtt); } else { curAtt = fAttrList->elementAt(attCount); } curAtt->setSpecified(true); // NO NAMESPACE CODE { curAtt->set( 0, namePtr, XMLUni::fgZeroLenString, XMLUni::fgZeroLenString , (attDef)?attDef->getType():XMLAttDef::CData ); // now need to prepare for duplicate detection if (attDef) { unsigned int *curCountPtr = fAttDefRegistry->get(attDef); if (!curCountPtr) { curCountPtr = getNewUIntPtr(); *curCountPtr = fElemCount; fAttDefRegistry->put(attDef, curCountPtr); } else if (*curCountPtr < fElemCount) { *curCountPtr = fElemCount; } else { emitError( XMLErrs::AttrAlreadyUsedInSTag , attDef->getFullName(), elemDecl->getFullName() ); } } else { // reset namePtr so it refers to newly-allocated memory namePtr = (XMLCh *)curAtt->getQName(); if (!fUndeclaredAttrRegistry->putIfNotPresent(namePtr, 0)) { emitError( XMLErrs::AttrAlreadyUsedInSTag , namePtr, elemDecl->getFullName() ); } } } if (fValidate) { if (attDef) { // Let the validator pass judgement on the attribute value fValidator->validateAttrValue( attDef, fAttValueBuf.getRawBuffer(), false, elemDecl ); } else { fValidator->emitError ( XMLValid::AttNotDefinedForElement , fAttNameBuf.getRawBuffer(), qnameRawBuf ); } } // must set the newly-minted value on the XMLAttr: curAtt->setValue(attrValue); attCount++; // And jump back to the top of the loop continue; } // It was some special case character so do all of the checks and // deal with it. if (!nextCh) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); if (nextCh == chForwardSlash) { fReaderMgr.getNextChar(); isEmpty = true; if (!fReaderMgr.skippedChar(chCloseAngle)) emitError(XMLErrs::UnterminatedStartTag, elemDecl->getFullName()); break; } else if (nextCh == chCloseAngle) { fReaderMgr.getNextChar(); break; } else if (nextCh == chOpenAngle) { // Check for this one specially, since its going to be common // and it is kind of auto-recovering since we've already hit the // next open bracket, which is what we would have seeked to (and // skipped this whole tag.) emitError(XMLErrs::UnterminatedStartTag, elemDecl->getFullName()); break; } else if ((nextCh == chSingleQuote) || (nextCh == chDoubleQuote)) { // Check for this one specially, which is probably a missing // attribute name, e.g. ="value". Just issue expected name // error and eat the quoted string, then jump back to the // top again. emitError(XMLErrs::ExpectedAttrName); fReaderMgr.getNextChar(); fReaderMgr.skipQuotedString(nextCh); fReaderMgr.skipPastSpaces(); continue; } } if(attCount) { // clean up after ourselves: // clear the map used to detect duplicate attributes fUndeclaredAttrRegistry->removeAll(); } // Now lets get the fAttrList filled in. This involves faulting in any // defaulted and fixed attributes and normalizing the values of any that // we got explicitly. // // We update the attCount value with the total number of attributes, but // it goes in with the number of values we got during the raw scan of // explictly provided attrs above. attCount = buildAttList(attCount, elemDecl, *fAttrList); // If we have a document handler, then tell it about this start tag. We // don't have any URI id to send along, so send fEmptyNamespaceId. We also do not send // any prefix since its just one big name if we are not doing namespaces. unsigned int uriId = fEmptyNamespaceId; if (fDocHandler) { fDocHandler->startElement ( *elemDecl , uriId , 0 , *fAttrList , attCount , isEmpty , isRoot ); } // If empty, validate content right now if we are validating and then // pop the element stack top. Else, we have to update the current stack // top's namespace mapping elements. if (isEmpty) { // If validating, then insure that its legal to have no content if (fValidate) { XMLSize_t failure; bool res = fValidator->checkContent(elemDecl, 0, 0, &failure); if (!res) { fValidator->emitError ( XMLValid::ElementNotValidForContent , qnameRawBuf , elemDecl->getFormattedContentModel() ); } } // Pop the element stack back off since it'll never be used now fElemStack.popTop(); // If the elem stack is empty, then it was an empty root if (isRoot) gotData = false; } return true; } bool DGXMLScanner::scanStartTagNS(bool& gotData) { // Assume we will still have data until proven otherwise. It will only // ever be false if this is the root and its empty. gotData = true; // Get the QName. In this case, we are not doing namespaces, so we just // use it as is and don't have to break it into parts. int colonPosition; bool validName = fReaderMgr.getQName(fQNameBuf, &colonPosition); if (!validName) { if (fQNameBuf.isEmpty()) emitError(XMLErrs::ExpectedElementName); else emitError(XMLErrs::InvalidElementName, fQNameBuf.getRawBuffer()); fReaderMgr.skipToChar(chOpenAngle); return false; } // Assume it won't be an empty tag bool isEmpty = false; // See if its the root element const bool isRoot = fElemStack.isEmpty(); // Lets try to look up the element in the validator's element decl pool // We can pass bogus values for the URI id and the base name. We know that // this can only be called if we are doing a DTD style validator and that // he will only look at the QName. // // We *do not* tell him to fault in a decl if he does not find one - NG. bool wasAdded = false; const XMLCh* qnameRawBuf = fQNameBuf.getRawBuffer(); XMLElementDecl* elemDecl = fGrammar->getElemDecl ( fEmptyNamespaceId , 0 , qnameRawBuf , Grammar::TOP_LEVEL_SCOPE ); // look in the undeclared pool: if(!elemDecl) { elemDecl = fDTDElemNonDeclPool->getByKey(qnameRawBuf); } if(!elemDecl) { wasAdded = true; elemDecl = new (fMemoryManager) DTDElementDecl ( qnameRawBuf , fEmptyNamespaceId , DTDElementDecl::Any , fMemoryManager ); elemDecl->setId(fDTDElemNonDeclPool->put((DTDElementDecl*)elemDecl)); } if (fValidate) { if (wasAdded) { // This is to tell the reuse Validator that this element was // faulted-in, was not an element in the validator pool originally elemDecl->setCreateReason(XMLElementDecl::JustFaultIn); fValidator->emitError ( XMLValid::ElementNotDefined , qnameRawBuf ); } // If its not marked declared, then emit an error else if (!elemDecl->isDeclared()) { fValidator->emitError ( XMLValid::ElementNotDefined , qnameRawBuf ); } fValidator->validateElement(elemDecl); } // Expand the element stack and add the new element fElemStack.addLevel(elemDecl, fReaderMgr.getCurrentReaderNum()); // If this is the first element and we are validating, check the root // element. if (isRoot) { fRootGrammar = fGrammar; if (fValidate) { // If a DocType exists, then check if it matches the root name there. if (fRootElemName && !XMLString::equals(qnameRawBuf, fRootElemName)) fValidator->emitError(XMLValid::RootElemNotLikeDocType); } } else if (fValidate) { // If the element stack is not empty, then add this element as a // child of the previous top element. If its empty, this is the root // elem and is not the child of anything. fElemStack.addChild(elemDecl->getElementName(), true); } // Skip any whitespace after the name fReaderMgr.skipPastSpaces(); // We loop until we either see a /> or >, handling attribute/value // pairs until we get there. XMLSize_t attCount = 0; XMLSize_t curAttListSize = fAttrList->size(); wasAdded = false; fElemCount++; while (true) { // And get the next non-space character XMLCh nextCh = fReaderMgr.peekNextChar(); // If the next character is not a slash or closed angle bracket, // then it must be whitespace, since whitespace is required // between the end of the last attribute and the name of the next // one. if (attCount) { if ((nextCh != chForwardSlash) && (nextCh != chCloseAngle)) { if (fReaderMgr.getCurrentReader()->isWhitespace(nextCh)) { // Ok, skip by them and peek another char fReaderMgr.skipPastSpaces(); nextCh = fReaderMgr.peekNextChar(); } else { // Emit the error but keep on going emitError(XMLErrs::ExpectedWhitespace); } } } // Ok, here we first check for any of the special case characters. // If its not one, then we do the normal case processing, which // assumes that we've hit an attribute value, Otherwise, we do all // the special case checks. if (!fReaderMgr.getCurrentReader()->isSpecialStartTagChar(nextCh)) { // Assume its going to be an attribute, so get a name from // the input. validName = fReaderMgr.getQName(fAttNameBuf, &colonPosition); if (!validName) { if (fAttNameBuf.isEmpty()) emitError(XMLErrs::ExpectedAttrName); else emitError(XMLErrs::InvalidAttrName, fAttNameBuf.getRawBuffer()); fReaderMgr.skipPastChar(chCloseAngle); return false; } // And next must be an equal sign if (!scanEq()) { static const XMLCh tmpList[] = { chSingleQuote, chDoubleQuote, chCloseAngle , chOpenAngle, chForwardSlash, chNull }; emitError(XMLErrs::ExpectedEqSign); // Try to sync back up by skipping forward until we either // hit something meaningful. const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList); if ((chFound == chCloseAngle) || (chFound == chForwardSlash)) { // Jump back to top for normal processing of these continue; } else if ((chFound == chSingleQuote) || (chFound == chDoubleQuote) || fReaderMgr.getCurrentReader()->isWhitespace(chFound)) { // Just fall through assuming that the value is to follow } else if (chFound == chOpenAngle) { // Assume a malformed tag and that new one is starting emitError(XMLErrs::UnterminatedStartTag, elemDecl->getFullName()); return false; } else { // Something went really wrong return false; } } // See if this attribute is declared for this element. If we are // not validating of course it will not be at first, but we will // fault it into the pool (to avoid lots of redundant errors.) XMLCh * namePtr = fAttNameBuf.getRawBuffer(); XMLAttDef* attDef = ((DTDElementDecl *)elemDecl)->getAttDef(namePtr); // Skip any whitespace before the value and then scan the att // value. This will come back normalized with entity refs and // char refs expanded. fReaderMgr.skipPastSpaces(); if (!scanAttValue(attDef, namePtr, fAttValueBuf)) { static const XMLCh tmpList[] = { chCloseAngle, chOpenAngle, chForwardSlash, chNull }; emitError(XMLErrs::ExpectedAttrValue); // It failed, so lets try to get synced back up. We skip // forward until we find some whitespace or one of the // chars in our list. const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList); if ((chFound == chCloseAngle) || (chFound == chForwardSlash) || fReaderMgr.getCurrentReader()->isWhitespace(chFound)) { // Just fall through and process this attribute, though // the value will be "". } else if (chFound == chOpenAngle) { // Assume a malformed tag and that new one is starting emitError(XMLErrs::UnterminatedStartTag, elemDecl->getFullName()); return false; } else { // Something went really wrong return false; } } // Add this attribute to the attribute list that we use to // pass them to the handler. We reuse its existing elements // but expand it as required. // Note that we want to this first since this will // make a copy of the namePtr; we can then make use of // that copy in the hashtable lookup that checks // for duplicates. This will mean we may have to update // the type of the XMLAttr later. XMLAttr* curAtt; const XMLCh* attrValue = fAttValueBuf.getRawBuffer(); if (attCount >= curAttListSize) { curAtt = new (fMemoryManager) XMLAttr(fMemoryManager); fAttrList->addElement(curAtt); } else { curAtt = fAttrList->elementAt(attCount); } curAtt->setSpecified(true); // DO NAMESPACES { curAtt->set( fEmptyNamespaceId, namePtr, XMLUni::fgZeroLenString , (attDef)? attDef->getType() : XMLAttDef::CData ); // each attribute has the prefix:suffix="value" const XMLCh* attPrefix = curAtt->getPrefix(); const XMLCh* attLocalName = curAtt->getName(); if (attPrefix && *attPrefix) { if (XMLString::equals(attPrefix, XMLUni::fgXMLString)) { curAtt->setURIId(fXMLNamespaceId); } else if (XMLString::equals(attPrefix, XMLUni::fgXMLNSString)) { curAtt->setURIId(fXMLNSNamespaceId); updateNSMap(attPrefix, attLocalName, attrValue); } else { fAttrNSList->addElement(curAtt); } } else if (XMLString::equals(XMLUni::fgXMLNSString, attLocalName)) { updateNSMap(attPrefix, XMLUni::fgZeroLenString, attrValue); } // NOTE: duplicate attribute check will be done, when we map // namespaces to all attributes if (attDef) { unsigned int *curCountPtr = fAttDefRegistry->get(attDef); if (!curCountPtr) { curCountPtr = getNewUIntPtr(); *curCountPtr = fElemCount; fAttDefRegistry->put(attDef, curCountPtr); } else if (*curCountPtr < fElemCount) { *curCountPtr = fElemCount; } } } if (fValidate) { if (attDef) { // Let the validator pass judgement on the attribute value fValidator->validateAttrValue( attDef, fAttValueBuf.getRawBuffer(), false, elemDecl ); } else { fValidator->emitError ( XMLValid::AttNotDefinedForElement , fAttNameBuf.getRawBuffer(), qnameRawBuf ); } } // must set the newly-minted value on the XMLAttr: curAtt->setValue(attrValue); attCount++; // And jump back to the top of the loop continue; } // It was some special case character so do all of the checks and // deal with it. if (!nextCh) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); if (nextCh == chForwardSlash) { fReaderMgr.getNextChar(); isEmpty = true; if (!fReaderMgr.skippedChar(chCloseAngle)) emitError(XMLErrs::UnterminatedStartTag, elemDecl->getFullName()); break; } else if (nextCh == chCloseAngle) { fReaderMgr.getNextChar(); break; } else if (nextCh == chOpenAngle) { // Check for this one specially, since its going to be common // and it is kind of auto-recovering since we've already hit the // next open bracket, which is what we would have seeked to (and // skipped this whole tag.) emitError(XMLErrs::UnterminatedStartTag, elemDecl->getFullName()); break; } else if ((nextCh == chSingleQuote) || (nextCh == chDoubleQuote)) { // Check for this one specially, which is probably a missing // attribute name, e.g. ="value". Just issue expected name // error and eat the quoted string, then jump back to the // top again. emitError(XMLErrs::ExpectedAttrName); fReaderMgr.getNextChar(); fReaderMgr.skipQuotedString(nextCh); fReaderMgr.skipPastSpaces(); continue; } } // Make an initial pass through the list and find any xmlns attributes. if (attCount) scanAttrListforNameSpaces(fAttrList, attCount, elemDecl); if(attCount) { // clean up after ourselves: // clear the map used to detect duplicate attributes fUndeclaredAttrRegistry->removeAll(); } // Now lets get the fAttrList filled in. This involves faulting in any // defaulted and fixed attributes and normalizing the values of any that // we got explicitly. // // We update the attCount value with the total number of attributes, but // it goes in with the number of values we got during the raw scan of // explictly provided attrs above. attCount = buildAttList(attCount, elemDecl, *fAttrList); // If we have a document handler, then tell it about this start tag. We // don't have any URI id to send along, so send fEmptyNamespaceId. We also do not send // any prefix since its just one big name if we are not doing namespaces. if (fDocHandler) { unsigned int uriId = resolvePrefix ( elemDecl->getElementName()->getPrefix() , ElemStack::Mode_Element ); fDocHandler->startElement ( *elemDecl , uriId , elemDecl->getElementName()->getPrefix() , *fAttrList , attCount , isEmpty , isRoot ); } // If empty, validate content right now if we are validating and then // pop the element stack top. Else, we have to update the current stack // top's namespace mapping elements. if (isEmpty) { // If validating, then insure that its legal to have no content if (fValidate) { XMLSize_t failure; bool res = fValidator->checkContent(elemDecl, 0, 0, &failure); if (!res) { fValidator->emitError ( XMLValid::ElementNotValidForContent , qnameRawBuf , elemDecl->getFormattedContentModel() ); } } // Pop the element stack back off since it'll never be used now fElemStack.popTop(); // If the elem stack is empty, then it was an empty root if (isRoot) gotData = false; } return true; } // --------------------------------------------------------------------------- // DGXMLScanner: Grammar preparsing // --------------------------------------------------------------------------- Grammar* DGXMLScanner::loadGrammar(const InputSource& src , const short grammarType , const bool toCache) { Grammar* loadedGrammar = 0; ReaderMgrResetType resetReaderMgr(&fReaderMgr, &ReaderMgr::reset); try { fGrammarResolver->cacheGrammarFromParse(false); fGrammarResolver->useCachedGrammarInParse(false); fRootGrammar = 0; if (fValScheme == Val_Auto) { fValidate = true; } // Reset some status flags fInException = false; fStandalone = false; fErrorCount = 0; fHasNoDTD = true; if (grammarType == Grammar::DTDGrammarType) { loadedGrammar = loadDTDGrammar(src, toCache); } } // NOTE: // // In all of the error processing below, the emitError() call MUST come // before the flush of the reader mgr, or it will fail because it tries // to find out the position in the XML source of the error. catch(const XMLErrs::Codes) { // This is a 'first failure' exception, so fall through } catch(const XMLValid::Codes) { // This is a 'first fatal error' type exit, so fall through } catch(const XMLException& excToCatch) { // Emit the error and catch any user exception thrown from here. Make // sure in all cases we flush the reader manager. fInException = true; try { if (excToCatch.getErrorType() == XMLErrorReporter::ErrType_Warning) emitError ( XMLErrs::XMLException_Warning , excToCatch.getCode() , excToCatch.getMessage() ); else if (excToCatch.getErrorType() >= XMLErrorReporter::ErrType_Fatal) emitError ( XMLErrs::XMLException_Fatal , excToCatch.getCode() , excToCatch.getMessage() ); else emitError ( XMLErrs::XMLException_Error , excToCatch.getCode() , excToCatch.getMessage() ); } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } return loadedGrammar; } Grammar* DGXMLScanner::loadDTDGrammar(const InputSource& src, const bool toCache) { // Reset the validators fDTDValidator->reset(); if (fValidatorFromUser) fValidator->reset(); fDTDGrammar = new (fGrammarPoolMemoryManager) DTDGrammar(fGrammarPoolMemoryManager); fGrammarResolver->putGrammar(fDTDGrammar); fGrammar = fDTDGrammar; fValidator->setGrammar(fGrammar); // And for all installed handlers, send reset events. This gives them // a chance to flush any cached data. if (fDocHandler) fDocHandler->resetDocument(); if (fEntityHandler) fEntityHandler->resetEntities(); if (fErrorReporter) fErrorReporter->resetErrors(); // Clear out the id reference list resetValidationContext(); if (toCache) { unsigned int sysId = fGrammarResolver->getStringPool()->addOrFind(src.getSystemId()); const XMLCh* sysIdStr = fGrammarResolver->getStringPool()->getValueForId(sysId); fGrammarResolver->orphanGrammar(XMLUni::fgDTDEntityString); ((XMLDTDDescription*) (fGrammar->getGrammarDescription()))->setSystemId(sysIdStr); fGrammarResolver->putGrammar(fGrammar); } // Handle the creation of the XML reader object for this input source. // This will provide us with transcoding and basic lexing services. XMLReader* newReader = fReaderMgr.createReader ( src , false , XMLReader::RefFrom_NonLiteral , XMLReader::Type_General , XMLReader::Source_External , fCalculateSrcOfs , fLowWaterMark ); if (!newReader) { if (src.getIssueFatalErrorIfNotFound()) ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Scan_CouldNotOpenSource, src.getSystemId(), fMemoryManager); else ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Scan_CouldNotOpenSource_Warning, src.getSystemId(), fMemoryManager); } // In order to make the processing work consistently, we have to // make this look like an external entity. So create an entity // decl and fill it in and push it with the reader, as happens // with an external entity. Put a janitor on it to insure it gets // cleaned up. The reader manager does not adopt them. const XMLCh gDTDStr[] = { chLatin_D, chLatin_T, chLatin_D , chNull }; DTDEntityDecl* declDTD = new (fMemoryManager) DTDEntityDecl(gDTDStr, false, fMemoryManager); declDTD->setSystemId(src.getSystemId()); declDTD->setIsExternal(true); Janitor janDecl(declDTD); // Mark this one as a throw at end newReader->setThrowAtEnd(true); // And push it onto the stack, with its pseudo name fReaderMgr.pushReader(newReader, declDTD); // If we have a doc type handler and advanced callbacks are enabled, // call the doctype event. if (fDocTypeHandler) { // Create a dummy root DTDElementDecl* rootDecl = new (fGrammarPoolMemoryManager) DTDElementDecl ( gDTDStr , fEmptyNamespaceId , DTDElementDecl::Any , fGrammarPoolMemoryManager ); rootDecl->setCreateReason(DTDElementDecl::AsRootElem); rootDecl->setExternalElemDeclaration(true); Janitor janSrc(rootDecl); fDocTypeHandler->doctypeDecl(*rootDecl, src.getPublicId(), src.getSystemId(), false, true); } // Create DTDScanner DTDScanner dtdScanner ( (DTDGrammar*)fGrammar , fDocTypeHandler , fGrammarPoolMemoryManager , fMemoryManager ); dtdScanner.setScannerInfo(this, &fReaderMgr, &fBufMgr); // Tell it its not in an include section dtdScanner.scanExtSubsetDecl(false, true); if (fValidate) { // validate the DTD scan so far fValidator->preContentValidation(false, true); } if (toCache) fGrammarResolver->cacheGrammars(); return fDTDGrammar; } // --------------------------------------------------------------------------- // DGXMLScanner: Private helper methods // --------------------------------------------------------------------------- // This method handles the common initialization, to avoid having to do // it redundantly in multiple constructors. void DGXMLScanner::commonInit() { // And we need one for the raw attribute scan. This just stores key/ // value string pairs (prior to any processing.) fAttrNSList = new (fMemoryManager) ValueVectorOf(8, fMemoryManager); // Create the Validator and init them fDTDValidator = new (fMemoryManager) DTDValidator(); initValidator(fDTDValidator); fDTDElemNonDeclPool = new (fMemoryManager) NameIdPool(29, 128, fMemoryManager); fAttDefRegistry = new (fMemoryManager) RefHashTableOf ( 131, false, fMemoryManager ); fUndeclaredAttrRegistry = new (fMemoryManager) Hash2KeysSetOf(7, fMemoryManager); if (fValidator) { if (!fValidator->handlesDTD()) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Gen_NoDTDValidator, fMemoryManager); } else { fValidator = fDTDValidator; } } void DGXMLScanner::cleanUp() { delete fAttrNSList; delete fDTDValidator; delete fDTDElemNonDeclPool; delete fAttDefRegistry; delete fUndeclaredAttrRegistry; } // This method is called from scanStartTagNS() to build up the list of // XMLAttr objects that will be passed out in the start tag callout. We // get the key/value pairs from the raw scan of explicitly provided attrs, // which have not been normalized. And we get the element declaration from // which we will get any defaulted or fixed attribute defs and add those // in as well. XMLSize_t DGXMLScanner::buildAttList(const XMLSize_t attCount , XMLElementDecl* elemDecl , RefVectorOf& toFill) { // Ask the element to clear the 'provided' flag on all of the att defs // that it owns, and to return us a boolean indicating whether it has // any defs. const bool hasDefs = elemDecl->hasAttDefs(); // If there are no expliclitily provided attributes and there are no // defined attributes for the element, the we don't have anything to do. // So just return zero in this case. if (!hasDefs && !attCount) return 0; // Keep up with how many attrs we end up with total XMLSize_t retCount = attCount; // And get the current size of the output vector. This lets us use // existing elements until we fill it, then start adding new ones. const XMLSize_t curAttListSize = toFill.size(); // Ok, so lets get an enumerator for the attributes of this element // and run through them for well formedness and validity checks. But // make sure that we had any attributes before we do it, since the list // would have have gotten faulted in anyway. if (hasDefs) { XMLAttDefList& attDefList = elemDecl->getAttDefList(); for(XMLSize_t i=0; iget(&curDef); if (!attCountPtr || *attCountPtr < fElemCount) { // did not occur const XMLAttDef::DefAttTypes defType = curDef.getDefaultType(); if (fValidate) { // If we are validating and its required, then an error if (defType == XMLAttDef::Required) { fValidator->emitError ( XMLValid::RequiredAttrNotProvided , curDef.getFullName() ); } else if ((defType == XMLAttDef::Default) || (defType == XMLAttDef::Fixed) ) { if (fStandalone && curDef.isExternal()) { // XML 1.0 Section 2.9 // Document is standalone, so attributes must not be defaulted. fValidator->emitError(XMLValid::NoDefAttForStandalone, curDef.getFullName(), elemDecl->getFullName()); } } } // Fault in the value if needed, and bump the att count if ((defType == XMLAttDef::Default) || (defType == XMLAttDef::Fixed)) { // Let the validator pass judgement on the attribute value if (fValidate) { fValidator->validateAttrValue ( &curDef , curDef.getValue() , false , elemDecl ); } XMLAttr* curAtt; if (retCount >= curAttListSize) { if (fDoNamespaces) { curAtt = new (fMemoryManager) XMLAttr ( fEmptyNamespaceId , curDef.getFullName() , curDef.getValue() , curDef.getType() , false , fMemoryManager ); } else { curAtt = new (fMemoryManager) XMLAttr ( 0 , curDef.getFullName() , XMLUni::fgZeroLenString , curDef.getValue() , curDef.getType() , false , fMemoryManager ); } fAttrList->addElement(curAtt); } else { curAtt = fAttrList->elementAt(retCount); if (fDoNamespaces) { curAtt->set ( fEmptyNamespaceId , curDef.getFullName() , curDef.getValue() , curDef.getType() ); } else { curAtt->set ( 0 , curDef.getFullName() , XMLUni::fgZeroLenString , curDef.getValue() , curDef.getType() ); } curAtt->setSpecified(false); } if (fDoNamespaces) { // Map the new attribute's prefix to a URI id and store // that in the attribute object. const XMLCh* attPrefix = curAtt->getPrefix(); if (attPrefix && *attPrefix) { curAtt->setURIId ( resolvePrefix(attPrefix, ElemStack::Mode_Attribute) ); } } retCount++; } } } } return retCount; } // This method will reset the scanner data structures, and related plugged // in stuff, for a new scan session. We get the input source for the primary // XML entity, create the reader for it, and push it on the stack so that // upon successful return from here we are ready to go. void DGXMLScanner::scanReset(const InputSource& src) { // This call implicitly tells us that we are going to reuse the scanner // if it was previously used. So tell the validator to reset itself. // // But, if the fUseCacheGrammar flag is set, then don't reset it. // // NOTE: The ReaderMgr is flushed on the way out, because that is // required to insure that files are closed. fGrammarResolver->cacheGrammarFromParse(fToCacheGrammar); fGrammarResolver->useCachedGrammarInParse(fUseCachedGrammar); fDTDGrammar = new (fGrammarPoolMemoryManager) DTDGrammar(fGrammarPoolMemoryManager); fGrammarResolver->putGrammar(fDTDGrammar); fGrammar = fDTDGrammar; fRootGrammar = 0; fValidator->setGrammar(fGrammar); // Reset validation fValidate = (fValScheme == Val_Always) ? true : false; // And for all installed handlers, send reset events. This gives them // a chance to flush any cached data. if (fDocHandler) fDocHandler->resetDocument(); if (fEntityHandler) fEntityHandler->resetEntities(); if (fErrorReporter) fErrorReporter->resetErrors(); // Clear out the id reference list resetValidationContext(); // Reset the Root Element Name fMemoryManager->deallocate(fRootElemName);//delete [] fRootElemName; fRootElemName = 0; // Reset the element stack, and give it the latest ids for the special // URIs it has to know about. fElemStack.reset ( fEmptyNamespaceId , fUnknownNamespaceId , fXMLNamespaceId , fXMLNSNamespaceId ); // Reset some status flags fInException = false; fStandalone = false; fErrorCount = 0; fHasNoDTD = true; // Reset the validators fDTDValidator->reset(); fDTDValidator->setErrorReporter(fErrorReporter); if (fValidatorFromUser) fValidator->reset(); // Handle the creation of the XML reader object for this input source. // This will provide us with transcoding and basic lexing services. XMLReader* newReader = fReaderMgr.createReader ( src , true , XMLReader::RefFrom_NonLiteral , XMLReader::Type_General , XMLReader::Source_External , fCalculateSrcOfs , fLowWaterMark ); if (!newReader) { if (src.getIssueFatalErrorIfNotFound()) ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Scan_CouldNotOpenSource, src.getSystemId(), fMemoryManager); else ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Scan_CouldNotOpenSource_Warning, src.getSystemId(), fMemoryManager); } // Push this read onto the reader manager fReaderMgr.pushReader(newReader, 0); // and reset security-related things if necessary: if(fSecurityManager != 0) { fEntityExpansionLimit = fSecurityManager->getEntityExpansionLimit(); fEntityExpansionCount = 0; } if(fUIntPoolRowTotal >= 32) { // 8 KB tied up with validating attributes... fAttDefRegistry->removeAll(); recreateUIntPool(); } else { // note that this will implicitly reset the values of the hashtables, // though their buckets will still be tied up resetUIntPool(); } fUndeclaredAttrRegistry->removeAll(); fAttrNSList->removeAllElements(); } // This method is called between markup in content. It scans for character // data that is sent to the document handler. It watches for any markup // characters that would indicate that the character data has ended. It also // handles expansion of general and character entities. // // sendData() is a local static helper for this method which handles some // code that must be done in three different places here. void DGXMLScanner::sendCharData(XMLBuffer& toSend) { // If no data in the buffer, then nothing to do if (toSend.isEmpty()) return; // We do different things according to whether we are validating or // not. If not, its always just characters; else, it depends on the // current element's content model. if (fValidate) { // Get the raw data we need for the callback const XMLCh* const rawBuf = toSend.getRawBuffer(); const XMLSize_t len = toSend.getLen(); // And see if the current element is a 'Children' style content model const ElemStack::StackElem* topElem = fElemStack.topElement(); // Get the character data opts for the current element XMLElementDecl::CharDataOpts charOpts = topElem->fThisElement->getCharDataOpts(); if (charOpts == XMLElementDecl::NoCharData) { // They definitely cannot handle any type of char data fValidator->emitError(XMLValid::NoCharDataInCM); } else if (fReaderMgr.getCurrentReader()->isAllSpaces(rawBuf, len)) { // Its all spaces. So, if they can take spaces, then send it // as ignorable whitespace. If they can handle any char data // send it as characters. if (charOpts == XMLElementDecl::SpacesOk) { if (fDocHandler) fDocHandler->ignorableWhitespace(rawBuf, len, false); } else if (charOpts == XMLElementDecl::AllCharData) { if (fDocHandler) fDocHandler->docCharacters(rawBuf, len, false); } } else { // If they can take any char data, then send it. Otherwise, they // can only handle whitespace and can't handle this stuff so // issue an error. if (charOpts == XMLElementDecl::AllCharData) { if (fDocHandler) fDocHandler->docCharacters(rawBuf, len, false); } else { fValidator->emitError(XMLValid::NoCharDataInCM); } } } else { // Always assume its just char data if not validating if (fDocHandler) fDocHandler->docCharacters(toSend.getRawBuffer(), toSend.getLen(), false); } // Reset buffer toSend.reset(); } // This method is called with a key/value string pair that represents an // xmlns="yyy" or xmlns:xxx="yyy" attribute. This method will update the // current top of the element stack based on this data. We know that when // we get here, that it is one of these forms, so we don't bother confirming // it. // // But we have to ensure // 1. xxx is not xmlns // 2. if xxx is xml, then yyy must match XMLUni::fgXMLURIName, and vice versa // 3. yyy is not XMLUni::fgXMLNSURIName // 4. if xxx is not null, then yyy cannot be an empty string. void DGXMLScanner::updateNSMap(const XMLCh* const attrPrefix , const XMLCh* const attrLocalName , const XMLCh* const attrValue) { // We either have the default prefix (""), or we point it into the attr // name parameter. Note that the xmlns is not the prefix we care about // here. To us, the 'prefix' is really the local part of the attrName // parameter. // // Check 1. xxx is not xmlns // 2. if xxx is xml, then yyy must match XMLUni::fgXMLURIName, and vice versa // 3. yyy is not XMLUni::fgXMLNSURIName // 4. if xxx is not null, then yyy cannot be an empty string. if (attrPrefix && *attrPrefix) { if (XMLString::equals(attrLocalName, XMLUni::fgXMLNSString)) emitError(XMLErrs::NoUseOfxmlnsAsPrefix); else if (XMLString::equals(attrLocalName, XMLUni::fgXMLString)) { if (!XMLString::equals(attrValue, XMLUni::fgXMLURIName)) emitError(XMLErrs::PrefixXMLNotMatchXMLURI); } if (!attrValue) emitError(XMLErrs::NoEmptyStrNamespace, attrLocalName); else if(!*attrValue && fXMLVersion == XMLReader::XMLV1_0) emitError(XMLErrs::NoEmptyStrNamespace, attrLocalName); } if (XMLString::equals(attrValue, XMLUni::fgXMLNSURIName)) emitError(XMLErrs::NoUseOfxmlnsURI); else if (XMLString::equals(attrValue, XMLUni::fgXMLURIName)) { if (!XMLString::equals(attrLocalName, XMLUni::fgXMLString)) emitError(XMLErrs::XMLURINotMatchXMLPrefix); } // Ok, we have to get the unique id for the attribute value, which is the // URI that this value should be mapped to. The validator has the // namespace string pool, so we ask him to find or add this new one. Then // we ask the element stack to add this prefix to URI Id mapping. fElemStack.addPrefix ( attrLocalName , fURIStringPool->addOrFind(attrValue) ); } void DGXMLScanner::scanAttrListforNameSpaces(RefVectorOf* theAttrList, XMLSize_t attCount, XMLElementDecl* elemDecl) { // Map prefixes to uris for (XMLSize_t i=0; i < fAttrNSList->size(); i++) { XMLAttr* providedAttr = fAttrNSList->elementAt(i); providedAttr->setURIId( resolvePrefix(providedAttr->getPrefix(), ElemStack::Mode_Attribute) ); } fAttrNSList->removeAllElements(); // Decide if to use hash table to do duplicate checking bool toUseHashTable = false; setAttrDupChkRegistry(attCount, toUseHashTable); for (XMLSize_t index = 0; index < attCount; index++) { // check for duplicate namespace attributes: // by checking for qualified names with the same local part and with prefixes // which have been bound to namespace names that are identical. XMLAttr* curAttr = theAttrList->elementAt(index); if (!toUseHashTable) { XMLAttr* loopAttr; for (XMLSize_t attrIndex=0; attrIndex < index; attrIndex++) { loopAttr = theAttrList->elementAt(attrIndex); if (loopAttr->getURIId() == curAttr->getURIId() && XMLString::equals(loopAttr->getName(), curAttr->getName())) { emitError( XMLErrs::AttrAlreadyUsedInSTag, curAttr->getName() , elemDecl->getFullName() ); } } } else { if (fAttrDupChkRegistry->containsKey((void*)curAttr->getName(), curAttr->getURIId())) { emitError( XMLErrs::AttrAlreadyUsedInSTag , curAttr->getName(), elemDecl->getFullName() ); } fAttrDupChkRegistry->put((void*)curAttr->getName(), curAttr->getURIId(), curAttr); } } } InputSource* DGXMLScanner::resolveSystemId(const XMLCh* const sysId ,const XMLCh* const pubId) { //Normalize sysId XMLBufBid nnSys(&fBufMgr); XMLBuffer& normalizedSysId = nnSys.getBuffer(); XMLString::removeChar(sysId, 0xFFFF, normalizedSysId); const XMLCh* normalizedURI = normalizedSysId.getRawBuffer(); // Create a buffer for expanding the normalized system id XMLBufBid bbSys(&fBufMgr); XMLBuffer& expSysId = bbSys.getBuffer(); // Allow the entity handler to expand the system id if they choose // to do so. InputSource* srcToFill = 0; if (fEntityHandler) { if (!fEntityHandler->expandSystemId(normalizedURI, expSysId)) expSysId.set(normalizedURI); ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr.getLastExtEntityInfo(lastInfo); XMLResourceIdentifier resourceIdentifier(XMLResourceIdentifier::ExternalEntity, expSysId.getRawBuffer(), 0, pubId, lastInfo.systemId, &fReaderMgr); srcToFill = fEntityHandler->resolveEntity(&resourceIdentifier); } else { expSysId.set(normalizedURI); } // If they didn't create a source via the entity handler, then we // have to create one on our own. if (!srcToFill) { if (fDisableDefaultEntityResolution) return srcToFill; ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr.getLastExtEntityInfo(lastInfo); XMLURL urlTmp(fMemoryManager); if ((!urlTmp.setURL(lastInfo.systemId, expSysId.getRawBuffer(), urlTmp)) || (urlTmp.isRelative())) { if (!fStandardUriConformant) { XMLBufBid ddSys(&fBufMgr); XMLBuffer& resolvedSysId = ddSys.getBuffer(); XMLUri::normalizeURI(expSysId.getRawBuffer(), resolvedSysId); srcToFill = new (fMemoryManager) LocalFileInputSource ( lastInfo.systemId , resolvedSysId.getRawBuffer() , fMemoryManager ); } else ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_MalformedURL, fMemoryManager); } else { if (fStandardUriConformant && urlTmp.hasInvalidChar()) ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_MalformedURL, fMemoryManager); srcToFill = new (fMemoryManager) URLInputSource(urlTmp, fMemoryManager); } } return srcToFill; } // --------------------------------------------------------------------------- // DGXMLScanner: Private parsing methods // --------------------------------------------------------------------------- bool DGXMLScanner::scanAttValue( const XMLAttDef* const attDef , const XMLCh *const attrName , XMLBuffer& toFill) { enum States { InWhitespace , InContent }; // Get the type and name const XMLAttDef::AttTypes type = (attDef) ?attDef->getType() :XMLAttDef::CData; // Reset the target buffer toFill.reset(); // Get the next char which must be a single or double quote XMLCh quoteCh; if (!fReaderMgr.skipIfQuote(quoteCh)) return false; // We have to get the current reader because we have to ignore closing // quotes until we hit the same reader again. const XMLSize_t curReader = fReaderMgr.getCurrentReaderNum(); // check to see if it's a tokenized type that is declared externally bool isAttTokenizedExternal = (attDef) ?attDef->isExternal() && (type == XMLAttDef::ID || type == XMLAttDef::IDRef || type == XMLAttDef::IDRefs || type == XMLAttDef::Entity || type == XMLAttDef::Entities || type == XMLAttDef::NmToken || type == XMLAttDef::NmTokens) :false; // Loop until we get the attribute value. Note that we use a double // loop here to avoid the setup/teardown overhead of the exception // handler on every round. XMLCh nextCh; XMLCh secondCh = 0; States curState = InContent; bool firstNonWS = false; bool gotLeadingSurrogate = false; bool escaped; while (true) { try { while(true) { nextCh = fReaderMgr.getNextChar(); if (!nextCh) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); // Check for our ending quote in the same entity if (nextCh == quoteCh) { if (curReader == fReaderMgr.getCurrentReaderNum()) return true; // Watch for spillover into a previous entity if (curReader > fReaderMgr.getCurrentReaderNum()) { emitError(XMLErrs::PartialMarkupInEntity); return false; } } // Check for an entity ref now, before we let it affect our // whitespace normalization logic below. We ignore the empty flag // in this one. escaped = false; if (nextCh == chAmpersand) { if (scanEntityRef(true, nextCh, secondCh, escaped) != EntityExp_Returned) { gotLeadingSurrogate = false; continue; } } else if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { // Deal with surrogate pairs // Its a leading surrogate. If we already got one, then // issue an error, else set leading flag to make sure that // we look for a trailing next time. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); else gotLeadingSurrogate = true; } else { // If its a trailing surrogate, make sure that we are // prepared for that. Else, its just a regular char so make // sure that we were not expected a trailing surrogate. if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) { // Its trailing, so make sure we were expecting it if (!gotLeadingSurrogate) emitError(XMLErrs::Unexpected2ndSurrogateChar); } else { // Its just a char, so make sure we were not expecting a // trailing surrogate. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); // Its got to at least be a valid XML character if (!fReaderMgr.getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); emitError(XMLErrs::InvalidCharacterInAttrValue, attrName, tmpBuf); } } gotLeadingSurrogate = false; } // If its not escaped, then make sure its not a < character, which // is not allowed in attribute values. if (!escaped && (nextCh == chOpenAngle)) emitError(XMLErrs::BracketInAttrValue, attrName); // If the attribute is a CDATA type we do simple replacement of // tabs and new lines with spaces, if the character is not escaped // by way of a char ref. // // Otherwise, we do the standard non-CDATA normalization of // compressing whitespace to single spaces and getting rid of leading // and trailing whitespace. if (type == XMLAttDef::CData) { if (!escaped) { if ((nextCh == 0x09) || (nextCh == 0x0A) || (nextCh == 0x0D)) { // Check Validity Constraint for Standalone document declaration // XML 1.0, Section 2.9 if (fStandalone && fValidate && isAttTokenizedExternal) { // Can't have a standalone document declaration of "yes" if attribute // values are subject to normalisation fValidator->emitError(XMLValid::NoAttNormForStandalone, attrName); } nextCh = chSpace; } } } else { if (curState == InWhitespace) { if ((escaped && nextCh != chSpace) || !fReaderMgr.getCurrentReader()->isWhitespace(nextCh)) { if (firstNonWS) toFill.append(chSpace); curState = InContent; firstNonWS = true; } else { continue; } } else if (curState == InContent) { if ((nextCh == chSpace) || (fReaderMgr.getCurrentReader()->isWhitespace(nextCh) && !escaped)) { curState = InWhitespace; // Check Validity Constraint for Standalone document declaration // XML 1.0, Section 2.9 if (fStandalone && fValidate && isAttTokenizedExternal) { if (!firstNonWS || (nextCh != chSpace && fReaderMgr.lookingAtSpace())) { // Can't have a standalone document declaration of "yes" if attribute // values are subject to normalisation fValidator->emitError(XMLValid::NoAttNormForStandalone, attrName); } } continue; } firstNonWS = true; } } // Else add it to the buffer toFill.append(nextCh); if (secondCh) { toFill.append(secondCh); secondCh=0; } } } catch(const EndOfEntityException&) { // Just eat it and continue. gotLeadingSurrogate = false; escaped = false; } } return true; } // This method scans a CDATA section. It collects the character into one // of the temp buffers and calls the document handler, if any, with the // characters. It assumes that the fThisElement->getCharDataOpts(); while (true) { const XMLCh nextCh = fReaderMgr.getNextChar(); // Watch for unexpected end of file if (!nextCh) { emitError(XMLErrs::UnterminatedCDATASection); ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); } if (fValidate && fStandalone && (fReaderMgr.getCurrentReader()->isWhitespace(nextCh))) { // This document is standalone; this ignorable CDATA whitespace is forbidden. // XML 1.0, Section 2.9 // And see if the current element is a 'Children' style content model if (topElem->fThisElement->isExternal()) { if (charOpts == XMLElementDecl::SpacesOk) // Element Content { // Error - standalone should have a value of "no" as whitespace detected in an // element type with element content whose element declaration was external fValidator->emitError(XMLValid::NoWSForStandalone); } } } // If this is a close square bracket it could be our closing // sequence. if (nextCh == chCloseSquare && fReaderMgr.skippedString(CDataClose)) { // make sure we were not expecting a trailing surrogate. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); if (fValidate) { if (charOpts != XMLElementDecl::AllCharData) { // They definitely cannot handle any type of char data fValidator->emitError(XMLValid::NoCharDataInCM); } } // If we have a doc handler, call it if (fDocHandler) { fDocHandler->docCharacters ( bbCData.getRawBuffer() , bbCData.getLen() , true ); } // And we are done break; } // Make sure its a valid character. But if we've emitted an error // already, don't bother with the overhead since we've already told // them about it. if (!emittedError) { // Deal with surrogate pairs if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { // Its a leading surrogate. If we already got one, then // issue an error, else set leading flag to make sure that // we look for a trailing next time. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); else gotLeadingSurrogate = true; } else { // If its a trailing surrogate, make sure that we are // prepared for that. Else, its just a regular char so make // sure that we were not expected a trailing surrogate. if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) { // Its trailing, so make sure we were expecting it if (!gotLeadingSurrogate) emitError(XMLErrs::Unexpected2ndSurrogateChar); } else { // Its just a char, so make sure we were not expecting a // trailing surrogate. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); // Its got to at least be a valid XML character else if (!fReaderMgr.getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); emitError(XMLErrs::InvalidCharacter, tmpBuf); emittedError = true; } } gotLeadingSurrogate = false; } } // Add it to the buffer bbCData.append(nextCh); } } void DGXMLScanner::scanCharData(XMLBuffer& toUse) { // We have to watch for the stupid ]]> sequence, which is illegal in // character data. So this is a little state machine that handles that. enum States { State_Waiting , State_GotOne , State_GotTwo }; // Reset the buffer before we start toUse.reset(); // Turn on the 'throw at end' flag of the reader manager ThrowEOEJanitor jan(&fReaderMgr, true); // In order to be more efficient we have to use kind of a deeply nested // set of blocks here. The outer block puts on a try and catches end of // entity exceptions. The inner loop is the per-character loop. If we // put the try inside the inner loop, it would work but would require // the exception handling code setup/teardown code to be invoked for // each character. XMLCh nextCh; XMLCh secondCh = 0; States curState = State_Waiting; bool escaped = false; bool gotLeadingSurrogate = false; bool notDone = true; while (notDone) { try { while (true) { // Eat through as many plain content characters as possible without // needing special handling. Moving most content characters here, // in this one call, rather than running the overall loop once // per content character, is a speed optimization. if (curState == State_Waiting && !gotLeadingSurrogate) { fReaderMgr.movePlainContentChars(toUse); } // Try to get another char from the source // The code from here on down covers all contengencies, if (!fReaderMgr.getNextCharIfNot(chOpenAngle, nextCh)) { // If we were waiting for a trailing surrogate, its an error if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); notDone = false; break; } // Watch for a reference. Note that the escapement mechanism // is ignored in this content. escaped = false; if (nextCh == chAmpersand) { sendCharData(toUse); // Turn off the throwing at the end of entity during this ThrowEOEJanitor jan(&fReaderMgr, false); if (scanEntityRef(false, nextCh, secondCh, escaped) != EntityExp_Returned) { gotLeadingSurrogate = false; continue; } else { if (escaped && !fElemStack.isEmpty()) fElemStack.setReferenceEscaped(); } } else if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { // Deal with surrogate pairs // Its a leading surrogate. If we already got one, then // issue an error, else set leading flag to make sure that // we look for a trailing next time. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); else gotLeadingSurrogate = true; } else { // If its a trailing surrogate, make sure that we are // prepared for that. Else, its just a regular char so make // sure that we were not expected a trailing surrogate. if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) { // Its trailing, so make sure we were expecting it if (!gotLeadingSurrogate) emitError(XMLErrs::Unexpected2ndSurrogateChar); } else { // Its just a char, so make sure we were not expecting a // trailing surrogate. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); // Make sure the returned char is a valid XML char if (!fReaderMgr.getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); emitError(XMLErrs::InvalidCharacter, tmpBuf); } } gotLeadingSurrogate = false; } // Keep the state machine up to date if (!escaped) { if (nextCh == chCloseSquare) { if (curState == State_Waiting) curState = State_GotOne; else if (curState == State_GotOne) curState = State_GotTwo; } else if (nextCh == chCloseAngle) { if (curState == State_GotTwo) emitError(XMLErrs::BadSequenceInCharData); curState = State_Waiting; } else { curState = State_Waiting; } } else { curState = State_Waiting; } // Add this char to the buffer toUse.append(nextCh); if (secondCh) { toUse.append(secondCh); secondCh=0; } } } catch(const EndOfEntityException& toCatch) { // Some entity ended, so we have to send any accumulated // chars and send an end of entity event. sendCharData(toUse); gotLeadingSurrogate = false; if (fDocHandler) fDocHandler->endEntityReference(toCatch.getEntity()); } } // Check the validity constraints as per XML 1.0 Section 2.9 if (fValidate && fStandalone) { // See if the text contains whitespace // Get the raw data we need for the callback const XMLCh* rawBuf = toUse.getRawBuffer(); const XMLSize_t len = toUse.getLen(); const bool isSpaces = fReaderMgr.getCurrentReader()->containsWhiteSpace(rawBuf, len); if (isSpaces) { // And see if the current element is a 'Children' style content model const ElemStack::StackElem* topElem = fElemStack.topElement(); if (topElem->fThisElement->isExternal()) { // Get the character data opts for the current element XMLElementDecl::CharDataOpts charOpts = topElem->fThisElement->getCharDataOpts(); if (charOpts == XMLElementDecl::SpacesOk) // => Element Content { // Error - standalone should have a value of "no" as whitespace detected in an // element type with element content whose element declaration was external // fValidator->emitError(XMLValid::NoWSForStandalone); } } } } // Send any char data that we accumulated into the buffer sendCharData(toUse); } // This method will scan a general/character entity ref. It will either // expand a char ref and return it directly, or push a reader for a general // entity. // // The return value indicates whether the char parameters hold the value // or whether the value was pushed as a reader, or that it failed. // // The escaped flag tells the caller whether the returned parameter resulted // from a character reference, which escapes the character in some cases. It // only makes any difference if the return value indicates the value was // returned directly. DGXMLScanner::EntityExpRes DGXMLScanner::scanEntityRef( const bool inAttVal , XMLCh& firstCh , XMLCh& secondCh , bool& escaped) { // Assume no escape secondCh = 0; escaped = false; // We have to insure that its all in one entity const XMLSize_t curReader = fReaderMgr.getCurrentReaderNum(); // If the next char is a pound, then its a character reference and we // need to expand it always. if (fReaderMgr.skippedChar(chPound)) { // Its a character reference, so scan it and get back the numeric // value it represents. if (!scanCharRef(firstCh, secondCh)) return EntityExp_Failed; escaped = true; if (curReader != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialMarkupInEntity); return EntityExp_Returned; } // Expand it since its a normal entity ref XMLBufBid bbName(&fBufMgr); int colonPosition; bool validName = fDoNamespaces ? fReaderMgr.getQName(bbName.getBuffer(), &colonPosition) : fReaderMgr.getName(bbName.getBuffer()); if (!validName) { if (bbName.isEmpty()) emitError(XMLErrs::ExpectedEntityRefName); else emitError(XMLErrs::InvalidEntityRefName, bbName.getRawBuffer()); return EntityExp_Failed; } // Next char must be a semi-colon. But if its not, just emit // an error and try to continue. if (!fReaderMgr.skippedChar(chSemiColon)) emitError(XMLErrs::UnterminatedEntityRef, bbName.getRawBuffer()); // Make sure we ended up on the same entity reader as the & char if (curReader != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialMarkupInEntity); // Look up the name in the general entity pool XMLEntityDecl* decl = fDTDGrammar->getEntityDecl(bbName.getRawBuffer()); // If it does not exist, then obviously an error if (!decl) { // XML 1.0 Section 4.1 // Well-formedness Constraint for entity not found: // In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, // or a document with "standalone='yes'", for an entity reference that does not occur within the external subset // or a parameter entity // // Else it's Validity Constraint if (fStandalone || fHasNoDTD) emitError(XMLErrs::EntityNotFound, bbName.getRawBuffer()); else { if (fValidate) fValidator->emitError(XMLValid::VC_EntityNotFound, bbName.getRawBuffer()); } return EntityExp_Failed; } // XML 1.0 Section 4.1 // If we are a standalone document, then it has to have been declared // in the internal subset. if (fStandalone && !decl->getDeclaredInIntSubset()) emitError(XMLErrs::IllegalRefInStandalone, bbName.getRawBuffer()); if (decl->isExternal()) { // If its unparsed, then its not valid here if (decl->isUnparsed()) { emitError(XMLErrs::NoUnparsedEntityRefs, bbName.getRawBuffer()); return EntityExp_Failed; } // If we are in an attribute value, then not valid but keep going if (inAttVal) emitError(XMLErrs::NoExtRefsInAttValue); // And now create a reader to read this entity InputSource* srcUsed; XMLReader* reader = fReaderMgr.createReader ( decl->getBaseURI() , decl->getSystemId() , decl->getPublicId() , false , XMLReader::RefFrom_NonLiteral , XMLReader::Type_General , XMLReader::Source_External , srcUsed , fCalculateSrcOfs , fLowWaterMark , fDisableDefaultEntityResolution ); // Put a janitor on the source so it gets cleaned up on exit Janitor janSrc(srcUsed); // If the creation failed, and its not because the source was empty, // then emit an error and return. if (!reader) ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Gen_CouldNotOpenExtEntity, srcUsed ? srcUsed->getSystemId() : decl->getSystemId(), fMemoryManager); // Push the reader. If its a recursive expansion, then emit an error // and return an failure. if (!fReaderMgr.pushReader(reader, decl)) { emitError(XMLErrs::RecursiveEntity, decl->getName()); return EntityExp_Failed; } // here's where we need to check if there's a SecurityManager, // how many entity references we've had if(fSecurityManager != 0 && ++fEntityExpansionCount > fEntityExpansionLimit) { XMLCh expLimStr[32]; XMLString::sizeToText(fEntityExpansionLimit, expLimStr, 31, 10, fMemoryManager); emitError ( XMLErrs::EntityExpansionLimitExceeded , expLimStr ); // there seems nothing better to do than reset the entity expansion counter fEntityExpansionCount = 0; } // Do a start entity reference event. // // For now, we supress them in att values. Later, when // the stuff is in place to correctly allow DOM to handle them // we'll turn this back on. if (fDocHandler && !inAttVal) fDocHandler->startEntityReference(*decl); // If it starts with the XML string, then parse a text decl if (checkXMLDecl(true)) scanXMLDecl(Decl_Text); } else { // If its one of the special char references, then we can return // it as a character, and its considered escaped. if (decl->getIsSpecialChar()) { firstCh = decl->getValue()[0]; escaped = true; return EntityExp_Returned; } // Create a reader over a memory stream over the entity value // We force it to assume UTF-16 by passing in an encoding // string. This way it won't both trying to predecode the // first line, looking for an XML/TextDecl. XMLReader* valueReader = fReaderMgr.createIntEntReader ( decl->getName() , XMLReader::RefFrom_NonLiteral , XMLReader::Type_General , decl->getValue() , decl->getValueLen() , false ); // Try to push the entity reader onto the reader manager stack, // where it will become the subsequent input. If it fails, that // means the entity is recursive, so issue an error. The reader // will have just been discarded, but we just keep going. if (!fReaderMgr.pushReader(valueReader, decl)) emitError(XMLErrs::RecursiveEntity, decl->getName()); // here's where we need to check if there's a SecurityManager, // how many entity references we've had if(fSecurityManager != 0 && ++fEntityExpansionCount > fEntityExpansionLimit) { XMLCh expLimStr[32]; XMLString::sizeToText(fEntityExpansionLimit, expLimStr, 31, 10, fMemoryManager); emitError ( XMLErrs::EntityExpansionLimitExceeded , expLimStr ); } // Do a start entity reference event. // // For now, we supress them in att values. Later, when // the stuff is in place to correctly allow DOM to handle them // we'll turn this back on. if (fDocHandler && !inAttVal) fDocHandler->startEntityReference(*decl); // If it starts with the XML string, then it's an error if (checkXMLDecl(true)) { emitError(XMLErrs::TextDeclNotLegalHere); fReaderMgr.skipPastChar(chCloseAngle); } } return EntityExp_Pushed; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/WFXMLScanner.cpp000644 000765 000024 00000215524 13241160334 023023 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: WFXMLScanner.cpp 833045 2009-11-05 13:21:27Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // WFXMLScanner: Constructors and Destructor // --------------------------------------------------------------------------- typedef JanitorMemFunCall CleanupType; typedef JanitorMemFunCall ReaderMgrResetType; WFXMLScanner::WFXMLScanner( XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager) : XMLScanner(valToAdopt, grammarResolver, manager) , fElementIndex(0) , fElements(0) , fEntityTable(0) , fAttrNameHashList(0) , fAttrNSList(0) , fElementLookup(0) { CleanupType cleanup(this, &WFXMLScanner::cleanUp); try { commonInit(); } catch(const OutOfMemoryException&) { // Don't cleanup when out of memory, since executing the // code can cause problems. cleanup.release(); throw; } cleanup.release(); } WFXMLScanner::WFXMLScanner( XMLDocumentHandler* const docHandler , DocTypeHandler* const docTypeHandler , XMLEntityHandler* const entityHandler , XMLErrorReporter* const errHandler , XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager) : XMLScanner(docHandler, docTypeHandler, entityHandler, errHandler, valToAdopt, grammarResolver, manager) , fElementIndex(0) , fElements(0) , fEntityTable(0) , fAttrNameHashList(0) , fAttrNSList(0) , fElementLookup(0) { CleanupType cleanup(this, &WFXMLScanner::cleanUp); try { commonInit(); } catch(const OutOfMemoryException&) { // Don't cleanup when out of memory, since executing the // code can cause problems. cleanup.release(); throw; } cleanup.release(); } WFXMLScanner::~WFXMLScanner() { cleanUp(); } // --------------------------------------------------------------------------- // XMLScanner: Getter methods // --------------------------------------------------------------------------- NameIdPool* WFXMLScanner::getEntityDeclPool() { return 0; } const NameIdPool* WFXMLScanner::getEntityDeclPool() const { return 0; } // --------------------------------------------------------------------------- // WFXMLScanner: Main entry point to scan a document // --------------------------------------------------------------------------- void WFXMLScanner::scanDocument(const InputSource& src) { // Bump up the sequence id for this parser instance. This will invalidate // any previous progressive scan tokens. fSequenceId++; ReaderMgrResetType resetReaderMgr(&fReaderMgr, &ReaderMgr::reset); try { // Reset the scanner and its plugged in stuff for a new run. This // resets all the data structures, creates the initial reader and // pushes it on the stack, and sets up the base document path. scanReset(src); // If we have a document handler, then call the start document if (fDocHandler) fDocHandler->startDocument(); // Scan the prolog part, which is everything before the root element // including the DTD subsets. scanProlog(); // If we got to the end of input, then its not a valid XML file. // Else, go on to scan the content. if (fReaderMgr.atEOF()) { emitError(XMLErrs::EmptyMainEntity); } else { // Scan content, and tell it its not an external entity if (scanContent()) { // That went ok, so scan for any miscellaneous stuff if (!fReaderMgr.atEOF()) scanMiscellaneous(); } } // If we have a document handler, then call the end document if (fDocHandler) fDocHandler->endDocument(); } // NOTE: // // In all of the error processing below, the emitError() call MUST come // before the flush of the reader mgr, or it will fail because it tries // to find out the position in the XML source of the error. catch(const XMLErrs::Codes) { // This is a 'first failure' exception, so fall through } catch(const XMLValid::Codes) { // This is a 'first fatal error' type exit, so fall through } catch(const XMLException& excToCatch) { // Emit the error and catch any user exception thrown from here. Make // sure in all cases we flush the reader manager. fInException = true; try { if (excToCatch.getErrorType() == XMLErrorReporter::ErrType_Warning) emitError ( XMLErrs::XMLException_Warning , excToCatch.getCode() , excToCatch.getMessage() ); else if (excToCatch.getErrorType() >= XMLErrorReporter::ErrType_Fatal) emitError ( XMLErrs::XMLException_Fatal , excToCatch.getCode() , excToCatch.getMessage() ); else emitError ( XMLErrs::XMLException_Error , excToCatch.getCode() , excToCatch.getMessage() ); } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } } bool WFXMLScanner::scanNext(XMLPScanToken& token) { // Make sure this token is still legal if (!isLegalToken(token)) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Scan_BadPScanToken, fMemoryManager); // Find the next token and remember the reader id XMLSize_t orgReader; XMLTokens curToken; bool retVal = true; ReaderMgrResetType resetReaderMgr(&fReaderMgr, &ReaderMgr::reset); try { while (true) { // We have to handle any end of entity exceptions that happen here. // We could be at the end of X nested entities, each of which will // generate an end of entity exception as we try to move forward. try { curToken = senseNextToken(orgReader); break; } catch(const EndOfEntityException& toCatch) { // Send an end of entity reference event if (fDocHandler) fDocHandler->endEntityReference(toCatch.getEntity()); } } if (curToken == Token_CharData) { scanCharData(fCDataBuf); } else if (curToken == Token_EOF) { if (!fElemStack.isEmpty()) { const ElemStack::StackElem* topElem = fElemStack.popTop(); emitError ( XMLErrs::EndedWithTagsOnStack , topElem->fThisElement->getFullName() ); } retVal = false; } else { // Its some sort of markup bool gotData = true; switch(curToken) { case Token_CData : // Make sure we are within content if (fElemStack.isEmpty()) emitError(XMLErrs::CDATAOutsideOfContent); scanCDSection(); break; case Token_Comment : scanComment(); break; case Token_EndTag : scanEndTag(gotData); break; case Token_PI : scanPI(); break; case Token_StartTag : if (fDoNamespaces) scanStartTagNS(gotData); else scanStartTag(gotData); break; default : fReaderMgr.skipToChar(chOpenAngle); break; } if (orgReader != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialMarkupInEntity); // If we hit the end, then do the miscellaneous part if (!gotData) { // That went ok, so scan for any miscellaneous stuff scanMiscellaneous(); if (fDocHandler) fDocHandler->endDocument(); } } } // NOTE: // // In all of the error processing below, the emitError() call MUST come // before the flush of the reader mgr, or it will fail because it tries // to find out the position in the XML source of the error. catch(const XMLErrs::Codes) { // This is a 'first failure' exception, so return failure retVal = false; } catch(const XMLValid::Codes) { // This is a 'first fatal error' type exit, so return failure retVal = false; } catch(const XMLException& excToCatch) { // Emit the error and catch any user exception thrown from here. Make // sure in all cases we flush the reader manager. fInException = true; try { if (excToCatch.getErrorType() == XMLErrorReporter::ErrType_Warning) emitError ( XMLErrs::XMLException_Warning , excToCatch.getCode() , excToCatch.getMessage() ); else if (excToCatch.getErrorType() >= XMLErrorReporter::ErrType_Fatal) emitError ( XMLErrs::XMLException_Fatal , excToCatch.getCode() , excToCatch.getMessage() ); else emitError ( XMLErrs::XMLException_Error , excToCatch.getCode() , excToCatch.getMessage() ); } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } // Return failure retVal = false; } catch(const OutOfMemoryException&) { throw; } // If we are not at the end, release the object that will // reset the ReaderMgr. if (retVal) resetReaderMgr.release(); return retVal; } // --------------------------------------------------------------------------- // WFXMLScanner: Private helper methods. // --------------------------------------------------------------------------- // This method handles the common initialization, to avoid having to do // it redundantly in multiple constructors. void WFXMLScanner::commonInit() { fEntityTable = new (fMemoryManager) ValueHashTableOf(11, fMemoryManager); fAttrNameHashList = new (fMemoryManager)ValueVectorOf(16, fMemoryManager); fAttrNSList = new (fMemoryManager) ValueVectorOf(8, fMemoryManager); fElements = new (fMemoryManager) RefVectorOf(32, true, fMemoryManager); fElementLookup = new (fMemoryManager) RefHashTableOf(109, false, fMemoryManager); // Add the default entity entries for the character refs that must always // be present. fEntityTable->put((void*) XMLUni::fgAmp, chAmpersand); fEntityTable->put((void*) XMLUni::fgLT, chOpenAngle); fEntityTable->put((void*) XMLUni::fgGT, chCloseAngle); fEntityTable->put((void*) XMLUni::fgQuot, chDoubleQuote); fEntityTable->put((void*) XMLUni::fgApos, chSingleQuote); } void WFXMLScanner::cleanUp() { delete fEntityTable; delete fAttrNameHashList; delete fAttrNSList; delete fElementLookup; delete fElements; } // This method will reset the scanner data structures, and related plugged // in stuff, for a new scan session. We get the input source for the primary // XML entity, create the reader for it, and push it on the stack so that // upon successful return from here we are ready to go. void WFXMLScanner::scanReset(const InputSource& src) { // For all installed handlers, send reset events. This gives them // a chance to flush any cached data. if (fDocHandler) fDocHandler->resetDocument(); if (fEntityHandler) fEntityHandler->resetEntities(); if (fErrorReporter) fErrorReporter->resetErrors(); // Reset the element stack, and give it the latest ids for the special // URIs it has to know about. fElemStack.reset ( fEmptyNamespaceId , fUnknownNamespaceId , fXMLNamespaceId , fXMLNSNamespaceId ); // Reset some status flags fInException = false; fStandalone = false; fErrorCount = 0; fHasNoDTD = true; fElementIndex = 0; // Reset elements lookup table fElementLookup->removeAll(); // Handle the creation of the XML reader object for this input source. // This will provide us with transcoding and basic lexing services. XMLReader* newReader = fReaderMgr.createReader ( src , true , XMLReader::RefFrom_NonLiteral , XMLReader::Type_General , XMLReader::Source_External , fCalculateSrcOfs , fLowWaterMark ); if (!newReader) { if (src.getIssueFatalErrorIfNotFound()) ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Scan_CouldNotOpenSource, src.getSystemId(), fMemoryManager); else ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Scan_CouldNotOpenSource_Warning, src.getSystemId(), fMemoryManager); } // Push this read onto the reader manager fReaderMgr.pushReader(newReader, 0); // and reset security-related things if necessary: if(fSecurityManager != 0) { fEntityExpansionLimit = fSecurityManager->getEntityExpansionLimit(); fEntityExpansionCount = 0; } } // This method is called between markup in content. It scans for character // data that is sent to the document handler. It watches for any markup // characters that would indicate that the character data has ended. It also // handles expansion of general and character entities. // // sendData() is a local static helper for this method which handles some // code that must be done in three different places here. void WFXMLScanner::sendCharData(XMLBuffer& toSend) { // If no data in the buffer, then nothing to do if (toSend.isEmpty()) return; // Always assume its just char data if not validating if (fDocHandler) fDocHandler->docCharacters(toSend.getRawBuffer(), toSend.getLen(), false); // Reset buffer toSend.reset(); } // --------------------------------------------------------------------------- // WFXMLScanner: Private scanning methods // --------------------------------------------------------------------------- // This method will kick off the scanning of the primary content of the // document, i.e. the elements. bool WFXMLScanner::scanContent() { // Go into a loop until we hit the end of the root element, or we fall // out because there is no root element. // // We have to do kind of a deeply nested double loop here in order to // avoid doing the setup/teardown of the exception handler on each // round. Doing it this way we only do it when an exception actually // occurs. bool gotData = true; bool inMarkup = false; while (gotData) { try { while (gotData) { // Sense what the next top level token is. According to what // this tells us, we will call something to handle that kind // of thing. XMLSize_t orgReader; const XMLTokens curToken = senseNextToken(orgReader); // Handle character data and end of file specially. Char data // is not markup so we don't want to handle it in the loop // below. if (curToken == Token_CharData) { // Scan the character data and call appropriate events. Let // him use our local character data buffer for efficiency. scanCharData(fCDataBuf); continue; } else if (curToken == Token_EOF) { // The element stack better be empty at this point or we // ended prematurely before all elements were closed. if (!fElemStack.isEmpty()) { const ElemStack::StackElem* topElem = fElemStack.popTop(); emitError ( XMLErrs::EndedWithTagsOnStack , topElem->fThisElement->getFullName() ); } // Its the end of file, so clear the got data flag gotData = false; continue; } // We are in some sort of markup now inMarkup = true; // According to the token we got, call the appropriate // scanning method. switch(curToken) { case Token_CData : // Make sure we are within content if (fElemStack.isEmpty()) emitError(XMLErrs::CDATAOutsideOfContent); scanCDSection(); break; case Token_Comment : scanComment(); break; case Token_EndTag : scanEndTag(gotData); break; case Token_PI : scanPI(); break; case Token_StartTag : if (fDoNamespaces) scanStartTagNS(gotData); else scanStartTag(gotData); break; default : fReaderMgr.skipToChar(chOpenAngle); break; } if (orgReader != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialMarkupInEntity); // And we are back out of markup again inMarkup = false; } } catch(const EndOfEntityException& toCatch) { // If we were in some markup when this happened, then its a // partial markup error. if (inMarkup) emitError(XMLErrs::PartialMarkupInEntity); // Send an end of entity reference event if (fDocHandler) fDocHandler->endEntityReference(toCatch.getEntity()); inMarkup = false; } } // It went ok, so return success return true; } void WFXMLScanner::scanEndTag(bool& gotData) { // Assume we will still have data until proven otherwise. It will only // ever be false if this is the end of the root element. gotData = true; // Check if the element stack is empty. If so, then this is an unbalanced // element (i.e. more ends than starts, perhaps because of bad text // causing one to be skipped.) if (fElemStack.isEmpty()) { emitError(XMLErrs::MoreEndThanStartTags); fReaderMgr.skipPastChar(chCloseAngle); ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Scan_UnbalancedStartEnd, fMemoryManager); } // Pop the stack of the element we are supposed to be ending. Remember // that we don't own this. The stack just keeps them and reuses them. unsigned int uriId = (fDoNamespaces) ? fElemStack.getCurrentURI() : fEmptyNamespaceId; const ElemStack::StackElem* topElem = fElemStack.popTop(); // See if it was the root element, to avoid multiple calls below const bool isRoot = fElemStack.isEmpty(); // Make sure that its the end of the element that we expect if (!fReaderMgr.skippedStringLong(topElem->fThisElement->getFullName())) { emitError ( XMLErrs::ExpectedEndOfTagX , topElem->fThisElement->getFullName() ); fReaderMgr.skipPastChar(chCloseAngle); return; } // Make sure we are back on the same reader as where we started if (topElem->fReaderNum != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialTagMarkupError); // Skip optional whitespace fReaderMgr.skipPastSpaces(); // Make sure we find the closing bracket if (!fReaderMgr.skippedChar(chCloseAngle)) { emitError ( XMLErrs::UnterminatedEndTag , topElem->fThisElement->getFullName() ); } // If we have a doc handler, tell it about the end tag if (fDocHandler) { fDocHandler->endElement ( *topElem->fThisElement , uriId , isRoot , topElem->fThisElement->getElementName()->getPrefix() ); } // If this was the root, then done with content gotData = !isRoot; } void WFXMLScanner::scanDocTypeDecl() { // Just skips over it // REVISIT: Should we issue a warning static const XMLCh doctypeIE[] = { chOpenSquare, chCloseAngle, chNull }; XMLCh nextCh = fReaderMgr.skipUntilIn(doctypeIE); if (nextCh == chOpenSquare) fReaderMgr.skipPastChar(chCloseSquare); fReaderMgr.skipPastChar(chCloseAngle); } bool WFXMLScanner::scanStartTag(bool& gotData) { // Assume we will still have data until proven otherwise. It will only // ever be false if this is the root and its empty. gotData = true; // Get the QName. In this case, we are not doing namespaces, so we just // use it as is and don't have to break it into parts. if (!fReaderMgr.getName(fQNameBuf)) { emitError(XMLErrs::ExpectedElementName); fReaderMgr.skipToChar(chOpenAngle); return false; } // Assume it won't be an empty tag bool isEmpty = false; // See if its the root element const bool isRoot = fElemStack.isEmpty(); // Lets try to look up the element const XMLCh* qnameRawBuf = fQNameBuf.getRawBuffer(); XMLElementDecl* elemDecl = fElementLookup->get(qnameRawBuf); if (!elemDecl) { if (fElementIndex < fElements->size()) { elemDecl = fElements->elementAt(fElementIndex); } else { elemDecl = new (fGrammarPoolMemoryManager) DTDElementDecl ( fGrammarPoolMemoryManager ); fElements->addElement(elemDecl); } elemDecl->setElementName(XMLUni::fgZeroLenString, qnameRawBuf, fEmptyNamespaceId); fElementLookup->put((void*)elemDecl->getFullName(), elemDecl); fElementIndex++; } // Expand the element stack and add the new element fElemStack.addLevel(elemDecl, fReaderMgr.getCurrentReaderNum()); // Skip any whitespace after the name fReaderMgr.skipPastSpaces(); // We loop until we either see a /> or >, handling attribute/value // pairs until we get there. XMLSize_t attCount = 0; XMLSize_t curAttListSize = fAttrList->size(); while (true) { // And get the next non-space character XMLCh nextCh = fReaderMgr.peekNextChar(); // If the next character is not a slash or closed angle bracket, // then it must be whitespace, since whitespace is required // between the end of the last attribute and the name of the next // one. if (attCount) { if ((nextCh != chForwardSlash) && (nextCh != chCloseAngle)) { bool bFoundSpace; fReaderMgr.skipPastSpaces(bFoundSpace); if (!bFoundSpace) { // Emit the error but keep on going emitError(XMLErrs::ExpectedWhitespace); } // Ok, peek another char nextCh = fReaderMgr.peekNextChar(); } } // Ok, here we first check for any of the special case characters. // If its not one, then we do the normal case processing, which // assumes that we've hit an attribute value, Otherwise, we do all // the special case checks. if (!fReaderMgr.getCurrentReader()->isSpecialStartTagChar(nextCh)) { // Assume its going to be an attribute, so get a name from // the input. if (!fReaderMgr.getName(fAttNameBuf)) { emitError(XMLErrs::ExpectedAttrName); fReaderMgr.skipPastChar(chCloseAngle); return false; } // And next must be an equal sign if (!scanEq()) { static const XMLCh tmpList[] = { chSingleQuote, chDoubleQuote, chCloseAngle , chOpenAngle, chForwardSlash, chNull }; emitError(XMLErrs::ExpectedEqSign); // Try to sync back up by skipping forward until we either // hit something meaningful. const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList); if ((chFound == chCloseAngle) || (chFound == chForwardSlash)) { // Jump back to top for normal processing of these continue; } else if ((chFound == chSingleQuote) || (chFound == chDoubleQuote) || fReaderMgr.getCurrentReader()->isWhitespace(chFound)) { // Just fall through assuming that the value is to follow } else if (chFound == chOpenAngle) { // Assume a malformed tag and that new one is starting emitError(XMLErrs::UnterminatedStartTag, qnameRawBuf); return false; } else { // Something went really wrong return false; } } // See if this attribute is declared more than one for this element. const XMLCh* attNameRawBuf = fAttNameBuf.getRawBuffer(); XMLSize_t attNameHash = XMLString::hash(attNameRawBuf, 109); if (attCount) { for (XMLSize_t k=0; k < attCount; k++) { if (fAttrNameHashList->elementAt(k) == attNameHash) { if ( XMLString::equals ( fAttrList->elementAt(k)->getName() , attNameRawBuf ) ) { emitError ( XMLErrs::AttrAlreadyUsedInSTag , attNameRawBuf , qnameRawBuf ); break; } } } } // Skip any whitespace before the value and then scan the att // value. This will come back normalized with entity refs and // char refs expanded. fReaderMgr.skipPastSpaces(); if (!scanAttValue(attNameRawBuf, fAttValueBuf)) { static const XMLCh tmpList[] = { chCloseAngle, chOpenAngle, chForwardSlash, chNull }; emitError(XMLErrs::ExpectedAttrValue); // It failed, so lets try to get synced back up. We skip // forward until we find some whitespace or one of the // chars in our list. const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList); if ((chFound == chCloseAngle) || (chFound == chForwardSlash) || fReaderMgr.getCurrentReader()->isWhitespace(chFound)) { // Just fall through and process this attribute, though // the value will be "". } else if (chFound == chOpenAngle) { // Assume a malformed tag and that new one is starting emitError(XMLErrs::UnterminatedStartTag, qnameRawBuf); return false; } else { // Something went really wrong return false; } } // Add this attribute to the attribute list that we use to // pass them to the handler. We reuse its existing elements // but expand it as required. XMLAttr* curAtt; if (attCount >= curAttListSize) { curAtt = new (fMemoryManager) XMLAttr ( 0 , attNameRawBuf , XMLUni::fgZeroLenString , fAttValueBuf.getRawBuffer() , XMLAttDef::CData , true , fMemoryManager ); fAttrList->addElement(curAtt); fAttrNameHashList->addElement(attNameHash); } else { curAtt = fAttrList->elementAt(attCount); curAtt->set ( 0 , attNameRawBuf , XMLUni::fgZeroLenString , fAttValueBuf.getRawBuffer() ); curAtt->setSpecified(true); fAttrNameHashList->setElementAt(attNameHash, attCount); } attCount++; // And jump back to the top of the loop continue; } // It was some special case character so do all of the checks and // deal with it. if (!nextCh) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); if (nextCh == chForwardSlash) { fReaderMgr.getNextChar(); isEmpty = true; if (!fReaderMgr.skippedChar(chCloseAngle)) emitError(XMLErrs::UnterminatedStartTag, qnameRawBuf); break; } else if (nextCh == chCloseAngle) { fReaderMgr.getNextChar(); break; } else if (nextCh == chOpenAngle) { // Check for this one specially, since its going to be common // and it is kind of auto-recovering since we've already hit the // next open bracket, which is what we would have seeked to (and // skipped this whole tag.) emitError(XMLErrs::UnterminatedStartTag, elemDecl->getFullName()); break; } else if ((nextCh == chSingleQuote) || (nextCh == chDoubleQuote)) { // Check for this one specially, which is probably a missing // attribute name, e.g. ="value". Just issue expected name // error and eat the quoted string, then jump back to the // top again. emitError(XMLErrs::ExpectedAttrName); fReaderMgr.getNextChar(); fReaderMgr.skipQuotedString(nextCh); fReaderMgr.skipPastSpaces(); continue; } } // If empty, validate content right now if we are validating and then // pop the element stack top. Else, we have to update the current stack // top's namespace mapping elements. if (isEmpty) { // Pop the element stack back off since it'll never be used now fElemStack.popTop(); // If the elem stack is empty, then it was an empty root if (isRoot) gotData = false; } // If we have a document handler, then tell it about this start tag. We // don't have any URI id to send along, so send fEmptyNamespaceId. We also do not send // any prefix since its just one big name if we are not doing namespaces. if (fDocHandler) { fDocHandler->startElement ( *elemDecl , fEmptyNamespaceId , 0 , *fAttrList , attCount , isEmpty , isRoot ); } return true; } // This method is called to scan a start tag when we are processing // namespaces. There are two different versions of this method, one for // namespace aware processing an done for non-namespace aware processing. // // This method is called after we've scanned the < of a start tag. So we // have to get the element name, then scan the attributes, after which // we are either going to see >, />, or attributes followed by one of those // sequences. bool WFXMLScanner::scanStartTagNS(bool& gotData) { // Assume we will still have data until proven otherwise. It will only // ever be false if this is the root and its empty. gotData = true; // The current position is after the open bracket, so we need to read in // in the element name. int colonPosition; if (!fReaderMgr.getQName(fQNameBuf, &colonPosition)) { if (fQNameBuf.isEmpty()) emitError(XMLErrs::ExpectedElementName); else emitError(XMLErrs::InvalidElementName, fQNameBuf.getRawBuffer()); fReaderMgr.skipToChar(chOpenAngle); return false; } // See if its the root element const bool isRoot = fElemStack.isEmpty(); // Assume it won't be an empty tag bool isEmpty = false; // Skip any whitespace after the name fReaderMgr.skipPastSpaces(); // Lets try to look up the element const XMLCh* qnameRawBuf = fQNameBuf.getRawBuffer(); XMLElementDecl* elemDecl = fElementLookup->get(qnameRawBuf); if (!elemDecl) { if (!XMLString::compareNString(qnameRawBuf, XMLUni::fgXMLNSColonString, 6)) emitError(XMLErrs::NoXMLNSAsElementPrefix, qnameRawBuf); if (fElementIndex < fElements->size()) { elemDecl = fElements->elementAt(fElementIndex); } else { elemDecl = new (fGrammarPoolMemoryManager) DTDElementDecl ( fGrammarPoolMemoryManager ); fElements->addElement(elemDecl); } elemDecl->setElementName(qnameRawBuf, fEmptyNamespaceId); fElementLookup->put((void*)elemDecl->getFullName(), elemDecl); fElementIndex++; } // Expand the element stack and add the new element fElemStack.addLevel(elemDecl, fReaderMgr.getCurrentReaderNum()); // reset NS attribute list fAttrNSList->removeAllElements(); // We loop until we either see a /> or >, handling attribute/value // pairs until we get there. XMLSize_t attCount = 0; XMLSize_t curAttListSize = fAttrList->size(); while (true) { // And get the next non-space character XMLCh nextCh = fReaderMgr.peekNextChar(); // If the next character is not a slash or closed angle bracket, // then it must be whitespace, since whitespace is required // between the end of the last attribute and the name of the next // one. if (attCount) { if ((nextCh != chForwardSlash) && (nextCh != chCloseAngle)) { bool bFoundSpace; fReaderMgr.skipPastSpaces(bFoundSpace); if (!bFoundSpace) { // Emit the error but keep on going emitError(XMLErrs::ExpectedWhitespace); } // Ok, peek another char nextCh = fReaderMgr.peekNextChar(); } } // Ok, here we first check for any of the special case characters. // If its not one, then we do the normal case processing, which // assumes that we've hit an attribute value, Otherwise, we do all // the special case checks. if (!fReaderMgr.getCurrentReader()->isSpecialStartTagChar(nextCh)) { // Assume its going to be an attribute, so get a name from // the input. int colonPosition; if (!fReaderMgr.getQName(fAttNameBuf, &colonPosition)) { if (fAttNameBuf.isEmpty()) emitError(XMLErrs::ExpectedAttrName); else emitError(XMLErrs::InvalidAttrName, fAttNameBuf.getRawBuffer()); fReaderMgr.skipPastChar(chCloseAngle); return false; } // And next must be an equal sign if (!scanEq()) { static const XMLCh tmpList[] = { chSingleQuote, chDoubleQuote, chCloseAngle , chOpenAngle, chForwardSlash, chNull }; emitError(XMLErrs::ExpectedEqSign); // Try to sync back up by skipping forward until we either // hit something meaningful. const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList); if ((chFound == chCloseAngle) || (chFound == chForwardSlash)) { // Jump back to top for normal processing of these continue; } else if ((chFound == chSingleQuote) || (chFound == chDoubleQuote) || fReaderMgr.getCurrentReader()->isWhitespace(chFound)) { // Just fall through assuming that the value is to follow } else if (chFound == chOpenAngle) { // Assume a malformed tag and that new one is starting emitError(XMLErrs::UnterminatedStartTag, qnameRawBuf); return false; } else { // Something went really wrong return false; } } // See if this attribute is declared more than one for this element. const XMLCh* attNameRawBuf = fAttNameBuf.getRawBuffer(); XMLSize_t attNameHash = XMLString::hash(attNameRawBuf, 109); if (attCount) { for (XMLSize_t k=0; k < attCount; k++) { if (fAttrNameHashList->elementAt(k) == attNameHash) { if (XMLString::equals( fAttrList->elementAt(k)->getQName() , attNameRawBuf)) { emitError ( XMLErrs::AttrAlreadyUsedInSTag , attNameRawBuf , qnameRawBuf ); break; } } } } // Skip any whitespace before the value and then scan the att // value. This will come back normalized with entity refs and // char refs expanded. fReaderMgr.skipPastSpaces(); if (!scanAttValue(attNameRawBuf, fAttValueBuf)) { static const XMLCh tmpList[] = { chCloseAngle, chOpenAngle, chForwardSlash, chNull }; emitError(XMLErrs::ExpectedAttrValue); // It failed, so lets try to get synced back up. We skip // forward until we find some whitespace or one of the // chars in our list. const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList); if ((chFound == chCloseAngle) || (chFound == chForwardSlash) || fReaderMgr.getCurrentReader()->isWhitespace(chFound)) { // Just fall through and process this attribute, though // the value will be "". } else if (chFound == chOpenAngle) { // Assume a malformed tag and that new one is starting emitError(XMLErrs::UnterminatedStartTag, qnameRawBuf); return false; } else { // Something went really wrong return false; } } // Add this attribute to the attribute list that we use to // pass them to the handler. We reuse its existing elements // but expand it as required. const XMLCh* attValueRawBuf = fAttValueBuf.getRawBuffer(); XMLAttr* curAtt = 0; if (attCount >= curAttListSize) { curAtt = new (fMemoryManager) XMLAttr ( fEmptyNamespaceId , attNameRawBuf , attValueRawBuf , XMLAttDef::CData , true , fMemoryManager ); fAttrList->addElement(curAtt); fAttrNameHashList->addElement(attNameHash); } else { curAtt = fAttrList->elementAt(attCount); curAtt->set ( fEmptyNamespaceId , attNameRawBuf , attValueRawBuf ); curAtt->setSpecified(true); fAttrNameHashList->setElementAt(attNameHash, attCount); } // Map prefix to namespace const XMLCh* attPrefix = curAtt->getPrefix(); const XMLCh* attLocalName = curAtt->getName(); const XMLCh* namespaceURI = fAttValueBuf.getRawBuffer(); if (attPrefix && *attPrefix) { if (XMLString::equals(attPrefix, XMLUni::fgXMLString)) { curAtt->setURIId(fXMLNamespaceId); } else if (XMLString::equals(attPrefix, XMLUni::fgXMLNSString)) { if (XMLString::equals(attLocalName, XMLUni::fgXMLNSString)) emitError(XMLErrs::NoUseOfxmlnsAsPrefix); else if (XMLString::equals(attLocalName, XMLUni::fgXMLString)) { if (!XMLString::equals(namespaceURI, XMLUni::fgXMLURIName)) emitError(XMLErrs::PrefixXMLNotMatchXMLURI); } if (!namespaceURI) emitError(XMLErrs::NoEmptyStrNamespace, attNameRawBuf); else if(!*namespaceURI && fXMLVersion == XMLReader::XMLV1_0) emitError(XMLErrs::NoEmptyStrNamespace, attNameRawBuf); fElemStack.addPrefix ( attLocalName , fURIStringPool->addOrFind(namespaceURI) ); curAtt->setURIId(fXMLNSNamespaceId); } else { fAttrNSList->addElement(curAtt); } } else { if (XMLString::equals(XMLUni::fgXMLNSString, attLocalName)) { if (XMLString::equals(namespaceURI, XMLUni::fgXMLNSURIName)) emitError(XMLErrs::NoUseOfxmlnsURI); else if (XMLString::equals(namespaceURI, XMLUni::fgXMLURIName)) emitError(XMLErrs::XMLURINotMatchXMLPrefix); fElemStack.addPrefix ( XMLUni::fgZeroLenString , fURIStringPool->addOrFind(namespaceURI) ); } } // increment attribute count attCount++; // And jump back to the top of the loop continue; } // It was some special case character so do all of the checks and // deal with it. if (!nextCh) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); if (nextCh == chForwardSlash) { fReaderMgr.getNextChar(); isEmpty = true; if (!fReaderMgr.skippedChar(chCloseAngle)) emitError(XMLErrs::UnterminatedStartTag, qnameRawBuf); break; } else if (nextCh == chCloseAngle) { fReaderMgr.getNextChar(); break; } else if (nextCh == chOpenAngle) { // Check for this one specially, since its going to be common // and it is kind of auto-recovering since we've already hit the // next open bracket, which is what we would have seeked to (and // skipped this whole tag.) emitError(XMLErrs::UnterminatedStartTag, qnameRawBuf); break; } else if ((nextCh == chSingleQuote) || (nextCh == chDoubleQuote)) { // Check for this one specially, which is probably a missing // attribute name, e.g. ="value". Just issue expected name // error and eat the quoted string, then jump back to the // top again. emitError(XMLErrs::ExpectedAttrName); fReaderMgr.getNextChar(); fReaderMgr.skipQuotedString(nextCh); fReaderMgr.skipPastSpaces(); continue; } } // Handle provided attributes that we did not map their prefixes for (unsigned int i=0; i < fAttrNSList->size(); i++) { XMLAttr* providedAttr = fAttrNSList->elementAt(i); providedAttr->setURIId ( resolvePrefix ( providedAttr->getPrefix(), ElemStack::Mode_Attribute ) ); } if(attCount) { // // Decide if to use hash table to do duplicate checking // bool toUseHashTable = false; setAttrDupChkRegistry(attCount, toUseHashTable); // check for duplicate namespace attributes: // by checking for qualified names with the same local part and with prefixes // which have been bound to namespace names that are identical. XMLAttr* loopAttr; XMLAttr* curAtt; for (unsigned int attrIndex=0; attrIndex < attCount-1; attrIndex++) { loopAttr = fAttrList->elementAt(attrIndex); if (!toUseHashTable) { for (unsigned int curAttrIndex = attrIndex+1; curAttrIndex < attCount; curAttrIndex++) { curAtt = fAttrList->elementAt(curAttrIndex); if (curAtt->getURIId() == loopAttr->getURIId() && XMLString::equals(curAtt->getName(), loopAttr->getName())) { emitError ( XMLErrs::AttrAlreadyUsedInSTag , curAtt->getName() , elemDecl->getFullName() ); } } } else { if (fAttrDupChkRegistry->containsKey((void*)loopAttr->getName(), loopAttr->getURIId())) { emitError ( XMLErrs::AttrAlreadyUsedInSTag , loopAttr->getName() , elemDecl->getFullName() ); } fAttrDupChkRegistry->put((void*)loopAttr->getName(), loopAttr->getURIId(), loopAttr); } } } // Resolve the qualified name to a URI. unsigned int uriId = resolvePrefix ( elemDecl->getElementName()->getPrefix() , ElemStack::Mode_Element ); // Now we can update the element stack fElemStack.setCurrentURI(uriId); // Tell the document handler about this start tag if (fDocHandler) { fDocHandler->startElement ( *elemDecl , uriId , elemDecl->getElementName()->getPrefix() , *fAttrList , attCount , isEmpty , isRoot ); } // If empty, validate content right now if we are validating and then // pop the element stack top. Else, we have to update the current stack // top's namespace mapping elements. if (isEmpty) { // Pop the element stack back off since it'll never be used now fElemStack.popTop(); // If the elem stack is empty, then it was an empty root if (isRoot) gotData = false; } return true; } // --------------------------------------------------------------------------- // XMLScanner: Private parsing methods // --------------------------------------------------------------------------- bool WFXMLScanner::scanAttValue(const XMLCh* const attrName , XMLBuffer& toFill) { // Reset the target buffer toFill.reset(); // Get the next char which must be a single or double quote XMLCh quoteCh; if (!fReaderMgr.skipIfQuote(quoteCh)) return false; // We have to get the current reader because we have to ignore closing // quotes until we hit the same reader again. const XMLSize_t curReader = fReaderMgr.getCurrentReaderNum(); // Loop until we get the attribute value. Note that we use a double // loop here to avoid the setup/teardown overhead of the exception // handler on every round. XMLCh nextCh; XMLCh secondCh = 0; bool gotLeadingSurrogate = false; bool escaped; while (true) { try { while(true) { nextCh = fReaderMgr.getNextChar(); if (!nextCh) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); // Check for our ending quote in the same entity if (nextCh == quoteCh) { if (curReader == fReaderMgr.getCurrentReaderNum()) return true; // Watch for spillover into a previous entity if (curReader > fReaderMgr.getCurrentReaderNum()) { emitError(XMLErrs::PartialMarkupInEntity); return false; } } // Check for an entity ref now, before we let it affect our // whitespace normalization logic below. We ignore the empty flag // in this one. escaped = false; if (nextCh == chAmpersand) { if (scanEntityRef(true, nextCh, secondCh, escaped) != EntityExp_Returned) { gotLeadingSurrogate = false; continue; } } else if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { // Deal with surrogate pairs // Its a leading surrogate. If we already got one, then // issue an error, else set leading flag to make sure that // we look for a trailing next time. if (gotLeadingSurrogate) { emitError(XMLErrs::Expected2ndSurrogateChar); } else gotLeadingSurrogate = true; } else { // If its a trailing surrogate, make sure that we are // prepared for that. Else, its just a regular char so make // sure that we were not expected a trailing surrogate. if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) { // Its trailing, so make sure we were expecting it if (!gotLeadingSurrogate) emitError(XMLErrs::Unexpected2ndSurrogateChar); } else { // Its just a char, so make sure we were not expecting a // trailing surrogate. if (gotLeadingSurrogate) { emitError(XMLErrs::Expected2ndSurrogateChar); } // Its got to at least be a valid XML character else if (!fReaderMgr.getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); emitError(XMLErrs::InvalidCharacterInAttrValue, attrName, tmpBuf); } } gotLeadingSurrogate = false; } // If its not escaped, then make sure its not a < character, which // is not allowed in attribute values. if (!escaped) { if (nextCh == chOpenAngle) emitError(XMLErrs::BracketInAttrValue, attrName); else if (fReaderMgr.getCurrentReader()->isWhitespace(nextCh)) nextCh = chSpace; } // Else add it to the buffer toFill.append(nextCh); if (secondCh) { toFill.append(secondCh); secondCh=0; } } } catch(const EndOfEntityException&) { // Just eat it and continue. gotLeadingSurrogate = false; escaped = false; } } return true; } // This method scans a CDATA section. It collects the character into one // of the temp buffers and calls the document handler, if any, with the // characters. It assumes that the docCharacters ( bbCData.getRawBuffer() , bbCData.getLen() , true ); } // And we are done break; } // Make sure its a valid character. But if we've emitted an error // already, don't bother with the overhead since we've already told // them about it. if (!emittedError) { // Deal with surrogate pairs if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { // Its a leading surrogate. If we already got one, then // issue an error, else set leading flag to make sure that // we look for a trailing next time. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); else gotLeadingSurrogate = true; } else { // If its a trailing surrogate, make sure that we are // prepared for that. Else, its just a regular char so make // sure that we were not expected a trailing surrogate. if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) { // Its trailing, so make sure we were expecting it if (!gotLeadingSurrogate) emitError(XMLErrs::Unexpected2ndSurrogateChar); } else { // Its just a char, so make sure we were not expecting a // trailing surrogate. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); // Its got to at least be a valid XML character else if (!fReaderMgr.getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); emitError(XMLErrs::InvalidCharacter, tmpBuf); emittedError = true; } } gotLeadingSurrogate = false; } } // Add it to the buffer bbCData.append(nextCh); } } void WFXMLScanner::scanCharData(XMLBuffer& toUse) { // We have to watch for the stupid ]]> sequence, which is illegal in // character data. So this is a little state machine that handles that. enum States { State_Waiting , State_GotOne , State_GotTwo }; // Reset the buffer before we start toUse.reset(); // Turn on the 'throw at end' flag of the reader manager ThrowEOEJanitor jan(&fReaderMgr, true); // In order to be more efficient we have to use kind of a deeply nested // set of blocks here. The outer block puts on a try and catches end of // entity exceptions. The inner loop is the per-character loop. If we // put the try inside the inner loop, it would work but would require // the exception handling code setup/teardown code to be invoked for // each character. XMLCh nextCh; XMLCh secondCh = 0; States curState = State_Waiting; bool escaped = false; bool gotLeadingSurrogate = false; bool notDone = true; while (notDone) { try { while (true) { // Eat through as many plain content characters as possible without // needing special handling. Moving most content characters here, // in this one call, rather than running the overall loop once // per content character, is a speed optimization. if (curState == State_Waiting && !gotLeadingSurrogate) { fReaderMgr.movePlainContentChars(toUse); } // Try to get another char from the source // The code from here on down covers all contengencies, if (!fReaderMgr.getNextCharIfNot(chOpenAngle, nextCh)) { // If we were waiting for a trailing surrogate, its an error if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); notDone = false; break; } // Watch for a reference. Note that the escapement mechanism // is ignored in this content. escaped = false; if (nextCh == chAmpersand) { sendCharData(toUse); // Turn off the throwing at the end of entity during this ThrowEOEJanitor jan(&fReaderMgr, false); if (scanEntityRef(false, nextCh, secondCh, escaped) != EntityExp_Returned) { gotLeadingSurrogate = false; continue; } } else if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { // Deal with surrogate pairs // Its a leading surrogate. If we already got one, then // issue an error, else set leading flag to make sure that // we look for a trailing next time. if (gotLeadingSurrogate) { emitError(XMLErrs::Expected2ndSurrogateChar); } else gotLeadingSurrogate = true; } else { // If its a trailing surrogate, make sure that we are // prepared for that. Else, its just a regular char so make // sure that we were not expected a trailing surrogate. if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) { // Its trailing, so make sure we were expecting it if (!gotLeadingSurrogate) emitError(XMLErrs::Unexpected2ndSurrogateChar); } else { // Its just a char, so make sure we were not expecting a // trailing surrogate. if (gotLeadingSurrogate) { emitError(XMLErrs::Expected2ndSurrogateChar); } // Its got to at least be a valid XML character else if (!fReaderMgr.getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); emitError(XMLErrs::InvalidCharacter, tmpBuf); } } gotLeadingSurrogate = false; } // Keep the state machine up to date if (!escaped) { if (nextCh == chCloseSquare) { if (curState == State_Waiting) curState = State_GotOne; else if (curState == State_GotOne) curState = State_GotTwo; } else if (nextCh == chCloseAngle) { if (curState == State_GotTwo) emitError(XMLErrs::BadSequenceInCharData); curState = State_Waiting; } else { curState = State_Waiting; } } else { curState = State_Waiting; } // Add this char to the buffer toUse.append(nextCh); if (secondCh) { toUse.append(secondCh); secondCh=0; } } } catch(const EndOfEntityException& toCatch) { // Some entity ended, so we have to send any accumulated // chars and send an end of entity event. sendCharData(toUse); gotLeadingSurrogate = false; if (fDocHandler) fDocHandler->endEntityReference(toCatch.getEntity()); } } // Send any char data that we accumulated into the buffer sendCharData(toUse); } InputSource* WFXMLScanner::resolveSystemId(const XMLCh* const /*sysId*/ ,const XMLCh* const /*pubId*/) { return 0; } // This method will scan a general/character entity ref. It will either // expand a char ref and return it directly, or push a reader for a general // entity. // // The return value indicates whether the char parameters hold the value // or whether the value was pushed as a reader, or that it failed. // // The escaped flag tells the caller whether the returned parameter resulted // from a character reference, which escapes the character in some cases. It // only makes any difference if the return value indicates the value was // returned directly. XMLScanner::EntityExpRes WFXMLScanner::scanEntityRef(const bool , XMLCh& firstCh , XMLCh& secondCh , bool& escaped) { // Assume no escape secondCh = 0; escaped = false; // We have to insure that its all in one entity const XMLSize_t curReader = fReaderMgr.getCurrentReaderNum(); // If the next char is a pound, then its a character reference and we // need to expand it always. if (fReaderMgr.skippedChar(chPound)) { // Its a character reference, so scan it and get back the numeric // value it represents. if (!scanCharRef(firstCh, secondCh)) return EntityExp_Failed; escaped = true; if (curReader != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialMarkupInEntity); return EntityExp_Returned; } // Expand it since its a normal entity ref XMLBufBid bbName(&fBufMgr); if (!fReaderMgr.getName(bbName.getBuffer())) { emitError(XMLErrs::ExpectedEntityRefName); return EntityExp_Failed; } // Next char must be a semi-colon. But if its not, just emit // an error and try to continue. if (!fReaderMgr.skippedChar(chSemiColon)) emitError(XMLErrs::UnterminatedEntityRef, bbName.getRawBuffer()); // Make sure we ended up on the same entity reader as the & char if (curReader != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialMarkupInEntity); // Look up the name in the general entity pool // If it does not exist, then obviously an error if (!fEntityTable->containsKey(bbName.getRawBuffer())) { // XML 1.0 Section 4.1 // Well-formedness Constraint for entity not found: // In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, // or a document with "standalone='yes'", for an entity reference that does not occur within the external subset // or a parameter entity if (fStandalone || fHasNoDTD) emitError(XMLErrs::EntityNotFound, bbName.getRawBuffer()); return EntityExp_Failed; } // here's where we need to check if there's a SecurityManager, // how many entity references we've had if(fSecurityManager != 0 && ++fEntityExpansionCount > fEntityExpansionLimit) { XMLCh expLimStr[32]; XMLString::sizeToText(fEntityExpansionLimit, expLimStr, 31, 10, fMemoryManager); emitError ( XMLErrs::EntityExpansionLimitExceeded , expLimStr ); // there seems nothing better to be done than to reset the entity expansion counter fEntityExpansionCount = 0; } firstCh = fEntityTable->get(bbName.getRawBuffer()); escaped = true; return EntityExp_Returned; } // --------------------------------------------------------------------------- // WFXMLScanner: Grammar preparsing // --------------------------------------------------------------------------- Grammar* WFXMLScanner::loadGrammar(const InputSource& , const short , const bool) { // REVISIT: emit a warning or throw an exception return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/XSObjectFactory.hpp000644 000765 000024 00000014571 13241160334 023631 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSObjectFactory.hpp 678409 2008-07-21 13:08:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSOBJECTFACTORY_HPP) #define XERCESC_INCLUDE_GUARD_XSOBJECTFACTORY_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class XSObject; class XSAttributeUse; class XSAttributeDeclaration; class XSModel; class XSElementDeclaration; class XSSimpleTypeDefinition; class XSComplexTypeDefinition; class XSModelGroupDefinition; class XSAttributeGroupDefinition; class XSWildcard; class XSParticle; class XSAnnotation; class XSNamespaceItem; class XSNotationDeclaration; class SchemaAttDef; class SchemaElementDecl; class DatatypeValidator; class ContentSpecNode; class ComplexTypeInfo; class XercesGroupInfo; class XercesAttGroupInfo; class XSIDCDefinition; class IdentityConstraint; class XMLNotationDecl; /** * Factory class to create various XSObject(s) * Used by XSModel */ class XMLPARSER_EXPORT XSObjectFactory : public XMemory { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- XSObjectFactory(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~XSObjectFactory(); private: // ----------------------------------------------------------------------- // Unimplemented constructors and destructor // ----------------------------------------------------------------------- XSObjectFactory(const XSObjectFactory&); XSObjectFactory& operator=(const XSObjectFactory&); // ----------------------------------------------------------------------- // factory methods // ----------------------------------------------------------------------- XSParticle* createModelGroupParticle ( const ContentSpecNode* const node , XSModel* const xsModel ); XSAttributeDeclaration* addOrFind ( SchemaAttDef* const attDef , XSModel* const xsModel , XSComplexTypeDefinition* const enclosingTypeDef = 0 ); XSSimpleTypeDefinition* addOrFind ( DatatypeValidator* const validator , XSModel* const xsModel , bool isAnySimpleType = false ); XSElementDeclaration* addOrFind ( SchemaElementDecl* const elemDecl , XSModel* const xsModel , XSComplexTypeDefinition* const enclosingTypeDef = 0 ); XSComplexTypeDefinition* addOrFind ( ComplexTypeInfo* const typeInfo , XSModel* const xsModel ); XSIDCDefinition* addOrFind ( IdentityConstraint* const ic , XSModel* const xsModel ); XSNotationDeclaration* addOrFind ( XMLNotationDecl* const notDecl , XSModel* const xsModel ); XSAttributeUse* createXSAttributeUse ( XSAttributeDeclaration* const xsAttDecl , XSModel* const xsModel ); XSWildcard* createXSWildcard ( SchemaAttDef* const attDef , XSModel* const xsModel ); XSWildcard* createXSWildcard ( const ContentSpecNode* const rootNode , XSModel* const xsModel ); XSModelGroupDefinition* createXSModelGroupDefinition ( XercesGroupInfo* const groupInfo , XSModel* const xsModel ); XSAttributeGroupDefinition* createXSAttGroupDefinition ( XercesAttGroupInfo* const attGroupInfo , XSModel* const xsModel ); // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- // creates a particle corresponding to an element XSParticle* createElementParticle ( const ContentSpecNode* const rootNode , XSModel* const xsModel ); // creates a particle corresponding to a wildcard XSParticle* createWildcardParticle ( const ContentSpecNode* const rootNode , XSModel* const xsModel ); XSAnnotation* getAnnotationFromModel ( XSModel* const xsModel , const void* const key ); void buildAllParticles ( const ContentSpecNode* const rootNode , XSParticleList* const particleList , XSModel* const xsModel ); void buildChoiceSequenceParticles ( const ContentSpecNode* const rootNode , XSParticleList* const particleList , XSModel* const xsModel ); void putObjectInMap ( void* key , XSObject* const object ); XSObject* getObjectFromMap ( void* key ); void processFacets ( DatatypeValidator* const dv , XSModel* const xsModel , XSSimpleTypeDefinition* const xsST ); void processAttUse ( SchemaAttDef* const attDef , XSAttributeUse* const xsAttUse ); bool isMultiValueFacetDefined(DatatypeValidator* const dv); // make XSModel our friend friend class XSModel; // ----------------------------------------------------------------------- // Private Data Members // // fMemoryManager // The memory manager used to create various XSObject(s). // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; RefHashTableOf* fXercesToXSMap; RefVectorOf* fDeleteVector; }; inline XSObject* XSObjectFactory::getObjectFromMap(void* key) { return fXercesToXSMap->get(key); } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/MemoryManagerImpl.hpp000644 000765 000024 00000005247 13241160334 024205 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: MemoryManagerImpl.hpp 673975 2008-07-04 09:23:56Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_MEMORYMANAGERIMPL_HPP) #define XERCESC_INCLUDE_GUARD_MEMORYMANAGERIMPL_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Configurable memory manager * *

This is Xerces default implementation of the memory * manager interface, which will be instantiated and used * in the absence of an application's memory manager. *

*/ class XMLUTIL_EXPORT MemoryManagerImpl : public MemoryManager { public: /** @name Constructor */ //@{ /** * Default constructor */ MemoryManagerImpl() { } //@} /** @name Destructor */ //@{ /** * Default destructor */ virtual ~MemoryManagerImpl() { } //@} /** * This method is called to obtain the memory manager that should be * used to allocate memory used in exceptions. * * @return A pointer to the memory manager */ virtual MemoryManager* getExceptionMemoryManager(); /** @name The virtual methods in MemoryManager */ //@{ /** * This method allocates requested memory. * * @param size The requested memory size * * @return A pointer to the allocated memory */ virtual void* allocate(XMLSize_t size); /** * This method deallocates memory * * @param p The pointer to the allocated memory to be deleted */ virtual void deallocate(void* p); //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- MemoryManagerImpl(const MemoryManagerImpl&); MemoryManagerImpl& operator=(const MemoryManagerImpl&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/XSerializeEngine.cpp000644 000765 000024 00000071606 13241160334 024022 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSerializeEngine.cpp 1798775 2017-06-14 21:35:37Z rleigh $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN const bool XSerializeEngine::toWriteBufferLen = true; const bool XSerializeEngine::toReadBufferLen = true; static const unsigned long noDataFollowed = (unsigned long)-1; static const XSerializeEngine::XSerializedObjectId_t fgNullObjectTag = 0; // indicating null ptrs static const XSerializeEngine::XSerializedObjectId_t fgNewClassTag = 0xFFFFFFFF; // indicating new class static const XSerializeEngine::XSerializedObjectId_t fgTemplateObjTag = 0xFFFFFFFE; // indicating template object static const XSerializeEngine::XSerializedObjectId_t fgClassMask = 0x80000000; // indicates class tag static const XSerializeEngine::XSerializedObjectId_t fgMaxObjectCount = 0x3FFFFFFD; #define TEST_THROW_ARG1(condition, data, err_msg) \ if (condition) \ { \ XMLCh value1[64]; \ XMLString::sizeToText(data, value1, 65, 10, getMemoryManager()); \ ThrowXMLwithMemMgr1(XSerializationException \ , err_msg \ , value1 \ , getMemoryManager()); \ } #define TEST_THROW_ARG2(condition, data1, data2, err_msg) \ if (condition) \ { \ XMLCh value1[64]; \ XMLCh value2[64]; \ XMLString::sizeToText(data1, value1, 65, 10, getMemoryManager()); \ XMLString::sizeToText(data2, value2, 65, 10, getMemoryManager()); \ ThrowXMLwithMemMgr2(XSerializationException \ , err_msg \ , value1 \ , value2 \ , getMemoryManager()); \ } // --------------------------------------------------------------------------- // Constructor and Destructor // --------------------------------------------------------------------------- XSerializeEngine::~XSerializeEngine() { if (isStoring()) { flush(); delete fStorePool; } else { delete fLoadPool; } getMemoryManager()->deallocate(fBufStart); } XSerializeEngine::XSerializeEngine(BinInputStream* inStream , XMLGrammarPool* const gramPool , XMLSize_t bufSize) :fStoreLoad(mode_Load) ,fStorerLevel(0) ,fGrammarPool(gramPool) ,fInputStream(inStream) ,fOutputStream(0) ,fBufCount(0) ,fBufSize(bufSize) ,fBufStart( (XMLByte*) gramPool->getMemoryManager()->allocate(bufSize)) ,fBufEnd(0) ,fBufCur(fBufStart) ,fBufLoadMax(fBufStart) ,fStorePool(0) ,fLoadPool( new (gramPool->getMemoryManager()) ValueVectorOf(29, gramPool->getMemoryManager(), false)) ,fObjectCount(0) { /*** * initialize buffer from the inStream ***/ fillBuffer(); } XSerializeEngine::XSerializeEngine(BinOutputStream* outStream , XMLGrammarPool* const gramPool , XMLSize_t bufSize) :fStoreLoad(mode_Store) ,fStorerLevel(0) ,fGrammarPool(gramPool) ,fInputStream(0) ,fOutputStream(outStream) ,fBufCount(0) ,fBufSize(bufSize) ,fBufStart((XMLByte*) gramPool->getMemoryManager()->allocate(bufSize)) ,fBufEnd(fBufStart+bufSize) ,fBufCur(fBufStart) ,fBufLoadMax(0) ,fStorePool( new (gramPool->getMemoryManager()) RefHashTableOf(29, true, gramPool->getMemoryManager()) ) ,fLoadPool(0) ,fObjectCount(0) { resetBuffer(); //initialize store pool fStorePool->put(0, new (gramPool->getMemoryManager()) XSerializedObjectId(fgNullObjectTag)); } void XSerializeEngine::flush() { if (isStoring()) flushBuffer(); } // --------------------------------------------------------------------------- // Storing // --------------------------------------------------------------------------- void XSerializeEngine::write(XSerializable* const objectToWrite) { ensureStoring(); //don't ensurePointer here !!! XSerializedObjectId_t objIndex = 0; if (!objectToWrite) // null pointer { *this << fgNullObjectTag; } else if (0 != (objIndex = lookupStorePool((void*) objectToWrite))) { // writing an object reference tag *this << objIndex; } else { // write protoType first XProtoType* protoType = objectToWrite->getProtoType(); write(protoType); // put the object into StorePool addStorePool((void*)objectToWrite); // ask the object to serialize itself objectToWrite->serialize(*this); } } void XSerializeEngine::write(XProtoType* const protoType) { ensureStoring(); ensurePointer(protoType); XSerializedObjectId_t objIndex = lookupStorePool((void*)protoType); if (objIndex) { //protoType seen in the store pool *this << (fgClassMask | objIndex); } else { // store protoType *this << fgNewClassTag; protoType->store(*this); addStorePool((void*)protoType); } } /*** * ***/ void XSerializeEngine::write(const XMLCh* const toWrite , XMLSize_t writeLen) { write((XMLByte*)toWrite, (sizeof(XMLCh)/sizeof(XMLByte)) * writeLen); } void XSerializeEngine::write(const XMLByte* const toWrite , XMLSize_t writeLen) { ensureStoring(); ensurePointer((void*)toWrite); ensureStoreBuffer(); if (writeLen == 0) return; /*** * If the available space is sufficient, write it up ***/ XMLSize_t bufAvail = fBufEnd - fBufCur; if (writeLen <= bufAvail) { memcpy(fBufCur, toWrite, writeLen); fBufCur += writeLen; return; } const XMLByte* tempWrite = (const XMLByte*) toWrite; XMLSize_t writeRemain = writeLen; // fill up the avaiable space and flush memcpy(fBufCur, tempWrite, bufAvail); tempWrite += bufAvail; writeRemain -= bufAvail; flushBuffer(); // write chunks of fBufSize while (writeRemain >= fBufSize) { memcpy(fBufCur, tempWrite, fBufSize); tempWrite += fBufSize; writeRemain -= fBufSize; flushBuffer(); } // write the remaining if any if (writeRemain) { memcpy(fBufCur, tempWrite, writeRemain); fBufCur += writeRemain; } } /*** * * Storage scheme (normal): * * < * 1st integer: bufferLen (optional) * 2nd integer: dataLen * bytes following: * > * * Storage scheme (special): * < * only integer: noDataFollowed * > */ void XSerializeEngine::writeString(const XMLCh* const toWrite , const XMLSize_t bufferLen , bool toWriteBufLen) { if (toWrite) { if (toWriteBufLen) *this<<(unsigned long)bufferLen; XMLSize_t strLen = XMLString::stringLen(toWrite); *this<<(unsigned long)strLen; write(toWrite, strLen); } else { *this<fCreateObject(getMemoryManager()); Assert((objRet != 0), XMLExcepts::XSer_CreateObject_Fail); // put it into load pool addLoadPool(objRet); // de-serialize it objRet->serialize(*this); } return objRet; } bool XSerializeEngine::read(XProtoType* const protoType , XSerializedObjectId_t* objectTagRet) { ensureLoading(); ensurePointer(protoType); XSerializedObjectId_t obTag; *this >> obTag; // object reference tag found if (!(obTag & fgClassMask)) { *objectTagRet = obTag; return false; } if (obTag == fgNewClassTag) { // what follows fgNewClassTag is the prototype object info // for the object anticipated, go and verify the info XProtoType::load(*this, protoType->fClassName, getMemoryManager()); addLoadPool((void*)protoType); } else { // what follows class tag is an XSerializable object XSerializedObjectId_t classIndex = (obTag & ~fgClassMask); XSerializedObjectId_t loadPoolSize = (XSerializedObjectId_t)fLoadPool->size(); if ((classIndex == 0 ) || (classIndex > loadPoolSize)) { XMLCh value1[64]; XMLCh value2[64]; XMLString::binToText(classIndex, value1, 65, 10, getMemoryManager()); XMLString::binToText(loadPoolSize, value2, 65, 10, getMemoryManager()); ThrowXMLwithMemMgr2(XSerializationException , XMLExcepts::XSer_Inv_ClassIndex , value1 , value2 , getMemoryManager()); } ensurePointer(lookupLoadPool(classIndex)); } return true; } void XSerializeEngine::read(XMLCh* const toRead , XMLSize_t readLen) { read((XMLByte*)toRead, (sizeof(XMLCh)/sizeof(XMLByte))*readLen); } void XSerializeEngine::read(XMLByte* const toRead , XMLSize_t readLen) { ensureLoading(); ensurePointer(toRead); ensureLoadBuffer(); if (readLen == 0) return; /*** * If unread is sufficient, read it up ***/ XMLSize_t dataAvail = fBufLoadMax - fBufCur; if (readLen <= dataAvail) { memcpy(toRead, fBufCur, readLen); fBufCur += readLen; return; } /*** * * fillBuffer will discard anything left in the buffer * before it asks the inputStream to fill in the buffer, * so we need to readup everything in the buffer before * calling fillBuffer * ***/ XMLByte* tempRead = (XMLByte*) toRead; XMLSize_t readRemain = readLen; // read the unread memcpy(tempRead, fBufCur, dataAvail); tempRead += dataAvail; readRemain -= dataAvail; // read chunks of fBufSize while (readRemain >= fBufSize) { fillBuffer(); memcpy(tempRead, fBufCur, fBufSize); tempRead += fBufSize; readRemain -= fBufSize; } // read the remaining if any if (readRemain) { fillBuffer(); memcpy(tempRead, fBufCur, readRemain); fBufCur += readRemain; } } /*** * * Storage scheme (normal): * * < * 1st integer: bufferLen (optional) * 2nd integer: dataLen * bytes following: * > * * Storage scheme (special): * < * only integer: noDataFollowed * > */ void XSerializeEngine::readString(XMLCh*& toRead , XMLSize_t& bufferLen , XMLSize_t& dataLen , bool toReadBufLen) { /*** * Check if any data written ***/ unsigned long tmp; *this>>tmp; bufferLen=tmp; if (bufferLen == noDataFollowed) { toRead = 0; bufferLen = 0; dataLen = 0; return; } if (toReadBufLen) { *this>>tmp; dataLen=tmp; } else { dataLen = bufferLen++; } toRead = (XMLCh*) getMemoryManager()->allocate(bufferLen * sizeof(XMLCh)); read(toRead, dataLen); toRead[dataLen] = 0; } void XSerializeEngine::readString(XMLByte*& toRead , XMLSize_t& bufferLen , XMLSize_t& dataLen , bool toReadBufLen) { /*** * Check if any data written ***/ unsigned long tmp; *this>>tmp; bufferLen=tmp; if (bufferLen == noDataFollowed) { toRead = 0; bufferLen = 0; dataLen = 0; return; } if (toReadBufLen) { *this>>tmp; dataLen=tmp; } else { dataLen = bufferLen++; } toRead = (XMLByte*) getMemoryManager()->allocate(bufferLen * sizeof(XMLByte)); read(toRead, dataLen); toRead[dataLen] = 0; } // --------------------------------------------------------------------------- // Insertion & Extraction // --------------------------------------------------------------------------- XSerializeEngine& XSerializeEngine::operator<<(XMLCh xch) { checkAndFlushBuffer(calBytesNeeded(sizeof(XMLCh))); alignBufCur(sizeof(XMLCh)); *reinterpret_cast(fBufCur) = xch; fBufCur += sizeof(XMLCh); return *this; } XSerializeEngine& XSerializeEngine::operator>>(XMLCh& xch) { checkAndFillBuffer(calBytesNeeded(sizeof(XMLCh))); alignBufCur(sizeof(XMLCh)); xch = *reinterpret_cast(fBufCur); fBufCur += sizeof(XMLCh); return *this; } XSerializeEngine& XSerializeEngine::operator<<(XMLByte by) { checkAndFlushBuffer(sizeof(XMLByte)); *(XMLByte*)fBufCur = by; fBufCur += sizeof(XMLByte); return *this; } XSerializeEngine& XSerializeEngine::operator>>(XMLByte& by) { checkAndFillBuffer(sizeof(XMLByte)); by = *(XMLByte*)fBufCur; fBufCur += sizeof(XMLByte); return *this; } XSerializeEngine& XSerializeEngine::operator<<(bool b) { checkAndFlushBuffer(sizeof(bool)); *(bool*)fBufCur = b; fBufCur += sizeof(bool); return *this; } XSerializeEngine& XSerializeEngine::operator>>(bool& b) { checkAndFillBuffer(sizeof(bool)); b = *(bool*)fBufCur; fBufCur += sizeof(bool); return *this; } void XSerializeEngine::writeSize (XMLSize_t t) { checkAndFlushBuffer(sizeof(t)); memcpy(fBufCur, &t, sizeof(t)); fBufCur += sizeof(t); } void XSerializeEngine::writeInt64 (XMLInt64 t) { checkAndFlushBuffer(sizeof(t)); memcpy(fBufCur, &t, sizeof(t)); fBufCur += sizeof(t); } void XSerializeEngine::writeUInt64 (XMLUInt64 t) { checkAndFlushBuffer(sizeof(t)); memcpy(fBufCur, &t, sizeof(t)); fBufCur += sizeof(t); } void XSerializeEngine::readSize (XMLSize_t& t) { checkAndFillBuffer(sizeof(t)); memcpy(&t, fBufCur, sizeof(t)); fBufCur += sizeof(t); } void XSerializeEngine::readInt64 (XMLInt64& t) { checkAndFillBuffer(sizeof(t)); memcpy(&t, fBufCur, sizeof(t)); fBufCur += sizeof(t); } void XSerializeEngine::readUInt64 (XMLUInt64& t) { checkAndFillBuffer(sizeof(t)); memcpy(&t, fBufCur, sizeof(t)); fBufCur += sizeof(t); } XSerializeEngine& XSerializeEngine::operator<<(char ch) { return XSerializeEngine::operator<<((XMLByte)ch); } XSerializeEngine& XSerializeEngine::operator>>(char& ch) { return XSerializeEngine::operator>>((XMLByte&)ch); } XSerializeEngine& XSerializeEngine::operator<<(short sh) { checkAndFlushBuffer(calBytesNeeded(sizeof(short))); alignBufCur(sizeof(short)); *reinterpret_cast(fBufCur) = sh; fBufCur += sizeof(short); return *this; } XSerializeEngine& XSerializeEngine::operator>>(short& sh) { checkAndFillBuffer(calBytesNeeded(sizeof(short))); alignBufCur(sizeof(short)); sh = *reinterpret_cast(fBufCur); fBufCur += sizeof(short); return *this; } XSerializeEngine& XSerializeEngine::operator<<(int i) { checkAndFlushBuffer(calBytesNeeded(sizeof(int))); alignBufCur(sizeof(int)); *reinterpret_cast(fBufCur) = i; fBufCur += sizeof(int); return *this; } XSerializeEngine& XSerializeEngine::operator>>(int& i) { checkAndFillBuffer(calBytesNeeded(sizeof(int))); alignBufCur(sizeof(int)); i = *reinterpret_cast(fBufCur); fBufCur += sizeof(int); return *this; } XSerializeEngine& XSerializeEngine::operator<<(unsigned int ui) { checkAndFlushBuffer(calBytesNeeded(sizeof(unsigned int))); alignBufCur(sizeof(unsigned int)); *reinterpret_cast(fBufCur) = ui; fBufCur += sizeof(unsigned int); return *this; } XSerializeEngine& XSerializeEngine::operator>>(unsigned int& ui) { checkAndFillBuffer(calBytesNeeded(sizeof(unsigned int))); alignBufCur(sizeof(unsigned int)); ui = *reinterpret_cast(fBufCur); fBufCur += sizeof(unsigned int); return *this; } XSerializeEngine& XSerializeEngine::operator<<(long l) { checkAndFlushBuffer(calBytesNeeded(sizeof(long))); alignBufCur(sizeof(long)); *reinterpret_cast(fBufCur) = l; fBufCur += sizeof(long); return *this; } XSerializeEngine& XSerializeEngine::operator>>(long& l) { checkAndFillBuffer(calBytesNeeded(sizeof(long))); alignBufCur(sizeof(long)); l = *reinterpret_cast(fBufCur); fBufCur += sizeof(long); return *this; } XSerializeEngine& XSerializeEngine::operator<<(unsigned long ul) { checkAndFlushBuffer(calBytesNeeded(sizeof(unsigned long))); alignBufCur(sizeof(unsigned long)); *reinterpret_cast(fBufCur) = ul; fBufCur += sizeof(unsigned long); return *this; } XSerializeEngine& XSerializeEngine::operator>>(unsigned long& ul) { checkAndFillBuffer(calBytesNeeded(sizeof(unsigned long))); alignBufCur(sizeof(unsigned long)); ul = *reinterpret_cast(fBufCur); fBufCur += sizeof(unsigned long); return *this; } XSerializeEngine& XSerializeEngine::operator<<(float f) { checkAndFlushBuffer(calBytesNeeded(sizeof(float))); alignBufCur(sizeof(float)); *reinterpret_cast(fBufCur) = *reinterpret_cast(&f); fBufCur += sizeof(float); return *this; } XSerializeEngine& XSerializeEngine::operator>>(float& f) { checkAndFillBuffer(calBytesNeeded(sizeof(float))); alignBufCur(sizeof(float)); *reinterpret_cast(&f) = *reinterpret_cast(fBufCur); fBufCur += sizeof(float); return *this; } XSerializeEngine& XSerializeEngine::operator<<(double d) { checkAndFlushBuffer(calBytesNeeded(sizeof(double))); alignBufCur(sizeof(double)); *reinterpret_cast(fBufCur) = *reinterpret_cast(&d); fBufCur += sizeof(double); return *this; } XSerializeEngine& XSerializeEngine::operator>>(double& d) { checkAndFillBuffer(calBytesNeeded(sizeof(double))); alignBufCur(sizeof(double)); *reinterpret_cast(&d) = *reinterpret_cast(fBufCur); fBufCur += sizeof(double); return *this; } // --------------------------------------------------------------------------- // StorePool/LoadPool Opertions // --------------------------------------------------------------------------- XSerializeEngine::XSerializedObjectId_t XSerializeEngine::lookupStorePool(void* const objToLookup) const { //0 indicating object is not in the StorePool XSerializedObjectId* data = fStorePool->get(objToLookup); return (XSerializeEngine::XSerializedObjectId_t) (data ? data->getValue() : 0); } void XSerializeEngine::addStorePool(void* const objToAdd) { pumpCount(); fStorePool->put(objToAdd, new (fGrammarPool->getMemoryManager()) XSerializedObjectId(fObjectCount)); } XSerializable* XSerializeEngine::lookupLoadPool(XSerializedObjectId_t objectTag) const { /*** * an object tag read from the binary refering to * an object beyond the upper most boundary of the load pool ***/ if (objectTag > fLoadPool->size()) { XMLCh value1[64]; XMLCh value2[64]; XMLString::binToText(objectTag, value1, 65, 10, getMemoryManager()); XMLString::sizeToText(fLoadPool->size(), value2, 65, 10, getMemoryManager()); ThrowXMLwithMemMgr2(XSerializationException , XMLExcepts::XSer_LoadPool_UppBnd_Exceed , value1 , value2 , getMemoryManager()); } if (objectTag == 0) return 0; /*** * A non-null object tag starts from 1 while fLoadPool starts from 0 ***/ return (XSerializable*) fLoadPool->elementAt(objectTag - 1); } void XSerializeEngine::addLoadPool(void* const objToAdd) { TEST_THROW_ARG2( (fLoadPool->size() != fObjectCount) , fObjectCount , fLoadPool->size() , XMLExcepts::XSer_LoadPool_NoTally_ObjCnt ) pumpCount(); fLoadPool->addElement(objToAdd); } void XSerializeEngine::pumpCount() { if (fObjectCount >= fgMaxObjectCount) { XMLCh value1[64]; XMLCh value2[64]; XMLString::sizeToText(fObjectCount, value1, 65, 10, getMemoryManager()); XMLString::binToText(fgMaxObjectCount, value2, 65, 10, getMemoryManager()); ThrowXMLwithMemMgr2(XSerializationException , XMLExcepts::XSer_ObjCount_UppBnd_Exceed , value1 , value2 , getMemoryManager()); } fObjectCount++; } // --------------------------------------------------------------------------- // Buffer Opertions // --------------------------------------------------------------------------- /*** * * Though client may need only miniBytesNeeded, we always request * a full size reading from our inputStream. * * Whatever possibly left in the buffer is abandoned, such as in * the case of CheckAndFillBuffer() * ***/ void XSerializeEngine::fillBuffer() { ensureLoading(); ensureLoadBuffer(); resetBuffer(); XMLSize_t bytesRead = fInputStream->readBytes(fBufStart, fBufSize); /*** * InputStream MUST fill in the exact amount of bytes as requested * to do: combine the checking and create a new exception code later ***/ TEST_THROW_ARG2( (bytesRead < fBufSize) , bytesRead , fBufSize , XMLExcepts::XSer_InStream_Read_LT_Req ) TEST_THROW_ARG2( (bytesRead > fBufSize) , bytesRead , fBufSize , XMLExcepts::XSer_InStream_Read_OverFlow ) fBufLoadMax = fBufStart + fBufSize; fBufCur = fBufStart; ensureLoadBuffer(); fBufCount++; } /*** * * Flush out whatever left in the buffer, from * fBufStart to fBufEnd. * ***/ void XSerializeEngine::flushBuffer() { ensureStoring(); ensureStoreBuffer(); fOutputStream->writeBytes(fBufStart, fBufSize); fBufCur = fBufStart; resetBuffer(); ensureStoreBuffer(); fBufCount++; } inline void XSerializeEngine::checkAndFlushBuffer(XMLSize_t bytesNeedToWrite) { TEST_THROW_ARG1( (bytesNeedToWrite <= 0) , bytesNeedToWrite , XMLExcepts::XSer_Inv_checkFlushBuffer_Size ) // fBufStart ... fBufCur ...fBufEnd if ((fBufCur + bytesNeedToWrite) > fBufEnd) flushBuffer(); } inline void XSerializeEngine::checkAndFillBuffer(XMLSize_t bytesNeedToRead) { TEST_THROW_ARG1( (bytesNeedToRead <= 0) , bytesNeedToRead , XMLExcepts::XSer_Inv_checkFillBuffer_Size ) // fBufStart ... fBufCur ...fBufLoadMax if ((fBufCur + bytesNeedToRead) > fBufLoadMax) { fillBuffer(); } } inline void XSerializeEngine::ensureStoreBuffer() const { XMLSize_t a = (XMLSize_t) (fBufCur - fBufStart); XMLSize_t b = (XMLSize_t) (fBufEnd - fBufCur); TEST_THROW_ARG2 ( !((fBufStart <= fBufCur) && (fBufCur <= fBufEnd)) , a , b , XMLExcepts::XSer_StoreBuffer_Violation ) } inline void XSerializeEngine::ensureLoadBuffer() const { XMLSize_t a = (XMLSize_t) (fBufCur - fBufStart); XMLSize_t b = (XMLSize_t) (fBufLoadMax - fBufCur); TEST_THROW_ARG2 ( !((fBufStart <= fBufCur) && (fBufCur <= fBufLoadMax)) , a , b , XMLExcepts::XSer_LoadBuffer_Violation ) } inline void XSerializeEngine::ensurePointer(void* const ptr) const { TEST_THROW_ARG1( (ptr == 0) , 0 , XMLExcepts::XSer_Inv_Null_Pointer ) } inline void XSerializeEngine::resetBuffer() { memset(fBufStart, 0, fBufSize * sizeof(XMLByte)); } // --------------------------------------------------------------------------- // Template object // --------------------------------------------------------------------------- /*** * * Search the store pool to see if the address has been seen before or not. * * If yes, write the corresponding object Tag to the internal buffer * and return true. * * Otherwise, add the address to the store pool and return false * to notifiy the client application code to store the template object. * ***/ bool XSerializeEngine::needToStoreObject(void* const templateObjectToWrite) { ensureStoring(); //don't ensurePointer here !!! XSerializedObjectId_t objIndex = 0; if (!templateObjectToWrite) { *this << fgNullObjectTag; // null pointer return false; } else if (0 != (objIndex = lookupStorePool(templateObjectToWrite))) { *this << objIndex; // write an object reference tag return false; } else { *this << fgTemplateObjTag; // write fgTemplateObjTag to denote that actual // template object follows addStorePool(templateObjectToWrite); // put the address into StorePool return true; } } bool XSerializeEngine::needToLoadObject(void** templateObjectToRead) { ensureLoading(); XSerializedObjectId_t obTag; *this >> obTag; if (obTag == fgTemplateObjTag) { /*** * what follows fgTemplateObjTag is the actual template object * We need the client application to create a template object * and register it through registerObject(), and deserialize * template object ***/ return true; } else { /*** * We hava a reference to an existing template object, get it. */ *templateObjectToRead = lookupLoadPool(obTag); return false; } } void XSerializeEngine::registerObject(void* const templateObjectToRegister) { ensureLoading(); addLoadPool(templateObjectToRegister); } XMLGrammarPool* XSerializeEngine::getGrammarPool() const { return fGrammarPool; } XMLStringPool* XSerializeEngine::getStringPool() const { return fGrammarPool->getURIStringPool(); } MemoryManager* XSerializeEngine::getMemoryManager() const { //todo: changed to return fGrammarPool->getMemoryManager() return fGrammarPool ? fGrammarPool->getMemoryManager() : XMLPlatformUtils::fgMemoryManager; } // // Based on the current position (fBufCur), calculated the needed size // to read/write // inline XMLSize_t XSerializeEngine::alignAdjust(XMLSize_t size) const { XMLSize_t remainder = (XMLSize_t) fBufCur % size; return (remainder == 0) ? 0 : (size - remainder); } // Adjust the fBufCur inline void XSerializeEngine::alignBufCur(XMLSize_t size) { fBufCur+=alignAdjust(size); assert(((XMLSize_t) fBufCur % size)==0); } inline XMLSize_t XSerializeEngine::calBytesNeeded(XMLSize_t size) const { return (alignAdjust(size) + size); } void XSerializeEngine::trace(char* /*funcName*/) const { return; /* if (isStoring()) printf("\n funcName=<%s>, storing, count=<%lu>, postion=<%lu>\n", funcName, fBufCount, getBufCurAccumulated()); else printf("\n funcName=<%s>, loading, count=<%lu>, postion=<%lu>\n", funcName, fBufCount, getBufCurAccumulated()); */ } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/ValidationContextImpl.cpp000644 000765 000024 00000013347 13241160334 025074 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ValidationContextImpl.cpp 903149 2010-01-26 09:58:40Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructor and Destructor // --------------------------------------------------------------------------- ValidationContextImpl::~ValidationContextImpl() { if (fIdRefList) delete fIdRefList; } ValidationContextImpl::ValidationContextImpl(MemoryManager* const manager) :ValidationContext(manager) ,fIdRefList(0) ,fEntityDeclPool(0) ,fToCheckIdRefList(true) ,fValidatingMemberType(0) ,fElemStack(0) ,fScanner(0) ,fNamespaceScope(0) { fIdRefList = new (fMemoryManager) RefHashTableOf(109, fMemoryManager); } /** * IdRefList * */ RefHashTableOf* ValidationContextImpl::getIdRefList() const { return fIdRefList; } void ValidationContextImpl::setIdRefList(RefHashTableOf* const newIdRefList) { if (fIdRefList) delete fIdRefList; fIdRefList = newIdRefList; } void ValidationContextImpl::clearIdRefList() { if (fIdRefList) fIdRefList->removeAll(); } void ValidationContextImpl::addId(const XMLCh * const content) { if (!fIdRefList || !fToCheckIdRefList) return; XMLRefInfo* idEntry = fIdRefList->get(content); if (idEntry) { if (idEntry->getDeclared()) { ThrowXMLwithMemMgr1(InvalidDatatypeValueException , XMLExcepts::VALUE_ID_Not_Unique , content , fMemoryManager); } } else { idEntry = new (fMemoryManager) XMLRefInfo(content, false, false, fMemoryManager); fIdRefList->put((void*)idEntry->getRefName(), idEntry); } // // Mark it declared // idEntry->setDeclared(true); } void ValidationContextImpl::addIdRef(const XMLCh * const content) { if (!fIdRefList || !fToCheckIdRefList) return; XMLRefInfo* idEntry = fIdRefList->get(content); if (!idEntry) { idEntry = new (fMemoryManager) XMLRefInfo(content, false, false, fMemoryManager); fIdRefList->put((void*)idEntry->getRefName(), idEntry); } // // Mark it used // idEntry->setUsed(true); } void ValidationContextImpl::toCheckIdRefList(bool toCheck) { fToCheckIdRefList = toCheck; } /** * EntityDeclPool * */ const NameIdPool* ValidationContextImpl::getEntityDeclPool() const { return fEntityDeclPool; } const NameIdPool* ValidationContextImpl::setEntityDeclPool(const NameIdPool* const newEntityDeclPool) { // we don't own it so we return the existing one for the owner to delete const NameIdPool* tempPool = fEntityDeclPool; fEntityDeclPool = newEntityDeclPool; return tempPool; } void ValidationContextImpl::checkEntity(const XMLCh * const content) const { if (fEntityDeclPool) { const DTDEntityDecl* decl = fEntityDeclPool->getByKey(content); if (!decl || !decl->isUnparsed()) { ThrowXMLwithMemMgr1(InvalidDatatypeValueException , XMLExcepts::VALUE_ENTITY_Invalid , content , fMemoryManager); } } else { ThrowXMLwithMemMgr1 ( InvalidDatatypeValueException , XMLExcepts::VALUE_ENTITY_Invalid , content , fMemoryManager ); } } /* QName */ bool ValidationContextImpl::isPrefixUnknown(XMLCh* prefix) { bool unknown = false; if (XMLString::equals(prefix, XMLUni::fgXMLNSString)) { return true; } else if (!XMLString::equals(prefix, XMLUni::fgXMLString)) { if(fElemStack && !fElemStack->isEmpty()) fElemStack->mapPrefixToURI(prefix, unknown); else if(fNamespaceScope) unknown = (fNamespaceScope->getNamespaceForPrefix(prefix)==fNamespaceScope->getEmptyNamespaceId()); } return unknown; } const XMLCh* ValidationContextImpl::getURIForPrefix(XMLCh* prefix) { bool unknown = false; unsigned int uriId = 0; if(fElemStack) uriId = fElemStack->mapPrefixToURI(prefix, unknown); else if(fNamespaceScope) { uriId = fNamespaceScope->getNamespaceForPrefix(prefix); unknown = uriId == fNamespaceScope->getEmptyNamespaceId(); } if (!unknown) return fScanner->getURIText(uriId); return XMLUni::fgZeroLenString; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/VecAttributesImpl.hpp000644 000765 000024 00000011152 13241160334 024216 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: VecAttributesImpl.hpp 672311 2008-06-27 16:05:01Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_VECATTRIBUTESIMPL_HPP) #define XERCESC_INCLUDE_GUARD_VECATTRIBUTESIMPL_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLPARSER_EXPORT VecAttributesImpl : public Attributes { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- VecAttributesImpl(); ~VecAttributesImpl(); // ----------------------------------------------------------------------- // Implementation of the attributes interface // ----------------------------------------------------------------------- virtual XMLSize_t getLength() const ; virtual const XMLCh* getURI(const XMLSize_t index) const; virtual const XMLCh* getLocalName(const XMLSize_t index) const ; virtual const XMLCh* getQName(const XMLSize_t index) const ; virtual const XMLCh* getType(const XMLSize_t index) const ; virtual const XMLCh* getValue(const XMLSize_t index) const ; virtual bool getIndex(const XMLCh* const uri, const XMLCh* const localPart, XMLSize_t& index) const; virtual int getIndex(const XMLCh* const uri, const XMLCh* const localPart ) const ; virtual bool getIndex(const XMLCh* const qName, XMLSize_t& index) const; virtual int getIndex(const XMLCh* const qName ) const ; virtual const XMLCh* getType(const XMLCh* const uri, const XMLCh* const localPart ) const ; virtual const XMLCh* getType(const XMLCh* const qName) const ; virtual const XMLCh* getValue(const XMLCh* const qName) const; virtual const XMLCh* getValue(const XMLCh* const uri, const XMLCh* const localPart ) const ; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setVector ( const RefVectorOf* const srcVec , const XMLSize_t count , const XMLScanner * const scanner , const bool adopt = false ); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- VecAttributesImpl(const VecAttributesImpl&); VecAttributesImpl& operator=(const VecAttributesImpl&); // ----------------------------------------------------------------------- // Private data members // // fAdopt // Indicates whether the passed vector is to be adopted or not. If // so, we destroy it when we are destroyed (and when a new vector is // set!) // // fCount // The count of elements in the vector that should be considered // valid. This is an optimization to allow vector elements to be // reused over and over but a different count of them be valid for // each use. // // fVector // The vector that provides the backing for the list. // // fScanner // This is a pointer to the in use Scanner, so that we can resolve // namespace URIs from UriIds // // fURIBuffer // A temporary buffer which is re-used when getting namespace URI's // ----------------------------------------------------------------------- bool fAdopt; XMLSize_t fCount; const RefVectorOf* fVector; const XMLScanner * fScanner ; }; XERCES_CPP_NAMESPACE_END #endif // ! VECATTRIBUTESIMPL_HPP xerces-c-3.2.2/src/xercesc/internal/XMLInternalErrorHandler.hpp000644 000765 000024 00000010346 13241160334 025261 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLInternalErrorHandler.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLINTERNALERRORHANDLER_HPP) #define XERCESC_INCLUDE_GUARD_XMLINTERNALERRORHANDLER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLInternalErrorHandler : public ErrorHandler { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- XMLInternalErrorHandler(ErrorHandler* userHandler = 0) : fSawWarning(false), fSawError(false), fSawFatal(false), fUserErrorHandler(userHandler) { } ~XMLInternalErrorHandler() { } // ----------------------------------------------------------------------- // Implementation of the error handler interface // ----------------------------------------------------------------------- void warning(const SAXParseException& toCatch); void error(const SAXParseException& toCatch); void fatalError(const SAXParseException& toCatch); void resetErrors(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- bool getSawWarning() const; bool getSawError() const; bool getSawFatal() const; // ----------------------------------------------------------------------- // Private data members // // fSawWarning // This is set if we get any warning, and is queryable via a getter // method. // // fSawError // This is set if we get any errors, and is queryable via a getter // method. // // fSawFatal // This is set if we get any fatal, and is queryable via a getter // method. // // fUserErrorHandler // This is the error handler from user // ----------------------------------------------------------------------- bool fSawWarning; bool fSawError; bool fSawFatal; ErrorHandler* fUserErrorHandler; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLInternalErrorHandler(const XMLInternalErrorHandler&); XMLInternalErrorHandler& operator=(const XMLInternalErrorHandler&); }; inline bool XMLInternalErrorHandler::getSawWarning() const { return fSawWarning; } inline bool XMLInternalErrorHandler::getSawError() const { return fSawError; } inline bool XMLInternalErrorHandler::getSawFatal() const { return fSawFatal; } inline void XMLInternalErrorHandler::warning(const SAXParseException& toCatch) { fSawWarning = true; if (fUserErrorHandler) fUserErrorHandler->warning(toCatch); } inline void XMLInternalErrorHandler::error(const SAXParseException& toCatch) { fSawError = true; if (fUserErrorHandler) fUserErrorHandler->error(toCatch); } inline void XMLInternalErrorHandler::fatalError(const SAXParseException& toCatch) { fSawFatal = true; if (fUserErrorHandler) fUserErrorHandler->fatalError(toCatch); } inline void XMLInternalErrorHandler::resetErrors() { fSawWarning = false; fSawError = false; fSawFatal = false; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/BinMemOutputStream.cpp000644 000765 000024 00000006352 13241160334 024355 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BinMemOutputStream.cpp 932889 2010-04-11 13:10:10Z borisk $ */ #include #include #include XERCES_CPP_NAMESPACE_BEGIN BinMemOutputStream::BinMemOutputStream( XMLSize_t initCapacity , MemoryManager* const manager) : fMemoryManager(manager) , fDataBuf(0) , fIndex(0) , fCapacity(initCapacity) { // Buffer is one larger than capacity, to allow for zero term fDataBuf = (XMLByte*) fMemoryManager->allocate ( (fCapacity + 4) * sizeof(XMLByte) ); // Keep it null terminated fDataBuf[0] = XMLByte(0); } BinMemOutputStream::~BinMemOutputStream() { fMemoryManager->deallocate(fDataBuf); } void BinMemOutputStream::writeBytes( const XMLByte* const toGo , const XMLSize_t maxToWrite) { if (maxToWrite) { ensureCapacity(maxToWrite); memcpy(&fDataBuf[fIndex], toGo, maxToWrite * sizeof(XMLByte)); fIndex += maxToWrite; } } const XMLByte* BinMemOutputStream::getRawBuffer() const { fDataBuf[fIndex] = 0; fDataBuf[fIndex + 1] = 0; fDataBuf[fIndex + 2] = 0; fDataBuf[fIndex + 3] = 0; return fDataBuf; } void BinMemOutputStream::reset() { fIndex = 0; for (int i = 0; i < 4; i++) { fDataBuf[fIndex + i] = 0; } } XMLFilePos BinMemOutputStream::curPos() const { return fIndex; } XMLFilePos BinMemOutputStream::getSize() const { return fCapacity; } // --------------------------------------------------------------------------- // BinMemOutputStream: Private helper methods // --------------------------------------------------------------------------- void BinMemOutputStream::ensureCapacity(const XMLSize_t extraNeeded) { // If we can handle it, do nothing yet if (fIndex + extraNeeded < fCapacity) return; // Oops, not enough room. Calc new capacity and allocate new buffer const XMLSize_t newCap = ((fIndex + extraNeeded) * 2); XMLByte* newBuf = (XMLByte*) fMemoryManager->allocate ( (newCap+4) * sizeof(XMLByte) ); memset(newBuf, 0, (newCap+4) * sizeof(XMLByte)); // Copy over the old stuff memcpy(newBuf, fDataBuf, fCapacity * sizeof(XMLByte) + 4); // Clean up old buffer and store new stuff fMemoryManager->deallocate(fDataBuf); fDataBuf = newBuf; fCapacity = newCap; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/VecAttrListImpl.hpp000644 000765 000024 00000007160 13241160334 023642 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: VecAttrListImpl.hpp 672273 2008-06-27 13:57:00Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_VECATTRLISTIMPL_HPP) #define XERCESC_INCLUDE_GUARD_VECATTRLISTIMPL_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLPARSER_EXPORT VecAttrListImpl : public XMemory, public AttributeList { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- VecAttrListImpl(); ~VecAttrListImpl(); // ----------------------------------------------------------------------- // Implementation of the attribute list interface // ----------------------------------------------------------------------- virtual XMLSize_t getLength() const; virtual const XMLCh* getName(const XMLSize_t index) const; virtual const XMLCh* getType(const XMLSize_t index) const; virtual const XMLCh* getValue(const XMLSize_t index) const; virtual const XMLCh* getType(const XMLCh* const name) const; virtual const XMLCh* getValue(const XMLCh* const name) const; virtual const XMLCh* getValue(const char* const name) const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setVector ( const RefVectorOf* const srcVec , const XMLSize_t count , const bool adopt = false ); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- VecAttrListImpl(const VecAttrListImpl&); VecAttrListImpl& operator=(const VecAttrListImpl&); // ----------------------------------------------------------------------- // Private data members // // fAdopt // Indicates whether the passed vector is to be adopted or not. If // so, we destroy it when we are destroyed (and when a new vector is // set!) // // fCount // The count of elements in the vector that should be considered // valid. This is an optimization to allow vector elements to be // reused over and over but a different count of them be valid for // each use. // // fVector // The vector that provides the backing for the list. // ----------------------------------------------------------------------- bool fAdopt; XMLSize_t fCount; const RefVectorOf* fVector; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/XMLReader.hpp000644 000765 000024 00000064445 13241160334 022410 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLReader.hpp 833045 2009-11-05 13:21:27Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLREADER_HPP) #define XERCESC_INCLUDE_GUARD_XMLREADER_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class InputSource; class BinInputStream; class ReaderMgr; class XMLScanner; class XMLTranscoder; // --------------------------------------------------------------------------- // Instances of this class are used to manage the content of entities. The // scanner maintains a stack of these, one for each entity (this means entity // in the sense of any parsed file or internal entity) currently being // scanned. This class, given a binary input stream will handle reading in // the data and decoding it from its external decoding into the internal // Unicode format. Once internallized, this class provides the access // methods to read in the data in various ways, maintains line and column // information, and provides high performance character attribute checking // methods. // // This is NOT to be derived from. // // --------------------------------------------------------------------------- class XMLPARSER_EXPORT XMLReader : public XMemory { public: // ----------------------------------------------------------------------- // Public types // ----------------------------------------------------------------------- enum Types { Type_PE , Type_General }; enum Sources { Source_Internal , Source_External }; enum RefFrom { RefFrom_Literal , RefFrom_NonLiteral }; enum XMLVersion { XMLV1_0 , XMLV1_1 , XMLV_Unknown }; // ----------------------------------------------------------------------- // Public, query methods // ----------------------------------------------------------------------- bool isAllSpaces ( const XMLCh* const toCheck , const XMLSize_t count ) const; bool containsWhiteSpace ( const XMLCh* const toCheck , const XMLSize_t count ) const; bool isXMLLetter(const XMLCh toCheck) const; bool isFirstNameChar(const XMLCh toCheck) const; bool isNameChar(const XMLCh toCheck) const; bool isPlainContentChar(const XMLCh toCheck) const; bool isSpecialStartTagChar(const XMLCh toCheck) const; bool isXMLChar(const XMLCh toCheck) const; bool isWhitespace(const XMLCh toCheck) const; bool isControlChar(const XMLCh toCheck) const; bool isPublicIdChar(const XMLCh toCheck) const; bool isFirstNCNameChar(const XMLCh toCheck) const; bool isNCNameChar(const XMLCh toCheck) const; // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- XMLReader ( const XMLCh* const pubId , const XMLCh* const sysId , BinInputStream* const streamToAdopt , const RefFrom from , const Types type , const Sources source , const bool throwAtEnd = false , const bool calculateSrcOfs = true , XMLSize_t lowWaterMark = 100 , const XMLVersion xmlVersion = XMLV1_0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); XMLReader ( const XMLCh* const pubId , const XMLCh* const sysId , BinInputStream* const streamToAdopt , const XMLCh* const encodingStr , const RefFrom from , const Types type , const Sources source , const bool throwAtEnd = false , const bool calculateSrcOfs = true , XMLSize_t lowWaterMark = 100 , const XMLVersion xmlVersion = XMLV1_0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); XMLReader ( const XMLCh* const pubId , const XMLCh* const sysId , BinInputStream* const streamToAdopt , XMLRecognizer::Encodings encodingEnum , const RefFrom from , const Types type , const Sources source , const bool throwAtEnd = false , const bool calculateSrcOfs = true , XMLSize_t lowWaterMark = 100 , const XMLVersion xmlVersion = XMLV1_0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~XMLReader(); // ----------------------------------------------------------------------- // Character buffer management methods // ----------------------------------------------------------------------- XMLSize_t charsLeftInBuffer() const; bool refreshCharBuffer(); // ----------------------------------------------------------------------- // Scanning methods // ----------------------------------------------------------------------- bool getName(XMLBuffer& toFill, const bool token); bool getQName(XMLBuffer& toFill, int* colonPosition); bool getNCName(XMLBuffer& toFill); bool getNextChar(XMLCh& chGotten); bool getNextCharIfNot(const XMLCh chNotToGet, XMLCh& chGotten); void movePlainContentChars(XMLBuffer &dest); bool getSpaces(XMLBuffer& toFill); bool getUpToCharOrWS(XMLBuffer& toFill, const XMLCh toCheck); bool peekNextChar(XMLCh& chGotten); bool skipIfQuote(XMLCh& chGotten); bool skipSpaces(bool& skippedSomething, bool inDecl = false); bool skippedChar(const XMLCh toSkip); bool skippedSpace(); bool skippedString(const XMLCh* const toSkip); bool skippedStringLong(const XMLCh* toSkip); bool peekString(const XMLCh* const toPeek); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- XMLFileLoc getColumnNumber() const; const XMLCh* getEncodingStr() const; XMLFileLoc getLineNumber() const; bool getNoMoreFlag() const; const XMLCh* getPublicId() const; XMLSize_t getReaderNum() const; RefFrom getRefFrom() const; Sources getSource() const; XMLFilePos getSrcOffset() const; const XMLCh* getSystemId() const; bool getThrowAtEnd() const; Types getType() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- bool setEncoding ( const XMLCh* const newEncoding ); void setReaderNum(const XMLSize_t newNum); void setThrowAtEnd(const bool newValue); void setXMLVersion(const XMLVersion version); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLReader(const XMLReader&); XMLReader& operator=(const XMLReader&); // --------------------------------------------------------------------------- // Class Constants // // kCharBufSize // The size of the character spool buffer that we use. Its not terribly // large because its just getting filled with data from a raw byte // buffer as we go along. We don't want to decode all the text at // once before we find out that there is an error. // // NOTE: This is a size in characters, not bytes. // // kRawBufSize // The size of the raw buffer from which raw bytes are spooled out // as we transcode chunks of data. As it is emptied, it is filled back // in again from the source stream. // --------------------------------------------------------------------------- enum Constants { kCharBufSize = 16 * 1024 , kRawBufSize = 48 * 1024 }; // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void checkForSwapped(); void doInitCharSizeChecks(); void doInitDecode(); XMLByte getNextRawByte ( const bool eoiOk ); void refreshRawBuffer(); void setTranscoder ( const XMLCh* const newEncoding ); XMLSize_t xcodeMoreChars ( XMLCh* const bufToFill , unsigned char* const charSizes , const XMLSize_t maxChars ); void handleEOL ( XMLCh& curCh , bool inDecl = false ); // ----------------------------------------------------------------------- // Data members // // fCharIndex // The index into the character buffer. When this hits fCharsAvail // then its time to refill. // // fCharBuf // A buffer that the reader manager fills up with transcoded // characters a small amount at a time. // // fCharsAvail // The characters currently available in the character buffer. // // fCharSizeBuf // This buffer is an array that contains the number of source chars // eaten to create each char in the fCharBuf buffer. So the entry // fCharSizeBuf[x] is the number of source chars that were eaten // to make the internalized char fCharBuf[x]. This only contains // useful data if fSrcOfsSupported is true. // // fCharOfsBuf // This buffer is an array that contains the offset in the // fRawByteBuf buffer of each char in the fCharBuf buffer. It // only contains useful data if fSrcOfsSupported is true. // // fCurCol // fCurLine // The current line and column that we are in within this reader's // text. // // fEncoding // This is the rough encoding setting. This enum is set during // construction and just tells us the rough family of encoding that // we are doing. // // fEncodingStr // This is the name of the encoding we are using. It will be // provisionally set during construction, from the auto-sensed // encoding. But it might be overridden when the XMLDecl is finally // seen by the scanner. It can also be forced to a particular // encoding, in which case fForcedEncoding is set. // // fForcedEncoding // If the encoding if forced then this is set and all other // information will be ignored. This encoding will be taken as // gospel. This is done by calling an alternate constructor. // // fNoMore // This is set when the source text is exhausted. It lets us know // quickly that no more text is available. // // fRawBufIndex // The current index into the raw byte buffer. When its equal to // fRawBytesAvail then we need to read another buffer. // // fRawByteBuf // This is the raw byte buffer that is used to spool out bytes // from into the fCharBuf buffer, as we transcode in blocks. // // fRawBytesAvail // The number of bytes currently available in the raw buffer. This // helps deal with the last buffer's worth, which will usually not // be a full one. // // fLowWaterMark // The low water mark for the raw byte buffer. // // // fReaderNum // Each reader from a particular reader manager (which means from a // particular document) is given a unique number. The reader manager // sets these numbers. They are used to catch things like partial // markup errors. // // fRefFrom // This flag is provided in the ctor, and tells us if we represent // some entity being expanded inside a literal. Sometimes things // happen differently inside and outside literals. // // fPublicId // fSystemId // These are the system and public ids of the source that this // reader is reading. // // fSentTrailingSpace // If we are a PE entity being read and we not referenced from a // literal, then a leading and trailing space must be faked into the // data. This lets us know we've done the trailing space already (so // we don't just keep doing it again and again.) // // fSource // Indicates whether the content this reader is spooling as already // been internalized. This will prevent multiple processing of // whitespace when an already internalized entity is being spooled // out. // // fSpareChar // Some encodings can create two chars in an atomic way, e.g. // surrogate pairs. We might not be able to store both, so we store // it here until the next buffer transcoding operation. // // fSrcOfsBase // This is the base offset within the source of this entity. Values // in the curent fCharSizeBuf array are relative to this value. // // fSrcOfsSupported // This flag is set to indicate whether source byte offset info // is supported. For intrinsic encodings, its always set since we // can always support it. For transcoder based encodings, we ask // the transcoder if it supports it or not. // // fStream // This is the input stream that provides the data for the reader. // Its always treated as a raw byte stream. The derived class will // ask for buffers of text from it and will handle making some // sense of it. // // fSwapped // If the encoding is one of the ones we do intrinsically, and its // in a different byte order from our native order, then this is // set to remind us to byte swap it during transcoding. // // fThrowAtEnd // Indicates whether the reader manager should throw an end of entity // exception at the end of this reader instance. This is usually // set for top level external entity references. It overrides the // reader manager's global flag that controls throwing at the end // of entities. Defaults to false. // // fTranscoder // If the encoding is not one that we handle intrinsically, then // we use an an external transcoder to do it. This class is an // abstraction that allows us to use pluggable external transcoding // services (via XMLTransService in util.) // // fType // Indicates whether this reader represents a PE or not. If this // flag is true and the fInLiteral flag is false, then we will put // out an extra space at the end. // // fgCharCharsTable; // Pointer to XMLChar table, depends on XML version // // fNEL // Boolean indicates if NEL and LSEP should be recognized as NEL // // fXMLVersion // Enum to indicate if this Reader is conforming to XML 1.0 or XML 1.1 // ----------------------------------------------------------------------- XMLSize_t fCharIndex; XMLCh fCharBuf[kCharBufSize]; XMLSize_t fCharsAvail; unsigned char fCharSizeBuf[kCharBufSize]; unsigned int fCharOfsBuf[kCharBufSize]; XMLFileLoc fCurCol; XMLFileLoc fCurLine; XMLRecognizer::Encodings fEncoding; XMLCh* fEncodingStr; bool fForcedEncoding; bool fNoMore; XMLCh* fPublicId; XMLSize_t fRawBufIndex; XMLByte fRawByteBuf[kRawBufSize]; XMLSize_t fRawBytesAvail; XMLSize_t fLowWaterMark; XMLSize_t fReaderNum; RefFrom fRefFrom; bool fSentTrailingSpace; Sources fSource; XMLFilePos fSrcOfsBase; bool fSrcOfsSupported; bool fCalculateSrcOfs; XMLCh* fSystemId; BinInputStream* fStream; bool fSwapped; bool fThrowAtEnd; XMLTranscoder* fTranscoder; Types fType; XMLByte* fgCharCharsTable; bool fNEL; XMLVersion fXMLVersion; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // XMLReader: Public, query methods // --------------------------------------------------------------------------- inline bool XMLReader::isNameChar(const XMLCh toCheck) const { return ((fgCharCharsTable[toCheck] & gNameCharMask) != 0); } inline bool XMLReader::isNCNameChar(const XMLCh toCheck) const { return ((fgCharCharsTable[toCheck] & gNCNameCharMask) != 0); } inline bool XMLReader::isPlainContentChar(const XMLCh toCheck) const { return ((fgCharCharsTable[toCheck] & gPlainContentCharMask) != 0); } inline bool XMLReader::isFirstNameChar(const XMLCh toCheck) const { return ((fgCharCharsTable[toCheck] & gFirstNameCharMask) != 0); } inline bool XMLReader::isFirstNCNameChar(const XMLCh toCheck) const { return (((fgCharCharsTable[toCheck] & gFirstNameCharMask) != 0) && (toCheck != chColon)); } inline bool XMLReader::isSpecialStartTagChar(const XMLCh toCheck) const { return ((fgCharCharsTable[toCheck] & gSpecialStartTagCharMask) != 0); } inline bool XMLReader::isXMLChar(const XMLCh toCheck) const { return ((fgCharCharsTable[toCheck] & gXMLCharMask) != 0); } inline bool XMLReader::isXMLLetter(const XMLCh toCheck) const { return (((fgCharCharsTable[toCheck] & gFirstNameCharMask) != 0) && (toCheck != chColon) && (toCheck != chUnderscore)); } inline bool XMLReader::isWhitespace(const XMLCh toCheck) const { return ((fgCharCharsTable[toCheck] & gWhitespaceCharMask) != 0); } inline bool XMLReader::isControlChar(const XMLCh toCheck) const { return ((fgCharCharsTable[toCheck] & gControlCharMask) != 0); } // --------------------------------------------------------------------------- // XMLReader: Buffer management methods // --------------------------------------------------------------------------- inline XMLSize_t XMLReader::charsLeftInBuffer() const { return fCharsAvail - fCharIndex; } // --------------------------------------------------------------------------- // XMLReader: Getter methods // --------------------------------------------------------------------------- inline XMLFileLoc XMLReader::getColumnNumber() const { return fCurCol; } inline const XMLCh* XMLReader::getEncodingStr() const { return fEncodingStr; } inline XMLFileLoc XMLReader::getLineNumber() const { return fCurLine; } inline bool XMLReader::getNoMoreFlag() const { return fNoMore; } inline const XMLCh* XMLReader::getPublicId() const { return fPublicId; } inline XMLSize_t XMLReader::getReaderNum() const { return fReaderNum; } inline XMLReader::RefFrom XMLReader::getRefFrom() const { return fRefFrom; } inline XMLReader::Sources XMLReader::getSource() const { return fSource; } inline const XMLCh* XMLReader::getSystemId() const { return fSystemId; } inline bool XMLReader::getThrowAtEnd() const { return fThrowAtEnd; } inline XMLReader::Types XMLReader::getType() const { return fType; } // --------------------------------------------------------------------------- // XMLReader: Setter methods // --------------------------------------------------------------------------- inline void XMLReader::setReaderNum(const XMLSize_t newNum) { fReaderNum = newNum; } inline void XMLReader::setThrowAtEnd(const bool newValue) { fThrowAtEnd = newValue; } inline void XMLReader::setXMLVersion(const XMLVersion version) { fXMLVersion = version; if (version == XMLV1_1) { fNEL = true; fgCharCharsTable = XMLChar1_1::fgCharCharsTable1_1; } else { fNEL = XMLChar1_0::enableNEL; fgCharCharsTable = XMLChar1_0::fgCharCharsTable1_0; } } // --------------------------------------------------------------------------- // // XMLReader: movePlainContentChars() // // Move as many plain (no special handling of any sort required) content // characters as possible from this reader to the supplied destination buffer. // // This is THE hottest performance spot in the parser. // // --------------------------------------------------------------------------- inline void XMLReader::movePlainContentChars(XMLBuffer &dest) { const XMLSize_t chunkSize = fCharsAvail - fCharIndex; const XMLCh* cursor = &fCharBuf[fCharIndex]; XMLSize_t count=0; for(;count= fCharsAvail) { // If fNoMore is set, then we have nothing else to give if (fNoMore) return false; // Try to refresh if (!refreshCharBuffer()) return false; } // Check the next char if (fCharBuf[fCharIndex] == chNotToGet) return false; // Its not the one we want to skip so bump the index chGotten = fCharBuf[fCharIndex++]; // Handle end of line normalization and line/col member maintenance. // // we can have end-of-line combinations with a leading // chCR(xD), chLF(xA), chNEL(x85), or chLineSeparator(x2028) // // 0000000000001101 chCR // 0000000000001010 chLF // 0000000010000101 chNEL // 0010000000101000 chLineSeparator // ----------------------- // 1101111101010000 == ~(chCR|chLF|chNEL|chLineSeparator) // // if the result of the logical-& operation is // true : 'curCh' can not be chCR, chLF, chNEL or chLineSeparator // false : 'curCh' can be chCR, chLF, chNEL or chLineSeparator // if ( chGotten & (XMLCh) ~(chCR|chLF|chNEL|chLineSeparator) ) { fCurCol++; } else { handleEOL(chGotten, false); } return true; } // --------------------------------------------------------------------------- // XMLReader: getNextChar() method inlined for speed // --------------------------------------------------------------------------- inline bool XMLReader::getNextChar(XMLCh& chGotten) { // // See if there is at least a char in the buffer. Else, do the buffer // reload logic. // if (fCharIndex >= fCharsAvail) { // If fNoMore is set, then we have nothing else to give if (fNoMore) return false; // Try to refresh if (!refreshCharBuffer()) return false; } chGotten = fCharBuf[fCharIndex++]; // Handle end of line normalization and line/col member maintenance. // // we can have end-of-line combinations with a leading // chCR(xD), chLF(xA), chNEL(x85), or chLineSeparator(x2028) // // 0000000000001101 chCR // 0000000000001010 chLF // 0000000010000101 chNEL // 0010000000101000 chLineSeparator // ----------------------- // 1101111101010000 == ~(chCR|chLF|chNEL|chLineSeparator) // // if the result of the logical-& operation is // true : 'curCh' can not be chCR, chLF, chNEL or chLineSeparator // false : 'curCh' can be chCR, chLF, chNEL or chLineSeparator // if ( chGotten & (XMLCh) ~(chCR|chLF|chNEL|chLineSeparator) ) { fCurCol++; } else { handleEOL(chGotten, false); } return true; } // --------------------------------------------------------------------------- // XMLReader: peekNextChar() method inlined for speed // --------------------------------------------------------------------------- inline bool XMLReader::peekNextChar(XMLCh& chGotten) { // // If there is something still in the buffer, get it. Else do the reload // scenario. // if (fCharIndex >= fCharsAvail) { // Try to refresh the buffer if (!refreshCharBuffer()) { chGotten = chNull; return false; } } chGotten = fCharBuf[fCharIndex]; // // Even though we are only peeking, we have to act the same as the // normal char get method in regards to newline normalization, though // its not as complicated as the actual character getting method's. // if ((chGotten == chCR || (fNEL && (chGotten == chNEL || chGotten == chLineSeparator))) && (fSource == Source_External)) chGotten = chLF; return true; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/CharTypeTables.hpp000644 000765 000024 00000021445 13241160334 023470 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: CharTypeTables.hpp 1517488 2013-08-26 10:33:26Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_CHARTYPETABLES_HPP) #define XERCESC_INCLUDE_GUARD_CHARTYPETABLES_HPP #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // These are character type lookup tables. They are included into XMLReader // but are in their own private header in order to keep from making that // file unreadable. // // THE RANGES and SINGLES MUST BE IN NUMERICAL ORDER, because the lookup // method will use this info to short circuit the search! // --------------------------------------------------------------------------- static const XMLCh gBaseChars[] = { // Ranges 0x0041, 0x005A, 0x0061, 0x007A, 0x00C0, 0x00D6, 0x00D8, 0x00F6 , 0x00F8, 0x00FF , 0x0100, 0x0131, 0x0134, 0x013E, 0x0141, 0x0148, 0x014A, 0x017E , 0x0180, 0x01C3, 0x01CD, 0x01F0, 0x01F4, 0x01F5, 0x01FA, 0x0217 , 0x0250, 0x02A8, 0x02BB, 0x02C1, 0x0388, 0x038A, 0x038E, 0x03A1 , 0x03A3, 0x03CE, 0x03D0, 0x03D6, 0x03E2, 0x03F3, 0x0401, 0x040C , 0x040E, 0x044F, 0x0451, 0x045C, 0x045E, 0x0481, 0x0490, 0x04C4 , 0x04C7, 0x04C8, 0x04CB, 0x04CC, 0x04D0, 0x04EB, 0x04EE, 0x04F5 , 0x04F8, 0x04F9, 0x0531, 0x0556, 0x0561, 0x0586, 0x05D0, 0x05EA , 0x05F0, 0x05F2, 0x0621, 0x063A, 0x0641, 0x064A, 0x0671, 0x06B7 , 0x06BA, 0x06BE, 0x06C0, 0x06CE, 0x06D0, 0x06D3, 0x06E5, 0x06E6 , 0x0905, 0x0939, 0x0958, 0x0961, 0x0985, 0x098C, 0x098F, 0x0990 , 0x0993, 0x09A8, 0x09AA, 0x09B0, 0x09B6, 0x09B9, 0x09DC, 0x09DD , 0x09DF, 0x09E1, 0x09F0, 0x09F1, 0x0A05, 0x0A0A, 0x0A0F, 0x0A10 , 0x0A13, 0x0A28, 0x0A2A, 0x0A30, 0x0A32, 0x0A33, 0x0A35, 0x0A36 , 0x0A38, 0x0A39, 0x0A59, 0x0A5C, 0x0A72, 0x0A74, 0x0A85, 0x0A8B , 0x0A8F, 0x0A91, 0x0A93, 0x0AA8, 0x0AAA, 0x0AB0, 0x0AB2, 0x0AB3 , 0x0AB5, 0x0AB9, 0x0B05, 0x0B0C, 0x0B0F, 0x0B10, 0x0B13, 0x0B28 , 0x0B2A, 0x0B30, 0x0B32, 0x0B33, 0x0B36, 0x0B39, 0x0B5C, 0x0B5D , 0x0B5F, 0x0B61, 0x0B85, 0x0B8A, 0x0B8E, 0x0B90, 0x0B92, 0x0B95 , 0x0B99, 0x0B9A, 0x0B9E, 0x0B9F, 0x0BA3, 0x0BA4, 0x0BA8, 0x0BAA , 0x0BAE, 0x0BB5, 0x0BB7, 0x0BB9, 0x0C05, 0x0C0C, 0x0C0E, 0x0C10 , 0x0C12, 0x0C28, 0x0C2A, 0x0C33, 0x0C35, 0x0C39, 0x0C60, 0x0C61 , 0x0C85, 0x0C8C, 0x0C8E, 0x0C90, 0x0C92, 0x0CA8, 0x0CAA, 0x0CB3 , 0x0CB5, 0x0CB9, 0x0CE0, 0x0CE1, 0x0D05, 0x0D0C, 0x0D0E, 0x0D10 , 0x0D12, 0x0D28, 0x0D2A, 0x0D39, 0x0D60, 0x0D61, 0x0E01, 0x0E2E , 0x0E32, 0x0E33, 0x0E40, 0x0E45, 0x0E81, 0x0E82, 0x0E87, 0x0E88 , 0x0E94, 0x0E97, 0x0E99, 0x0E9F, 0x0EA1, 0x0EA3, 0x0EAA, 0x0EAB , 0x0EAD, 0x0EAE, 0x0EB2, 0x0EB3, 0x0EC0, 0x0EC4, 0x0F40, 0x0F47 , 0x0F49, 0x0F69, 0x10A0, 0x10C5, 0x10D0, 0x10F6, 0x1102, 0x1103 , 0x1105, 0x1107, 0x110B, 0x110C, 0x110E, 0x1112, 0x1154, 0x1155 , 0x115F, 0x1161, 0x116D, 0x116E, 0x1172, 0x1173, 0x11AE, 0x11AF , 0x11B7, 0x11B8, 0x11BC, 0x11C2, 0x1E00, 0x1E9B, 0x1EA0, 0x1EF9 , 0x1F00, 0x1F15, 0x1F18, 0x1F1D, 0x1F20, 0x1F45, 0x1F48, 0x1F4D , 0x1F50, 0x1F57, 0x1F5F, 0x1F7D, 0x1F80, 0x1FB4, 0x1FB6, 0x1FBC , 0x1FC2, 0x1FC4, 0x1FC6, 0x1FCC, 0x1FD0, 0x1FD3, 0x1FD6, 0x1FDB , 0x1FE0, 0x1FEC, 0x1FF2, 0x1FF4, 0x1FF6, 0x1FFC, 0x212A, 0x212B , 0x2180, 0x2182, 0x3041, 0x3094, 0x30A1, 0x30FA, 0x3105, 0x312C , 0xAC00, 0xD7A3 , 0x00 // Singles , 0x0386, 0x038C, 0x03DA, 0x03DC, 0x03DE, 0x03E0, 0x0559, 0x06D5 , 0x093D, 0x09B2, 0x0A5E, 0x0A8D, 0x0ABD, 0x0AE0, 0x0B3D, 0x0B9C , 0x0CDE, 0x0E30, 0x0E84, 0x0E8A, 0x0E8D, 0x0EA5, 0x0EA7, 0x0EB0 , 0x0EBD, 0x1100, 0x1109, 0x113C, 0x113E, 0x1140, 0x114C, 0x114E , 0x1150, 0x1159, 0x1163, 0x1165, 0x1167, 0x1169, 0x1175, 0x119E , 0x11A8, 0x11AB, 0x11BA, 0x11EB, 0x11F0, 0x11F9, 0x1F59, 0x1F5B , 0x1F5D, 0x1FBE, 0x2126, 0x212E , 0x00 }; static const XMLCh gCombiningChars[] = { // Ranges 0x0300, 0x0345, 0x0360, 0x0361, 0x0483, 0x0486, 0x0591, 0x05A1 , 0x05A3, 0x05B9, 0x05BB, 0x05BD, 0x05C1, 0x05C2, 0x064B, 0x0652 , 0x06D6, 0x06DC, 0x06DD, 0x06DF, 0x06E0, 0x06E4 , 0x06E7, 0x06E8, 0x06EA, 0x06ED, 0x0901, 0x0903, 0x093E, 0x094C , 0x0951, 0x0954, 0x0962, 0x0963, 0x0981, 0x0983, 0x09C0, 0x09C4 , 0x09C7, 0x09C8, 0x09CB, 0x09CD, 0x09E2, 0x09E3, 0x0A40, 0x0A42 , 0x0A47, 0x0A48, 0x0A4B, 0x0A4D, 0x0A70, 0x0A71, 0x0A81, 0x0A83 , 0x0ABE, 0x0AC5, 0x0AC7, 0x0AC9, 0x0ACB, 0x0ACD, 0x0B01, 0x0B03 , 0x0B3E, 0x0B43, 0x0B47, 0x0B48, 0x0B4B, 0x0B4D, 0x0B56, 0x0B57 , 0x0B82, 0x0B83, 0x0BBE, 0x0BC2, 0x0BC6, 0x0BC8, 0x0BCA, 0x0BCD , 0x0C01, 0x0C03, 0x0C3E, 0x0C44, 0x0C46, 0x0C48, 0x0C4A, 0x0C4D , 0x0C55, 0x0C56, 0x0C82, 0x0C83, 0x0CBE, 0x0CC4, 0x0CC6, 0x0CC8 , 0x0CCA, 0x0CCD, 0x0CD5, 0x0CD6, 0x0D02, 0x0D03, 0x0D3E, 0x0D43 , 0x0D46, 0x0D48, 0x0D4A, 0x0D4D, 0x0E34, 0x0E3A, 0x0E47, 0x0E4E , 0x0EB4, 0x0EB9, 0x0EBB, 0x0EBC, 0x0EC8, 0x0ECD, 0x0F18, 0x0F19 , 0x0F71, 0x0F84, 0x0F86, 0x0F8B, 0x0F90, 0x0F95, 0x0F99, 0x0FAD , 0x0FB1, 0x0FB7, 0x20D0, 0x20DC, 0x302A, 0x302F , 0x00 // Singles , 0x05BF, 0x05C4, 0x0670 , 0x093C, 0x094D, 0x09BC, 0x09BE, 0x09BF, 0x09D7, 0x0A02 , 0x0A3C, 0x0A3E, 0x0A3F, 0x0ABC, 0x0B3C, 0x0BD7, 0x0D57, 0x0E31 , 0x0EB1, 0x0F35, 0x0F37, 0x0F39, 0x0F3E, 0x0F3F, 0x0F97, 0x0FB9 , 0x20E1, 0x3099, 0x309A , 0x00 }; static const XMLCh gDigitChars[] = { // Ranges 0x0030, 0x0039, 0x0660, 0x0669, 0x06F0, 0x06F9, 0x0966, 0x096F , 0x09E6, 0x09EF, 0x0A66, 0x0A6F, 0x0AE6, 0x0AEF, 0x0B66, 0x0B6F , 0x0BE7, 0x0BEF, 0x0C66, 0x0C6F, 0x0CE6, 0x0CEF, 0x0D66, 0x0D6F , 0x0E50, 0x0E59, 0x0ED0, 0x0ED9, 0x0F20, 0x0F29 , 0x00 // Singles , 0x00 }; static const XMLCh gIdeographicChars[] = { // Ranges 0x3021, 0x3029, 0x4E00, 0x9FA5 , 0x00 // Singles , 0x3007 , 0x00 }; static const XMLCh gExtenderChars[] = { // Ranges 0x3031, 0x3035, 0x309D, 0x309E, 0x30FC, 0x30FE , 0x00 // Singles , 0x00B7, 0x02D0, 0x02D1, 0x0387, 0x0640, 0x0E46, 0x0EC6, 0x3005 , 0x00 }; static const XMLCh gPublicIdChars[] = { // Ranges 0x0023, 0x0025, 0x0027, 0x003B, 0x003F, 0x005A, 0x0061, 0x007A , 0x00 // Singles , 0x000A, 0x000D, 0x0020, 0x0021, 0x003D, 0x005F , 0x00 }; static const XMLCh gWhitespaceChars[] = { // Ranges 0x00 , 0x0020, 0x0009, 0x000D, 0x000A , 0x00 }; static const XMLCh gXMLChars[] = { // Ranges 0x0020, 0xD7FF, 0xE000, 0xFFFD , 0x00 , 0x0009, 0x000D, 0x000A , 0x00 }; // The following are for XML 1.1 static const XMLCh gWhitespaceChars1_1[] = { // Ranges 0x00 , 0x0020, 0x0009, 0x000D, 0x000A, 0x0085, 0x2028 , 0x00 }; static const XMLCh gFirstNameChars[] = { // Ranges // Note: 0x10000 to 0xEFFFF are also allowed, need to separately check 0x0041, 0x005A, 0x0061, 0x007A, 0x00C0, 0x00D6, 0x00D8, 0x00F6 , 0x00F8, 0x02FF, 0x0370, 0x037D, 0x037F, 0x1FFF, 0x200C, 0x200D , 0x2070, 0x218F, 0x2C00, 0x2FEF, 0x3001, 0xD7FF, 0xF900, 0xFDCF , 0xFDF0, 0xFFFD , 0x00 // : _ , 0x003A, 0x005F , 0x00 }; static const XMLCh gNameChars[] = { // Ranges // Note: 0x10000 to 0xEFFFF are also allowed, need to separately check 0x0030, 0x0039, 0x0041, 0x005A, 0x0061, 0x007A, 0x00C0, 0x00D6 , 0x00D8, 0x00F6, 0x00F8, 0x037D, 0x037F, 0x1FFF, 0x200C, 0x200D , 0x203F, 0x2040, 0x2070, 0x218F, 0x2C00, 0x2FEF, 0x3001, 0xD7FF , 0xF900, 0xFDCF, 0xFDF0, 0xFFFD , 0x00 // - . : _ , 0x002D, 0x002E, 0x003A, 0x005F, 0x00B7 , 0x00 }; static const XMLCh gXMLChars1_1[] = { // Ranges 0x0020, 0x007E, 0x00A0, 0xD7FF, 0xE000, 0xFFFD , 0x00 , 0x0009, 0x000D, 0x000A, 0x0085 , 0x00 }; static const XMLCh gControl_Chars1_1[] = { // Ranges 0x0001, 0x001F, 0x007F, 0x009F , 0x00 , 0x00 }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/BinFileOutputStream.hpp000644 000765 000024 00000006605 13241160334 024524 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BinFileOutputStream.hpp 553915 2007-07-06 14:57:08Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_BINFILEOUTPUTSTREAM_HPP) #define XERCESC_INCLUDE_GUARD_BINFILEOUTPUTSTREAM_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT BinFileOutputStream : public BinOutputStream { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- ~BinFileOutputStream(); BinFileOutputStream ( const XMLCh* const fileName , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); BinFileOutputStream ( const char* const fileName , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- bool getIsOpen() const; XMLFilePos getSize() const; void reset(); // ----------------------------------------------------------------------- // Implementation of the input stream interface // ----------------------------------------------------------------------- virtual XMLFilePos curPos() const; virtual void writeBytes ( const XMLByte* const toGo , const XMLSize_t maxToWrite ); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- BinFileOutputStream(const BinFileOutputStream&); BinFileOutputStream& operator=(const BinFileOutputStream&); // ----------------------------------------------------------------------- // Private data members // // fSource // The source file that we represent. The FileHandle type is defined // per platform. // ----------------------------------------------------------------------- FileHandle fSource; MemoryManager* const fMemoryManager; }; // --------------------------------------------------------------------------- // BinFileOutputStream: Getter methods // --------------------------------------------------------------------------- inline bool BinFileOutputStream::getIsOpen() const { return (fSource != (FileHandle) XERCES_Invalid_File_Handle); } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/IANAEncodings.hpp000644 000765 000024 00000205670 13241160334 023164 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IANAEncodings.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_IANAENCODINGS_HPP) #define XERCESC_INCLUDE_GUARD_IANAENCODINGS_HPP #include XERCES_CPP_NAMESPACE_BEGIN // ---------------------------------------------------------------- // This file was generated from the IANA charset source. // so do not edit this file directly!! // ---------------------------------------------------------------- const XMLCh gEncodingArray[][46] = { { 0x0041,0x004E,0x0053,0x0049,0x005F,0x0058,0x0033,0x002E,0x0034,0x002D,0x0031,0x0039,0x0036,0x0038,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0036,0x00 } , { 0x0041,0x004E,0x0053,0x0049,0x005F,0x0058,0x0033,0x002E,0x0034,0x002D,0x0031,0x0039,0x0038,0x0036,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0036,0x0034,0x0036,0x002E,0x0069,0x0072,0x0076,0x003A,0x0031,0x0039,0x0039,0x0031,0x00 } , { 0x0041,0x0053,0x0043,0x0049,0x0049,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0055,0x0053,0x00 } , { 0x0055,0x0053,0x002D,0x0041,0x0053,0x0043,0x0049,0x0049,0x00 } , { 0x0075,0x0073,0x00 } , { 0x0049,0x0042,0x004D,0x0033,0x0036,0x0037,0x00 } , { 0x0063,0x0070,0x0033,0x0036,0x0037,0x00 } , { 0x0063,0x0073,0x0041,0x0053,0x0043,0x0049,0x0049,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0031,0x0030,0x0036,0x0034,0x0036,0x002D,0x0055,0x0054,0x0046,0x002D,0x0031,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0030,0x0036,0x0034,0x0036,0x0055,0x0054,0x0046,0x0031,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0036,0x0034,0x0036,0x002E,0x0062,0x0061,0x0073,0x0069,0x0063,0x003A,0x0031,0x0039,0x0038,0x0033,0x00 } , { 0x0072,0x0065,0x0066,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x0062,0x0061,0x0073,0x0069,0x0063,0x0031,0x0039,0x0038,0x0033,0x00 } , { 0x0049,0x004E,0x0056,0x0041,0x0052,0x0049,0x0041,0x004E,0x0054,0x00 } , { 0x0063,0x0073,0x0049,0x004E,0x0056,0x0041,0x0052,0x0049,0x0041,0x004E,0x0054,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0036,0x0034,0x0036,0x002E,0x0069,0x0072,0x0076,0x003A,0x0031,0x0039,0x0038,0x0033,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0032,0x00 } , { 0x0069,0x0072,0x0076,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0032,0x0049,0x006E,0x0074,0x006C,0x0052,0x0065,0x0066,0x0056,0x0065,0x0072,0x0073,0x0069,0x006F,0x006E,0x00 } , { 0x0042,0x0053,0x005F,0x0034,0x0037,0x0033,0x0030,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0034,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0047,0x0042,0x00 } , { 0x0067,0x0062,0x00 } , { 0x0075,0x006B,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0034,0x0055,0x006E,0x0069,0x0074,0x0065,0x0064,0x004B,0x0069,0x006E,0x0067,0x0064,0x006F,0x006D,0x00 } , { 0x004E,0x0041,0x0054,0x0053,0x002D,0x0053,0x0045,0x0046,0x0049,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0038,0x002D,0x0031,0x00 } , { 0x0063,0x0073,0x004E,0x0041,0x0054,0x0053,0x0053,0x0045,0x0046,0x0049,0x00 } , { 0x004E,0x0041,0x0054,0x0053,0x002D,0x0053,0x0045,0x0046,0x0049,0x002D,0x0041,0x0044,0x0044,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0038,0x002D,0x0032,0x00 } , { 0x0063,0x0073,0x004E,0x0041,0x0054,0x0053,0x0053,0x0045,0x0046,0x0049,0x0041,0x0044,0x0044,0x00 } , { 0x004E,0x0041,0x0054,0x0053,0x002D,0x0044,0x0041,0x004E,0x004F,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0039,0x002D,0x0031,0x00 } , { 0x0063,0x0073,0x004E,0x0041,0x0054,0x0053,0x0044,0x0041,0x004E,0x004F,0x00 } , { 0x004E,0x0041,0x0054,0x0053,0x002D,0x0044,0x0041,0x004E,0x004F,0x002D,0x0041,0x0044,0x0044,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0039,0x002D,0x0032,0x00 } , { 0x0063,0x0073,0x004E,0x0041,0x0054,0x0053,0x0044,0x0041,0x004E,0x004F,0x0041,0x0044,0x0044,0x00 } , { 0x0053,0x0045,0x004E,0x005F,0x0038,0x0035,0x0030,0x0032,0x0030,0x0030,0x005F,0x0042,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0030,0x00 } , { 0x0046,0x0049,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0046,0x0049,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0053,0x0045,0x00 } , { 0x0073,0x0065,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0030,0x0053,0x0077,0x0065,0x0064,0x0069,0x0073,0x0068,0x00 } , { 0x0053,0x0045,0x004E,0x005F,0x0038,0x0035,0x0030,0x0032,0x0030,0x0030,0x005F,0x0043,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0031,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0053,0x0045,0x0032,0x00 } , { 0x0073,0x0065,0x0032,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0031,0x0053,0x0077,0x0065,0x0064,0x0069,0x0073,0x0068,0x0046,0x006F,0x0072,0x004E,0x0061,0x006D,0x0065,0x0073,0x00 } , { 0x004B,0x0053,0x005F,0x0043,0x005F,0x0035,0x0036,0x0030,0x0031,0x002D,0x0031,0x0039,0x0038,0x0037,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0034,0x0039,0x00 } , { 0x004B,0x0053,0x005F,0x0043,0x005F,0x0035,0x0036,0x0030,0x0031,0x002D,0x0031,0x0039,0x0038,0x0039,0x00 } , { 0x004B,0x0053,0x0043,0x005F,0x0035,0x0036,0x0030,0x0031,0x00 } , { 0x006B,0x006F,0x0072,0x0065,0x0061,0x006E,0x00 } , { 0x0063,0x0073,0x004B,0x0053,0x0043,0x0035,0x0036,0x0030,0x0031,0x0031,0x0039,0x0038,0x0037,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0032,0x0030,0x0032,0x0032,0x002D,0x004B,0x0052,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0032,0x0030,0x0032,0x0032,0x004B,0x0052,0x00 } , { 0x0045,0x0055,0x0043,0x002D,0x004B,0x0052,0x00 } , { 0x0063,0x0073,0x0045,0x0055,0x0043,0x004B,0x0052,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0032,0x0030,0x0032,0x0032,0x002D,0x004A,0x0050,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0032,0x0030,0x0032,0x0032,0x004A,0x0050,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0032,0x0030,0x0032,0x0032,0x002D,0x004A,0x0050,0x002D,0x0032,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0032,0x0030,0x0032,0x0032,0x004A,0x0050,0x0032,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0032,0x0030,0x0032,0x0032,0x002D,0x0043,0x004E,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0032,0x0030,0x0032,0x0032,0x002D,0x0043,0x004E,0x002D,0x0045,0x0058,0x0054,0x00 } , { 0x004A,0x0049,0x0053,0x005F,0x0043,0x0036,0x0032,0x0032,0x0030,0x002D,0x0031,0x0039,0x0036,0x0039,0x002D,0x006A,0x0070,0x00 } , { 0x004A,0x0049,0x0053,0x005F,0x0043,0x0036,0x0032,0x0032,0x0030,0x002D,0x0031,0x0039,0x0036,0x0039,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0033,0x00 } , { 0x006B,0x0061,0x0074,0x0061,0x006B,0x0061,0x006E,0x0061,0x00 } , { 0x0078,0x0030,0x0032,0x0030,0x0031,0x002D,0x0037,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0033,0x004A,0x0049,0x0053,0x0043,0x0036,0x0032,0x0032,0x0030,0x006A,0x0070,0x00 } , { 0x004A,0x0049,0x0053,0x005F,0x0043,0x0036,0x0032,0x0032,0x0030,0x002D,0x0031,0x0039,0x0036,0x0039,0x002D,0x0072,0x006F,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0034,0x00 } , { 0x006A,0x0070,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x004A,0x0050,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0034,0x004A,0x0049,0x0053,0x0043,0x0036,0x0032,0x0032,0x0030,0x0072,0x006F,0x00 } , { 0x0049,0x0054,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0035,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0049,0x0054,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0035,0x0049,0x0074,0x0061,0x006C,0x0069,0x0061,0x006E,0x00 } , { 0x0050,0x0054,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0036,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0050,0x0054,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0036,0x0050,0x006F,0x0072,0x0074,0x0075,0x0067,0x0075,0x0065,0x0073,0x0065,0x00 } , { 0x0045,0x0053,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0037,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0045,0x0053,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0037,0x0053,0x0070,0x0061,0x006E,0x0069,0x0073,0x0068,0x00 } , { 0x0067,0x0072,0x0065,0x0065,0x006B,0x0037,0x002D,0x006F,0x006C,0x0064,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0038,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0038,0x0047,0x0072,0x0065,0x0065,0x006B,0x0037,0x004F,0x006C,0x0064,0x00 } , { 0x006C,0x0061,0x0074,0x0069,0x006E,0x002D,0x0067,0x0072,0x0065,0x0065,0x006B,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0039,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0039,0x004C,0x0061,0x0074,0x0069,0x006E,0x0047,0x0072,0x0065,0x0065,0x006B,0x00 } , { 0x0044,0x0049,0x004E,0x005F,0x0036,0x0036,0x0030,0x0030,0x0033,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0032,0x0031,0x00 } , { 0x0064,0x0065,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0044,0x0045,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0032,0x0031,0x0047,0x0065,0x0072,0x006D,0x0061,0x006E,0x00 } , { 0x004E,0x0046,0x005F,0x005A,0x005F,0x0036,0x0032,0x002D,0x0030,0x0031,0x0030,0x005F,0x0028,0x0031,0x0039,0x0037,0x0033,0x0029,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0032,0x0035,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0046,0x0052,0x0031,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0032,0x0035,0x0046,0x0072,0x0065,0x006E,0x0063,0x0068,0x00 } , { 0x004C,0x0061,0x0074,0x0069,0x006E,0x002D,0x0067,0x0072,0x0065,0x0065,0x006B,0x002D,0x0031,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0032,0x0037,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0032,0x0037,0x004C,0x0061,0x0074,0x0069,0x006E,0x0047,0x0072,0x0065,0x0065,0x006B,0x0031,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0035,0x0034,0x0032,0x0037,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0033,0x0037,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0035,0x0034,0x0032,0x0037,0x0043,0x0079,0x0072,0x0069,0x006C,0x006C,0x0069,0x0063,0x00 } , { 0x004A,0x0049,0x0053,0x005F,0x0043,0x0036,0x0032,0x0032,0x0036,0x002D,0x0031,0x0039,0x0037,0x0038,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0034,0x0032,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0034,0x0032,0x004A,0x0049,0x0053,0x0043,0x0036,0x0032,0x0032,0x0036,0x0031,0x0039,0x0037,0x0038,0x00 } , { 0x0042,0x0053,0x005F,0x0076,0x0069,0x0065,0x0077,0x0064,0x0061,0x0074,0x0061,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0034,0x0037,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0034,0x0037,0x0042,0x0053,0x0056,0x0069,0x0065,0x0077,0x0064,0x0061,0x0074,0x0061,0x00 } , { 0x0049,0x004E,0x0049,0x0053,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0034,0x0039,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0034,0x0039,0x0049,0x004E,0x0049,0x0053,0x00 } , { 0x0049,0x004E,0x0049,0x0053,0x002D,0x0038,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0035,0x0030,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0035,0x0030,0x0049,0x004E,0x0049,0x0053,0x0038,0x00 } , { 0x0049,0x004E,0x0049,0x0053,0x002D,0x0063,0x0079,0x0072,0x0069,0x006C,0x006C,0x0069,0x0063,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0035,0x0031,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0035,0x0031,0x0049,0x004E,0x0049,0x0053,0x0043,0x0079,0x0072,0x0069,0x006C,0x006C,0x0069,0x0063,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0035,0x0034,0x0032,0x0037,0x003A,0x0031,0x0039,0x0038,0x0031,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0035,0x0034,0x00 } , { 0x0049,0x0053,0x004F,0x0035,0x0034,0x0032,0x0037,0x0043,0x0079,0x0072,0x0069,0x006C,0x006C,0x0069,0x0063,0x0031,0x0039,0x0038,0x0031,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0035,0x0034,0x0032,0x0038,0x003A,0x0031,0x0039,0x0038,0x0030,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0035,0x0035,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0035,0x0034,0x0032,0x0038,0x0047,0x0072,0x0065,0x0065,0x006B,0x00 } , { 0x0047,0x0042,0x005F,0x0031,0x0039,0x0038,0x0038,0x002D,0x0038,0x0030,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0035,0x0037,0x00 } , { 0x0063,0x006E,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0043,0x004E,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0035,0x0037,0x0047,0x0042,0x0031,0x0039,0x0038,0x0038,0x00 } , { 0x0047,0x0042,0x005F,0x0032,0x0033,0x0031,0x0032,0x002D,0x0038,0x0030,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0035,0x0038,0x00 } , { 0x0063,0x0068,0x0069,0x006E,0x0065,0x0073,0x0065,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0035,0x0038,0x0047,0x0042,0x0032,0x0033,0x0031,0x0032,0x0038,0x0030,0x00 } , { 0x004E,0x0053,0x005F,0x0034,0x0035,0x0035,0x0031,0x002D,0x0031,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0036,0x0030,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x004E,0x004F,0x00 } , { 0x006E,0x006F,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0036,0x0030,0x0044,0x0061,0x006E,0x0069,0x0073,0x0068,0x004E,0x006F,0x0072,0x0077,0x0065,0x0067,0x0069,0x0061,0x006E,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0036,0x0030,0x004E,0x006F,0x0072,0x0077,0x0065,0x0067,0x0069,0x0061,0x006E,0x0031,0x00 } , { 0x004E,0x0053,0x005F,0x0034,0x0035,0x0035,0x0031,0x002D,0x0032,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x004E,0x004F,0x0032,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0036,0x0031,0x00 } , { 0x006E,0x006F,0x0032,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0036,0x0031,0x004E,0x006F,0x0072,0x0077,0x0065,0x0067,0x0069,0x0061,0x006E,0x0032,0x00 } , { 0x004E,0x0046,0x005F,0x005A,0x005F,0x0036,0x0032,0x002D,0x0030,0x0031,0x0030,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0036,0x0039,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0046,0x0052,0x00 } , { 0x0066,0x0072,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0036,0x0039,0x0046,0x0072,0x0065,0x006E,0x0063,0x0068,0x00 } , { 0x0076,0x0069,0x0064,0x0065,0x006F,0x0074,0x0065,0x0078,0x002D,0x0073,0x0075,0x0070,0x0070,0x006C,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0037,0x0030,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0037,0x0030,0x0056,0x0069,0x0064,0x0065,0x006F,0x0074,0x0065,0x0078,0x0053,0x0075,0x0070,0x0070,0x0031,0x00 } , { 0x0050,0x0054,0x0032,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0038,0x0034,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0050,0x0054,0x0032,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0038,0x0034,0x0050,0x006F,0x0072,0x0074,0x0075,0x0067,0x0075,0x0065,0x0073,0x0065,0x0032,0x00 } , { 0x0045,0x0053,0x0032,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0038,0x0035,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0045,0x0053,0x0032,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0038,0x0035,0x0053,0x0070,0x0061,0x006E,0x0069,0x0073,0x0068,0x0032,0x00 } , { 0x004D,0x0053,0x005A,0x005F,0x0037,0x0037,0x0039,0x0035,0x002E,0x0033,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0038,0x0036,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0048,0x0055,0x00 } , { 0x0068,0x0075,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0038,0x0036,0x0048,0x0075,0x006E,0x0067,0x0061,0x0072,0x0069,0x0061,0x006E,0x00 } , { 0x004A,0x0049,0x0053,0x005F,0x0043,0x0036,0x0032,0x0032,0x0036,0x002D,0x0031,0x0039,0x0038,0x0033,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0038,0x0037,0x00 } , { 0x0078,0x0030,0x0032,0x0030,0x0038,0x00 } , { 0x004A,0x0049,0x0053,0x005F,0x0058,0x0030,0x0032,0x0030,0x0038,0x002D,0x0031,0x0039,0x0038,0x0033,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0038,0x0037,0x004A,0x0049,0x0053,0x0058,0x0030,0x0032,0x0030,0x0038,0x00 } , { 0x0067,0x0072,0x0065,0x0065,0x006B,0x0037,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0038,0x0038,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0038,0x0038,0x0047,0x0072,0x0065,0x0065,0x006B,0x0037,0x00 } , { 0x0041,0x0053,0x004D,0x004F,0x005F,0x0034,0x0034,0x0039,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0039,0x0030,0x0033,0x0036,0x00 } , { 0x0061,0x0072,0x0061,0x0062,0x0069,0x0063,0x0037,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0038,0x0039,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0038,0x0039,0x0041,0x0053,0x004D,0x004F,0x0034,0x0034,0x0039,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0039,0x0030,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0039,0x0030,0x00 } , { 0x004A,0x0049,0x0053,0x005F,0x0043,0x0036,0x0032,0x0032,0x0039,0x002D,0x0031,0x0039,0x0038,0x0034,0x002D,0x0061,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0039,0x0031,0x00 } , { 0x006A,0x0070,0x002D,0x006F,0x0063,0x0072,0x002D,0x0061,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0039,0x0031,0x004A,0x0049,0x0053,0x0043,0x0036,0x0032,0x0032,0x0039,0x0031,0x0039,0x0038,0x0034,0x0061,0x00 } , { 0x004A,0x0049,0x0053,0x005F,0x0043,0x0036,0x0032,0x0032,0x0039,0x002D,0x0031,0x0039,0x0038,0x0034,0x002D,0x0062,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0039,0x0032,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x004A,0x0050,0x002D,0x004F,0x0043,0x0052,0x002D,0x0042,0x00 } , { 0x006A,0x0070,0x002D,0x006F,0x0063,0x0072,0x002D,0x0062,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0039,0x0032,0x004A,0x0049,0x0053,0x0043,0x0036,0x0032,0x0039,0x0039,0x0031,0x0039,0x0038,0x0034,0x0062,0x00 } , { 0x004A,0x0049,0x0053,0x005F,0x0043,0x0036,0x0032,0x0032,0x0039,0x002D,0x0031,0x0039,0x0038,0x0034,0x002D,0x0062,0x002D,0x0061,0x0064,0x0064,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0039,0x0033,0x00 } , { 0x006A,0x0070,0x002D,0x006F,0x0063,0x0072,0x002D,0x0062,0x002D,0x0061,0x0064,0x0064,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0039,0x0033,0x004A,0x0049,0x0053,0x0036,0x0032,0x0032,0x0039,0x0031,0x0039,0x0038,0x0034,0x0062,0x0061,0x0064,0x0064,0x00 } , { 0x004A,0x0049,0x0053,0x005F,0x0043,0x0036,0x0032,0x0032,0x0039,0x002D,0x0031,0x0039,0x0038,0x0034,0x002D,0x0068,0x0061,0x006E,0x0064,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0039,0x0034,0x00 } , { 0x006A,0x0070,0x002D,0x006F,0x0063,0x0072,0x002D,0x0068,0x0061,0x006E,0x0064,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0039,0x0034,0x004A,0x0049,0x0053,0x0036,0x0032,0x0032,0x0039,0x0031,0x0039,0x0038,0x0034,0x0068,0x0061,0x006E,0x0064,0x00 } , { 0x004A,0x0049,0x0053,0x005F,0x0043,0x0036,0x0032,0x0032,0x0039,0x002D,0x0031,0x0039,0x0038,0x0034,0x002D,0x0068,0x0061,0x006E,0x0064,0x002D,0x0061,0x0064,0x0064,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0039,0x0035,0x00 } , { 0x006A,0x0070,0x002D,0x006F,0x0063,0x0072,0x002D,0x0068,0x0061,0x006E,0x0064,0x002D,0x0061,0x0064,0x0064,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0039,0x0035,0x004A,0x0049,0x0053,0x0036,0x0032,0x0032,0x0039,0x0031,0x0039,0x0038,0x0034,0x0068,0x0061,0x006E,0x0064,0x0061,0x0064,0x0064,0x00 } , { 0x004A,0x0049,0x0053,0x005F,0x0043,0x0036,0x0032,0x0032,0x0039,0x002D,0x0031,0x0039,0x0038,0x0034,0x002D,0x006B,0x0061,0x006E,0x0061,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0039,0x0036,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0039,0x0036,0x004A,0x0049,0x0053,0x0043,0x0036,0x0032,0x0032,0x0039,0x0031,0x0039,0x0038,0x0034,0x006B,0x0061,0x006E,0x0061,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0032,0x0030,0x0033,0x0033,0x002D,0x0031,0x0039,0x0038,0x0033,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0039,0x0038,0x00 } , { 0x0065,0x0031,0x0033,0x0062,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0032,0x0030,0x0033,0x0033,0x00 } , { 0x0041,0x004E,0x0053,0x0049,0x005F,0x0058,0x0033,0x002E,0x0031,0x0031,0x0030,0x002D,0x0031,0x0039,0x0038,0x0033,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0039,0x0039,0x00 } , { 0x0043,0x0053,0x0041,0x005F,0x0054,0x0035,0x0030,0x0030,0x002D,0x0031,0x0039,0x0038,0x0033,0x00 } , { 0x004E,0x0041,0x0050,0x004C,0x0050,0x0053,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0039,0x0039,0x004E,0x0041,0x0050,0x004C,0x0050,0x0053,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0031,0x003A,0x0031,0x0039,0x0038,0x0037,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0030,0x0030,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0031,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0031,0x00 } , { 0x006C,0x0061,0x0074,0x0069,0x006E,0x0031,0x00 } , { 0x006C,0x0031,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0031,0x0039,0x00 } , { 0x0043,0x0050,0x0038,0x0031,0x0039,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x004C,0x0061,0x0074,0x0069,0x006E,0x0031,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0032,0x003A,0x0031,0x0039,0x0038,0x0037,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0030,0x0031,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0032,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0032,0x00 } , { 0x006C,0x0061,0x0074,0x0069,0x006E,0x0032,0x00 } , { 0x006C,0x0032,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x004C,0x0061,0x0074,0x0069,0x006E,0x0032,0x00 } , { 0x0054,0x002E,0x0036,0x0031,0x002D,0x0037,0x0062,0x0069,0x0074,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0030,0x0032,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0030,0x0032,0x0054,0x0036,0x0031,0x0037,0x0062,0x0069,0x0074,0x00 } , { 0x0054,0x002E,0x0036,0x0031,0x002D,0x0038,0x0062,0x0069,0x0074,0x00 } , { 0x0054,0x002E,0x0036,0x0031,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0030,0x0033,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0030,0x0033,0x0054,0x0036,0x0031,0x0038,0x0062,0x0069,0x0074,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0033,0x003A,0x0031,0x0039,0x0038,0x0038,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0030,0x0039,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0033,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0033,0x00 } , { 0x006C,0x0061,0x0074,0x0069,0x006E,0x0033,0x00 } , { 0x006C,0x0033,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x004C,0x0061,0x0074,0x0069,0x006E,0x0033,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0034,0x003A,0x0031,0x0039,0x0038,0x0038,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0031,0x0030,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0034,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0034,0x00 } , { 0x006C,0x0061,0x0074,0x0069,0x006E,0x0034,0x00 } , { 0x006C,0x0034,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x004C,0x0061,0x0074,0x0069,0x006E,0x0034,0x00 } , { 0x0045,0x0043,0x004D,0x0041,0x002D,0x0063,0x0079,0x0072,0x0069,0x006C,0x006C,0x0069,0x0063,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0031,0x0031,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0031,0x0031,0x0045,0x0043,0x004D,0x0041,0x0043,0x0079,0x0072,0x0069,0x006C,0x006C,0x0069,0x0063,0x00 } , { 0x0043,0x0053,0x0041,0x005F,0x005A,0x0032,0x0034,0x0033,0x002E,0x0034,0x002D,0x0031,0x0039,0x0038,0x0035,0x002D,0x0031,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0032,0x0031,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0043,0x0041,0x00 } , { 0x0063,0x0073,0x0061,0x0037,0x002D,0x0031,0x00 } , { 0x0063,0x0061,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0032,0x0031,0x0043,0x0061,0x006E,0x0061,0x0064,0x0069,0x0061,0x006E,0x0031,0x00 } , { 0x0043,0x0053,0x0041,0x005F,0x005A,0x0032,0x0034,0x0033,0x002E,0x0034,0x002D,0x0031,0x0039,0x0038,0x0035,0x002D,0x0032,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0032,0x0032,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0043,0x0041,0x0032,0x00 } , { 0x0063,0x0073,0x0061,0x0037,0x002D,0x0032,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0032,0x0032,0x0043,0x0061,0x006E,0x0061,0x0064,0x0069,0x0061,0x006E,0x0032,0x00 } , { 0x0043,0x0053,0x0041,0x005F,0x005A,0x0032,0x0034,0x0033,0x002E,0x0034,0x002D,0x0031,0x0039,0x0038,0x0035,0x002D,0x0067,0x0072,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0032,0x0033,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0032,0x0033,0x0043,0x0053,0x0041,0x005A,0x0032,0x0034,0x0033,0x0034,0x0031,0x0039,0x0038,0x0035,0x0067,0x0072,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0036,0x003A,0x0031,0x0039,0x0038,0x0037,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0032,0x0037,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0036,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0036,0x00 } , { 0x0045,0x0043,0x004D,0x0041,0x002D,0x0031,0x0031,0x0034,0x00 } , { 0x0041,0x0053,0x004D,0x004F,0x002D,0x0037,0x0030,0x0038,0x00 } , { 0x0061,0x0072,0x0061,0x0062,0x0069,0x0063,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x004C,0x0061,0x0074,0x0069,0x006E,0x0041,0x0072,0x0061,0x0062,0x0069,0x0063,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0036,0x002D,0x0045,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0038,0x0038,0x0035,0x0039,0x0036,0x0045,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0036,0x002D,0x0045,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0036,0x002D,0x0049,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0038,0x0038,0x0035,0x0039,0x0036,0x0049,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0036,0x002D,0x0049,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0037,0x003A,0x0031,0x0039,0x0038,0x0037,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0032,0x0036,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0037,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0037,0x00 } , { 0x0045,0x004C,0x004F,0x0054,0x005F,0x0039,0x0032,0x0038,0x00 } , { 0x0045,0x0043,0x004D,0x0041,0x002D,0x0031,0x0031,0x0038,0x00 } , { 0x0067,0x0072,0x0065,0x0065,0x006B,0x00 } , { 0x0067,0x0072,0x0065,0x0065,0x006B,0x0038,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x004C,0x0061,0x0074,0x0069,0x006E,0x0047,0x0072,0x0065,0x0065,0x006B,0x00 } , { 0x0054,0x002E,0x0031,0x0030,0x0031,0x002D,0x0047,0x0032,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0032,0x0038,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0032,0x0038,0x0054,0x0031,0x0030,0x0031,0x0047,0x0032,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0038,0x003A,0x0031,0x0039,0x0038,0x0038,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0033,0x0038,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0038,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0038,0x00 } , { 0x0068,0x0065,0x0062,0x0072,0x0065,0x0077,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x004C,0x0061,0x0074,0x0069,0x006E,0x0048,0x0065,0x0062,0x0072,0x0065,0x0077,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0038,0x002D,0x0045,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0038,0x0038,0x0035,0x0039,0x0038,0x0045,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0038,0x002D,0x0045,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0038,0x002D,0x0049,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0038,0x0038,0x0035,0x0039,0x0038,0x0049,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0038,0x002D,0x0049,0x00 } , { 0x0043,0x0053,0x004E,0x005F,0x0033,0x0036,0x0039,0x0031,0x0030,0x0033,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0033,0x0039,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0033,0x0039,0x0043,0x0053,0x004E,0x0033,0x0036,0x0039,0x0031,0x0030,0x0033,0x00 } , { 0x004A,0x0055,0x0053,0x005F,0x0049,0x002E,0x0042,0x0031,0x002E,0x0030,0x0030,0x0032,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0034,0x0031,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0059,0x0055,0x00 } , { 0x006A,0x0073,0x00 } , { 0x0079,0x0075,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0034,0x0031,0x004A,0x0055,0x0053,0x0049,0x0042,0x0031,0x0030,0x0030,0x0032,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0036,0x0039,0x0033,0x0037,0x002D,0x0032,0x002D,0x0061,0x0064,0x0064,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0034,0x0032,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0054,0x0065,0x0078,0x0074,0x0043,0x006F,0x006D,0x006D,0x00 } , { 0x0049,0x0045,0x0043,0x005F,0x0050,0x0032,0x0037,0x002D,0x0031,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0034,0x0033,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0034,0x0033,0x0049,0x0045,0x0043,0x0050,0x0032,0x0037,0x0031,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0035,0x003A,0x0031,0x0039,0x0038,0x0038,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0034,0x0034,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0035,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0035,0x00 } , { 0x0063,0x0079,0x0072,0x0069,0x006C,0x006C,0x0069,0x0063,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x004C,0x0061,0x0074,0x0069,0x006E,0x0043,0x0079,0x0072,0x0069,0x006C,0x006C,0x0069,0x0063,0x00 } , { 0x004A,0x0055,0x0053,0x005F,0x0049,0x002E,0x0042,0x0031,0x002E,0x0030,0x0030,0x0033,0x002D,0x0073,0x0065,0x0072,0x0062,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0034,0x0036,0x00 } , { 0x0073,0x0065,0x0072,0x0062,0x0069,0x0061,0x006E,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0034,0x0036,0x0053,0x0065,0x0072,0x0062,0x0069,0x0061,0x006E,0x00 } , { 0x004A,0x0055,0x0053,0x005F,0x0049,0x002E,0x0042,0x0031,0x002E,0x0030,0x0030,0x0033,0x002D,0x006D,0x0061,0x0063,0x00 } , { 0x006D,0x0061,0x0063,0x0065,0x0064,0x006F,0x006E,0x0069,0x0061,0x006E,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0034,0x0037,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0034,0x0037,0x004D,0x0061,0x0063,0x0065,0x0064,0x006F,0x006E,0x0069,0x0061,0x006E,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0039,0x003A,0x0031,0x0039,0x0038,0x0039,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0034,0x0038,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0039,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0039,0x00 } , { 0x006C,0x0061,0x0074,0x0069,0x006E,0x0035,0x00 } , { 0x006C,0x0035,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x004C,0x0061,0x0074,0x0069,0x006E,0x0035,0x00 } , { 0x0067,0x0072,0x0065,0x0065,0x006B,0x002D,0x0063,0x0063,0x0069,0x0074,0x0074,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0035,0x0030,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0035,0x0030,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0035,0x0030,0x0047,0x0072,0x0065,0x0065,0x006B,0x0043,0x0043,0x0049,0x0054,0x0054,0x00 } , { 0x004E,0x0043,0x005F,0x004E,0x0043,0x0030,0x0030,0x002D,0x0031,0x0030,0x003A,0x0038,0x0031,0x00 } , { 0x0063,0x0075,0x0062,0x0061,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0035,0x0031,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0043,0x0055,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0035,0x0031,0x0043,0x0075,0x0062,0x0061,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0036,0x0039,0x0033,0x0037,0x002D,0x0032,0x002D,0x0032,0x0035,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0035,0x0032,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0036,0x0039,0x0033,0x0037,0x0041,0x0064,0x0064,0x00 } , { 0x0047,0x004F,0x0053,0x0054,0x005F,0x0031,0x0039,0x0037,0x0036,0x0038,0x002D,0x0037,0x0034,0x00 } , { 0x0053,0x0054,0x005F,0x0053,0x0045,0x0056,0x005F,0x0033,0x0035,0x0038,0x002D,0x0038,0x0038,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0035,0x0033,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0035,0x0033,0x0047,0x004F,0x0053,0x0054,0x0031,0x0039,0x0037,0x0036,0x0038,0x0037,0x0034,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0073,0x0075,0x0070,0x0070,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0035,0x0034,0x00 } , { 0x006C,0x0061,0x0074,0x0069,0x006E,0x0031,0x002D,0x0032,0x002D,0x0035,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0038,0x0038,0x0035,0x0039,0x0053,0x0075,0x0070,0x0070,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0031,0x0030,0x0033,0x0036,0x0037,0x002D,0x0062,0x006F,0x0078,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0035,0x0035,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0030,0x0033,0x0036,0x0037,0x0042,0x006F,0x0078,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0031,0x0030,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0035,0x0037,0x00 } , { 0x006C,0x0036,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0031,0x0030,0x003A,0x0031,0x0039,0x0039,0x0032,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x004C,0x0061,0x0074,0x0069,0x006E,0x0036,0x00 } , { 0x006C,0x0061,0x0074,0x0069,0x006E,0x0036,0x00 } , { 0x006C,0x0061,0x0074,0x0069,0x006E,0x002D,0x006C,0x0061,0x0070,0x00 } , { 0x006C,0x0061,0x0070,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0035,0x0038,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0035,0x0038,0x004C,0x0061,0x0070,0x00 } , { 0x004A,0x0049,0x0053,0x005F,0x0058,0x0030,0x0032,0x0031,0x0032,0x002D,0x0031,0x0039,0x0039,0x0030,0x00 } , { 0x0078,0x0030,0x0032,0x0031,0x0032,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0035,0x0039,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0031,0x0035,0x0039,0x004A,0x0049,0x0053,0x0058,0x0030,0x0032,0x0031,0x0032,0x0031,0x0039,0x0039,0x0030,0x00 } , { 0x0044,0x0053,0x005F,0x0032,0x0030,0x0038,0x0039,0x00 } , { 0x0044,0x0053,0x0032,0x0030,0x0038,0x0039,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x0044,0x004B,0x00 } , { 0x0064,0x006B,0x00 } , { 0x0063,0x0073,0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x0044,0x0061,0x006E,0x0069,0x0073,0x0068,0x00 } , { 0x0075,0x0073,0x002D,0x0064,0x006B,0x00 } , { 0x0063,0x0073,0x0055,0x0053,0x0044,0x004B,0x00 } , { 0x0064,0x006B,0x002D,0x0075,0x0073,0x00 } , { 0x0063,0x0073,0x0044,0x004B,0x0055,0x0053,0x00 } , { 0x004A,0x0049,0x0053,0x005F,0x0058,0x0030,0x0032,0x0030,0x0031,0x00 } , { 0x0058,0x0030,0x0032,0x0030,0x0031,0x00 } , { 0x0063,0x0073,0x0048,0x0061,0x006C,0x0066,0x0057,0x0069,0x0064,0x0074,0x0068,0x004B,0x0061,0x0074,0x0061,0x006B,0x0061,0x006E,0x0061,0x00 } , { 0x004B,0x0053,0x0043,0x0035,0x0036,0x0033,0x0036,0x00 } , { 0x0049,0x0053,0x004F,0x0036,0x0034,0x0036,0x002D,0x004B,0x0052,0x00 } , { 0x0063,0x0073,0x004B,0x0053,0x0043,0x0035,0x0036,0x0033,0x0036,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0031,0x0030,0x0036,0x0034,0x0036,0x002D,0x0055,0x0043,0x0053,0x002D,0x0032,0x00 } , { 0x0063,0x0073,0x0055,0x006E,0x0069,0x0063,0x006F,0x0064,0x0065,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0031,0x0030,0x0036,0x0034,0x0036,0x002D,0x0055,0x0043,0x0053,0x002D,0x0034,0x00 } , { 0x0063,0x0073,0x0055,0x0043,0x0053,0x0034,0x00 } , { 0x0044,0x0045,0x0043,0x002D,0x004D,0x0043,0x0053,0x00 } , { 0x0064,0x0065,0x0063,0x00 } , { 0x0063,0x0073,0x0044,0x0045,0x0043,0x004D,0x0043,0x0053,0x00 } , { 0x0068,0x0070,0x002D,0x0072,0x006F,0x006D,0x0061,0x006E,0x0038,0x00 } , { 0x0072,0x006F,0x006D,0x0061,0x006E,0x0038,0x00 } , { 0x0072,0x0038,0x00 } , { 0x0063,0x0073,0x0048,0x0050,0x0052,0x006F,0x006D,0x0061,0x006E,0x0038,0x00 } , { 0x006D,0x0061,0x0063,0x0069,0x006E,0x0074,0x006F,0x0073,0x0068,0x00 } , { 0x006D,0x0061,0x0063,0x00 } , { 0x0063,0x0073,0x004D,0x0061,0x0063,0x0069,0x006E,0x0074,0x006F,0x0073,0x0068,0x00 } , { 0x0049,0x0042,0x004D,0x0030,0x0033,0x0037,0x00 } , { 0x0063,0x0070,0x0030,0x0033,0x0037,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0075,0x0073,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0063,0x0061,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0077,0x0074,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x006E,0x006C,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0030,0x0033,0x0037,0x00 } , { 0x0049,0x0042,0x004D,0x0030,0x0033,0x0038,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0049,0x004E,0x0054,0x00 } , { 0x0063,0x0070,0x0030,0x0033,0x0038,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0030,0x0033,0x0038,0x00 } , { 0x0049,0x0042,0x004D,0x0032,0x0037,0x0033,0x00 } , { 0x0043,0x0050,0x0032,0x0037,0x0033,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0032,0x0037,0x0033,0x00 } , { 0x0049,0x0042,0x004D,0x0032,0x0037,0x0034,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0042,0x0045,0x00 } , { 0x0043,0x0050,0x0032,0x0037,0x0034,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0032,0x0037,0x0034,0x00 } , { 0x0049,0x0042,0x004D,0x0032,0x0037,0x0035,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0042,0x0052,0x00 } , { 0x0063,0x0070,0x0032,0x0037,0x0035,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0032,0x0037,0x0035,0x00 } , { 0x0049,0x0042,0x004D,0x0032,0x0037,0x0037,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0043,0x0050,0x002D,0x0044,0x004B,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0043,0x0050,0x002D,0x004E,0x004F,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0032,0x0037,0x0037,0x00 } , { 0x0049,0x0042,0x004D,0x0032,0x0037,0x0038,0x00 } , { 0x0043,0x0050,0x0032,0x0037,0x0038,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0066,0x0069,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0073,0x0065,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0032,0x0037,0x0038,0x00 } , { 0x0049,0x0042,0x004D,0x0032,0x0038,0x0030,0x00 } , { 0x0043,0x0050,0x0032,0x0038,0x0030,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0069,0x0074,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0032,0x0038,0x0030,0x00 } , { 0x0049,0x0042,0x004D,0x0032,0x0038,0x0031,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x004A,0x0050,0x002D,0x0045,0x00 } , { 0x0063,0x0070,0x0032,0x0038,0x0031,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0032,0x0038,0x0031,0x00 } , { 0x0049,0x0042,0x004D,0x0032,0x0038,0x0034,0x00 } , { 0x0043,0x0050,0x0032,0x0038,0x0034,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0065,0x0073,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0032,0x0038,0x0034,0x00 } , { 0x0049,0x0042,0x004D,0x0032,0x0038,0x0035,0x00 } , { 0x0043,0x0050,0x0032,0x0038,0x0035,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0067,0x0062,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0032,0x0038,0x0035,0x00 } , { 0x0049,0x0042,0x004D,0x0032,0x0039,0x0030,0x00 } , { 0x0063,0x0070,0x0032,0x0039,0x0030,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x004A,0x0050,0x002D,0x006B,0x0061,0x006E,0x0061,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0032,0x0039,0x0030,0x00 } , { 0x0049,0x0042,0x004D,0x0032,0x0039,0x0037,0x00 } , { 0x0063,0x0070,0x0032,0x0039,0x0037,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0066,0x0072,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0032,0x0039,0x0037,0x00 } , { 0x0049,0x0042,0x004D,0x0034,0x0032,0x0030,0x00 } , { 0x0063,0x0070,0x0034,0x0032,0x0030,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0061,0x0072,0x0031,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0034,0x0032,0x0030,0x00 } , { 0x0049,0x0042,0x004D,0x0034,0x0032,0x0033,0x00 } , { 0x0063,0x0070,0x0034,0x0032,0x0033,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0067,0x0072,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0034,0x0032,0x0033,0x00 } , { 0x0049,0x0042,0x004D,0x0034,0x0032,0x0034,0x00 } , { 0x0063,0x0070,0x0034,0x0032,0x0034,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0068,0x0065,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0034,0x0032,0x0034,0x00 } , { 0x0049,0x0042,0x004D,0x0034,0x0033,0x0037,0x00 } , { 0x0063,0x0070,0x0034,0x0033,0x0037,0x00 } , { 0x0034,0x0033,0x0037,0x00 } , { 0x0063,0x0073,0x0050,0x0043,0x0038,0x0043,0x006F,0x0064,0x0065,0x0050,0x0061,0x0067,0x0065,0x0034,0x0033,0x0037,0x00 } , { 0x0049,0x0042,0x004D,0x0035,0x0030,0x0030,0x00 } , { 0x0043,0x0050,0x0035,0x0030,0x0030,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0062,0x0065,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0063,0x0068,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0035,0x0030,0x0030,0x00 } , { 0x0049,0x0042,0x004D,0x0037,0x0037,0x0035,0x00 } , { 0x0063,0x0070,0x0037,0x0037,0x0035,0x00 } , { 0x0063,0x0073,0x0050,0x0043,0x0037,0x0037,0x0035,0x0042,0x0061,0x006C,0x0074,0x0069,0x0063,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0035,0x0030,0x00 } , { 0x0063,0x0070,0x0038,0x0035,0x0030,0x00 } , { 0x0038,0x0035,0x0030,0x00 } , { 0x0063,0x0073,0x0050,0x0043,0x0038,0x0035,0x0030,0x004D,0x0075,0x006C,0x0074,0x0069,0x006C,0x0069,0x006E,0x0067,0x0075,0x0061,0x006C,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0035,0x0031,0x00 } , { 0x0063,0x0070,0x0038,0x0035,0x0031,0x00 } , { 0x0038,0x0035,0x0031,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0038,0x0035,0x0031,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0035,0x0032,0x00 } , { 0x0063,0x0070,0x0038,0x0035,0x0032,0x00 } , { 0x0038,0x0035,0x0032,0x00 } , { 0x0063,0x0073,0x0050,0x0043,0x0070,0x0038,0x0035,0x0032,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0035,0x0035,0x00 } , { 0x0063,0x0070,0x0038,0x0035,0x0035,0x00 } , { 0x0038,0x0035,0x0035,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0038,0x0035,0x0035,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0035,0x0037,0x00 } , { 0x0063,0x0070,0x0038,0x0035,0x0037,0x00 } , { 0x0038,0x0035,0x0037,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0038,0x0035,0x0037,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0036,0x0030,0x00 } , { 0x0063,0x0070,0x0038,0x0036,0x0030,0x00 } , { 0x0038,0x0036,0x0030,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0038,0x0036,0x0030,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0036,0x0031,0x00 } , { 0x0063,0x0070,0x0038,0x0036,0x0031,0x00 } , { 0x0038,0x0036,0x0031,0x00 } , { 0x0063,0x0070,0x002D,0x0069,0x0073,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0038,0x0036,0x0031,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0036,0x0032,0x00 } , { 0x0063,0x0070,0x0038,0x0036,0x0032,0x00 } , { 0x0038,0x0036,0x0032,0x00 } , { 0x0063,0x0073,0x0050,0x0043,0x0038,0x0036,0x0032,0x004C,0x0061,0x0074,0x0069,0x006E,0x0048,0x0065,0x0062,0x0072,0x0065,0x0077,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0036,0x0033,0x00 } , { 0x0063,0x0070,0x0038,0x0036,0x0033,0x00 } , { 0x0038,0x0036,0x0033,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0038,0x0036,0x0033,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0036,0x0034,0x00 } , { 0x0063,0x0070,0x0038,0x0036,0x0034,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0038,0x0036,0x0034,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0036,0x0035,0x00 } , { 0x0063,0x0070,0x0038,0x0036,0x0035,0x00 } , { 0x0038,0x0036,0x0035,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0038,0x0036,0x0035,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0036,0x0036,0x00 } , { 0x0063,0x0070,0x0038,0x0036,0x0036,0x00 } , { 0x0038,0x0036,0x0036,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0038,0x0036,0x0036,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0036,0x0038,0x00 } , { 0x0043,0x0050,0x0038,0x0036,0x0038,0x00 } , { 0x0063,0x0070,0x002D,0x0061,0x0072,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0038,0x0036,0x0038,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0036,0x0039,0x00 } , { 0x0063,0x0070,0x0038,0x0036,0x0039,0x00 } , { 0x0038,0x0036,0x0039,0x00 } , { 0x0063,0x0070,0x002D,0x0067,0x0072,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0038,0x0036,0x0039,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0037,0x0030,0x00 } , { 0x0043,0x0050,0x0038,0x0037,0x0030,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0072,0x006F,0x0065,0x0063,0x0065,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0079,0x0075,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0038,0x0037,0x0030,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0037,0x0031,0x00 } , { 0x0043,0x0050,0x0038,0x0037,0x0031,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0069,0x0073,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0038,0x0037,0x0031,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0038,0x0030,0x00 } , { 0x0063,0x0070,0x0038,0x0038,0x0030,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0043,0x0079,0x0072,0x0069,0x006C,0x006C,0x0069,0x0063,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0038,0x0038,0x0030,0x00 } , { 0x0049,0x0042,0x004D,0x0038,0x0039,0x0031,0x00 } , { 0x0063,0x0070,0x0038,0x0039,0x0031,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0038,0x0039,0x0031,0x00 } , { 0x0049,0x0042,0x004D,0x0039,0x0030,0x0033,0x00 } , { 0x0063,0x0070,0x0039,0x0030,0x0033,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0039,0x0030,0x0033,0x00 } , { 0x0049,0x0042,0x004D,0x0039,0x0030,0x0034,0x00 } , { 0x0063,0x0070,0x0039,0x0030,0x0034,0x00 } , { 0x0039,0x0030,0x0034,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x0042,0x004D,0x0039,0x0030,0x0034,0x00 } , { 0x0049,0x0042,0x004D,0x0039,0x0030,0x0035,0x00 } , { 0x0043,0x0050,0x0039,0x0030,0x0035,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0074,0x0072,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0039,0x0030,0x0035,0x00 } , { 0x0049,0x0042,0x004D,0x0039,0x0031,0x0038,0x00 } , { 0x0043,0x0050,0x0039,0x0031,0x0038,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0063,0x0070,0x002D,0x0061,0x0072,0x0032,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0039,0x0031,0x0038,0x00 } , { 0x0049,0x0042,0x004D,0x0031,0x0030,0x0032,0x0036,0x00 } , { 0x0043,0x0050,0x0031,0x0030,0x0032,0x0036,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0031,0x0030,0x0032,0x0036,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0041,0x0054,0x002D,0x0044,0x0045,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x0041,0x0054,0x0044,0x0045,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0041,0x0054,0x002D,0x0044,0x0045,0x002D,0x0041,0x00 } , { 0x0063,0x0073,0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x0041,0x0054,0x0044,0x0045,0x0041,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0043,0x0041,0x002D,0x0046,0x0052,0x00 } , { 0x0063,0x0073,0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x0043,0x0041,0x0046,0x0052,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0044,0x004B,0x002D,0x004E,0x004F,0x00 } , { 0x0063,0x0073,0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x0044,0x004B,0x004E,0x004F,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0044,0x004B,0x002D,0x004E,0x004F,0x002D,0x0041,0x00 } , { 0x0063,0x0073,0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x0044,0x004B,0x004E,0x004F,0x0041,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0046,0x0049,0x002D,0x0053,0x0045,0x00 } , { 0x0063,0x0073,0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x0046,0x0049,0x0053,0x0045,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0046,0x0049,0x002D,0x0053,0x0045,0x002D,0x0041,0x00 } , { 0x0063,0x0073,0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x0046,0x0049,0x0053,0x0045,0x0041,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0046,0x0052,0x00 } , { 0x0063,0x0073,0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x0046,0x0052,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0049,0x0054,0x00 } , { 0x0063,0x0073,0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x0049,0x0054,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0050,0x0054,0x00 } , { 0x0063,0x0073,0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x0050,0x0054,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0045,0x0053,0x00 } , { 0x0063,0x0073,0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x0045,0x0053,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0045,0x0053,0x002D,0x0041,0x00 } , { 0x0063,0x0073,0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x0045,0x0053,0x0041,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0045,0x0053,0x002D,0x0053,0x00 } , { 0x0063,0x0073,0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x0045,0x0053,0x0053,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0055,0x004B,0x00 } , { 0x0063,0x0073,0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x0055,0x004B,0x00 } , { 0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x002D,0x0055,0x0053,0x00 } , { 0x0063,0x0073,0x0045,0x0042,0x0043,0x0044,0x0049,0x0043,0x0055,0x0053,0x00 } , { 0x0055,0x004E,0x004B,0x004E,0x004F,0x0057,0x004E,0x002D,0x0038,0x0042,0x0049,0x0054,0x00 } , { 0x0063,0x0073,0x0055,0x006E,0x006B,0x006E,0x006F,0x0077,0x006E,0x0038,0x0042,0x0069,0x0054,0x00 } , { 0x004D,0x004E,0x0045,0x004D,0x004F,0x004E,0x0049,0x0043,0x00 } , { 0x0063,0x0073,0x004D,0x006E,0x0065,0x006D,0x006F,0x006E,0x0069,0x0063,0x00 } , { 0x004D,0x004E,0x0045,0x004D,0x00 } , { 0x0063,0x0073,0x004D,0x006E,0x0065,0x006D,0x00 } , { 0x0056,0x0049,0x0053,0x0043,0x0049,0x0049,0x00 } , { 0x0063,0x0073,0x0056,0x0049,0x0053,0x0043,0x0049,0x0049,0x00 } , { 0x0056,0x0049,0x0051,0x0052,0x00 } , { 0x0063,0x0073,0x0056,0x0049,0x0051,0x0052,0x00 } , { 0x004B,0x004F,0x0049,0x0038,0x002D,0x0052,0x00 } , { 0x0063,0x0073,0x004B,0x004F,0x0049,0x0038,0x0052,0x00 } , { 0x004B,0x004F,0x0049,0x0038,0x002D,0x0055,0x00 } , { 0x0049,0x0042,0x004D,0x0030,0x0030,0x0038,0x0035,0x0038,0x00 } , { 0x0043,0x0043,0x0053,0x0049,0x0044,0x0030,0x0030,0x0038,0x0035,0x0038,0x00 } , { 0x0043,0x0050,0x0030,0x0030,0x0038,0x0035,0x0038,0x00 } , { 0x0050,0x0043,0x002D,0x004D,0x0075,0x006C,0x0074,0x0069,0x006C,0x0069,0x006E,0x0067,0x0075,0x0061,0x006C,0x002D,0x0038,0x0035,0x0030,0x002B,0x0065,0x0075,0x0072,0x006F,0x00 } , { 0x0049,0x0042,0x004D,0x0030,0x0030,0x0039,0x0032,0x0034,0x00 } , { 0x0043,0x0043,0x0053,0x0049,0x0044,0x0030,0x0030,0x0039,0x0032,0x0034,0x00 } , { 0x0043,0x0050,0x0030,0x0030,0x0039,0x0032,0x0034,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x004C,0x0061,0x0074,0x0069,0x006E,0x0039,0x002D,0x002D,0x0065,0x0075,0x0072,0x006F,0x00 } , { 0x0049,0x0042,0x004D,0x0030,0x0031,0x0031,0x0034,0x0030,0x00 } , { 0x0043,0x0043,0x0053,0x0049,0x0044,0x0030,0x0031,0x0031,0x0034,0x0030,0x00 } , { 0x0043,0x0050,0x0030,0x0031,0x0031,0x0034,0x0030,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0075,0x0073,0x002D,0x0033,0x0037,0x002B,0x0065,0x0075,0x0072,0x006F,0x00 } , { 0x0049,0x0042,0x004D,0x0030,0x0031,0x0031,0x0034,0x0031,0x00 } , { 0x0043,0x0043,0x0053,0x0049,0x0044,0x0030,0x0031,0x0031,0x0034,0x0031,0x00 } , { 0x0043,0x0050,0x0030,0x0031,0x0031,0x0034,0x0031,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0064,0x0065,0x002D,0x0032,0x0037,0x0033,0x002B,0x0065,0x0075,0x0072,0x006F,0x00 } , { 0x0049,0x0042,0x004D,0x0030,0x0031,0x0031,0x0034,0x0032,0x00 } , { 0x0043,0x0043,0x0053,0x0049,0x0044,0x0030,0x0031,0x0031,0x0034,0x0032,0x00 } , { 0x0043,0x0050,0x0030,0x0031,0x0031,0x0034,0x0032,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0064,0x006B,0x002D,0x0032,0x0037,0x0037,0x002B,0x0065,0x0075,0x0072,0x006F,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x006E,0x006F,0x002D,0x0032,0x0037,0x0037,0x002B,0x0065,0x0075,0x0072,0x006F,0x00 } , { 0x0049,0x0042,0x004D,0x0030,0x0031,0x0031,0x0034,0x0033,0x00 } , { 0x0043,0x0043,0x0053,0x0049,0x0044,0x0030,0x0031,0x0031,0x0034,0x0033,0x00 } , { 0x0043,0x0050,0x0030,0x0031,0x0031,0x0034,0x0033,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0066,0x0069,0x002D,0x0032,0x0037,0x0038,0x002B,0x0065,0x0075,0x0072,0x006F,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0073,0x0065,0x002D,0x0032,0x0037,0x0038,0x002B,0x0065,0x0075,0x0072,0x006F,0x00 } , { 0x0049,0x0042,0x004D,0x0030,0x0031,0x0031,0x0034,0x0034,0x00 } , { 0x0043,0x0043,0x0053,0x0049,0x0044,0x0030,0x0031,0x0031,0x0034,0x0034,0x00 } , { 0x0043,0x0050,0x0030,0x0031,0x0031,0x0034,0x0034,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0069,0x0074,0x002D,0x0032,0x0038,0x0030,0x002B,0x0065,0x0075,0x0072,0x006F,0x00 } , { 0x0049,0x0042,0x004D,0x0030,0x0031,0x0031,0x0034,0x0035,0x00 } , { 0x0043,0x0043,0x0053,0x0049,0x0044,0x0030,0x0031,0x0031,0x0034,0x0035,0x00 } , { 0x0043,0x0050,0x0030,0x0031,0x0031,0x0034,0x0035,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0065,0x0073,0x002D,0x0032,0x0038,0x0034,0x002B,0x0065,0x0075,0x0072,0x006F,0x00 } , { 0x0049,0x0042,0x004D,0x0030,0x0031,0x0031,0x0034,0x0036,0x00 } , { 0x0043,0x0043,0x0053,0x0049,0x0044,0x0030,0x0031,0x0031,0x0034,0x0036,0x00 } , { 0x0043,0x0050,0x0030,0x0031,0x0031,0x0034,0x0036,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0067,0x0062,0x002D,0x0032,0x0038,0x0035,0x002B,0x0065,0x0075,0x0072,0x006F,0x00 } , { 0x0049,0x0042,0x004D,0x0030,0x0031,0x0031,0x0034,0x0037,0x00 } , { 0x0043,0x0043,0x0053,0x0049,0x0044,0x0030,0x0031,0x0031,0x0034,0x0037,0x00 } , { 0x0043,0x0050,0x0030,0x0031,0x0031,0x0034,0x0037,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0066,0x0072,0x002D,0x0032,0x0039,0x0037,0x002B,0x0065,0x0075,0x0072,0x006F,0x00 } , { 0x0049,0x0042,0x004D,0x0030,0x0031,0x0031,0x0034,0x0038,0x00 } , { 0x0043,0x0043,0x0053,0x0049,0x0044,0x0030,0x0031,0x0031,0x0034,0x0038,0x00 } , { 0x0043,0x0050,0x0030,0x0031,0x0031,0x0034,0x0038,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0069,0x006E,0x0074,0x0065,0x0072,0x006E,0x0061,0x0074,0x0069,0x006F,0x006E,0x0061,0x006C,0x002D,0x0035,0x0030,0x0030,0x002B,0x0065,0x0075,0x0072,0x006F,0x00 } , { 0x0049,0x0042,0x004D,0x0030,0x0031,0x0031,0x0034,0x0039,0x00 } , { 0x0043,0x0043,0x0053,0x0049,0x0044,0x0030,0x0031,0x0031,0x0034,0x0039,0x00 } , { 0x0043,0x0050,0x0030,0x0031,0x0031,0x0034,0x0039,0x00 } , { 0x0065,0x0062,0x0063,0x0064,0x0069,0x0063,0x002D,0x0069,0x0073,0x002D,0x0038,0x0037,0x0031,0x002B,0x0065,0x0075,0x0072,0x006F,0x00 } , { 0x0042,0x0069,0x0067,0x0035,0x002D,0x0048,0x004B,0x0053,0x0043,0x0053,0x00 } , { 0x0055,0x004E,0x0049,0x0043,0x004F,0x0044,0x0045,0x002D,0x0031,0x002D,0x0031,0x00 } , { 0x0063,0x0073,0x0055,0x006E,0x0069,0x0063,0x006F,0x0064,0x0065,0x0031,0x0031,0x00 } , { 0x0053,0x0043,0x0053,0x0055,0x00 } , { 0x0055,0x0054,0x0046,0x002D,0x0037,0x00 } , { 0x0055,0x0054,0x0046,0x002D,0x0031,0x0036,0x0042,0x0045,0x00 } , { 0x0055,0x0054,0x0046,0x002D,0x0031,0x0036,0x004C,0x0045,0x00 } , { 0x0055,0x0054,0x0046,0x002D,0x0031,0x0036,0x00 } , { 0x0043,0x0045,0x0053,0x0055,0x002D,0x0038,0x00 } , { 0x0063,0x0073,0x0043,0x0045,0x0053,0x0055,0x002D,0x0038,0x00 } , { 0x0055,0x0054,0x0046,0x002D,0x0033,0x0032,0x00 } , { 0x0055,0x0054,0x0046,0x002D,0x0033,0x0032,0x0042,0x0045,0x00 } , { 0x0055,0x0054,0x0046,0x002D,0x0033,0x0032,0x004C,0x0045,0x00 } , { 0x0055,0x004E,0x0049,0x0043,0x004F,0x0044,0x0045,0x002D,0x0031,0x002D,0x0031,0x002D,0x0055,0x0054,0x0046,0x002D,0x0037,0x00 } , { 0x0063,0x0073,0x0055,0x006E,0x0069,0x0063,0x006F,0x0064,0x0065,0x0031,0x0031,0x0055,0x0054,0x0046,0x0037,0x00 } , { 0x0055,0x0054,0x0046,0x002D,0x0038,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0031,0x0033,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0031,0x0034,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0069,0x0072,0x002D,0x0031,0x0039,0x0039,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0031,0x0034,0x003A,0x0031,0x0039,0x0039,0x0038,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0031,0x0034,0x00 } , { 0x006C,0x0061,0x0074,0x0069,0x006E,0x0038,0x00 } , { 0x0069,0x0073,0x006F,0x002D,0x0063,0x0065,0x006C,0x0074,0x0069,0x0063,0x00 } , { 0x006C,0x0038,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0031,0x0035,0x00 } , { 0x0049,0x0053,0x004F,0x005F,0x0038,0x0038,0x0035,0x0039,0x002D,0x0031,0x0035,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0031,0x0036,0x00 } , { 0x00 } , { 0x0047,0x0042,0x004B,0x00 } , { 0x0043,0x0050,0x0039,0x0033,0x0036,0x00 } , { 0x004D,0x0053,0x0039,0x0033,0x0036,0x00 } , { 0x0077,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x002D,0x0039,0x0033,0x0036,0x00 } , { 0x0047,0x0042,0x0031,0x0038,0x0030,0x0033,0x0030,0x00 } , { 0x004A,0x0049,0x0053,0x005F,0x0045,0x006E,0x0063,0x006F,0x0064,0x0069,0x006E,0x0067,0x00 } , { 0x0063,0x0073,0x004A,0x0049,0x0053,0x0045,0x006E,0x0063,0x006F,0x0064,0x0069,0x006E,0x0067,0x00 } , { 0x0053,0x0068,0x0069,0x0066,0x0074,0x005F,0x004A,0x0049,0x0053,0x00 } , { 0x004D,0x0053,0x005F,0x004B,0x0061,0x006E,0x006A,0x0069,0x00 } , { 0x0063,0x0073,0x0053,0x0068,0x0069,0x0066,0x0074,0x004A,0x0049,0x0053,0x00 } , { 0x0045,0x0078,0x0074,0x0065,0x006E,0x0064,0x0065,0x0064,0x005F,0x0055,0x004E,0x0049,0x0058,0x005F,0x0043,0x006F,0x0064,0x0065,0x005F,0x0050,0x0061,0x0063,0x006B,0x0065,0x0064,0x005F,0x0046,0x006F,0x0072,0x006D,0x0061,0x0074,0x005F,0x0066,0x006F,0x0072,0x005F,0x004A,0x0061,0x0070,0x0061,0x006E,0x0065,0x0073,0x0065,0x00 } , { 0x0063,0x0073,0x0045,0x0055,0x0043,0x0050,0x006B,0x0064,0x0046,0x006D,0x0074,0x004A,0x0061,0x0070,0x0061,0x006E,0x0065,0x0073,0x0065,0x00 } , { 0x0045,0x0055,0x0043,0x002D,0x004A,0x0050,0x00 } , { 0x0045,0x0078,0x0074,0x0065,0x006E,0x0064,0x0065,0x0064,0x005F,0x0055,0x004E,0x0049,0x0058,0x005F,0x0043,0x006F,0x0064,0x0065,0x005F,0x0046,0x0069,0x0078,0x0065,0x0064,0x005F,0x0057,0x0069,0x0064,0x0074,0x0068,0x005F,0x0066,0x006F,0x0072,0x005F,0x004A,0x0061,0x0070,0x0061,0x006E,0x0065,0x0073,0x0065,0x00 } , { 0x0063,0x0073,0x0045,0x0055,0x0043,0x0046,0x0069,0x0078,0x0057,0x0069,0x0064,0x004A,0x0061,0x0070,0x0061,0x006E,0x0065,0x0073,0x0065,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0031,0x0030,0x0036,0x0034,0x0036,0x002D,0x0055,0x0043,0x0053,0x002D,0x0042,0x0061,0x0073,0x0069,0x0063,0x00 } , { 0x0063,0x0073,0x0055,0x006E,0x0069,0x0063,0x006F,0x0064,0x0065,0x0041,0x0053,0x0043,0x0049,0x0049,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0031,0x0030,0x0036,0x0034,0x0036,0x002D,0x0055,0x006E,0x0069,0x0063,0x006F,0x0064,0x0065,0x002D,0x004C,0x0061,0x0074,0x0069,0x006E,0x0031,0x00 } , { 0x0063,0x0073,0x0055,0x006E,0x0069,0x0063,0x006F,0x0064,0x0065,0x004C,0x0061,0x0074,0x0069,0x006E,0x0031,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0031,0x0030,0x0036,0x0034,0x0036,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0031,0x0030,0x0036,0x0034,0x0036,0x002D,0x004A,0x002D,0x0031,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0055,0x006E,0x0069,0x0063,0x006F,0x0064,0x0065,0x002D,0x0049,0x0042,0x004D,0x002D,0x0031,0x0032,0x0036,0x0031,0x00 } , { 0x0063,0x0073,0x0055,0x006E,0x0069,0x0063,0x006F,0x0064,0x0065,0x0049,0x0042,0x004D,0x0031,0x0032,0x0036,0x0031,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0055,0x006E,0x0069,0x0063,0x006F,0x0064,0x0065,0x002D,0x0049,0x0042,0x004D,0x002D,0x0031,0x0032,0x0036,0x0038,0x00 } , { 0x0063,0x0073,0x0055,0x006E,0x0069,0x0063,0x006F,0x0064,0x0065,0x0049,0x0042,0x004D,0x0031,0x0032,0x0036,0x0038,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0055,0x006E,0x0069,0x0063,0x006F,0x0064,0x0065,0x002D,0x0049,0x0042,0x004D,0x002D,0x0031,0x0032,0x0037,0x0036,0x00 } , { 0x0063,0x0073,0x0055,0x006E,0x0069,0x0063,0x006F,0x0064,0x0065,0x0049,0x0042,0x004D,0x0031,0x0032,0x0037,0x0036,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0055,0x006E,0x0069,0x0063,0x006F,0x0064,0x0065,0x002D,0x0049,0x0042,0x004D,0x002D,0x0031,0x0032,0x0036,0x0034,0x00 } , { 0x0063,0x0073,0x0055,0x006E,0x0069,0x0063,0x006F,0x0064,0x0065,0x0049,0x0042,0x004D,0x0031,0x0032,0x0036,0x0034,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0055,0x006E,0x0069,0x0063,0x006F,0x0064,0x0065,0x002D,0x0049,0x0042,0x004D,0x002D,0x0031,0x0032,0x0036,0x0035,0x00 } , { 0x0063,0x0073,0x0055,0x006E,0x0069,0x0063,0x006F,0x0064,0x0065,0x0049,0x0042,0x004D,0x0031,0x0032,0x0036,0x0035,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0031,0x002D,0x0057,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x002D,0x0033,0x002E,0x0030,0x002D,0x004C,0x0061,0x0074,0x0069,0x006E,0x002D,0x0031,0x00 } , { 0x0063,0x0073,0x0057,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x0033,0x0030,0x004C,0x0061,0x0074,0x0069,0x006E,0x0031,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0031,0x002D,0x0057,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x002D,0x0033,0x002E,0x0031,0x002D,0x004C,0x0061,0x0074,0x0069,0x006E,0x002D,0x0031,0x00 } , { 0x0063,0x0073,0x0057,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x0033,0x0031,0x004C,0x0061,0x0074,0x0069,0x006E,0x0031,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0032,0x002D,0x0057,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x002D,0x004C,0x0061,0x0074,0x0069,0x006E,0x002D,0x0032,0x00 } , { 0x0063,0x0073,0x0057,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x0033,0x0031,0x004C,0x0061,0x0074,0x0069,0x006E,0x0032,0x00 } , { 0x0049,0x0053,0x004F,0x002D,0x0038,0x0038,0x0035,0x0039,0x002D,0x0039,0x002D,0x0057,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x002D,0x004C,0x0061,0x0074,0x0069,0x006E,0x002D,0x0035,0x00 } , { 0x0063,0x0073,0x0057,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x0033,0x0031,0x004C,0x0061,0x0074,0x0069,0x006E,0x0035,0x00 } , { 0x0041,0x0064,0x006F,0x0062,0x0065,0x002D,0x0053,0x0074,0x0061,0x006E,0x0064,0x0061,0x0072,0x0064,0x002D,0x0045,0x006E,0x0063,0x006F,0x0064,0x0069,0x006E,0x0067,0x00 } , { 0x0063,0x0073,0x0041,0x0064,0x006F,0x0062,0x0065,0x0053,0x0074,0x0061,0x006E,0x0064,0x0061,0x0072,0x0064,0x0045,0x006E,0x0063,0x006F,0x0064,0x0069,0x006E,0x0067,0x00 } , { 0x0056,0x0065,0x006E,0x0074,0x0075,0x0072,0x0061,0x002D,0x0055,0x0053,0x00 } , { 0x0063,0x0073,0x0056,0x0065,0x006E,0x0074,0x0075,0x0072,0x0061,0x0055,0x0053,0x00 } , { 0x0056,0x0065,0x006E,0x0074,0x0075,0x0072,0x0061,0x002D,0x0049,0x006E,0x0074,0x0065,0x0072,0x006E,0x0061,0x0074,0x0069,0x006F,0x006E,0x0061,0x006C,0x00 } , { 0x0063,0x0073,0x0056,0x0065,0x006E,0x0074,0x0075,0x0072,0x0061,0x0049,0x006E,0x0074,0x0065,0x0072,0x006E,0x0061,0x0074,0x0069,0x006F,0x006E,0x0061,0x006C,0x00 } , { 0x0050,0x0043,0x0038,0x002D,0x0044,0x0061,0x006E,0x0069,0x0073,0x0068,0x002D,0x004E,0x006F,0x0072,0x0077,0x0065,0x0067,0x0069,0x0061,0x006E,0x00 } , { 0x0063,0x0073,0x0050,0x0043,0x0038,0x0044,0x0061,0x006E,0x0069,0x0073,0x0068,0x004E,0x006F,0x0072,0x0077,0x0065,0x0067,0x0069,0x0061,0x006E,0x00 } , { 0x0050,0x0043,0x0038,0x002D,0x0054,0x0075,0x0072,0x006B,0x0069,0x0073,0x0068,0x00 } , { 0x0063,0x0073,0x0050,0x0043,0x0038,0x0054,0x0075,0x0072,0x006B,0x0069,0x0073,0x0068,0x00 } , { 0x0049,0x0042,0x004D,0x002D,0x0053,0x0079,0x006D,0x0062,0x006F,0x006C,0x0073,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0053,0x0079,0x006D,0x0062,0x006F,0x006C,0x0073,0x00 } , { 0x0049,0x0042,0x004D,0x002D,0x0054,0x0068,0x0061,0x0069,0x00 } , { 0x0063,0x0073,0x0049,0x0042,0x004D,0x0054,0x0068,0x0061,0x0069,0x00 } , { 0x0048,0x0050,0x002D,0x004C,0x0065,0x0067,0x0061,0x006C,0x00 } , { 0x0063,0x0073,0x0048,0x0050,0x004C,0x0065,0x0067,0x0061,0x006C,0x00 } , { 0x0048,0x0050,0x002D,0x0050,0x0069,0x002D,0x0066,0x006F,0x006E,0x0074,0x00 } , { 0x0063,0x0073,0x0048,0x0050,0x0050,0x0069,0x0046,0x006F,0x006E,0x0074,0x00 } , { 0x0048,0x0050,0x002D,0x004D,0x0061,0x0074,0x0068,0x0038,0x00 } , { 0x0063,0x0073,0x0048,0x0050,0x004D,0x0061,0x0074,0x0068,0x0038,0x00 } , { 0x0041,0x0064,0x006F,0x0062,0x0065,0x002D,0x0053,0x0079,0x006D,0x0062,0x006F,0x006C,0x002D,0x0045,0x006E,0x0063,0x006F,0x0064,0x0069,0x006E,0x0067,0x00 } , { 0x0063,0x0073,0x0048,0x0050,0x0050,0x0053,0x004D,0x0061,0x0074,0x0068,0x00 } , { 0x0048,0x0050,0x002D,0x0044,0x0065,0x0073,0x006B,0x0054,0x006F,0x0070,0x00 } , { 0x0063,0x0073,0x0048,0x0050,0x0044,0x0065,0x0073,0x006B,0x0074,0x006F,0x0070,0x00 } , { 0x0056,0x0065,0x006E,0x0074,0x0075,0x0072,0x0061,0x002D,0x004D,0x0061,0x0074,0x0068,0x00 } , { 0x0063,0x0073,0x0056,0x0065,0x006E,0x0074,0x0075,0x0072,0x0061,0x004D,0x0061,0x0074,0x0068,0x00 } , { 0x004D,0x0069,0x0063,0x0072,0x006F,0x0073,0x006F,0x0066,0x0074,0x002D,0x0050,0x0075,0x0062,0x006C,0x0069,0x0073,0x0068,0x0069,0x006E,0x0067,0x00 } , { 0x0063,0x0073,0x004D,0x0069,0x0063,0x0072,0x006F,0x0073,0x006F,0x0066,0x0074,0x0050,0x0075,0x0062,0x006C,0x0069,0x0073,0x0068,0x0069,0x006E,0x0067,0x00 } , { 0x0057,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x002D,0x0033,0x0031,0x004A,0x00 } , { 0x0063,0x0073,0x0057,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x0033,0x0031,0x004A,0x00 } , { 0x0047,0x0042,0x0032,0x0033,0x0031,0x0032,0x00 } , { 0x0063,0x0073,0x0047,0x0042,0x0032,0x0033,0x0031,0x0032,0x00 } , { 0x0042,0x0069,0x0067,0x0035,0x00 } , { 0x0063,0x0073,0x0042,0x0069,0x0067,0x0035,0x00 } , { 0x0077,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x002D,0x0031,0x0032,0x0035,0x0030,0x00 } , { 0x0077,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x002D,0x0031,0x0032,0x0035,0x0031,0x00 } , { 0x0077,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x002D,0x0031,0x0032,0x0035,0x0032,0x00 } , { 0x0077,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x002D,0x0031,0x0032,0x0035,0x0033,0x00 } , { 0x0077,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x002D,0x0031,0x0032,0x0035,0x0034,0x00 } , { 0x0077,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x002D,0x0031,0x0032,0x0035,0x0035,0x00 } , { 0x0077,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x002D,0x0031,0x0032,0x0035,0x0036,0x00 } , { 0x0077,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x002D,0x0031,0x0032,0x0035,0x0037,0x00 } , { 0x0077,0x0069,0x006E,0x0064,0x006F,0x0077,0x0073,0x002D,0x0031,0x0032,0x0035,0x0038,0x00 } , { 0x0054,0x0049,0x0053,0x002D,0x0036,0x0032,0x0030,0x00 } , { 0x0048,0x005A,0x002D,0x0047,0x0042,0x002D,0x0032,0x0033,0x0031,0x0032,0x00 } }; const unsigned int gEncodingArraySize = 791; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/XMLScanner.hpp000644 000765 000024 00000133162 13241160334 022570 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLScanner.hpp 1800006 2017-06-27 02:40:16Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLSCANNER_HPP) #define XERCESC_INCLUDE_GUARD_XMLSCANNER_HPP #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class InputSource; class XMLDocumentHandler; class XMLEntityHandler; class ErrorHandler; class DocTypeHandler; class XMLPScanToken; class XMLStringPool; class Grammar; class XMLValidator; class MemoryManager; class PSVIHandler; struct PSVIElemContext { bool fIsSpecified; bool fErrorOccurred; int fElemDepth; int fFullValidationDepth; int fNoneValidationDepth; DatatypeValidator* fCurrentDV; ComplexTypeInfo* fCurrentTypeInfo; const XMLCh* fNormalizedValue; }; // This is the mondo scanner class, which does the vast majority of the // work of parsing. It handles reading in input and spitting out events // to installed handlers. class XMLPARSER_EXPORT XMLScanner : public XMemory, public XMLBufferFullHandler { public : // ----------------------------------------------------------------------- // Public class types // // NOTE: These should really be private, but some of the compilers we // have to deal with are too stupid to understand this. // // DeclTypes // Used by scanXMLDecl() to know what type of decl it should scan. // Text decls have slightly different rules from XMLDecls. // // EntityExpRes // These are the values returned from the entity expansion method, // to indicate how it went. // // XMLTokens // These represent the possible types of input we can get while // scanning content. // // ValScheme // This indicates what the scanner should do in terms of validation. // 'Auto' means if there is any int/ext subset, then validate. Else, // don't. // ----------------------------------------------------------------------- enum DeclTypes { Decl_Text , Decl_XML }; enum EntityExpRes { EntityExp_Pushed , EntityExp_Returned , EntityExp_Failed }; enum XMLTokens { Token_CData , Token_CharData , Token_Comment , Token_EndTag , Token_EOF , Token_PI , Token_StartTag , Token_Unknown }; enum ValSchemes { Val_Never , Val_Always , Val_Auto }; // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- XMLScanner ( XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); XMLScanner ( XMLDocumentHandler* const docHandler , DocTypeHandler* const docTypeHandler , XMLEntityHandler* const entityHandler , XMLErrorReporter* const errReporter , XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~XMLScanner(); // ----------------------------------------------------------------------- // Error emitter methods // ----------------------------------------------------------------------- bool emitErrorWillThrowException(const XMLErrs::Codes toEmit); void emitError(const XMLErrs::Codes toEmit); void emitError ( const XMLErrs::Codes toEmit , const XMLCh* const text1 , const XMLCh* const text2 = 0 , const XMLCh* const text3 = 0 , const XMLCh* const text4 = 0 ); void emitError ( const XMLErrs::Codes toEmit , const char* const text1 , const char* const text2 = 0 , const char* const text3 = 0 , const char* const text4 = 0 ); void emitError ( const XMLErrs::Codes toEmit , const XMLExcepts::Codes originalErrorCode , const XMLCh* const text1 = 0 , const XMLCh* const text2 = 0 , const XMLCh* const text3 = 0 , const XMLCh* const text4 = 0 ); // ----------------------------------------------------------------------- // Implementation of XMLBufferFullHandler interface // ----------------------------------------------------------------------- virtual bool bufferFull(XMLBuffer& toSend) { sendCharData(toSend); return true; } virtual Grammar::GrammarType getCurrentGrammarType() const; // ----------------------------------------------------------------------- // Public pure virtual methods // ----------------------------------------------------------------------- virtual const XMLCh* getName() const = 0; virtual NameIdPool* getEntityDeclPool() = 0; virtual const NameIdPool* getEntityDeclPool() const = 0; virtual void scanDocument ( const InputSource& src ) = 0; virtual bool scanNext(XMLPScanToken& toFill) = 0; virtual Grammar* loadGrammar ( const InputSource& src , const short grammarType , const bool toCache = false ) = 0; virtual void resetCachedGrammar (); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- const XMLDocumentHandler* getDocHandler() const; XMLDocumentHandler* getDocHandler(); const DocTypeHandler* getDocTypeHandler() const; DocTypeHandler* getDocTypeHandler(); bool getDoNamespaces() const; ValSchemes getValidationScheme() const; bool getDoSchema() const; bool getValidationSchemaFullChecking() const; bool getIdentityConstraintChecking() const; const XMLEntityHandler* getEntityHandler() const; XMLEntityHandler* getEntityHandler(); const XMLErrorReporter* getErrorReporter() const; XMLErrorReporter* getErrorReporter(); const ErrorHandler* getErrorHandler() const; ErrorHandler* getErrorHandler(); const PSVIHandler* getPSVIHandler() const; PSVIHandler* getPSVIHandler(); bool getExitOnFirstFatal() const; bool getValidationConstraintFatal() const; RefHashTableOf* getIDRefList(); const RefHashTableOf* getIDRefList() const; ValidationContext* getValidationContext(); bool getInException() const; /*bool getLastExtLocation ( XMLCh* const sysIdToFill , const unsigned int maxSysIdChars , XMLCh* const pubIdToFill , const unsigned int maxPubIdChars , XMLSSize_t& lineToFill , XMLSSize_t& colToFill ) const;*/ const Locator* getLocator() const; const ReaderMgr* getReaderMgr() const; XMLFilePos getSrcOffset() const; bool getStandalone() const; const XMLValidator* getValidator() const; XMLValidator* getValidator(); int getErrorCount(); const XMLStringPool* getURIStringPool() const; XMLStringPool* getURIStringPool(); bool getHasNoDTD() const; XMLCh* getExternalSchemaLocation() const; XMLCh* getExternalNoNamespaceSchemaLocation() const; SecurityManager* getSecurityManager() const; bool getDisallowDTD() const; bool getLoadExternalDTD() const; bool getLoadSchema() const; bool getNormalizeData() const; bool isCachingGrammarFromParse() const; bool isUsingCachedGrammarInParse() const; bool getCalculateSrcOfs() const; Grammar* getRootGrammar() const; XMLReader::XMLVersion getXMLVersion() const; MemoryManager* getMemoryManager() const; ValueVectorOf* getNamespaceContext() const; unsigned int getPrefixId(const XMLCh* const prefix) const; const XMLCh* getPrefixForId(unsigned int prefId) const; // Return is a reference so that we can return it as void* from // getProperty. // const XMLSize_t& getLowWaterMark() const; bool getGenerateSyntheticAnnotations() const; bool getValidateAnnotations() const; bool getIgnoreCachedDTD() const; bool getIgnoreAnnotations() const; bool getDisableDefaultEntityResolution() const; bool getSkipDTDValidation() const; bool getHandleMultipleImports() const; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * When an attribute name has no prefix, unlike elements, it is not mapped * to the global namespace. So, in order to have something to map it to * for practical purposes, a id for an empty URL is created and used for * such names. * * @return The URL pool id of the URL for an empty URL "". */ unsigned int getEmptyNamespaceId() const; /** * When a prefix is found that has not been mapped, an error is issued. * However, if the parser has been instructed not to stop on the first * fatal error, it needs to be able to continue. To do so, it will map * that prefix tot his magic unknown namespace id. * * @return The URL pool id of the URL for the unknown prefix * namespace. */ unsigned int getUnknownNamespaceId() const; /** * The prefix 'xml' is a magic prefix, defined by the XML spec and * requiring no prior definition. This method returns the id for the * intrinsically defined URL for this prefix. * * @return The URL pool id of the URL for the 'xml' prefix. */ unsigned int getXMLNamespaceId() const; /** * The prefix 'xmlns' is a magic prefix, defined by the namespace spec * and requiring no prior definition. This method returns the id for the * intrinsically defined URL for this prefix. * * @return The URL pool id of the URL for the 'xmlns' prefix. */ unsigned int getXMLNSNamespaceId() const; /** * This method find the passed URI id in its URI pool and * copy the text of that URI into the passed buffer. */ bool getURIText ( const unsigned int uriId , XMLBuffer& uriBufToFill ) const; const XMLCh* getURIText(const unsigned int uriId) const; /* tell if the validator comes from user */ bool isValidatorFromUser(); /* tell if standard URI are forced */ bool getStandardUriConformant() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void addGlobalPrefix(const XMLCh* const prefix, const unsigned int uriId); void setDocHandler(XMLDocumentHandler* const docHandler); void setDocTypeHandler(DocTypeHandler* const docTypeHandler); void setDoNamespaces(const bool doNamespaces); void setEntityHandler(XMLEntityHandler* const docTypeHandler); void setErrorReporter(XMLErrorReporter* const errHandler); void setErrorHandler(ErrorHandler* const handler); void setPSVIHandler(PSVIHandler* const handler); void setURIStringPool(XMLStringPool* const stringPool); void setExitOnFirstFatal(const bool newValue); void setValidationConstraintFatal(const bool newValue); void setValidationScheme(const ValSchemes newScheme); void setValidator(XMLValidator* const valToAdopt); void setDoSchema(const bool doSchema); void setValidationSchemaFullChecking(const bool schemaFullChecking); void setIdentityConstraintChecking(const bool identityConstraintChecking); void setHasNoDTD(const bool hasNoDTD); void cacheGrammarFromParse(const bool newValue); void useCachedGrammarInParse(const bool newValue); void setRootElemName(XMLCh* rootElemName); void setExternalSchemaLocation(const XMLCh* const schemaLocation); void setExternalNoNamespaceSchemaLocation(const XMLCh* const noNamespaceSchemaLocation); void setExternalSchemaLocation(const char* const schemaLocation); void setExternalNoNamespaceSchemaLocation(const char* const noNamespaceSchemaLocation); void setSecurityManager(SecurityManager* const securityManager); void setDisallowDTD(const bool disallowDTD); void setLoadExternalDTD(const bool loadDTD); void setLoadSchema(const bool loadSchema); void setNormalizeData(const bool normalizeData); void setCalculateSrcOfs(const bool newValue); void setParseSettings(XMLScanner* const refScanner); void setStandardUriConformant(const bool newValue); void setInputBufferSize(const XMLSize_t bufferSize); void setLowWaterMark(XMLSize_t newValue); void setGenerateSyntheticAnnotations(const bool newValue); void setValidateAnnotations(const bool newValue); void setIgnoredCachedDTD(const bool newValue); void setIgnoreAnnotations(const bool newValue); void setDisableDefaultEntityResolution(const bool newValue); void setSkipDTDValidation(const bool newValue); void setHandleMultipleImports(const bool newValue); // ----------------------------------------------------------------------- // Mutator methods // ----------------------------------------------------------------------- void incrementErrorCount(void); // For use by XMLValidator // ----------------------------------------------------------------------- // Document scanning methods // // scanDocument() does the entire source document. scanFirst(), // scanNext(), and scanReset() support a progressive parse. // ----------------------------------------------------------------------- void scanDocument ( const XMLCh* const systemId ); void scanDocument ( const char* const systemId ); bool scanFirst ( const InputSource& src , XMLPScanToken& toFill ); bool scanFirst ( const XMLCh* const systemId , XMLPScanToken& toFill ); bool scanFirst ( const char* const systemId , XMLPScanToken& toFill ); void scanReset(XMLPScanToken& toFill); bool checkXMLDecl(bool startWithAngle); // ----------------------------------------------------------------------- // Grammar preparsing methods // ----------------------------------------------------------------------- Grammar* loadGrammar ( const XMLCh* const systemId , const short grammarType , const bool toCache = false ); Grammar* loadGrammar ( const char* const systemId , const short grammarType , const bool toCache = false ); // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- unsigned int resolveQName ( const XMLCh* const qName , XMLBuffer& prefixBufToFill , const ElemStack::MapModes mode , int& prefixColonPos ); protected: // ----------------------------------------------------------------------- // Protected pure virtual methods // ----------------------------------------------------------------------- virtual void scanCDSection() = 0; virtual void scanCharData(XMLBuffer& toToUse) = 0; virtual EntityExpRes scanEntityRef ( const bool inAttVal , XMLCh& firstCh , XMLCh& secondCh , bool& escaped ) = 0; virtual void scanDocTypeDecl() = 0; virtual void scanReset(const InputSource& src) = 0; virtual void sendCharData(XMLBuffer& toSend) = 0; //return owned by the caller virtual InputSource* resolveSystemId(const XMLCh* const /*sysId*/ ,const XMLCh* const /*pubId*/) {return 0;}; // ----------------------------------------------------------------------- // Protected scanning methods // ----------------------------------------------------------------------- bool scanCharRef(XMLCh& toFill, XMLCh& second); void scanComment(); bool scanEq(bool inDecl = false); void scanMiscellaneous(); void scanPI(); void scanProlog(); void scanXMLDecl(const DeclTypes type); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void checkInternalDTD(bool hasExtSubset, const XMLCh* const sysId, const XMLCh* const pubId); void checkIDRefs(); bool isLegalToken(const XMLPScanToken& toCheck); XMLTokens senseNextToken(XMLSize_t& orgReader); void initValidator(XMLValidator* theValidator); inline void resetValidationContext(); unsigned int *getNewUIntPtr(); void resetUIntPool(); void recreateUIntPool(); unsigned int resolvePrefix ( const XMLCh* const prefix , const ElemStack::MapModes mode ); unsigned int resolveQNameWithColon ( const XMLCh* const qName , XMLBuffer& prefixBufToFill , const ElemStack::MapModes mode , const int prefixColonPos ); inline void setAttrDupChkRegistry ( const XMLSize_t &attrNumber , bool &toUseHashTable ); // ----------------------------------------------------------------------- // Data members // // fBufferSize // Maximum input buffer size // // fLowWaterMark // The low water mark for the raw byte buffer. // // fAttrList // Every time we get a new element start tag, we have to pass to // the document handler the attributes found. To make it more // efficient we keep this ref vector of XMLAttr objects around. We // just reuse it over and over, allowing it to grow to meet the // peak need. // // fBufMgr // This is a manager for temporary buffers used during scanning. // For efficiency we must use a set of static buffers, but we have // to insure that they are not incorrectly reused. So this manager // provides the smarts to hand out buffers as required. // // fDocHandler // The client code's document handler. If zero, then no document // handler callouts are done. We don't adopt it. // // fDocTypeHandler // The client code's document type handler (used by DTD Validator). // // fDoNamespaces // This flag indicates whether the client code wants us to do // namespaces or not. If the installed validator indicates that it // has to do namespaces, then this is ignored. // // fEntityHandler // The client code's entity handler. If zero, then no entity handler // callouts are done. We don't adopt it. // // fErrorReporter // The client code's error reporter. If zero, then no error reporter // callouts are done. We don't adopt it. // // fErrorHandler // The client code's error handler. Need to store this info for // Schema parse error handling. // // fPSVIHandler // The client code's PSVI handler. // // fExitOnFirstFatal // This indicates whether we bail out on the first fatal XML error // or not. It defaults to true, which is the strict XML way, but it // can be changed. // // fValidationConstraintFatal // This indicates whether we treat validation constraint errors as // fatal errors or not. It defaults to false, but it can be changed. // // fIDRefList // This is a list of XMLRefInfo objects. This member lets us do all // needed ID-IDREF balancing checks. // // fInException // To avoid a circular freakout when we catch an exception and emit // it, which would normally throw again if the 'fail on first error' // flag is one. // // fReaderMgr // This is the reader manager, from which we get characters. It // manages the reader stack for us, and provides a lot of convenience // methods to do specialized checking for chars, sequences of chars, // skipping chars, etc... // // fScannerId // fSequenceId // These are used for progressive parsing, to make sure that the // client code does the right thing at the right time. // // fStandalone // Indicates whether the document is standalone or not. Defaults to // no, but can be overridden in the XMLDecl. // // fHasNoDTD // Indicates the document has no DTD or has only an internal DTD subset // which contains no parameter entity references. // // fValidate // Indicates whether any validation should be done. This is defined // by the existence of a Grammar together with fValScheme. // // fValidator // The installed validator. We look at them via the abstract // validator interface, and don't know what it actual is. // Either point to user's installed validator, or fDTDValidator // or fSchemaValidator. // // fValidatorFromUser // This flag indicates whether the validator was installed from // user. If false, then the validator was created by the Scanner. // // fValScheme // This is the currently set validation scheme. It defaults to // 'never', but can be set by the client. // // fErrorCount // The number of errors we've encountered. // // fDoSchema // This flag indicates whether the client code wants Schema to // be processed or not. // // fSchemaFullChecking // This flag indicates whether the client code wants full Schema // constraint checking. // // fIdentityConstraintChecking // This flag indicates whether the client code wants Identity // Constraint checking, defaulted to true to maintain backward // compatibility (to minimize supprise) // // fAttName // fAttValue // fCDataBuf // fNameBuf // fQNameBuf // fPrefixBuf // For the most part, buffers are obtained from the fBufMgr object // on the fly. However, for the start tag scan, we have a set of // fixed buffers for performance reasons. These are used a lot and // there are a number of them, so asking the buffer manager each // time for new buffers is a bit too much overhead. // // fEmptyNamespaceId // This is the id of the empty namespace URI. This is a special one // because of the xmlns="" type of deal. We have to quickly sense // that its the empty namespace. // // fUnknownNamespaceId // This is the id of the namespace URI which is assigned to the // global namespace. Its for debug purposes only, since there is no // real global namespace URI. Its set by the derived class. // // fXMLNamespaceId // fXMLNSNamespaceId // These are the ids of the namespace URIs which are assigned to the // 'xml' and 'xmlns' special prefixes. The former is officially // defined but the latter is not, so we just provide one for debug // purposes. // // fSchemaNamespaceId // This is the id of the schema namespace URI. // // fGrammarResolver // Grammar Pool that stores all the grammars. Key is namespace for // schema and system id for external DTD. When caching a grammar, if // a grammar is already in the pool, it will be replaced with the // new parsed one. // // fGrammar // Current Grammar used by the Scanner and Validator // // fRootGrammar // The grammar where the root element is declared. // // fGrammarType // Current Grammar Type. Store this value instead of calling getGrammarType // all the time for faster performance. // // fURIStringPool // This is a pool for URIs with unique ids assigned. We use a standard // string pool class. This pool is going to be shared by all Grammar. // Use only if namespace is turned on. // // fRootElemName // No matter we are using DTD or Schema Grammar, if a DOCTYPE exists, // we need to verify the root element name. So store the rootElement // that is used in the DOCTYPE in the Scanner instead of in the DTDGrammar // where it used to // // fExternalSchemaLocation // The list of Namespace/SchemaLocation that was specified externally // using setExternalSchemaLocation. // // fExternalNoNamespaceSchemaLocation // The no target namespace XML Schema Location that was specified // externally using setExternalNoNamespaceSchemaLocation. // // fSecurityManager // The SecurityManager instance; as and when set by the application. // // fEntityExpansionLimit // The number of entity expansions to be permitted while processing this document // Only meaningful when fSecurityManager != 0 // // fEntityExpansionCount // The number of general entities expanded so far in this document. // Only meaningful when fSecurityManager != null // // fDisallowDTD // This flag indicates whether the presence of a DTD should be fatal // // fLoadExternalDTD // This flag indicates whether the external DTD be loaded or not // // fLoadSchema // This flag indicates whether the parser should attempt to load // schemas if they cannot be found in the grammar pool. // // fNormalizeData // This flag indicates whether the parser should perform datatype // normalization that is defined in the schema. // // fCalculateSrcOfs // This flag indicates the parser should calculate the source offset. // Turning this on may impact performance. // // fStandardUriConformant // This flag controls whether we force conformant URI // // fXMLVersion // Enum to indicate if the main doc is XML 1.1 or XML 1.0 conformant // fUIntPool // pool of unsigned integers to help with duplicate attribute // detection and filling in default/fixed attributes // fUIntPoolRow // current row in fUIntPool // fUIntPoolCol // current column in row // fUIntPoolRowTotal // total number of rows in table // // fMemoryManager // Pluggable memory manager for dynamic allocation/deallocation. // // ----------------------------------------------------------------------- XMLSize_t fBufferSize; XMLSize_t fLowWaterMark; bool fStandardUriConformant; bool fCalculateSrcOfs; bool fDoNamespaces; bool fExitOnFirstFatal; bool fValidationConstraintFatal; bool fInException; bool fStandalone; bool fHasNoDTD; bool fValidate; bool fValidatorFromUser; bool fDoSchema; bool fSchemaFullChecking; bool fIdentityConstraintChecking; bool fToCacheGrammar; bool fUseCachedGrammar; bool fDisallowDTD; bool fLoadExternalDTD; bool fLoadSchema; bool fNormalizeData; bool fGenerateSyntheticAnnotations; bool fValidateAnnotations; bool fIgnoreCachedDTD; bool fIgnoreAnnotations; bool fDisableDefaultEntityResolution; bool fSkipDTDValidation; bool fHandleMultipleImports; int fErrorCount; XMLSize_t fEntityExpansionLimit; XMLSize_t fEntityExpansionCount; unsigned int fEmptyNamespaceId; unsigned int fUnknownNamespaceId; unsigned int fXMLNamespaceId; unsigned int fXMLNSNamespaceId; unsigned int fSchemaNamespaceId; unsigned int ** fUIntPool; unsigned int fUIntPoolRow; unsigned int fUIntPoolCol; unsigned int fUIntPoolRowTotal; XMLUInt32 fScannerId; XMLUInt32 fSequenceId; RefVectorOf* fAttrList; RefHash2KeysTableOf* fAttrDupChkRegistry; XMLDocumentHandler* fDocHandler; DocTypeHandler* fDocTypeHandler; XMLEntityHandler* fEntityHandler; XMLErrorReporter* fErrorReporter; ErrorHandler* fErrorHandler; PSVIHandler* fPSVIHandler; ValidationContext *fValidationContext; bool fEntityDeclPoolRetrieved; ReaderMgr fReaderMgr; XMLValidator* fValidator; ValSchemes fValScheme; GrammarResolver* const fGrammarResolver; MemoryManager* const fGrammarPoolMemoryManager; Grammar* fGrammar; Grammar* fRootGrammar; XMLStringPool* fURIStringPool; XMLCh* fRootElemName; XMLCh* fExternalSchemaLocation; XMLCh* fExternalNoNamespaceSchemaLocation; SecurityManager* fSecurityManager; XMLReader::XMLVersion fXMLVersion; MemoryManager* fMemoryManager; XMLBufferMgr fBufMgr; XMLBuffer fAttNameBuf; XMLBuffer fAttValueBuf; XMLBuffer fCDataBuf; XMLBuffer fQNameBuf; XMLBuffer fPrefixBuf; XMLBuffer fURIBuf; XMLBuffer fWSNormalizeBuf; ElemStack fElemStack; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLScanner(); XMLScanner(const XMLScanner&); XMLScanner& operator=(const XMLScanner&); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void commonInit(); void cleanUp(); // ----------------------------------------------------------------------- // Private scanning methods // ----------------------------------------------------------------------- bool getQuotedString(XMLBuffer& toFill); XMLSize_t scanUpToWSOr ( XMLBuffer& toFill , const XMLCh chEndChar ); }; // --------------------------------------------------------------------------- // XMLScanner: Getter methods // --------------------------------------------------------------------------- inline const XMLDocumentHandler* XMLScanner::getDocHandler() const { return fDocHandler; } inline XMLDocumentHandler* XMLScanner::getDocHandler() { return fDocHandler; } inline const DocTypeHandler* XMLScanner::getDocTypeHandler() const { return fDocTypeHandler; } inline DocTypeHandler* XMLScanner::getDocTypeHandler() { return fDocTypeHandler; } inline bool XMLScanner::getDoNamespaces() const { return fDoNamespaces; } inline const XMLEntityHandler* XMLScanner::getEntityHandler() const { return fEntityHandler; } inline XMLEntityHandler* XMLScanner::getEntityHandler() { return fEntityHandler; } inline const XMLErrorReporter* XMLScanner::getErrorReporter() const { return fErrorReporter; } inline XMLErrorReporter* XMLScanner::getErrorReporter() { return fErrorReporter; } inline const ErrorHandler* XMLScanner::getErrorHandler() const { return fErrorHandler; } inline ErrorHandler* XMLScanner::getErrorHandler() { return fErrorHandler; } inline const PSVIHandler* XMLScanner::getPSVIHandler() const { return fPSVIHandler; } inline PSVIHandler* XMLScanner::getPSVIHandler() { return fPSVIHandler; } inline bool XMLScanner::getExitOnFirstFatal() const { return fExitOnFirstFatal; } inline bool XMLScanner::getValidationConstraintFatal() const { return fValidationConstraintFatal; } inline bool XMLScanner::getInException() const { return fInException; } inline RefHashTableOf* XMLScanner::getIDRefList() { return fValidationContext->getIdRefList(); } inline const RefHashTableOf* XMLScanner::getIDRefList() const { return fValidationContext->getIdRefList(); } inline ValidationContext* XMLScanner::getValidationContext() { if (!fEntityDeclPoolRetrieved) { fValidationContext->setEntityDeclPool(getEntityDeclPool()); fEntityDeclPoolRetrieved = true; } return fValidationContext; } inline const Locator* XMLScanner::getLocator() const { return &fReaderMgr; } inline const ReaderMgr* XMLScanner::getReaderMgr() const { return &fReaderMgr; } inline XMLFilePos XMLScanner::getSrcOffset() const { return fReaderMgr.getSrcOffset(); } inline bool XMLScanner::getStandalone() const { return fStandalone; } inline XMLScanner::ValSchemes XMLScanner::getValidationScheme() const { return fValScheme; } inline const XMLValidator* XMLScanner::getValidator() const { return fValidator; } inline XMLValidator* XMLScanner::getValidator() { return fValidator; } inline bool XMLScanner::getDoSchema() const { return fDoSchema; } inline bool XMLScanner::getValidationSchemaFullChecking() const { return fSchemaFullChecking; } inline bool XMLScanner::getIdentityConstraintChecking() const { return fIdentityConstraintChecking; } inline int XMLScanner::getErrorCount() { return fErrorCount; } inline bool XMLScanner::isValidatorFromUser() { return fValidatorFromUser; } inline unsigned int XMLScanner::getEmptyNamespaceId() const { return fEmptyNamespaceId; } inline unsigned int XMLScanner::getUnknownNamespaceId() const { return fUnknownNamespaceId; } inline unsigned int XMLScanner::getXMLNamespaceId() const { return fXMLNamespaceId; } inline unsigned int XMLScanner::getXMLNSNamespaceId() const { return fXMLNSNamespaceId; } inline const XMLStringPool* XMLScanner::getURIStringPool() const { return fURIStringPool; } inline XMLStringPool* XMLScanner::getURIStringPool() { return fURIStringPool; } inline bool XMLScanner::getHasNoDTD() const { return fHasNoDTD; } inline XMLCh* XMLScanner::getExternalSchemaLocation() const { return fExternalSchemaLocation; } inline XMLCh* XMLScanner::getExternalNoNamespaceSchemaLocation() const { return fExternalNoNamespaceSchemaLocation; } inline SecurityManager* XMLScanner::getSecurityManager() const { return fSecurityManager; } inline bool XMLScanner::getDisallowDTD() const { return fDisallowDTD; } inline bool XMLScanner::getLoadExternalDTD() const { return fLoadExternalDTD; } inline bool XMLScanner::getLoadSchema() const { return fLoadSchema; } inline bool XMLScanner::getNormalizeData() const { return fNormalizeData; } inline bool XMLScanner::isCachingGrammarFromParse() const { return fToCacheGrammar; } inline bool XMLScanner::isUsingCachedGrammarInParse() const { return fUseCachedGrammar; } inline bool XMLScanner::getCalculateSrcOfs() const { return fCalculateSrcOfs; } inline Grammar* XMLScanner::getRootGrammar() const { return fRootGrammar; } inline bool XMLScanner::getStandardUriConformant() const { return fStandardUriConformant; } inline XMLReader::XMLVersion XMLScanner::getXMLVersion() const { return fXMLVersion; } inline MemoryManager* XMLScanner::getMemoryManager() const { return fMemoryManager; } inline ValueVectorOf* XMLScanner::getNamespaceContext() const { return fElemStack.getNamespaceMap(); } inline unsigned int XMLScanner::getPrefixId(const XMLCh* const prefix) const { return fElemStack.getPrefixId(prefix); } inline const XMLCh* XMLScanner::getPrefixForId(unsigned int prefId) const { return fElemStack.getPrefixForId(prefId); } inline bool XMLScanner::getGenerateSyntheticAnnotations() const { return fGenerateSyntheticAnnotations; } inline bool XMLScanner::getValidateAnnotations() const { return fValidateAnnotations; } inline const XMLSize_t& XMLScanner::getLowWaterMark() const { return fLowWaterMark; } inline bool XMLScanner::getIgnoreCachedDTD() const { return fIgnoreCachedDTD; } inline bool XMLScanner::getIgnoreAnnotations() const { return fIgnoreAnnotations; } inline bool XMLScanner::getDisableDefaultEntityResolution() const { return fDisableDefaultEntityResolution; } inline bool XMLScanner::getSkipDTDValidation() const { return fSkipDTDValidation; } inline bool XMLScanner::getHandleMultipleImports() const { return fHandleMultipleImports; } // --------------------------------------------------------------------------- // XMLScanner: Setter methods // --------------------------------------------------------------------------- inline void XMLScanner::addGlobalPrefix(const XMLCh* const prefix, const unsigned int uriId) { fElemStack.addGlobalPrefix(prefix, uriId); } inline void XMLScanner::setDocHandler(XMLDocumentHandler* const docHandler) { fDocHandler = docHandler; } inline void XMLScanner::setDocTypeHandler(DocTypeHandler* const docTypeHandler) { fDocTypeHandler = docTypeHandler; } inline void XMLScanner::setErrorHandler(ErrorHandler* const handler) { fErrorHandler = handler; } inline void XMLScanner::setPSVIHandler(PSVIHandler* const handler) { fPSVIHandler = handler; } inline void XMLScanner::setEntityHandler(XMLEntityHandler* const entityHandler) { fEntityHandler = entityHandler; fReaderMgr.setEntityHandler(entityHandler); } inline void XMLScanner::setErrorReporter(XMLErrorReporter* const errHandler) { fErrorReporter = errHandler; } inline void XMLScanner::setExitOnFirstFatal(const bool newValue) { fExitOnFirstFatal = newValue; } inline void XMLScanner::setValidationConstraintFatal(const bool newValue) { fValidationConstraintFatal = newValue; } inline void XMLScanner::setValidationScheme(const ValSchemes newScheme) { fValScheme = newScheme; // validation flag for Val_Auto is set to false by default, // and will be turned to true if a grammar is seen if (fValScheme == Val_Always) fValidate = true; else fValidate = false; } inline void XMLScanner::setDoSchema(const bool doSchema) { fDoSchema = doSchema; } inline void XMLScanner::setDoNamespaces(const bool doNamespaces) { fDoNamespaces = doNamespaces; } inline void XMLScanner::setValidationSchemaFullChecking(const bool schemaFullChecking) { fSchemaFullChecking = schemaFullChecking; } inline void XMLScanner::setIdentityConstraintChecking(const bool identityConstraintChecking) { fIdentityConstraintChecking = identityConstraintChecking; } inline void XMLScanner::setHasNoDTD(const bool hasNoDTD) { fHasNoDTD = hasNoDTD; } inline void XMLScanner::setRootElemName(XMLCh* rootElemName) { fMemoryManager->deallocate(fRootElemName);//delete [] fRootElemName; fRootElemName = XMLString::replicate(rootElemName, fMemoryManager); } inline void XMLScanner::setExternalSchemaLocation(const XMLCh* const schemaLocation) { fMemoryManager->deallocate(fExternalSchemaLocation);//delete [] fExternalSchemaLocation; fExternalSchemaLocation = XMLString::replicate(schemaLocation, fMemoryManager); } inline void XMLScanner::setExternalNoNamespaceSchemaLocation(const XMLCh* const noNamespaceSchemaLocation) { fMemoryManager->deallocate(fExternalNoNamespaceSchemaLocation);//delete [] fExternalNoNamespaceSchemaLocation; fExternalNoNamespaceSchemaLocation = XMLString::replicate(noNamespaceSchemaLocation, fMemoryManager); } inline void XMLScanner::setExternalSchemaLocation(const char* const schemaLocation) { fMemoryManager->deallocate(fExternalSchemaLocation);//delete [] fExternalSchemaLocation; fExternalSchemaLocation = XMLString::transcode(schemaLocation, fMemoryManager); } inline void XMLScanner::setExternalNoNamespaceSchemaLocation(const char* const noNamespaceSchemaLocation) { fMemoryManager->deallocate(fExternalNoNamespaceSchemaLocation);//delete [] fExternalNoNamespaceSchemaLocation; fExternalNoNamespaceSchemaLocation = XMLString::transcode(noNamespaceSchemaLocation, fMemoryManager); } inline void XMLScanner::setSecurityManager(SecurityManager* const securityManager) { fSecurityManager = securityManager; if(securityManager != 0) { fEntityExpansionLimit = securityManager->getEntityExpansionLimit(); fEntityExpansionCount = 0; } } inline void XMLScanner::setDisallowDTD(const bool disallowDTD) { fDisallowDTD = disallowDTD; } inline void XMLScanner::setLoadExternalDTD(const bool loadDTD) { fLoadExternalDTD = loadDTD; } inline void XMLScanner::setLoadSchema(const bool loadSchema) { fLoadSchema = loadSchema; } inline void XMLScanner::setNormalizeData(const bool normalizeData) { fNormalizeData = normalizeData; } inline void XMLScanner::cacheGrammarFromParse(const bool newValue) { fToCacheGrammar = newValue; } inline void XMLScanner::useCachedGrammarInParse(const bool newValue) { fUseCachedGrammar = newValue; } inline void XMLScanner::setCalculateSrcOfs(const bool newValue) { fCalculateSrcOfs = newValue; } inline void XMLScanner::setStandardUriConformant(const bool newValue) { fStandardUriConformant = newValue; fReaderMgr.setStandardUriConformant(newValue); } inline void XMLScanner::setGenerateSyntheticAnnotations(const bool newValue) { fGenerateSyntheticAnnotations = newValue; } inline void XMLScanner::setValidateAnnotations(const bool newValue) { fValidateAnnotations = newValue; } inline void XMLScanner::setInputBufferSize(const XMLSize_t bufferSize) { fBufferSize = bufferSize; fCDataBuf.setFullHandler(this, fBufferSize); } inline void XMLScanner::setLowWaterMark(XMLSize_t newValue) { fLowWaterMark = newValue; } inline void XMLScanner::setIgnoredCachedDTD(const bool newValue) { fIgnoreCachedDTD = newValue; } inline void XMLScanner::setIgnoreAnnotations(const bool newValue) { fIgnoreAnnotations = newValue; } inline void XMLScanner::setDisableDefaultEntityResolution(const bool newValue) { fDisableDefaultEntityResolution = newValue; } inline void XMLScanner::setSkipDTDValidation(const bool newValue) { fSkipDTDValidation = newValue; } inline void XMLScanner::setHandleMultipleImports(const bool newValue) { fHandleMultipleImports = newValue; } // --------------------------------------------------------------------------- // XMLScanner: Mutator methods // --------------------------------------------------------------------------- inline void XMLScanner::incrementErrorCount() { ++fErrorCount; } inline void XMLScanner::resetValidationContext() { fValidationContext->clearIdRefList(); fValidationContext->setEntityDeclPool(0); fEntityDeclPoolRetrieved = false; } inline void XMLScanner::setAttrDupChkRegistry(const XMLSize_t &attrNumber , bool &toUseHashTable) { // once the attribute exceed 100, we use hash table to check duplication if (attrNumber > 100) { toUseHashTable = true; if (!fAttrDupChkRegistry) { fAttrDupChkRegistry = new (fMemoryManager) RefHash2KeysTableOf ( 2*attrNumber+1, false, fMemoryManager ); } else { fAttrDupChkRegistry->removeAll(); } } } inline Grammar::GrammarType XMLScanner::getCurrentGrammarType() const { return Grammar::UnKnown; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/ElemStack.cpp000644 000765 000024 00000072043 13241160334 022461 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ElemStack.cpp 830538 2009-10-28 13:41:11Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // ElemStack: Constructors and Destructor // --------------------------------------------------------------------------- ElemStack::ElemStack(MemoryManager* const manager) : fEmptyNamespaceId(0) , fGlobalPoolId(0) , fPrefixPool(109, manager) , fGlobalNamespaces(0) , fStack(0) , fStackCapacity(32) , fStackTop(0) , fUnknownNamespaceId(0) , fXMLNamespaceId(0) , fXMLPoolId(0) , fXMLNSNamespaceId(0) , fXMLNSPoolId(0) , fNamespaceMap(0) , fMemoryManager(manager) { // Do an initial allocation of the stack and zero it out fStack = (StackElem**) fMemoryManager->allocate ( fStackCapacity * sizeof(StackElem*) );//new StackElem*[fStackCapacity]; memset(fStack, 0, fStackCapacity * sizeof(StackElem*)); fNamespaceMap = new (fMemoryManager) ValueVectorOf(16, fMemoryManager); } ElemStack::~ElemStack() { if(fGlobalNamespaces) { fMemoryManager->deallocate(fGlobalNamespaces->fMap); delete fGlobalNamespaces; } // // Start working from the bottom of the stack and clear it out as we // go up. Once we hit an uninitialized one, we can break out. // for (XMLSize_t stackInd = 0; stackInd < fStackCapacity; stackInd++) { // If this entry has been set, then lets clean it up if (!fStack[stackInd]) break; fMemoryManager->deallocate(fStack[stackInd]->fChildren);//delete [] fStack[stackInd]->fChildren; fMemoryManager->deallocate(fStack[stackInd]->fMap);//delete [] fStack[stackInd]->fMap; fMemoryManager->deallocate(fStack[stackInd]->fSchemaElemName); delete fStack[stackInd]; } // Delete the stack array itself now fMemoryManager->deallocate(fStack);//delete [] fStack; delete fNamespaceMap; } // --------------------------------------------------------------------------- // ElemStack: Stack access // --------------------------------------------------------------------------- XMLSize_t ElemStack::addLevel() { // See if we need to expand the stack if (fStackTop == fStackCapacity) expandStack(); // If this element has not been initialized yet, then initialize it if (!fStack[fStackTop]) { fStack[fStackTop] = new (fMemoryManager) StackElem; fStack[fStackTop]->fChildCapacity = 0; fStack[fStackTop]->fChildren = 0; fStack[fStackTop]->fMapCapacity = 0; fStack[fStackTop]->fMap = 0; fStack[fStackTop]->fSchemaElemName = 0; fStack[fStackTop]->fSchemaElemNameMaxLen = 0; } // Set up the new top row fStack[fStackTop]->fThisElement = 0; fStack[fStackTop]->fReaderNum = 0xFFFFFFFF; fStack[fStackTop]->fChildCount = 0; fStack[fStackTop]->fMapCount = 0; fStack[fStackTop]->fValidationFlag = false; fStack[fStackTop]->fCommentOrPISeen = false; fStack[fStackTop]->fReferenceEscaped = false; fStack[fStackTop]->fCurrentURI = fUnknownNamespaceId; fStack[fStackTop]->fCurrentScope = Grammar::TOP_LEVEL_SCOPE; fStack[fStackTop]->fCurrentGrammar = 0; // Bump the top of stack fStackTop++; return fStackTop-1; } XMLSize_t ElemStack::addLevel(XMLElementDecl* const toSet, const XMLSize_t readerNum) { // See if we need to expand the stack if (fStackTop == fStackCapacity) expandStack(); // If this element has not been initialized yet, then initialize it if (!fStack[fStackTop]) { fStack[fStackTop] = new (fMemoryManager) StackElem; fStack[fStackTop]->fChildCapacity = 0; fStack[fStackTop]->fChildren = 0; fStack[fStackTop]->fMapCapacity = 0; fStack[fStackTop]->fMap = 0; fStack[fStackTop]->fSchemaElemName = 0; fStack[fStackTop]->fSchemaElemNameMaxLen = 0; } // Set up the new top row fStack[fStackTop]->fThisElement = toSet; fStack[fStackTop]->fReaderNum = readerNum; fStack[fStackTop]->fChildCount = 0; fStack[fStackTop]->fMapCount = 0; fStack[fStackTop]->fValidationFlag = false; fStack[fStackTop]->fCommentOrPISeen = false; fStack[fStackTop]->fReferenceEscaped = false; fStack[fStackTop]->fCurrentURI = fUnknownNamespaceId; fStack[fStackTop]->fCurrentScope = Grammar::TOP_LEVEL_SCOPE; fStack[fStackTop]->fCurrentGrammar = 0; // Bump the top of stack fStackTop++; return fStackTop-1; } const ElemStack::StackElem* ElemStack::popTop() { // Watch for an underflow error if (!fStackTop) ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::ElemStack_StackUnderflow, fMemoryManager); fStackTop--; return fStack[fStackTop]; } void ElemStack::setElement(XMLElementDecl* const toSet, const XMLSize_t readerNum) { if (!fStackTop) ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::ElemStack_EmptyStack, fMemoryManager); fStack[fStackTop - 1]->fThisElement = toSet; fStack[fStackTop - 1]->fReaderNum = readerNum; } // --------------------------------------------------------------------------- // ElemStack: Stack top access // --------------------------------------------------------------------------- XMLSize_t ElemStack::addChild(QName* const child, const bool toParent) { if (!fStackTop) ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::ElemStack_EmptyStack, fMemoryManager); // // If they want to add to the parent, then we have to have at least two // elements on the stack. // if (toParent && (fStackTop < 2)) ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::ElemStack_NoParentPushed, fMemoryManager); // Get a convenience pointer to the stack top row StackElem* curRow = toParent ? fStack[fStackTop - 2] : fStack[fStackTop - 1]; // See if we need to expand this row's child array if (curRow->fChildCount == curRow->fChildCapacity) { // Increase the capacity by a quarter and allocate a new row const XMLSize_t newCapacity = curRow->fChildCapacity ? (XMLSize_t)(curRow->fChildCapacity * 1.25) : 32; QName** newRow = (QName**) fMemoryManager->allocate ( newCapacity * sizeof(QName*) );//new QName*[newCapacity]; // // Copy over the old contents. We don't have to initialize the new // part because The current child count is used to know how much of // it is valid. // // Only both doing this if there is any current content, since // this code also does the initial faulting in of the array when // both the current capacity and child count are zero. // for (XMLSize_t index = 0; index < curRow->fChildCount; index++) newRow[index] = curRow->fChildren[index]; // Clean up the old children and store the new info fMemoryManager->deallocate(curRow->fChildren);//delete [] curRow->fChildren; curRow->fChildren = newRow; curRow->fChildCapacity = newCapacity; } // Add this id to the end of the row's child id array and bump the count curRow->fChildren[curRow->fChildCount++] = child; // Return the level of the index we just filled (before the bump) return curRow->fChildCount - 1; } const ElemStack::StackElem* ElemStack::topElement() const { if (!fStackTop) ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::ElemStack_EmptyStack, fMemoryManager); return fStack[fStackTop - 1]; } // --------------------------------------------------------------------------- // ElemStack: Prefix map methods // --------------------------------------------------------------------------- void ElemStack::addGlobalPrefix(const XMLCh* const prefixToAdd , const unsigned int uriId) { if (!fGlobalNamespaces) { fGlobalNamespaces = new (fMemoryManager) StackElem; fGlobalNamespaces->fChildCapacity = 0; fGlobalNamespaces->fChildren = 0; fGlobalNamespaces->fMapCapacity = 0; fGlobalNamespaces->fMap = 0; fGlobalNamespaces->fMapCount = 0; fGlobalNamespaces->fSchemaElemName = 0; fGlobalNamespaces->fSchemaElemNameMaxLen = 0; fGlobalNamespaces->fThisElement = 0; fGlobalNamespaces->fReaderNum = 0xFFFFFFFF; fGlobalNamespaces->fChildCount = 0; fGlobalNamespaces->fValidationFlag = false; fGlobalNamespaces->fCommentOrPISeen = false; fGlobalNamespaces->fReferenceEscaped = false; fGlobalNamespaces->fCurrentURI = fUnknownNamespaceId; fGlobalNamespaces->fCurrentScope = Grammar::TOP_LEVEL_SCOPE; fGlobalNamespaces->fCurrentGrammar = 0; } // Map the prefix to its unique id const unsigned int prefId = fPrefixPool.addOrFind(prefixToAdd); // // Add a new element to the prefix map for this element. If its full, // then expand it out. // if (fGlobalNamespaces->fMapCount == fGlobalNamespaces->fMapCapacity) expandMap(fGlobalNamespaces); // // And now add a new element for this prefix. Watch for the special case // of xmlns=="", and force it to ""=[globalid] // fGlobalNamespaces->fMap[fGlobalNamespaces->fMapCount].fPrefId = prefId; if ((prefId == fGlobalPoolId) && (uriId == fEmptyNamespaceId)) fGlobalNamespaces->fMap[fGlobalNamespaces->fMapCount].fURIId = fEmptyNamespaceId; else fGlobalNamespaces->fMap[fGlobalNamespaces->fMapCount].fURIId = uriId; // Bump the map count now fGlobalNamespaces->fMapCount++; } void ElemStack::addPrefix( const XMLCh* const prefixToAdd , const unsigned int uriId) { if (!fStackTop) ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::ElemStack_EmptyStack, fMemoryManager); // Get a convenience pointer to the stack top row StackElem* curRow = fStack[fStackTop - 1]; // Map the prefix to its unique id const unsigned int prefId = fPrefixPool.addOrFind(prefixToAdd); // // Add a new element to the prefix map for this element. If its full, // then expand it out. // if (curRow->fMapCount == curRow->fMapCapacity) expandMap(curRow); // // And now add a new element for this prefix. Watch for the special case // of xmlns=="", and force it to ""=[globalid] // curRow->fMap[curRow->fMapCount].fPrefId = prefId; if ((prefId == fGlobalPoolId) && (uriId == fEmptyNamespaceId)) curRow->fMap[curRow->fMapCount].fURIId = fEmptyNamespaceId; else curRow->fMap[curRow->fMapCount].fURIId = uriId; // Bump the map count now curRow->fMapCount++; } unsigned int ElemStack::mapPrefixToURI( const XMLCh* const prefixToMap , bool& unknown) const { // Assume we find it unknown = false; // // Map the prefix to its unique id, from the prefix string pool. If its // not a valid prefix, then its a failure. // unsigned int prefixId = (!prefixToMap || !*prefixToMap)?fGlobalPoolId : fPrefixPool.getId(prefixToMap); if (prefixId == 0) { unknown = true; return fUnknownNamespaceId; } // // Check for the special prefixes 'xml' and 'xmlns' since they cannot // be overridden. // else if (prefixId == fXMLPoolId) return fXMLNamespaceId; else if (prefixId == fXMLNSPoolId) return fXMLNSNamespaceId; // // Start at the stack top and work backwards until we come to some // element that mapped this prefix. // for (XMLSize_t index = fStackTop; index > 0; index--) { // Get a convenience pointer to the current element StackElem* curRow = fStack[index-1]; // Search the map at this level for the passed prefix for (XMLSize_t mapIndex = 0; mapIndex < curRow->fMapCount; mapIndex++) { if (curRow->fMap[mapIndex].fPrefId == prefixId) return curRow->fMap[mapIndex].fURIId; } } // If the prefix wasn't found, try in the global namespaces if(fGlobalNamespaces) { for (XMLSize_t mapIndex = 0; mapIndex < fGlobalNamespaces->fMapCount; mapIndex++) { if (fGlobalNamespaces->fMap[mapIndex].fPrefId == prefixId) return fGlobalNamespaces->fMap[mapIndex].fURIId; } } // // If the prefix is an empty string, then we will return the special // global namespace id. This can be overridden, but no one has or we // would have not gotten here. // if (!*prefixToMap) return fEmptyNamespaceId; // Oh well, don't have a clue so return the unknown id unknown = true; return fUnknownNamespaceId; } ValueVectorOf* ElemStack::getNamespaceMap() const { fNamespaceMap->removeAllElements(); // Start at the stack top and work backwards until we come to some // element that mapped this prefix. for (XMLSize_t index = fStackTop; index > 0; index--) { // Get a convenience pointer to the current element StackElem* curRow = fStack[index-1]; // If no prefixes mapped at this level, then go the next one if (!curRow->fMapCount) continue; // Search the map at this level for the passed prefix for (XMLSize_t mapIndex = 0; mapIndex < curRow->fMapCount; mapIndex++) fNamespaceMap->addElement(&(curRow->fMap[mapIndex])); } // Add the global namespaces if(fGlobalNamespaces) { for (XMLSize_t mapIndex = 0; mapIndex < fGlobalNamespaces->fMapCount; mapIndex++) fNamespaceMap->addElement(&(fGlobalNamespaces->fMap[mapIndex])); } return fNamespaceMap; } // --------------------------------------------------------------------------- // ElemStack: Miscellaneous methods // --------------------------------------------------------------------------- void ElemStack::reset( const unsigned int emptyId , const unsigned int unknownId , const unsigned int xmlId , const unsigned int xmlNSId) { if(fGlobalNamespaces) { fMemoryManager->deallocate(fGlobalNamespaces->fMap); delete fGlobalNamespaces; fGlobalNamespaces = 0; } // Reset the stack top to clear the stack fStackTop = 0; // if first time, put in the standard prefixes if (fXMLPoolId == 0) { fGlobalPoolId = fPrefixPool.addOrFind(XMLUni::fgZeroLenString); fXMLPoolId = fPrefixPool.addOrFind(XMLUni::fgXMLString); fXMLNSPoolId = fPrefixPool.addOrFind(XMLUni::fgXMLNSString); } // And store the new special URI ids fEmptyNamespaceId = emptyId; fUnknownNamespaceId = unknownId; fXMLNamespaceId = xmlId; fXMLNSNamespaceId = xmlNSId; } // --------------------------------------------------------------------------- // ElemStack: Private helpers // --------------------------------------------------------------------------- void ElemStack::expandMap(StackElem* const toExpand) { // For convenience get the old map size const XMLSize_t oldCap = toExpand->fMapCapacity; // // Expand the capacity by 25%, or initialize it to 16 if its currently // empty. Then allocate a new temp buffer. // const XMLSize_t newCapacity = oldCap ? (XMLSize_t )(oldCap * 1.25) : 16; PrefMapElem* newMap = (PrefMapElem*) fMemoryManager->allocate ( newCapacity * sizeof(PrefMapElem) );//new PrefMapElem[newCapacity]; // // Copy over the old stuff. We DON'T have to zero out the new stuff // since this is a by value map and the current map index controls what // is relevant. // memcpy(newMap, toExpand->fMap, oldCap * sizeof(PrefMapElem)); // Delete the old map and store the new stuff fMemoryManager->deallocate(toExpand->fMap);//delete [] toExpand->fMap; toExpand->fMap = newMap; toExpand->fMapCapacity = newCapacity; } void ElemStack::expandStack() { // Expand the capacity by 25% and allocate a new buffer const XMLSize_t newCapacity = (XMLSize_t)(fStackCapacity * 1.25); StackElem** newStack = (StackElem**) fMemoryManager->allocate ( newCapacity * sizeof(StackElem*) );//new StackElem*[newCapacity]; // Copy over the old stuff memcpy(newStack, fStack, fStackCapacity * sizeof(StackElem*)); // // And zero out the new stuff. Though we use a stack top, we reuse old // stack contents so we need to know if elements have been initially // allocated or not as we push new stuff onto the stack. // memset ( &newStack[fStackCapacity] , 0 , (newCapacity - fStackCapacity) * sizeof(StackElem*) ); // Delete the old array and update our members fMemoryManager->deallocate(fStack);//delete [] fStack; fStack = newStack; fStackCapacity = newCapacity; } // --------------------------------------------------------------------------- // WFElemStack: Constructors and Destructor // --------------------------------------------------------------------------- WFElemStack::WFElemStack(MemoryManager* const manager) : fEmptyNamespaceId(0) , fGlobalPoolId(0) , fStackCapacity(32) , fStackTop(0) , fUnknownNamespaceId(0) , fXMLNamespaceId(0) , fXMLPoolId(0) , fXMLNSNamespaceId(0) , fXMLNSPoolId(0) , fMapCapacity(0) , fMap(0) , fStack(0) , fPrefixPool(109, manager) , fMemoryManager(manager) { // Do an initial allocation of the stack and zero it out fStack = (StackElem**) fMemoryManager->allocate ( fStackCapacity * sizeof(StackElem*) );//new StackElem*[fStackCapacity]; memset(fStack, 0, fStackCapacity * sizeof(StackElem*)); } WFElemStack::~WFElemStack() { // // Start working from the bottom of the stack and clear it out as we // go up. Once we hit an uninitialized one, we can break out. // for (XMLSize_t stackInd = 0; stackInd < fStackCapacity; stackInd++) { // If this entry has been set, then lets clean it up if (!fStack[stackInd]) break; fMemoryManager->deallocate(fStack[stackInd]->fThisElement);//delete [] fStack[stackInd]->fThisElement; delete fStack[stackInd]; } if (fMap) fMemoryManager->deallocate(fMap);//delete [] fMap; // Delete the stack array itself now fMemoryManager->deallocate(fStack);//delete [] fStack; } // --------------------------------------------------------------------------- // WFElemStack: Stack access // --------------------------------------------------------------------------- XMLSize_t WFElemStack::addLevel() { // See if we need to expand the stack if (fStackTop == fStackCapacity) expandStack(); // If this element has not been initialized yet, then initialize it if (!fStack[fStackTop]) { fStack[fStackTop] = new (fMemoryManager) StackElem; fStack[fStackTop]->fThisElement = 0; fStack[fStackTop]->fElemMaxLength = 0; } // Set up the new top row fStack[fStackTop]->fReaderNum = 0xFFFFFFFF; fStack[fStackTop]->fCurrentURI = fUnknownNamespaceId; fStack[fStackTop]->fTopPrefix = -1; if (fStackTop != 0) fStack[fStackTop]->fTopPrefix = fStack[fStackTop - 1]->fTopPrefix; // Bump the top of stack fStackTop++; return fStackTop-1; } XMLSize_t WFElemStack::addLevel(const XMLCh* const toSet, const unsigned int toSetLen, const unsigned int readerNum) { // See if we need to expand the stack if (fStackTop == fStackCapacity) expandStack(); // If this element has not been initialized yet, then initialize it if (!fStack[fStackTop]) { fStack[fStackTop] = new (fMemoryManager) StackElem; fStack[fStackTop]->fThisElement = 0; fStack[fStackTop]->fElemMaxLength = 0; } // Set up the new top row fStack[fStackTop]->fCurrentURI = fUnknownNamespaceId; fStack[fStackTop]->fTopPrefix = -1; // And store the new stuff if (toSetLen > fStack[fStackTop]->fElemMaxLength) { fMemoryManager->deallocate(fStack[fStackTop]->fThisElement);//delete [] fStack[fStackTop]->fThisElement; fStack[fStackTop]->fElemMaxLength = toSetLen; fStack[fStackTop]->fThisElement = (XMLCh*) fMemoryManager->allocate ( (toSetLen + 1) * sizeof(XMLCh) );//new XMLCh[toSetLen + 1]; } XMLString::moveChars(fStack[fStackTop]->fThisElement, toSet, toSetLen + 1); fStack[fStackTop]->fReaderNum = readerNum; if (fStackTop != 0) fStack[fStackTop]->fTopPrefix = fStack[fStackTop - 1]->fTopPrefix; // Bump the top of stack fStackTop++; return fStackTop-1; } const WFElemStack::StackElem* WFElemStack::popTop() { // Watch for an underflow error if (!fStackTop) ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::ElemStack_StackUnderflow, fMemoryManager); fStackTop--; return fStack[fStackTop]; } void WFElemStack::setElement(const XMLCh* const toSet, const unsigned int toSetLen, const unsigned int readerNum) { if (!fStackTop) ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::ElemStack_EmptyStack, fMemoryManager); if (toSetLen > fStack[fStackTop - 1]->fElemMaxLength) { fMemoryManager->deallocate(fStack[fStackTop - 1]->fThisElement);//delete [] fStack[fStackTop - 1]->fThisElement; fStack[fStackTop - 1]->fElemMaxLength = toSetLen; fStack[fStackTop - 1]->fThisElement = (XMLCh*) fMemoryManager->allocate ( (toSetLen + 1) * sizeof(XMLCh) );//new XMLCh[toSetLen + 1]; } XMLString::moveChars(fStack[fStackTop - 1]->fThisElement, toSet, toSetLen + 1); fStack[fStackTop - 1]->fReaderNum = readerNum; } // --------------------------------------------------------------------------- // WFElemStack: Stack top access // --------------------------------------------------------------------------- const WFElemStack::StackElem* WFElemStack::topElement() const { if (!fStackTop) ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::ElemStack_EmptyStack, fMemoryManager); return fStack[fStackTop - 1]; } // --------------------------------------------------------------------------- // WFElemStack: Prefix map methods // --------------------------------------------------------------------------- void WFElemStack::addPrefix( const XMLCh* const prefixToAdd , const unsigned int uriId) { if (!fStackTop) ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::ElemStack_EmptyStack, fMemoryManager); // Get a convenience pointer to the stack top row StackElem* curRow = fStack[fStackTop - 1]; // Map the prefix to its unique id const unsigned int prefId = fPrefixPool.addOrFind(prefixToAdd); // // Add a new element to the prefix map for this element. If its full, // then expand it out. // if ((unsigned int)curRow->fTopPrefix + 1 == fMapCapacity) expandMap(); // // And now add a new element for this prefix. Watch for the special case // of xmlns=="", and force it to ""=[globalid] // fMap[curRow->fTopPrefix + 1].fPrefId = prefId; if ((prefId == fGlobalPoolId) && (uriId == fEmptyNamespaceId)) fMap[curRow->fTopPrefix + 1].fURIId = fEmptyNamespaceId; else fMap[curRow->fTopPrefix + 1].fURIId = uriId; // Bump the map count now curRow->fTopPrefix++; } unsigned int WFElemStack::mapPrefixToURI( const XMLCh* const prefixToMap , bool& unknown) const { // Assume we find it unknown = false; // // Map the prefix to its unique id, from the prefix string pool. If its // not a valid prefix, then its a failure. // unsigned int prefixId = fPrefixPool.getId(prefixToMap); if (!prefixId) { unknown = true; return fUnknownNamespaceId; } // // Check for the special prefixes 'xml' and 'xmlns' since they cannot // be overridden. // if (prefixId == fXMLPoolId) return fXMLNamespaceId; else if (prefixId == fXMLNSPoolId) return fXMLNSNamespaceId; // // Start at the stack top and work backwards until we come to some // element that mapped this prefix. // // Get a convenience pointer to the stack top row StackElem* curRow = fStack[fStackTop - 1]; for (int mapIndex = curRow->fTopPrefix; mapIndex >=0; mapIndex--) { if (fMap[mapIndex].fPrefId == prefixId) return fMap[mapIndex].fURIId; } // // If the prefix is an empty string, then we will return the special // global namespace id. This can be overridden, but no one has or we // would have not gotten here. // if (!*prefixToMap) return fEmptyNamespaceId; // Oh well, don't have a clue so return the unknown id unknown = true; return fUnknownNamespaceId; } // --------------------------------------------------------------------------- // WFElemStack: Miscellaneous methods // --------------------------------------------------------------------------- void WFElemStack::reset( const unsigned int emptyId , const unsigned int unknownId , const unsigned int xmlId , const unsigned int xmlNSId) { // Reset the stack top to clear the stack fStackTop = 0; // if first time, put in the standard prefixes if (fXMLPoolId == 0) { fGlobalPoolId = fPrefixPool.addOrFind(XMLUni::fgZeroLenString); fXMLPoolId = fPrefixPool.addOrFind(XMLUni::fgXMLString); fXMLNSPoolId = fPrefixPool.addOrFind(XMLUni::fgXMLNSString); } // And store the new special URI ids fEmptyNamespaceId = emptyId; fUnknownNamespaceId = unknownId; fXMLNamespaceId = xmlId; fXMLNSNamespaceId = xmlNSId; } // --------------------------------------------------------------------------- // WFElemStack: Private helpers // --------------------------------------------------------------------------- void WFElemStack::expandMap() { // // Expand the capacity by 25%, or initialize it to 16 if its currently // empty. Then allocate a new temp buffer. // const XMLSize_t newCapacity = fMapCapacity ? (XMLSize_t)(fMapCapacity * 1.25) : 16; PrefMapElem* newMap = (PrefMapElem*) fMemoryManager->allocate ( newCapacity * sizeof(PrefMapElem) );//new PrefMapElem[newCapacity]; // // Copy over the old stuff. We DON'T have to zero out the new stuff // since this is a by value map and the current map index controls what // is relevant. // if (fMapCapacity) { memcpy(newMap, fMap, fMapCapacity * sizeof(PrefMapElem)); fMemoryManager->deallocate(fMap);//delete [] fMap; } fMap = newMap; fMapCapacity = newCapacity; } void WFElemStack::expandStack() { // Expand the capacity by 25% and allocate a new buffer const XMLSize_t newCapacity = (XMLSize_t)(fStackCapacity * 1.25); StackElem** newStack = (StackElem**) fMemoryManager->allocate ( newCapacity * sizeof(StackElem*) );//new StackElem*[newCapacity]; // Copy over the old stuff memcpy(newStack, fStack, fStackCapacity * sizeof(StackElem*)); // // And zero out the new stuff. Though we use a stack top, we reuse old // stack contents so we need to know if elements have been initially // allocated or not as we push new stuff onto the stack. // memset ( &newStack[fStackCapacity] , 0 , (newCapacity - fStackCapacity) * sizeof(StackElem*) ); // Delete the old array and update our members fMemoryManager->deallocate(fStack);//delete [] fStack; fStack = newStack; fStackCapacity = newCapacity; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/XMLScannerResolver.cpp000644 000765 000024 00000010352 13241160334 024300 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLScannerResolver.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLScannerResolver: Public static methods // --------------------------------------------------------------------------- XMLScanner* XMLScannerResolver::getDefaultScanner( XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager) { return new (manager) IGXMLScanner(valToAdopt, grammarResolver, manager); } XMLScanner* XMLScannerResolver::resolveScanner( const XMLCh* const scannerName , XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager) { if (XMLString::equals(scannerName, XMLUni::fgWFXMLScanner)) return new (manager) WFXMLScanner(valToAdopt, grammarResolver, manager); else if (XMLString::equals(scannerName, XMLUni::fgIGXMLScanner)) return new (manager) IGXMLScanner(valToAdopt, grammarResolver, manager); else if (XMLString::equals(scannerName, XMLUni::fgSGXMLScanner)) return new (manager) SGXMLScanner(valToAdopt, grammarResolver, manager); else if (XMLString::equals(scannerName, XMLUni::fgDGXMLScanner)) return new (manager) DGXMLScanner(valToAdopt, grammarResolver, manager); // REVISIT: throw an exception or return a default one? return 0; } XMLScanner* XMLScannerResolver::resolveScanner( const XMLCh* const scannerName , XMLDocumentHandler* const docHandler , DocTypeHandler* const docTypeHandler , XMLEntityHandler* const entityHandler , XMLErrorReporter* const errReporter , XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager) { if (XMLString::equals(scannerName, XMLUni::fgWFXMLScanner)) return new (manager) WFXMLScanner(docHandler, docTypeHandler, entityHandler, errReporter, valToAdopt, grammarResolver, manager); else if (XMLString::equals(scannerName, XMLUni::fgIGXMLScanner)) return new (manager) IGXMLScanner(docHandler, docTypeHandler, entityHandler, errReporter, valToAdopt, grammarResolver, manager); else if (XMLString::equals(scannerName, XMLUni::fgSGXMLScanner)) return new (manager) SGXMLScanner(docHandler, docTypeHandler, entityHandler, errReporter, valToAdopt, grammarResolver, manager); else if (XMLString::equals(scannerName, XMLUni::fgDGXMLScanner)) return new (manager) DGXMLScanner(docHandler, docTypeHandler, entityHandler, errReporter, valToAdopt, grammarResolver, manager); // REVISIT: throw an exception or return a default one? return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/SGXMLScanner.hpp000644 000765 000024 00000027434 13241160334 023026 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SGXMLScanner.hpp 882548 2009-11-20 13:44:14Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_SGXMLSCANNER_HPP) #define XERCESC_INCLUDE_GUARD_SGXMLSCANNER_HPP #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class SchemaGrammar; class SchemaValidator; class IdentityConstraintHandler; class IdentityConstraint; class ContentLeafNameTypeVector; class SchemaAttDef; class XMLContentModel; class XSModel; class PSVIAttributeList; class PSVIElement; // This is a scanner class, which process XML Schema grammar. class XMLPARSER_EXPORT SGXMLScanner : public XMLScanner { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- SGXMLScanner ( XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); SGXMLScanner ( XMLDocumentHandler* const docHandler , DocTypeHandler* const docTypeHandler , XMLEntityHandler* const entityHandler , XMLErrorReporter* const errReporter , XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~SGXMLScanner(); // ----------------------------------------------------------------------- // XMLScanner public virtual methods // ----------------------------------------------------------------------- virtual const XMLCh* getName() const; virtual NameIdPool* getEntityDeclPool(); virtual const NameIdPool* getEntityDeclPool() const; virtual void scanDocument ( const InputSource& src ); virtual bool scanNext(XMLPScanToken& toFill); virtual Grammar* loadGrammar ( const InputSource& src , const short grammarType , const bool toCache = false ); virtual void resetCachedGrammar (); virtual Grammar::GrammarType getCurrentGrammarType() const; protected: // ----------------------------------------------------------------------- // XMLScanner virtual methods // ----------------------------------------------------------------------- virtual void scanReset(const InputSource& src); // ----------------------------------------------------------------------- // SGXMLScanner virtual methods // ----------------------------------------------------------------------- virtual bool scanStartTag(bool& gotData); virtual void scanEndTag(bool& gotData); // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- XMLSize_t buildAttList ( const RefVectorOf& providedAttrs , const XMLSize_t attCount , XMLElementDecl* elemDecl , RefVectorOf& toFill ); bool laxElementValidation(QName* element, ContentLeafNameTypeVector* cv, const XMLContentModel* const cm, const XMLSize_t parentElemDepth); XMLSize_t rawAttrScan ( const XMLCh* const elemName , RefVectorOf& toFill , bool& isEmpty ); void updateNSMap ( const XMLCh* const attrName , const XMLCh* const attrValue ); void resizeElemState(); void updateNSMap ( const XMLCh* const attrName , const XMLCh* const attrValue , const int colonPosition ); void resizeRawAttrColonList(); // ----------------------------------------------------------------------- // Data members // // fRawAttrList // During the initial scan of the attributes we can only do a raw // scan for key/value pairs. So this vector is used to store them // until they can be processed (and put into fAttrList.) // // fSchemaValidator // The Schema validator instance. // // fSeeXsi // This flag indicates a schema has been seen. // // fElemState // fElemLoopState // fElemStateSize // Stores an element next state from DFA content model - used for // wildcard validation // // fElemNonDeclPool // registry for elements without decls in the grammar // fElemCount // count of the number of start tags seen so far (starts at 1). // Used for duplicate attribute detection/processing of required/defaulted attributes // fAttDefRegistry // mapping from XMLAttDef instances to the count of the last // start tag where they were utilized. // fUndeclaredAttrRegistry // set of namespaceId/localName pairs to detect duplicates // fPSVIAttrList // PSVI attribute list implementation that needs to be // filled when a PSVIHandler is registered // fSchemaInfoList // Transient schema info list that is passed to TraverseSchema instances. // fCachedSchemaInfoList // Cached Schema info list that is passed to TraverseSchema instances. // // ----------------------------------------------------------------------- bool fSeeXsi; Grammar::GrammarType fGrammarType; unsigned int fElemStateSize; unsigned int* fElemState; unsigned int* fElemLoopState; XMLBuffer fContent; ValueHashTableOf* fEntityTable; RefVectorOf* fRawAttrList; unsigned int fRawAttrColonListSize; int* fRawAttrColonList; SchemaGrammar* fSchemaGrammar; SchemaValidator* fSchemaValidator; IdentityConstraintHandler* fICHandler; RefHash3KeysIdPool* fElemNonDeclPool; unsigned int fElemCount; RefHashTableOf*fAttDefRegistry; Hash2KeysSetOf* fUndeclaredAttrRegistry; PSVIAttributeList * fPSVIAttrList; XSModel* fModel; PSVIElement* fPSVIElement; ValueStackOf* fErrorStack; PSVIElemContext fPSVIElemContext; RefHash2KeysTableOf* fSchemaInfoList; RefHash2KeysTableOf* fCachedSchemaInfoList; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- SGXMLScanner(); SGXMLScanner(const SGXMLScanner&); SGXMLScanner& operator=(const SGXMLScanner&); // ----------------------------------------------------------------------- // XMLScanner virtual methods // ----------------------------------------------------------------------- virtual void scanCDSection(); virtual void scanCharData(XMLBuffer& toToUse); virtual EntityExpRes scanEntityRef ( const bool inAttVal , XMLCh& firstCh , XMLCh& secondCh , bool& escaped ); virtual void scanDocTypeDecl(); virtual void sendCharData(XMLBuffer& toSend); virtual InputSource* resolveSystemId(const XMLCh* const sysId ,const XMLCh* const pubId); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void commonInit(); void cleanUp(); bool normalizeAttValue ( const XMLAttDef* const attDef , const XMLCh* const attrName , const XMLCh* const value , XMLBuffer& toFill ); bool normalizeAttRawValue ( const XMLCh* const attrName , const XMLCh* const value , XMLBuffer& toFill ); void scanRawAttrListforNameSpaces(XMLSize_t attCount); void parseSchemaLocation(const XMLCh* const schemaLocationStr, bool ignoreLoadSchema = false); void resolveSchemaGrammar(const XMLCh* const loc, const XMLCh* const uri, bool ignoreLoadSchema = false); bool switchGrammar(const XMLCh* const newGrammarNameSpace); bool anyAttributeValidation(SchemaAttDef* attWildCard, unsigned int uriId, bool& skipThisOne, bool& laxThisOne); // ----------------------------------------------------------------------- // Private scanning methods // ----------------------------------------------------------------------- bool basicAttrValueScan ( const XMLCh* const attrName , XMLBuffer& toFill ); bool scanAttValue ( const XMLAttDef* const attDef , XMLBuffer& toFill ); bool scanContent(); // ----------------------------------------------------------------------- // IdentityConstraints Activation methods // ----------------------------------------------------------------------- inline bool toCheckIdentityConstraint() const; // ----------------------------------------------------------------------- // Grammar preparsing methods // ----------------------------------------------------------------------- Grammar* loadXMLSchemaGrammar(const InputSource& src, const bool toCache = false); // ----------------------------------------------------------------------- // PSVI handling methods // ----------------------------------------------------------------------- void endElementPSVI(SchemaElementDecl* const elemDecl, DatatypeValidator* const memberDV); void resetPSVIElemContext(); }; inline const XMLCh* SGXMLScanner::getName() const { return XMLUni::fgSGXMLScanner; } inline bool SGXMLScanner::toCheckIdentityConstraint() const { return fValidate && fIdentityConstraintChecking && fICHandler; } inline Grammar::GrammarType SGXMLScanner::getCurrentGrammarType() const { return fGrammarType; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/XTemplateSerializer.hpp000644 000765 000024 00000045112 13241160334 024550 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XTemplateSerializer.hpp 678409 2008-07-21 13:08:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XTEMPLATE_SERIALIZER_HPP) #define XERCESC_INCLUDE_GUARD_XTEMPLATE_SERIALIZER_HPP #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT XTemplateSerializer { public: /********************************************************** * * ValueVectorOf * * SchemaElementDecl* * unsigned int * ***********************************************************/ static void storeObject(ValueVectorOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(ValueVectorOf** tempObjToRead , int initSize , bool toCallDestructor , XSerializeEngine& serEng); static void storeObject(ValueVectorOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(ValueVectorOf** tempObjToRead , int initSize , bool toCallDestructor , XSerializeEngine& serEng); /********************************************************** * * RefArrayVectorOf * * XMLCh * ***********************************************************/ static void storeObject(RefArrayVectorOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefArrayVectorOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); /********************************************************** * * RefVectorOf * * SchemaAttDef * SchemaElementDecl * ContentSpecNode * IC_Field * DatatypeValidator * IdentityConstraint * XMLNumber * XercesLocationPath * XercesStep * ***********************************************************/ static void storeObject(RefVectorOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefVectorOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); static void storeObject(RefVectorOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefVectorOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); static void storeObject(RefVectorOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefVectorOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); static void storeObject(RefVectorOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefVectorOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); static void storeObject(RefVectorOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefVectorOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); static void storeObject(RefVectorOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefVectorOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); static void storeObject(RefVectorOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefVectorOf** tempObjToRead , int initSize , bool toAdopt , XMLNumber::NumberType numType , XSerializeEngine& serEng); static void storeObject(RefVectorOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefVectorOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); static void storeObject(RefVectorOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefVectorOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); /********************************************************** * * RefHashTableOf * * KVStringPair * XMLAttDef * DTDAttDef * ComplexTypeInfo * XercesGroupInfo * XercesAttGroupInfo * XMLRefInfo * DatatypeValidator * Grammar * XSAnnotation * ***********************************************************/ static void storeObject(RefHashTableOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefHashTableOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); static void storeObject(RefHashTableOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefHashTableOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); static void storeObject(RefHashTableOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefHashTableOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); static void storeObject(RefHashTableOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefHashTableOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); static void storeObject(RefHashTableOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefHashTableOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); static void storeObject(RefHashTableOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefHashTableOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); static void storeObject(RefHashTableOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefHashTableOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); static void storeObject(RefHashTableOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefHashTableOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); static void storeObject(RefHashTableOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefHashTableOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); static void storeObject(RefHashTableOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefHashTableOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); /********************************************************** * * RefHash2KeysTableOf * * SchemaAttDef * ElemVector * ***********************************************************/ static void storeObject(RefHash2KeysTableOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefHash2KeysTableOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); static void storeObject(RefHash2KeysTableOf* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefHash2KeysTableOf** tempObjToRead , int initSize , bool toAdopt , XSerializeEngine& serEng); /********************************************************** * * RefHash3KeysIdPool * * SchemaElementDecl * ***********************************************************/ static void storeObject(RefHash3KeysIdPool* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(RefHash3KeysIdPool** tempObjToRead , int initSize , bool toAdopt , int initSize2 , XSerializeEngine& serEng); /********************************************************** * * NameIdPool * * DTDElementDecl * DTDEntityDecl * XMLNotationDecl * ***********************************************************/ static void storeObject(NameIdPool* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(NameIdPool** tempObjToRead , int initSize , int initSize2 , XSerializeEngine& serEng); static void storeObject(NameIdPool* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(NameIdPool** tempObjToRead , int initSize , int initSize2 , XSerializeEngine& serEng); static void storeObject(NameIdPool* const tempObjToWrite , XSerializeEngine& serEng); static void loadObject(NameIdPool** tempObjToRead , int initSize , int initSize2 , XSerializeEngine& serEng); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ~XTemplateSerializer(); XTemplateSerializer(); XTemplateSerializer(const XTemplateSerializer&); XTemplateSerializer& operator=(const XTemplateSerializer&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/IGXMLScanner.cpp000644 000765 000024 00000345002 13241160334 023001 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IGXMLScanner.cpp 1799522 2017-06-21 21:38:42Z scantor $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN typedef JanitorMemFunCall CleanupType; typedef JanitorMemFunCall ReaderMgrResetType; // --------------------------------------------------------------------------- // IGXMLScanner: Constructors and Destructor // --------------------------------------------------------------------------- IGXMLScanner::IGXMLScanner( XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager) : XMLScanner(valToAdopt, grammarResolver, manager) , fSeeXsi(false) , fGrammarType(Grammar::UnKnown) , fElemStateSize(16) , fElemState(0) , fElemLoopState(0) , fContent(1023, manager) , fRawAttrList(0) , fRawAttrColonListSize(32) , fRawAttrColonList(0) , fDTDValidator(0) , fSchemaValidator(0) , fDTDGrammar(0) , fICHandler(0) , fLocationPairs(0) , fDTDElemNonDeclPool(0) , fSchemaElemNonDeclPool(0) , fElemCount(0) , fAttDefRegistry(0) , fUndeclaredAttrRegistry(0) , fPSVIAttrList(0) , fModel(0) , fPSVIElement(0) , fErrorStack(0) , fSchemaInfoList(0) , fCachedSchemaInfoList (0) { CleanupType cleanup(this, &IGXMLScanner::cleanUp); try { commonInit(); } catch(const OutOfMemoryException&) { // Don't cleanup when out of memory, since executing the // code can cause problems. cleanup.release(); throw; } cleanup.release(); } IGXMLScanner::IGXMLScanner( XMLDocumentHandler* const docHandler , DocTypeHandler* const docTypeHandler , XMLEntityHandler* const entityHandler , XMLErrorReporter* const errHandler , XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager) : XMLScanner(docHandler, docTypeHandler, entityHandler, errHandler, valToAdopt, grammarResolver, manager) , fSeeXsi(false) , fGrammarType(Grammar::UnKnown) , fElemStateSize(16) , fElemState(0) , fElemLoopState(0) , fContent(1023, manager) , fRawAttrList(0) , fRawAttrColonListSize(32) , fRawAttrColonList(0) , fDTDValidator(0) , fSchemaValidator(0) , fDTDGrammar(0) , fICHandler(0) , fLocationPairs(0) , fDTDElemNonDeclPool(0) , fSchemaElemNonDeclPool(0) , fElemCount(0) , fAttDefRegistry(0) , fUndeclaredAttrRegistry(0) , fPSVIAttrList(0) , fModel(0) , fPSVIElement(0) , fErrorStack(0) , fSchemaInfoList(0) , fCachedSchemaInfoList (0) { CleanupType cleanup(this, &IGXMLScanner::cleanUp); try { commonInit(); } catch(const OutOfMemoryException&) { // Don't cleanup when out of memory, since executing the // code can cause problems. cleanup.release(); throw; } cleanup.release(); } IGXMLScanner::~IGXMLScanner() { cleanUp(); } // --------------------------------------------------------------------------- // XMLScanner: Getter methods // --------------------------------------------------------------------------- NameIdPool* IGXMLScanner::getEntityDeclPool() { if(!fDTDGrammar) return 0; return fDTDGrammar->getEntityDeclPool(); } const NameIdPool* IGXMLScanner::getEntityDeclPool() const { if(!fDTDGrammar) return 0; return fDTDGrammar->getEntityDeclPool(); } // --------------------------------------------------------------------------- // IGXMLScanner: Main entry point to scan a document // --------------------------------------------------------------------------- void IGXMLScanner::scanDocument(const InputSource& src) { // Bump up the sequence id for this parser instance. This will invalidate // any previous progressive scan tokens. fSequenceId++; ReaderMgrResetType resetReaderMgr(&fReaderMgr, &ReaderMgr::reset); try { // Reset the scanner and its plugged in stuff for a new run. This // resets all the data structures, creates the initial reader and // pushes it on the stack, and sets up the base document path. scanReset(src); // If we have a document handler, then call the start document if (fDocHandler) fDocHandler->startDocument(); // Scan the prolog part, which is everything before the root element // including the DTD subsets. scanProlog(); // If we got to the end of input, then its not a valid XML file. // Else, go on to scan the content. if (fReaderMgr.atEOF()) { emitError(XMLErrs::EmptyMainEntity); } else { // Scan content, and tell it its not an external entity if (scanContent()) { // Do post-parse validation if required if (fValidate) { // We handle ID reference semantics at this level since // its required by XML 1.0. checkIDRefs(); // Then allow the validator to do any extra stuff it wants // fValidator->postParseValidation(); } // That went ok, so scan for any miscellaneous stuff if (!fReaderMgr.atEOF()) scanMiscellaneous(); } } // If we have a document handler, then call the end document if (fDocHandler) fDocHandler->endDocument(); //cargill debug: //fGrammarResolver->getXSModel(); } // NOTE: // // In all of the error processing below, the emitError() call MUST come // before the flush of the reader mgr, or it will fail because it tries // to find out the position in the XML source of the error. catch(const XMLErrs::Codes) { // This is a 'first failure' exception, so fall through } catch(const XMLValid::Codes) { // This is a 'first fatal error' type exit, so fall through } catch(const XMLException& excToCatch) { // Emit the error and catch any user exception thrown from here. Make // sure in all cases we flush the reader manager. fInException = true; try { if (excToCatch.getErrorType() == XMLErrorReporter::ErrType_Warning) emitError ( XMLErrs::XMLException_Warning , excToCatch.getCode() , excToCatch.getMessage() ); else if (excToCatch.getErrorType() >= XMLErrorReporter::ErrType_Fatal) emitError ( XMLErrs::XMLException_Fatal , excToCatch.getCode() , excToCatch.getMessage() ); else emitError ( XMLErrs::XMLException_Error , excToCatch.getCode() , excToCatch.getMessage() ); } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } } bool IGXMLScanner::scanNext(XMLPScanToken& token) { // Make sure this token is still legal if (!isLegalToken(token)) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Scan_BadPScanToken, fMemoryManager); // Find the next token and remember the reader id XMLSize_t orgReader; XMLTokens curToken; ReaderMgrResetType resetReaderMgr(&fReaderMgr, &ReaderMgr::reset); bool retVal = true; try { while (true) { // We have to handle any end of entity exceptions that happen here. // We could be at the end of X nested entities, each of which will // generate an end of entity exception as we try to move forward. try { curToken = senseNextToken(orgReader); break; } catch(const EndOfEntityException& toCatch) { // Send an end of entity reference event if (fDocHandler) fDocHandler->endEntityReference(toCatch.getEntity()); } } if (curToken == Token_CharData) { scanCharData(fCDataBuf); } else if (curToken == Token_EOF) { if (!fElemStack.isEmpty()) { const ElemStack::StackElem* topElem = fElemStack.popTop(); emitError ( XMLErrs::EndedWithTagsOnStack , topElem->fThisElement->getFullName() ); } retVal = false; } else { // Its some sort of markup bool gotData = true; switch(curToken) { case Token_CData : // Make sure we are within content if (fElemStack.isEmpty()) emitError(XMLErrs::CDATAOutsideOfContent); scanCDSection(); break; case Token_Comment : scanComment(); break; case Token_EndTag : scanEndTag(gotData); break; case Token_PI : scanPI(); break; case Token_StartTag : if (fDoNamespaces) scanStartTagNS(gotData); else scanStartTag(gotData); break; default : fReaderMgr.skipToChar(chOpenAngle); break; } if (orgReader != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialMarkupInEntity); // If we hit the end, then do the miscellaneous part if (!gotData) { // Do post-parse validation if required if (fValidate) { // We handle ID reference semantics at this level since // its required by XML 1.0. checkIDRefs(); // Then allow the validator to do any extra stuff it wants // fValidator->postParseValidation(); } // That went ok, so scan for any miscellaneous stuff scanMiscellaneous(); if (toCheckIdentityConstraint()) fICHandler->endDocument(); if (fDocHandler) fDocHandler->endDocument(); } } } // NOTE: // // In all of the error processing below, the emitError() call MUST come // before the flush of the reader mgr, or it will fail because it tries // to find out the position in the XML source of the error. catch(const XMLErrs::Codes) { // This is a 'first failure' exception so return failure retVal = false; } catch(const XMLValid::Codes) { // This is a 'first fatal error' type exit, so return failure retVal = false; } catch(const XMLException& excToCatch) { // Emit the error and catch any user exception thrown from here. Make // sure in all cases we flush the reader manager. fInException = true; try { if (excToCatch.getErrorType() == XMLErrorReporter::ErrType_Warning) emitError ( XMLErrs::XMLException_Warning , excToCatch.getCode() , excToCatch.getMessage() ); else if (excToCatch.getErrorType() >= XMLErrorReporter::ErrType_Fatal) emitError ( XMLErrs::XMLException_Fatal , excToCatch.getCode() , excToCatch.getMessage() ); else emitError ( XMLErrs::XMLException_Error , excToCatch.getCode() , excToCatch.getMessage() ); } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } retVal = false; } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } // If we are not at the end, release the object that will // reset the ReaderMgr. if (retVal) resetReaderMgr.release(); return retVal; } // --------------------------------------------------------------------------- // IGXMLScanner: Private helper methods. Most of these are implemented in // IGXMLScanner2.Cpp. // --------------------------------------------------------------------------- // This method handles the common initialization, to avoid having to do // it redundantly in multiple constructors. void IGXMLScanner::commonInit() { // Create the element state array fElemState = (unsigned int*) fMemoryManager->allocate ( fElemStateSize * sizeof(unsigned int) ); //new unsigned int[fElemStateSize]; fElemLoopState = (unsigned int*) fMemoryManager->allocate ( fElemStateSize * sizeof(unsigned int) ); //new unsigned int[fElemStateSize]; // And we need one for the raw attribute scan. This just stores key/ // value string pairs (prior to any processing.) fRawAttrList = new (fMemoryManager) RefVectorOf(32, true, fMemoryManager); fRawAttrColonList = (int*) fMemoryManager->allocate ( fRawAttrColonListSize * sizeof(int) ); // Create the Validator and init them fDTDValidator = new (fMemoryManager) DTDValidator(); initValidator(fDTDValidator); fSchemaValidator = new (fMemoryManager) SchemaValidator(0, fMemoryManager); initValidator(fSchemaValidator); // Create IdentityConstraint info fICHandler = new (fMemoryManager) IdentityConstraintHandler(this, fMemoryManager); // Create schemaLocation pair info fLocationPairs = new (fMemoryManager) ValueVectorOf(8, fMemoryManager); // create pools for undeclared elements fDTDElemNonDeclPool = new (fMemoryManager) NameIdPool(29, 128, fMemoryManager); fSchemaElemNonDeclPool = new (fMemoryManager) RefHash3KeysIdPool(29, true, 128, fMemoryManager); fAttDefRegistry = new (fMemoryManager) RefHashTableOf ( 131, false, fMemoryManager ); fUndeclaredAttrRegistry = new (fMemoryManager) Hash2KeysSetOf(7, fMemoryManager); fPSVIAttrList = new (fMemoryManager) PSVIAttributeList(fMemoryManager); fSchemaInfoList = new (fMemoryManager) RefHash2KeysTableOf(29, fMemoryManager); fCachedSchemaInfoList = new (fMemoryManager) RefHash2KeysTableOf(29, fMemoryManager); // use fDTDValidator as the default validator if (!fValidator) fValidator = fDTDValidator; } void IGXMLScanner::cleanUp() { fMemoryManager->deallocate(fElemState); //delete [] fElemState; fMemoryManager->deallocate(fElemLoopState); //delete [] fElemLoopState; delete fRawAttrList; fMemoryManager->deallocate(fRawAttrColonList); delete fDTDValidator; delete fSchemaValidator; delete fICHandler; delete fLocationPairs; delete fDTDElemNonDeclPool; delete fSchemaElemNonDeclPool; delete fAttDefRegistry; delete fUndeclaredAttrRegistry; delete fPSVIAttrList; delete fPSVIElement; delete fErrorStack; delete fSchemaInfoList; delete fCachedSchemaInfoList; } // --------------------------------------------------------------------------- // IGXMLScanner: Private scanning methods // --------------------------------------------------------------------------- // This method is called from scanStartTag() to handle the very raw initial // scan of the attributes. It just fills in the passed collection with // key/value pairs for each attribute. No processing is done on them at all. XMLSize_t IGXMLScanner::rawAttrScan(const XMLCh* const elemName , RefVectorOf& toFill , bool& isEmpty) { // Keep up with how many attributes we've seen so far, and how many // elements are available in the vector. This way we can reuse old // elements until we run out and then expand it. XMLSize_t attCount = 0; XMLSize_t curVecSize = toFill.size(); // Assume it is not empty isEmpty = false; // We loop until we either see a /> or >, handling key/value pairs util // we get there. We place them in the passed vector, which we will expand // as required to hold them. while (true) { // Get the next character, which should be non-space XMLCh nextCh = fReaderMgr.peekNextChar(); // If the next character is not a slash or closed angle bracket, // then it must be whitespace, since whitespace is required // between the end of the last attribute and the name of the next // one. // if (attCount) { if ((nextCh != chForwardSlash) && (nextCh != chCloseAngle)) { bool bFoundSpace; fReaderMgr.skipPastSpaces(bFoundSpace); if (!bFoundSpace) { // Emit the error but keep on going emitError(XMLErrs::ExpectedWhitespace); } // Ok, peek another char nextCh = fReaderMgr.peekNextChar(); } } // Ok, here we first check for any of the special case characters. // If its not one, then we do the normal case processing, which // assumes that we've hit an attribute value, Otherwise, we do all // the special case checks. if (!fReaderMgr.getCurrentReader()->isSpecialStartTagChar(nextCh)) { // Assume it's going to be an attribute, so get a name from // the input. int colonPosition; if (!fReaderMgr.getQName(fAttNameBuf, &colonPosition)) { if (fAttNameBuf.isEmpty()) emitError(XMLErrs::ExpectedAttrName); else emitError(XMLErrs::InvalidAttrName, fAttNameBuf.getRawBuffer()); fReaderMgr.skipPastChar(chCloseAngle); return attCount; } const XMLCh* curAttNameBuf = fAttNameBuf.getRawBuffer(); // And next must be an equal sign if (!scanEq()) { static const XMLCh tmpList[] = { chSingleQuote, chDoubleQuote, chCloseAngle , chOpenAngle, chForwardSlash, chNull }; emitError(XMLErrs::ExpectedEqSign); // Try to sync back up by skipping forward until we either // hit something meaningful. const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList); if ((chFound == chCloseAngle) || (chFound == chForwardSlash)) { // Jump back to top for normal processing of these continue; } else if ((chFound == chSingleQuote) || (chFound == chDoubleQuote) || fReaderMgr.getCurrentReader()->isWhitespace(chFound)) { // Just fall through assuming that the value is to follow } else if (chFound == chOpenAngle) { // Assume a malformed tag and that new one is starting emitError(XMLErrs::UnterminatedStartTag, elemName); return attCount; } else { // Something went really wrong return attCount; } } // Next should be the quoted attribute value. We just do a simple // and stupid scan of this value. The only thing we do here // is to expand entity references. if (!basicAttrValueScan(curAttNameBuf, fAttValueBuf)) { static const XMLCh tmpList[] = { chCloseAngle, chOpenAngle, chForwardSlash, chNull }; emitError(XMLErrs::ExpectedAttrValue); // It failed, so lets try to get synced back up. We skip // forward until we find some whitespace or one of the // chars in our list. const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList); if ((chFound == chCloseAngle) || (chFound == chForwardSlash) || fReaderMgr.getCurrentReader()->isWhitespace(chFound)) { // Just fall through and process this attribute, though // the value will be "". } else if (chFound == chOpenAngle) { // Assume a malformed tag and that new one is starting emitError(XMLErrs::UnterminatedStartTag, elemName); return attCount; } else { // Something went really wrong return attCount; } } // And now lets add it to the passed collection. If we have not // filled it up yet, then we use the next element. Else we add // a new one. KVStringPair* curPair = 0; if (attCount >= curVecSize) { curPair = new (fMemoryManager) KVStringPair ( curAttNameBuf , fAttNameBuf.getLen() , fAttValueBuf.getRawBuffer() , fAttValueBuf.getLen() , fMemoryManager ); toFill.addElement(curPair); } else { curPair = toFill.elementAt(attCount); curPair->set ( curAttNameBuf, fAttNameBuf.getLen(), fAttValueBuf.getRawBuffer(), fAttValueBuf.getLen() ); } if (attCount >= fRawAttrColonListSize) { resizeRawAttrColonList(); } // Set the position of the colon and bump the count of attributes we've gotten fRawAttrColonList[attCount++] = colonPosition; // And go to the top again for another attribute continue; } // It was some special case character so do all of the checks and // deal with it. if (!nextCh) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); if (nextCh == chForwardSlash) { fReaderMgr.getNextChar(); isEmpty = true; if (!fReaderMgr.skippedChar(chCloseAngle)) emitError(XMLErrs::UnterminatedStartTag, elemName); break; } else if (nextCh == chCloseAngle) { fReaderMgr.getNextChar(); break; } else if (nextCh == chOpenAngle) { // Check for this one specially, since its going to be common // and it is kind of auto-recovering since we've already hit the // next open bracket, which is what we would have seeked to (and // skipped this whole tag.) emitError(XMLErrs::UnterminatedStartTag, elemName); break; } else if ((nextCh == chSingleQuote) || (nextCh == chDoubleQuote)) { // Check for this one specially, which is probably a missing // attribute name, e.g. ="value". Just issue expected name // error and eat the quoted string, then jump back to the // top again. emitError(XMLErrs::ExpectedAttrName); fReaderMgr.getNextChar(); fReaderMgr.skipQuotedString(nextCh); fReaderMgr.skipPastSpaces(); continue; } } return attCount; } // This method will kick off the scanning of the primary content of the // document, i.e. the elements. bool IGXMLScanner::scanContent() { // Go into a loop until we hit the end of the root element, or we fall // out because there is no root element. // // We have to do kind of a deeply nested double loop here in order to // avoid doing the setup/teardown of the exception handler on each // round. Doing it this way we only do it when an exception actually // occurs. bool gotData = true; bool inMarkup = false; while (gotData) { try { while (gotData) { // Sense what the next top level token is. According to what // this tells us, we will call something to handle that kind // of thing. XMLSize_t orgReader; const XMLTokens curToken = senseNextToken(orgReader); // Handle character data and end of file specially. Char data // is not markup so we don't want to handle it in the loop // below. if (curToken == Token_CharData) { // Scan the character data and call appropriate events. Let // him use our local character data buffer for efficiency. scanCharData(fCDataBuf); continue; } else if (curToken == Token_EOF) { // The element stack better be empty at this point or we // ended prematurely before all elements were closed. if (!fElemStack.isEmpty()) { const ElemStack::StackElem* topElem = fElemStack.popTop(); emitError ( XMLErrs::EndedWithTagsOnStack , topElem->fThisElement->getFullName() ); } // Its the end of file, so clear the got data flag gotData = false; continue; } // We are in some sort of markup now inMarkup = true; // According to the token we got, call the appropriate // scanning method. switch(curToken) { case Token_CData : // Make sure we are within content if (fElemStack.isEmpty()) emitError(XMLErrs::CDATAOutsideOfContent); scanCDSection(); break; case Token_Comment : scanComment(); break; case Token_EndTag : scanEndTag(gotData); break; case Token_PI : scanPI(); break; case Token_StartTag : if (fDoNamespaces) scanStartTagNS(gotData); else scanStartTag(gotData); break; default : fReaderMgr.skipToChar(chOpenAngle); break; } if (orgReader != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialMarkupInEntity); // And we are back out of markup again inMarkup = false; } } catch(const EndOfEntityException& toCatch) { // If we were in some markup when this happened, then its a // partial markup error. if (inMarkup) emitError(XMLErrs::PartialMarkupInEntity); // Send an end of entity reference event if (fDocHandler) fDocHandler->endEntityReference(toCatch.getEntity()); inMarkup = false; } } // It went ok, so return success return true; } void IGXMLScanner::scanEndTag(bool& gotData) { // Assume we will still have data until proven otherwise. It will only // ever be false if this is the end of the root element. gotData = true; // Check if the element stack is empty. If so, then this is an unbalanced // element (i.e. more ends than starts, perhaps because of bad text // causing one to be skipped.) if (fElemStack.isEmpty()) { emitError(XMLErrs::MoreEndThanStartTags); fReaderMgr.skipPastChar(chCloseAngle); ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Scan_UnbalancedStartEnd, fMemoryManager); } // Pop the stack of the element we are supposed to be ending. Remember // that we don't own this. The stack just keeps them and reuses them. unsigned int uriId = (fDoNamespaces) ? fElemStack.getCurrentURI() : fEmptyNamespaceId; // these get initialized below const ElemStack::StackElem* topElem = 0; const XMLCh *elemName = 0; // Make sure that its the end of the element that we expect // special case for schema validation, whose element decls, // obviously don't contain prefix information if(fGrammarType == Grammar::SchemaGrammarType) { elemName = fElemStack.getCurrentSchemaElemName(); topElem = fElemStack.topElement(); } else { topElem = fElemStack.topElement(); elemName = topElem->fThisElement->getFullName(); } if (!fReaderMgr.skippedStringLong(elemName)) { emitError ( XMLErrs::ExpectedEndOfTagX , elemName ); fReaderMgr.skipPastChar(chCloseAngle); fElemStack.popTop(); return; } // Make sure we are back on the same reader as where we started if (topElem->fReaderNum != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialTagMarkupError); // Skip optional whitespace fReaderMgr.skipPastSpaces(); // Make sure we find the closing bracket if (!fReaderMgr.skippedChar(chCloseAngle)) { emitError ( XMLErrs::UnterminatedEndTag , topElem->fThisElement->getFullName() ); } if (fGrammarType == Grammar::SchemaGrammarType) { // reset error occurred fPSVIElemContext.fErrorOccurred = fErrorStack->pop(); if (fValidate && topElem->fThisElement->isDeclared()) { fPSVIElemContext.fCurrentTypeInfo = ((SchemaValidator*) fValidator)->getCurrentTypeInfo(); if(!fPSVIElemContext.fCurrentTypeInfo) fPSVIElemContext.fCurrentDV = ((SchemaValidator*) fValidator)->getCurrentDatatypeValidator(); else fPSVIElemContext.fCurrentDV = 0; if(fPSVIHandler) { fPSVIElemContext.fNormalizedValue = ((SchemaValidator*) fValidator)->getNormalizedValue(); if (XMLString::equals(fPSVIElemContext.fNormalizedValue, XMLUni::fgZeroLenString)) fPSVIElemContext.fNormalizedValue = 0; } } else { fPSVIElemContext.fCurrentDV = 0; fPSVIElemContext.fCurrentTypeInfo = 0; fPSVIElemContext.fNormalizedValue = 0; } } // If validation is enabled, then lets pass him the list of children and // this element and let him validate it. DatatypeValidator* psviMemberType = 0; if (fValidate) { // // XML1.0-3rd // Validity Constraint: // The declaration matches EMPTY and the element has no content (not even // entity references, comments, PIs or white space). // if ( (fGrammarType == Grammar::DTDGrammarType) && (topElem->fCommentOrPISeen) && (((DTDElementDecl*) topElem->fThisElement)->getModelType() == DTDElementDecl::Empty)) { fValidator->emitError ( XMLValid::EmptyElemHasContent , topElem->fThisElement->getFullName() ); } // // XML1.0-3rd // Validity Constraint: // // The declaration matches children and the sequence of child elements // belongs to the language generated by the regular expression in the // content model, with optional white space, comments and PIs // (i.e. markup matching production [27] Misc) between the start-tag and // the first child element, between child elements, or between the last // child element and the end-tag. // // Note that // a CDATA section containing only white space or // a reference to an entity whose replacement text is character references // expanding to white space do not match the nonterminal S, and hence // cannot appear in these positions; however, // a reference to an internal entity with a literal value consisting // of character references expanding to white space does match S, // since its replacement text is the white space resulting from expansion // of the character references. // if ( (fGrammarType == Grammar::DTDGrammarType) && (topElem->fReferenceEscaped) && (((DTDElementDecl*) topElem->fThisElement)->getModelType() == DTDElementDecl::Children)) { fValidator->emitError ( XMLValid::ElemChildrenHasInvalidWS , topElem->fThisElement->getFullName() ); } XMLSize_t failure; bool res = fValidator->checkContent ( topElem->fThisElement , topElem->fChildren , topElem->fChildCount , &failure ); if (!res) { // One of the elements is not valid for the content. NOTE that // if no children were provided but the content model requires // them, it comes back with a zero value. But we cannot use that // to index the child array in this case, and have to put out a // special message. if (!topElem->fChildCount) { fValidator->emitError ( XMLValid::EmptyNotValidForContent , topElem->fThisElement->getFormattedContentModel() ); } else if (failure >= topElem->fChildCount) { fValidator->emitError ( XMLValid::NotEnoughElemsForCM , topElem->fThisElement->getFormattedContentModel() ); } else { fValidator->emitError ( XMLValid::ElementNotValidForContent , topElem->fChildren[failure]->getRawName() , topElem->fThisElement->getFormattedContentModel() ); } } if (fGrammarType == Grammar::SchemaGrammarType) { if (((SchemaValidator*) fValidator)->getErrorOccurred()) fPSVIElemContext.fErrorOccurred = true; else if (fPSVIElemContext.fCurrentDV && fPSVIElemContext.fCurrentDV->getType() == DatatypeValidator::Union) psviMemberType = fValidationContext->getValidatingMemberType(); if (fPSVIHandler) { fPSVIElemContext.fIsSpecified = ((SchemaValidator*) fValidator)->getIsElemSpecified(); if(fPSVIElemContext.fIsSpecified) fPSVIElemContext.fNormalizedValue = ((SchemaElementDecl *)topElem->fThisElement)->getDefaultValue(); } // call matchers and de-activate context if (toCheckIdentityConstraint()) { fICHandler->deactivateContext ( (SchemaElementDecl *) topElem->fThisElement , fContent.getRawBuffer() , fValidationContext , fPSVIElemContext.fCurrentDV ); } } } // QName dv needed topElem to resolve URIs on the checkContent fElemStack.popTop(); // See if it was the root element, to avoid multiple calls below const bool isRoot = fElemStack.isEmpty(); if (fGrammarType == Grammar::SchemaGrammarType) { if (fPSVIHandler) { endElementPSVI( (SchemaElementDecl*)topElem->fThisElement, psviMemberType); } // now we can reset the datatype buffer, since the // application has had a chance to copy the characters somewhere else ((SchemaValidator *)fValidator)->clearDatatypeBuffer(); } // If we have a doc handler, tell it about the end tag if (fDocHandler) { if (fGrammarType == Grammar::SchemaGrammarType) { if (topElem->fPrefixColonPos != -1) fPrefixBuf.set(elemName, topElem->fPrefixColonPos); else fPrefixBuf.reset(); } else { fPrefixBuf.set(topElem->fThisElement->getElementName()->getPrefix()); } fDocHandler->endElement ( *topElem->fThisElement , uriId , isRoot , fPrefixBuf.getRawBuffer() ); } if (fGrammarType == Grammar::SchemaGrammarType) { if (!isRoot) { // update error information fErrorStack->push((fErrorStack->size() && fErrorStack->pop()) || fPSVIElemContext.fErrorOccurred); } } // If this was the root, then done with content gotData = !isRoot; if (gotData) { if (fDoNamespaces) { // Restore the grammar fGrammar = fElemStack.getCurrentGrammar(); fGrammarType = fGrammar->getGrammarType(); if (fGrammarType == Grammar::SchemaGrammarType && !fValidator->handlesSchema()) { if (fValidatorFromUser) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Gen_NoSchemaValidator, fMemoryManager); else { fValidator = fSchemaValidator; } } else if (fGrammarType == Grammar::DTDGrammarType && !fValidator->handlesDTD()) { if (fValidatorFromUser) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Gen_NoDTDValidator, fMemoryManager); else { fValidator = fDTDValidator; } } fValidator->setGrammar(fGrammar); } // Restore the validation flag fValidate = fElemStack.getValidationFlag(); } } // This method handles the high level logic of scanning the DOCType // declaration. This calls the DTDScanner and kicks off both the scanning of // the internal subset and the scanning of the external subset, if any. // // When we get here the 'resetDocType(); // There must be some space after DOCTYPE bool skippedSomething; fReaderMgr.skipPastSpaces(skippedSomething); if (!skippedSomething) { emitError(XMLErrs::ExpectedWhitespace); // Just skip the Doctype declaration and return fReaderMgr.skipPastChar(chCloseAngle); return; } // Get a buffer for the root element XMLBufBid bbRootName(&fBufMgr); // Get a name from the input, which should be the name of the root // element of the upcoming content. int colonPosition; bool validName = fDoNamespaces ? fReaderMgr.getQName(bbRootName.getBuffer(), &colonPosition) : fReaderMgr.getName(bbRootName.getBuffer()); if (!validName) { if (bbRootName.isEmpty()) emitError(XMLErrs::NoRootElemInDOCTYPE); else emitError(XMLErrs::InvalidRootElemInDOCTYPE, bbRootName.getRawBuffer()); fReaderMgr.skipPastChar(chCloseAngle); return; } // Store the root element name for later check setRootElemName(bbRootName.getRawBuffer()); // This element obviously is not going to exist in the element decl // pool yet, but we need to call docTypeDecl. So force it into // the element decl pool, marked as being there because it was in // the DOCTYPE. Later, when its declared, the status will be updated. // // Only do this if we are not reusing the validator! If we are reusing, // then look it up instead. It has to exist! MemoryManager* const rootDeclMgr = fUseCachedGrammar ? fMemoryManager : fGrammarPoolMemoryManager; DTDElementDecl* rootDecl = new (rootDeclMgr) DTDElementDecl ( bbRootName.getRawBuffer() , fEmptyNamespaceId , DTDElementDecl::Any , rootDeclMgr ); Janitor rootDeclJanitor(rootDecl); rootDecl->setCreateReason(DTDElementDecl::AsRootElem); rootDecl->setExternalElemDeclaration(true); if(!fUseCachedGrammar) { fGrammar->putElemDecl(rootDecl); rootDeclJanitor.release(); } else { // attach this to the undeclared element pool so that it gets deleted XMLElementDecl* elemDecl = fDTDElemNonDeclPool->getByKey(bbRootName.getRawBuffer()); if (elemDecl) { rootDecl->setId(elemDecl->getId()); } else { rootDecl->setId(fDTDElemNonDeclPool->put((DTDElementDecl*)rootDecl)); rootDeclJanitor.release(); } } // Skip any spaces after the name fReaderMgr.skipPastSpaces(); // And now if we are looking at a >, then we are done. It is not // required to have an internal or external subset, though why you // would not escapes me. if (fReaderMgr.skippedChar(chCloseAngle)) { // If we have a doc type handler and advanced callbacks are enabled, // call the doctype event. if (fDocTypeHandler) fDocTypeHandler->doctypeDecl(*rootDecl, 0, 0, false); return; } // either internal/external subset if (fValScheme == Val_Auto && !fValidate) fValidate = true; bool hasIntSubset = false; bool hasExtSubset = false; XMLCh* sysId = 0; XMLCh* pubId = 0; DTDScanner dtdScanner ( (DTDGrammar*) fGrammar , fDocTypeHandler , fGrammarPoolMemoryManager , fMemoryManager ); dtdScanner.setScannerInfo(this, &fReaderMgr, &fBufMgr); // If the next character is '[' then we have no external subset cause // there is no system id, just the opening character of the internal // subset. Else, has to be an id. // // Just look at the next char, don't eat it. if (fReaderMgr.peekNextChar() == chOpenSquare) { hasIntSubset = true; } else { // Indicate we have an external subset hasExtSubset = true; fHasNoDTD = false; // Get buffers for the ids XMLBufBid bbPubId(&fBufMgr); XMLBufBid bbSysId(&fBufMgr); // Get the external subset id if (!dtdScanner.scanId(bbPubId.getBuffer(), bbSysId.getBuffer(), DTDScanner::IDType_External)) { fReaderMgr.skipPastChar(chCloseAngle); return; } // Get copies of the ids we got pubId = XMLString::replicate(bbPubId.getRawBuffer(), fMemoryManager); sysId = XMLString::replicate(bbSysId.getRawBuffer(), fMemoryManager); // Skip spaces and check again for the opening of an internal subset fReaderMgr.skipPastSpaces(); // Just look at the next char, don't eat it. if (fReaderMgr.peekNextChar() == chOpenSquare) { hasIntSubset = true; } } // Insure that the ids get cleaned up, if they got allocated ArrayJanitor janSysId(sysId, fMemoryManager); ArrayJanitor janPubId(pubId, fMemoryManager); // If we have a doc type handler and advanced callbacks are enabled, // call the doctype event. if (fDocTypeHandler) fDocTypeHandler->doctypeDecl(*rootDecl, pubId, sysId, hasIntSubset, hasExtSubset); // Ok, if we had an internal subset, we are just past the [ character // and need to parse that first. if (hasIntSubset) { // Eat the opening square bracket fReaderMgr.getNextChar(); checkInternalDTD(hasExtSubset, sysId, pubId); // And try to scan the internal subset. If we fail, try to recover // by skipping forward tot he close angle and returning. if (!dtdScanner.scanInternalSubset()) { fReaderMgr.skipPastChar(chCloseAngle); return; } // Do a sanity check that some expanded PE did not propogate out of // the doctype. This could happen if it was terminated early by bad // syntax. if (fReaderMgr.getReaderDepth() > 1) { emitError(XMLErrs::PEPropogated); // Ask the reader manager to pop back down to the main level fReaderMgr.cleanStackBackTo(1); } fReaderMgr.skipPastSpaces(); } // And that should leave us at the closing > of the DOCTYPE line if (!fReaderMgr.skippedChar(chCloseAngle)) { // Do a special check for the common scenario of an extra ] char at // the end. This is easy to recover from. if (fReaderMgr.skippedChar(chCloseSquare) && fReaderMgr.skippedChar(chCloseAngle)) { emitError(XMLErrs::ExtraCloseSquare); } else { emitError(XMLErrs::UnterminatedDOCTYPE); fReaderMgr.skipPastChar(chCloseAngle); } } // If we had an external subset, then we need to deal with that one // next. If we are reusing the validator, then don't scan it. if (hasExtSubset) { InputSource* srcUsed=0; Janitor janSrc(srcUsed); // If we had an internal subset and we're using the cached grammar, it // means that the ignoreCachedDTD is set, so we ignore the cached // grammar if (fUseCachedGrammar && !hasIntSubset) { srcUsed = resolveSystemId(sysId, pubId); if (srcUsed) { janSrc.reset(srcUsed); Grammar* grammar = fGrammarResolver->getGrammar(srcUsed->getSystemId()); if (grammar && grammar->getGrammarType() == Grammar::DTDGrammarType) { fDTDGrammar = (DTDGrammar*) grammar; fGrammar = fDTDGrammar; fValidator->setGrammar(fGrammar); // If we don't report at least the external subset boundaries, // an advanced document handler cannot know when the DTD end, // since we've already sent a doctype decl that indicates there's // there's an external subset. if (fDocTypeHandler) { fDocTypeHandler->startExtSubset(); fDocTypeHandler->endExtSubset(); } return; } } } if (fLoadExternalDTD || fValidate) { // And now create a reader to read this entity XMLReader* reader; if (srcUsed) { reader = fReaderMgr.createReader ( *srcUsed , false , XMLReader::RefFrom_NonLiteral , XMLReader::Type_General , XMLReader::Source_External , fCalculateSrcOfs , fLowWaterMark ); } else { reader = fReaderMgr.createReader ( sysId , pubId , false , XMLReader::RefFrom_NonLiteral , XMLReader::Type_General , XMLReader::Source_External , srcUsed , fCalculateSrcOfs , fLowWaterMark , fDisableDefaultEntityResolution ); janSrc.reset(srcUsed); } // If it failed then throw an exception if (!reader) ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Gen_CouldNotOpenDTD, srcUsed ? srcUsed->getSystemId() : sysId, fMemoryManager); if (fToCacheGrammar) { unsigned int stringId = fGrammarResolver->getStringPool()->addOrFind(srcUsed->getSystemId()); const XMLCh* sysIdStr = fGrammarResolver->getStringPool()->getValueForId(stringId); fGrammarResolver->orphanGrammar(XMLUni::fgDTDEntityString); ((XMLDTDDescription*) (fGrammar->getGrammarDescription()))->setSystemId(sysIdStr); fGrammarResolver->putGrammar(fGrammar); } // In order to make the processing work consistently, we have to // make this look like an external entity. So create an entity // decl and fill it in and push it with the reader, as happens // with an external entity. Put a janitor on it to insure it gets // cleaned up. The reader manager does not adopt them. const XMLCh gDTDStr[] = { chLatin_D, chLatin_T, chLatin_D , chNull }; DTDEntityDecl* declDTD = new (fMemoryManager) DTDEntityDecl(gDTDStr, false, fMemoryManager); declDTD->setSystemId(sysId); declDTD->setIsExternal(true); Janitor janDecl(declDTD); // Mark this one as a throw at end reader->setThrowAtEnd(true); // And push it onto the stack, with its pseudo name fReaderMgr.pushReader(reader, declDTD); // Tell it its not in an include section dtdScanner.scanExtSubsetDecl(false, true); } } } bool IGXMLScanner::scanStartTag(bool& gotData) { // Assume we will still have data until proven otherwise. It will only // ever be false if this is the root and its empty. gotData = true; // Get the QName. In this case, we are not doing namespaces, so we just // use it as is and don't have to break it into parts. if (!fReaderMgr.getName(fQNameBuf)) { emitError(XMLErrs::ExpectedElementName); fReaderMgr.skipToChar(chOpenAngle); return false; } // Assume it won't be an empty tag bool isEmpty = false; // Lets try to look up the element in the validator's element decl pool // We can pass bogus values for the URI id and the base name. We know that // this can only be called if we are doing a DTD style validator and that // he will only look at the QName. // // We tell him to fault in a decl if he does not find one. // Actually, we *don't* tell him to fault in a decl if he does not find one- NG bool wasAdded = false; const XMLCh *rawQName = fQNameBuf.getRawBuffer(); XMLElementDecl* elemDecl = fGrammar->getElemDecl ( fEmptyNamespaceId , 0 , rawQName , Grammar::TOP_LEVEL_SCOPE ); // look for it in the undeclared pool: if(!elemDecl) { elemDecl = fDTDElemNonDeclPool->getByKey(rawQName); } if(!elemDecl) { // we're assuming this must be a DTD element. DTD's can be // used with or without namespaces, but schemas cannot be used without // namespaces. wasAdded = true; elemDecl = new (fMemoryManager) DTDElementDecl ( rawQName , fEmptyNamespaceId , DTDElementDecl::Any , fMemoryManager ); elemDecl->setId(fDTDElemNonDeclPool->put((DTDElementDecl*)elemDecl)); } // We do something different here according to whether we found the // element or not. if (wasAdded) { // If validating then emit an error if (fValidate) { // This is to tell the reuse Validator that this element was // faulted-in, was not an element in the validator pool originally elemDecl->setCreateReason(XMLElementDecl::JustFaultIn); fValidator->emitError ( XMLValid::ElementNotDefined , elemDecl->getFullName() ); } } else { // If its not marked declared and validating, then emit an error if (fValidate && !elemDecl->isDeclared()) { fValidator->emitError ( XMLValid::ElementNotDefined , elemDecl->getFullName() ); } } // See if its the root element const bool isRoot = fElemStack.isEmpty(); // Expand the element stack and add the new element fElemStack.addLevel(elemDecl, fReaderMgr.getCurrentReaderNum()); fElemStack.setValidationFlag(fValidate); // Validate the element if (fValidate) fValidator->validateElement(elemDecl); // If this is the first element and we are validating, check the root // element. if (isRoot) { fRootGrammar = fGrammar; if (fValidate) { // If a DocType exists, then check if it matches the root name there. if (fRootElemName && !XMLString::equals(fQNameBuf.getRawBuffer(), fRootElemName)) fValidator->emitError(XMLValid::RootElemNotLikeDocType); } } else { // If the element stack is not empty, then add this element as a // child of the previous top element. If its empty, this is the root // elem and is not the child of anything. fElemStack.addChild(elemDecl->getElementName(), true); } // Skip any whitespace after the name fReaderMgr.skipPastSpaces(); // We loop until we either see a /> or >, handling attribute/value // pairs until we get there. XMLSize_t attCount = 0; XMLSize_t curAttListSize = fAttrList->size(); wasAdded = false; fElemCount++; while (true) { // And get the next non-space character XMLCh nextCh = fReaderMgr.peekNextChar(); // If the next character is not a slash or closed angle bracket, // then it must be whitespace, since whitespace is required // between the end of the last attribute and the name of the next // one. if (attCount) { if ((nextCh != chForwardSlash) && (nextCh != chCloseAngle)) { bool bFoundSpace; fReaderMgr.skipPastSpaces(bFoundSpace); if (!bFoundSpace) { // Emit the error but keep on going emitError(XMLErrs::ExpectedWhitespace); } // Ok, peek another char nextCh = fReaderMgr.peekNextChar(); } } // Ok, here we first check for any of the special case characters. // If its not one, then we do the normal case processing, which // assumes that we've hit an attribute value, Otherwise, we do all // the special case checks. if (!fReaderMgr.getCurrentReader()->isSpecialStartTagChar(nextCh)) { // Assume its going to be an attribute, so get a name from // the input. if (!fReaderMgr.getName(fAttNameBuf)) { emitError(XMLErrs::ExpectedAttrName); fReaderMgr.skipPastChar(chCloseAngle); return false; } // And next must be an equal sign if (!scanEq()) { static const XMLCh tmpList[] = { chSingleQuote, chDoubleQuote, chCloseAngle , chOpenAngle, chForwardSlash, chNull }; emitError(XMLErrs::ExpectedEqSign); // Try to sync back up by skipping forward until we either // hit something meaningful. const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList); if ((chFound == chCloseAngle) || (chFound == chForwardSlash)) { // Jump back to top for normal processing of these continue; } else if ((chFound == chSingleQuote) || (chFound == chDoubleQuote) || fReaderMgr.getCurrentReader()->isWhitespace(chFound)) { // Just fall through assuming that the value is to follow } else if (chFound == chOpenAngle) { // Assume a malformed tag and that new one is starting emitError(XMLErrs::UnterminatedStartTag, elemDecl->getFullName()); return false; } else { // Something went really wrong return false; } } // See if this attribute is declared for this element. If we are // not validating of course it will not be at first, but we will // fault it into the pool (to avoid lots of redundant errors.) XMLCh * namePtr = fAttNameBuf.getRawBuffer(); XMLAttDef* attDef = ((DTDElementDecl *)elemDecl)->getAttDef(namePtr); // Add this attribute to the attribute list that we use to // pass them to the handler. We reuse its existing elements // but expand it as required. // Note that we want to this first since this will // make a copy of the namePtr; we can then make use of // that copy in the hashtable lookup that checks // for duplicates. This will mean we may have to update // the type of the XMLAttr later. XMLAttr* curAtt; if (attCount >= curAttListSize) { curAtt = new (fMemoryManager) XMLAttr ( 0 , namePtr , XMLUni::fgZeroLenString , XMLUni::fgZeroLenString , (attDef)?attDef->getType():XMLAttDef::CData , true , fMemoryManager ); fAttrList->addElement(curAtt); } else { curAtt = fAttrList->elementAt(attCount); curAtt->set ( 0 , namePtr , XMLUni::fgZeroLenString , XMLUni::fgZeroLenString , (attDef)?attDef->getType():XMLAttDef::CData ); curAtt->setSpecified(true); } // reset namePtr so it refers to newly-allocated memory namePtr = (XMLCh *)curAtt->getName(); if (!attDef) { // If there is a validation handler, then we are validating // so emit an error. if (fValidate) { fValidator->emitError ( XMLValid::AttNotDefinedForElement , fAttNameBuf.getRawBuffer() , elemDecl->getFullName() ); } if(!fUndeclaredAttrRegistry->putIfNotPresent(namePtr, 0)) { emitError ( XMLErrs::AttrAlreadyUsedInSTag , namePtr , elemDecl->getFullName() ); } } else { // prepare for duplicate detection unsigned int *curCountPtr = fAttDefRegistry->get(attDef); if(!curCountPtr) { curCountPtr = getNewUIntPtr(); *curCountPtr = fElemCount; fAttDefRegistry->put(attDef, curCountPtr); } else if(*curCountPtr < fElemCount) *curCountPtr = fElemCount; else { emitError ( XMLErrs::AttrAlreadyUsedInSTag , attDef->getFullName() , elemDecl->getFullName() ); } } // Skip any whitespace before the value and then scan the att // value. This will come back normalized with entity refs and // char refs expanded. fReaderMgr.skipPastSpaces(); if (!scanAttValue(attDef, namePtr, fAttValueBuf)) { static const XMLCh tmpList[] = { chCloseAngle, chOpenAngle, chForwardSlash, chNull }; emitError(XMLErrs::ExpectedAttrValue); // It failed, so lets try to get synced back up. We skip // forward until we find some whitespace or one of the // chars in our list. const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList); if ((chFound == chCloseAngle) || (chFound == chForwardSlash) || fReaderMgr.getCurrentReader()->isWhitespace(chFound)) { // Just fall through and process this attribute, though // the value will be "". } else if (chFound == chOpenAngle) { // Assume a malformed tag and that new one is starting emitError(XMLErrs::UnterminatedStartTag, elemDecl->getFullName()); return false; } else { // Something went really wrong return false; } } // must set the newly-minted value on the XMLAttr: curAtt->setValue(fAttValueBuf.getRawBuffer()); // Now that its all stretched out, lets look at its type and // determine if it has a valid value. It will output any needed // errors, but we just keep going. We only need to do this if // we are validating. if (attDef) { // Let the validator pass judgement on the attribute value if (fValidate) { fValidator->validateAttrValue ( attDef , fAttValueBuf.getRawBuffer() , false , elemDecl ); } } attCount++; // And jump back to the top of the loop continue; } // It was some special case character so do all of the checks and // deal with it. if (!nextCh) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); if (nextCh == chForwardSlash) { fReaderMgr.getNextChar(); isEmpty = true; if (!fReaderMgr.skippedChar(chCloseAngle)) emitError(XMLErrs::UnterminatedStartTag, elemDecl->getFullName()); break; } else if (nextCh == chCloseAngle) { fReaderMgr.getNextChar(); break; } else if (nextCh == chOpenAngle) { // Check for this one specially, since its going to be common // and it is kind of auto-recovering since we've already hit the // next open bracket, which is what we would have seeked to (and // skipped this whole tag.) emitError(XMLErrs::UnterminatedStartTag, elemDecl->getFullName()); break; } else if ((nextCh == chSingleQuote) || (nextCh == chDoubleQuote)) { // Check for this one specially, which is probably a missing // attribute name, e.g. ="value". Just issue expected name // error and eat the quoted string, then jump back to the // top again. emitError(XMLErrs::ExpectedAttrName); fReaderMgr.getNextChar(); fReaderMgr.skipQuotedString(nextCh); fReaderMgr.skipPastSpaces(); continue; } } if(attCount) { // clean up after ourselves: // clear the map used to detect duplicate attributes fUndeclaredAttrRegistry->removeAll(); } // Ok, so lets get an enumerator for the attributes of this element // and run through them for well formedness and validity checks. But // make sure that we had any attributes before we do it, since the list // would have have gotten faulted in anyway. if (elemDecl->hasAttDefs()) { // N.B.: this assumes DTD validation. XMLAttDefList& attDefList = elemDecl->getAttDefList(); for(XMLSize_t i=0; iget(&curDef); if (!attCountPtr || *attCountPtr < fElemCount) { // did not occur if (fValidate) { // If we are validating and its required, then an error if (defType == XMLAttDef::Required) { fValidator->emitError ( XMLValid::RequiredAttrNotProvided , curDef.getFullName() ); } else if ((defType == XMLAttDef::Default) || (defType == XMLAttDef::Fixed) ) { if (fStandalone && curDef.isExternal()) { // XML 1.0 Section 2.9 // Document is standalone, so attributes must not be defaulted. fValidator->emitError(XMLValid::NoDefAttForStandalone, curDef.getFullName(), elemDecl->getFullName()); } } } // Fault in the value if needed, and bump the att count if ((defType == XMLAttDef::Default) || (defType == XMLAttDef::Fixed)) { // Let the validator pass judgement on the attribute value if (fValidate) { fValidator->validateAttrValue ( &curDef , curDef.getValue() , false , elemDecl ); } XMLAttr* curAtt; if (attCount >= curAttListSize) { curAtt = new (fMemoryManager) XMLAttr ( 0 , curDef.getFullName() , XMLUni::fgZeroLenString , curDef.getValue() , curDef.getType() , false , fMemoryManager ); fAttrList->addElement(curAtt); curAttListSize++; } else { curAtt = fAttrList->elementAt(attCount); curAtt->set ( 0 , curDef.getFullName() , XMLUni::fgZeroLenString , curDef.getValue() , curDef.getType() ); curAtt->setSpecified(false); } attCount++; } } } } // If empty, validate content right now if we are validating and then // pop the element stack top. Else, we have to update the current stack // top's namespace mapping elements. if (isEmpty) { // If validating, then insure that its legal to have no content if (fValidate) { XMLSize_t failure; bool res = fValidator->checkContent(elemDecl, 0, 0, &failure); if (!res) { fValidator->emitError ( XMLValid::ElementNotValidForContent , elemDecl->getFullName() , elemDecl->getFormattedContentModel() ); } } // Pop the element stack back off since it'll never be used now fElemStack.popTop(); // If the elem stack is empty, then it was an empty root if (isRoot) gotData = false; else { // Restore the validation flag fValidate = fElemStack.getValidationFlag(); } } // If we have a document handler, then tell it about this start tag. We // don't have any URI id to send along, so send fEmptyNamespaceId. We also do not send // any prefix since its just one big name if we are not doing namespaces. if (fDocHandler) { fDocHandler->startElement ( *elemDecl , fEmptyNamespaceId , 0 , *fAttrList , attCount , isEmpty , isRoot ); } return true; } // This method is called to scan a start tag when we are processing // namespaces. There are two different versions of this method, one for // namespace aware processing and one for non-namespace aware processing. // // This method is called after we've scanned the < of a start tag. So we // have to get the element name, then scan the attributes, after which // we are either going to see >, />, or attributes followed by one of those // sequences. bool IGXMLScanner::scanStartTagNS(bool& gotData) { // Assume we will still have data until proven otherwise. It will only // ever be false if this is the root and its empty. gotData = true; // Reset element content buffer fContent.reset(); // The current position is after the open bracket, so we need to read in // in the element name. int prefixColonPos; if (!fReaderMgr.getQName(fQNameBuf, &prefixColonPos)) { if (fQNameBuf.isEmpty()) emitError(XMLErrs::ExpectedElementName); else emitError(XMLErrs::InvalidElementName, fQNameBuf.getRawBuffer()); fReaderMgr.skipToChar(chOpenAngle); return false; } // See if its the root element const bool isRoot = fElemStack.isEmpty(); // Skip any whitespace after the name fReaderMgr.skipPastSpaces(); // First we have to do the rawest attribute scan. We don't do any // normalization of them at all, since we don't know yet what type they // might be (since we need the element decl in order to do that.) bool isEmpty; XMLSize_t attCount = rawAttrScan ( fQNameBuf.getRawBuffer() , *fRawAttrList , isEmpty ); // save the contentleafname and currentscope before addlevel, for later use ContentLeafNameTypeVector* cv = 0; XMLContentModel* cm = 0; unsigned int currentScope = Grammar::TOP_LEVEL_SCOPE; bool laxThisOne = false; if (!isRoot && fGrammarType == Grammar::SchemaGrammarType) { // schema validator will have correct type if validating SchemaElementDecl* tempElement = (SchemaElementDecl*) fElemStack.topElement()->fThisElement; SchemaElementDecl::ModelTypes modelType = tempElement->getModelType(); ComplexTypeInfo *currType = 0; if (fValidate) { currType = ((SchemaValidator*)fValidator)->getCurrentTypeInfo(); if (currType) modelType = (SchemaElementDecl::ModelTypes)currType->getContentType(); else // something must have gone wrong modelType = SchemaElementDecl::Any; } else { currType = tempElement->getComplexTypeInfo(); } if ((modelType == SchemaElementDecl::Mixed_Simple) || (modelType == SchemaElementDecl::Mixed_Complex) || (modelType == SchemaElementDecl::Children)) { cm = currType->getContentModel(); cv = cm->getContentLeafNameTypeVector(); currentScope = fElemStack.getCurrentScope(); } else if (modelType == SchemaElementDecl::Any) { laxThisOne = true; } } // Now, since we might have to update the namespace map for this element, // but we don't have the element decl yet, we just tell the element stack // to expand up to get ready. XMLSize_t elemDepth = fElemStack.addLevel(); fElemStack.setValidationFlag(fValidate); fElemStack.setPrefixColonPos(prefixColonPos); // Check if there is any external schema location specified, and if we are at root, // go through them first before scanning those specified in the instance document if (isRoot && fDoSchema && (fExternalSchemaLocation || fExternalNoNamespaceSchemaLocation)) { if (fExternalSchemaLocation) parseSchemaLocation(fExternalSchemaLocation, true); if (fExternalNoNamespaceSchemaLocation) resolveSchemaGrammar(fExternalNoNamespaceSchemaLocation, XMLUni::fgZeroLenString, true); } // Make an initial pass through the list and find any xmlns attributes or // schema attributes. if (attCount) { scanRawAttrListforNameSpaces(attCount); } // Also find any default or fixed xmlns attributes in DTD defined for // this element. XMLElementDecl* elemDecl = 0; const XMLCh* qnameRawBuf = fQNameBuf.getRawBuffer(); if (fGrammarType == Grammar::DTDGrammarType) { if (!fSkipDTDValidation) { elemDecl = fGrammar->getElemDecl( fEmptyNamespaceId, 0, qnameRawBuf, Grammar::TOP_LEVEL_SCOPE ); if (elemDecl) { if (elemDecl->hasAttDefs()) { XMLAttDefList& attDefList = elemDecl->getAttDefList(); for(XMLSize_t i=0; igetByKey(qnameRawBuf); } } // Resolve the qualified name to a URI and name so that we can look up // the element decl for this element. We have now update the prefix to // namespace map so we should get the correct element now. unsigned int uriId = resolveQNameWithColon( qnameRawBuf, fPrefixBuf, ElemStack::Mode_Element, prefixColonPos ); //if schema, check if we should lax or skip the validation of this element bool parentValidation = fValidate; if (cv) { QName element(fPrefixBuf.getRawBuffer(), &qnameRawBuf[prefixColonPos + 1], uriId, fMemoryManager); // elementDepth will be > 0, as cv is only constructed if element is not // root. laxThisOne = laxElementValidation(&element, cv, cm, elemDepth - 1); } // Look up the element now in the grammar. This will get us back a // generic element decl object. We tell him to fault one in if he does // not find it. bool wasAdded = false; const XMLCh* nameRawBuf = &qnameRawBuf[prefixColonPos + 1]; if (fDoSchema) { if (fGrammarType == Grammar::DTDGrammarType) { if (!switchGrammar(getURIText(uriId))) { fValidator->emitError( XMLValid::GrammarNotFound, getURIText(uriId) ); } } if (fGrammarType == Grammar::SchemaGrammarType) { elemDecl = fGrammar->getElemDecl( uriId, nameRawBuf, qnameRawBuf, currentScope ); // if not found, then it may be a reference, try TOP_LEVEL_SCOPE if (!elemDecl) { bool checkTopLevel = (currentScope != Grammar::TOP_LEVEL_SCOPE); const XMLCh* original_uriStr = fGrammar->getTargetNamespace(); unsigned int orgGrammarUri = fURIStringPool->getId(original_uriStr); if (orgGrammarUri != uriId) { if (switchGrammar(getURIText(uriId))) { checkTopLevel = true; } else { // the laxElementValidation routine (called above) will // set fValidate to false for a "skipped" element if (!laxThisOne && fValidate) { fValidator->emitError( XMLValid::GrammarNotFound, getURIText(uriId) ); } checkTopLevel = false; } } if (checkTopLevel) { elemDecl = fGrammar->getElemDecl( uriId, nameRawBuf, qnameRawBuf, Grammar::TOP_LEVEL_SCOPE ); } if (!elemDecl && currentScope != Grammar::TOP_LEVEL_SCOPE) { if (orgGrammarUri == uriId) { // still not found in specified uri // try emptyNamespace see if element should be // un-qualified. // Use a temp variable until we decide this is the case if (uriId != fEmptyNamespaceId) { XMLElementDecl* tempElemDecl = fGrammar->getElemDecl( fEmptyNamespaceId, nameRawBuf, qnameRawBuf, currentScope ); if (tempElemDecl && tempElemDecl->getCreateReason() != XMLElementDecl::JustFaultIn && fValidate) { fValidator->emitError( XMLValid::ElementNotUnQualified, qnameRawBuf ); elemDecl = tempElemDecl; } } } // still Not found in specified uri // go to original Grammar again to see if element needs // to be fully qualified. // Use a temp variable until we decide this is the case else if (uriId == fEmptyNamespaceId) { if (switchGrammar(original_uriStr)) { XMLElementDecl* tempElemDecl = fGrammar->getElemDecl( orgGrammarUri, nameRawBuf, qnameRawBuf, currentScope ); if (tempElemDecl && tempElemDecl->getCreateReason() != XMLElementDecl::JustFaultIn && fValidate) { fValidator->emitError( XMLValid::ElementNotQualified, qnameRawBuf ); elemDecl = tempElemDecl; } } else if (!laxThisOne && fValidate) { fValidator->emitError( XMLValid::GrammarNotFound,original_uriStr ); } } } if (!elemDecl) { // still not found // switch back to original grammar first if necessary if (orgGrammarUri != uriId) { switchGrammar(original_uriStr); } // look in the list of undeclared elements, as would have been // done before we made grammars stateless: elemDecl = fSchemaElemNonDeclPool->getByKey( nameRawBuf, uriId, (int)Grammar::TOP_LEVEL_SCOPE ); } } } } if (!elemDecl) { if (fGrammarType == Grammar::DTDGrammarType) { elemDecl = new (fMemoryManager) DTDElementDecl( qnameRawBuf, uriId, DTDElementDecl::Any, fMemoryManager ); elemDecl->setId(fDTDElemNonDeclPool->put((DTDElementDecl*)elemDecl)); } else if (fGrammarType == Grammar::SchemaGrammarType) { elemDecl = new (fMemoryManager) SchemaElementDecl( fPrefixBuf.getRawBuffer(), nameRawBuf, uriId , SchemaElementDecl::Any, Grammar::TOP_LEVEL_SCOPE , fMemoryManager ); elemDecl->setId( fSchemaElemNonDeclPool->put((void*)elemDecl->getBaseName() , uriId, (int)Grammar::TOP_LEVEL_SCOPE, (SchemaElementDecl*)elemDecl) ); } else { fValidator->emitError( XMLValid::GrammarNotFound, getURIText(uriId) ); } wasAdded = true; } // this info needed for DOMTypeInfo fPSVIElemContext.fErrorOccurred = false; // We do something different here according to whether we found the // element or not. bool bXsiTypeSet= (fValidator && fGrammarType == Grammar::SchemaGrammarType)?((SchemaValidator*)fValidator)->getIsXsiTypeSet():false; if (wasAdded) { if (laxThisOne && !bXsiTypeSet) { fValidate = false; fElemStack.setValidationFlag(fValidate); } else if (fValidate) { // If validating then emit an error // This is to tell the reuse Validator that this element was // faulted-in, was not an element in the grammar pool originally elemDecl->setCreateReason(XMLElementDecl::JustFaultIn); // xsi:type was specified, don't complain about missing definition if(!bXsiTypeSet) { fValidator->emitError ( XMLValid::ElementNotDefined , elemDecl->getFullName() ); if(fGrammarType == Grammar::SchemaGrammarType) { fPSVIElemContext.fErrorOccurred = true; } } } } else { // If its not marked declared and validating, then emit an error if (!elemDecl->isDeclared()) { if(elemDecl->getCreateReason() == XMLElementDecl::NoReason) { if(!bXsiTypeSet && fGrammarType == Grammar::SchemaGrammarType) { fPSVIElemContext.fErrorOccurred = true; } } if (laxThisOne) { fValidate = false; fElemStack.setValidationFlag(fValidate); } else if (fValidate && !bXsiTypeSet) { fValidator->emitError ( XMLValid::ElementNotDefined , elemDecl->getFullName() ); } } } // Now we can update the element stack to set the current element // decl. We expanded the stack above, but couldn't store the element // decl because we didn't know it yet. fElemStack.setElement(elemDecl, fReaderMgr.getCurrentReaderNum()); fElemStack.setCurrentURI(uriId); if (isRoot) { fRootGrammar = fGrammar; if (fGrammarType == Grammar::SchemaGrammarType && !fRootElemName) fRootElemName = XMLString::replicate(qnameRawBuf, fMemoryManager); } if (fGrammarType == Grammar::SchemaGrammarType && fPSVIHandler) { fPSVIElemContext.fElemDepth++; if (elemDecl->isDeclared()) { fPSVIElemContext.fNoneValidationDepth = fPSVIElemContext.fElemDepth; } else { fPSVIElemContext.fFullValidationDepth = fPSVIElemContext.fElemDepth; /****** * While we report an error for historical reasons, this should * actually result in lax assessment - NG. if (isRoot && fValidate) fPSVIElemContext.fErrorOccurred = true; *****/ } } // Validate the element if (fValidate) { fValidator->validateElement(elemDecl); if (fValidator->handlesSchema()) { if (((SchemaValidator*) fValidator)->getErrorOccurred()) fPSVIElemContext.fErrorOccurred = true; } } if (fGrammarType == Grammar::SchemaGrammarType) { // squirrel away the element's QName, so that we can do an efficient // end-tag match fElemStack.setCurrentSchemaElemName(fQNameBuf.getRawBuffer()); ComplexTypeInfo* typeinfo = (fValidate) ? ((SchemaValidator*)fValidator)->getCurrentTypeInfo() : ((SchemaElementDecl*) elemDecl)->getComplexTypeInfo(); if (typeinfo) { currentScope = typeinfo->getScopeDefined(); // switch grammar if the typeinfo has a different grammar (happens when there is xsi:type) XMLCh* typeName = typeinfo->getTypeName(); const int comma = XMLString::indexOf(typeName, chComma); if (comma > 0) { XMLBuffer prefixBuf(comma+1, fMemoryManager); prefixBuf.append(typeName, comma); const XMLCh* uriStr = prefixBuf.getRawBuffer(); bool errorCondition = !switchGrammar(uriStr) && fValidate; if (errorCondition && !laxThisOne) { fValidator->emitError ( XMLValid::GrammarNotFound , prefixBuf.getRawBuffer() ); } } else if (comma == 0) { bool errorCondition = !switchGrammar(XMLUni::fgZeroLenString) && fValidate; if (errorCondition && !laxThisOne) { fValidator->emitError ( XMLValid::GrammarNotFound , XMLUni::fgZeroLenString ); } } } fElemStack.setCurrentScope(currentScope); // Set element next state if (elemDepth >= fElemStateSize) { resizeElemState(); } fElemState[elemDepth] = 0; fElemLoopState[elemDepth] = 0; } fElemStack.setCurrentGrammar(fGrammar); // If this is the first element and we are validating, check the root // element. if (isRoot) { if (fValidate) { // If a DocType exists, then check if it matches the root name there. if (fRootElemName && !XMLString::equals(qnameRawBuf, fRootElemName)) fValidator->emitError(XMLValid::RootElemNotLikeDocType); } } else if (parentValidation) { // If the element stack is not empty, then add this element as a // child of the previous top element. If its empty, this is the root // elem and is not the child of anything. fElemStack.addChild(elemDecl->getElementName(), true); } // PSVI handling: even if it turns out there are // no attributes, we need to reset this list... if(getPSVIHandler() && fGrammarType == Grammar::SchemaGrammarType ) fPSVIAttrList->reset(); // Now lets get the fAttrList filled in. This involves faulting in any // defaulted and fixed attributes and normalizing the values of any that // we got explicitly. // // We update the attCount value with the total number of attributes, but // it goes in with the number of values we got during the raw scan of // explictly provided attrs above. attCount = buildAttList(*fRawAttrList, attCount, elemDecl, *fAttrList); if(attCount) { // clean up after ourselves: // clear the map used to detect duplicate attributes fUndeclaredAttrRegistry->removeAll(); } // activate identity constraints if (fGrammar && fGrammarType == Grammar::SchemaGrammarType && toCheckIdentityConstraint()) { fICHandler->activateIdentityConstraint ( (SchemaElementDecl*) elemDecl , (int) elemDepth , uriId , fPrefixBuf.getRawBuffer() , *fAttrList , attCount , fValidationContext ); } // Since the element may have default values, call start tag now regardless if it is empty or not // If we have a document handler, then tell it about this start tag if (fDocHandler) { fDocHandler->startElement ( *elemDecl , uriId , fPrefixBuf.getRawBuffer() , *fAttrList , attCount , false , isRoot ); } // if we have a PSVIHandler, now's the time to call // its handleAttributesPSVI method: if(fPSVIHandler && fGrammarType == Grammar::SchemaGrammarType) { QName *eName = elemDecl->getElementName(); fPSVIHandler->handleAttributesPSVI ( eName->getLocalPart() , fURIStringPool->getValueForId(eName->getURI()) , fPSVIAttrList ); } // If empty, validate content right now if we are validating and then // pop the element stack top. Else, we have to update the current stack // top's namespace mapping elements. if (isEmpty) { // Pop the element stack back off since it'll never be used now fElemStack.popTop(); // reset current type info DatatypeValidator* psviMemberType = 0; if (fGrammarType == Grammar::SchemaGrammarType) { if (fValidate && elemDecl->isDeclared()) { fPSVIElemContext.fCurrentTypeInfo = ((SchemaValidator*) fValidator)->getCurrentTypeInfo(); if(!fPSVIElemContext.fCurrentTypeInfo) fPSVIElemContext.fCurrentDV = ((SchemaValidator*) fValidator)->getCurrentDatatypeValidator(); else fPSVIElemContext.fCurrentDV = 0; if(fPSVIHandler) { fPSVIElemContext.fNormalizedValue = ((SchemaValidator*) fValidator)->getNormalizedValue(); if (XMLString::equals(fPSVIElemContext.fNormalizedValue, XMLUni::fgZeroLenString)) fPSVIElemContext.fNormalizedValue = 0; } } else { fPSVIElemContext.fCurrentDV = 0; fPSVIElemContext.fCurrentTypeInfo = 0; fPSVIElemContext.fNormalizedValue = 0; } } // If validating, then insure that its legal to have no content if (fValidate) { XMLSize_t failure; bool res = fValidator->checkContent(elemDecl, 0, 0, &failure); if (!res) { fValidator->emitError ( XMLValid::ElementNotValidForContent , elemDecl->getFullName() , elemDecl->getFormattedContentModel() ); } if (fGrammarType == Grammar::SchemaGrammarType) { if (((SchemaValidator*) fValidator)->getErrorOccurred()) { fPSVIElemContext.fErrorOccurred = true; } else { if (fPSVIHandler) { fPSVIElemContext.fIsSpecified = ((SchemaValidator*) fValidator)->getIsElemSpecified(); if(fPSVIElemContext.fIsSpecified) fPSVIElemContext.fNormalizedValue = ((SchemaElementDecl *)elemDecl)->getDefaultValue(); } // note that if we're empty, won't be a current DV if (fPSVIElemContext.fCurrentDV && fPSVIElemContext.fCurrentDV->getType() == DatatypeValidator::Union) psviMemberType = fValidationContext->getValidatingMemberType(); } // call matchers and de-activate context if (toCheckIdentityConstraint()) { fICHandler->deactivateContext ( (SchemaElementDecl *) elemDecl , fContent.getRawBuffer() , fValidationContext , fPSVIElemContext.fCurrentDV ); } } } else if (fGrammarType == Grammar::SchemaGrammarType) { ((SchemaValidator*)fValidator)->resetNillable(); } if (fGrammarType == Grammar::SchemaGrammarType) { if (fPSVIHandler) { endElementPSVI((SchemaElementDecl*)elemDecl, psviMemberType); } } // If we have a doc handler, tell it about the end tag if (fDocHandler) { fDocHandler->endElement ( *elemDecl , uriId , isRoot , fPrefixBuf.getRawBuffer() ); } // If the elem stack is empty, then it was an empty root if (isRoot) gotData = false; else { // Restore the grammar fGrammar = fElemStack.getCurrentGrammar(); fGrammarType = fGrammar->getGrammarType(); if (fGrammarType == Grammar::SchemaGrammarType && !fValidator->handlesSchema()) { if (fValidatorFromUser) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Gen_NoSchemaValidator, fMemoryManager); else { fValidator = fSchemaValidator; } } else if (fGrammarType == Grammar::DTDGrammarType && !fValidator->handlesDTD()) { if (fValidatorFromUser) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Gen_NoDTDValidator, fMemoryManager); else { fValidator = fDTDValidator; } } fValidator->setGrammar(fGrammar); // Restore the validation flag fValidate = fElemStack.getValidationFlag(); } } else if (fGrammarType == Grammar::SchemaGrammarType) { // send a partial element psvi if (fPSVIHandler) { ComplexTypeInfo* curTypeInfo = 0; DatatypeValidator* curDV = 0; XSTypeDefinition* typeDef = 0; if (fValidate && elemDecl->isDeclared()) { curTypeInfo = ((SchemaValidator*) fValidator)->getCurrentTypeInfo(); if (curTypeInfo) { typeDef = (XSTypeDefinition*) fModel->getXSObject(curTypeInfo); } else { curDV = ((SchemaValidator*) fValidator)->getCurrentDatatypeValidator(); if (curDV) { typeDef = (XSTypeDefinition*) fModel->getXSObject(curDV); } } } fPSVIElement->reset ( PSVIElement::VALIDITY_NOTKNOWN , PSVIElement::VALIDATION_NONE , fRootElemName , ((SchemaValidator*) fValidator)->getIsElemSpecified() , (elemDecl->isDeclared()) ? (XSElementDeclaration*) fModel->getXSObject(elemDecl) : 0 , typeDef , 0 //memberType , fModel , ((SchemaElementDecl*)elemDecl)->getDefaultValue() , 0 , 0 , 0 ); fPSVIHandler->handlePartialElementPSVI ( elemDecl->getBaseName() , fURIStringPool->getValueForId(elemDecl->getURI()) , fPSVIElement ); } // not empty fErrorStack->push(fPSVIElemContext.fErrorOccurred); } return true; } // --------------------------------------------------------------------------- // IGXMLScanner: Helper methos // --------------------------------------------------------------------------- void IGXMLScanner::resizeElemState() { unsigned int newSize = fElemStateSize * 2; unsigned int* newElemState = (unsigned int*) fMemoryManager->allocate ( newSize * sizeof(unsigned int) ); //new unsigned int[newSize]; unsigned int* newElemLoopState = (unsigned int*) fMemoryManager->allocate ( newSize * sizeof(unsigned int) ); //new unsigned int[newSize]; // Copy the existing values unsigned int index = 0; for (; index < fElemStateSize; index++) { newElemState[index] = fElemState[index]; newElemLoopState[index] = fElemLoopState[index]; } for (; index < newSize; index++) newElemLoopState[index] = newElemState[index] = 0; // Delete the old array and udpate our members fMemoryManager->deallocate(fElemState); //delete [] fElemState; fMemoryManager->deallocate(fElemLoopState); //delete [] fElemState; fElemState = newElemState; fElemLoopState = newElemLoopState; fElemStateSize = newSize; } void IGXMLScanner::resizeRawAttrColonList() { unsigned int newSize = fRawAttrColonListSize * 2; int* newRawAttrColonList = (int*) fMemoryManager->allocate ( newSize * sizeof(int) ); //new int[newSize]; // Copy the existing values unsigned int index = 0; for (; index < fRawAttrColonListSize; index++) newRawAttrColonList[index] = fRawAttrColonList[index]; // Delete the old array and udpate our members fMemoryManager->deallocate(fRawAttrColonList); //delete [] fRawAttrColonList; fRawAttrColonList = newRawAttrColonList; fRawAttrColonListSize = newSize; } // --------------------------------------------------------------------------- // IGXMLScanner: Grammar preparsing // --------------------------------------------------------------------------- Grammar* IGXMLScanner::loadGrammar(const InputSource& src , const short grammarType , const bool toCache) { Grammar* loadedGrammar = 0; ReaderMgrResetType resetReaderMgr(&fReaderMgr, &ReaderMgr::reset); try { fGrammarResolver->cacheGrammarFromParse(false); // if the new grammar has to be cached, better use the already cached // grammars, or the an exception will be thrown when caching an already // cached grammar fGrammarResolver->useCachedGrammarInParse(toCache); fRootGrammar = 0; if (fValScheme == Val_Auto) { fValidate = true; } // Reset some status flags fInException = false; fStandalone = false; fErrorCount = 0; fHasNoDTD = true; fSeeXsi = false; if (grammarType == Grammar::SchemaGrammarType) { loadedGrammar = loadXMLSchemaGrammar(src, toCache); } else if (grammarType == Grammar::DTDGrammarType) { loadedGrammar = loadDTDGrammar(src, toCache); } } // NOTE: // // In all of the error processing below, the emitError() call MUST come // before the flush of the reader mgr, or it will fail because it tries // to find out the position in the XML source of the error. catch(const XMLErrs::Codes) { // This is a 'first fatal error' type exit, so fall through } catch(const XMLValid::Codes) { // This is a 'first fatal error' type exit, so fall through } catch(const XMLException& excToCatch) { // Emit the error and catch any user exception thrown from here. Make // sure in all cases we flush the reader manager. fInException = true; try { if (excToCatch.getErrorType() == XMLErrorReporter::ErrType_Warning) emitError ( XMLErrs::XMLException_Warning , excToCatch.getCode() , excToCatch.getMessage() ); else if (excToCatch.getErrorType() >= XMLErrorReporter::ErrType_Fatal) emitError ( XMLErrs::XMLException_Fatal , excToCatch.getCode() , excToCatch.getMessage() ); else emitError ( XMLErrs::XMLException_Error , excToCatch.getCode() , excToCatch.getMessage() ); } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } return loadedGrammar; } void IGXMLScanner::resetCachedGrammar () { fCachedSchemaInfoList->removeAll (); } Grammar* IGXMLScanner::loadDTDGrammar(const InputSource& src, const bool toCache) { // Reset the validators fDTDValidator->reset(); if (fValidatorFromUser) fValidator->reset(); if (!fValidator->handlesDTD()) { if (fValidatorFromUser && fValidate) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Gen_NoDTDValidator, fMemoryManager); else { fValidator = fDTDValidator; } } fDTDGrammar = (DTDGrammar*) fGrammarResolver->getGrammar(XMLUni::fgDTDEntityString); if (fDTDGrammar) { fDTDGrammar->reset(); } else { fDTDGrammar = new (fGrammarPoolMemoryManager) DTDGrammar(fGrammarPoolMemoryManager); fGrammarResolver->putGrammar(fDTDGrammar); } fGrammar = fDTDGrammar; fGrammarType = fGrammar->getGrammarType(); fValidator->setGrammar(fGrammar); // And for all installed handlers, send reset events. This gives them // a chance to flush any cached data. if (fDocHandler) fDocHandler->resetDocument(); if (fEntityHandler) fEntityHandler->resetEntities(); if (fErrorReporter) fErrorReporter->resetErrors(); // Clear out the id reference list resetValidationContext(); // and clear out the darned undeclared DTD element pool... fDTDElemNonDeclPool->removeAll(); if (toCache) { unsigned int sysId = fGrammarResolver->getStringPool()->addOrFind(src.getSystemId()); const XMLCh* sysIdStr = fGrammarResolver->getStringPool()->getValueForId(sysId); fGrammarResolver->orphanGrammar(XMLUni::fgDTDEntityString); ((XMLDTDDescription*) (fGrammar->getGrammarDescription()))->setSystemId(sysIdStr); fGrammarResolver->putGrammar(fGrammar); } // Handle the creation of the XML reader object for this input source. // This will provide us with transcoding and basic lexing services. XMLReader* newReader = fReaderMgr.createReader ( src , false , XMLReader::RefFrom_NonLiteral , XMLReader::Type_General , XMLReader::Source_External , fCalculateSrcOfs , fLowWaterMark ); if (!newReader) { if (src.getIssueFatalErrorIfNotFound()) ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Scan_CouldNotOpenSource, src.getSystemId(), fMemoryManager); else ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Scan_CouldNotOpenSource_Warning, src.getSystemId(), fMemoryManager); } // In order to make the processing work consistently, we have to // make this look like an external entity. So create an entity // decl and fill it in and push it with the reader, as happens // with an external entity. Put a janitor on it to insure it gets // cleaned up. The reader manager does not adopt them. const XMLCh gDTDStr[] = { chLatin_D, chLatin_T, chLatin_D , chNull }; DTDEntityDecl* declDTD = new (fMemoryManager) DTDEntityDecl(gDTDStr, false, fMemoryManager); declDTD->setSystemId(src.getSystemId()); declDTD->setIsExternal(true); Janitor janDecl(declDTD); // Mark this one as a throw at end newReader->setThrowAtEnd(true); // And push it onto the stack, with its pseudo name fReaderMgr.pushReader(newReader, declDTD); // If we have a doc type handler and advanced callbacks are enabled, // call the doctype event. if (fDocTypeHandler) { // Create a dummy root DTDElementDecl* rootDecl = new (fGrammarPoolMemoryManager) DTDElementDecl ( gDTDStr , fEmptyNamespaceId , DTDElementDecl::Any , fGrammarPoolMemoryManager ); rootDecl->setCreateReason(DTDElementDecl::AsRootElem); rootDecl->setExternalElemDeclaration(true); Janitor janSrc(rootDecl); fDocTypeHandler->doctypeDecl(*rootDecl, src.getPublicId(), src.getSystemId(), false, true); } // Create DTDScanner DTDScanner dtdScanner ( (DTDGrammar*) fGrammar , fDocTypeHandler , fGrammarPoolMemoryManager , fMemoryManager ); dtdScanner.setScannerInfo(this, &fReaderMgr, &fBufMgr); // Tell it its not in an include section dtdScanner.scanExtSubsetDecl(false, true); if (fValidate) { // validate the DTD scan so far fValidator->preContentValidation(false, true); } if (toCache) fGrammarResolver->cacheGrammars(); return fDTDGrammar; } // --------------------------------------------------------------------------- // IGXMLScanner: Helper methods // --------------------------------------------------------------------------- void IGXMLScanner::processSchemaLocation(XMLCh* const schemaLoc) { XMLCh* locStr = schemaLoc; XMLReader* curReader = fReaderMgr.getCurrentReader(); fLocationPairs->removeAllElements(); while (*locStr) { do { // Do we have an escaped character ? if (*locStr == 0xFFFF) continue; if (!curReader->isWhitespace(*locStr)) break; *locStr = chNull; } while (*++locStr); if (*locStr) { fLocationPairs->addElement(locStr); while (*++locStr) { // Do we have an escaped character ? if (*locStr == 0xFFFF) continue; if (curReader->isWhitespace(*locStr)) break; } } } } void IGXMLScanner::endElementPSVI(SchemaElementDecl* const elemDecl, DatatypeValidator* const memberDV) { PSVIElement::ASSESSMENT_TYPE validationAttempted; PSVIElement::VALIDITY_STATE validity = PSVIElement::VALIDITY_NOTKNOWN; if (fPSVIElemContext.fElemDepth > fPSVIElemContext.fFullValidationDepth) validationAttempted = PSVIElement::VALIDATION_FULL; else if (fPSVIElemContext.fElemDepth > fPSVIElemContext.fNoneValidationDepth) validationAttempted = PSVIElement::VALIDATION_NONE; else { validationAttempted = PSVIElement::VALIDATION_PARTIAL; fPSVIElemContext.fFullValidationDepth = fPSVIElemContext.fNoneValidationDepth = fPSVIElemContext.fElemDepth - 1; } if (fValidate && elemDecl->isDeclared()) { validity = (fPSVIElemContext.fErrorOccurred) ? PSVIElement::VALIDITY_INVALID : PSVIElement::VALIDITY_VALID; } XSTypeDefinition* typeDef = 0; bool isMixed = false; if (fPSVIElemContext.fCurrentTypeInfo) { typeDef = (XSTypeDefinition*) fModel->getXSObject(fPSVIElemContext.fCurrentTypeInfo); SchemaElementDecl::ModelTypes modelType = (SchemaElementDecl::ModelTypes)fPSVIElemContext.fCurrentTypeInfo->getContentType(); isMixed = (modelType == SchemaElementDecl::Mixed_Simple || modelType == SchemaElementDecl::Mixed_Complex); } else if (fPSVIElemContext.fCurrentDV) typeDef = (XSTypeDefinition*) fModel->getXSObject(fPSVIElemContext.fCurrentDV); XMLCh* canonicalValue = 0; if (fPSVIElemContext.fNormalizedValue && !isMixed && validity == PSVIElement::VALIDITY_VALID) { if (memberDV) canonicalValue = (XMLCh*) memberDV->getCanonicalRepresentation(fPSVIElemContext.fNormalizedValue, fMemoryManager); else if (fPSVIElemContext.fCurrentDV) canonicalValue = (XMLCh*) fPSVIElemContext.fCurrentDV->getCanonicalRepresentation(fPSVIElemContext.fNormalizedValue, fMemoryManager); } fPSVIElement->reset ( validity , validationAttempted , fRootElemName , fPSVIElemContext.fIsSpecified , (elemDecl->isDeclared()) ? (XSElementDeclaration*) fModel->getXSObject(elemDecl) : 0 , typeDef , (memberDV) ? (XSSimpleTypeDefinition*) fModel->getXSObject(memberDV) : 0 , fModel , elemDecl->getDefaultValue() , fPSVIElemContext.fNormalizedValue , canonicalValue ); fPSVIHandler->handleElementPSVI ( elemDecl->getBaseName() , fURIStringPool->getValueForId(elemDecl->getURI()) , fPSVIElement ); // decrease element depth fPSVIElemContext.fElemDepth--; } void IGXMLScanner::resetPSVIElemContext() { fPSVIElemContext.fIsSpecified = false; fPSVIElemContext.fErrorOccurred = false; fPSVIElemContext.fElemDepth = -1; fPSVIElemContext.fFullValidationDepth = -1; fPSVIElemContext.fNoneValidationDepth = -1; fPSVIElemContext.fCurrentDV = 0; fPSVIElemContext.fCurrentTypeInfo = 0; fPSVIElemContext.fNormalizedValue = 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/BinMemOutputStream.hpp000644 000765 000024 00000007066 13241160334 024365 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BinMemOutputStream.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_BINMEMOUTPUTSTREAM_HPP) #define XERCESC_INCLUDE_GUARD_BINMEMOUTPUTSTREAM_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT BinMemOutputStream : public BinOutputStream { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- ~BinMemOutputStream(); BinMemOutputStream ( XMLSize_t initCapacity = 1023 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); // ----------------------------------------------------------------------- // Implementation of the output stream interface // ----------------------------------------------------------------------- virtual XMLFilePos curPos() const; virtual void writeBytes ( const XMLByte* const toGo , const XMLSize_t maxToWrite ) ; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- const XMLByte* getRawBuffer() const; XMLFilePos getSize() const; void reset(); private : // ----------------------------------------------------------------------- // Unimplemented methods. // ----------------------------------------------------------------------- BinMemOutputStream(const BinMemOutputStream&); BinMemOutputStream& operator=(const BinMemOutputStream&); // ----------------------------------------------------------------------- // Private helpers // ----------------------------------------------------------------------- void ensureCapacity(const XMLSize_t extraNeeded); // ----------------------------------------------------------------------- // Private data members // // fDataBuf // The pointer to the buffer data. Its grown as needed. Its always // one larger than fCapacity, to leave room for the null terminator. // // fIndex // The current index into the buffer, as characters are appended // to it. If its zero, then the buffer is empty. // // fCapacity // The current capacity of the buffer. Its actually always one // larger, to leave room for the null terminator. // // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; XMLByte* fDataBuf; XMLSize_t fIndex; XMLSize_t fCapacity; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/VecAttrListImpl.cpp000644 000765 000024 00000011435 13241160334 023635 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: VecAttrListImpl.cpp 672273 2008-06-27 13:57:00Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- VecAttrListImpl::VecAttrListImpl() : fAdopt(false) , fCount(0) , fVector(0) { } VecAttrListImpl::~VecAttrListImpl() { // // Note that some compilers can't deal with the fact that the pointer // is to a const object, so we have to cast off the const'ness here! // if (fAdopt) delete (RefVectorOf*)fVector; } // --------------------------------------------------------------------------- // Implementation of the attribute list interface // --------------------------------------------------------------------------- XMLSize_t VecAttrListImpl::getLength() const { return fCount; } const XMLCh* VecAttrListImpl::getName(const XMLSize_t index) const { if (index >= fCount) { return 0; } return fVector->elementAt(index)->getQName(); } const XMLCh* VecAttrListImpl::getType(const XMLSize_t index) const { if (index >= fCount) { return 0; } return XMLAttDef::getAttTypeString(fVector->elementAt(index)->getType(), fVector->getMemoryManager()); } const XMLCh* VecAttrListImpl::getValue(const XMLSize_t index) const { if (index >= fCount) { return 0; } return fVector->elementAt(index)->getValue(); } const XMLCh* VecAttrListImpl::getType(const XMLCh* const name) const { // // Search the vector for the attribute with the given name and return // its type. // for (XMLSize_t index = 0; index < fCount; index++) { const XMLAttr* curElem = fVector->elementAt(index); if (XMLString::equals(curElem->getQName(), name)) return XMLAttDef::getAttTypeString(curElem->getType(), fVector->getMemoryManager()); } return 0; } const XMLCh* VecAttrListImpl::getValue(const XMLCh* const name) const { // // Search the vector for the attribute with the given name and return // its type. // for (XMLSize_t index = 0; index < fCount; index++) { const XMLAttr* curElem = fVector->elementAt(index); if (XMLString::equals(curElem->getQName(), name)) return curElem->getValue(); } return 0; } const XMLCh* VecAttrListImpl::getValue(const char* const name) const { // Temporarily transcode the name for lookup XMLCh* wideName = XMLString::transcode(name, XMLPlatformUtils::fgMemoryManager); ArrayJanitor janName(wideName, XMLPlatformUtils::fgMemoryManager); // // Search the vector for the attribute with the given name and return // its type. // for (XMLSize_t index = 0; index < fCount; index++) { const XMLAttr* curElem = fVector->elementAt(index); if (XMLString::equals(curElem->getQName(), wideName)) return curElem->getValue(); } return 0; } // --------------------------------------------------------------------------- // Setter methods // --------------------------------------------------------------------------- void VecAttrListImpl::setVector(const RefVectorOf* const srcVec , const XMLSize_t count , const bool adopt) { // // Delete the previous vector (if any) if we are adopting. Note that some // compilers can't deal with the fact that the pointer is to a const // object, so we have to cast off the const'ness here! // if (fAdopt) delete (RefVectorOf*)fVector; fAdopt = adopt; fCount = count; fVector = srcVec; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/XMLReader.cpp000644 000765 000024 00000201761 13241160334 022375 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLReader.cpp 1801896 2017-07-13 22:53:07Z scantor $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLReader: Query Methods // --------------------------------------------------------------------------- // Checks whether all of the chars in the passed buffer are whitespace or // not. Breaks out on the first non-whitespace. // bool XMLReader::isAllSpaces(const XMLCh* const toCheck , const XMLSize_t count) const { const XMLCh* curCh = toCheck; const XMLCh* endPtr = toCheck + count; while (curCh < endPtr) { if (!(fgCharCharsTable[*curCh++] & gWhitespaceCharMask)) return false; } return true; } // // Checks whether at least one of the chars in the passed buffer are whitespace or // not. // bool XMLReader::containsWhiteSpace(const XMLCh* const toCheck , const XMLSize_t count) const { const XMLCh* curCh = toCheck; const XMLCh* endPtr = toCheck + count; while (curCh < endPtr) { if (fgCharCharsTable[*curCh++] & gWhitespaceCharMask) return true; } return false; } // // This one is not called terribly often, so call the XMLChar utility // bool XMLReader::isPublicIdChar(const XMLCh toCheck) const { if (fXMLVersion == XMLV1_1) return XMLChar1_1::isPublicIdChar(toCheck); else return XMLChar1_0::isPublicIdChar(toCheck); } // --------------------------------------------------------------------------- // XMLReader: Constructors and Destructor // --------------------------------------------------------------------------- XMLReader::XMLReader(const XMLCh* const pubId , const XMLCh* const sysId , BinInputStream* const streamToAdopt , const RefFrom from , const Types type , const Sources source , const bool throwAtEnd , const bool calculateSrcOfs , XMLSize_t lowWaterMark , const XMLVersion version , MemoryManager* const manager) : fCharIndex(0) , fCharsAvail(0) , fCurCol(1) , fCurLine(1) , fEncodingStr(0) , fForcedEncoding(false) , fNoMore(false) , fPublicId(XMLString::replicate(pubId, manager)) , fRawBufIndex(0) , fRawBytesAvail(0) , fLowWaterMark (lowWaterMark) , fReaderNum(0xFFFFFFFF) , fRefFrom(from) , fSentTrailingSpace(false) , fSource(source) , fSrcOfsBase(0) , fSrcOfsSupported(false) , fCalculateSrcOfs(calculateSrcOfs) , fSystemId(XMLString::replicate(sysId, manager)) , fStream(streamToAdopt) , fSwapped(false) , fThrowAtEnd(throwAtEnd) , fTranscoder(0) , fType(type) , fMemoryManager(manager) { setXMLVersion(version); // Do an initial load of raw bytes refreshRawBuffer(); // Ask the transcoding service if it supports src offset info fSrcOfsSupported = XMLPlatformUtils::fgTransService->supportsSrcOfs(); // // Use the recognizer class to get a basic sense of what family of // encodings this file is in. We'll start off with a reader of that // type, and update it later if needed when we read the XMLDecl line. // fEncoding = XMLRecognizer::basicEncodingProbe(fRawByteBuf, fRawBytesAvail); #if defined(XERCES_DEBUG) if ((fEncoding < XMLRecognizer::Encodings_Min) || (fEncoding > XMLRecognizer::Encodings_Max)) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Reader_BadAutoEncoding, fMemoryManager); } #endif fEncodingStr = XMLString::replicate(XMLRecognizer::nameForEncoding(fEncoding, fMemoryManager), fMemoryManager); // Check whether the fSwapped flag should be set or not checkForSwapped(); // // This will check to see if the first line is an XMLDecl and, if // so, decode that first line manually one character at a time. This // leaves enough characters in the buffer that the high level code // can get through the Decl and call us back with the real encoding. // doInitDecode(); // // NOTE: We won't create a transcoder until we either get a call to // setEncoding() or we get a call to refreshCharBuffer() and no // transcoder has been set yet. // } XMLReader::XMLReader(const XMLCh* const pubId , const XMLCh* const sysId , BinInputStream* const streamToAdopt , const XMLCh* const encodingStr , const RefFrom from , const Types type , const Sources source , const bool throwAtEnd , const bool calculateSrcOfs , XMLSize_t lowWaterMark , const XMLVersion version , MemoryManager* const manager) : fCharIndex(0) , fCharsAvail(0) , fCurCol(1) , fCurLine(1) , fEncoding(XMLRecognizer::UTF_8) , fEncodingStr(0) , fForcedEncoding(true) , fNoMore(false) , fPublicId(XMLString::replicate(pubId, manager)) , fRawBufIndex(0) , fRawBytesAvail(0) , fLowWaterMark (lowWaterMark) , fReaderNum(0xFFFFFFFF) , fRefFrom(from) , fSentTrailingSpace(false) , fSource(source) , fSrcOfsBase(0) , fSrcOfsSupported(false) , fCalculateSrcOfs(calculateSrcOfs) , fSystemId(XMLString::replicate(sysId, manager)) , fStream(streamToAdopt) , fSwapped(false) , fThrowAtEnd(throwAtEnd) , fTranscoder(0) , fType(type) , fMemoryManager(manager) { setXMLVersion(version); // Do an initial load of raw bytes refreshRawBuffer(); // Copy the encoding string to our member fEncodingStr = XMLString::replicate(encodingStr, fMemoryManager); XMLString::upperCaseASCII(fEncodingStr); // Ask the transcoding service if it supports src offset info fSrcOfsSupported = XMLPlatformUtils::fgTransService->supportsSrcOfs(); // // Map the passed encoding name to one of our enums. If it does not // match one of the intrinsic encodings, it will come back 'other', // which tells us to create a transcoder based reader. // fEncoding = XMLRecognizer::encodingForName(fEncodingStr); // test the presence of the BOM and remove it from the source switch(fEncoding) { case XMLRecognizer::UCS_4B : case XMLRecognizer::UCS_4L : { if (fRawBytesAvail > 4 && (((fRawByteBuf[0] == 0x00) && (fRawByteBuf[1] == 0x00) && (fRawByteBuf[2] == 0xFE) && (fRawByteBuf[3] == 0xFF)) || ((fRawByteBuf[0] == 0xFF) && (fRawByteBuf[1] == 0xFE) && (fRawByteBuf[2] == 0x00) && (fRawByteBuf[3] == 0x00))) ) { fRawBufIndex += 4; } break; } case XMLRecognizer::UTF_8 : { // Look at the raw buffer as short chars const char* asChars = (const char*)fRawByteBuf; if (fRawBytesAvail > XMLRecognizer::fgUTF8BOMLen && XMLString::compareNString( asChars , XMLRecognizer::fgUTF8BOM , XMLRecognizer::fgUTF8BOMLen) == 0) { fRawBufIndex += XMLRecognizer::fgUTF8BOMLen; } break; } case XMLRecognizer::UTF_16B : case XMLRecognizer::UTF_16L : { if (fRawBytesAvail < 2) break; const UTF16Ch* asUTF16 = reinterpret_cast(&fRawByteBuf[fRawBufIndex]); if ((*asUTF16 == chUnicodeMarker) || (*asUTF16 == chSwappedUnicodeMarker)) { fRawBufIndex += sizeof(UTF16Ch); } break; } case XMLRecognizer::EBCDIC: case XMLRecognizer::US_ASCII: case XMLRecognizer::XERCES_XMLCH: case XMLRecognizer::OtherEncoding: case XMLRecognizer::Encodings_Count: { // silence warning about enumeration not being used break; } } // Check whether the fSwapped flag should be set or not checkForSwapped(); // // Create a transcoder for the encoding. Since the encoding has been // forced, this will be the one we will use, period. // XMLTransService::Codes failReason; if (fEncoding == XMLRecognizer::OtherEncoding) { // // fEncodingStr not pre-recognized, use it // directly for transcoder // fTranscoder = XMLPlatformUtils::fgTransService->makeNewTranscoderFor ( fEncodingStr , failReason , kCharBufSize , fMemoryManager ); } else { // // Use the recognized fEncoding to create the transcoder // fTranscoder = XMLPlatformUtils::fgTransService->makeNewTranscoderFor ( fEncoding , failReason , kCharBufSize , fMemoryManager ); } if (!fTranscoder) { // We are about to throw which means the d-tor won't be called. // Clean up some memory. // fMemoryManager->deallocate(fPublicId); fMemoryManager->deallocate(fSystemId); ArrayJanitor jan (fEncodingStr, fMemoryManager); ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Trans_CantCreateCvtrFor , fEncodingStr , fMemoryManager ); } // // Note that, unlike above, we do not do an initial decode of the // first line. We take the caller's word that the encoding is correct // and just assume that the first bulk decode (kicked off by the first // get of a character) will work. // // So we do here the slipping in of the leading space if required. // if ((fType == Type_PE) && (fRefFrom == RefFrom_NonLiteral)) { // This represents no data from the source fCharSizeBuf[fCharsAvail] = 0; fCharOfsBuf[fCharsAvail] = 0; fCharBuf[fCharsAvail++] = chSpace; } } XMLReader::XMLReader(const XMLCh* const pubId , const XMLCh* const sysId , BinInputStream* const streamToAdopt , XMLRecognizer::Encodings encodingEnum , const RefFrom from , const Types type , const Sources source , const bool throwAtEnd , const bool calculateSrcOfs , XMLSize_t lowWaterMark , const XMLVersion version , MemoryManager* const manager) : fCharIndex(0) , fCharsAvail(0) , fCurCol(1) , fCurLine(1) , fEncoding(XMLRecognizer::UTF_8) , fEncodingStr(0) , fForcedEncoding(true) , fNoMore(false) , fPublicId(XMLString::replicate(pubId, manager)) , fRawBufIndex(0) , fRawBytesAvail(0) , fLowWaterMark (lowWaterMark) , fReaderNum(0xFFFFFFFF) , fRefFrom(from) , fSentTrailingSpace(false) , fSource(source) , fSrcOfsBase(0) , fSrcOfsSupported(false) , fCalculateSrcOfs(calculateSrcOfs) , fSystemId(XMLString::replicate(sysId, manager)) , fStream(streamToAdopt) , fSwapped(false) , fThrowAtEnd(throwAtEnd) , fTranscoder(0) , fType(type) , fMemoryManager(manager) { setXMLVersion(version); // Do an initial load of raw bytes refreshRawBuffer(); // Ask the transcoding service if it supports src offset info fSrcOfsSupported = XMLPlatformUtils::fgTransService->supportsSrcOfs(); // // Use the passed encoding code // fEncoding = encodingEnum; fEncodingStr = XMLString::replicate(XMLRecognizer::nameForEncoding(fEncoding, fMemoryManager), fMemoryManager); // Check whether the fSwapped flag should be set or not checkForSwapped(); // // Create a transcoder for the encoding. Since the encoding has been // forced, this will be the one we will use, period. // XMLTransService::Codes failReason; fTranscoder = XMLPlatformUtils::fgTransService->makeNewTranscoderFor ( fEncoding , failReason , kCharBufSize , fMemoryManager ); if (!fTranscoder) { // We are about to throw which means the d-tor won't be called. // Clean up some memory. // fMemoryManager->deallocate(fPublicId); fMemoryManager->deallocate(fSystemId); ArrayJanitor jan (fEncodingStr, fMemoryManager); ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Trans_CantCreateCvtrFor , fEncodingStr , fMemoryManager ); } // // Note that, unlike above, we do not do an initial decode of the // first line. We take the caller's word that the encoding is correct // and just assume that the first bulk decode (kicked off by the first // get of a character) will work. // // So we do here the slipping in of the leading space if required. // if ((fType == Type_PE) && (fRefFrom == RefFrom_NonLiteral)) { // This represents no data from the source fCharSizeBuf[fCharsAvail] = 0; fCharOfsBuf[fCharsAvail] = 0; fCharBuf[fCharsAvail++] = chSpace; } } XMLReader::~XMLReader() { fMemoryManager->deallocate(fEncodingStr); fMemoryManager->deallocate(fPublicId); fMemoryManager->deallocate(fSystemId); delete fStream; delete fTranscoder; } // --------------------------------------------------------------------------- // XMLReader: Character buffer management methods // --------------------------------------------------------------------------- XMLFilePos XMLReader::getSrcOffset() const { if (!fSrcOfsSupported || !fCalculateSrcOfs) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Reader_SrcOfsNotSupported, fMemoryManager); // // Take the current source offset and add in the sizes that we've // eaten from the source so far. // if( fCharIndex == 0 ) { return fSrcOfsBase; } if( fCharIndex < fCharsAvail ) { return (fSrcOfsBase + fCharOfsBuf[fCharIndex]); } return (fSrcOfsBase + fCharOfsBuf[fCharIndex-1] + fCharSizeBuf[fCharIndex-1]); } bool XMLReader::refreshCharBuffer() { // If the no more flag is set, then don't bother doing anything. if (fNoMore) return false; XMLSize_t startInd; // See if we have any existing chars. const XMLSize_t spareChars = fCharsAvail - fCharIndex; // If we are full, then don't do anything. if (spareChars == kCharBufSize) return true; // // If no transcoder has been created yet, then we never saw the // any encoding="" string and the encoding was not forced, so lets // create one now. We know that it won't change now. // // However, note that if we autosensed EBCDIC, then we have to // consider it an error if we never got an encoding since we don't // know what variant of EBCDIC it is. // if (!fTranscoder) { if (fEncoding == XMLRecognizer::EBCDIC) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Reader_EncodingStrRequired, fMemoryManager); // Ask the transcoding service to make use a transcoder XMLTransService::Codes failReason; fTranscoder = XMLPlatformUtils::fgTransService->makeNewTranscoderFor ( fEncodingStr , failReason , kCharBufSize , fMemoryManager ); if (!fTranscoder) { ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Trans_CantCreateCvtrFor , fEncodingStr , fMemoryManager ); } } // // Add the number of source bytes eaten so far to the base src // offset member. // if (fCalculateSrcOfs) { for (startInd = 0; startInd < fCharIndex; startInd++) fSrcOfsBase += fCharSizeBuf[startInd]; } // // If there are spare chars, then move then down to the bottom. We // have to move the char sizes down also. // startInd = 0; if (spareChars) { for (XMLSize_t index = fCharIndex; index < fCharsAvail; index++) { fCharBuf[startInd] = fCharBuf[index]; fCharSizeBuf[startInd] = fCharSizeBuf[index]; startInd++; } } // // And then get more chars, starting after any spare chars that were // left over from the last time. // fCharsAvail = xcodeMoreChars ( &fCharBuf[startInd] , &fCharSizeBuf[startInd] , kCharBufSize - spareChars ); // Add back in the spare chars fCharsAvail += spareChars; // Reset the buffer index to zero, so we start from the 0th char again fCharIndex = 0; // // If no chars available, then we have to check for one last thing. If // this is reader for a PE and its not being expanded inside a literal, // then unget a trailing space. We use a boolean to avoid triggering // this more than once. // if (!fCharsAvail && (fType == Type_PE) && (fRefFrom == RefFrom_NonLiteral) && !fSentTrailingSpace) { fCharBuf[0] = chSpace; fCharsAvail = 1; fSentTrailingSpace = true; } // // If we get here with no more chars, then set the fNoMore flag which // lets us optimize and know without checking that no more chars are // available. // if (!fCharsAvail) fNoMore = true; // Calculate fCharOfsBuf using the elements from fCharBufSize if (fCalculateSrcOfs) { unsigned int last = 0; fCharOfsBuf[0] = 0; for (XMLSize_t index = 1; index < fCharsAvail; ++index) { fCharOfsBuf[index] = last+fCharSizeBuf[index-1]; last = fCharOfsBuf[index]; // code was: // fCharOfsBuf[index] = fCharOfsBuf[index-1]+fCharSizeBuf[index-1]; // but on Solaris 64 bit with sun studio 11 this didn't work as // every value of fCharOfsBuf[] was 1. } } return (fCharsAvail != 0); } // --------------------------------------------------------------------------- // XMLReader: Scanning methods // --------------------------------------------------------------------------- bool XMLReader::getName(XMLBuffer& toFill, const bool token) { // Ok, first lets see if we have chars in the buffer. If not, then lets // reload. if (fCharIndex == fCharsAvail) { if (!refreshCharBuffer()) return false; } XMLSize_t charIndex_start = fCharIndex; // Lets check the first char for being a first name char. If not, then // what's the point in living mannnn? Just give up now. We only do this // if its a name and not a name token that they want. if (!token) { if ((fCharBuf[fCharIndex] >= 0xD800) && (fCharBuf[fCharIndex] <= 0xDB7F)) { // make sure one more char is in the buffer, the transcoder // should put only a complete surrogate pair into the buffer assert(fCharIndex+1 < fCharsAvail); if ((fCharBuf[fCharIndex+1] < 0xDC00) || (fCharBuf[fCharIndex+1] > 0xDFFF)) return false; // Looks ok, so lets eat it fCharIndex += 2; } else { if (!isFirstNameChar(fCharBuf[fCharIndex])) return false; // Looks ok, so lets eat it fCharIndex ++; } } // And now we loop until we run out of data in this reader or we hit // a non-name char. while (true) { while (fCharIndex < fCharsAvail) { // Check the current char and take it if its a name char. Else // break out. if ( (fCharBuf[fCharIndex] >= 0xD800) && (fCharBuf[fCharIndex] <= 0xDB7F) ) { // make sure one more char is in the buffer, the transcoder // should put only a complete surrogate pair into the buffer assert(fCharIndex+1 < fCharsAvail); if ( (fCharBuf[fCharIndex+1] < 0xDC00) || (fCharBuf[fCharIndex+1] > 0xDFFF) ) break; fCharIndex += 2; } else { if (!isNameChar(fCharBuf[fCharIndex])) break; fCharIndex++; } } // we have to copy the accepted character(s), and update column if (fCharIndex != charIndex_start) { fCurCol += (XMLFileLoc)(fCharIndex - charIndex_start); toFill.append(&fCharBuf[charIndex_start], fCharIndex - charIndex_start); } // something is wrong if there is still something in the buffer // or if we don't get no more, then break out. if ((fCharIndex < fCharsAvail) || !refreshCharBuffer()) break; charIndex_start = fCharIndex; } return !toFill.isEmpty(); } bool XMLReader::getNCName(XMLBuffer& toFill) { if (fCharIndex == fCharsAvail && !refreshCharBuffer()) return false; XMLSize_t charIndex_start = fCharIndex, count; // Lets check the first char for being a first name char. If not, then // what's the point in living mannnn? Just give up now. We only do this // if its a name and not a name token that they want. if ((fCharBuf[fCharIndex] >= 0xD800) && (fCharBuf[fCharIndex] <= 0xDB7F)) { // make sure one more char is in the buffer, the transcoder // should put only a complete surrogate pair into the buffer assert(fCharIndex+1 < fCharsAvail); if ((fCharBuf[fCharIndex+1] < 0xDC00) || (fCharBuf[fCharIndex+1] > 0xDFFF)) return false; // Looks ok, so lets eat it fCharIndex += 2; } else { if (!isFirstNCNameChar(fCharBuf[fCharIndex])) { return false; } // Looks ok, so lets eat it fCharIndex++; } do { if (fCharIndex == fCharsAvail) { // we have to copy the accepted character(s), and update the column number, // before getting new data and losing the value of fCharIndex if((count = fCharIndex - charIndex_start)!=0) { fCurCol += (XMLFileLoc)count; toFill.append(&fCharBuf[charIndex_start], count); } if(!refreshCharBuffer()) return true; charIndex_start = fCharIndex; } // Check the current char and take it if it's a name char while(fCharIndex < fCharsAvail) { if((fCharBuf[fCharIndex] >= 0xD800) && (fCharBuf[fCharIndex] <= 0xDB7F) && fCharIndex+1 < fCharsAvail && ((fCharBuf[fCharIndex+1] < 0xDC00) || (fCharBuf[fCharIndex+1] > 0xDFFF))) fCharIndex+=2; else if(isNCNameChar(fCharBuf[fCharIndex])) fCharIndex++; else break; } // if we didn't consume the entire buffer, we are done } while(fCharIndex == fCharsAvail); // we have to copy the accepted character(s), and update column if((count = fCharIndex - charIndex_start)!=0) { fCurCol += (XMLFileLoc)count; toFill.append(&fCharBuf[charIndex_start], count); } return true; } bool XMLReader::getQName(XMLBuffer& toFill, int* colonPosition) { // We are only looking for two iterations (i.e. 'NCNAME':'NCNAME'). // We will stop when we finished scanning for a QName (i.e. either a second // colon or an invalid char). if(!getNCName(toFill)) { *colonPosition = -1; return false; } if (fCharIndex == fCharsAvail && !refreshCharBuffer()) { *colonPosition = -1; return true; } if (fCharBuf[fCharIndex] != chColon) { *colonPosition = -1; return true; } *colonPosition = (int)toFill.getLen(); toFill.append(chColon); fCharIndex++; fCurCol++; return getNCName(toFill); } bool XMLReader::getSpaces(XMLBuffer& toFill) { // // We just loop until we either hit a non-space or the end of this // entity. We return true if we returned because of a non-space and // false if because of end of entity. // // NOTE: We have to maintain line/col info here and we have to do // whitespace normalization if we are not already internalized. // while (true) { // Loop through the current chars in the buffer while (fCharIndex < fCharsAvail) { // Get the current char out of the buffer XMLCh curCh = fCharBuf[fCharIndex]; // // See if its a white space char. If so, then process it. Else // we've hit a non-space and need to return. // if (isWhitespace(curCh)) { // Eat this char fCharIndex++; // // 'curCh' is a whitespace(x20|x9|xD|xA), so we only can have // end-of-line combinations with a leading chCR(xD) or chLF(xA) // // 100000 x20 // 001001 x9 // 001010 chLF // 001101 chCR // ----------- // 000110 == (chCR|chLF) & ~(0x9|0x20) // // if the result of thelogical-& operation is // true : 'curCh' must be xA or xD // false : 'curCh' must be x20 or x9 // if ( ( curCh & (chCR|chLF) & ~(0x9|0x20) ) == 0 ) { fCurCol++; } else { handleEOL(curCh, false); } // Ok we can add this guy to our buffer toFill.append(curCh); } else { // Return true to indicate we broke out due to a whitespace return true; } } // // We've eaten up the current buffer, so lets try to reload it. If // we don't get anything new, then break out. If we do, then we go // back to the top to keep getting spaces. // if (!refreshCharBuffer()) break; } return false; } bool XMLReader::getUpToCharOrWS(XMLBuffer& toFill, const XMLCh toCheck) { while (true) { // Loop through the current chars in the buffer while (fCharIndex < fCharsAvail) { // Get the current char out of the buffer XMLCh curCh = fCharBuf[fCharIndex]; // // See if its not a white space or our target char, then process // it. Else, we need to return. // if (!isWhitespace(curCh) && (curCh != toCheck)) { // Eat this char fCharIndex++; // // 'curCh' is not a whitespace(x20|x9|xD|xA), so we only can // have end-of-line combinations with a leading chNEL(x85) or // chLineSeparator(x2028) // // 0010000000101000 chLineSeparator // 0000000010000101 chNEL // --------------------- // 1101111101010010 == ~(chNEL|chLineSeparator) // // if the result of the logical-& operation is // true : 'curCh' can not be chNEL or chLineSeparator // false : 'curCh' can be chNEL or chLineSeparator // if ( curCh & (XMLCh) ~(chNEL|chLineSeparator) ) { fCurCol++; } else { handleEOL(curCh, false); } // Add it to our buffer toFill.append(curCh); } else { return true; } } // // We've eaten up the current buffer, so lets try to reload it. If // we don't get anything new, then break out. If we do, then we go // back to the top to keep getting spaces. // if (!refreshCharBuffer()) break; } // We never hit any non-space and ate up the whole reader return false; } bool XMLReader::skipIfQuote(XMLCh& chGotten) { if (fCharIndex == fCharsAvail && !refreshCharBuffer()) return false; chGotten = fCharBuf[fCharIndex]; if ((chGotten == chDoubleQuote) || (chGotten == chSingleQuote)) { fCharIndex++; fCurCol++; return true; } return false; } bool XMLReader::skipSpaces(bool& skippedSomething, bool inDecl) { // DO NOT set the skippedSomething to 'false', but change it to be 'true' only // We enter a loop where we skip over spaces until we hit the end of // this reader or a non-space value. The return indicates whether we // hit the non-space (true) or the end (false). do { // Loop through the current chars in the buffer while (fCharIndex < fCharsAvail) { // See if its a white space char. If so, then process it. Else // we've hit a non-space and need to return. if (isWhitespace(fCharBuf[fCharIndex])) { // Get the current char out of the buffer and eat it XMLCh curCh = fCharBuf[fCharIndex++]; skippedSomething = true; // // 'curCh' is a whitespace(x20|x9|xD|xA), so we only can have // end-of-line combinations with a leading chCR(xD) or chLF(xA) // // 100000 x20 // 001001 x9 // 001010 chLF // 001101 chCR // ----------- // 000110 == (chCR|chLF) & ~(0x9|0x20) // // if the result of the logical-& operation is // true : 'curCh' must be xA or xD // false : 'curCh' must be x20 or x9 // if ( ( curCh & (chCR|chLF) & ~(0x9|0x20) ) == 0 ) { fCurCol++; } else { handleEOL(curCh, inDecl); } } else return true; } // We've eaten up the current buffer, so lets try to reload it. If // we don't get anything new, then break out. If we do, then we go // back to the top to keep getting spaces. } while(refreshCharBuffer()); // We never hit any non-space and ate up the whole reader return false; } bool XMLReader::skippedChar(const XMLCh toSkip) { // // If the buffer is empty, then try to reload it. If we still get // nothing, then return false. // if (fCharIndex == fCharsAvail) { if (!refreshCharBuffer()) return false; } // // See if the current char is the one we want. If so, then we need // to eat it and return true. // if (fCharBuf[fCharIndex] == toSkip) { fCharIndex++; fCurCol++; return true; } return false; } bool XMLReader::skippedSpace() { // // If the buffer is empty, then try to reload it. If we still get // nothing, then return false. // if (fCharIndex == fCharsAvail) { if (!refreshCharBuffer()) return false; } // // See if the current char is a whitespace. If so, then we need to eat // it and return true. // const XMLCh curCh = fCharBuf[fCharIndex]; if (isWhitespace(curCh)) { // Eat the character fCharIndex++; // // 'curCh' is a whitespace(x20|x9|xD|xA), so we only can have // end-of-line combinations with a leading chCR(xD) or chLF(xA) // // 100000 x20 // 001001 x9 // 001010 chLF // 001101 chCR // ----------- // 000110 == (chCR|chLF) & ~(0x9|0x20) // // if the result of the logical-& operation is // true : 'curCh' must be xA or xD // false : 'curCh' must be x20 or x9 // if ( ( curCh & (chCR|chLF) & ~(0x9|0x20) ) == 0 ) { fCurCol++; } else { handleEOL((XMLCh&)curCh, false); } return true; } return false; } bool XMLReader::skippedString(const XMLCh* const toSkip) { // This function works on strings that are smaller than kCharBufSize. // This function guarantees that in case the comparison is unsuccessful // the fCharIndex will point to the original data. // // Get the length of the string to skip. // const XMLSize_t srcLen = XMLString::stringLen(toSkip); XMLSize_t charsLeft = charsLeftInBuffer(); // See if the current reader has enough chars to test against this // string. If not, then ask it to reload its buffer. If that does not // get us enough, then it cannot match. // // NOTE: This works because strings never have to cross a reader! And // a string to skip will never have a new line in it, so we will never // miss adjusting the current line. // while (charsLeft < srcLen) { if (!refreshCharBuffer()) return false; XMLSize_t tmp = charsLeftInBuffer(); if (tmp == charsLeft) // if the refreshCharBuf() did not add anything new return false; // give up and return. charsLeft = tmp; } // Ok, now we now that the current reader has enough chars in its // buffer and that its index is back at zero. So we can do a quick and // dirty comparison straight to its buffer with no requirement to unget // if it fails. // if (memcmp(&fCharBuf[fCharIndex], toSkip, srcLen * sizeof(XMLCh))) return false; // Add the source length to the current column to get it back right. // fCurCol += (XMLFileLoc)srcLen; // And get the character buffer index back right by just adding the // source len to it. // fCharIndex += srcLen; return true; } bool XMLReader::skippedStringLong(const XMLCh* toSkip) { // This function works on strings that are potentially longer than // kCharBufSize (e.g., end tag). This function does not guarantee // that in case the comparison is unsuccessful the fCharIndex will // point to the original data. // XMLSize_t srcLen = XMLString::stringLen(toSkip); XMLSize_t charsLeft = charsLeftInBuffer(); while (srcLen != 0) { // Fill up the buffer with as much data as possible. // while (charsLeft < srcLen && charsLeft != kCharBufSize) { if (!refreshCharBuffer()) return false; XMLSize_t tmp = charsLeftInBuffer(); if (tmp == charsLeft) // if the refreshCharBuf() did not add anything return false; // new give up and return. charsLeft = tmp; } XMLSize_t n = charsLeft < srcLen ? charsLeft : srcLen; if (memcmp(&fCharBuf[fCharIndex], toSkip, n * sizeof(XMLCh))) return false; toSkip += n; srcLen -= n; fCharIndex += n; fCurCol += (XMLFileLoc)n; charsLeft -= n; } return true; } // // This is just to peek if the next coming buffer // matches the string toPeek. // Similar to skippedString, but just the fCharIndex and fCurCol are not updated // bool XMLReader::peekString(const XMLCh* const toPeek) { // Get the length of the string to skip const XMLSize_t srcLen = XMLString::stringLen(toPeek); // // See if the current reader has enough chars to test against this // string. If not, then ask it to reload its buffer. If that does not // get us enough, then it cannot match. // // NOTE: This works because strings never have to cross a reader! And // a string to skip will never have a new line in it, so we will never // miss adjusting the current line. // XMLSize_t charsLeft = charsLeftInBuffer(); while (charsLeft < srcLen) { refreshCharBuffer(); XMLSize_t t = charsLeftInBuffer(); if (t == charsLeft) // if the refreshCharBuf() did not add anything new return false; // give up and return. charsLeft = t; } // // Ok, now we now that the current reader has enough chars in its // buffer and that its index is back at zero. So we can do a quick and // dirty comparison straight to its buffer with no requirement to unget // if it fails. // if (memcmp(&fCharBuf[fCharIndex], toPeek, srcLen*sizeof(XMLCh))) return false; return true; } // --------------------------------------------------------------------------- // XMLReader: Setter methods (most are inlined) // --------------------------------------------------------------------------- bool XMLReader::setEncoding(const XMLCh* const newEncoding) { // // If the encoding was forced, then we ignore the new value and just // return with success. If it was forced, then we are to use that // encoding without question. Note that, if we are forced, we created // a transcoder up front so there is no need to do one here in that // case. // if (fForcedEncoding) return true; // // upperCase the newEncoding first for better performance // XMLCh* inputEncoding = XMLString::replicate(newEncoding, fMemoryManager); XMLString::upperCaseASCII(inputEncoding); XMLRecognizer::Encodings newBaseEncoding; // // Check for non-endian specific UTF-16 or UCS-4. If so, and if we // are already in one of the endian versions of those encodings, // then just keep it and go on. Otherwise, its not valid. // if (XMLString::equals(inputEncoding, XMLUni::fgUTF16EncodingString) || XMLString::equals(inputEncoding, XMLUni::fgUTF16EncodingString2) || XMLString::equals(inputEncoding, XMLUni::fgUTF16EncodingString3) || XMLString::equals(inputEncoding, XMLUni::fgUTF16EncodingString4) || XMLString::equals(inputEncoding, XMLUni::fgUTF16EncodingString5) || XMLString::equals(inputEncoding, XMLUni::fgUTF16EncodingString6) || XMLString::equals(inputEncoding, XMLUni::fgUTF16EncodingString7)) { fMemoryManager->deallocate(inputEncoding); if ((fEncoding != XMLRecognizer::UTF_16L) && (fEncoding != XMLRecognizer::UTF_16B)) { return false; } // Override with the original endian specific encoding newBaseEncoding = fEncoding; if (fEncoding == XMLRecognizer::UTF_16L) { fMemoryManager->deallocate(fEncodingStr); fEncodingStr = 0; fEncodingStr = XMLString::replicate(XMLUni::fgUTF16LEncodingString, fMemoryManager); } else { fMemoryManager->deallocate(fEncodingStr); fEncodingStr = 0; fEncodingStr = XMLString::replicate(XMLUni::fgUTF16BEncodingString, fMemoryManager); } } else if (XMLString::equals(inputEncoding, XMLUni::fgUCS4EncodingString) || XMLString::equals(inputEncoding, XMLUni::fgUCS4EncodingString2) || XMLString::equals(inputEncoding, XMLUni::fgUCS4EncodingString3) || XMLString::equals(inputEncoding, XMLUni::fgUCS4EncodingString4) || XMLString::equals(inputEncoding, XMLUni::fgUCS4EncodingString5)) { fMemoryManager->deallocate(inputEncoding); if ((fEncoding != XMLRecognizer::UCS_4L) && (fEncoding != XMLRecognizer::UCS_4B)) { return false; } // Override with the original endian specific encoding newBaseEncoding = fEncoding; if (fEncoding == XMLRecognizer::UCS_4L) { fMemoryManager->deallocate(fEncodingStr); fEncodingStr = 0; fEncodingStr = XMLString::replicate(XMLUni::fgUCS4LEncodingString, fMemoryManager); } else { fMemoryManager->deallocate(fEncodingStr); fEncodingStr = 0; fEncodingStr = XMLString::replicate(XMLUni::fgUCS4BEncodingString, fMemoryManager); } } else { // // Try to map the string to one of our standard encodings. If its not // one of them, then it has to be one of the non-intrinsic encodings, // in which case we have to delete our intrinsic encoder and create a // new one. // newBaseEncoding = XMLRecognizer::encodingForName(inputEncoding); // // If it does not come back as one of the auto-sensed encodings, then we // have to possibly replace it and at least check a few things. // if (newBaseEncoding == XMLRecognizer::OtherEncoding) { // // We already know it's none of those non-endian special cases, // so just replicate the new name and use it directly to create the transcoder // fMemoryManager->deallocate(fEncodingStr); fEncodingStr = inputEncoding; // Check for a pre-created transcoder to delete. if (fTranscoder) { delete fTranscoder; fTranscoder = 0; } XMLTransService::Codes failReason; fTranscoder = XMLPlatformUtils::fgTransService->makeNewTranscoderFor ( fEncodingStr , failReason , kCharBufSize , fMemoryManager ); if (!fTranscoder) ThrowXMLwithMemMgr1(TranscodingException, XMLExcepts::Trans_CantCreateCvtrFor, fEncodingStr, fMemoryManager); } else { // Store the new encoding string since it is just an intrinsic fMemoryManager->deallocate(fEncodingStr); fEncodingStr = inputEncoding; } } if (!fTranscoder) { // // Now we can create a transcoder using the recognized fEncoding. We // might get back a transcoder for an intrinsically supported encoding, // or we might get one from the underlying transcoding service. // XMLTransService::Codes failReason; fTranscoder = XMLPlatformUtils::fgTransService->makeNewTranscoderFor ( newBaseEncoding , failReason , kCharBufSize , fMemoryManager ); if (!fTranscoder) ThrowXMLwithMemMgr1(TranscodingException, XMLExcepts::Trans_CantCreateCvtrFor, fEncodingStr, fMemoryManager); } // Update the base encoding member with the new base encoding found fEncoding = newBaseEncoding; // Looks ok to us return true; } // --------------------------------------------------------------------------- // XMLReader: Private helper methods // --------------------------------------------------------------------------- // // This is called when the encoding flag is set and just sets the fSwapped // flag appropriately. // void XMLReader::checkForSwapped() { // Assume not swapped fSwapped = false; if (XMLPlatformUtils::fgXMLChBigEndian) { if ((fEncoding == XMLRecognizer::UTF_16L) || (fEncoding == XMLRecognizer::UCS_4L)) { fSwapped = true; } } else { if ((fEncoding == XMLRecognizer::UTF_16B) || (fEncoding == XMLRecognizer::UCS_4B)) { fSwapped = true; } } } // // This is called from the constructor when the encoding is not forced. // We assume that the encoding has been auto-sensed at this point and that // fSwapped is set correctly. // // In the case of UCS-4 and EBCDIC, we don't have to check for a decl. // The fact that we got here, means that there is one, because that's the // only way we can autosense those. // void XMLReader::doInitDecode() { switch(fEncoding) { case XMLRecognizer::UCS_4B : case XMLRecognizer::UCS_4L : { // Remove bom if any if (((fRawByteBuf[0] == 0x00) && (fRawByteBuf[1] == 0x00) && (fRawByteBuf[2] == 0xFE) && (fRawByteBuf[3] == 0xFF)) || ((fRawByteBuf[0] == 0xFF) && (fRawByteBuf[1] == 0xFE) && (fRawByteBuf[2] == 0x00) && (fRawByteBuf[3] == 0x00)) ) { for (XMLSize_t i = 0; i < fRawBytesAvail; i++) fRawByteBuf[i] = fRawByteBuf[i+4]; fRawBytesAvail -=4; } // Look at the raw buffer as UCS4 chars const UCS4Ch* asUCS = reinterpret_cast(fRawByteBuf); while (fRawBufIndex < fRawBytesAvail) { // Make sure there are at least sizeof(UCS4Ch) bytes to consume. if (fRawBufIndex + sizeof(UCS4Ch) > fRawBytesAvail) { fCharsAvail = 0; fRawBufIndex = 0; fMemoryManager->deallocate(fPublicId); fMemoryManager->deallocate(fEncodingStr); ArrayJanitor janValue(fSystemId, fMemoryManager); ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Reader_CouldNotDecodeFirstLine , fSystemId , fMemoryManager ); } // Make sure we don't exhaust the limited prolog buffer size. // Leave room for a space added at the end of this function. if (fCharsAvail == kCharBufSize - 1) { fCharsAvail = 0; fRawBufIndex = 0; fMemoryManager->deallocate(fPublicId); fMemoryManager->deallocate(fEncodingStr); ArrayJanitor janValue(fSystemId, fMemoryManager); ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Reader_CouldNotDecodeFirstLine , fSystemId , fMemoryManager ); } // Get out the current 4 byte value and inc our raw buf index UCS4Ch curVal = *asUCS++; fRawBufIndex += sizeof(UCS4Ch); // Swap if that is required for this machine if (fSwapped) curVal = BitOps::swapBytes(curVal); // Make sure its at least semi legal. If not, undo and throw if (curVal > 0xFFFF) { fCharsAvail = 0; fRawBufIndex = 0; fMemoryManager->deallocate(fPublicId); fMemoryManager->deallocate(fEncodingStr); ArrayJanitor janValue(fSystemId, fMemoryManager); ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Reader_CouldNotDecodeFirstLine , fSystemId , fMemoryManager ); } // Convert the value to an XML char and store it fCharSizeBuf[fCharsAvail] = 4; fCharBuf[fCharsAvail++] = XMLCh(curVal); // Break out on the > character if (curVal == chCloseAngle) break; } break; } case XMLRecognizer::UTF_8 : { // If there's a utf-8 BOM (0xEF 0xBB 0xBF), skip past it. // Don't move to char buf - no one wants to see it. // Note: this causes any encoding= declaration to override // the BOM's attempt to say that the encoding is utf-8. // Look at the raw buffer as short chars const char* asChars = (const char*)fRawByteBuf; if (fRawBytesAvail > XMLRecognizer::fgUTF8BOMLen && XMLString::compareNString( asChars , XMLRecognizer::fgUTF8BOM , XMLRecognizer::fgUTF8BOMLen) == 0) { fRawBufIndex += XMLRecognizer::fgUTF8BOMLen; asChars += XMLRecognizer::fgUTF8BOMLen; } // // First check that there are enough bytes to even see the // decl indentifier. If not, get out now with no action since // there is no decl. // if (fRawBytesAvail < XMLRecognizer::fgASCIIPreLen) break; // Check for the opening sequence. If not, then no decl if (XMLString::compareNString( asChars , XMLRecognizer::fgASCIIPre , XMLRecognizer::fgASCIIPreLen)) { break; } while (fRawBufIndex < fRawBytesAvail) { const char curCh = *asChars++; fRawBufIndex++; // Make sure we don't exhaust the limited prolog buffer size. // Leave room for a space added at the end of this function. if (fCharsAvail == kCharBufSize - 1) { fCharsAvail = 0; fRawBufIndex = 0; fMemoryManager->deallocate(fPublicId); fMemoryManager->deallocate(fEncodingStr); ArrayJanitor janValue(fSystemId, fMemoryManager); ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Reader_CouldNotDecodeFirstLine , fSystemId , fMemoryManager ); } // Looks ok, so store it fCharSizeBuf[fCharsAvail] = 1; fCharBuf[fCharsAvail++] = XMLCh(curCh); // Break out on a > character if (curCh == chCloseAngle) break; // // A char greater than 0x7F is not allowed in this case. If // so, undo and throw. // if (curCh & 0x80) { fCharsAvail = 0; fRawBufIndex = 0; fMemoryManager->deallocate(fPublicId); fMemoryManager->deallocate(fEncodingStr); ArrayJanitor janValue(fSystemId, fMemoryManager); ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Reader_CouldNotDecodeFirstLine , fSystemId , fMemoryManager ); } } break; } case XMLRecognizer::UTF_16B : case XMLRecognizer::UTF_16L : { // // If there is a decl here, we just truncate back the characters // as we go. No surrogate creation would be allowed here in legal // XML, so we consider it a transoding error if we find one. // if (fRawBytesAvail < 2) break; XMLSize_t postBOMIndex = 0; const UTF16Ch* asUTF16 = reinterpret_cast(&fRawByteBuf[fRawBufIndex]); if ((*asUTF16 == chUnicodeMarker) || (*asUTF16 == chSwappedUnicodeMarker)) { fRawBufIndex += sizeof(UTF16Ch); asUTF16++; postBOMIndex = fRawBufIndex; } // First check that there are enough raw bytes for there to even // be a decl indentifier. If not, then nothing to do. // if (fRawBytesAvail - fRawBufIndex < XMLRecognizer::fgUTF16PreLen) { fRawBufIndex = postBOMIndex; break; } // // See we get a match on the prefix. If not, then reset and // break out. // if (fEncoding == XMLRecognizer::UTF_16B) { if (memcmp(asUTF16, XMLRecognizer::fgUTF16BPre, XMLRecognizer::fgUTF16PreLen)) { fRawBufIndex = postBOMIndex; break; } } else { if (memcmp(asUTF16, XMLRecognizer::fgUTF16LPre, XMLRecognizer::fgUTF16PreLen)) { fRawBufIndex = postBOMIndex; break; } } while (fRawBufIndex < fRawBytesAvail) { // Make sure there are at least sizeof(UTF16Ch) bytes to consume. if (fRawBufIndex + sizeof(UTF16Ch) > fRawBytesAvail) { fCharsAvail = 0; fRawBufIndex = 0; fMemoryManager->deallocate(fPublicId); fMemoryManager->deallocate(fEncodingStr); ArrayJanitor janValue(fSystemId, fMemoryManager); ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Reader_CouldNotDecodeFirstLine , fSystemId , fMemoryManager ); } // Make sure we don't exhaust the limited prolog buffer size. // Leave room for a space added at the end of this function. if (fCharsAvail == kCharBufSize - 1) { fCharsAvail = 0; fRawBufIndex = 0; fMemoryManager->deallocate(fPublicId); fMemoryManager->deallocate(fEncodingStr); ArrayJanitor janValue(fSystemId, fMemoryManager); ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Reader_CouldNotDecodeFirstLine , fSystemId , fMemoryManager ); } // Get out the current 2 byte value UTF16Ch curVal = *asUTF16++; fRawBufIndex += sizeof(UTF16Ch); // Swap if that is required for this machine if (fSwapped) curVal = BitOps::swapBytes(curVal); // // Store it and bump the target index, implicitly converting // if UTF16Ch and XMLCh are not the same size. // fCharSizeBuf[fCharsAvail] = 2; fCharBuf[fCharsAvail++] = curVal; // Break out on a > char if (curVal == chCloseAngle) break; } break; } case XMLRecognizer::EBCDIC : { // // We use special support in the intrinsic EBCDIC-US transcoder // to go through one char at a time. // const XMLByte* srcPtr = fRawByteBuf; while (1) { // Transcode one char from the source const XMLCh chCur = XMLEBCDICTranscoder::xlatThisOne(*srcPtr++); fRawBufIndex++; // Make sure we don't exhaust the limited prolog buffer size. // Leave room for a space added at the end of this function. if (fCharsAvail == kCharBufSize - 1) { fCharsAvail = 0; fRawBufIndex = 0; fMemoryManager->deallocate(fPublicId); fMemoryManager->deallocate(fEncodingStr); ArrayJanitor janValue(fSystemId, fMemoryManager); ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Reader_CouldNotDecodeFirstLine , fSystemId , fMemoryManager ); } // // And put it into the character buffer. This stuff has to // look like it was normally transcoded. // fCharSizeBuf[fCharsAvail] = 1; fCharBuf[fCharsAvail++] = chCur; // If its a > char, then break out if (chCur == chCloseAngle) break; // Watch for using up all input and get out if (fRawBufIndex == fRawBytesAvail) break; } break; } default : // It should never be anything else here fMemoryManager->deallocate(fPublicId); fMemoryManager->deallocate(fEncodingStr); fMemoryManager->deallocate(fSystemId); ThrowXMLwithMemMgr(TranscodingException, XMLExcepts::Reader_BadAutoEncoding, fMemoryManager); break; } // // Ok, by the time we get here, if its a legal XML file we have eaten // the XML/TextDecl. So, if we are a PE and are being referenced from // outside a literal, then we need to throw in an arbitrary space that // is required by XML. // if ((fType == Type_PE) && (fRefFrom == RefFrom_NonLiteral)) fCharBuf[fCharsAvail++] = chSpace; // Calculate fCharOfsBuf buffer using the elements from fCharBufSize if (fCalculateSrcOfs) { fCharOfsBuf[0] = 0; for (XMLSize_t index = 1; index < fCharsAvail; ++index) { fCharOfsBuf[index] = fCharOfsBuf[index-1]+fCharSizeBuf[index-1]; } } } // // This method is called internally when we run out of bytes in the raw // buffer. We just read as many bytes as we can into the raw buffer again // and store the number of bytes we got. // void XMLReader::refreshRawBuffer() { // Make sure we don't underflow on the subtraction. if (fRawBufIndex > fRawBytesAvail) { ThrowXMLwithMemMgr1 ( RuntimeException , XMLExcepts::Str_StartIndexPastEnd , fSystemId , fMemoryManager ); } // // If there are any bytes left, move them down to the start. There // should only ever be (max bytes per char - 1) at the most. // const XMLSize_t bytesLeft = fRawBytesAvail - fRawBufIndex; // Move the existing ones down for (XMLSize_t index = 0; index < bytesLeft; index++) fRawByteBuf[index] = fRawByteBuf[fRawBufIndex + index]; // // And then read into the buffer past the existing bytes. Add back in // that many to the bytes read, and subtract that many from the bytes // requested. // fRawBytesAvail = fStream->readBytes ( &fRawByteBuf[bytesLeft], kRawBufSize - bytesLeft ) + bytesLeft; // // We need to reset the buffer index back to the start in all cases, // since any trailing data was copied down to the start. // fRawBufIndex = 0; } // // This method is called internally when we run out of characters in the // trancoded character buffer. We transcode up to another maxChars chars // from the // XMLSize_t XMLReader::xcodeMoreChars( XMLCh* const bufToFill , unsigned char* const charSizes , const XMLSize_t maxChars) { XMLSize_t charsDone = 0; XMLSize_t bytesEaten = 0; bool needMode = false; while (!bytesEaten) { // If our raw buffer is low, then lets load up another batch of // raw bytes now. // XMLSize_t bytesLeft = fRawBytesAvail - fRawBufIndex; if (needMode || bytesLeft == 0 || bytesLeft < fLowWaterMark) { refreshRawBuffer(); // If there are no characters or if we need more but didn't get // any, return zero now. // if (fRawBytesAvail == 0 || (needMode && (bytesLeft == fRawBytesAvail - fRawBufIndex))) return 0; } // Ask the transcoder to internalize another batch of chars. It is // possible that there is data in the raw buffer but the transcoder // is unable to produce anything because transcoding of multi-byte // encodings may have left a few bytes representing a partial // character in the buffer that can't be used until the next chunk // (and the rest of the character) is read. In this case set the // needMore flag and try again. // charsDone = fTranscoder->transcodeFrom ( &fRawByteBuf[fRawBufIndex] , fRawBytesAvail - fRawBufIndex , bufToFill , maxChars , bytesEaten , charSizes ); if (bytesEaten == 0) needMode = true; else fRawBufIndex += bytesEaten; } return charsDone; } /*** * * XML1.1 * * 2.11 End-of-Line Handling * * XML parsed entities are often stored in computer files which, for editing * convenience, are organized into lines. These lines are typically separated * by some combination of the characters CARRIAGE RETURN (#xD) and LINE FEED (#xA). * * To simplify the tasks of applications, the XML processor MUST behave as if * it normalized all line breaks in external parsed entities (including the document * entity) on input, before parsing, by translating all of the following to a single * #xA character: * * 1. the two-character sequence #xD #xA * 2. the two-character sequence #xD #x85 * 3. the single character #x85 * 4. the single character #x2028 * 5. any #xD character that is not immediately followed by #xA or #x85. * * ***/ void XMLReader::handleEOL(XMLCh& curCh, bool inDecl) { // 1. the two-character sequence #xD #xA // 2. the two-character sequence #xD #x85 // 5. any #xD character that is not immediately followed by #xA or #x85. switch(curCh) { case chCR: fCurCol = 1; fCurLine++; // // If not already internalized, then convert it to an // LF and eat any following LF. // if (fSource == Source_External) { if ((fCharIndex < fCharsAvail) || refreshCharBuffer()) { if ( fCharBuf[fCharIndex] == chLF || ((fCharBuf[fCharIndex] == chNEL) && fNEL) ) { fCharIndex++; } } curCh = chLF; } break; case chLF: fCurCol = 1; fCurLine++; break; // 3. the single character #x85 // 4. the single character #x2028 case chNEL: case chLineSeparator: if (inDecl && fXMLVersion == XMLV1_1) { /*** * XML1.1 * * 2.11 End-of-Line Handling * ... * The characters #x85 and #x2028 cannot be reliably recognized and translated * until an entity's encoding declaration (if present) has been read. * Therefore, it is a fatal error to use them within the XML declaration or * text declaration. * ***/ ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Reader_NelLsepinDecl , fSystemId , fMemoryManager ); } if (fNEL && fSource == Source_External) { fCurCol = 1; fCurLine++; curCh = chLF; } break; default: fCurCol++; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/BinFileOutputStream.cpp000644 000765 000024 00000006732 13241160334 024520 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BinFileOutputStream.cpp 1597057 2014-05-23 10:50:16Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // BinFileOutputStream: Constructors and Destructor // --------------------------------------------------------------------------- BinFileOutputStream::BinFileOutputStream(const XMLCh* const fileName , MemoryManager* const manager) :fSource(XMLPlatformUtils::openFileToWrite(fileName, manager)) ,fMemoryManager(manager) { } BinFileOutputStream::BinFileOutputStream(const char* const fileName , MemoryManager* const manager) :fSource(XMLPlatformUtils::openFileToWrite(fileName, manager)) ,fMemoryManager(manager) { } BinFileOutputStream::~BinFileOutputStream() { if (getIsOpen()) { try { XMLPlatformUtils::closeFile(fSource, fMemoryManager); } catch (...) { // There is nothing we can do about it here. } } } // --------------------------------------------------------------------------- // BinFileOutputStream: Getter methods // --------------------------------------------------------------------------- XMLFilePos BinFileOutputStream::getSize() const { return XMLPlatformUtils::fileSize(fSource, fMemoryManager); } // --------------------------------------------------------------------------- // BinFileOutputStream: Stream management methods // --------------------------------------------------------------------------- void BinFileOutputStream::reset() { XMLPlatformUtils::resetFile(fSource, fMemoryManager); } // --------------------------------------------------------------------------- // BinFileOutputStream: Implementation of the input stream interface // --------------------------------------------------------------------------- XMLFilePos BinFileOutputStream::curPos() const { return XMLPlatformUtils::curFilePos(fSource, fMemoryManager); } void BinFileOutputStream::writeBytes( const XMLByte* const toGo , const XMLSize_t maxToWrite) { // // Write up to the maximum bytes requested. // XMLPlatformUtils::writeBufferToFile(fSource, maxToWrite, toGo, fMemoryManager); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/ElemStack.hpp000644 000765 000024 00000050517 13241160334 022470 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ElemStack.hpp 830538 2009-10-28 13:41:11Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_ELEMSTACK_HPP) #define XERCESC_INCLUDE_GUARD_ELEMSTACK_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLElementDecl; class Grammar; struct PrefMapElem : public XMemory { unsigned int fPrefId; unsigned int fURIId; }; // // During the scan of content, we have to keep up with the nesting of // elements (for validation and wellformedness purposes) and we have to // have places to remember namespace (prefix to URI) mappings. // // We only have to keep a stack of the current path down through the tree // that we are currently scanning, and keep track of any children of any // elements along that path. // // So, this data structure is a stack, which represents the current path // through the tree that we've worked our way down to. For each node in // the stack, there is an array of element ids that represent the ids of // the child elements scanned so far. Upon exit from that element, its // array of child elements is validated. // // Since we have the actual XMLElementDecl in the stack nodes, when its time // to validate, we just extract the content model from that element decl // and validate. All the required data falls easily to hand. Note that we // actually have some derivative of XMLElementDecl, which is specific to // the validator used, but the abstract API is sufficient for the needs of // the scanner. // // Since the namespace support also requires the storage of information on // a nested element basis, this structure also holds the namespace info. For // each level, the prefixes defined at that level (and the namespaces that // they map to) are stored. // class XMLPARSER_EXPORT ElemStack : public XMemory { public : // ----------------------------------------------------------------------- // Class specific data types // // These really should be private, but some of the compilers we have to // support are too dumb to deal with that. // // PrefMapElem // fURIId is the id of the URI from the validator's URI map. The // fPrefId is the id of the prefix from our own prefix pool. The // namespace stack consists of these elements. // // StackElem // fThisElement is the basic element decl for the current element. // The fRowCapacity is how large fChildIds has grown so far. // fChildCount is how many of them are valid right now. // // The fMapCapacity is how large fMap has grown so far. fMapCount // is how many of them are valid right now. // // Note that we store the reader number we were in when we found the // start tag. We'll use this at the end tag to test for unbalanced // markup in entities. // // MapModes // When a prefix is mapped to a namespace id, it matters whether the // QName being mapped is an attribute or name. Attributes are not // affected by an sibling xmlns attributes, whereas elements are // affected by its own xmlns attributes. // ----------------------------------------------------------------------- struct StackElem : public XMemory { XMLElementDecl* fThisElement; XMLSize_t fReaderNum; XMLSize_t fChildCapacity; XMLSize_t fChildCount; QName** fChildren; PrefMapElem* fMap; XMLSize_t fMapCapacity; XMLSize_t fMapCount; bool fValidationFlag; bool fCommentOrPISeen; bool fReferenceEscaped; unsigned int fCurrentScope; Grammar* fCurrentGrammar; unsigned int fCurrentURI; XMLCh * fSchemaElemName; XMLSize_t fSchemaElemNameMaxLen; int fPrefixColonPos; }; enum MapModes { Mode_Attribute , Mode_Element }; // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- ElemStack(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~ElemStack(); // ----------------------------------------------------------------------- // Stack access // ----------------------------------------------------------------------- XMLSize_t addLevel(); XMLSize_t addLevel(XMLElementDecl* const toSet, const XMLSize_t readerNum); const StackElem* popTop(); // ----------------------------------------------------------------------- // Stack top access // ----------------------------------------------------------------------- XMLSize_t addChild(QName* const child, const bool toParent); const StackElem* topElement() const; void setElement(XMLElementDecl* const toSet, const XMLSize_t readerNum); void setValidationFlag(bool validationFlag); bool getValidationFlag(); inline void setCommentOrPISeen(); inline bool getCommentOrPISeen() const; inline void setReferenceEscaped(); inline bool getReferenceEscaped() const; void setCurrentScope(int currentScope); int getCurrentScope(); void setCurrentGrammar(Grammar* currentGrammar); Grammar* getCurrentGrammar(); void setCurrentURI(unsigned int uri); unsigned int getCurrentURI(); inline void setCurrentSchemaElemName(const XMLCh * const schemaElemName); inline XMLCh *getCurrentSchemaElemName(); void setPrefixColonPos(int colonPos); int getPrefixColonPos() const; // ----------------------------------------------------------------------- // Prefix map methods // ----------------------------------------------------------------------- void addGlobalPrefix ( const XMLCh* const prefixToAdd , const unsigned int uriId ); void addPrefix ( const XMLCh* const prefixToAdd , const unsigned int uriId ); unsigned int mapPrefixToURI ( const XMLCh* const prefixToMap , bool& unknown ) const; ValueVectorOf* getNamespaceMap() const; unsigned int getPrefixId(const XMLCh* const prefix) const; const XMLCh* getPrefixForId(unsigned int prefId) const; // ----------------------------------------------------------------------- // Miscellaneous methods // ----------------------------------------------------------------------- bool isEmpty() const; void reset ( const unsigned int emptyId , const unsigned int unknownId , const unsigned int xmlId , const unsigned int xmlNSId ); unsigned int getEmptyNamespaceId(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ElemStack(const ElemStack&); ElemStack& operator=(const ElemStack&); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void expandMap(StackElem* const toExpand); void expandStack(); // ----------------------------------------------------------------------- // Data members // // fEmptyNamespaceId // This is the special URI id for the "" namespace, which is magic // because of the xmlns="" operation. // // fGlobalPoolId // This is a special URI id that is returned when the namespace // prefix is "" and no one has explicitly mapped that prefix to an // explicit URI (or when they explicitly clear any such mapping, // which they can also do.) And also its prefix pool id, which is // stored here for fast access. // // fPrefixPool // This is the prefix pool where prefixes are hashed and given unique // ids. These ids are used to track prefixes in the element stack. // // fGlobalNamespaces // This object contains the namespace bindings that are globally valid // // fStack // fStackCapacity // fStackTop // This the stack array. Its an array of pointers to StackElem // structures. The capacity is the current high water mark of the // stack. The top is the current top of stack (i.e. the part of it // being used.) // // fUnknownNamespaceId // This is the URI id for the special URI that is assigned to any // prefix which has not been mapped. This lets us keep going after // issuing the error. // // fXMLNamespaceId // fXMLPoolId // fXMLNSNamespaceId // fXMLNSPoolId // These are the URI ids for the special URIs that are assigned to // the 'xml' and 'xmlns' namespaces. And also its prefix pool id, // which is stored here for fast access. // ----------------------------------------------------------------------- unsigned int fEmptyNamespaceId; unsigned int fGlobalPoolId; XMLStringPool fPrefixPool; StackElem* fGlobalNamespaces; StackElem** fStack; XMLSize_t fStackCapacity; XMLSize_t fStackTop; unsigned int fUnknownNamespaceId; unsigned int fXMLNamespaceId; unsigned int fXMLPoolId; unsigned int fXMLNSNamespaceId; unsigned int fXMLNSPoolId; ValueVectorOf* fNamespaceMap; MemoryManager* fMemoryManager; }; class XMLPARSER_EXPORT WFElemStack : public XMemory { public : // ----------------------------------------------------------------------- // Class specific data types // // These really should be private, but some of the compilers we have to // support are too dumb to deal with that. // // PrefMapElem // fURIId is the id of the URI from the validator's URI map. The // fPrefId is the id of the prefix from our own prefix pool. The // namespace stack consists of these elements. // // StackElem // fThisElement is the basic element decl for the current element. // The fRowCapacity is how large fChildIds has grown so far. // fChildCount is how many of them are valid right now. // // The fMapCapacity is how large fMap has grown so far. fMapCount // is how many of them are valid right now. // // Note that we store the reader number we were in when we found the // start tag. We'll use this at the end tag to test for unbalanced // markup in entities. // // MapModes // When a prefix is mapped to a namespace id, it matters whether the // QName being mapped is an attribute or name. Attributes are not // affected by an sibling xmlns attributes, whereas elements are // affected by its own xmlns attributes. // ----------------------------------------------------------------------- struct StackElem : public XMemory { int fTopPrefix; unsigned int fCurrentURI; unsigned int fReaderNum; unsigned int fElemMaxLength; XMLCh* fThisElement; }; enum MapModes { Mode_Attribute , Mode_Element }; // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- WFElemStack(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~WFElemStack(); // ----------------------------------------------------------------------- // Stack access // ----------------------------------------------------------------------- XMLSize_t addLevel(); XMLSize_t addLevel(const XMLCh* const toSet, const unsigned int toSetLen, const unsigned int readerNum); const StackElem* popTop(); // ----------------------------------------------------------------------- // Stack top access // ----------------------------------------------------------------------- const StackElem* topElement() const; void setElement(const XMLCh* const toSet, const unsigned int toSetLen, const unsigned int readerNum); void setCurrentURI(unsigned int uri); unsigned int getCurrentURI(); // ----------------------------------------------------------------------- // Prefix map methods // ----------------------------------------------------------------------- void addPrefix ( const XMLCh* const prefixToAdd , const unsigned int uriId ); unsigned int mapPrefixToURI ( const XMLCh* const prefixToMap , bool& unknown ) const; // ----------------------------------------------------------------------- // Miscellaneous methods // ----------------------------------------------------------------------- bool isEmpty() const; void reset ( const unsigned int emptyId , const unsigned int unknownId , const unsigned int xmlId , const unsigned int xmlNSId ); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- WFElemStack(const WFElemStack&); WFElemStack& operator=(const WFElemStack&); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void expandMap(); void expandStack(); // ----------------------------------------------------------------------- // Data members // // fEmptyNamespaceId // This is the special URI id for the "" namespace, which is magic // because of the xmlns="" operation. // // fGlobalPoolId // This is a special URI id that is returned when the namespace // prefix is "" and no one has explicitly mapped that prefix to an // explicit URI (or when they explicitly clear any such mapping, // which they can also do.) And also its prefix pool id, which is // stored here for fast access. // // fPrefixPool // This is the prefix pool where prefixes are hashed and given unique // ids. These ids are used to track prefixes in the element stack. // // fStack // fStackCapacity // fStackTop // This the stack array. Its an array of pointers to StackElem // structures. The capacity is the current high water mark of the // stack. The top is the current top of stack (i.e. the part of it // being used.) // // fUnknownNamespaceId // This is the URI id for the special URI that is assigned to any // prefix which has not been mapped. This lets us keep going after // issuing the error. // // fXMLNamespaceId // fXMLPoolId // fXMLNSNamespaceId // fXMLNSPoolId // These are the URI ids for the special URIs that are assigned to // the 'xml' and 'xmlns' namespaces. And also its prefix pool id, // which is stored here for fast access. // ----------------------------------------------------------------------- unsigned int fEmptyNamespaceId; unsigned int fGlobalPoolId; XMLSize_t fStackCapacity; XMLSize_t fStackTop; unsigned int fUnknownNamespaceId; unsigned int fXMLNamespaceId; unsigned int fXMLPoolId; unsigned int fXMLNSNamespaceId; unsigned int fXMLNSPoolId; XMLSize_t fMapCapacity; PrefMapElem* fMap; StackElem** fStack; XMLStringPool fPrefixPool; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // ElemStack: Miscellaneous methods // --------------------------------------------------------------------------- inline bool ElemStack::isEmpty() const { return (fStackTop == 0); } inline bool ElemStack::getValidationFlag() { return fStack[fStackTop-1]->fValidationFlag; } inline void ElemStack::setValidationFlag(bool validationFlag) { fStack[fStackTop-1]->fValidationFlag = validationFlag; } inline bool ElemStack::getCommentOrPISeen() const { return fStack[fStackTop-1]->fCommentOrPISeen; } inline void ElemStack::setCommentOrPISeen() { fStack[fStackTop-1]->fCommentOrPISeen = true; } inline bool ElemStack::getReferenceEscaped() const { return fStack[fStackTop-1]->fReferenceEscaped; } inline void ElemStack::setReferenceEscaped() { fStack[fStackTop-1]->fReferenceEscaped = true; } inline void ElemStack::setCurrentSchemaElemName(const XMLCh * const schemaElemName) { XMLSize_t schemaElemNameLen = XMLString::stringLen(schemaElemName); XMLSize_t stackPos = fStackTop-1; if(fStack[stackPos]->fSchemaElemNameMaxLen <= schemaElemNameLen) { XMLCh *tempStr = fStack[stackPos]->fSchemaElemName; fStack[stackPos]->fSchemaElemNameMaxLen = schemaElemNameLen << 1; fStack[stackPos]->fSchemaElemName = (XMLCh *)fMemoryManager->allocate((fStack[stackPos]->fSchemaElemNameMaxLen)*sizeof(XMLCh)); fMemoryManager->deallocate(tempStr); } XMLString::copyString(fStack[stackPos]->fSchemaElemName, schemaElemName); } inline XMLCh *ElemStack::getCurrentSchemaElemName() { return fStack[fStackTop-1]->fSchemaElemName; } inline int ElemStack::getCurrentScope() { return fStack[fStackTop-1]->fCurrentScope; } inline void ElemStack::setCurrentScope(int currentScope) { fStack[fStackTop-1]->fCurrentScope = currentScope; } inline Grammar* ElemStack::getCurrentGrammar() { return fStack[fStackTop-1]->fCurrentGrammar; } inline void ElemStack::setCurrentGrammar(Grammar* currentGrammar) { fStack[fStackTop-1]->fCurrentGrammar = currentGrammar; } inline unsigned int ElemStack::getCurrentURI() { return fStack[fStackTop-1]->fCurrentURI; } inline void ElemStack::setCurrentURI(unsigned int uri) { fStack[fStackTop-1]->fCurrentURI = uri; } inline unsigned int ElemStack::getPrefixId(const XMLCh* const prefix) const { return fPrefixPool.getId(prefix); } inline const XMLCh* ElemStack::getPrefixForId(unsigned int prefId) const { return fPrefixPool.getValueForId(prefId); } inline void ElemStack::setPrefixColonPos(int colonPos) { fStack[fStackTop-1]->fPrefixColonPos = colonPos; } inline int ElemStack::getPrefixColonPos() const { return fStack[fStackTop-1]->fPrefixColonPos; } inline unsigned int ElemStack::getEmptyNamespaceId() { return fEmptyNamespaceId; } // --------------------------------------------------------------------------- // WFElemStack: Miscellaneous methods // --------------------------------------------------------------------------- inline bool WFElemStack::isEmpty() const { return (fStackTop == 0); } inline unsigned int WFElemStack::getCurrentURI() { return fStack[fStackTop-1]->fCurrentURI; } inline void WFElemStack::setCurrentURI(unsigned int uri) { fStack[fStackTop-1]->fCurrentURI = uri; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/XMLScanner.cpp000644 000765 000024 00000245264 13241160334 022572 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLScanner.cpp 1800342 2017-06-30 00:29:50Z scantor $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local static data // --------------------------------------------------------------------------- static XMLUInt32 gScannerId = 0; static XMLMutex* sScannerMutex = 0; static XMLMsgLoader* gMsgLoader = 0; void XMLInitializer::initializeXMLScanner() { gMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgXMLErrDomain); if (!gMsgLoader) XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain); sScannerMutex = new XMLMutex(XMLPlatformUtils::fgMemoryManager); } void XMLInitializer::terminateXMLScanner() { delete gMsgLoader; gMsgLoader = 0; delete sScannerMutex; sScannerMutex = 0; } // // typedef JanitorMemFunCall CleanupType; typedef JanitorMemFunCall ReaderMgrResetType; // --------------------------------------------------------------------------- // XMLScanner: Constructors and Destructor // --------------------------------------------------------------------------- XMLScanner::XMLScanner(XMLValidator* const valToAdopt, GrammarResolver* const grammarResolver, MemoryManager* const manager) : fBufferSize(1024 * 1024) , fLowWaterMark (100) , fStandardUriConformant(false) , fCalculateSrcOfs(false) , fDoNamespaces(false) , fExitOnFirstFatal(true) , fValidationConstraintFatal(false) , fInException(false) , fStandalone(false) , fHasNoDTD(true) , fValidate(false) , fValidatorFromUser(false) , fDoSchema(false) , fSchemaFullChecking(false) , fIdentityConstraintChecking(true) , fToCacheGrammar(false) , fUseCachedGrammar(false) , fDisallowDTD(false) , fLoadExternalDTD(true) , fLoadSchema(true) , fNormalizeData(true) , fGenerateSyntheticAnnotations(false) , fValidateAnnotations(false) , fIgnoreCachedDTD(false) , fIgnoreAnnotations(false) , fDisableDefaultEntityResolution(false) , fSkipDTDValidation(false) , fHandleMultipleImports(false) , fErrorCount(0) , fEntityExpansionLimit(0) , fEntityExpansionCount(0) , fEmptyNamespaceId(0) , fUnknownNamespaceId(0) , fXMLNamespaceId(0) , fXMLNSNamespaceId(0) , fSchemaNamespaceId(0) , fUIntPool(0) , fUIntPoolRow(0) , fUIntPoolCol(0) , fUIntPoolRowTotal(2) , fScannerId(0) , fSequenceId(0) , fAttrList(0) , fAttrDupChkRegistry(0) , fDocHandler(0) , fDocTypeHandler(0) , fEntityHandler(0) , fErrorReporter(0) , fErrorHandler(0) , fPSVIHandler(0) , fValidationContext(0) , fEntityDeclPoolRetrieved(false) , fReaderMgr(manager) , fValidator(valToAdopt) , fValScheme(Val_Never) , fGrammarResolver(grammarResolver) , fGrammarPoolMemoryManager(grammarResolver->getGrammarPoolMemoryManager()) , fGrammar(0) , fRootGrammar(0) , fURIStringPool(0) , fRootElemName(0) , fExternalSchemaLocation(0) , fExternalNoNamespaceSchemaLocation(0) , fSecurityManager(0) , fXMLVersion(XMLReader::XMLV1_0) , fMemoryManager(manager) , fBufMgr(manager) , fAttNameBuf(1023, manager) , fAttValueBuf(1023, manager) , fCDataBuf(1023, manager) , fQNameBuf(1023, manager) , fPrefixBuf(1023, manager) , fURIBuf(1023, manager) , fWSNormalizeBuf(1023, manager) , fElemStack(manager) { CleanupType cleanup(this, &XMLScanner::cleanUp); try { commonInit(); } catch(const OutOfMemoryException&) { // Don't cleanup when out of memory, since executing the // code can cause problems. cleanup.release(); throw; } cleanup.release(); } XMLScanner::XMLScanner( XMLDocumentHandler* const docHandler , DocTypeHandler* const docTypeHandler , XMLEntityHandler* const entityHandler , XMLErrorReporter* const errHandler , XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager) : fBufferSize(1024 * 1024) , fLowWaterMark (100) , fStandardUriConformant(false) , fCalculateSrcOfs(false) , fDoNamespaces(false) , fExitOnFirstFatal(true) , fValidationConstraintFatal(false) , fInException(false) , fStandalone(false) , fHasNoDTD(true) , fValidate(false) , fValidatorFromUser(false) , fDoSchema(false) , fSchemaFullChecking(false) , fIdentityConstraintChecking(true) , fToCacheGrammar(false) , fUseCachedGrammar(false) , fDisallowDTD(false) , fLoadExternalDTD(true) , fLoadSchema(true) , fNormalizeData(true) , fGenerateSyntheticAnnotations(false) , fValidateAnnotations(false) , fIgnoreCachedDTD(false) , fIgnoreAnnotations(false) , fDisableDefaultEntityResolution(false) , fSkipDTDValidation(false) , fHandleMultipleImports(false) , fErrorCount(0) , fEntityExpansionLimit(0) , fEntityExpansionCount(0) , fEmptyNamespaceId(0) , fUnknownNamespaceId(0) , fXMLNamespaceId(0) , fXMLNSNamespaceId(0) , fSchemaNamespaceId(0) , fUIntPool(0) , fUIntPoolRow(0) , fUIntPoolCol(0) , fUIntPoolRowTotal(2) , fScannerId(0) , fSequenceId(0) , fAttrList(0) , fAttrDupChkRegistry(0) , fDocHandler(docHandler) , fDocTypeHandler(docTypeHandler) , fEntityHandler(entityHandler) , fErrorReporter(errHandler) , fErrorHandler(0) , fPSVIHandler(0) , fValidationContext(0) , fEntityDeclPoolRetrieved(false) , fReaderMgr(manager) , fValidator(valToAdopt) , fValScheme(Val_Never) , fGrammarResolver(grammarResolver) , fGrammarPoolMemoryManager(grammarResolver->getGrammarPoolMemoryManager()) , fGrammar(0) , fRootGrammar(0) , fURIStringPool(0) , fRootElemName(0) , fExternalSchemaLocation(0) , fExternalNoNamespaceSchemaLocation(0) , fSecurityManager(0) , fXMLVersion(XMLReader::XMLV1_0) , fMemoryManager(manager) , fBufMgr(manager) , fAttNameBuf(1023, manager) , fAttValueBuf(1023, manager) , fCDataBuf(1023, manager) , fQNameBuf(1023, manager) , fPrefixBuf(1023, manager) , fURIBuf(1023, manager) , fWSNormalizeBuf(1023, manager) , fElemStack(manager) { CleanupType cleanup(this, &XMLScanner::cleanUp); try { commonInit(); } catch(const OutOfMemoryException&) { // Don't cleanup when out of memory, since executing the // code can cause problems. cleanup.release(); throw; } cleanup.release(); } XMLScanner::~XMLScanner() { cleanUp(); } void XMLScanner::resetCachedGrammar () { } void XMLScanner::setValidator(XMLValidator* const valToAdopt) { if (fValidatorFromUser) delete fValidator; fValidator = valToAdopt; fValidatorFromUser = true; initValidator(fValidator); } // --------------------------------------------------------------------------- // XMLScanner: Main entry point to scan a document // --------------------------------------------------------------------------- void XMLScanner::scanDocument( const XMLCh* const systemId) { // First we try to parse it as a URL. If that fails, we assume its // a file and try it that way. InputSource* srcToUse = 0; try { // Create a temporary URL. Since this is the primary document, // it has to be fully qualified. If not, then assume we are just // mistaking a file for a URL. XMLURL tmpURL(fMemoryManager); if (XMLURL::parse(systemId, tmpURL)) { if (tmpURL.isRelative()) { if (!fStandardUriConformant) srcToUse = new (fMemoryManager) LocalFileInputSource(systemId, fMemoryManager); else { // since this is the top of the try/catch, cannot call ThrowXMLwithMemMgr // emit the error directly MalformedURLException e(__FILE__, __LINE__, XMLExcepts::URL_NoProtocolPresent, fMemoryManager); fInException = true; emitError ( XMLErrs::XMLException_Fatal , e.getCode() , e.getMessage() ); return; } } else { if (fStandardUriConformant && tmpURL.hasInvalidChar()) { MalformedURLException e(__FILE__, __LINE__, XMLExcepts::URL_MalformedURL, fMemoryManager); fInException = true; emitError ( XMLErrs::XMLException_Fatal , e.getCode() , e.getMessage() ); return; } srcToUse = new (fMemoryManager) URLInputSource(tmpURL, fMemoryManager); } } else { if (!fStandardUriConformant) srcToUse = new (fMemoryManager) LocalFileInputSource(systemId, fMemoryManager); else { // since this is the top of the try/catch, cannot call ThrowXMLwithMemMgr // emit the error directly // lazy bypass ... since all MalformedURLException are fatal, no need to check the type MalformedURLException e(__FILE__, __LINE__, XMLExcepts::URL_MalformedURL, fMemoryManager); fInException = true; emitError ( XMLErrs::XMLException_Fatal , e.getCode() , e.getMessage() ); return; } } } catch(const XMLException& excToCatch) { // For any other XMLException, // emit the error and catch any user exception thrown from here. fInException = true; if (excToCatch.getErrorType() == XMLErrorReporter::ErrType_Warning) emitError ( XMLErrs::XMLException_Warning , excToCatch.getCode() , excToCatch.getMessage() ); else if (excToCatch.getErrorType() >= XMLErrorReporter::ErrType_Fatal) emitError ( XMLErrs::XMLException_Fatal , excToCatch.getCode() , excToCatch.getMessage() ); else emitError ( XMLErrs::XMLException_Error , excToCatch.getCode() , excToCatch.getMessage() ); return; } Janitor janSrc(srcToUse); scanDocument(*srcToUse); } void XMLScanner::scanDocument( const char* const systemId) { // We just delegate this to the XMLCh version after transcoding XMLCh* tmpBuf = XMLString::transcode(systemId, fMemoryManager); ArrayJanitor janBuf(tmpBuf, fMemoryManager); scanDocument(tmpBuf); } // This method begins a progressive parse. It scans through the prolog and // returns a token to be used on subsequent scanNext() calls. If the return // value is true, then the token is legal and ready for further use. If it // returns false, then the scan of the prolog failed and the token is not // going to work on subsequent scanNext() calls. bool XMLScanner::scanFirst( const XMLCh* const systemId , XMLPScanToken& toFill) { // First we try to parse it as a URL. If that fails, we assume its // a file and try it that way. InputSource* srcToUse = 0; try { // Create a temporary URL. Since this is the primary document, // it has to be fully qualified. If not, then assume we are just // mistaking a file for a URL. XMLURL tmpURL(fMemoryManager); if (XMLURL::parse(systemId, tmpURL)) { if (tmpURL.isRelative()) { if (!fStandardUriConformant) srcToUse = new (fMemoryManager) LocalFileInputSource(systemId, fMemoryManager); else { // since this is the top of the try/catch, cannot call ThrowXMLwithMemMgr // emit the error directly MalformedURLException e(__FILE__, __LINE__, XMLExcepts::URL_NoProtocolPresent, fMemoryManager); fInException = true; emitError ( XMLErrs::XMLException_Fatal , e.getCode() , e.getMessage() ); return false; } } else { if (fStandardUriConformant && tmpURL.hasInvalidChar()) { MalformedURLException e(__FILE__, __LINE__, XMLExcepts::URL_MalformedURL, fMemoryManager); fInException = true; emitError ( XMLErrs::XMLException_Fatal , e.getCode() , e.getMessage() ); return false; } srcToUse = new (fMemoryManager) URLInputSource(tmpURL, fMemoryManager); } } else { if (!fStandardUriConformant) srcToUse = new (fMemoryManager) LocalFileInputSource(systemId, fMemoryManager); else { // since this is the top of the try/catch, cannot call ThrowXMLwithMemMgr // emit the error directly // lazy bypass ... since all MalformedURLException are fatal, no need to check the type MalformedURLException e(__FILE__, __LINE__, XMLExcepts::URL_MalformedURL); fInException = true; emitError ( XMLErrs::XMLException_Fatal , e.getCode() , e.getMessage() ); return false; } } } catch(const XMLException& excToCatch) { // For any other XMLException, // emit the error and catch any user exception thrown from here. fInException = true; if (excToCatch.getErrorType() == XMLErrorReporter::ErrType_Warning) emitError ( XMLErrs::XMLException_Warning , excToCatch.getCode() , excToCatch.getMessage() ); else if (excToCatch.getErrorType() >= XMLErrorReporter::ErrType_Fatal) emitError ( XMLErrs::XMLException_Fatal , excToCatch.getCode() , excToCatch.getMessage() ); else emitError ( XMLErrs::XMLException_Error , excToCatch.getCode() , excToCatch.getMessage() ); return false; } Janitor janSrc(srcToUse); return scanFirst(*srcToUse, toFill); } bool XMLScanner::scanFirst( const char* const systemId , XMLPScanToken& toFill) { // We just delegate this to the XMLCh version after transcoding XMLCh* tmpBuf = XMLString::transcode(systemId, fMemoryManager); ArrayJanitor janBuf(tmpBuf, fMemoryManager); return scanFirst(tmpBuf, toFill); } bool XMLScanner::scanFirst( const InputSource& src , XMLPScanToken& toFill) { // Bump up the sequence id for this new scan cycle. This will invalidate // any previous tokens we've returned. fSequenceId++; ReaderMgrResetType resetReaderMgr(&fReaderMgr, &ReaderMgr::reset); // Reset the scanner and its plugged in stuff for a new run. This // resets all the data structures, creates the initial reader and // pushes it on the stack, and sets up the base document path scanReset(src); // If we have a document handler, then call the start document if (fDocHandler) fDocHandler->startDocument(); try { // Scan the prolog part, which is everything before the root element // including the DTD subsets. This is all that is done on the scan // first. scanProlog(); // If we got to the end of input, then its not a valid XML file. // Else, go on to scan the content. if (fReaderMgr.atEOF()) { emitError(XMLErrs::EmptyMainEntity); } } // NOTE: // // In all of the error processing below, the emitError() call MUST come // before the flush of the reader mgr, or it will fail because it tries // to find out the position in the XML source of the error. catch(const XMLErrs::Codes) { // This is a 'first failure' exception so return failure return false; } catch(const XMLValid::Codes) { // This is a 'first fatal error' type exit, return failure return false; } catch(const XMLException& excToCatch) { // Emit the error and catch any user exception thrown from here. Make // sure in all cases we flush the reader manager. fInException = true; try { if (excToCatch.getErrorType() == XMLErrorReporter::ErrType_Warning) emitError ( XMLErrs::XMLException_Warning , excToCatch.getCode() , excToCatch.getMessage() ); else if (excToCatch.getErrorType() >= XMLErrorReporter::ErrType_Fatal) emitError ( XMLErrs::XMLException_Fatal , excToCatch.getCode() , excToCatch.getMessage() ); else emitError ( XMLErrs::XMLException_Error , excToCatch.getCode() , excToCatch.getMessage() ); } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } return false; } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } // Fill in the caller's token to make it legal and return success toFill.set(fScannerId, fSequenceId); // Release the object that will reset the ReaderMgr, since there's // more to scan. resetReaderMgr.release(); return true; } void XMLScanner::scanReset(XMLPScanToken& token) { // Make sure this token is still legal if (!isLegalToken(token)) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Scan_BadPScanToken, fMemoryManager); // Reset the reader manager fReaderMgr.reset(); // And invalidate any tokens by bumping our sequence number fSequenceId++; // Reset our error count fErrorCount = 0; } void XMLScanner::setParseSettings(XMLScanner* const refScanner) { setDocHandler(refScanner->getDocHandler()); setDocTypeHandler(refScanner->getDocTypeHandler()); setErrorHandler(refScanner->getErrorHandler()); setErrorReporter(refScanner->getErrorReporter()); setEntityHandler(refScanner->getEntityHandler()); setDoNamespaces(refScanner->getDoNamespaces()); setDoSchema(refScanner->getDoSchema()); setCalculateSrcOfs(refScanner->getCalculateSrcOfs()); setStandardUriConformant(refScanner->getStandardUriConformant()); setExitOnFirstFatal(refScanner->getExitOnFirstFatal()); setValidationConstraintFatal(refScanner->getValidationConstraintFatal()); setIdentityConstraintChecking(refScanner->getIdentityConstraintChecking()); setValidationSchemaFullChecking(refScanner->getValidationSchemaFullChecking()); cacheGrammarFromParse(refScanner->isCachingGrammarFromParse()); useCachedGrammarInParse(refScanner->isUsingCachedGrammarInParse()); setDisallowDTD(refScanner->getDisallowDTD()); setLoadExternalDTD(refScanner->getLoadExternalDTD()); setLoadSchema(refScanner->getLoadSchema()); setNormalizeData(refScanner->getNormalizeData()); setExternalSchemaLocation(refScanner->getExternalSchemaLocation()); setExternalNoNamespaceSchemaLocation(refScanner->getExternalNoNamespaceSchemaLocation()); setValidationScheme(refScanner->getValidationScheme()); setSecurityManager(refScanner->getSecurityManager()); setPSVIHandler(refScanner->getPSVIHandler()); } // --------------------------------------------------------------------------- // XMLScanner: Private helper methods. // --------------------------------------------------------------------------- // This method handles the common initialization, to avoid having to do // it redundantly in multiple constructors. void XMLScanner::commonInit() { // We have to do a little init that involves statics, so we have to // use the mutex to protect it. { XMLMutexLock lockInit(sScannerMutex); // And assign ourselves the next available scanner id fScannerId = ++gScannerId; } // Create the attribute list, which is used to store attribute values // during start tag processing. Give it a reasonable initial size that // will serve for most folks, though it will grow as required. fAttrList = new (fMemoryManager) RefVectorOf(32, true, fMemoryManager); // Create the id ref list. This is used to enforce XML 1.0 ID ref // semantics, i.e. all id refs must refer to elements that exist fValidationContext = new (fMemoryManager) ValidationContextImpl(fMemoryManager); fValidationContext->setElemStack(&fElemStack); fValidationContext->setScanner(this); // Create the GrammarResolver //fGrammarResolver = new GrammarResolver(); // create initial, 64-element, fUIntPool fUIntPool = (unsigned int **)fMemoryManager->allocate(sizeof(unsigned int *) *fUIntPoolRowTotal); memset(fUIntPool, 0, sizeof(unsigned int *) * fUIntPoolRowTotal); fUIntPool[0] = (unsigned int *)fMemoryManager->allocate(sizeof(unsigned int) << 6); memset(fUIntPool[0], 0, sizeof(unsigned int) << 6); // Register self as handler for XMLBufferFull events on the CDATA buffer fCDataBuf.setFullHandler(this, fBufferSize); if (fValidator) { fValidatorFromUser = true; initValidator(fValidator); } } void XMLScanner::cleanUp() { delete fAttrList; delete fAttrDupChkRegistry; delete fValidationContext; fMemoryManager->deallocate(fRootElemName);//delete [] fRootElemName; fMemoryManager->deallocate(fExternalSchemaLocation);//delete [] fExternalSchemaLocation; fMemoryManager->deallocate(fExternalNoNamespaceSchemaLocation);//delete [] fExternalNoNamespaceSchemaLocation; // delete fUIntPool if (fUIntPool) { for (unsigned int i=0; i<=fUIntPoolRow; i++) { fMemoryManager->deallocate(fUIntPool[i]); } fMemoryManager->deallocate(fUIntPool); } } void XMLScanner::initValidator(XMLValidator* theValidator) { // Tell the validator about the stuff it needs to know in order to // do its work. theValidator->setScannerInfo(this, &fReaderMgr, &fBufMgr); theValidator->setErrorReporter(fErrorReporter); } // --------------------------------------------------------------------------- // XMLScanner: Error emitting methods // --------------------------------------------------------------------------- // These methods are called whenever the scanner wants to emit an error. // It handles getting the message loaded, doing token replacement, etc... // and then calling the error handler, if its installed. bool XMLScanner::emitErrorWillThrowException(const XMLErrs::Codes toEmit) { if (XMLErrs::isFatal(toEmit) && fExitOnFirstFatal && !fInException) return true; return false; } void XMLScanner::emitError(const XMLErrs::Codes toEmit) { // Bump the error count if it is not a warning if (XMLErrs::errorType(toEmit) != XMLErrorReporter::ErrType_Warning) incrementErrorCount(); if (fErrorReporter) { // Load the message into a local for display const XMLSize_t msgSize = 1023; XMLCh errText[msgSize + 1]; if (!gMsgLoader->loadMsg(toEmit, errText, msgSize)) { // Probably should load a default msg here } // Create a LastExtEntityInfo structure and get the reader manager // to fill it in for us. This will give us the information about // the last reader on the stack that was an external entity of some // sort (i.e. it will ignore internal entities. ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr.getLastExtEntityInfo(lastInfo); fErrorReporter->error ( toEmit , XMLUni::fgXMLErrDomain , XMLErrs::errorType(toEmit) , errText , lastInfo.systemId , lastInfo.publicId , lastInfo.lineNumber , lastInfo.colNumber ); } // Bail out if its fatal an we are to give up on the first fatal error if (emitErrorWillThrowException(toEmit)) throw toEmit; } void XMLScanner::emitError( const XMLErrs::Codes toEmit , const XMLCh* const text1 , const XMLCh* const text2 , const XMLCh* const text3 , const XMLCh* const text4) { // Bump the error count if it is not a warning if (XMLErrs::errorType(toEmit) != XMLErrorReporter::ErrType_Warning) incrementErrorCount(); if (fErrorReporter) { // Load the message into alocal and replace any tokens found in // the text. const XMLSize_t maxChars = 2047; XMLCh errText[maxChars + 1]; if (!gMsgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4, fMemoryManager)) { // Should probably load a default message here } // Create a LastExtEntityInfo structure and get the reader manager // to fill it in for us. This will give us the information about // the last reader on the stack that was an external entity of some // sort (i.e. it will ignore internal entities. ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr.getLastExtEntityInfo(lastInfo); fErrorReporter->error ( toEmit , XMLUni::fgXMLErrDomain , XMLErrs::errorType(toEmit) , errText , lastInfo.systemId , lastInfo.publicId , lastInfo.lineNumber , lastInfo.colNumber ); } // Bail out if its fatal an we are to give up on the first fatal error if (emitErrorWillThrowException(toEmit)) throw toEmit; } void XMLScanner::emitError( const XMLErrs::Codes toEmit , const char* const text1 , const char* const text2 , const char* const text3 , const char* const text4) { // Bump the error count if it is not a warning if (XMLErrs::errorType(toEmit) != XMLErrorReporter::ErrType_Warning) incrementErrorCount(); if (fErrorReporter) { // Load the message into alocal and replace any tokens found in // the text. const XMLSize_t maxChars = 2047; XMLCh errText[maxChars + 1]; if (!gMsgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4, fMemoryManager)) { // Should probably load a default message here } // Create a LastExtEntityInfo structure and get the reader manager // to fill it in for us. This will give us the information about // the last reader on the stack that was an external entity of some // sort (i.e. it will ignore internal entities. ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr.getLastExtEntityInfo(lastInfo); fErrorReporter->error ( toEmit , XMLUni::fgXMLErrDomain , XMLErrs::errorType(toEmit) , errText , lastInfo.systemId , lastInfo.publicId , lastInfo.lineNumber , lastInfo.colNumber ); } // Bail out if its fatal an we are to give up on the first fatal error if (emitErrorWillThrowException(toEmit)) throw toEmit; } void XMLScanner::emitError( const XMLErrs::Codes toEmit , const XMLExcepts::Codes originalExceptCode , const XMLCh* const text1 , const XMLCh* const text2 , const XMLCh* const text3 , const XMLCh* const text4) { // Bump the error count if it is not a warning if (XMLErrs::errorType(toEmit) != XMLErrorReporter::ErrType_Warning) incrementErrorCount(); if (fErrorReporter) { // Load the message into alocal and replace any tokens found in // the text. const XMLSize_t maxChars = 2047; XMLCh errText[maxChars + 1]; if (!gMsgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4, fMemoryManager)) { // Should probably load a default message here } // Create a LastExtEntityInfo structure and get the reader manager // to fill it in for us. This will give us the information about // the last reader on the stack that was an external entity of some // sort (i.e. it will ignore internal entities. ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr.getLastExtEntityInfo(lastInfo); fErrorReporter->error ( originalExceptCode , XMLUni::fgExceptDomain //fgXMLErrDomain , XMLErrs::errorType(toEmit) , errText , lastInfo.systemId , lastInfo.publicId , lastInfo.lineNumber , lastInfo.colNumber ); } // Bail out if its fatal an we are to give up on the first fatal error if (emitErrorWillThrowException(toEmit)) throw toEmit; } // --------------------------------------------------------------------------- // XMLScanner: Getter methods // --------------------------------------------------------------------------- // This method allows the caller to query the current location of the scanner. // It will return the sys/public ids of the current entity, and the line/col // position within it. // // NOTE: This API returns the location with the last external file. So if its // currently scanning an entity, the position returned will be the end of // the entity reference in the file that had the reference. // /*bool XMLScanner::getLastExtLocation( XMLCh* const sysIdToFill , const unsigned int maxSysIdChars , XMLCh* const pubIdToFill , const unsigned int maxPubIdChars , XMLSSize_t& lineToFill , XMLSSize_t& colToFill) const { // Create a local info object and get it filled in by the reader manager ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr.getLastExtEntityInfo(lastInfo); // Fill in the line and column number lineToFill = lastInfo.lineNumber; colToFill = lastInfo.colNumber; // And copy over as much of the ids as will fit sysIdToFill[0] = 0; if (lastInfo.systemId) { if (XMLString::stringLen(lastInfo.systemId) > maxSysIdChars) return false; XMLString::copyString(sysIdToFill, lastInfo.systemId); } pubIdToFill[0] = 0; if (lastInfo.publicId) { if (XMLString::stringLen(lastInfo.publicId) > maxPubIdChars) return false; XMLString::copyString(pubIdToFill, lastInfo.publicId); } return true; }*/ // --------------------------------------------------------------------------- // XMLScanner: Private scanning methods // --------------------------------------------------------------------------- // This method is called after the end of the root element, to handle // any miscellaneous stuff hanging around. void XMLScanner::scanMiscellaneous() { // Get a buffer for this work XMLBufBid bbCData(&fBufMgr); while (true) { try { const XMLCh nextCh = fReaderMgr.peekNextChar(); // Watch for end of file and break out if (!nextCh) break; if (nextCh == chOpenAngle) { if (checkXMLDecl(true)) { // Can't have an XML decl here emitError(XMLErrs::NotValidAfterContent); fReaderMgr.skipPastChar(chCloseAngle); } else if (fReaderMgr.skippedString(XMLUni::fgPIString)) { scanPI(); } else if (fReaderMgr.skippedString(XMLUni::fgCommentString)) { scanComment(); } else { // This can't be possible, so just give up emitError(XMLErrs::ExpectedCommentOrPI); fReaderMgr.skipPastChar(chCloseAngle); } } else if (fReaderMgr.getCurrentReader()->isWhitespace(nextCh)) { // If we have a doc handler, then gather up the spaces and // call back. Otherwise, just skip over whitespace. if (fDocHandler) { fReaderMgr.getSpaces(bbCData.getBuffer()); fDocHandler->ignorableWhitespace ( bbCData.getRawBuffer() , bbCData.getLen() , false ); } else { fReaderMgr.skipPastSpaces(); } } else { emitError(XMLErrs::ExpectedCommentOrPI); fReaderMgr.skipPastChar(chCloseAngle); } } catch(const EndOfEntityException&) { // Some entity leaked out of the content part of the document. Issue // a warning and keep going. emitError(XMLErrs::EntityPropogated); } } } // Scans a PI and calls the appropriate callbacks. At entry we have just // scanned the ' to be a termination of the target if (fReaderMgr.skippedChar(chCloseAngle)) break; } // Check for correct surrogate pairs if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); else gotLeadingSurrogate = true; } else { if (gotLeadingSurrogate) { if ((nextCh < 0xDC00) || (nextCh > 0xDFFF)) emitError(XMLErrs::Expected2ndSurrogateChar); } // Its got to at least be a valid XML character else if (!fReaderMgr.getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); emitError(XMLErrs::InvalidCharacter, tmpBuf); } gotLeadingSurrogate = false; } bbTarget.append(nextCh); } } else { // No target, but make sure its terminated ok if (!fReaderMgr.skippedChar(chQuestion)) { emitError(XMLErrs::UnterminatedPI); fReaderMgr.skipPastChar(chCloseAngle); return; } if (!fReaderMgr.skippedChar(chCloseAngle)) { emitError(XMLErrs::UnterminatedPI); fReaderMgr.skipPastChar(chCloseAngle); return; } } // Point the target pointer at the raw data targetPtr = bbTarget.getRawBuffer(); // If we have a handler, then call it if (fDocHandler) { fDocHandler->docPI ( namePtr , targetPtr ); } //mark PI is seen within the current element if (! fElemStack.isEmpty()) fElemStack.setCommentOrPISeen(); } // Scans all the input from the start of the file to the root element. // There does not have to be anything in the prolog necessarily, but usually // there is at least an XMLDecl. // // On exit from here we are either at the end of the file or about to read // the opening < of the root element. void XMLScanner::scanProlog() { bool sawDocTypeDecl = false; // Get a buffer for whitespace processing XMLBufBid bbCData(&fBufMgr); // Loop through the prolog. If there is no content, this could go all // the way to the end of the file. try { while (true) { const XMLCh nextCh = fReaderMgr.peekNextChar(); if (nextCh == chOpenAngle) { // Ok, it could be the xml decl, a comment, the doc type line, // or the start of the root element. if (checkXMLDecl(true)) { // There shall be at lease --ONE-- space in between // the tag 'getLineNumber() != 1) || (curReader->getColumnNumber() != 7)) { emitError(XMLErrs::XMLDeclMustBeFirst); } scanXMLDecl(Decl_XML); } else if (fReaderMgr.skippedString(XMLUni::fgPIString)) { scanPI(); } else if (fReaderMgr.skippedString(XMLUni::fgCommentString)) { scanComment(); } else if (fReaderMgr.skippedString(XMLUni::fgDocTypeString)) { if (sawDocTypeDecl) { emitError(XMLErrs::DuplicateDocTypeDecl); } const char* envvar = getenv("XERCES_DISABLE_DTD"); if (fDisallowDTD || (envvar && !strcmp(envvar, "1"))) { emitError(XMLErrs::InvalidDocumentStructure); } else { scanDocTypeDecl(); sawDocTypeDecl = true; } // if reusing grammar, this has been validated already in first scan // skip for performance if (fValidate && fGrammar && !fGrammar->getValidated()) { // validate the DTD scan so far fValidator->preContentValidation(fUseCachedGrammar, true); } } else { // Assume its the start of the root element return; } } else if (fReaderMgr.getCurrentReader()->isWhitespace(nextCh)) { // If we have a document handler then gather up the // whitespace and call back. Otherwise just skip over spaces. if (fDocHandler) { fReaderMgr.getSpaces(bbCData.getBuffer()); fDocHandler->ignorableWhitespace ( bbCData.getRawBuffer() , bbCData.getLen() , false ); } else { fReaderMgr.skipPastSpaces(); } } else { emitError(XMLErrs::InvalidDocumentStructure); // Watch for end of file and break out if (!nextCh) break; else fReaderMgr.skipPastChar(chCloseAngle); } } } catch(const EndOfEntityException&) { // We should never get an end of entity here. They should only // occur within the doc type scanning method, and not leak out to // here. emitError ( XMLErrs::UnexpectedEOE , "in prolog" ); } } // Scans the line. This stuff is all sequential so we don't // do any state machine loop here. We just bull straight through it. It ends // past the closing bracket. If there is a document handler, then its called // on the XMLDecl callback. // // On entry, the ' // [77] TextDecl::= '' void XMLScanner::scanXMLDecl(const DeclTypes type) { // Get us some buffers to use XMLBufBid bbVersion(&fBufMgr); XMLBufBid bbEncoding(&fBufMgr); XMLBufBid bbStand(&fBufMgr); XMLBufBid bbDummy(&fBufMgr); XMLBufBid bbName(&fBufMgr); // We use this little enum and array to keep up with what we found // and what order we found them in. This lets us get them free form // without too much overhead, but still know that they were in the // wrong order. enum Strings { VersionString , EncodingString , StandaloneString , UnknownString , StringCount }; int flags[StringCount] = { -1, -1, -1, -1 }; // Also set up a list of buffers in the right order so that we know // where to put stuff. XMLBuffer* buffers[StringCount] ; buffers[0] = &bbVersion.getBuffer(); buffers[1] = &bbEncoding.getBuffer(); buffers[2] = &bbStand.getBuffer(); buffers[3] = &bbDummy.getBuffer(); int curCount = 0; Strings curString; XMLBuffer& nameBuf = bbName.getBuffer(); while (true) { // Skip any spaces bool skippedSomething; fReaderMgr.skipPastSpaces(skippedSomething, true); // If we are looking at a question mark, then break out if (fReaderMgr.lookingAtChar(chQuestion)) break; // If this is not the first string, then we require the spaces if (!skippedSomething && curCount) emitError(XMLErrs::ExpectedWhitespace); // Get characters up to the next whitespace or equal's sign. if (!scanUpToWSOr(nameBuf, chEqual)) emitError(XMLErrs::ExpectedDeclString); // See if it matches any of our expected strings if (XMLString::equals(nameBuf.getRawBuffer(), XMLUni::fgVersionString)) curString = VersionString; else if (XMLString::equals(nameBuf.getRawBuffer(), XMLUni::fgEncodingString)) curString = EncodingString; else if (XMLString::equals(nameBuf.getRawBuffer(), XMLUni::fgStandaloneString)) curString = StandaloneString; else curString = UnknownString; // If its an unknown string, then give that error. Else check to // see if this one has been done already and give that error. if (curString == UnknownString) emitError(XMLErrs::ExpectedDeclString, nameBuf.getRawBuffer()); else if (flags[curString] != -1) emitError(XMLErrs::DeclStringRep, nameBuf.getRawBuffer()); else if (flags[curString] == -1) flags[curString] = ++curCount; // Scan for an equal's sign. If we don't find it, issue an error // but keep trying to go on. if (!scanEq(true)) emitError(XMLErrs::ExpectedEqSign); // Get a quote string into the buffer for the string that we are // currently working on. if (!getQuotedString(*buffers[curString])) { emitError(XMLErrs::ExpectedQuotedString); fReaderMgr.skipPastChar(chCloseAngle); return; } // And validate the value according which one it was const XMLCh* rawValue = buffers[curString]->getRawBuffer(); if (curString == VersionString) { if (XMLString::equals(rawValue, XMLUni::fgVersion1_1)) { if (type == Decl_XML) { fXMLVersion = XMLReader::XMLV1_1; fReaderMgr.setXMLVersion(XMLReader::XMLV1_1); } else { if (fXMLVersion != XMLReader::XMLV1_1) emitError(XMLErrs::UnsupportedXMLVersion, rawValue); } } else if (XMLString::equals(rawValue, XMLUni::fgVersion1_0)) { if (type == Decl_XML) { fXMLVersion = XMLReader::XMLV1_0; fReaderMgr.setXMLVersion(XMLReader::XMLV1_0); } } else if (XMLString::startsWith(rawValue, XMLUni::fgVersion1)) { if (type == Decl_XML) { fXMLVersion = XMLReader::XMLV1_0; fReaderMgr.setXMLVersion(XMLReader::XMLV1_0); } } else emitError(XMLErrs::UnsupportedXMLVersion, rawValue); } else if (curString == EncodingString) { if (!XMLString::isValidEncName(rawValue)) emitError(XMLErrs::BadXMLEncoding, rawValue); } else if (curString == StandaloneString) { if (XMLString::equals(rawValue, XMLUni::fgYesString)) fStandalone = true; else if (XMLString::equals(rawValue, XMLUni::fgNoString)) fStandalone = false; else { emitError(XMLErrs::BadStandalone); //if (!XMLString::compareIString(rawValue, XMLUni::fgYesString)) //else if (!XMLString::compareIString(rawValue, XMLUni::fgNoString)) if (buffers[curString]->getLen() == 3 && (((rawValue[0] == chLatin_y) || (rawValue[0] == chLatin_Y)) && ((rawValue[1] == chLatin_e) || (rawValue[1] == chLatin_E)) && ((rawValue[2] == chLatin_s) || (rawValue[2] == chLatin_S)))) fStandalone = true; else if (buffers[curString]->getLen() == 2 && (((rawValue[0] == chLatin_n) || (rawValue[0] == chLatin_N)) && ((rawValue[1] == chLatin_o) || (rawValue[1] == chLatin_O)))) fStandalone = false; } } } // Make sure that the strings present are in order. We don't care about // which ones are present at this point, just that any there are in the // right order. int curTop = 0; for (int index = VersionString; index < StandaloneString; index++) { if (flags[index] != -1) { if (flags[index] != curTop + 1) { emitError(XMLErrs::DeclStringsInWrongOrder); break; } curTop = flags[index]; } } // If its an XML decl, the version must be present. // If its a Text decl, then encoding must be present AND standalone must not be present. if ((type == Decl_XML) && (flags[VersionString] == -1)) emitError(XMLErrs::XMLVersionRequired); else if (type == Decl_Text) { if (flags[StandaloneString] != -1) emitError(XMLErrs::StandaloneNotLegal); if (flags[EncodingString] == -1) emitError(XMLErrs::EncodingRequired); } if (!fReaderMgr.skippedChar(chQuestion)) { emitError(XMLErrs::UnterminatedXMLDecl); fReaderMgr.skipPastChar(chCloseAngle); } else if (!fReaderMgr.skippedChar(chCloseAngle)) { emitError(XMLErrs::UnterminatedXMLDecl); fReaderMgr.skipPastChar(chCloseAngle); } // Do this before we possibly update the reader with the // actual encoding string. Otherwise, we will pass the wrong thing // for the last parameter! const XMLCh* actualEnc = fReaderMgr.getCurrentEncodingStr(); // Ok, we've now seen the real encoding string, if there was one, so // lets call back on the current reader and tell it what the real // encoding string was. If it fails, that's because it represents some // sort of contradiction with the autosensed format, and it keeps the // original encoding. // // NOTE: This can fail for a number of reasons, such as a bogus encoding // name or because its in flagrant contradiction of the auto-sensed // format. if (flags[EncodingString] != -1) { if (!fReaderMgr.getCurrentReader()->setEncoding(bbEncoding.getRawBuffer())) emitError(XMLErrs::ContradictoryEncoding, bbEncoding.getRawBuffer()); else actualEnc = bbEncoding.getRawBuffer(); } // If we have a document handler then call the XML Decl callback. if (type == Decl_XML) { if (fDocHandler) fDocHandler->XMLDecl ( bbVersion.getRawBuffer() , bbEncoding.getRawBuffer() , bbStand.getRawBuffer() , actualEnc ); } else if (type == Decl_Text) { if (fDocTypeHandler) fDocTypeHandler->TextDecl ( bbVersion.getRawBuffer() , bbEncoding.getRawBuffer() ); } } const XMLCh* XMLScanner::getURIText(const unsigned int uriId) const { if (fURIStringPool->exists(uriId)) { // Look up the URI in the string pool and return its id const XMLCh* value = fURIStringPool->getValueForId(uriId); if (!value) return XMLUni::fgZeroLenString; return value; } else return XMLUni::fgZeroLenString; } bool XMLScanner::getURIText( const unsigned int uriId , XMLBuffer& uriBufToFill) const { if (fURIStringPool->exists(uriId)) { // Look up the URI in the string pool and return its id const XMLCh* value = fURIStringPool->getValueForId(uriId); if (!value) return false; uriBufToFill.set(value); return true; } else return false; } bool XMLScanner::checkXMLDecl(bool startWithAngle) { // [23] XMLDecl ::= '' // [24] VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"') // // [3] S ::= (#x20 | #x9 | #xD | #xA)+ if (startWithAngle) { if (fReaderMgr.peekString(XMLUni::fgXMLDeclString)) { if (fReaderMgr.skippedString(XMLUni::fgXMLDeclStringSpace) || fReaderMgr.skippedString(XMLUni::fgXMLDeclStringHTab) || fReaderMgr.skippedString(XMLUni::fgXMLDeclStringLF) || fReaderMgr.skippedString(XMLUni::fgXMLDeclStringCR)) { return true; } } else if (fReaderMgr.skippedString(XMLUni::fgXMLDeclStringSpaceU) || fReaderMgr.skippedString(XMLUni::fgXMLDeclStringHTabU) || fReaderMgr.skippedString(XMLUni::fgXMLDeclStringLFU) || fReaderMgr.skippedString(XMLUni::fgXMLDeclStringCRU)) { // Just in case, check for upper case. If found, issue // an error, but keep going. emitError(XMLErrs::XMLDeclMustBeLowerCase); return true; } } else { if (fReaderMgr.peekString(XMLUni::fgXMLString)) { if (fReaderMgr.skippedString(XMLUni::fgXMLStringSpace) || fReaderMgr.skippedString(XMLUni::fgXMLStringHTab) || fReaderMgr.skippedString(XMLUni::fgXMLStringLF) || fReaderMgr.skippedString(XMLUni::fgXMLStringCR)) { return true; } } else if (fReaderMgr.skippedString(XMLUni::fgXMLStringSpaceU) || fReaderMgr.skippedString(XMLUni::fgXMLStringHTabU) || fReaderMgr.skippedString(XMLUni::fgXMLStringLFU) || fReaderMgr.skippedString(XMLUni::fgXMLStringCRU)) { // Just in case, check for upper case. If found, issue // an error, but keep going. emitError(XMLErrs::XMLDeclMustBeLowerCase); return true; } } return false; } // --------------------------------------------------------------------------- // XMLScanner: Grammar preparsing // --------------------------------------------------------------------------- Grammar* XMLScanner::loadGrammar(const XMLCh* const systemId , const short grammarType , const bool toCache) { InputSource* srcToUse = 0; if (fEntityHandler){ ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr.getLastExtEntityInfo(lastInfo); XMLResourceIdentifier resourceIdentifier(XMLResourceIdentifier::ExternalEntity, systemId, 0, XMLUni::fgZeroLenString, lastInfo.systemId, &fReaderMgr); srcToUse = fEntityHandler->resolveEntity(&resourceIdentifier); } // First we try to parse it as a URL. If that fails, we assume its // a file and try it that way. if (!srcToUse) { if (fDisableDefaultEntityResolution) return 0; try { // Create a temporary URL. Since this is the primary document, // it has to be fully qualified. If not, then assume we are just // mistaking a file for a URL. XMLURL tmpURL(fMemoryManager); if (XMLURL::parse(systemId, tmpURL)) { if (tmpURL.isRelative()) { if (!fStandardUriConformant) srcToUse = new (fMemoryManager) LocalFileInputSource(systemId, fMemoryManager); else { // since this is the top of the try/catch, cannot call ThrowXMLwithMemMgr // emit the error directly MalformedURLException e(__FILE__, __LINE__, XMLExcepts::URL_NoProtocolPresent, fMemoryManager); fInException = true; emitError ( XMLErrs::XMLException_Fatal , e.getCode() , e.getMessage() ); return 0; } } else { if (fStandardUriConformant && tmpURL.hasInvalidChar()) { MalformedURLException e(__FILE__, __LINE__, XMLExcepts::URL_MalformedURL, fMemoryManager); fInException = true; emitError ( XMLErrs::XMLException_Fatal , e.getCode() , e.getMessage() ); return 0; } srcToUse = new (fMemoryManager) URLInputSource(tmpURL, fMemoryManager); } } else { if (!fStandardUriConformant) srcToUse = new (fMemoryManager) LocalFileInputSource(systemId, fMemoryManager); else { // since this is the top of the try/catch, cannot call ThrowXMLwithMemMgr // emit the error directly // lazy bypass ... since all MalformedURLException are fatal, no need to check the type MalformedURLException e(__FILE__, __LINE__, XMLExcepts::URL_MalformedURL); fInException = true; emitError ( XMLErrs::XMLException_Fatal , e.getCode() , e.getMessage() ); return 0; } } } catch(const XMLException& excToCatch) { // For any other XMLException, // emit the error and catch any user exception thrown from here. fInException = true; if (excToCatch.getErrorType() == XMLErrorReporter::ErrType_Warning) emitError ( XMLErrs::XMLException_Warning , excToCatch.getCode() , excToCatch.getMessage() ); else if (excToCatch.getErrorType() >= XMLErrorReporter::ErrType_Fatal) emitError ( XMLErrs::XMLException_Fatal , excToCatch.getCode() , excToCatch.getMessage() ); else emitError ( XMLErrs::XMLException_Error , excToCatch.getCode() , excToCatch.getMessage() ); return 0; } } Janitor janSrc(srcToUse); return loadGrammar(*srcToUse, grammarType, toCache); } Grammar* XMLScanner::loadGrammar(const char* const systemId , const short grammarType , const bool toCache) { // We just delegate this to the XMLCh version after transcoding XMLCh* tmpBuf = XMLString::transcode(systemId, fMemoryManager); ArrayJanitor janBuf(tmpBuf, fMemoryManager); return loadGrammar(tmpBuf, grammarType, toCache); } // --------------------------------------------------------------------------- // XMLScanner: Setter methods // --------------------------------------------------------------------------- void XMLScanner::setURIStringPool(XMLStringPool* const stringPool) { fURIStringPool = stringPool; fEmptyNamespaceId = fURIStringPool->addOrFind(XMLUni::fgZeroLenString); fUnknownNamespaceId = fURIStringPool->addOrFind(XMLUni::fgUnknownURIName); fXMLNamespaceId = fURIStringPool->addOrFind(XMLUni::fgXMLURIName); fXMLNSNamespaceId = fURIStringPool->addOrFind(XMLUni::fgXMLNSURIName); } // --------------------------------------------------------------------------- // XMLScanner: Private helper methods // --------------------------------------------------------------------------- /*** * In reusing grammars (cacheing grammar from parse, or use cached grammar), internal * dtd is allowed conditionally. * * In the case of cacheing grammar from parse, it is NOT allowed. * * In the case of use cached grammar, * if external dtd is present and it is parsed before, then it is not allowed, * otherwise it is allowed. * ***/ void XMLScanner::checkInternalDTD(bool hasExtSubset ,const XMLCh* const sysId ,const XMLCh* const pubId) { if (fToCacheGrammar) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Val_CantHaveIntSS, fMemoryManager); if (fUseCachedGrammar && hasExtSubset && !fIgnoreCachedDTD) { InputSource* sysIdSrc = resolveSystemId(sysId, pubId); if (sysIdSrc) { Janitor janSysIdSrc(sysIdSrc); Grammar* grammar = fGrammarResolver->getGrammar(sysIdSrc->getSystemId()); if (grammar && grammar->getGrammarType() == Grammar::DTDGrammarType) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Val_CantHaveIntSS, fMemoryManager); } } } } // This method is called after the content scan to insure that all the // ID/IDREF attributes match up (i.e. that all IDREFs refer to IDs.) This is // an XML 1.0 rule, so we can do here in the core. void XMLScanner::checkIDRefs() { // Iterate the id ref list. If we find any entries here which are used // but not declared, then that's an error. RefHashTableOfEnumerator refEnum(fValidationContext->getIdRefList(), false, fMemoryManager); while (refEnum.hasMoreElements()) { // Get a ref to the current element const XMLRefInfo& curRef = refEnum.nextElement(); // If its used but not declared, then its an error if (!curRef.getDeclared() && curRef.getUsed() && fValidate) fValidator->emitError(XMLValid::IDNotDeclared, curRef.getRefName()); } } // This just does a simple check that the passed progressive scan token is // legal for this scanner. bool XMLScanner::isLegalToken(const XMLPScanToken& toCheck) { return ((fScannerId == toCheck.fScannerId) && (fSequenceId == toCheck.fSequenceId)); } // This method will handle figuring out what the next top level token is // in the input stream. It will return an enumerated value that indicates // what it believes the next XML level token must be. It will eat as many // chars are required to figure out what is next. XMLScanner::XMLTokens XMLScanner::senseNextToken(XMLSize_t& orgReader) { // Get the next character and use it to guesstimate what the next token // is going to be. We turn on end of entity exceptions when we do this // in order to catch the scenario where the current entity ended at // the > of some markup. XMLCh nextCh=0; XMLReader* curReader=fReaderMgr.getCurrentReader(); // avoid setting up the ThrowEOEJanitor if we know that we have data in the current reader if(curReader && curReader->charsLeftInBuffer()>0) nextCh = fReaderMgr.peekNextChar(); else { ThrowEOEJanitor janMgr(&fReaderMgr, true); nextCh = fReaderMgr.peekNextChar(); } // If it's not a '<' we must be in content (unless it's a EOF) // // This includes entity references '&' of some sort. These must // be character data because that's the only place a reference can // occur in content. if (nextCh != chOpenAngle) return nextCh?Token_CharData:Token_EOF; // Ok it had to have been a '<' character. So get it out of the reader // and store the reader number where we saw it, passing it back to the // caller. fReaderMgr.getNextChar(); orgReader = fReaderMgr.getCurrentReaderNum(); // Ok, so lets go through the things that it could be at this point which // are all some form of markup. switch(fReaderMgr.peekNextChar()) { case chForwardSlash: { fReaderMgr.getNextChar(); return Token_EndTag; } case chBang: { static const XMLCh gCDATAStr[] = { chBang, chOpenSquare, chLatin_C, chLatin_D, chLatin_A , chLatin_T, chLatin_A, chNull }; static const XMLCh gCommentString[] = { chBang, chDash, chDash, chNull }; if (fReaderMgr.skippedString(gCDATAStr)) return Token_CData; if (fReaderMgr.skippedString(gCommentString)) return Token_Comment; emitError(XMLErrs::ExpectedCommentOrCDATA); return Token_Unknown; } case chQuestion: { // It must be a PI fReaderMgr.getNextChar(); return Token_PI; } } // Assume its an element name, so return with a start tag token. If it // turns out not to be, then it will fail when it cannot get a valid tag. return Token_StartTag; } // --------------------------------------------------------------------------- // XMLScanner: Private parsing methods // --------------------------------------------------------------------------- // This guy just scans out a single or double quoted string of characters. // It does not pass any judgement on the contents and assumes that it is // illegal to have another quote of the same kind inside the string's // contents. // // NOTE: This is for simple stuff like the strings in the XMLDecl which // cannot have any entities inside them. So this guy does not handle any // end of entity stuff. bool XMLScanner::getQuotedString(XMLBuffer& toFill) { // Reset the target buffer toFill.reset(); // Get the next char which must be a single or double quote XMLCh quoteCh; if (!fReaderMgr.skipIfQuote(quoteCh)) return false; XMLCh nextCh; // Get another char and see if it matches the starting quote char while ((nextCh=fReaderMgr.getNextChar())!=quoteCh) { // We should never get either an end of file null char here. If we // do, just fail. It will be handled more gracefully in the higher // level code that called us. if (!nextCh) return false; // Else add it to the buffer toFill.append(nextCh); } return true; } // This method scans a character reference and returns the character that // was refered to. It assumes that we've already scanned the &# characters // that prefix the numeric code. bool XMLScanner::scanCharRef(XMLCh& toFill, XMLCh& second) { bool gotOne = false; unsigned int value = 0; // Set the radix. Its supposed to be a lower case x if hex. But, in // order to recover well, we check for an upper and put out an error // for that. unsigned int radix = 10; if (fReaderMgr.skippedChar(chLatin_x)) { radix = 16; } else if (fReaderMgr.skippedChar(chLatin_X)) { emitError(XMLErrs::HexRadixMustBeLowerCase); radix = 16; } while (true) { const XMLCh nextCh = fReaderMgr.peekNextChar(); // Watch for EOF if (!nextCh) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); // Break out on the terminating semicolon if (nextCh == chSemiColon) { fReaderMgr.getNextChar(); break; } // Convert this char to a binary value, or bail out if its not // one. unsigned int nextVal; if ((nextCh >= chDigit_0) && (nextCh <= chDigit_9)) nextVal = (unsigned int)(nextCh - chDigit_0); else if ((nextCh >= chLatin_A) && (nextCh <= chLatin_F)) nextVal= (unsigned int)(10 + (nextCh - chLatin_A)); else if ((nextCh >= chLatin_a) && (nextCh <= chLatin_f)) nextVal = (unsigned int)(10 + (nextCh - chLatin_a)); else { // Return a zero toFill = 0; // If we got at least a sigit, then do an unterminated ref error. // Else, do an expected a numerical ref thing. if (gotOne) emitError(XMLErrs::UnterminatedCharRef); else emitError(XMLErrs::ExpectedNumericalCharRef); // Return failure return false; } // Make sure its valid for the radix. If not, then just eat the // digit and go on after issueing an error. Else, update the // running value with this new digit. if (nextVal >= radix) { XMLCh tmpStr[2]; tmpStr[0] = nextCh; tmpStr[1] = chNull; emitError(XMLErrs::BadDigitForRadix, tmpStr); } else { value = (value * radix) + nextVal; // Guard against overflow. if (value > 0x10FFFF) { // Character reference was not in the valid range emitError(XMLErrs::InvalidCharacterRef); return false; } } // Indicate that we got at least one good digit gotOne = true; // And eat the last char fReaderMgr.getNextChar(); } // Return the char (or chars) // And check if the character expanded is valid or not if (value >= 0x10000 && value <= 0x10FFFF) { value -= 0x10000; toFill = XMLCh((value >> 10) + 0xD800); second = XMLCh((value & 0x3FF) + 0xDC00); } else if (value <= 0xFFFD) { toFill = XMLCh(value); second = 0; if (!fReaderMgr.getCurrentReader()->isXMLChar(toFill) && !fReaderMgr.getCurrentReader()->isControlChar(toFill)) { // Character reference was not in the valid range emitError(XMLErrs::InvalidCharacterRef); return false; } } else { // Character reference was not in the valid range emitError(XMLErrs::InvalidCharacterRef); return false; } return true; } // We get here after the '' It will calls the appropriate handler with the comment // text, if one is provided. A comment can be in either the document or // the DTD, so the fInDocument flag is used to know which handler to send // it to. void XMLScanner::scanComment() { enum States { InText , OneDash , TwoDashes }; // Get a buffer for this XMLBufBid bbComment(&fBufMgr); // Get the comment text into a temp buffer. Be sure to use temp buffer // two here, since its to be used for stuff that is potentially longer // than just a name. States curState = InText; bool gotLeadingSurrogate = false; while (true) { // Get the next character const XMLCh nextCh = fReaderMgr.getNextChar(); // Watch for an end of file if (!nextCh) { emitError(XMLErrs::UnterminatedComment); ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); } // Check for correct surrogate pairs if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); else gotLeadingSurrogate = true; } else { if (gotLeadingSurrogate) { if ((nextCh < 0xDC00) || (nextCh > 0xDFFF)) emitError(XMLErrs::Expected2ndSurrogateChar); } // Its got to at least be a valid XML character else if (!fReaderMgr.getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); emitError(XMLErrs::InvalidCharacter, tmpBuf); } gotLeadingSurrogate = false; } if (curState == InText) { // If its a dash, go to OneDash state. Otherwise take as text if (nextCh == chDash) curState = OneDash; else bbComment.append(nextCh); } else if (curState == OneDash) { // If its another dash, then we change to the two dashes states. // Otherwise, we have to put in the deficit dash and the new // character and go back to InText. if (nextCh == chDash) { curState = TwoDashes; } else { bbComment.append(chDash); bbComment.append(nextCh); curState = InText; } } else if (curState == TwoDashes) { // The next character must be the closing bracket if (nextCh != chCloseAngle) { emitError(XMLErrs::IllegalSequenceInComment); fReaderMgr.skipPastChar(chCloseAngle); return; } break; } } // If we have an available handler, call back with the comment. if (fDocHandler) { fDocHandler->docComment ( bbComment.getRawBuffer() ); } //mark comment is seen within the current element if (! fElemStack.isEmpty()) fElemStack.setCommentOrPISeen(); } // Most equal signs can have white space around them, so this little guy // just makes the calling code cleaner by eating whitespace. bool XMLScanner::scanEq(bool inDecl) { if(inDecl) { bool skippedSomething; fReaderMgr.skipPastSpaces(skippedSomething, inDecl); if (fReaderMgr.skippedChar(chEqual)) { fReaderMgr.skipPastSpaces(skippedSomething, inDecl); return true; } } else { fReaderMgr.skipPastSpaces(); if (fReaderMgr.skippedChar(chEqual)) { fReaderMgr.skipPastSpaces(); return true; } } return false; } XMLSize_t XMLScanner::scanUpToWSOr(XMLBuffer& toFill, const XMLCh chEndChar) { fReaderMgr.getUpToCharOrWS(toFill, chEndChar); return toFill.getLen(); } unsigned int *XMLScanner::getNewUIntPtr() { // this method hands back a new pointer initialized to 0 unsigned int *retVal; if(fUIntPoolCol < 64) { retVal = fUIntPool[fUIntPoolRow]+fUIntPoolCol; fUIntPoolCol++; return retVal; } // time to grow the pool... if(fUIntPoolRow+1 == fUIntPoolRowTotal) { // and time to add some space for new rows: fUIntPoolRowTotal <<= 1; unsigned int **newArray = (unsigned int **)fMemoryManager->allocate(sizeof(unsigned int *) * fUIntPoolRowTotal ); memcpy(newArray, fUIntPool, (fUIntPoolRow+1) * sizeof(unsigned int *)); fMemoryManager->deallocate(fUIntPool); fUIntPool = newArray; // need to 0 out new elements we won't need: for (unsigned int i=fUIntPoolRow+2; iallocate(sizeof(unsigned int) << 6); memset(fUIntPool[fUIntPoolRow], 0, sizeof(unsigned int) << 6); // point to next element fUIntPoolCol = 1; return fUIntPool[fUIntPoolRow]; } void XMLScanner::resetUIntPool() { // to reuse the unsigned int pool--and the hashtables that use it-- // simply reinitialize everything to 0's for(unsigned int i = 0; i<= fUIntPoolRow; i++) memset(fUIntPool[i], 0, sizeof(unsigned int) << 6); } void XMLScanner::recreateUIntPool() { // this allows a bloated unsigned int pool to be dispensed with // first, delete old fUIntPool for (unsigned int i=0; i<=fUIntPoolRow; i++) { fMemoryManager->deallocate(fUIntPool[i]); } fMemoryManager->deallocate(fUIntPool); fUIntPoolRow = fUIntPoolCol = 0; fUIntPoolRowTotal = 2; fUIntPool = (unsigned int **)fMemoryManager->allocate(sizeof(unsigned int *) * fUIntPoolRowTotal); fUIntPool[0] = (unsigned int *)fMemoryManager->allocate(sizeof(unsigned int) << 6); memset(fUIntPool[fUIntPoolRow], 0, sizeof(unsigned int) << 6); fUIntPool[1] = 0; } unsigned int XMLScanner::resolvePrefix( const XMLCh* const prefix , const ElemStack::MapModes mode) { // // If the prefix is empty, and we are in attribute mode, then we assign // it to the empty namespace because the default namespace does not // apply to attributes. // if (!*prefix) { if(mode == ElemStack::Mode_Attribute) return fEmptyNamespaceId; } // Watch for the special namespace prefixes. We always map these to // special URIs. 'xml' gets mapped to the official URI that its defined // to map to by the NS spec. xmlns gets mapped to a special place holder // URI that we define (so that it maps to something checkable.) else { if (XMLString::equals(prefix, XMLUni::fgXMLNSString)) return fXMLNSNamespaceId; else if (XMLString::equals(prefix, XMLUni::fgXMLString)) return fXMLNamespaceId; } // Ask the element stack to search up itself for a mapping for the // passed prefix. bool unknown; unsigned int uriId = fElemStack.mapPrefixToURI(prefix, unknown); // If it was unknown, then the URI was faked in but we have to issue an error if (unknown) emitError(XMLErrs::UnknownPrefix, prefix); // check to see if uriId is empty; in XML 1.1 an emptynamespace is okay unless // we are trying to use it. if (*prefix && mode == ElemStack::Mode_Element && fXMLVersion != XMLReader::XMLV1_0 && uriId == fElemStack.getEmptyNamespaceId()) emitError(XMLErrs::UnknownPrefix, prefix); return uriId; } unsigned int XMLScanner::resolveQName( const XMLCh* const qName , XMLBuffer& prefixBuf , const ElemStack::MapModes mode , int& prefixColonPos) { prefixColonPos = XMLString::indexOf(qName, chColon); return resolveQNameWithColon(qName, prefixBuf, mode, prefixColonPos); } unsigned int XMLScanner::resolveQNameWithColon( const XMLCh* const qName , XMLBuffer& prefixBuf , const ElemStack::MapModes mode , const int prefixColonPos) { // Lets split out the qName into a URI and name buffer first. The URI // can be empty. if (prefixColonPos == -1) { // Its all name with no prefix, so put the whole thing into the name // buffer. Then map the empty string to a URI, since the empty string // represents the default namespace. This will either return some // explicit URI which the default namespace is mapped to, or the // the default global namespace. prefixBuf.reset(); return resolvePrefix(XMLUni::fgZeroLenString, mode); } else { // Copy the chars up to but not including the colon into the prefix // buffer. prefixBuf.set(qName, prefixColonPos); return resolvePrefix(prefixBuf.getRawBuffer(), mode); } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/XMLScannerResolver.hpp000644 000765 000024 00000005202 13241160334 024303 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLScannerResolver.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLSCANNERRESOLVER_HPP) #define XERCESC_INCLUDE_GUARD_XMLSCANNERRESOLVER_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLValidator; class XMLDocumentHandler; class XMLErrorReporter; class DocTypeHandler; class XMLEntityHandler; class XMLPARSER_EXPORT XMLScannerResolver { public: // ----------------------------------------------------------------------- // Public class methods // ----------------------------------------------------------------------- static XMLScanner* resolveScanner ( const XMLCh* const scannerName , XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); static XMLScanner* resolveScanner ( const XMLCh* const scannerName , XMLDocumentHandler* const docHandler , DocTypeHandler* const docTypeHandler , XMLEntityHandler* const entityHandler , XMLErrorReporter* const errReporter , XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); static XMLScanner* getDefaultScanner ( XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); private : // ----------------------------------------------------------------------- // Unimplemented constructor and destructor // ----------------------------------------------------------------------- XMLScannerResolver(); ~XMLScannerResolver(); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/XTemplateSerializer.cpp000644 000765 000024 00000214540 13241160333 024545 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN /*** * internal class meant to be comsumed by XTemplateSerializer only * the size can not grow ***/ #ifdef XERCES_DEBUG_SORT_GRAMMAR class KeySet : public XMemory { public: // ----------------------------------------------------------------------- // Contructors and Destructor // ----------------------------------------------------------------------- KeySet ( const XMLCh* const strKey , const int intKey1 , const int intKey2 , MemoryManager* const manager ); ~KeySet(); // ----------------------------------------------------------------------- // Public operators // ----------------------------------------------------------------------- inline void getKeys(const XMLCh*&, int&, int&) const; void print() const; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- KeySet(const KeySet&); KeySet& operator=(const KeySet&); // ----------------------------------------------------------------------- // Data members // reference only // ----------------------------------------------------------------------- const XMLCh* const fStrKey; const int fIntKey1; const int fIntKey2; MemoryManager* fMemoryManager; }; KeySet::KeySet(const XMLCh* const strKey , const int intKey1 , const int intKey2 , MemoryManager* const manager) :fStrKey(strKey) ,fIntKey1(intKey1) ,fIntKey2(intKey2) ,fMemoryManager(manager) { } KeySet::~KeySet() { } inline void KeySet::getKeys(const XMLCh*& strKey, int& intKey1, int& intKey2) const { strKey = fStrKey; intKey1 = fIntKey1; intKey2 = fIntKey2; } void KeySet::print() const { char* tmpStr = XMLString::transcode(fStrKey, fMemoryManager); printf("tmpStr=<%s>, intKey1=<%d>, intKey2=<%d>\n", tmpStr, fIntKey1, fIntKey2); XMLString::release(&tmpStr, fMemoryManager); } static int compareKeySet(const void* keyl, const void* keyr) { const KeySet* pairl=*(const KeySet**)keyl; const KeySet* pairr=*(const KeySet**)keyr; const XMLCh* strKeyl = 0; int intKeyl_1 = 0; int intKeyl_2 = 0; pairl->getKeys(strKeyl, intKeyl_1, intKeyl_2); const XMLCh* strKeyr = 0; int intKeyr_1 = 0; int intKeyr_2 = 0; pairr->getKeys(strKeyr, intKeyr_1, intKeyr_2); int compareValue = XMLString::compareString(strKeyl, strKeyr); if (compareValue !=0) return compareValue; compareValue = intKeyl_1 - intKeyr_1; if (compareValue !=0) return compareValue; return (intKeyl_2 - intKeyr_2); } class SortArray : public XMemory { private : // ----------------------------------------------------------------------- // Contructors and Destructor // ----------------------------------------------------------------------- SortArray ( const XMLSize_t size , MemoryManager* const manager ); ~SortArray(); // ----------------------------------------------------------------------- // Public operators // ----------------------------------------------------------------------- inline const KeySet* elementAt(const XMLSize_t index) const; void addElement(const KeySet* const keySet); void sort(); void dump() const; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- SortArray(const SortArray&); SortArray& operator=(const SortArray&); // ----------------------------------------------------------------------- // Data members // ----------------------------------------------------------------------- XMLSize_t fCur; //point to the current available slot XMLSize_t fSize; const KeySet** fElemList; //owning objects MemoryManager* fMemoryManager; friend class XTemplateSerializer; }; SortArray::SortArray(const XMLSize_t size , MemoryManager* const manager ) :fCur(0) ,fSize(size) ,fMemoryManager(manager) { fElemList = (const KeySet**) fMemoryManager->allocate(size * sizeof (KeySet*)); } SortArray::~SortArray() { for (XMLSize_t i=0; i< fSize; i++) delete fElemList[i]; fMemoryManager->deallocate(fElemList); } inline const KeySet* SortArray::elementAt(const XMLSize_t index) const { assert(index < fCur); return fElemList[index]; } void SortArray::addElement(const KeySet* const keySet) { assert(fCur < fSize); fElemList[fCur++]=keySet; } void SortArray::sort() { assert(fCur == fSize); //dump(); qsort(fElemList, fSize, sizeof (KeySet*), compareKeySet); //dump(); } void SortArray::dump() const { printf("\n fSize=<%d>, fCur=<%d>\n", fSize, fCur); for (XMLSize_t i = 0; i < fCur; i++) fElemList[i]->print(); } #define GET_NEXT_KEYSET() \ const KeySet* keySet = sortArray.elementAt(i); \ const XMLCh* strKey = 0; \ int intKey1 = 0; \ int intKey2 = 0; \ keySet->getKeys(strKey, intKey1, intKey2); #define SORT_KEYSET_ONEKEY(MM) \ SortArray sortArray(itemNumber, MM); \ while (e.hasMoreElements()) \ { \ KeySet* keySet = new (MM) KeySet((XMLCh*) e.nextElementKey(), 0, 0, MM); \ sortArray.addElement(keySet); \ } \ sortArray.sort(); #define SORT_KEYSET_TWOKEYS(MM) \ SortArray sortArray(itemNumber, MM); \ while (e.hasMoreElements()) \ { \ XMLCh* strKey; \ int intKey; \ e.nextElementKey((void*&)strKey, intKey); \ KeySet* keySet = new (MM) KeySet(strKey, intKey, 0, MM); \ sortArray.addElement(keySet); \ } \ sortArray.sort(); #endif /********************************************************** * * ValueVectorOf * * SchemaElementDecl* * unsigned int * ***********************************************************/ void XTemplateSerializer::storeObject(ValueVectorOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { XMLSize_t vectorSize = objToStore->size(); serEng.writeSize (vectorSize); for ( XMLSize_t i = 0; i < vectorSize; i++) { SchemaElementDecl*& data = objToStore->elementAt(i); serEng<** objToLoad , int initSize , bool toCallDestructor , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { if (!*objToLoad) { if (initSize < 0) initSize = 16; *objToLoad = new (serEng.getMemoryManager()) ValueVectorOf( initSize , serEng.getMemoryManager() , toCallDestructor ); } serEng.registerObject(*objToLoad); XMLSize_t vectorSize = 0; serEng.readSize (vectorSize); for (XMLSize_t i = 0; i < vectorSize; i++) { SchemaElementDecl* data; serEng>>data; (*objToLoad)->addElement(data); } } } void XTemplateSerializer::storeObject(ValueVectorOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { XMLSize_t vectorSize = objToStore->size(); serEng.writeSize (vectorSize); for (XMLSize_t i = 0; i < vectorSize; i++) { unsigned int& data = objToStore->elementAt(i); serEng<** objToLoad , int initSize , bool toCallDestructor , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { if (!*objToLoad) { if (initSize < 0) initSize = 16; *objToLoad = new (serEng.getMemoryManager()) ValueVectorOf( initSize , serEng.getMemoryManager() , toCallDestructor ); } serEng.registerObject(*objToLoad); XMLSize_t vectorSize = 0; serEng.readSize (vectorSize); for (XMLSize_t i = 0; i < vectorSize; i++) { unsigned int data; serEng>>data; (*objToLoad)->addElement(data); } } } /********************************************************** * * RefArrayVectorOf * * XMLCh * ***********************************************************/ void XTemplateSerializer::storeObject(RefArrayVectorOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { XMLSize_t vectorSize = objToStore->size(); serEng.writeSize (vectorSize); for (XMLSize_t i = 0; i < vectorSize; i++) { serEng.writeString(objToStore->elementAt(i)); } } } void XTemplateSerializer::loadObject(RefArrayVectorOf** objToLoad , int initSize , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { if (!*objToLoad) { if (initSize < 0) initSize = 16; *objToLoad = new (serEng.getMemoryManager()) RefArrayVectorOf( initSize , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t vectorSize = 0; serEng.readSize (vectorSize); for (XMLSize_t i = 0; i < vectorSize; i++) { XMLCh* data; serEng.readString(data); (*objToLoad)->addElement(data); } } } /********************************************************** * * RefVectorOf * * SchemaAttDef * SchemaElementDecl * ContentSpecNode * IC_Field * DatatypeValidator * IdentityConstraint * XMLNumber * XercesLocationPath * XercesStep * ***********************************************************/ void XTemplateSerializer::storeObject(RefVectorOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { XMLSize_t vectorLength = objToStore->size(); serEng.writeSize (vectorLength); for ( XMLSize_t i = 0; i < vectorLength; i++) { SchemaAttDef* data = objToStore->elementAt(i); serEng<** objToLoad , int initSize , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { if (!*objToLoad) { if (initSize < 0) initSize = 16; *objToLoad = new (serEng.getMemoryManager()) RefVectorOf( initSize , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t vectorLength = 0; serEng.readSize (vectorLength); for (XMLSize_t i = 0 ; i < vectorLength; i++) { SchemaAttDef* data; serEng>>data; (*objToLoad)->addElement(data); } } } void XTemplateSerializer::storeObject(RefVectorOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { XMLSize_t vectorLength = objToStore->size(); serEng.writeSize (vectorLength); for ( XMLSize_t i = 0; i < vectorLength; i++) { SchemaElementDecl* data = objToStore->elementAt(i); serEng<** objToLoad , int initSize , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { if (!*objToLoad) { if (initSize < 0) initSize = 16; *objToLoad = new (serEng.getMemoryManager()) RefVectorOf( initSize , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t vectorLength = 0; serEng.readSize (vectorLength); for (XMLSize_t i = 0 ; i < vectorLength; i++) { SchemaElementDecl* data; serEng>>data; (*objToLoad)->addElement(data); } } } void XTemplateSerializer::storeObject(RefVectorOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { XMLSize_t vectorLength = objToStore->size(); serEng.writeSize (vectorLength); for ( XMLSize_t i = 0; i < vectorLength; i++) { ContentSpecNode* data = objToStore->elementAt(i); serEng<** objToLoad , int initSize , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { if (!*objToLoad) { if (initSize < 0) initSize = 16; *objToLoad = new (serEng.getMemoryManager()) RefVectorOf( initSize , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t vectorLength = 0; serEng.readSize (vectorLength); for (XMLSize_t i = 0 ; i < vectorLength; i++) { ContentSpecNode* data; serEng>>data; (*objToLoad)->addElement(data); } } } void XTemplateSerializer::storeObject(RefVectorOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { XMLSize_t vectorLength = objToStore->size(); serEng.writeSize (vectorLength); for ( XMLSize_t i = 0; i < vectorLength; i++) { IC_Field* data = objToStore->elementAt(i); serEng<** objToLoad , int initSize , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { if (!*objToLoad) { if (initSize < 0) initSize = 16; *objToLoad = new (serEng.getMemoryManager()) RefVectorOf( initSize , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t vectorLength = 0; serEng.readSize (vectorLength); for (XMLSize_t i = 0 ; i < vectorLength; i++) { IC_Field* data; serEng>>data; (*objToLoad)->addElement(data); } } } void XTemplateSerializer::storeObject(RefVectorOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { XMLSize_t vectorLength = objToStore->size(); serEng.writeSize (vectorLength); for ( XMLSize_t i = 0; i < vectorLength; i++) { DatatypeValidator* data = objToStore->elementAt(i); DatatypeValidator::storeDV(serEng, data); } } } void XTemplateSerializer::loadObject(RefVectorOf** objToLoad , int initSize , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { if (!*objToLoad) { if (initSize < 0) initSize = 16; *objToLoad = new (serEng.getMemoryManager()) RefVectorOf( initSize , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t vectorLength = 0; serEng.readSize (vectorLength); for (XMLSize_t i = 0 ; i < vectorLength; i++) { DatatypeValidator* data; data = DatatypeValidator::loadDV(serEng); (*objToLoad)->addElement(data); } } } void XTemplateSerializer::storeObject(RefVectorOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { XMLSize_t vectorLength = objToStore->size(); serEng.writeSize (vectorLength); for ( XMLSize_t i = 0; i < vectorLength; i++) { IdentityConstraint* data = objToStore->elementAt(i); IdentityConstraint::storeIC(serEng, data); } } } void XTemplateSerializer::loadObject(RefVectorOf** objToLoad , int initSize , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { if (!*objToLoad) { if (initSize < 0) initSize = 16; *objToLoad = new (serEng.getMemoryManager()) RefVectorOf( initSize , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t vectorLength = 0; serEng.readSize (vectorLength); for (XMLSize_t i = 0 ; i < vectorLength; i++) { IdentityConstraint* data; data = IdentityConstraint::loadIC(serEng); (*objToLoad)->addElement(data); } } } void XTemplateSerializer::storeObject(RefVectorOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { XMLSize_t vectorLength = objToStore->size(); serEng.writeSize (vectorLength); for ( XMLSize_t i = 0; i < vectorLength; i++) { XMLNumber* data = objToStore->elementAt(i); serEng<** objToLoad , int initSize , bool toAdopt , XMLNumber::NumberType numType , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { if (!*objToLoad) { if (initSize < 0) initSize = 16; *objToLoad = new (serEng.getMemoryManager()) RefVectorOf( initSize , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t vectorLength = 0; serEng.readSize (vectorLength); for (XMLSize_t i = 0 ; i < vectorLength; i++) { XMLNumber* data; data = XMLNumber::loadNumber(numType , serEng); (*objToLoad)->addElement(data); } } } void XTemplateSerializer::storeObject(RefVectorOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { XMLSize_t vectorLength = objToStore->size(); serEng.writeSize (vectorLength); for ( XMLSize_t i = 0; i < vectorLength; i++) { XercesLocationPath* data = objToStore->elementAt(i); serEng<** objToLoad , int initSize , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { if (!*objToLoad) { if (initSize < 0) initSize = 16; *objToLoad = new (serEng.getMemoryManager()) RefVectorOf( initSize , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t vectorLength = 0; serEng.readSize (vectorLength); for (XMLSize_t i = 0 ; i < vectorLength; i++) { XercesLocationPath* data; serEng>>data; (*objToLoad)->addElement(data); } } } void XTemplateSerializer::storeObject(RefVectorOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { XMLSize_t vectorLength = objToStore->size(); serEng.writeSize (vectorLength); for (XMLSize_t i = 0; i < vectorLength; i++) { XercesStep* data = objToStore->elementAt(i); serEng<** objToLoad , int initSize , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { if (!*objToLoad) { if (initSize < 0) initSize = 16; *objToLoad = new (serEng.getMemoryManager()) RefVectorOf( initSize , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t vectorLength = 0; serEng.readSize (vectorLength); for (XMLSize_t i = 0 ; i < vectorLength; i++) { XercesStep* data; serEng>>data; (*objToLoad)->addElement(data); } } } /********************************************************** * * RefHashTableOf * * KVStringPair * XMLAttDef * DTDAttDef * ComplexTypeInfo * XercesGroupInfo * XercesAttGroupInfo * XMLRefInfo * DatatypeValidator * Grammar * XSAnnotation * ***********************************************************/ void XTemplateSerializer::storeObject(RefHashTableOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { serEng.writeSize (objToStore->getHashModulus()); RefHashTableOfEnumerator e(objToStore, false, objToStore->getMemoryManager()); XMLSize_t itemNumber = 0; while (e.hasMoreElements()) { e.nextElement(); itemNumber++; } serEng.writeSize (itemNumber); e.Reset(); #ifdef XERCES_DEBUG_SORT_GRAMMAR //to sort the key SORT_KEYSET_ONEKEY(serEng.getMemoryManager()) //to store the data for (XMLSize_t i=0; i < itemNumber; i++) { GET_NEXT_KEYSET() KVStringPair* data = objToStore->get(strKey); serEng<get(e.nextElementKey()); serEng<** objToLoad , int , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { XMLSize_t hashModulus; serEng.readSize (hashModulus); if (!*objToLoad) { *objToLoad = new (serEng.getMemoryManager()) RefHashTableOf( hashModulus , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t itemNumber = 0; serEng.readSize (itemNumber); for (XMLSize_t itemIndex = 0; itemIndex < itemNumber; itemIndex++) { KVStringPair* data; serEng>>data; (*objToLoad)->put((void*)data->getKey(), data); } } } void XTemplateSerializer::storeObject(RefHashTableOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { serEng.writeSize (objToStore->getHashModulus()); RefHashTableOfEnumerator e(objToStore, false, objToStore->getMemoryManager()); XMLSize_t itemNumber = 0; while (e.hasMoreElements()) { e.nextElement(); itemNumber++; } serEng.writeSize (itemNumber); e.Reset(); #ifdef XERCES_DEBUG_SORT_GRAMMAR //to sort the key SORT_KEYSET_ONEKEY(serEng.getMemoryManager()) //to store the data for (XMLSize_t i=0; i < itemNumber; i++) { GET_NEXT_KEYSET() XMLAttDef* data = objToStore->get(strKey); serEng<get(e.nextElementKey()); serEng<** objToLoad , int , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { XMLSize_t hashModulus; serEng.readSize (hashModulus); if (!*objToLoad) { *objToLoad = new (serEng.getMemoryManager()) RefHashTableOf( hashModulus , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t itemNumber = 0; serEng.readSize (itemNumber); for (XMLSize_t itemIndex = 0; itemIndex < itemNumber; itemIndex++) { //This is used solely by SchemaGrammar and by all means it must be //SchemaAttDef, ideally we may change it to RefHashTableOf //later on. //Affected files IGXMLScanner, SGXMLScanner, SchemaGrammar, TraverseSchema //XMLAttDef* data; SchemaAttDef* data; serEng>>data; (*objToLoad)->put((void*)data->getAttName()->getLocalPart(), data); } } } void XTemplateSerializer::storeObject(RefHashTableOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { serEng.writeSize (objToStore->getHashModulus()); RefHashTableOfEnumerator e(objToStore, false, objToStore->getMemoryManager()); XMLSize_t itemNumber = 0; while (e.hasMoreElements()) { e.nextElement(); itemNumber++; } serEng.writeSize (itemNumber); e.Reset(); #ifdef XERCES_DEBUG_SORT_GRAMMAR //to sort the key SORT_KEYSET_ONEKEY(serEng.getMemoryManager()) //to store the data for (XMLSize_t i=0; i < itemNumber; i++) { GET_NEXT_KEYSET() DTDAttDef* data = objToStore->get(strKey); serEng<get(e.nextElementKey()); serEng<** objToLoad , int , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { XMLSize_t hashModulus; serEng.readSize (hashModulus); if (!*objToLoad) { *objToLoad = new (serEng.getMemoryManager()) RefHashTableOf( hashModulus , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t itemNumber = 0; serEng.readSize (itemNumber); for (XMLSize_t itemIndex = 0; itemIndex < itemNumber; itemIndex++) { DTDAttDef* data; serEng>>data; (*objToLoad)->put((void*)data->getFullName(), data); } } } void XTemplateSerializer::storeObject(RefHashTableOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { serEng.writeSize (objToStore->getHashModulus()); RefHashTableOfEnumerator e(objToStore, false, objToStore->getMemoryManager()); XMLSize_t itemNumber = 0; while (e.hasMoreElements()) { e.nextElement(); itemNumber++; } serEng.writeSize (itemNumber); e.Reset(); #ifdef XERCES_DEBUG_SORT_GRAMMAR //to sort the key SORT_KEYSET_ONEKEY(serEng.getMemoryManager()) //to store the data for (XMLSize_t i=0; i < itemNumber; i++) { GET_NEXT_KEYSET() ComplexTypeInfo* data = objToStore->get(strKey); serEng<get(e.nextElementKey()); serEng<** objToLoad , int , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { XMLSize_t hashModulus; serEng.readSize (hashModulus); if (!*objToLoad) { *objToLoad = new (serEng.getMemoryManager()) RefHashTableOf( hashModulus , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t itemNumber = 0; serEng.readSize (itemNumber); for (XMLSize_t itemIndex = 0; itemIndex < itemNumber; itemIndex++) { ComplexTypeInfo* data; serEng>>data; (*objToLoad)->put((void*)data->getTypeName(), data); } } } void XTemplateSerializer::storeObject(RefHashTableOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { serEng.writeSize (objToStore->getHashModulus()); RefHashTableOfEnumerator e(objToStore, false, objToStore->getMemoryManager()); XMLSize_t itemNumber = 0; while (e.hasMoreElements()) { e.nextElement(); itemNumber++; } serEng.writeSize (itemNumber); e.Reset(); #ifdef XERCES_DEBUG_SORT_GRAMMAR //to sort the key SORT_KEYSET_ONEKEY(serEng.getMemoryManager()) //to store the data for (XMLSize_t i=0; i < itemNumber; i++) { GET_NEXT_KEYSET() unsigned int id = serEng.getStringPool()->getId(strKey); serEng<get(strKey); serEng<getId(key); // key = StringPool->getValueForId(XercesGroupInfo::getNameSpaceId()) // + chComma // + StringPool->getValueForId(XercesGroupInfo::getNameId()) // // and the key is guranteed in the StringPool // // // if (id == 0) // { // throw exception // } // serEng<get(key); serEng<** objToLoad , int , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { XMLSize_t hashModulus; serEng.readSize (hashModulus); if (!*objToLoad) { *objToLoad = new (serEng.getMemoryManager()) RefHashTableOf( hashModulus , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t itemNumber = 0; serEng.readSize (itemNumber); for (XMLSize_t itemIndex = 0; itemIndex < itemNumber; itemIndex++) { unsigned int id; serEng>>id; XMLCh* key = (XMLCh*) serEng.getStringPool()->getValueForId(id); XercesGroupInfo* data; serEng>>data; (*objToLoad)->put((void*)key, data); } } } void XTemplateSerializer::storeObject(RefHashTableOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { serEng.writeSize (objToStore->getHashModulus()); RefHashTableOfEnumerator e(objToStore, false, objToStore->getMemoryManager()); XMLSize_t itemNumber = 0; while (e.hasMoreElements()) { e.nextElement(); itemNumber++; } serEng.writeSize (itemNumber); e.Reset(); #ifdef XERCES_DEBUG_SORT_GRAMMAR //to sort the key SORT_KEYSET_ONEKEY(serEng.getMemoryManager()) //to store the data for (XMLSize_t i=0; i < itemNumber; i++) { GET_NEXT_KEYSET() XercesAttGroupInfo* data = objToStore->get(strKey); serEng<get(e.nextElementKey()); serEng<** objToLoad , int , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { XMLSize_t hashModulus; serEng.readSize (hashModulus); if (!*objToLoad) { *objToLoad = new (serEng.getMemoryManager()) RefHashTableOf( hashModulus , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t itemNumber = 0; serEng.readSize (itemNumber); for (XMLSize_t itemIndex = 0; itemIndex < itemNumber; itemIndex++) { XercesAttGroupInfo* data; serEng>>data; XMLCh* key = (XMLCh*) serEng.getStringPool()->getValueForId(data->getNameId()); (*objToLoad)->put((void*)key, data); } } } void XTemplateSerializer::storeObject(RefHashTableOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { serEng.writeSize (objToStore->getHashModulus()); RefHashTableOfEnumerator e(objToStore, false, objToStore->getMemoryManager()); XMLSize_t itemNumber = 0; while (e.hasMoreElements()) { e.nextElement(); itemNumber++; } serEng.writeSize (itemNumber); e.Reset(); #ifdef XERCES_DEBUG_SORT_GRAMMAR //to sort the key SORT_KEYSET_ONEKEY(serEng.getMemoryManager()) //to store the data for (XMLSize_t i=0; i < itemNumber; i++) { GET_NEXT_KEYSET() serEng.writeString(strKey); XMLRefInfo* data = objToStore->get(strKey); serEng<get(key); serEng<** objToLoad , int , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { XMLSize_t hashModulus; serEng.readSize (hashModulus); if (!*objToLoad) { *objToLoad = new (serEng.getMemoryManager()) RefHashTableOf( hashModulus , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t itemNumber = 0; serEng.readSize (itemNumber); for (XMLSize_t itemIndex = 0; itemIndex < itemNumber; itemIndex++) { XMLCh* key; serEng.readString(key); XMLRefInfo* data; serEng>>data; (*objToLoad)->put((void*)key, data); } } } void XTemplateSerializer::storeObject(RefHashTableOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { serEng.writeSize (objToStore->getHashModulus()); RefHashTableOfEnumerator e(objToStore, false, objToStore->getMemoryManager()); XMLSize_t itemNumber = 0; while (e.hasMoreElements()) { e.nextElement(); itemNumber++; } serEng.writeSize (itemNumber); e.Reset(); #ifdef XERCES_DEBUG_SORT_GRAMMAR //to sort the key SORT_KEYSET_ONEKEY(serEng.getMemoryManager()) //to store the data for (XMLSize_t i=0; i < itemNumber; i++) { GET_NEXT_KEYSET() DatatypeValidator* data = objToStore->get(strKey); DatatypeValidator::storeDV(serEng, data); } #else while (e.hasMoreElements()) { /*** * to do: verify valid id * * XMLCh* key = (XMLCh*) e.nextElementKey(); * unsigned int id = serEng.getStringPool()->getId(key); * if (id == 0) * throw exception ***/ DatatypeValidator* data = objToStore->get(e.nextElementKey()); DatatypeValidator::storeDV(serEng, data); } #endif } } void XTemplateSerializer::loadObject(RefHashTableOf** objToLoad , int , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { XMLSize_t hashModulus; serEng.readSize (hashModulus); if (!*objToLoad) { *objToLoad = new (serEng.getMemoryManager()) RefHashTableOf( hashModulus , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t itemNumber = 0; serEng.readSize (itemNumber); for (XMLSize_t itemIndex = 0; itemIndex < itemNumber; itemIndex++) { DatatypeValidator* data; data = DatatypeValidator::loadDV(serEng); /*** * restore the key ***/ XMLCh* typeUri = (XMLCh*) data->getTypeUri(); XMLCh* typeLocal = (XMLCh*) data->getTypeLocalName(); XMLSize_t uriLen = XMLString::stringLen(typeUri); XMLSize_t localLen = XMLString::stringLen(typeLocal); XMLCh* typeKey = (XMLCh*) serEng.getMemoryManager()->allocate ( (uriLen + localLen + 2) * sizeof(XMLCh) ); // "typeuri,typeLocal" XMLString::moveChars(typeKey, typeUri, uriLen+1); typeKey[uriLen] = chComma; XMLString::moveChars(&typeKey[uriLen+1], typeLocal, localLen+1); typeKey[uriLen + localLen + 1] = chNull; ArrayJanitor janName(typeKey, serEng.getMemoryManager()); /* * get the string from string pool * * to do: ***/ unsigned int id = serEng.getStringPool()->getId(typeKey); XMLCh* refKey = (XMLCh*) serEng.getStringPool()->getValueForId(id); (*objToLoad)->put((void*)refKey, data); } } } void XTemplateSerializer::storeObject(RefHashTableOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { serEng.writeSize (objToStore->getHashModulus()); RefHashTableOfEnumerator e(objToStore, false, objToStore->getMemoryManager()); XMLSize_t itemNumber = 0; while (e.hasMoreElements()) { e.nextElement(); itemNumber++; } serEng.writeSize (itemNumber); e.Reset(); #ifdef XERCES_DEBUG_SORT_GRAMMAR //to sort the key SORT_KEYSET_ONEKEY(serEng.getMemoryManager()) //to store the data for (XMLSize_t i=0; i < itemNumber; i++) { GET_NEXT_KEYSET() Grammar* data = objToStore->get(strKey); Grammar::storeGrammar(serEng, data); } #else while (e.hasMoreElements()) { Grammar* data = objToStore->get(e.nextElementKey()); Grammar::storeGrammar(serEng, data); } #endif } } void XTemplateSerializer::loadObject(RefHashTableOf** objToLoad , int , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { XMLSize_t hashModulus; serEng.readSize (hashModulus); if (!*objToLoad) { *objToLoad = new (serEng.getMemoryManager()) RefHashTableOf( hashModulus , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t itemNumber = 0; serEng.readSize (itemNumber); for (XMLSize_t itemIndex = 0; itemIndex < itemNumber; itemIndex++) { Grammar* data; data = Grammar::loadGrammar(serEng); XMLCh* key = (XMLCh*) data->getGrammarDescription()->getGrammarKey(); (*objToLoad)->put(key, data); } } } void XTemplateSerializer::storeObject(RefHashTableOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { serEng.writeSize (objToStore->getHashModulus()); RefHashTableOfEnumerator e(objToStore, false, objToStore->getMemoryManager()); #ifdef XERCES_DEBUG_SORT_GRAMMAR //get the total item number unsigned int itemNumber = 0; while (e.hasMoreElements()) { void* key = e.nextElementKey(); XSerializeEngine::XSerializedObjectId_t keyId = serEng.lookupStorePool(key); if (keyId) itemNumber++; } serEng.writeSize (itemNumber); e.Reset(); //to sort the key //though keyId is not supposed to be involved in compare //we merely use the KeySet to encap both the string key and keyid SortArray sortArray(itemNumber, objToStore->getMemoryManager()); while (e.hasMoreElements()) { void* key = e.nextElementKey(); XSerializeEngine::XSerializedObjectId_t keyId = serEng.lookupStorePool(key); if (keyId) { KeySet* keySet = new (objToStore->getMemoryManager()) KeySet((XMLCh*)key, keyId, 0, objToStore->getMemoryManager()); sortArray.addElement(keySet); } } sortArray.sort(); //to store the data for (XMLSize_t i=0; i < itemNumber; i++) { GET_NEXT_KEYSET() XSerializeEngine::XSerializedObjectId_t keyId = (XSerializeEngine::XSerializedObjectId_t)intKey1; XSAnnotation* data = objToStore->get(strKey); serEng< ids(16, serEng.getMemoryManager()); ValueVectorOf keys(16, serEng.getMemoryManager()); while (e.hasMoreElements()) { void* key = e.nextElementKey(); XSerializeEngine::XSerializedObjectId_t keyId = serEng.lookupStorePool(key); if (keyId) { ids.addElement(keyId); keys.addElement(key); } } XMLSize_t itemNumber = ids.size(); serEng.writeSize (itemNumber); for (XMLSize_t i=0; iget(keys.elementAt(i)); serEng<** objToLoad , int , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { XMLSize_t hashModulus; serEng.readSize (hashModulus); if (!*objToLoad) { *objToLoad = new (serEng.getMemoryManager()) RefHashTableOf( hashModulus , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t itemNumber = 0; serEng.readSize (itemNumber); XMLSize_t itemIndex; XSerializeEngine::XSerializedObjectId_t keyId; void* key; XSAnnotation* data; if (!serEng.fGrammarPool->getIgnoreSerializedAnnotations()) { for (itemIndex = 0; itemIndex < itemNumber; itemIndex++) { serEng>>keyId; key = serEng.lookupLoadPool(keyId); serEng>>data; (*objToLoad)->put(key, data); } } else { for (itemIndex = 0; itemIndex < itemNumber; itemIndex++) { serEng>>keyId; key = serEng.lookupLoadPool(keyId); serEng>>data; delete data; } } } } /********************************************************** * * RefHash2KeysTableOf * * SchemaAttDef * ElemVector * ***********************************************************/ void XTemplateSerializer::storeObject(RefHash2KeysTableOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { serEng.writeSize (objToStore->getHashModulus()); XMLSize_t itemNumber = 0; RefHash2KeysTableOfEnumerator e(objToStore, false, objToStore->getMemoryManager()); while (e.hasMoreElements()) { e.nextElement(); itemNumber++; } serEng.writeSize (itemNumber); e.Reset(); #ifdef XERCES_DEBUG_SORT_GRAMMAR //to sort the key SORT_KEYSET_TWOKEYS(serEng.getMemoryManager()) //to store the data for (XMLSize_t i=0; i < itemNumber; i++) { GET_NEXT_KEYSET() SchemaAttDef* data = objToStore->get(strKey, intKey1); serEng<get(key1, key2); serEng<** objToLoad , int , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { XMLSize_t hashModulus; serEng.readSize (hashModulus); if (!*objToLoad) { *objToLoad = new (serEng.getMemoryManager()) RefHash2KeysTableOf( hashModulus , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t itemNumber = 0; serEng.readSize (itemNumber); for (XMLSize_t itemIndex = 0; itemIndex < itemNumber; itemIndex++) { SchemaAttDef* data; serEng>>data; XMLCh* key1 = data->getAttName()->getLocalPart(); int key2 = data->getAttName()->getURI(); //key2==data->getId() (*objToLoad)->put((void*)key1, key2, data); } } } void XTemplateSerializer::storeObject(RefHash2KeysTableOf* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { serEng.writeSize (objToStore->getHashModulus()); XMLSize_t itemNumber = 0; RefHash2KeysTableOfEnumerator e(objToStore, false, objToStore->getMemoryManager()); while (e.hasMoreElements()) { e.nextElement(); itemNumber++; } serEng.writeSize (itemNumber); e.Reset(); #ifdef XERCES_DEBUG_SORT_GRAMMAR //to sort the key SORT_KEYSET_TWOKEYS(serEng.getMemoryManager()) //to store the data for (XMLSize_t i=0; i < itemNumber; i++) { GET_NEXT_KEYSET() serEng.writeString(strKey); serEng<get(strKey, intKey1); storeObject(data, serEng); } #else while (e.hasMoreElements()) { void* key1; int key2; e.nextElementKey(key1, key2); serEng.writeString((const XMLCh*)key1); serEng<get(key1, key2); storeObject(data, serEng); } #endif } } void XTemplateSerializer::loadObject(RefHash2KeysTableOf** objToLoad , int , bool toAdopt , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { XMLSize_t hashModulus; serEng.readSize (hashModulus); if (!*objToLoad) { *objToLoad = new (serEng.getMemoryManager()) RefHash2KeysTableOf( hashModulus , toAdopt , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); XMLSize_t itemNumber = 0; serEng.readSize (itemNumber); for (XMLSize_t itemIndex = 0; itemIndex < itemNumber; itemIndex++) { XMLCh* key1; serEng.readString(key1); int key2; serEng>>key2; ElemVector* data = 0; //don't call destructor loadObject(&data, 8, false, serEng); /*** * * There must be one element in the vector whose * susbititutionGroupElem matches the (key1,key2) * ***/ // bool FOUND=false; XMLSize_t vectorSize = data->size(); for ( XMLSize_t i = 0; i < vectorSize; i++) { SchemaElementDecl*& elem = data->elementAt(i); SchemaElementDecl* subElem = elem->getSubstitutionGroupElem(); XMLCh* elemName = subElem->getBaseName(); int uri = subElem->getURI(); if (XMLString::equals(elemName, key1) && (uri == key2) ) { //release the temp serEng.getMemoryManager()->deallocate(key1); key1 = elemName; //FOUND=true; break; } } /*** * if (!FOUND) * { * throw exception * } ***/ (*objToLoad)->put((void*)key1, key2, data); } } } /********************************************************** * * RefHash3KeysIdPool * * SchemaElementDecl * * maintain the same order through id ***********************************************************/ void XTemplateSerializer::storeObject(RefHash3KeysIdPool* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { serEng.writeSize (objToStore->getHashModulus()); RefHash3KeysIdPoolEnumerator e(objToStore, false, objToStore->getMemoryManager()); serEng.writeSize (e.size()); void* strkey; int key1; int key2; /* Update to store key2 separately as for the putGroupElemDecl the key is not the enclosing scope but another value. */ while (e.hasMoreKeys()) { e.nextElementKey(strkey, key1, key2); serEng<getByKey(strkey, key1, key2); serEng<** objToLoad , int , bool toAdopt , int initSize2 , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { XMLSize_t hashModulus; serEng.readSize (hashModulus); if (!*objToLoad) { *objToLoad = new (serEng.getMemoryManager()) RefHash3KeysIdPool( hashModulus , toAdopt , initSize2 , serEng.getMemoryManager()); } serEng.registerObject(*objToLoad); XMLSize_t itemNumber = 0; serEng.readSize (itemNumber); int scopeKey; SchemaElementDecl* elemDecl; for (XMLSize_t itemIndex = 0; itemIndex < itemNumber; itemIndex++) { serEng>>scopeKey; serEng>>elemDecl; (*objToLoad)->put(elemDecl->getBaseName() , elemDecl->getURI() , scopeKey , elemDecl); } } } /********************************************************** * * NameIdPool * no NameIdPool::nextElementKey() * * DTDElementDecl * DTDEntityDecl * XMLNotationDecl * * maintain the same order through id ***********************************************************/ void XTemplateSerializer::storeObject(NameIdPool* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { NameIdPoolEnumerator e(objToStore, objToStore->getMemoryManager()); serEng<<(unsigned int)e.size(); while (e.hasMoreElements()) { DTDElementDecl& data = e.nextElement(); data.serialize(serEng); } } } void XTemplateSerializer::loadObject(NameIdPool** objToLoad , int initSize , int initSize2 , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { if (!*objToLoad) { if (initSize < 0) initSize = 16; *objToLoad = new (serEng.getMemoryManager()) NameIdPool( initSize , initSize2 , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); unsigned int itemNumber = 0; serEng >> itemNumber; for (unsigned int itemIndex = 0; itemIndex < itemNumber; itemIndex++) { DTDElementDecl* data = new (serEng.getMemoryManager()) DTDElementDecl(serEng.getMemoryManager()); data->serialize(serEng); (*objToLoad)->put(data); } } } void XTemplateSerializer::storeObject(NameIdPool* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { NameIdPoolEnumerator e(objToStore, objToStore->getMemoryManager()); serEng<<(unsigned int)e.size(); while (e.hasMoreElements()) { DTDEntityDecl& data = e.nextElement(); data.serialize(serEng); } } } void XTemplateSerializer::loadObject(NameIdPool** objToLoad , int initSize , int initSize2 , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { if (!*objToLoad) { if (initSize < 0) initSize = 16; *objToLoad = new (serEng.getMemoryManager()) NameIdPool( initSize , initSize2 , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); unsigned int itemNumber = 0; serEng >> itemNumber; for (unsigned int itemIndex = 0; itemIndex < itemNumber; itemIndex++) { DTDEntityDecl* data = new (serEng.getMemoryManager()) DTDEntityDecl(serEng.getMemoryManager()); data->serialize(serEng); (*objToLoad)->put(data); } } } void XTemplateSerializer::storeObject(NameIdPool* const objToStore , XSerializeEngine& serEng) { if (serEng.needToStoreObject(objToStore)) { NameIdPoolEnumerator e(objToStore, objToStore->getMemoryManager()); serEng<<(unsigned int)e.size(); while (e.hasMoreElements()) { XMLNotationDecl& data = e.nextElement(); data.serialize(serEng); } } } void XTemplateSerializer::loadObject(NameIdPool** objToLoad , int initSize , int initSize2 , XSerializeEngine& serEng) { if (serEng.needToLoadObject((void**)objToLoad)) { if (!*objToLoad) { if (initSize < 0) initSize = 16; *objToLoad = new (serEng.getMemoryManager()) NameIdPool( initSize , initSize2 , serEng.getMemoryManager() ); } serEng.registerObject(*objToLoad); unsigned int itemNumber = 0; serEng >> itemNumber; for (unsigned int itemIndex = 0; itemIndex < itemNumber; itemIndex++) { XMLNotationDecl* data = new (serEng.getMemoryManager()) XMLNotationDecl(serEng.getMemoryManager()); data->serialize(serEng); (*objToLoad)->put(data); } } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/SGXMLScanner.cpp000644 000765 000024 00000557231 13241160334 023024 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SGXMLScanner.cpp 1517488 2013-08-26 10:33:26Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN inline XMLAttDefList& getAttDefList(ComplexTypeInfo* currType, XMLElementDecl* elemDecl); typedef JanitorMemFunCall CleanupType; typedef JanitorMemFunCall ReaderMgrResetType; // --------------------------------------------------------------------------- // SGXMLScanner: Constructors and Destructor // --------------------------------------------------------------------------- SGXMLScanner::SGXMLScanner( XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager) : XMLScanner(valToAdopt, grammarResolver, manager) , fSeeXsi(false) , fGrammarType(Grammar::UnKnown) , fElemStateSize(16) , fElemState(0) , fElemLoopState(0) , fContent(1023, manager) , fEntityTable(0) , fRawAttrList(0) , fRawAttrColonListSize(32) , fRawAttrColonList(0) , fSchemaGrammar(0) , fSchemaValidator(0) , fICHandler(0) , fElemNonDeclPool(0) , fElemCount(0) , fAttDefRegistry(0) , fUndeclaredAttrRegistry(0) , fPSVIAttrList(0) , fModel(0) , fPSVIElement(0) , fErrorStack(0) , fSchemaInfoList(0) , fCachedSchemaInfoList(0) { CleanupType cleanup(this, &SGXMLScanner::cleanUp); try { commonInit(); } catch(const OutOfMemoryException&) { // Don't cleanup when out of memory, since executing the // code can cause problems. cleanup.release(); throw; } cleanup.release(); } SGXMLScanner::SGXMLScanner( XMLDocumentHandler* const docHandler , DocTypeHandler* const docTypeHandler , XMLEntityHandler* const entityHandler , XMLErrorReporter* const errHandler , XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager) : XMLScanner(docHandler, docTypeHandler, entityHandler, errHandler, valToAdopt, grammarResolver, manager) , fSeeXsi(false) , fGrammarType(Grammar::UnKnown) , fElemStateSize(16) , fElemState(0) , fElemLoopState(0) , fContent(1023, manager) , fEntityTable(0) , fRawAttrList(0) , fRawAttrColonListSize(32) , fRawAttrColonList(0) , fSchemaGrammar(0) , fSchemaValidator(0) , fICHandler(0) , fElemNonDeclPool(0) , fElemCount(0) , fAttDefRegistry(0) , fUndeclaredAttrRegistry(0) , fPSVIAttrList(0) , fModel(0) , fPSVIElement(0) , fErrorStack(0) , fSchemaInfoList(0) , fCachedSchemaInfoList(0) { CleanupType cleanup(this, &SGXMLScanner::cleanUp); try { commonInit(); } catch(const OutOfMemoryException&) { // Don't cleanup when out of memory, since executing the // code can cause problems. cleanup.release(); throw; } cleanup.release(); } SGXMLScanner::~SGXMLScanner() { cleanUp(); } // --------------------------------------------------------------------------- // XMLScanner: Getter methods // --------------------------------------------------------------------------- NameIdPool* SGXMLScanner::getEntityDeclPool() { return 0; } const NameIdPool* SGXMLScanner::getEntityDeclPool() const { return 0; } // --------------------------------------------------------------------------- // SGXMLScanner: Main entry point to scan a document // --------------------------------------------------------------------------- void SGXMLScanner::scanDocument(const InputSource& src) { // Bump up the sequence id for this parser instance. This will invalidate // any previous progressive scan tokens. fSequenceId++; ReaderMgrResetType resetReaderMgr(&fReaderMgr, &ReaderMgr::reset); try { // Reset the scanner and its plugged in stuff for a new run. This // resets all the data structures, creates the initial reader and // pushes it on the stack, and sets up the base document path. scanReset(src); // If we have a document handler, then call the start document if (fDocHandler) fDocHandler->startDocument(); // Scan the prolog part, which is everything before the root element // including the DTD subsets. scanProlog(); // If we got to the end of input, then its not a valid XML file. // Else, go on to scan the content. if (fReaderMgr.atEOF()) { emitError(XMLErrs::EmptyMainEntity); } else { // Scan content, and tell it its not an external entity if (scanContent()) { // Do post-parse validation if required if (fValidate) { // We handle ID reference semantics at this level since // its required by XML 1.0. checkIDRefs(); // Then allow the validator to do any extra stuff it wants // fValidator->postParseValidation(); } // That went ok, so scan for any miscellaneous stuff if (!fReaderMgr.atEOF()) scanMiscellaneous(); } } // If we have a document handler, then call the end document if (fDocHandler) fDocHandler->endDocument(); } // NOTE: // // In all of the error processing below, the emitError() call MUST come // before the flush of the reader mgr, or it will fail because it tries // to find out the position in the XML source of the error. catch(const XMLErrs::Codes) { // This is a 'first failure' exception, so fall through } catch(const XMLValid::Codes) { // This is a 'first fatal error' type exit, so fall through } catch(const XMLException& excToCatch) { // Emit the error and catch any user exception thrown from here. Make // sure in all cases we flush the reader manager. fInException = true; try { if (excToCatch.getErrorType() == XMLErrorReporter::ErrType_Warning) emitError ( XMLErrs::XMLException_Warning , excToCatch.getCode() , excToCatch.getMessage() ); else if (excToCatch.getErrorType() >= XMLErrorReporter::ErrType_Fatal) emitError ( XMLErrs::XMLException_Fatal , excToCatch.getCode() , excToCatch.getMessage() ); else emitError ( XMLErrs::XMLException_Error , excToCatch.getCode() , excToCatch.getMessage() ); } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } } bool SGXMLScanner::scanNext(XMLPScanToken& token) { // Make sure this token is still legal if (!isLegalToken(token)) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Scan_BadPScanToken, fMemoryManager); // Find the next token and remember the reader id XMLSize_t orgReader; XMLTokens curToken; ReaderMgrResetType resetReaderMgr(&fReaderMgr, &ReaderMgr::reset); bool retVal = true; try { while (true) { // We have to handle any end of entity exceptions that happen here. // We could be at the end of X nested entities, each of which will // generate an end of entity exception as we try to move forward. try { curToken = senseNextToken(orgReader); break; } catch(const EndOfEntityException& toCatch) { // Send an end of entity reference event if (fDocHandler) fDocHandler->endEntityReference(toCatch.getEntity()); } } if (curToken == Token_CharData) { scanCharData(fCDataBuf); } else if (curToken == Token_EOF) { if (!fElemStack.isEmpty()) { const ElemStack::StackElem* topElem = fElemStack.popTop(); emitError ( XMLErrs::EndedWithTagsOnStack , topElem->fThisElement->getFullName() ); } retVal = false; } else { // Its some sort of markup bool gotData = true; switch(curToken) { case Token_CData : // Make sure we are within content if (fElemStack.isEmpty()) emitError(XMLErrs::CDATAOutsideOfContent); scanCDSection(); break; case Token_Comment : scanComment(); break; case Token_EndTag : scanEndTag(gotData); break; case Token_PI : scanPI(); break; case Token_StartTag : scanStartTag(gotData); break; default : fReaderMgr.skipToChar(chOpenAngle); break; } if (orgReader != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialMarkupInEntity); // If we hit the end, then do the miscellaneous part if (!gotData) { // Do post-parse validation if required if (fValidate) { // We handle ID reference semantics at this level since // its required by XML 1.0. checkIDRefs(); // Then allow the validator to do any extra stuff it wants // fValidator->postParseValidation(); } // That went ok, so scan for any miscellaneous stuff scanMiscellaneous(); if (toCheckIdentityConstraint()) fICHandler->endDocument(); if (fDocHandler) fDocHandler->endDocument(); } } } // NOTE: // // In all of the error processing below, the emitError() call MUST come // before the flush of the reader mgr, or it will fail because it tries // to find out the position in the XML source of the error. catch(const XMLErrs::Codes) { // This is a 'first failure' exception, so return failure retVal = false; } catch(const XMLValid::Codes) { // This is a 'first fatal error' type exit, so return failure retVal = false; } catch(const XMLException& excToCatch) { // Emit the error and catch any user exception thrown from here. Make // sure in all cases we flush the reader manager. fInException = true; try { if (excToCatch.getErrorType() == XMLErrorReporter::ErrType_Warning) emitError ( XMLErrs::XMLException_Warning , excToCatch.getCode() , excToCatch.getMessage() ); else if (excToCatch.getErrorType() >= XMLErrorReporter::ErrType_Fatal) emitError ( XMLErrs::XMLException_Fatal , excToCatch.getCode() , excToCatch.getMessage() ); else emitError ( XMLErrs::XMLException_Error , excToCatch.getCode() , excToCatch.getMessage() ); } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } retVal = false; } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } // If we are not at the end, release the object that will // reset the ReaderMgr. if (retVal) resetReaderMgr.release(); return retVal; } // --------------------------------------------------------------------------- // SGXMLScanner: Private scanning methods // --------------------------------------------------------------------------- // This method is called from scanStartTag() to handle the very raw initial // scan of the attributes. It just fills in the passed collection with // key/value pairs for each attribute. No processing is done on them at all. XMLSize_t SGXMLScanner::rawAttrScan(const XMLCh* const elemName , RefVectorOf& toFill , bool& isEmpty) { // Keep up with how many attributes we've seen so far, and how many // elements are available in the vector. This way we can reuse old // elements until we run out and then expand it. XMLSize_t attCount = 0; XMLSize_t curVecSize = toFill.size(); // Assume it is not empty isEmpty = false; // We loop until we either see a /> or >, handling key/value pairs util // we get there. We place them in the passed vector, which we will expand // as required to hold them. while (true) { // Get the next character, which should be non-space XMLCh nextCh = fReaderMgr.peekNextChar(); // If the next character is not a slash or closed angle bracket, // then it must be whitespace, since whitespace is required // between the end of the last attribute and the name of the next // one. // if (attCount) { if ((nextCh != chForwardSlash) && (nextCh != chCloseAngle)) { if (fReaderMgr.getCurrentReader()->isWhitespace(nextCh)) { // Ok, skip by them and get another char fReaderMgr.getNextChar(); fReaderMgr.skipPastSpaces(); nextCh = fReaderMgr.peekNextChar(); } else { // Emit the error but keep on going emitError(XMLErrs::ExpectedWhitespace); } } } // Ok, here we first check for any of the special case characters. // If its not one, then we do the normal case processing, which // assumes that we've hit an attribute value, Otherwise, we do all // the special case checks. if (!fReaderMgr.getCurrentReader()->isSpecialStartTagChar(nextCh)) { // Assume its going to be an attribute, so get a name from // the input. int colonPosition; if (!fReaderMgr.getQName(fAttNameBuf, &colonPosition)) { if (fAttNameBuf.isEmpty()) emitError(XMLErrs::ExpectedAttrName); else emitError(XMLErrs::InvalidAttrName, fAttNameBuf.getRawBuffer()); fReaderMgr.skipPastChar(chCloseAngle); return attCount; } const XMLCh* curAttNameBuf = fAttNameBuf.getRawBuffer(); // And next must be an equal sign if (!scanEq()) { static const XMLCh tmpList[] = { chSingleQuote, chDoubleQuote, chCloseAngle , chOpenAngle, chForwardSlash, chNull }; emitError(XMLErrs::ExpectedEqSign); // Try to sync back up by skipping forward until we either // hit something meaningful. const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList); if ((chFound == chCloseAngle) || (chFound == chForwardSlash)) { // Jump back to top for normal processing of these continue; } else if ((chFound == chSingleQuote) || (chFound == chDoubleQuote) || fReaderMgr.getCurrentReader()->isWhitespace(chFound)) { // Just fall through assuming that the value is to follow } else if (chFound == chOpenAngle) { // Assume a malformed tag and that new one is starting emitError(XMLErrs::UnterminatedStartTag, elemName); return attCount; } else { // Something went really wrong return attCount; } } // Next should be the quoted attribute value. We just do a simple // and stupid scan of this value. The only thing we do here // is to expand entity references. if (!basicAttrValueScan(curAttNameBuf, fAttValueBuf)) { static const XMLCh tmpList[] = { chCloseAngle, chOpenAngle, chForwardSlash, chNull }; emitError(XMLErrs::ExpectedAttrValue); // It failed, so lets try to get synced back up. We skip // forward until we find some whitespace or one of the // chars in our list. const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList); if ((chFound == chCloseAngle) || (chFound == chForwardSlash) || fReaderMgr.getCurrentReader()->isWhitespace(chFound)) { // Just fall through and process this attribute, though // the value will be "". } else if (chFound == chOpenAngle) { // Assume a malformed tag and that new one is starting emitError(XMLErrs::UnterminatedStartTag, elemName); return attCount; } else { // Something went really wrong return attCount; } } // And now lets add it to the passed collection. If we have not // filled it up yet, then we use the next element. Else we add // a new one. KVStringPair* curPair = 0; if (attCount >= curVecSize) { curPair = new (fMemoryManager) KVStringPair ( curAttNameBuf , fAttNameBuf.getLen() , fAttValueBuf.getRawBuffer() , fAttValueBuf.getLen() , fMemoryManager ); toFill.addElement(curPair); } else { curPair = toFill.elementAt(attCount); curPair->set ( curAttNameBuf , fAttNameBuf.getLen() , fAttValueBuf.getRawBuffer() , fAttValueBuf.getLen() ); } if (attCount >= fRawAttrColonListSize) { resizeRawAttrColonList(); } fRawAttrColonList[attCount] = colonPosition; // And bump the count of attributes we've gotten attCount++; // And go to the top again for another attribute continue; } // It was some special case character so do all of the checks and // deal with it. if (!nextCh) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); if (nextCh == chForwardSlash) { fReaderMgr.getNextChar(); isEmpty = true; if (!fReaderMgr.skippedChar(chCloseAngle)) emitError(XMLErrs::UnterminatedStartTag, elemName); break; } else if (nextCh == chCloseAngle) { fReaderMgr.getNextChar(); break; } else if (nextCh == chOpenAngle) { // Check for this one specially, since its going to be common // and it is kind of auto-recovering since we've already hit the // next open bracket, which is what we would have seeked to (and // skipped this whole tag.) emitError(XMLErrs::UnterminatedStartTag, elemName); break; } else if ((nextCh == chSingleQuote) || (nextCh == chDoubleQuote)) { // Check for this one specially, which is probably a missing // attribute name, e.g. ="value". Just issue expected name // error and eat the quoted string, then jump back to the // top again. emitError(XMLErrs::ExpectedAttrName); fReaderMgr.getNextChar(); fReaderMgr.skipQuotedString(nextCh); fReaderMgr.skipPastSpaces(); continue; } } return attCount; } // This method will kick off the scanning of the primary content of the // document, i.e. the elements. bool SGXMLScanner::scanContent() { // Go into a loop until we hit the end of the root element, or we fall // out because there is no root element. // // We have to do kind of a deeply nested double loop here in order to // avoid doing the setup/teardown of the exception handler on each // round. Doing it this way we only do it when an exception actually // occurs. bool gotData = true; bool inMarkup = false; while (gotData) { try { while (gotData) { // Sense what the next top level token is. According to what // this tells us, we will call something to handle that kind // of thing. XMLSize_t orgReader; const XMLTokens curToken = senseNextToken(orgReader); // Handle character data and end of file specially. Char data // is not markup so we don't want to handle it in the loop // below. if (curToken == Token_CharData) { // Scan the character data and call appropriate events. Let // him use our local character data buffer for efficiency. scanCharData(fCDataBuf); continue; } else if (curToken == Token_EOF) { // The element stack better be empty at this point or we // ended prematurely before all elements were closed. if (!fElemStack.isEmpty()) { const ElemStack::StackElem* topElem = fElemStack.popTop(); emitError ( XMLErrs::EndedWithTagsOnStack , topElem->fThisElement->getFullName() ); } // Its the end of file, so clear the got data flag gotData = false; continue; } // We are in some sort of markup now inMarkup = true; // According to the token we got, call the appropriate // scanning method. switch(curToken) { case Token_CData : // Make sure we are within content if (fElemStack.isEmpty()) emitError(XMLErrs::CDATAOutsideOfContent); scanCDSection(); break; case Token_Comment : scanComment(); break; case Token_EndTag : scanEndTag(gotData); break; case Token_PI : scanPI(); break; case Token_StartTag : scanStartTag(gotData); break; default : fReaderMgr.skipToChar(chOpenAngle); break; } if (orgReader != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialMarkupInEntity); // And we are back out of markup again inMarkup = false; } } catch(const EndOfEntityException& toCatch) { // If we were in some markup when this happened, then its a // partial markup error. if (inMarkup) emitError(XMLErrs::PartialMarkupInEntity); // Send an end of entity reference event if (fDocHandler) fDocHandler->endEntityReference(toCatch.getEntity()); inMarkup = false; } } // It went ok, so return success return true; } void SGXMLScanner::scanEndTag(bool& gotData) { // Assume we will still have data until proven otherwise. It will only // ever be false if this is the end of the root element. gotData = true; // Check if the element stack is empty. If so, then this is an unbalanced // element (i.e. more ends than starts, perhaps because of bad text // causing one to be skipped.) if (fElemStack.isEmpty()) { emitError(XMLErrs::MoreEndThanStartTags); fReaderMgr.skipPastChar(chCloseAngle); ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Scan_UnbalancedStartEnd, fMemoryManager); } // Pop the stack of the element we are supposed to be ending. Remember // that we don't own this. The stack just keeps them and reuses them. unsigned int uriId = (fDoNamespaces) ? fElemStack.getCurrentURI() : fEmptyNamespaceId; // Make sure that its the end of the element that we expect const XMLCh *elemName = fElemStack.getCurrentSchemaElemName(); const ElemStack::StackElem* topElem = fElemStack.topElement(); if (!fReaderMgr.skippedStringLong(elemName)) { emitError ( XMLErrs::ExpectedEndOfTagX , elemName ); fReaderMgr.skipPastChar(chCloseAngle); fElemStack.popTop(); return; } fPSVIElemContext.fErrorOccurred = fErrorStack->pop(); // Make sure we are back on the same reader as where we started if (topElem->fReaderNum != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialTagMarkupError); // Skip optional whitespace fReaderMgr.skipPastSpaces(); // Make sure we find the closing bracket if (!fReaderMgr.skippedChar(chCloseAngle)) { emitError ( XMLErrs::UnterminatedEndTag , topElem->fThisElement->getFullName() ); } if (fValidate && topElem->fThisElement->isDeclared()) { fPSVIElemContext.fCurrentTypeInfo = ((SchemaValidator*) fValidator)->getCurrentTypeInfo(); if(!fPSVIElemContext.fCurrentTypeInfo) fPSVIElemContext.fCurrentDV = ((SchemaValidator*) fValidator)->getCurrentDatatypeValidator(); else fPSVIElemContext.fCurrentDV = 0; if (fPSVIHandler) { fPSVIElemContext.fNormalizedValue = ((SchemaValidator*) fValidator)->getNormalizedValue(); if (XMLString::equals(fPSVIElemContext.fNormalizedValue, XMLUni::fgZeroLenString)) fPSVIElemContext.fNormalizedValue = 0; } } else { fPSVIElemContext.fCurrentDV = 0; fPSVIElemContext.fCurrentTypeInfo = 0; fPSVIElemContext.fNormalizedValue = 0; } // If validation is enabled, then lets pass him the list of children and // this element and let him validate it. DatatypeValidator* psviMemberType = 0; if (fValidate) { XMLSize_t failure; bool res = fValidator->checkContent ( topElem->fThisElement , topElem->fChildren , topElem->fChildCount , &failure ); if (!res) { // One of the elements is not valid for the content. NOTE that // if no children were provided but the content model requires // them, it comes back with a zero value. But we cannot use that // to index the child array in this case, and have to put out a // special message. if (!topElem->fChildCount) { fValidator->emitError ( XMLValid::EmptyNotValidForContent , topElem->fThisElement->getFormattedContentModel() ); } else if (failure >= topElem->fChildCount) { fValidator->emitError ( XMLValid::NotEnoughElemsForCM , topElem->fThisElement->getFormattedContentModel() ); } else { fValidator->emitError ( XMLValid::ElementNotValidForContent , topElem->fChildren[failure]->getRawName() , topElem->fThisElement->getFormattedContentModel() ); } } // update PSVI info if (((SchemaValidator*) fValidator)->getErrorOccurred()) fPSVIElemContext.fErrorOccurred = true; else if (fPSVIElemContext.fCurrentDV && fPSVIElemContext.fCurrentDV->getType() == DatatypeValidator::Union) psviMemberType = fValidationContext->getValidatingMemberType(); if (fPSVIHandler) { fPSVIElemContext.fIsSpecified = ((SchemaValidator*) fValidator)->getIsElemSpecified(); if(fPSVIElemContext.fIsSpecified) fPSVIElemContext.fNormalizedValue = ((SchemaElementDecl *)topElem->fThisElement)->getDefaultValue(); } // call matchers and de-activate context if (toCheckIdentityConstraint()) { fICHandler->deactivateContext ( (SchemaElementDecl *) topElem->fThisElement , fContent.getRawBuffer() , fValidationContext , fPSVIElemContext.fCurrentDV ); } } // QName dv needed topElem to resolve URIs on the checkContent fElemStack.popTop(); // See if it was the root element, to avoid multiple calls below const bool isRoot = fElemStack.isEmpty(); if (fPSVIHandler) { endElementPSVI ( (SchemaElementDecl*)topElem->fThisElement, psviMemberType ); } // now we can reset the datatype buffer, since the // application has had a chance to copy the characters somewhere else ((SchemaValidator *)fValidator)->clearDatatypeBuffer(); // If we have a doc handler, tell it about the end tag if (fDocHandler) { if (fGrammarType == Grammar::SchemaGrammarType) { if (topElem->fPrefixColonPos != -1) fPrefixBuf.set(elemName, topElem->fPrefixColonPos); else fPrefixBuf.reset(); } else { fPrefixBuf.set(topElem->fThisElement->getElementName()->getPrefix()); } fDocHandler->endElement ( *topElem->fThisElement , uriId , isRoot , fPrefixBuf.getRawBuffer() ); } if (!isRoot) { // update error information fErrorStack->push((fErrorStack->size() && fErrorStack->pop()) || fPSVIElemContext.fErrorOccurred); } // If this was the root, then done with content gotData = !isRoot; if (gotData) { // Restore the grammar fGrammar = fElemStack.getCurrentGrammar(); fGrammarType = fGrammar->getGrammarType(); fValidator->setGrammar(fGrammar); // Restore the validation flag fValidate = fElemStack.getValidationFlag(); } } // This method handles the high level logic of scanning the DOCType // declaration. This calls the DTDScanner and kicks off both the scanning of // the internal subset and the scanning of the external subset, if any. // // When we get here the ', />, or attributes followed // by one of those sequences. bool SGXMLScanner::scanStartTag(bool& gotData) { // Assume we will still have data until proven otherwise. It will only // ever be false if this is the root and its empty. gotData = true; // Reset element content fContent.reset(); // The current position is after the open bracket, so we need to read in // in the element name. int prefixColonPos; if (!fReaderMgr.getQName(fQNameBuf, &prefixColonPos)) { if (fQNameBuf.isEmpty()) emitError(XMLErrs::ExpectedElementName); else emitError(XMLErrs::InvalidElementName, fQNameBuf.getRawBuffer()); fReaderMgr.skipToChar(chOpenAngle); return false; } // See if its the root element const bool isRoot = fElemStack.isEmpty(); // Skip any whitespace after the name fReaderMgr.skipPastSpaces(); // First we have to do the rawest attribute scan. We don't do any // normalization of them at all, since we don't know yet what type they // might be (since we need the element decl in order to do that.) const XMLCh* qnameRawBuf = fQNameBuf.getRawBuffer(); bool isEmpty; XMLSize_t attCount = rawAttrScan ( qnameRawBuf , *fRawAttrList , isEmpty ); // save the contentleafname and currentscope before addlevel, for later use ContentLeafNameTypeVector* cv = 0; XMLContentModel* cm = 0; unsigned int currentScope = Grammar::TOP_LEVEL_SCOPE; bool laxThisOne = false; if (!isRoot) { // schema validator will have correct type if validating SchemaElementDecl* tempElement = (SchemaElementDecl*) fElemStack.topElement()->fThisElement; SchemaElementDecl::ModelTypes modelType = tempElement->getModelType(); ComplexTypeInfo *currType = 0; if (fValidate) { currType = ((SchemaValidator*)fValidator)->getCurrentTypeInfo(); if (currType) modelType = (SchemaElementDecl::ModelTypes)currType->getContentType(); else // something must have gone wrong modelType = SchemaElementDecl::Any; } else { currType = tempElement->getComplexTypeInfo(); } if ((modelType == SchemaElementDecl::Mixed_Simple) || (modelType == SchemaElementDecl::Mixed_Complex) || (modelType == SchemaElementDecl::Children)) { cm = currType->getContentModel(); cv = cm->getContentLeafNameTypeVector(); currentScope = fElemStack.getCurrentScope(); } else if (modelType == SchemaElementDecl::Any) { laxThisOne = true; } } // Now, since we might have to update the namespace map for this element, // but we don't have the element decl yet, we just tell the element stack // to expand up to get ready. XMLSize_t elemDepth = fElemStack.addLevel(); fElemStack.setValidationFlag(fValidate); fElemStack.setPrefixColonPos(prefixColonPos); // Check if there is any external schema location specified, and if we are at root, // go through them first before scanning those specified in the instance document if (isRoot && (fExternalSchemaLocation || fExternalNoNamespaceSchemaLocation)) { if (fExternalSchemaLocation) parseSchemaLocation(fExternalSchemaLocation, true); if (fExternalNoNamespaceSchemaLocation) resolveSchemaGrammar(fExternalNoNamespaceSchemaLocation, XMLUni::fgZeroLenString, true); } // Make an initial pass through the list and find any xmlns attributes or // schema attributes. if (attCount) scanRawAttrListforNameSpaces(attCount); // Resolve the qualified name to a URI and name so that we can look up // the element decl for this element. We have now update the prefix to // namespace map so we should get the correct element now. unsigned int uriId = resolveQNameWithColon ( qnameRawBuf , fPrefixBuf , ElemStack::Mode_Element , prefixColonPos ); //if schema, check if we should lax or skip the validation of this element bool parentValidation = fValidate; if (cv) { QName element(fPrefixBuf.getRawBuffer(), &qnameRawBuf[prefixColonPos + 1], uriId, fMemoryManager); // elementDepth will be > 0, as cv is only constructed if element is not // root. laxThisOne = laxElementValidation(&element, cv, cm, elemDepth - 1); } // Look up the element now in the grammar. This will get us back a // generic element decl object. We tell him to fault one in if he does // not find it. XMLElementDecl* elemDecl = 0; bool wasAdded = false; const XMLCh* nameRawBuf = &qnameRawBuf[prefixColonPos + 1]; const XMLCh* original_uriStr = fGrammar->getTargetNamespace(); if (uriId != fEmptyNamespaceId) { // Check in current grammar before switching if necessary elemDecl = fGrammar->getElemDecl ( uriId , nameRawBuf , qnameRawBuf , currentScope ); if(!elemDecl) { // look in the list of undeclared elements, as would have been done // before we made grammars stateless: elemDecl = fElemNonDeclPool->getByKey(nameRawBuf, uriId, currentScope); } // this is initialized correctly only if there is // no element decl. The other uses in this scope will only // be encountered if there continues to be no element decl--which // implies that this will have been initialized correctly. unsigned int orgGrammarUri = uriId; if (!elemDecl && ( orgGrammarUri = fURIStringPool->getId(original_uriStr)) != uriId) { // not found, switch to the specified grammar const XMLCh* uriStr = getURIText(uriId); bool errorCondition = !switchGrammar(uriStr) && fValidate; if (errorCondition && !laxThisOne) { fValidator->emitError ( XMLValid::GrammarNotFound ,uriStr ); } elemDecl = fGrammar->getElemDecl ( uriId , nameRawBuf , qnameRawBuf , currentScope ); } if (!elemDecl && currentScope != Grammar::TOP_LEVEL_SCOPE) { // if not found, then it may be a reference, try TOP_LEVEL_SCOPE elemDecl = fGrammar->getElemDecl ( uriId , nameRawBuf , qnameRawBuf , Grammar::TOP_LEVEL_SCOPE ); if(!elemDecl) { // look in the list of undeclared elements, as would have been done // before we made grammars stateless: elemDecl = fElemNonDeclPool->getByKey(nameRawBuf, uriId, (int)Grammar::TOP_LEVEL_SCOPE); } if(!elemDecl) { // still not found in specified uri // try emptyNamespace see if element should be un-qualified. // Use a temp variable until we decide this is the case XMLElementDecl* tempElemDecl = fGrammar->getElemDecl ( fEmptyNamespaceId , nameRawBuf , qnameRawBuf , currentScope ); if (tempElemDecl && tempElemDecl->getCreateReason() != XMLElementDecl::JustFaultIn && fValidate) { fValidator->emitError ( XMLValid::ElementNotUnQualified , qnameRawBuf ); elemDecl = tempElemDecl; } } } if (!elemDecl) { // still not found, fault this in and issue error later // switch back to original grammar first (if necessary) if(orgGrammarUri != uriId) { switchGrammar(original_uriStr); } elemDecl = new (fMemoryManager) SchemaElementDecl ( fPrefixBuf.getRawBuffer() , nameRawBuf , uriId , SchemaElementDecl::Any , Grammar::TOP_LEVEL_SCOPE , fMemoryManager ); elemDecl->setId(fElemNonDeclPool->put((void*)elemDecl->getBaseName(), uriId, currentScope, (SchemaElementDecl*)elemDecl)); wasAdded = true; } } else if (!elemDecl) { //the element has no prefix, //thus it is either a non-qualified element defined in current targetNS //or an element that is defined in the globalNS //try unqualifed first elemDecl = fGrammar->getElemDecl ( uriId , nameRawBuf , qnameRawBuf , currentScope ); if(!elemDecl) { // look in the list of undeclared elements, as would have been done // before we made grammars stateless: elemDecl = fElemNonDeclPool->getByKey(nameRawBuf, uriId, currentScope); } // this is initialized correctly only if there is // no element decl. The other uses in this scope will only // be encountered if there continues to be no element decl--which // implies that this will have been initialized correctly. unsigned int orgGrammarUri = fEmptyNamespaceId; if (!elemDecl && (orgGrammarUri = fURIStringPool->getId(original_uriStr)) != fEmptyNamespaceId) { //not found, switch grammar and try globalNS bool errorCondition = !switchGrammar(XMLUni::fgZeroLenString) && fValidate; if (errorCondition && !laxThisOne) { fValidator->emitError ( XMLValid::GrammarNotFound , XMLUni::fgZeroLenString ); } elemDecl = fGrammar->getElemDecl ( uriId , nameRawBuf , qnameRawBuf , currentScope ); } if (!elemDecl && currentScope != Grammar::TOP_LEVEL_SCOPE) { // if not found, then it may be a reference, try TOP_LEVEL_SCOPE elemDecl = fGrammar->getElemDecl ( uriId , nameRawBuf , qnameRawBuf , Grammar::TOP_LEVEL_SCOPE ); if(!elemDecl) { // look in the list of undeclared elements, as would have been done // before we made grammars stateless: elemDecl = fElemNonDeclPool->getByKey(nameRawBuf, uriId, (int)Grammar::TOP_LEVEL_SCOPE); } if (!elemDecl && orgGrammarUri != fEmptyNamespaceId) { // still Not found in specified uri // go to original Grammar again to see if element needs to be fully qualified. bool errorCondition = !switchGrammar(original_uriStr) && fValidate; if (errorCondition && !laxThisOne) { fValidator->emitError ( XMLValid::GrammarNotFound ,original_uriStr ); } // Use a temp variable until we decide this is the case XMLElementDecl* tempElemDecl = fGrammar->getElemDecl ( orgGrammarUri , nameRawBuf , qnameRawBuf , currentScope ); if (tempElemDecl && tempElemDecl->getCreateReason() != XMLElementDecl::JustFaultIn && fValidate) { fValidator->emitError ( XMLValid::ElementNotQualified , qnameRawBuf ); elemDecl=tempElemDecl; } } } if (!elemDecl) { // still not found, fault this in and issue error later // switch back to original grammar first (if necessary) if(orgGrammarUri != fEmptyNamespaceId) { switchGrammar(original_uriStr); } elemDecl = new (fMemoryManager) SchemaElementDecl ( fPrefixBuf.getRawBuffer() , nameRawBuf , uriId , SchemaElementDecl::Any , Grammar::TOP_LEVEL_SCOPE , fMemoryManager ); elemDecl->setId(fElemNonDeclPool->put((void*)elemDecl->getBaseName(), uriId, currentScope, (SchemaElementDecl*)elemDecl)); wasAdded = true; } } // this info needed for DOMTypeInfo fPSVIElemContext.fErrorOccurred = false; // We do something different here according to whether we found the // element or not. bool bXsiTypeSet= (fValidator)?((SchemaValidator*)fValidator)->getIsXsiTypeSet():false; if (wasAdded) { if (laxThisOne && !bXsiTypeSet) { fValidate = false; fElemStack.setValidationFlag(fValidate); } // If validating then emit an error if (fValidate) { // This is to tell the reuse Validator that this element was // faulted-in, was not an element in the grammar pool originally elemDecl->setCreateReason(XMLElementDecl::JustFaultIn); if(!bXsiTypeSet) { fValidator->emitError ( XMLValid::ElementNotDefined , elemDecl->getFullName() ); fPSVIElemContext.fErrorOccurred = true; } } } else { // If its not marked declared and validating, then emit an error if (!elemDecl->isDeclared()) { if(elemDecl->getCreateReason() == XMLElementDecl::NoReason) { if(!bXsiTypeSet) fPSVIElemContext.fErrorOccurred = true; } if (laxThisOne) { fValidate = false; fElemStack.setValidationFlag(fValidate); } if (fValidate && !bXsiTypeSet) { fValidator->emitError ( XMLValid::ElementNotDefined , elemDecl->getFullName() ); } } } // Now we can update the element stack to set the current element // decl. We expanded the stack above, but couldn't store the element // decl because we didn't know it yet. fElemStack.setElement(elemDecl, fReaderMgr.getCurrentReaderNum()); fElemStack.setCurrentURI(uriId); if (isRoot) { fRootGrammar = fGrammar; fRootElemName = XMLString::replicate(qnameRawBuf, fMemoryManager); } if (fPSVIHandler) { fPSVIElemContext.fElemDepth++; if (elemDecl->isDeclared()) { fPSVIElemContext.fNoneValidationDepth = fPSVIElemContext.fElemDepth; } else { fPSVIElemContext.fFullValidationDepth = fPSVIElemContext.fElemDepth; /****** * While we report an error for historical reasons, this should * actually result in lax assessment - NG. if (isRoot && fValidate) fPSVIElemContext.fErrorOccurred = true; ******/ } } // Validate the element if (fValidate) { fValidator->validateElement(elemDecl); if (((SchemaValidator*) fValidator)->getErrorOccurred()) fPSVIElemContext.fErrorOccurred = true; } // squirrel away the element's QName, so that we can do an efficient // end-tag match fElemStack.setCurrentSchemaElemName(fQNameBuf.getRawBuffer()); ComplexTypeInfo* typeinfo = (fValidate) ? ((SchemaValidator*)fValidator)->getCurrentTypeInfo() : ((SchemaElementDecl*) elemDecl)->getComplexTypeInfo(); if (typeinfo) { currentScope = typeinfo->getScopeDefined(); // switch grammar if the typeinfo has a different grammar (happens when there is xsi:type) XMLCh* typeName = typeinfo->getTypeName(); const int comma = XMLString::indexOf(typeName, chComma); if (comma > 0) { XMLBuffer prefixBuf(comma+1, fMemoryManager); prefixBuf.append(typeName, comma); const XMLCh* uriStr = prefixBuf.getRawBuffer(); bool errorCondition = !switchGrammar(uriStr) && fValidate; if (errorCondition && !laxThisOne) { fValidator->emitError ( XMLValid::GrammarNotFound , prefixBuf.getRawBuffer() ); } } else if (comma == 0) { bool errorCondition = !switchGrammar(XMLUni::fgZeroLenString) && fValidate; if (errorCondition && !laxThisOne) { fValidator->emitError ( XMLValid::GrammarNotFound , XMLUni::fgZeroLenString ); } } } fElemStack.setCurrentScope(currentScope); // Set element next state if (elemDepth >= fElemStateSize) { resizeElemState(); } fElemState[elemDepth] = 0; fElemLoopState[elemDepth] = 0; fElemStack.setCurrentGrammar(fGrammar); // If this is the first element and we are validating, check the root // element. if (!isRoot && parentValidation) { // If the element stack is not empty, then add this element as a // child of the previous top element. If its empty, this is the root // elem and is not the child of anything. fElemStack.addChild(elemDecl->getElementName(), true); } // PSVI handling: must reset this, even if no attributes... if(getPSVIHandler()) fPSVIAttrList->reset(); // Now lets get the fAttrList filled in. This involves faulting in any // defaulted and fixed attributes and normalizing the values of any that // we got explicitly. // // We update the attCount value with the total number of attributes, but // it goes in with the number of values we got during the raw scan of // explictly provided attrs above. attCount = buildAttList(*fRawAttrList, attCount, elemDecl, *fAttrList); if(attCount) { // clean up after ourselves: // clear the map used to detect duplicate attributes fUndeclaredAttrRegistry->removeAll(); } // activate identity constraints if (toCheckIdentityConstraint()) { fICHandler->activateIdentityConstraint ( (SchemaElementDecl*) elemDecl , (int) elemDepth , uriId , fPrefixBuf.getRawBuffer() , *fAttrList , attCount , fValidationContext ); } // Since the element may have default values, call start tag now regardless if it is empty or not // If we have a document handler, then tell it about this start tag if (fDocHandler) { fDocHandler->startElement ( *elemDecl , uriId , fPrefixBuf.getRawBuffer() , *fAttrList , attCount , false , isRoot ); } // may be where we output something... // if we have a PSVIHandler, now's the time to call // its handleAttributesPSVI method: if(fPSVIHandler) { QName *eName = elemDecl->getElementName(); fPSVIHandler->handleAttributesPSVI ( eName->getLocalPart() , fURIStringPool->getValueForId(eName->getURI()) , fPSVIAttrList ); } // If empty, validate content right now if we are validating and then // pop the element stack top. Else, we have to update the current stack // top's namespace mapping elements. if (isEmpty) { // Pop the element stack back off since it'll never be used now fElemStack.popTop(); // reset current type info DatatypeValidator* psviMemberType = 0; if (fGrammarType == Grammar::SchemaGrammarType) { if (fValidate && elemDecl->isDeclared()) { fPSVIElemContext.fCurrentTypeInfo = ((SchemaValidator*) fValidator)->getCurrentTypeInfo(); if(!fPSVIElemContext.fCurrentTypeInfo) fPSVIElemContext.fCurrentDV = ((SchemaValidator*) fValidator)->getCurrentDatatypeValidator(); else fPSVIElemContext.fCurrentDV = 0; if(fPSVIHandler) { fPSVIElemContext.fNormalizedValue = ((SchemaValidator*) fValidator)->getNormalizedValue(); if (XMLString::equals(fPSVIElemContext.fNormalizedValue, XMLUni::fgZeroLenString)) fPSVIElemContext.fNormalizedValue = 0; } } else { fPSVIElemContext.fCurrentDV = 0; fPSVIElemContext.fCurrentTypeInfo = 0; fPSVIElemContext.fNormalizedValue = 0; } } // If validating, then insure that its legal to have no content if (fValidate) { XMLSize_t failure; bool res = fValidator->checkContent(elemDecl, 0, 0, &failure); if (!res) { // REVISIT: in the case of xsi:type, this may // return the wrong string... fValidator->emitError ( XMLValid::ElementNotValidForContent , elemDecl->getFullName() , elemDecl->getFormattedContentModel() ); } if (((SchemaValidator*) fValidator)->getErrorOccurred()) fPSVIElemContext.fErrorOccurred = true; // note that if we're empty, won't be a current DV else { if (fPSVIHandler) { fPSVIElemContext.fIsSpecified = ((SchemaValidator*) fValidator)->getIsElemSpecified(); if(fPSVIElemContext.fIsSpecified) fPSVIElemContext.fNormalizedValue = ((SchemaElementDecl *)elemDecl)->getDefaultValue(); } if (fPSVIElemContext.fCurrentDV && fPSVIElemContext.fCurrentDV->getType() == DatatypeValidator::Union) psviMemberType = fValidationContext->getValidatingMemberType(); } // call matchers and de-activate context if (toCheckIdentityConstraint()) { fICHandler->deactivateContext ( (SchemaElementDecl *) elemDecl , fContent.getRawBuffer() , fValidationContext , fPSVIElemContext.fCurrentDV ); } } else if (fGrammarType == Grammar::SchemaGrammarType) { ((SchemaValidator*)fValidator)->resetNillable(); } if (fPSVIHandler) { endElementPSVI ( (SchemaElementDecl*)elemDecl, psviMemberType ); } // If we have a doc handler, tell it about the end tag if (fDocHandler) { fDocHandler->endElement ( *elemDecl , uriId , isRoot , fPrefixBuf.getRawBuffer() ); } // If the elem stack is empty, then it was an empty root if (isRoot) gotData = false; else { // Restore the grammar fGrammar = fElemStack.getCurrentGrammar(); fGrammarType = fGrammar->getGrammarType(); fValidator->setGrammar(fGrammar); // Restore the validation flag fValidate = fElemStack.getValidationFlag(); } } else // not empty { // send a partial element psvi if (fPSVIHandler) { ComplexTypeInfo* curTypeInfo = 0; DatatypeValidator* curDV = 0; XSTypeDefinition* typeDef = 0; if (fValidate && elemDecl->isDeclared()) { curTypeInfo = ((SchemaValidator*) fValidator)->getCurrentTypeInfo(); if (curTypeInfo) { typeDef = (XSTypeDefinition*) fModel->getXSObject(curTypeInfo); } else { curDV = ((SchemaValidator*) fValidator)->getCurrentDatatypeValidator(); if (curDV) { typeDef = (XSTypeDefinition*) fModel->getXSObject(curDV); } } } fPSVIElement->reset ( PSVIElement::VALIDITY_NOTKNOWN , PSVIElement::VALIDATION_NONE , fRootElemName , ((SchemaValidator*) fValidator)->getIsElemSpecified() , (elemDecl->isDeclared()) ? (XSElementDeclaration*) fModel->getXSObject(elemDecl) : 0 , typeDef , 0 //memberType , fModel , ((SchemaElementDecl*)elemDecl)->getDefaultValue() , 0 , 0 , 0 ); fPSVIHandler->handlePartialElementPSVI ( elemDecl->getBaseName() , fURIStringPool->getValueForId(elemDecl->getURI()) , fPSVIElement ); } fErrorStack->push(fPSVIElemContext.fErrorOccurred); } return true; } // --------------------------------------------------------------------------- // SGXMLScanner: Grammar preparsing // --------------------------------------------------------------------------- Grammar* SGXMLScanner::loadGrammar(const InputSource& src , const short grammarType , const bool toCache) { Grammar* loadedGrammar = 0; ReaderMgrResetType resetReaderMgr(&fReaderMgr, &ReaderMgr::reset); try { fGrammarResolver->cacheGrammarFromParse(false); // if the new grammar has to be cached, better use the already cached // grammars, or the an exception will be thrown when caching an already // cached grammar fGrammarResolver->useCachedGrammarInParse(toCache); fRootGrammar = 0; if (fValScheme == Val_Auto) { fValidate = true; } // Reset some status flags fInException = false; fStandalone = false; fErrorCount = 0; fHasNoDTD = true; fSeeXsi = false; if (grammarType == Grammar::SchemaGrammarType) { loadedGrammar = loadXMLSchemaGrammar(src, toCache); } } // NOTE: // // In all of the error processing below, the emitError() call MUST come // before the flush of the reader mgr, or it will fail because it tries // to find out the position in the XML source of the error. catch(const XMLErrs::Codes) { // This is a 'first failure' exception, so fall through } catch(const XMLValid::Codes) { // This is a 'first fatal error' type exit, so fall through } catch(const XMLException& excToCatch) { // Emit the error and catch any user exception thrown from here. Make // sure in all cases we flush the reader manager. fInException = true; try { if (excToCatch.getErrorType() == XMLErrorReporter::ErrType_Warning) emitError ( XMLErrs::XMLException_Warning , excToCatch.getCode() , excToCatch.getMessage() ); else if (excToCatch.getErrorType() >= XMLErrorReporter::ErrType_Fatal) emitError ( XMLErrs::XMLException_Fatal , excToCatch.getCode() , excToCatch.getMessage() ); else emitError ( XMLErrs::XMLException_Error , excToCatch.getCode() , excToCatch.getMessage() ); } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } } catch(const OutOfMemoryException&) { // This is a special case for out-of-memory // conditions, because resetting the ReaderMgr // can be problematic. resetReaderMgr.release(); throw; } return loadedGrammar; } void SGXMLScanner::resetCachedGrammar () { fCachedSchemaInfoList->removeAll (); } // --------------------------------------------------------------------------- // SGXMLScanner: Private helper methods // --------------------------------------------------------------------------- // This method handles the common initialization, to avoid having to do // it redundantly in multiple constructors. void SGXMLScanner::commonInit() { // Create the element state array fElemState = (unsigned int*) fMemoryManager->allocate ( fElemStateSize * sizeof(unsigned int) ); //new unsigned int[fElemStateSize]; fElemLoopState = (unsigned int*) fMemoryManager->allocate ( fElemStateSize * sizeof(unsigned int) ); //new unsigned int[fElemStateSize]; // And we need one for the raw attribute scan. This just stores key/ // value string pairs (prior to any processing.) fRawAttrList = new (fMemoryManager) RefVectorOf(32, true, fMemoryManager); fRawAttrColonList = (int*) fMemoryManager->allocate ( fRawAttrColonListSize * sizeof(int) ); // Create the Validator and init them fSchemaValidator = new (fMemoryManager) SchemaValidator(0, fMemoryManager); initValidator(fSchemaValidator); // Create IdentityConstraint info fICHandler = new (fMemoryManager) IdentityConstraintHandler(this, fMemoryManager); // Add the default entity entries for the character refs that must always // be present. fEntityTable = new (fMemoryManager) ValueHashTableOf(11, fMemoryManager); fEntityTable->put((void*) XMLUni::fgAmp, chAmpersand); fEntityTable->put((void*) XMLUni::fgLT, chOpenAngle); fEntityTable->put((void*) XMLUni::fgGT, chCloseAngle); fEntityTable->put((void*) XMLUni::fgQuot, chDoubleQuote); fEntityTable->put((void*) XMLUni::fgApos, chSingleQuote); fElemNonDeclPool = new (fMemoryManager) RefHash3KeysIdPool(29, true, 128, fMemoryManager); fAttDefRegistry = new (fMemoryManager) RefHashTableOf ( 131, false, fMemoryManager ); fUndeclaredAttrRegistry = new (fMemoryManager) Hash2KeysSetOf(7, fMemoryManager); fPSVIAttrList = new (fMemoryManager) PSVIAttributeList(fMemoryManager); fSchemaInfoList = new (fMemoryManager) RefHash2KeysTableOf(29, fMemoryManager); fCachedSchemaInfoList = new (fMemoryManager) RefHash2KeysTableOf(29, fMemoryManager); if (fValidator) { if (!fValidator->handlesSchema()) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Gen_NoSchemaValidator, fMemoryManager); } else { fValidator = fSchemaValidator; } } void SGXMLScanner::cleanUp() { fMemoryManager->deallocate(fElemState); //delete [] fElemState; fMemoryManager->deallocate(fElemLoopState); //delete [] fElemLoopState; delete fSchemaGrammar; delete fEntityTable; delete fRawAttrList; fMemoryManager->deallocate(fRawAttrColonList); delete fSchemaValidator; delete fICHandler; delete fElemNonDeclPool; delete fAttDefRegistry; delete fUndeclaredAttrRegistry; delete fPSVIAttrList; if (fPSVIElement) delete fPSVIElement; if (fErrorStack) delete fErrorStack; delete fSchemaInfoList; delete fCachedSchemaInfoList; } void SGXMLScanner::resizeElemState() { unsigned int newSize = fElemStateSize * 2; unsigned int* newElemState = (unsigned int*) fMemoryManager->allocate ( newSize * sizeof(unsigned int) ); //new unsigned int[newSize]; unsigned int* newElemLoopState = (unsigned int*) fMemoryManager->allocate ( newSize * sizeof(unsigned int) ); //new unsigned int[newSize]; // Copy the existing values unsigned int index = 0; for (; index < fElemStateSize; index++) { newElemState[index] = fElemState[index]; newElemLoopState[index] = fElemLoopState[index]; } for (; index < newSize; index++) newElemLoopState[index] = newElemState[index] = 0; // Delete the old array and udpate our members fMemoryManager->deallocate(fElemState); //delete [] fElemState; fMemoryManager->deallocate(fElemLoopState); //delete [] fElemLoopState; fElemState = newElemState; fElemLoopState = newElemLoopState; fElemStateSize = newSize; } void SGXMLScanner::resizeRawAttrColonList() { unsigned int newSize = fRawAttrColonListSize * 2; int* newRawAttrColonList = (int*) fMemoryManager->allocate ( newSize * sizeof(int) ); //new int[newSize]; // Copy the existing values unsigned int index = 0; for (; index < fRawAttrColonListSize; index++) newRawAttrColonList[index] = fRawAttrColonList[index]; // Delete the old array and udpate our members fMemoryManager->deallocate(fRawAttrColonList); //delete [] fRawAttrColonList; fRawAttrColonList = newRawAttrColonList; fRawAttrColonListSize = newSize; } // This method is called from scanStartTag() to build up the list of // XMLAttr objects that will be passed out in the start tag callout. We // get the key/value pairs from the raw scan of explicitly provided attrs, // which have not been normalized. And we get the element declaration from // which we will get any defaulted or fixed attribute defs and add those // in as well. XMLSize_t SGXMLScanner::buildAttList(const RefVectorOf& providedAttrs , const XMLSize_t attCount , XMLElementDecl* elemDecl , RefVectorOf& toFill) { // Ask the element to clear the 'provided' flag on all of the att defs // that it owns, and to return us a boolean indicating whether it has // any defs. DatatypeValidator *currDV = 0; ComplexTypeInfo *currType = 0; if (fValidate) { currType = ((SchemaValidator*)fValidator)->getCurrentTypeInfo(); if (!currType) { currDV = ((SchemaValidator*)fValidator)->getCurrentDatatypeValidator(); } } const bool hasDefs = (currType && fValidate) ? currType->hasAttDefs() : elemDecl->hasAttDefs(); fElemCount++; // If there are no expliclitily provided attributes and there are no // defined attributes for the element, the we don't have anything to do. // So just return zero in this case. if (!hasDefs && !attCount) return 0; // Keep up with how many attrs we end up with total XMLSize_t retCount = 0; // And get the current size of the output vector. This lets us use // existing elements until we fill it, then start adding new ones. const XMLSize_t curAttListSize = toFill.size(); // We need a buffer into which raw scanned attribute values will be // normalized. XMLBufBid bbNormal(&fBufMgr); XMLBuffer& normBuf = bbNormal.getBuffer(); XMLBufBid bbPrefix(&fBufMgr); XMLBuffer& prefixBuf = bbPrefix.getBuffer(); // Loop through our explicitly provided attributes, which are in the raw // scanned form, and build up XMLAttr objects. XMLSize_t index; const XMLCh* prefPtr, *suffPtr; for (index = 0; index < attCount; index++) { PSVIItem::VALIDITY_STATE attrValid = PSVIItem::VALIDITY_VALID; PSVIItem::ASSESSMENT_TYPE attrAssessed = PSVIItem::VALIDATION_FULL; const KVStringPair* curPair = providedAttrs.elementAt(index); // We have to split the name into its prefix and name parts. Then // we map the prefix to its URI. const XMLCh* const namePtr = curPair->getKey(); const int colonInd = fRawAttrColonList[index]; unsigned int uriId; if (colonInd != -1) { prefixBuf.set(namePtr, colonInd); prefPtr = prefixBuf.getRawBuffer(); suffPtr = namePtr + colonInd + 1; // Map the prefix to a URI id uriId = resolvePrefix(prefPtr, ElemStack::Mode_Attribute); } else { // No colon, so we just have a name with no prefix prefPtr = XMLUni::fgZeroLenString; suffPtr = namePtr; // an empty prefix is always the empty namespace, when dealing with attributes uriId = fEmptyNamespaceId; } // If the uri comes back as the xmlns or xml URI or its just a name // and that name is 'xmlns', then we handle it specially. So set a // boolean flag that lets us quickly below know which we are dealing // with. const bool isNSAttr = (uriId == fEmptyNamespaceId)? XMLString::equals(suffPtr, XMLUni::fgXMLNSString) : (uriId == fXMLNSNamespaceId || XMLString::equals(getURIText(uriId), SchemaSymbols::fgURI_XSI)); // If its not a special case namespace attr of some sort, then we // do normal checking and processing. XMLAttDef::AttTypes attType = XMLAttDef::CData; DatatypeValidator *attrValidator = 0; PSVIAttribute *psviAttr = 0; bool otherXSI = false; if (isNSAttr) { if(!fUndeclaredAttrRegistry->putIfNotPresent(suffPtr, uriId)) { emitError ( XMLErrs::AttrAlreadyUsedInSTag , namePtr , elemDecl->getFullName() ); fPSVIElemContext.fErrorOccurred = true; } else { bool ValueValidate = false; bool tokenizeBuffer = false; if (uriId == fXMLNSNamespaceId) { attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_ANYURI); } else if (XMLString::equals(getURIText(uriId), SchemaSymbols::fgURI_XSI)) { if (XMLString::equals(suffPtr, SchemaSymbols::fgATT_NILL)) { attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_BOOLEAN); ValueValidate = true; } else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_SCHEMALOCATION)) { // use anyURI as the validator // tokenize the data and use the anyURI data for each piece attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_ANYURI); //We should validate each value in the schema location however //this lead to a performance degradation of around 4%. Since //the first value of each pair needs to match what is in the //schema document and the second value needs to be valid in //order to open the document we won't validate it. Need to //do performance analysis of the anyuri datatype. //ValueValidate = true; ValueValidate = false; tokenizeBuffer = true; } else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCATION)) { attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_ANYURI); //We should validate this value however //this lead to a performance degradation of around 4%. Since //the value needs to be valid in //order to open the document we won't validate it. Need to //do performance analysis of the anyuri datatype. //ValueValidate = true; ValueValidate = false; } else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_TYPE)) { attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_QNAME); ValueValidate = true; } else { otherXSI = true; } } if (!otherXSI) { normalizeAttRawValue ( namePtr , curPair->getValue() , normBuf ); if (fValidate && attrValidator && ValueValidate) { ((SchemaValidator*) fValidator)->normalizeWhiteSpace(attrValidator, normBuf.getRawBuffer(), normBuf, true); ValidationContext* const theContext = getValidationContext(); if (theContext) { try { if (tokenizeBuffer) { XMLStringTokenizer tokenizer(normBuf.getRawBuffer(), fMemoryManager); while (tokenizer.hasMoreTokens()) { attrValidator->validate( tokenizer.nextToken(), theContext, fMemoryManager); } } else { attrValidator->validate( normBuf.getRawBuffer(), theContext, fMemoryManager); } } catch (const XMLException& idve) { fValidator->emitError (XMLValid::DatatypeError, idve.getCode(), idve.getMessage()); } } } if(getPSVIHandler() && fGrammarType == Grammar::SchemaGrammarType) { psviAttr = fPSVIAttrList->getPSVIAttributeToFill(suffPtr, fURIStringPool->getValueForId(uriId)); XSSimpleTypeDefinition *validatingType = (attrValidator) ? (XSSimpleTypeDefinition *)fModel->getXSObject(attrValidator) : 0; // no attribute declarations for these... psviAttr->reset( fRootElemName , PSVIItem::VALIDITY_NOTKNOWN , PSVIItem::VALIDATION_NONE , validatingType , 0 , 0 , false , 0 , attrValidator ); } } } } if (!isNSAttr || otherXSI) { // Some checking for attribute wild card first (for schema) bool laxThisOne = false; bool skipThisOne = false; XMLAttDef* attDefForWildCard = 0; XMLAttDef* attDef = 0; if (fGrammarType == Grammar::SchemaGrammarType) { //retrieve the att def SchemaAttDef* attWildCard = 0; if (currType) { attDef = currType->getAttDef(suffPtr, uriId); attWildCard = currType->getAttWildCard(); } else if (!currDV) { // check explicitly-set wildcard attWildCard = ((SchemaElementDecl*)elemDecl)->getAttWildCard(); } // if not found or faulted in - check for a matching wildcard attribute // if no matching wildcard attribute, check (un)qualifed cases and flag // appropriate errors if (!attDef || (attDef->getCreateReason() == XMLAttDef::JustFaultIn)) { if (attWildCard) { //if schema, see if we should lax or skip the validation of this attribute if (anyAttributeValidation(attWildCard, uriId, skipThisOne, laxThisOne)) { if(!skipThisOne) { SchemaGrammar* sGrammar = (SchemaGrammar*) fGrammarResolver->getGrammar(getURIText(uriId)); if (sGrammar && sGrammar->getGrammarType() == Grammar::SchemaGrammarType) { RefHashTableOf* attRegistry = sGrammar->getAttributeDeclRegistry(); if (attRegistry) { attDefForWildCard = attRegistry->get(suffPtr); } } } } } else if (currType) { // not found, see if the attDef should be qualified or not if (uriId == fEmptyNamespaceId) { attDef = currType->getAttDef(suffPtr, fURIStringPool->getId(fGrammar->getTargetNamespace())); if (fValidate && attDef && attDef->getCreateReason() != XMLAttDef::JustFaultIn) { // the attribute should be qualified fValidator->emitError ( XMLValid::AttributeNotQualified , attDef->getFullName() ); fPSVIElemContext.fErrorOccurred = true; if (getPSVIHandler()) { attrValid = PSVIItem::VALIDITY_INVALID; } } } else { attDef = currType->getAttDef(suffPtr, fEmptyNamespaceId); if (fValidate && attDef && attDef->getCreateReason() != XMLAttDef::JustFaultIn) { // the attribute should be qualified fValidator->emitError ( XMLValid::AttributeNotUnQualified , attDef->getFullName() ); fPSVIElemContext.fErrorOccurred = true; if (getPSVIHandler()) { attrValid = PSVIItem::VALIDITY_INVALID; } } } } } } // now need to prepare for duplicate detection if(attDef) { unsigned int *curCountPtr = fAttDefRegistry->get(attDef); if(!curCountPtr) { curCountPtr = getNewUIntPtr(); *curCountPtr = fElemCount; fAttDefRegistry->put(attDef, curCountPtr); } else if(*curCountPtr < fElemCount) *curCountPtr = fElemCount; else { emitError ( XMLErrs::AttrAlreadyUsedInSTag , attDef->getFullName() , elemDecl->getFullName() ); fPSVIElemContext.fErrorOccurred = true; } } else { if(!fUndeclaredAttrRegistry->putIfNotPresent(suffPtr, uriId)) { emitError ( XMLErrs::AttrAlreadyUsedInSTag , namePtr , elemDecl->getFullName() ); fPSVIElemContext.fErrorOccurred = true; } } // if we've found either an attDef or an attDefForWildCard, // then we're doing full validation and it may still be valid. if(!attDef && !attDefForWildCard) { if(!laxThisOne && !skipThisOne) { fPSVIElemContext.fErrorOccurred = true; } if(getPSVIHandler()) { if(!laxThisOne && !skipThisOne) { attrValid = PSVIItem::VALIDITY_INVALID; } else if(laxThisOne) { attrValid = PSVIItem::VALIDITY_NOTKNOWN; attrAssessed = PSVIItem::VALIDATION_PARTIAL; } else { attrValid = PSVIItem::VALIDITY_NOTKNOWN; attrAssessed = PSVIItem::VALIDATION_NONE; } } } bool errorCondition = fValidate && !attDefForWildCard && !attDef; if (errorCondition && !skipThisOne && !laxThisOne) { // // Its not valid for this element, so issue an error if we are // validating. // XMLBufBid bbMsg(&fBufMgr); XMLBuffer& bufMsg = bbMsg.getBuffer(); if (uriId != fEmptyNamespaceId) { XMLBufBid bbURI(&fBufMgr); XMLBuffer& bufURI = bbURI.getBuffer(); getURIText(uriId, bufURI); bufMsg.append(chOpenCurly); bufMsg.append(bufURI.getRawBuffer()); bufMsg.append(chCloseCurly); } bufMsg.append(suffPtr); fValidator->emitError ( XMLValid::AttNotDefinedForElement , bufMsg.getRawBuffer() , elemDecl->getFullName() ); } // Now normalize the raw value since we have the attribute type. We // don't care about the return status here. If it failed, an error // was issued, which is all we care about. if (attDefForWildCard) { normalizeAttValue( attDefForWildCard, namePtr, curPair->getValue(), normBuf ); // If we found an attdef for this one, then lets validate it. const XMLCh* xsNormalized = normBuf.getRawBuffer(); DatatypeValidator* tempDV = ((SchemaAttDef*) attDefForWildCard)->getDatatypeValidator(); if (tempDV && tempDV->getWSFacet() != DatatypeValidator::PRESERVE) { // normalize the attribute according to schema whitespace facet ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, xsNormalized, fWSNormalizeBuf, true); xsNormalized = fWSNormalizeBuf.getRawBuffer(); if (fNormalizeData && fValidate) { normBuf.set(xsNormalized); } } if (fValidate ) { fValidator->validateAttrValue( attDefForWildCard, xsNormalized, false, elemDecl ); attrValidator = ((SchemaValidator *)fValidator)->getMostRecentAttrValidator(); if(((SchemaValidator *)fValidator)->getErrorOccurred()) { fPSVIElemContext.fErrorOccurred = true; if(getPSVIHandler()) attrValid = PSVIItem::VALIDITY_INVALID; } } else { // no decl; default DOMTypeInfo to anySimpleType attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_ANYSIMPLETYPE); } // Save the type for later use attType = attDefForWildCard->getType(); } else { normalizeAttValue( attDef, namePtr, curPair->getValue(), normBuf ); // If we found an attdef for this one, then lets validate it. if (attDef) { const XMLCh* xsNormalized = normBuf.getRawBuffer(); if (fGrammarType == Grammar::SchemaGrammarType) { DatatypeValidator* tempDV = ((SchemaAttDef*) attDef)->getDatatypeValidator(); if (tempDV && tempDV->getWSFacet() != DatatypeValidator::PRESERVE) { // normalize the attribute according to schema whitespace facet ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, xsNormalized, fWSNormalizeBuf, true); xsNormalized = fWSNormalizeBuf.getRawBuffer(); if (fNormalizeData && fValidate && !skipThisOne) { normBuf.set(xsNormalized); } } } if (fValidate && !skipThisOne) { fValidator->validateAttrValue( attDef, xsNormalized, false, elemDecl ); attrValidator = ((SchemaValidator *)fValidator)->getMostRecentAttrValidator(); if(((SchemaValidator *)fValidator)->getErrorOccurred()) { fPSVIElemContext.fErrorOccurred = true; if(getPSVIHandler()) attrValid = PSVIItem::VALIDITY_INVALID; } } else { attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_ANYSIMPLETYPE); } } else { attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_ANYSIMPLETYPE); } // Save the type for later use if (attDef) { attType = attDef->getType(); } } // now fill in the PSVIAttributes entry for this attribute: if(getPSVIHandler()) { psviAttr = fPSVIAttrList->getPSVIAttributeToFill(suffPtr, fURIStringPool->getValueForId(uriId)); SchemaAttDef *actualAttDef = 0; if(attDef) actualAttDef = (SchemaAttDef *)attDef; else if (attDefForWildCard) actualAttDef = (SchemaAttDef *)attDefForWildCard; if(actualAttDef) { XSAttributeDeclaration *attrDecl = (XSAttributeDeclaration *)fModel->getXSObject(actualAttDef); DatatypeValidator * attrDataType = actualAttDef->getDatatypeValidator(); XSSimpleTypeDefinition *validatingType = (XSSimpleTypeDefinition *)fModel->getXSObject(attrDataType); if(attrValid != PSVIItem::VALIDITY_VALID) { psviAttr->reset ( fRootElemName , attrValid , attrAssessed , validatingType , 0 , actualAttDef->getValue() , false , attrDecl , 0 ); } else { XSSimpleTypeDefinition *memberType = 0; if(validatingType->getVariety() == XSSimpleTypeDefinition::VARIETY_UNION) memberType = (XSSimpleTypeDefinition *)fModel->getXSObject(attrValidator); psviAttr->reset ( fRootElemName , attrValid , attrAssessed , validatingType , memberType , actualAttDef->getValue() , false , attrDecl , (memberType)?attrValidator:attrDataType ); } } else { psviAttr->reset ( fRootElemName , attrValid , attrAssessed , 0 , 0 , 0 , false , 0 , 0 ); } } } // Add this attribute to the attribute list that we use to pass them // to the handler. We reuse its existing elements but expand it as // required. XMLAttr* curAttr; if (retCount >= curAttListSize) { curAttr = new (fMemoryManager) XMLAttr ( uriId , suffPtr , prefPtr , normBuf.getRawBuffer() , attType , true , fMemoryManager ); toFill.addElement(curAttr); } else { curAttr = toFill.elementAt(retCount); curAttr->set ( uriId , suffPtr , prefPtr , normBuf.getRawBuffer() , attType ); curAttr->setSpecified(true); } if(psviAttr) psviAttr->setValue(curAttr->getValue()); // Bump the count of attrs in the list retCount++; } // Now, if there are any attributes declared by this element, let's // go through them and make sure that any required ones are provided, // and fault in any fixed ones and defaulted ones that are not provided // literally. if (hasDefs) { // Check after all specified attrs are scanned // (1) report error for REQUIRED attrs that are missing (V_TAGc) // (2) add default attrs if missing (FIXED and NOT_FIXED) XMLAttDefList& attDefList = getAttDefList(currType, elemDecl); for(XMLSize_t i=0; igetDefaultType(); unsigned int *attCountPtr = fAttDefRegistry->get(curDef); if (!attCountPtr || *attCountPtr < fElemCount) { // did not occur // note that since there is no attribute information // item present, there is no PSVI infoset to augment here *except* // that the element is invalid //the attribute is not provided if (fValidate) { // If we are validating and its required, then an error if ((defType == XMLAttDef::Required) || (defType == XMLAttDef::Required_And_Fixed) ) { fValidator->emitError ( XMLValid::RequiredAttrNotProvided , curDef->getFullName() ); fPSVIElemContext.fErrorOccurred = true; } else if ((defType == XMLAttDef::Default) || (defType == XMLAttDef::Fixed) ) { if (fStandalone && curDef->isExternal()) { // XML 1.0 Section 2.9 // Document is standalone, so attributes must not be defaulted. fValidator->emitError(XMLValid::NoDefAttForStandalone, curDef->getFullName(), elemDecl->getFullName()); } } } // Fault in the value if needed, and bump the att count. if ((defType == XMLAttDef::Default) || (defType == XMLAttDef::Fixed)) { // Let the validator pass judgement on the attribute value if (fValidate) { fValidator->validateAttrValue ( curDef , curDef->getValue() , false , elemDecl ); } XMLAttr* curAtt; if (retCount >= curAttListSize) { curAtt = new (fMemoryManager) XMLAttr(fMemoryManager); fValidator->faultInAttr(*curAtt, *curDef); fAttrList->addElement(curAtt); } else { curAtt = fAttrList->elementAt(retCount); fValidator->faultInAttr(*curAtt, *curDef); } // Indicate it was not explicitly specified and bump count curAtt->setSpecified(false); retCount++; if(getPSVIHandler()) { QName *attName = ((SchemaAttDef *)curDef)->getAttName(); PSVIAttribute *defAttrToFill = fPSVIAttrList->getPSVIAttributeToFill ( attName->getLocalPart(), fURIStringPool->getValueForId( attName->getURI()) ); XSAttributeDeclaration *defAttrDecl = (XSAttributeDeclaration *)fModel->getXSObject((void *)curDef); DatatypeValidator * attrDataType = ((SchemaAttDef *)curDef)->getDatatypeValidator(); XSSimpleTypeDefinition *defAttrType = (XSSimpleTypeDefinition*)fModel->getXSObject(attrDataType); // would have occurred during validation of default value if(((SchemaValidator *)fValidator)->getErrorOccurred()) { defAttrToFill->reset( fRootElemName , PSVIItem::VALIDITY_INVALID , PSVIItem::VALIDATION_FULL , defAttrType , 0 , curDef->getValue() , true , defAttrDecl , 0 ); } else { XSSimpleTypeDefinition *defAttrMemberType = 0; if(defAttrType->getVariety() == XSSimpleTypeDefinition::VARIETY_UNION) { defAttrMemberType = (XSSimpleTypeDefinition *)fModel->getXSObject ( ((SchemaValidator*)fValidator)->getMostRecentAttrValidator() ); } defAttrToFill->reset ( fRootElemName , PSVIItem::VALIDITY_VALID , PSVIItem::VALIDATION_FULL , defAttrType , defAttrMemberType , curDef->getValue() , true , defAttrDecl , (defAttrMemberType)?((SchemaValidator *)fValidator)->getMostRecentAttrValidator():attrDataType ); } defAttrToFill->setValue(curDef->getValue()); } } } else if (attCountPtr) { //attribute is provided // (schema) report error for PROHIBITED attrs that are present (V_TAGc) if (defType == XMLAttDef::Prohibited && fValidate) { fValidator->emitError ( XMLValid::ProhibitedAttributePresent , curDef->getFullName() ); fPSVIElemContext.fErrorOccurred = true; if (getPSVIHandler()) { QName *attQName = ((SchemaAttDef *)curDef)->getAttName(); // bad luck... PSVIAttribute *prohibitedAttr = fPSVIAttrList->getAttributePSVIByName ( attQName->getLocalPart(), fURIStringPool->getValueForId(attQName->getURI()) ); prohibitedAttr->updateValidity(PSVIItem::VALIDITY_INVALID); } } } } } return retCount; } // This method will take a raw attribute value and normalize it according to // the rules of the attribute type. It will put the resulting value into the // passed buffer. // // This code assumes that escaped characters in the original value (via char // refs) are prefixed by a 0xFFFF character. This is because some characters // are legal if escaped only. And some escape chars are not subject to // normalization rules. bool SGXMLScanner::normalizeAttValue( const XMLAttDef* const attDef , const XMLCh* const attName , const XMLCh* const value , XMLBuffer& toFill) { // A simple state value for a whitespace processing state machine enum States { InWhitespace , InContent }; // Get the type and name const XMLAttDef::AttTypes type = (attDef) ?attDef->getType() :XMLAttDef::CData; // Assume its going to go fine, and empty the target buffer in preperation bool retVal = true; toFill.reset(); // check to see if it's a tokenized type that is declared externally bool isAttTokenizedExternal = (attDef) ?attDef->isExternal() && (type == XMLAttDef::ID || type == XMLAttDef::IDRef || type == XMLAttDef::IDRefs || type == XMLAttDef::Entity || type == XMLAttDef::Entities || type == XMLAttDef::NmToken || type == XMLAttDef::NmTokens) :false; // Loop through the chars of the source value and normalize it according // to the type. States curState = InContent; bool firstNonWS = false; XMLCh nextCh; const XMLCh* srcPtr = value; if (type == XMLAttDef::CData || type > XMLAttDef::Notation) { while (*srcPtr) { // Get the next character from the source. We have to watch for // escaped characters (which are indicated by a 0xFFFF value followed // by the char that was escaped.) nextCh = *srcPtr; // Do we have an escaped character ? if (nextCh == 0xFFFF) { nextCh = *++srcPtr; } else if ( (nextCh <= 0x0D) && (nextCh == 0x09 || nextCh == 0x0A || nextCh == 0x0D) ) { // Check Validity Constraint for Standalone document declaration // XML 1.0, Section 2.9 if (fStandalone && fValidate && isAttTokenizedExternal) { // Can't have a standalone document declaration of "yes" if attribute // values are subject to normalisation fValidator->emitError(XMLValid::NoAttNormForStandalone, attName); } nextCh = chSpace; } else if (nextCh == chOpenAngle) { // If its not escaped, then make sure its not a < character, which is // not allowed in attribute values. emitError(XMLErrs::BracketInAttrValue, attName); retVal = false; } // Add this char to the target buffer toFill.append(nextCh); // And move up to the next character in the source srcPtr++; } } else { while (*srcPtr) { // Get the next character from the source. We have to watch for // escaped characters (which are indicated by a 0xFFFF value followed // by the char that was escaped.) nextCh = *srcPtr; // Do we have an escaped character ? if (nextCh == 0xFFFF) { nextCh = *++srcPtr; } else if (nextCh == chOpenAngle) { // If its not escaped, then make sure its not a < character, which is // not allowed in attribute values. emitError(XMLErrs::BracketInAttrValue, attName); retVal = false; } if (curState == InWhitespace) { if (!fReaderMgr.getCurrentReader()->isWhitespace(nextCh)) { if (firstNonWS) toFill.append(chSpace); curState = InContent; firstNonWS = true; } else { srcPtr++; continue; } } else if (curState == InContent) { if (fReaderMgr.getCurrentReader()->isWhitespace(nextCh)) { curState = InWhitespace; srcPtr++; // Check Validity Constraint for Standalone document declaration // XML 1.0, Section 2.9 if (fStandalone && fValidate && isAttTokenizedExternal) { if (!firstNonWS || (nextCh != chSpace && *srcPtr && fReaderMgr.getCurrentReader()->isWhitespace(*srcPtr))) { // Can't have a standalone document declaration of "yes" if attribute // values are subject to normalisation fValidator->emitError(XMLValid::NoAttNormForStandalone, attName); } } continue; } firstNonWS = true; } // Add this char to the target buffer toFill.append(nextCh); // And move up to the next character in the source srcPtr++; } } return retVal; } // This method will just normalize the input value as CDATA without // any standalone checking. bool SGXMLScanner::normalizeAttRawValue( const XMLCh* const attrName , const XMLCh* const value , XMLBuffer& toFill) { // Assume its going to go fine, and empty the target buffer in preperation bool retVal = true; toFill.reset(); // Loop through the chars of the source value and normalize it according // to the type. bool escaped; XMLCh nextCh; const XMLCh* srcPtr = value; while (*srcPtr) { // Get the next character from the source. We have to watch for // escaped characters (which are indicated by a 0xFFFF value followed // by the char that was escaped.) nextCh = *srcPtr; escaped = (nextCh == 0xFFFF); if (escaped) nextCh = *++srcPtr; // If its not escaped, then make sure its not a < character, which is // not allowed in attribute values. if (!escaped && (*srcPtr == chOpenAngle)) { emitError(XMLErrs::BracketInAttrValue, attrName); retVal = false; } if (!escaped) { // NOTE: Yes this is a little redundant in that a 0x20 is // replaced with an 0x20. But its faster to do this (I think) // than checking for 9, A, and D separately. if (fReaderMgr.getCurrentReader()->isWhitespace(nextCh)) nextCh = chSpace; } // Add this char to the target buffer toFill.append(nextCh); // And move up to the next character in the source srcPtr++; } return retVal; } // This method will reset the scanner data structures, and related plugged // in stuff, for a new scan session. We get the input source for the primary // XML entity, create the reader for it, and push it on the stack so that // upon successful return from here we are ready to go. void SGXMLScanner::scanReset(const InputSource& src) { // This call implicitly tells us that we are going to reuse the scanner // if it was previously used. So tell the validator to reset itself. // // But, if the fUseCacheGrammar flag is set, then don't reset it. // // NOTE: The ReaderMgr is flushed on the way out, because that is // required to insure that files are closed. fGrammarResolver->cacheGrammarFromParse(fToCacheGrammar); fGrammarResolver->useCachedGrammarInParse(fUseCachedGrammar); // Clear transient schema info list. // fSchemaInfoList->removeAll (); // fModel may need updating, as fGrammarResolver could have cleaned it if(fModel && getPSVIHandler()) fModel = fGrammarResolver->getXSModel(); // Create dummy schema grammar if (!fSchemaGrammar) { fSchemaGrammar = new (fGrammarPoolMemoryManager) SchemaGrammar(fGrammarPoolMemoryManager); } fGrammar = fSchemaGrammar; fGrammarType = Grammar::DTDGrammarType; fRootGrammar = 0; fValidator->setGrammar(fGrammar); if (fValidatorFromUser) { ((SchemaValidator*) fValidator)->setErrorReporter(fErrorReporter); ((SchemaValidator*) fValidator)->setGrammarResolver(fGrammarResolver); ((SchemaValidator*) fValidator)->setExitOnFirstFatal(fExitOnFirstFatal); } // Reset validation fValidate = (fValScheme == Val_Always) ? true : false; // And for all installed handlers, send reset events. This gives them // a chance to flush any cached data. if (fDocHandler) fDocHandler->resetDocument(); if (fEntityHandler) fEntityHandler->resetEntities(); if (fErrorReporter) fErrorReporter->resetErrors(); // Clear out the id reference list resetValidationContext(); // Reset the Root Element Name fMemoryManager->deallocate(fRootElemName);//delete [] fRootElemName; fRootElemName = 0; // Reset IdentityConstraints if (fICHandler) fICHandler->reset(); // Reset the element stack, and give it the latest ids for the special // URIs it has to know about. fElemStack.reset ( fEmptyNamespaceId , fUnknownNamespaceId , fXMLNamespaceId , fXMLNSNamespaceId ); if (!fSchemaNamespaceId) fSchemaNamespaceId = fURIStringPool->addOrFind(SchemaSymbols::fgURI_XSI); // Reset some status flags fInException = false; fStandalone = false; fErrorCount = 0; fHasNoDTD = true; fSeeXsi = false; fDoNamespaces = true; fDoSchema = true; // Reset PSVI context // Note that we always need this around for DOMTypeInfo if (!fPSVIElement) fPSVIElement = new (fMemoryManager) PSVIElement(fMemoryManager); if (!fErrorStack) { fErrorStack = new (fMemoryManager) ValueStackOf(8, fMemoryManager); } else { fErrorStack->removeAllElements(); } resetPSVIElemContext(); // Reset the validators fSchemaValidator->reset(); fSchemaValidator->setErrorReporter(fErrorReporter); fSchemaValidator->setExitOnFirstFatal(fExitOnFirstFatal); fSchemaValidator->setGrammarResolver(fGrammarResolver); if (fValidatorFromUser) fValidator->reset(); // Handle the creation of the XML reader object for this input source. // This will provide us with transcoding and basic lexing services. XMLReader* newReader = fReaderMgr.createReader ( src , true , XMLReader::RefFrom_NonLiteral , XMLReader::Type_General , XMLReader::Source_External , fCalculateSrcOfs , fLowWaterMark ); if (!newReader) { if (src.getIssueFatalErrorIfNotFound()) ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Scan_CouldNotOpenSource, src.getSystemId(), fMemoryManager); else ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Scan_CouldNotOpenSource_Warning, src.getSystemId(), fMemoryManager); } // Push this read onto the reader manager fReaderMgr.pushReader(newReader, 0); // and reset security-related things if necessary: if(fSecurityManager != 0) { fEntityExpansionLimit = fSecurityManager->getEntityExpansionLimit(); fEntityExpansionCount = 0; } fElemCount = 0; if(fUIntPoolRowTotal >= 32) { // 8 KB tied up with validating attributes... fAttDefRegistry->removeAll(); recreateUIntPool(); } else { // note that this will implicitly reset the values of the hashtables, // though their buckets will still be tied up resetUIntPool(); } fUndeclaredAttrRegistry->removeAll(); } // This method is called between markup in content. It scans for character // data that is sent to the document handler. It watches for any markup // characters that would indicate that the character data has ended. It also // handles expansion of general and character entities. // // sendData() is a local static helper for this method which handles some // code that must be done in three different places here. void SGXMLScanner::sendCharData(XMLBuffer& toSend) { // If no data in the buffer, then nothing to do if (toSend.isEmpty()) return; // We do different things according to whether we are validating or // not. If not, its always just characters; else, it depends on the // current element's content model. if (fValidate) { // Get the raw data we need for the callback const XMLCh* rawBuf = toSend.getRawBuffer(); const XMLSize_t len = toSend.getLen(); // Get the character data opts for the current element XMLElementDecl::CharDataOpts charOpts = XMLElementDecl::AllCharData; // And see if the current element is a 'Children' style content model ComplexTypeInfo *currType = ((SchemaValidator*)fValidator)->getCurrentTypeInfo(); if(currType) { SchemaElementDecl::ModelTypes modelType = (SchemaElementDecl::ModelTypes) currType->getContentType(); if(modelType == SchemaElementDecl::Children || modelType == SchemaElementDecl::ElementOnlyEmpty) charOpts = XMLElementDecl::SpacesOk; else if(modelType == SchemaElementDecl::Empty) charOpts = XMLElementDecl::NoCharData; } // should not be necessary once PSVI method on element decls // are removed if (charOpts == XMLElementDecl::NoCharData) { // They definitely cannot handle any type of char data fValidator->emitError(XMLValid::NoCharDataInCM); if (getPSVIHandler()) { // REVISIT: // PSVIElement->setValidity(PSVIItem::VALIDITY_INVALID); } } else if (fReaderMgr.getCurrentReader()->isAllSpaces(rawBuf, len)) { // Its all spaces. So, if they can take spaces, then send it // as ignorable whitespace. If they can handle any char data // send it as characters. if (charOpts == XMLElementDecl::SpacesOk) { if (fDocHandler) fDocHandler->ignorableWhitespace(rawBuf, len, false); } else if (charOpts == XMLElementDecl::AllCharData) { XMLSize_t xsLen; const XMLCh* xsNormalized; DatatypeValidator* tempDV = ((SchemaValidator*) fValidator)->getCurrentDatatypeValidator(); if (tempDV && tempDV->getWSFacet() != DatatypeValidator::PRESERVE) { // normalize the character according to schema whitespace facet ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, rawBuf, fWSNormalizeBuf); xsNormalized = fWSNormalizeBuf.getRawBuffer(); xsLen = fWSNormalizeBuf.getLen(); } else { xsNormalized = rawBuf; xsLen = len; } // tell the schema validation about the character data for checkContent later ((SchemaValidator*)fValidator)->setDatatypeBuffer(xsNormalized); // call all active identity constraints if (toCheckIdentityConstraint() && fICHandler->getMatcherCount()) { fContent.append(xsNormalized, xsLen); } if (fDocHandler) { if (fNormalizeData) { fDocHandler->docCharacters(xsNormalized, xsLen, false); } else { fDocHandler->docCharacters(rawBuf, len, false); } } } } else { // If they can take any char data, then send it. Otherwise, they // can only handle whitespace and can't handle this stuff so // issue an error. if (charOpts == XMLElementDecl::AllCharData) { XMLSize_t xsLen; const XMLCh *xsNormalized; DatatypeValidator* tempDV = ((SchemaValidator*) fValidator)->getCurrentDatatypeValidator(); if (tempDV && tempDV->getWSFacet() != DatatypeValidator::PRESERVE) { ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, rawBuf, fWSNormalizeBuf); xsNormalized = fWSNormalizeBuf.getRawBuffer(); xsLen = fWSNormalizeBuf.getLen(); } else { xsNormalized = rawBuf; xsLen = len; } // tell the schema validation about the character data for checkContent later ((SchemaValidator*)fValidator)->setDatatypeBuffer(xsNormalized); // call all active identity constraints if (toCheckIdentityConstraint() && fICHandler->getMatcherCount()) { fContent.append(xsNormalized, xsLen); } if (fDocHandler) { if (fNormalizeData) { fDocHandler->docCharacters(xsNormalized, xsLen, false); } else { fDocHandler->docCharacters(rawBuf, len, false); } } } else { fValidator->emitError(XMLValid::NoCharDataInCM); if (getPSVIHandler()) { // REVISIT: // PSVIElement->setValidity(PSVIItem::VALIDITY_INVALID); } } } } else { // call all active identity constraints if (toCheckIdentityConstraint() && fICHandler->getMatcherCount()) fContent.append(toSend.getRawBuffer(), toSend.getLen()); // Always assume its just char data if not validating if (fDocHandler) fDocHandler->docCharacters(toSend.getRawBuffer(), toSend.getLen(), false); } // Reset buffer toSend.reset(); } // This method is called with a key/value string pair that represents an // xmlns="yyy" or xmlns:xxx="yyy" attribute. This method will update the // current top of the element stack based on this data. We know that when // we get here, that it is one of these forms, so we don't bother confirming // it. // // But we have to ensure // 1. xxx is not xmlns // 2. if xxx is xml, then yyy must match XMLUni::fgXMLURIName, and vice versa // 3. yyy is not XMLUni::fgXMLNSURIName // 4. if xxx is not null, then yyy cannot be an empty string. void SGXMLScanner::updateNSMap(const XMLCh* const attrName , const XMLCh* const attrValue) { updateNSMap(attrName, attrValue, XMLString::indexOf(attrName, chColon)); } void SGXMLScanner::updateNSMap(const XMLCh* const attrName , const XMLCh* const attrValue , const int colonOfs) { // We need a buffer to normalize the attribute value into XMLBufBid bbNormal(&fBufMgr); XMLBuffer& normalBuf = bbNormal.getBuffer(); // Normalize the value into the passed buffer. In this case, we don't // care about the return value. An error was issued for the error, which // is all we care about here. normalizeAttRawValue(attrName, attrValue, normalBuf); XMLCh* namespaceURI = normalBuf.getRawBuffer(); // We either have the default prefix (""), or we point it into the attr // name parameter. Note that the xmlns is not the prefix we care about // here. To us, the 'prefix' is really the local part of the attrName // parameter. // // Check 1. xxx is not xmlns // 2. if xxx is xml, then yyy must match XMLUni::fgXMLURIName, and vice versa // 3. yyy is not XMLUni::fgXMLNSURIName // 4. if xxx is not null, then yyy cannot be an empty string. const XMLCh* prefPtr = XMLUni::fgZeroLenString; if (colonOfs != -1) { prefPtr = &attrName[colonOfs + 1]; if (XMLString::equals(prefPtr, XMLUni::fgXMLNSString)) emitError(XMLErrs::NoUseOfxmlnsAsPrefix); else if (XMLString::equals(prefPtr, XMLUni::fgXMLString)) { if (!XMLString::equals(namespaceURI, XMLUni::fgXMLURIName)) emitError(XMLErrs::PrefixXMLNotMatchXMLURI); } if (!namespaceURI) emitError(XMLErrs::NoEmptyStrNamespace, attrName); else if(!*namespaceURI && fXMLVersion == XMLReader::XMLV1_0) emitError(XMLErrs::NoEmptyStrNamespace, attrName); } if (XMLString::equals(namespaceURI, XMLUni::fgXMLNSURIName)) emitError(XMLErrs::NoUseOfxmlnsURI); else if (XMLString::equals(namespaceURI, XMLUni::fgXMLURIName)) { if (!XMLString::equals(prefPtr, XMLUni::fgXMLString)) emitError(XMLErrs::XMLURINotMatchXMLPrefix); } // Ok, we have to get the unique id for the attribute value, which is the // URI that this value should be mapped to. The validator has the // namespace string pool, so we ask him to find or add this new one. Then // we ask the element stack to add this prefix to URI Id mapping. fElemStack.addPrefix ( prefPtr , fURIStringPool->addOrFind(namespaceURI) ); } void SGXMLScanner::scanRawAttrListforNameSpaces(XMLSize_t attCount) { // Make an initial pass through the list and find any xmlns attributes or // schema attributes. // When we find one, send it off to be used to update the element stack's // namespace mappings. for (XMLSize_t index = 0; index < attCount; index++) { // each attribute has the prefix:suffix="value" const KVStringPair* curPair = fRawAttrList->elementAt(index); const XMLCh* rawPtr = curPair->getKey(); // If either the key begins with "xmlns:" or its just plain // "xmlns", then use it to update the map. if (!XMLString::compareNString(rawPtr, XMLUni::fgXMLNSColonString, 6) || XMLString::equals(rawPtr, XMLUni::fgXMLNSString)) { const XMLCh* valuePtr = curPair->getValue(); updateNSMap(rawPtr, valuePtr, fRawAttrColonList[index]); // if the schema URI is seen in the the valuePtr, set the boolean seeXsi if (XMLString::equals(valuePtr, SchemaSymbols::fgURI_XSI)) { fSeeXsi = true; } } } // walk through the list again to deal with "xsi:...." if (fSeeXsi) { for (XMLSize_t index = 0; index < attCount; index++) { // each attribute has the prefix:suffix="value" const KVStringPair* curPair = fRawAttrList->elementAt(index); const XMLCh* rawPtr = curPair->getKey(); const XMLCh* prefPtr; int colonInd = fRawAttrColonList[index]; if (colonInd != -1) { fURIBuf.set(rawPtr, colonInd); prefPtr = fURIBuf.getRawBuffer(); } else { prefPtr = XMLUni::fgZeroLenString; } // if schema URI has been seen, scan for the schema location and uri // and resolve the schema grammar if (resolvePrefix(prefPtr, ElemStack::Mode_Attribute) == fSchemaNamespaceId) { const XMLCh* valuePtr = curPair->getValue(); const XMLCh* suffPtr = &rawPtr[colonInd + 1]; if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_SCHEMALOCATION)) parseSchemaLocation(valuePtr); else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCATION)) resolveSchemaGrammar(valuePtr, XMLUni::fgZeroLenString); } } // do it another time, as xsi:type and xsi:nill only work if the schema grammar has been already // loaded (JIRA XERCESC-1937) if (fValidator && fValidator->handlesSchema()) { for (XMLSize_t index = 0; index < attCount; index++) { // each attribute has the prefix:suffix="value" const KVStringPair* curPair = fRawAttrList->elementAt(index); const XMLCh* rawPtr = curPair->getKey(); const XMLCh* prefPtr; int colonInd = fRawAttrColonList[index]; if (colonInd != -1) { fURIBuf.set(rawPtr, colonInd); prefPtr = fURIBuf.getRawBuffer(); } else { prefPtr = XMLUni::fgZeroLenString; } // scan for schema type if (resolvePrefix(prefPtr, ElemStack::Mode_Attribute) == fSchemaNamespaceId) { const XMLCh* valuePtr = curPair->getValue(); const XMLCh* suffPtr = &rawPtr[colonInd + 1]; if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_TYPE)) { XMLBufBid bbXsi(&fBufMgr); XMLBuffer& fXsiType = bbXsi.getBuffer(); // normalize the attribute according to schema whitespace facet DatatypeValidator* tempDV = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_QNAME); normalizeAttRawValue(SchemaSymbols::fgXSI_TYPE, valuePtr, fXsiType); ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, fXsiType.getRawBuffer(), fXsiType, true); if (!fXsiType.isEmpty()) { int colonPos = -1; unsigned int uriId = resolveQName ( fXsiType.getRawBuffer() , fPrefixBuf , ElemStack::Mode_Element , colonPos ); ((SchemaValidator*)fValidator)->setXsiType(fPrefixBuf.getRawBuffer(), fXsiType.getRawBuffer() + colonPos + 1, uriId); } } else if (XMLString::equals(suffPtr, SchemaSymbols::fgATT_NILL)) { // normalize the attribute according to schema whitespace facet XMLBufBid bbXsi(&fBufMgr); XMLBuffer& fXsiNil = bbXsi.getBuffer(); DatatypeValidator* tempDV = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_BOOLEAN); normalizeAttRawValue(SchemaSymbols::fgATT_NILL, valuePtr, fXsiNil); ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, fXsiNil.getRawBuffer(), fXsiNil, true); if(XMLString::equals(fXsiNil.getRawBuffer(), SchemaSymbols::fgATTVAL_TRUE)) ((SchemaValidator*)fValidator)->setNillable(true); else if(XMLString::equals(fXsiNil.getRawBuffer(), SchemaSymbols::fgATTVAL_FALSE)) ((SchemaValidator*)fValidator)->setNillable(false); else emitError(XMLErrs::InvalidAttValue, fXsiNil.getRawBuffer(), valuePtr); } } } } } } void SGXMLScanner::parseSchemaLocation(const XMLCh* const schemaLocationStr, bool ignoreLoadSchema) { BaseRefVectorOf* schemaLocation = XMLString::tokenizeString(schemaLocationStr, fMemoryManager); Janitor > janLoc(schemaLocation); XMLSize_t size = schemaLocation->size(); if (size % 2 != 0 ) { emitError(XMLErrs::BadSchemaLocation); } else { // We need a buffer to normalize the attribute value into XMLBuffer normalBuf(1023, fMemoryManager); for(XMLSize_t i=0; ielementAt(i), normalBuf); resolveSchemaGrammar(schemaLocation->elementAt(i+1), normalBuf.getRawBuffer(), ignoreLoadSchema); } } } void SGXMLScanner::resolveSchemaGrammar(const XMLCh* const loc, const XMLCh* const uri, bool ignoreLoadSchema) { Grammar* grammar = 0; { XMLSchemaDescriptionImpl theSchemaDescription(uri, fMemoryManager); theSchemaDescription.setLocationHints(loc); grammar = fGrammarResolver->getGrammar(&theSchemaDescription); } // If multi-import is enabled, make sure the existing grammar came // from the import directive. Otherwise we may end up reloading // the same schema that came from the external grammar pool. Ideally, // we would move fSchemaInfoList to XMLGrammarPool so that it survives // the destruction of the scanner in which case we could rely on the // same logic we use to weed out duplicate schemas below. // if (!grammar || grammar->getGrammarType() == Grammar::DTDGrammarType || (getHandleMultipleImports() && ((XMLSchemaDescription*)grammar->getGrammarDescription())-> getContextType () == XMLSchemaDescription::CONTEXT_IMPORT)) { if (fLoadSchema || ignoreLoadSchema) { XSDDOMParser parser(0, fMemoryManager, 0); parser.setValidationScheme(XercesDOMParser::Val_Never); parser.setDoNamespaces(true); parser.setUserEntityHandler(fEntityHandler); parser.setUserErrorReporter(fErrorReporter); //Normalize sysId XMLBufBid nnSys(&fBufMgr); XMLBuffer& normalizedSysId = nnSys.getBuffer(); XMLString::removeChar(loc, 0xFFFF, normalizedSysId); const XMLCh* normalizedURI = normalizedSysId.getRawBuffer(); // Create a buffer for expanding the system id XMLBufBid bbSys(&fBufMgr); XMLBuffer& expSysId = bbSys.getBuffer(); // Allow the entity handler to expand the system id if they choose // to do so. InputSource* srcToFill = 0; if (fEntityHandler) { if (!fEntityHandler->expandSystemId(normalizedURI, expSysId)) expSysId.set(normalizedURI); ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr.getLastExtEntityInfo(lastInfo); XMLResourceIdentifier resourceIdentifier(XMLResourceIdentifier::SchemaGrammar, expSysId.getRawBuffer(), uri, XMLUni::fgZeroLenString, lastInfo.systemId, &fReaderMgr); srcToFill = fEntityHandler->resolveEntity(&resourceIdentifier); } else { expSysId.set(normalizedURI); } // If they didn't create a source via the entity handler, then we // have to create one on our own. if (!srcToFill) { if (fDisableDefaultEntityResolution) return; ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr.getLastExtEntityInfo(lastInfo); XMLURL urlTmp(fMemoryManager); if ((!urlTmp.setURL(lastInfo.systemId, expSysId.getRawBuffer(), urlTmp)) || (urlTmp.isRelative())) { if (!fStandardUriConformant) { XMLBufBid ddSys(&fBufMgr); XMLBuffer& resolvedSysId = ddSys.getBuffer(); XMLUri::normalizeURI(expSysId.getRawBuffer(), resolvedSysId); srcToFill = new (fMemoryManager) LocalFileInputSource ( lastInfo.systemId , resolvedSysId.getRawBuffer() , fMemoryManager ); } else ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_MalformedURL, fMemoryManager); } else { if (fStandardUriConformant && urlTmp.hasInvalidChar()) ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_MalformedURL, fMemoryManager); srcToFill = new (fMemoryManager) URLInputSource(urlTmp, fMemoryManager); } } // Put a janitor on the input source Janitor janSrc(srcToFill); // Check if this exact schema has already been seen. // const XMLCh* sysId = srcToFill->getSystemId(); unsigned int uriId = (uri && *uri) ? fURIStringPool->addOrFind(uri) : fEmptyNamespaceId; SchemaInfo* importSchemaInfo = 0; if (fUseCachedGrammar) importSchemaInfo = fCachedSchemaInfoList->get(sysId, uriId); if (!importSchemaInfo && !fToCacheGrammar) importSchemaInfo = fSchemaInfoList->get(sysId, uriId); if (importSchemaInfo) { // We haven't added any new grammars so it is safe to just // return. // return; } // Should just issue warning if the schema is not found bool flag = srcToFill->getIssueFatalErrorIfNotFound(); srcToFill->setIssueFatalErrorIfNotFound(false); parser.parse(*srcToFill); // Reset the InputSource srcToFill->setIssueFatalErrorIfNotFound(flag); if (parser.getSawFatal() && fExitOnFirstFatal) emitError(XMLErrs::SchemaScanFatalError); DOMDocument* document = parser.getDocument(); //Our Grammar if (document != 0) { DOMElement* root = document->getDocumentElement();// This is what we pass to TraverserSchema if (root != 0) { const XMLCh* newUri = root->getAttribute(SchemaSymbols::fgATT_TARGETNAMESPACE); bool newGrammar = false; if (!XMLString::equals(newUri, uri)) { if (fValidate || fValScheme == Val_Auto) { fValidator->emitError(XMLValid::WrongTargetNamespace, loc, uri); } grammar = fGrammarResolver->getGrammar(newUri); newGrammar = true; } if (!grammar || grammar->getGrammarType() == Grammar::DTDGrammarType || (getHandleMultipleImports() && ((XMLSchemaDescription*) grammar->getGrammarDescription())-> getContextType () == XMLSchemaDescription::CONTEXT_IMPORT)) { // If we switched namespace URI, recheck the schema info. // if (newGrammar) { unsigned int newUriId = (newUri && *newUri) ? fURIStringPool->addOrFind(newUri) : fEmptyNamespaceId; if (fUseCachedGrammar) importSchemaInfo = fCachedSchemaInfoList->get(sysId, newUriId); if (!importSchemaInfo && !fToCacheGrammar) importSchemaInfo = fSchemaInfoList->get(sysId, newUriId); if (importSchemaInfo) return; } // Since we have seen a grammar, set our validation flag // at this point if the validation scheme is auto if (fValScheme == Val_Auto && !fValidate) { fValidate = true; fElemStack.setValidationFlag(fValidate); } bool grammarFound = grammar && grammar->getGrammarType() == Grammar::SchemaGrammarType; SchemaGrammar* schemaGrammar; if (grammarFound) { schemaGrammar = (SchemaGrammar*) grammar; } else { schemaGrammar = new (fGrammarPoolMemoryManager) SchemaGrammar(fGrammarPoolMemoryManager); } XMLSchemaDescription* gramDesc = (XMLSchemaDescription*) schemaGrammar->getGrammarDescription(); gramDesc->setContextType(XMLSchemaDescription::CONTEXT_PREPARSE); gramDesc->setLocationHints(sysId); TraverseSchema traverseSchema ( root , fURIStringPool , schemaGrammar , fGrammarResolver , fUseCachedGrammar ? fCachedSchemaInfoList : fSchemaInfoList , fToCacheGrammar ? fCachedSchemaInfoList : fSchemaInfoList , this , sysId , fEntityHandler , fErrorReporter , fMemoryManager , grammarFound ); // Reset the now invalid schema roots in the collected // schema info entries. // { RefHash2KeysTableOfEnumerator i ( fToCacheGrammar ? fCachedSchemaInfoList : fSchemaInfoList); while (i.hasMoreElements ()) i.nextElement().resetRoot (); } if (fGrammarType == Grammar::DTDGrammarType) { fGrammar = schemaGrammar; fGrammarType = Grammar::SchemaGrammarType; fValidator->setGrammar(fGrammar); } if (fValidate) { // validate the Schema scan so far fValidator->preContentValidation(false); } } } } } } else { // Since we have seen a grammar, set our validation flag // at this point if the validation scheme is auto if (fValScheme == Val_Auto && !fValidate) { fValidate = true; fElemStack.setValidationFlag(fValidate); } // we have seen a schema, so set up the fValidator as fSchemaValidator if (fGrammarType == Grammar::DTDGrammarType) { fGrammar = grammar; fGrammarType = Grammar::SchemaGrammarType; fValidator->setGrammar(fGrammar); } } // update fModel; rely on the grammar resolver to do this // efficiently if(getPSVIHandler()) fModel = fGrammarResolver->getXSModel(); } InputSource* SGXMLScanner::resolveSystemId(const XMLCh* const sysId ,const XMLCh* const pubId) { //Normalize sysId XMLBufBid nnSys(&fBufMgr); XMLBuffer& normalizedSysId = nnSys.getBuffer(); XMLString::removeChar(sysId, 0xFFFF, normalizedSysId); const XMLCh* normalizedURI = normalizedSysId.getRawBuffer(); // Create a buffer for expanding the system id XMLBufBid bbSys(&fBufMgr); XMLBuffer& expSysId = bbSys.getBuffer(); // Allow the entity handler to expand the system id if they choose // to do so. InputSource* srcToFill = 0; if (fEntityHandler) { if (!fEntityHandler->expandSystemId(normalizedURI, expSysId)) expSysId.set(normalizedURI); ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr.getLastExtEntityInfo(lastInfo); XMLResourceIdentifier resourceIdentifier(XMLResourceIdentifier::ExternalEntity, expSysId.getRawBuffer(), 0, pubId, lastInfo.systemId, &fReaderMgr); srcToFill = fEntityHandler->resolveEntity(&resourceIdentifier); } else { expSysId.set(normalizedURI); } // If they didn't create a source via the entity handler, then we // have to create one on our own. if (!srcToFill) { if (fDisableDefaultEntityResolution) return 0; ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr.getLastExtEntityInfo(lastInfo); XMLURL urlTmp(fMemoryManager); if ((!urlTmp.setURL(lastInfo.systemId, expSysId.getRawBuffer(), urlTmp)) || (urlTmp.isRelative())) { if (!fStandardUriConformant) { XMLBufBid ddSys(&fBufMgr); XMLBuffer& resolvedSysId = ddSys.getBuffer(); XMLUri::normalizeURI(expSysId.getRawBuffer(), resolvedSysId); srcToFill = new (fMemoryManager) LocalFileInputSource ( lastInfo.systemId , resolvedSysId.getRawBuffer() , fMemoryManager ); } else ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_MalformedURL, fMemoryManager); } else { if (fStandardUriConformant && urlTmp.hasInvalidChar()) ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_MalformedURL, fMemoryManager); srcToFill = new (fMemoryManager) URLInputSource(urlTmp, fMemoryManager); } } return srcToFill; } // --------------------------------------------------------------------------- // SGXMLScanner: Private grammar preparsing methods // --------------------------------------------------------------------------- Grammar* SGXMLScanner::loadXMLSchemaGrammar(const InputSource& src, const bool toCache) { // Reset the validators fSchemaValidator->reset(); fSchemaValidator->setErrorReporter(fErrorReporter); fSchemaValidator->setExitOnFirstFatal(fExitOnFirstFatal); fSchemaValidator->setGrammarResolver(fGrammarResolver); if (fValidatorFromUser) fValidator->reset(); XSDDOMParser parser(0, fMemoryManager, 0); parser.setValidationScheme(XercesDOMParser::Val_Never); parser.setDoNamespaces(true); parser.setUserEntityHandler(fEntityHandler); parser.setUserErrorReporter(fErrorReporter); // Should just issue warning if the schema is not found bool flag = src.getIssueFatalErrorIfNotFound(); ((InputSource&) src).setIssueFatalErrorIfNotFound(false); parser.parse(src); // Reset the InputSource ((InputSource&) src).setIssueFatalErrorIfNotFound(flag); if (parser.getSawFatal() && fExitOnFirstFatal) emitError(XMLErrs::SchemaScanFatalError); DOMDocument* document = parser.getDocument(); //Our Grammar if (document != 0) { DOMElement* root = document->getDocumentElement();// This is what we pass to TraverserSchema if (root != 0) { const XMLCh* nsUri = root->getAttribute(SchemaSymbols::fgATT_TARGETNAMESPACE); Grammar* grammar = fGrammarResolver->getGrammar(nsUri); // Check if this exact schema has already been seen. // const XMLCh* sysId = src.getSystemId(); SchemaInfo* importSchemaInfo = 0; if (grammar) { if (nsUri && *nsUri) importSchemaInfo = fCachedSchemaInfoList->get(sysId, fURIStringPool->addOrFind(nsUri)); else importSchemaInfo = fCachedSchemaInfoList->get(sysId, fEmptyNamespaceId); } if (!importSchemaInfo) { bool grammarFound = grammar && grammar->getGrammarType() == Grammar::SchemaGrammarType && getHandleMultipleImports(); SchemaGrammar* schemaGrammar; if (grammarFound) schemaGrammar = (SchemaGrammar*) grammar; else schemaGrammar = new (fGrammarPoolMemoryManager) SchemaGrammar(fGrammarPoolMemoryManager); XMLSchemaDescription* gramDesc = (XMLSchemaDescription*) schemaGrammar->getGrammarDescription(); gramDesc->setContextType(XMLSchemaDescription::CONTEXT_PREPARSE); gramDesc->setLocationHints(sysId); TraverseSchema traverseSchema ( root , fURIStringPool , schemaGrammar , fGrammarResolver , fCachedSchemaInfoList , toCache ? fCachedSchemaInfoList : fSchemaInfoList , this , sysId , fEntityHandler , fErrorReporter , fMemoryManager , grammarFound ); grammar = schemaGrammar; // Reset the now invalid schema roots in the collected // schema info entries. // { RefHash2KeysTableOfEnumerator i ( toCache ? fCachedSchemaInfoList : fSchemaInfoList); while (i.hasMoreElements ()) i.nextElement().resetRoot (); } } if (fValidate) { // validate the Schema scan so far fValidator->setGrammar(grammar); fValidator->preContentValidation(false); } if (toCache) { fGrammarResolver->cacheGrammars(); } if(getPSVIHandler()) fModel = fGrammarResolver->getXSModel(); return grammar; } } return 0; } // --------------------------------------------------------------------------- // SGXMLScanner: Private parsing methods // --------------------------------------------------------------------------- // This method is called to do a raw scan of an attribute value. It does not // do normalization (since we don't know their types yet.) It just scans the // value and does entity expansion. // // End of entity's must be dealt with here. During DTD scan, they can come // from external entities. During content, they can come from any entity. // We just eat the end of entity and continue with our scan until we come // to the closing quote. If an unterminated value causes us to go through // subsequent entities, that will cause errors back in the calling code, // but there's little we can do about it here. bool SGXMLScanner::basicAttrValueScan(const XMLCh* const attrName, XMLBuffer& toFill) { // Reset the target buffer toFill.reset(); // Get the next char which must be a single or double quote XMLCh quoteCh; if (!fReaderMgr.skipIfQuote(quoteCh)) return false; // We have to get the current reader because we have to ignore closing // quotes until we hit the same reader again. const XMLSize_t curReader = fReaderMgr.getCurrentReaderNum(); // Loop until we get the attribute value. Note that we use a double // loop here to avoid the setup/teardown overhead of the exception // handler on every round. while (true) { try { while(true) { XMLCh nextCh = fReaderMgr.getNextChar(); if (nextCh != quoteCh) { if (nextCh != chAmpersand) { if ((nextCh < 0xD800) || (nextCh > 0xDFFF)) { // Its got to at least be a valid XML character if (!fReaderMgr.getCurrentReader()->isXMLChar(nextCh)) { if (nextCh == 0) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); emitError(XMLErrs::InvalidCharacterInAttrValue, attrName, tmpBuf); } } else // its a surrogate { // Deal with surrogate pairs // we expect a a leading surrogate. if (nextCh <= 0xDBFF) { toFill.append(nextCh); // process the trailing surrogate nextCh = fReaderMgr.getNextChar(); // it should be a trailing surrogate. if ((nextCh < 0xDC00) || (nextCh > 0xDFFF)) { emitError(XMLErrs::Expected2ndSurrogateChar); } } else { // Its a trailing surrogate, but we are not expecting it emitError(XMLErrs::Unexpected2ndSurrogateChar); } } } else // its a chAmpersand { // Check for an entity ref . We ignore the empty flag in // this one. bool escaped; XMLCh firstCh; XMLCh secondCh ; // If it was not returned directly, then jump back up if (scanEntityRef(true, firstCh, secondCh, escaped) == EntityExp_Returned) { // If it was escaped, then put in a 0xFFFF value. This will // be used later during validation and normalization of the // value to know that the following character was via an // escape char. if (escaped) toFill.append(0xFFFF); toFill.append(firstCh); if (secondCh) toFill.append(secondCh); } continue; } } else // its a quoteCh { // Check for our ending quote. It has to be in the same entity // as where we started. Quotes in nested entities are ignored. if (curReader == fReaderMgr.getCurrentReaderNum()) { return true; } // Watch for spillover into a previous entity if (curReader > fReaderMgr.getCurrentReaderNum()) { emitError(XMLErrs::PartialMarkupInEntity); return false; } } // add it to the buffer toFill.append(nextCh); } } catch(const EndOfEntityException&) { // Just eat it and continue. } } return true; } // This method scans a CDATA section. It collects the character into one // of the temp buffers and calls the document handler, if any, with the // characters. It assumes that the getCurrentTypeInfo(); if(currType) { SchemaElementDecl::ModelTypes modelType = (SchemaElementDecl::ModelTypes) currType->getContentType(); if(modelType == SchemaElementDecl::Children || modelType == SchemaElementDecl::ElementOnlyEmpty) charOpts = XMLElementDecl::SpacesOk; else if(modelType == SchemaElementDecl::Empty) charOpts = XMLElementDecl::NoCharData; } // should not be necessary when PSVI on element decl removed const ElemStack::StackElem* topElem = fElemStack.topElement(); while (true) { const XMLCh nextCh = fReaderMgr.getNextChar(); // Watch for unexpected end of file if (!nextCh) { emitError(XMLErrs::UnterminatedCDATASection); ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); } if (fValidate && fStandalone && (fReaderMgr.getCurrentReader()->isWhitespace(nextCh))) { // This document is standalone; this ignorable CDATA whitespace is forbidden. // XML 1.0, Section 2.9 // And see if the current element is a 'Children' style content model if (topElem->fThisElement->isExternal()) { if (charOpts == XMLElementDecl::SpacesOk) // Element Content { // Error - standalone should have a value of "no" as whitespace detected in an // element type with element content whose element declaration was external fValidator->emitError(XMLValid::NoWSForStandalone); if (getPSVIHandler()) { // REVISIT: // PSVIElement->setValidity(PSVIItem::VALIDITY_INVALID); } } } } // If this is a close square bracket it could be our closing // sequence. if (nextCh == chCloseSquare && fReaderMgr.skippedString(CDataClose)) { // make sure we were not expecting a trailing surrogate. if (gotLeadingSurrogate) { emitError(XMLErrs::Expected2ndSurrogateChar); } XMLSize_t xsLen = bbCData.getLen(); const XMLCh* xsNormalized = bbCData.getRawBuffer(); if (fValidate) { DatatypeValidator* tempDV = ((SchemaValidator*) fValidator)->getCurrentDatatypeValidator(); if (tempDV && tempDV->getWSFacet() != DatatypeValidator::PRESERVE) { // normalize the character according to schema whitespace facet ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, xsNormalized, fWSNormalizeBuf); xsNormalized = fWSNormalizeBuf.getRawBuffer(); xsLen = fWSNormalizeBuf.getLen(); } // tell the schema validation about the character data for checkContent later ((SchemaValidator*)fValidator)->setDatatypeBuffer(xsNormalized); if (charOpts != XMLElementDecl::AllCharData) { // They definitely cannot handle any type of char data fValidator->emitError(XMLValid::NoCharDataInCM); if (getPSVIHandler()) { // REVISIT: // PSVIElement->setValidity(PSVIItem::VALIDITY_INVALID); } } } // call all active identity constraints if (toCheckIdentityConstraint() && fICHandler->getMatcherCount()) { fContent.append(xsNormalized, xsLen); } // If we have a doc handler, call it if (fDocHandler) { if (fNormalizeData) { fDocHandler->docCharacters(xsNormalized, xsLen, true); } else { fDocHandler->docCharacters( bbCData.getRawBuffer(), bbCData.getLen(), true ); } } // And we are done break; } // Make sure its a valid character. But if we've emitted an error // already, don't bother with the overhead since we've already told // them about it. if (!emittedError) { // Deal with surrogate pairs if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { // Its a leading surrogate. If we already got one, then // issue an error, else set leading flag to make sure that // we look for a trailing next time. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); else gotLeadingSurrogate = true; } else { // If its a trailing surrogate, make sure that we are // prepared for that. Else, its just a regular char so make // sure that we were not expected a trailing surrogate. if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) { // Its trailing, so make sure we were expecting it if (!gotLeadingSurrogate) emitError(XMLErrs::Unexpected2ndSurrogateChar); } else { // Its just a char, so make sure we were not expecting a // trailing surrogate. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); // Its got to at least be a valid XML character else if (!fReaderMgr.getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); emitError(XMLErrs::InvalidCharacter, tmpBuf); emittedError = true; } } gotLeadingSurrogate = false; } } // Add it to the buffer bbCData.append(nextCh); } } void SGXMLScanner::scanCharData(XMLBuffer& toUse) { // We have to watch for the stupid ]]> sequence, which is illegal in // character data. So this is a little state machine that handles that. enum States { State_Waiting , State_GotOne , State_GotTwo }; // Reset the buffer before we start toUse.reset(); // Turn on the 'throw at end' flag of the reader manager ThrowEOEJanitor jan(&fReaderMgr, true); // In order to be more efficient we have to use kind of a deeply nested // set of blocks here. The outer block puts on a try and catches end of // entity exceptions. The inner loop is the per-character loop. If we // put the try inside the inner loop, it would work but would require // the exception handling code setup/teardown code to be invoked for // each character. XMLCh nextCh; XMLCh secondCh = 0; States curState = State_Waiting; bool escaped = false; bool gotLeadingSurrogate = false; bool notDone = true; while (notDone) { try { while (true) { // Eat through as many plain content characters as possible without // needing special handling. Moving most content characters here, // in this one call, rather than running the overall loop once // per content character, is a speed optimization. if (curState == State_Waiting && !gotLeadingSurrogate) { fReaderMgr.movePlainContentChars(toUse); } // Try to get another char from the source // The code from here on down covers all contengencies, if (!fReaderMgr.getNextCharIfNot(chOpenAngle, nextCh)) { // If we were waiting for a trailing surrogate, its an error if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); notDone = false; break; } // Watch for a reference. Note that the escapement mechanism // is ignored in this content. escaped = false; if (nextCh == chAmpersand) { sendCharData(toUse); // Turn off the throwing at the end of entity during this ThrowEOEJanitor jan(&fReaderMgr, false); if (scanEntityRef(false, nextCh, secondCh, escaped) != EntityExp_Returned) { gotLeadingSurrogate = false; continue; } } else if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { // Deal with surrogate pairs // Its a leading surrogate. If we already got one, then // issue an error, else set leading flag to make sure that // we look for a trailing next time. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); else gotLeadingSurrogate = true; } else { // If its a trailing surrogate, make sure that we are // prepared for that. Else, its just a regular char so make // sure that we were not expected a trailing surrogate. if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) { // Its trailing, so make sure we were expecting it if (!gotLeadingSurrogate) emitError(XMLErrs::Unexpected2ndSurrogateChar); } else { // Its just a char, so make sure we were not expecting a // trailing surrogate. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); // Make sure the returned char is a valid XML char if (!fReaderMgr.getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); emitError(XMLErrs::InvalidCharacter, tmpBuf); } } gotLeadingSurrogate = false; } // Keep the state machine up to date if (!escaped) { if (nextCh == chCloseSquare) { if (curState == State_Waiting) curState = State_GotOne; else if (curState == State_GotOne) curState = State_GotTwo; } else if (nextCh == chCloseAngle) { if (curState == State_GotTwo) emitError(XMLErrs::BadSequenceInCharData); curState = State_Waiting; } else { curState = State_Waiting; } } else { curState = State_Waiting; } // Add this char to the buffer toUse.append(nextCh); if (secondCh) { toUse.append(secondCh); secondCh=0; } } } catch(const EndOfEntityException& toCatch) { // Some entity ended, so we have to send any accumulated // chars and send an end of entity event. sendCharData(toUse); gotLeadingSurrogate = false; if (fDocHandler) fDocHandler->endEntityReference(toCatch.getEntity()); } } // Check the validity constraints as per XML 1.0 Section 2.9 if (fValidate && fStandalone) { // See if the text contains whitespace // Get the raw data we need for the callback const XMLCh* rawBuf = toUse.getRawBuffer(); const XMLSize_t len = toUse.getLen(); const bool isSpaces = fReaderMgr.getCurrentReader()->containsWhiteSpace(rawBuf, len); if (isSpaces) { // And see if the current element is a 'Children' style content model const ElemStack::StackElem* topElem = fElemStack.topElement(); if (topElem->fThisElement->isExternal()) { // Get the character data opts for the current element XMLElementDecl::CharDataOpts charOpts = XMLElementDecl::AllCharData; // And see if the current element is a 'Children' style content model ComplexTypeInfo *currType = ((SchemaValidator*)fValidator)->getCurrentTypeInfo(); if(currType) { SchemaElementDecl::ModelTypes modelType = (SchemaElementDecl::ModelTypes) currType->getContentType(); if(modelType == SchemaElementDecl::Children || modelType == SchemaElementDecl::ElementOnlyEmpty) charOpts = XMLElementDecl::SpacesOk; } if (charOpts == XMLElementDecl::SpacesOk) // => Element Content { // Error - standalone should have a value of "no" as whitespace detected in an // element type with element content whose element declaration was external // fValidator->emitError(XMLValid::NoWSForStandalone); if (getPSVIHandler()) { // REVISIT: // PSVIElement->setValidity(PSVIItem::VALIDITY_INVALID); } } } } } // Send any char data that we accumulated into the buffer sendCharData(toUse); } // This method will scan a general/character entity ref. It will either // expand a char ref and return it directly, or push a reader for a general // entity. // // The return value indicates whether the char parameters hold the value // or whether the value was pushed as a reader, or that it failed. // // The escaped flag tells the caller whether the returned parameter resulted // from a character reference, which escapes the character in some cases. It // only makes any difference if the return value indicates the value was // returned directly. SGXMLScanner::EntityExpRes SGXMLScanner::scanEntityRef( const bool , XMLCh& firstCh , XMLCh& secondCh , bool& escaped) { // Assume no escape secondCh = 0; escaped = false; // We have to insure that its all in one entity const XMLSize_t curReader = fReaderMgr.getCurrentReaderNum(); // If the next char is a pound, then its a character reference and we // need to expand it always. if (fReaderMgr.skippedChar(chPound)) { // Its a character reference, so scan it and get back the numeric // value it represents. if (!scanCharRef(firstCh, secondCh)) return EntityExp_Failed; escaped = true; if (curReader != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialMarkupInEntity); return EntityExp_Returned; } // Expand it since its a normal entity ref XMLBufBid bbName(&fBufMgr); int colonPosition; if (!fReaderMgr.getQName(bbName.getBuffer(), &colonPosition)) { if (bbName.isEmpty()) emitError(XMLErrs::ExpectedEntityRefName); else emitError(XMLErrs::InvalidEntityRefName, bbName.getRawBuffer()); return EntityExp_Failed; } // Next char must be a semi-colon. But if its not, just emit // an error and try to continue. if (!fReaderMgr.skippedChar(chSemiColon)) emitError(XMLErrs::UnterminatedEntityRef, bbName.getRawBuffer()); // Make sure we ended up on the same entity reader as the & char if (curReader != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialMarkupInEntity); // Look up the name in the general entity pool // If it does not exist, then obviously an error if (!fEntityTable->containsKey(bbName.getRawBuffer())) { // XML 1.0 Section 4.1 // Well-formedness Constraint for entity not found: // In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, // or a document with "standalone='yes'", for an entity reference that does not occur within the external subset // or a parameter entity if (fStandalone || fHasNoDTD) emitError(XMLErrs::EntityNotFound, bbName.getRawBuffer()); return EntityExp_Failed; } // here's where we need to check if there's a SecurityManager, // how many entity references we've had if(fSecurityManager != 0 && ++fEntityExpansionCount > fEntityExpansionLimit) { XMLCh expLimStr[32]; XMLString::sizeToText(fEntityExpansionLimit, expLimStr, 31, 10, fMemoryManager); emitError ( XMLErrs::EntityExpansionLimitExceeded , expLimStr ); // there seems nothing better to be done than to reset the entity expansion limit fEntityExpansionCount = 0; } firstCh = fEntityTable->get(bbName.getRawBuffer()); escaped = true; return EntityExp_Returned; } bool SGXMLScanner::switchGrammar(const XMLCh* const newGrammarNameSpace) { Grammar* tempGrammar = fGrammarResolver->getGrammar(newGrammarNameSpace); if (!tempGrammar) { tempGrammar = fSchemaGrammar; } if (!tempGrammar) return false; else { fGrammar = tempGrammar; fGrammarType = fGrammar->getGrammarType(); if (fGrammarType == Grammar::DTDGrammarType) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Gen_NoDTDValidator, fMemoryManager); } fValidator->setGrammar(fGrammar); return true; } } // check if we should skip or lax the validation of the element // if skip - no validation // if lax - validate only if the element if found bool SGXMLScanner::laxElementValidation(QName* element, ContentLeafNameTypeVector* cv, const XMLContentModel* const cm, const XMLSize_t parentElemDepth) { bool skipThisOne = false; bool laxThisOne = false; unsigned int elementURI = element->getURI(); unsigned int currState = fElemState[parentElemDepth]; unsigned int currLoop = fElemLoopState[parentElemDepth]; if (currState == XMLContentModel::gInvalidTrans) { return laxThisOne; } SubstitutionGroupComparator comparator(fGrammarResolver, fURIStringPool); if (cv) { XMLSize_t i = 0; XMLSize_t leafCount = cv->getLeafCount(); unsigned int nextState = 0; for (; i < leafCount; i++) { QName* fElemMap = cv->getLeafNameAt(i); unsigned int uri = fElemMap->getURI(); ContentSpecNode::NodeTypes type = cv->getLeafTypeAt(i); if (type == ContentSpecNode::Leaf) { if (((uri == elementURI) && XMLString::equals(fElemMap->getLocalPart(), element->getLocalPart())) || comparator.isEquivalentTo(element, fElemMap)) { nextState = cm->getNextState(currState, i); if (nextState != XMLContentModel::gInvalidTrans) break; } } else if ((type & 0x0f) == ContentSpecNode::Any) { nextState = cm->getNextState(currState, i); if (nextState != XMLContentModel::gInvalidTrans) break; } else if ((type & 0x0f) == ContentSpecNode::Any_Other) { if (uri != elementURI && elementURI != fEmptyNamespaceId) { nextState = cm->getNextState(currState, i); if (nextState != XMLContentModel::gInvalidTrans) break; } } else if ((type & 0x0f) == ContentSpecNode::Any_NS) { if (uri == elementURI) { nextState = cm->getNextState(currState, i); if (nextState != XMLContentModel::gInvalidTrans) break; } } } // for if (i == leafCount) { // no match fElemState[parentElemDepth] = XMLContentModel::gInvalidTrans; fElemLoopState[parentElemDepth] = 0; return laxThisOne; } ContentSpecNode::NodeTypes type = cv->getLeafTypeAt(i); if ((type & 0x0f) == ContentSpecNode::Any || (type & 0x0f) == ContentSpecNode::Any_Other || (type & 0x0f) == ContentSpecNode::Any_NS) { if (type == ContentSpecNode::Any_Skip || type == ContentSpecNode::Any_NS_Skip || type == ContentSpecNode::Any_Other_Skip) { skipThisOne = true; } else if (type == ContentSpecNode::Any_Lax || type == ContentSpecNode::Any_NS_Lax || type == ContentSpecNode::Any_Other_Lax) { laxThisOne = true; } } fElemState[parentElemDepth] = nextState; fElemLoopState[parentElemDepth] = currLoop; } // if if (skipThisOne) { fValidate = false; fElemStack.setValidationFlag(fValidate); } return laxThisOne; } // check if there is an AnyAttribute, and if so, see if we should lax or skip // if skip - no validation // if lax - validate only if the attribute if found bool SGXMLScanner::anyAttributeValidation(SchemaAttDef* attWildCard, unsigned int uriId, bool& skipThisOne, bool& laxThisOne) { XMLAttDef::AttTypes wildCardType = attWildCard->getType(); bool anyEncountered = false; skipThisOne = false; laxThisOne = false; if (wildCardType == XMLAttDef::Any_Any) anyEncountered = true; else if (wildCardType == XMLAttDef::Any_Other) { if (attWildCard->getAttName()->getURI() != uriId && uriId != fEmptyNamespaceId) anyEncountered = true; } else if (wildCardType == XMLAttDef::Any_List) { ValueVectorOf* nameURIList = attWildCard->getNamespaceList(); XMLSize_t listSize = (nameURIList) ? nameURIList->size() : 0; if (listSize) { for (XMLSize_t i=0; i < listSize; i++) { if (nameURIList->elementAt(i) == uriId) anyEncountered = true; } } } if (anyEncountered) { XMLAttDef::DefAttTypes defType = attWildCard->getDefaultType(); if (defType == XMLAttDef::ProcessContents_Skip) { // attribute should just be bypassed, skipThisOne = true; if (getPSVIHandler()) { // REVISIT: // PSVIAttribute->setValidationAttempted(PSVIItem::VALIDATION_NONE); } } else if (defType == XMLAttDef::ProcessContents_Lax) { laxThisOne = true; } } return anyEncountered; } inline XMLAttDefList& getAttDefList(ComplexTypeInfo* currType, XMLElementDecl* elemDecl) { if (currType) return currType->getAttDefList(); else return elemDecl->getAttDefList(); } void SGXMLScanner::endElementPSVI(SchemaElementDecl* const elemDecl, DatatypeValidator* const memberDV) { PSVIElement::ASSESSMENT_TYPE validationAttempted; PSVIElement::VALIDITY_STATE validity = PSVIElement::VALIDITY_NOTKNOWN; if (fPSVIElemContext.fElemDepth > fPSVIElemContext.fFullValidationDepth) validationAttempted = PSVIElement::VALIDATION_FULL; else if (fPSVIElemContext.fElemDepth > fPSVIElemContext.fNoneValidationDepth) validationAttempted = PSVIElement::VALIDATION_NONE; else { validationAttempted = PSVIElement::VALIDATION_PARTIAL; fPSVIElemContext.fFullValidationDepth = fPSVIElemContext.fNoneValidationDepth = fPSVIElemContext.fElemDepth - 1; } if (fValidate && elemDecl->isDeclared()) { validity = (fPSVIElemContext.fErrorOccurred) ? PSVIElement::VALIDITY_INVALID : PSVIElement::VALIDITY_VALID; } XSTypeDefinition* typeDef = 0; bool isMixed = false; if (fPSVIElemContext.fCurrentTypeInfo) { typeDef = (XSTypeDefinition*) fModel->getXSObject(fPSVIElemContext.fCurrentTypeInfo); SchemaElementDecl::ModelTypes modelType = (SchemaElementDecl::ModelTypes)fPSVIElemContext.fCurrentTypeInfo->getContentType(); isMixed = (modelType == SchemaElementDecl::Mixed_Simple || modelType == SchemaElementDecl::Mixed_Complex); } else if (fPSVIElemContext.fCurrentDV) typeDef = (XSTypeDefinition*) fModel->getXSObject(fPSVIElemContext.fCurrentDV); XMLCh* canonicalValue = 0; if (fPSVIElemContext.fNormalizedValue && !isMixed && validity == PSVIElement::VALIDITY_VALID) { if (memberDV) canonicalValue = (XMLCh*) memberDV->getCanonicalRepresentation(fPSVIElemContext.fNormalizedValue, fMemoryManager); else if (fPSVIElemContext.fCurrentDV) canonicalValue = (XMLCh*) fPSVIElemContext.fCurrentDV->getCanonicalRepresentation(fPSVIElemContext.fNormalizedValue, fMemoryManager); } fPSVIElement->reset ( validity , validationAttempted , fRootElemName , fPSVIElemContext.fIsSpecified , (elemDecl->isDeclared()) ? (XSElementDeclaration*) fModel->getXSObject(elemDecl) : 0 , typeDef , (memberDV) ? (XSSimpleTypeDefinition*) fModel->getXSObject(memberDV) : 0 , fModel , elemDecl->getDefaultValue() , fPSVIElemContext.fNormalizedValue , canonicalValue ); fPSVIHandler->handleElementPSVI ( elemDecl->getBaseName() , fURIStringPool->getValueForId(elemDecl->getURI()) , fPSVIElement ); // decrease element depth fPSVIElemContext.fElemDepth--; } void SGXMLScanner::resetPSVIElemContext() { fPSVIElemContext.fIsSpecified = false; fPSVIElemContext.fErrorOccurred = false; fPSVIElemContext.fElemDepth = -1; fPSVIElemContext.fFullValidationDepth = -1; fPSVIElemContext.fNoneValidationDepth = -1; fPSVIElemContext.fCurrentDV = 0; fPSVIElemContext.fCurrentTypeInfo = 0; fPSVIElemContext.fNormalizedValue = 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/IGXMLScanner.hpp000644 000765 000024 00000027356 13241160334 023017 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IGXMLScanner.hpp 882548 2009-11-20 13:44:14Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_IGXMLSCANNER_HPP) #define XERCESC_INCLUDE_GUARD_IGXMLSCANNER_HPP #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class DTDElementDecl; class DTDGrammar; class DTDValidator; class SchemaValidator; class IdentityConstraintHandler; class IdentityConstraint; class ContentLeafNameTypeVector; class SchemaAttDef; class XMLContentModel; class XSModel; class PSVIAttributeList; class PSVIElement; // This is an integrated scanner class, which does DTD/XML Schema grammar // processing. class XMLPARSER_EXPORT IGXMLScanner : public XMLScanner { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- IGXMLScanner ( XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); IGXMLScanner ( XMLDocumentHandler* const docHandler , DocTypeHandler* const docTypeHandler , XMLEntityHandler* const entityHandler , XMLErrorReporter* const errReporter , XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~IGXMLScanner(); // ----------------------------------------------------------------------- // XMLScanner public virtual methods // ----------------------------------------------------------------------- virtual const XMLCh* getName() const; virtual NameIdPool* getEntityDeclPool(); virtual const NameIdPool* getEntityDeclPool() const; virtual void scanDocument ( const InputSource& src ); virtual bool scanNext(XMLPScanToken& toFill); virtual Grammar* loadGrammar ( const InputSource& src , const short grammarType , const bool toCache = false ); virtual void resetCachedGrammar (); virtual Grammar::GrammarType getCurrentGrammarType() const; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- IGXMLScanner(); IGXMLScanner(const IGXMLScanner&); IGXMLScanner& operator=(const IGXMLScanner&); // ----------------------------------------------------------------------- // XMLScanner virtual methods // ----------------------------------------------------------------------- virtual void scanCDSection(); virtual void scanCharData(XMLBuffer& toToUse); virtual EntityExpRes scanEntityRef ( const bool inAttVal , XMLCh& firstCh , XMLCh& secondCh , bool& escaped ); virtual void scanDocTypeDecl(); virtual void scanReset(const InputSource& src); virtual void sendCharData(XMLBuffer& toSend); virtual InputSource* resolveSystemId(const XMLCh* const sysId ,const XMLCh* const pubId); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void commonInit(); void cleanUp(); XMLSize_t buildAttList ( const RefVectorOf& providedAttrs , const XMLSize_t attCount , XMLElementDecl* elemDecl , RefVectorOf& toFill ); bool normalizeAttValue ( const XMLAttDef* const attDef , const XMLCh* const name , const XMLCh* const value , XMLBuffer& toFill ); bool normalizeAttRawValue ( const XMLCh* const attrName , const XMLCh* const value , XMLBuffer& toFill ); void updateNSMap ( const XMLCh* const attrName , const XMLCh* const attrValue ); void updateNSMap ( const XMLCh* const attrName , const XMLCh* const attrValue , const int colonPosition ); void scanRawAttrListforNameSpaces(XMLSize_t attCount); void parseSchemaLocation(const XMLCh* const schemaLocationStr, bool ignoreLoadSchema = false); void resolveSchemaGrammar(const XMLCh* const loc, const XMLCh* const uri, bool ignoreLoadSchema = false); bool switchGrammar(const XMLCh* const newGrammarNameSpace); bool laxElementValidation(QName* element, ContentLeafNameTypeVector* cv, const XMLContentModel* const cm, const XMLSize_t parentElemDepth); bool anyAttributeValidation(SchemaAttDef* attWildCard, unsigned int uriId, bool& skipThisOne, bool& laxThisOne); void resizeElemState(); void processSchemaLocation(XMLCh* const schemaLoc); void resizeRawAttrColonList(); // ----------------------------------------------------------------------- // Private scanning methods // ----------------------------------------------------------------------- bool basicAttrValueScan ( const XMLCh* const attrName , XMLBuffer& toFill ); XMLSize_t rawAttrScan ( const XMLCh* const elemName , RefVectorOf& toFill , bool& isEmpty ); bool scanAttValue ( const XMLAttDef* const attDef , const XMLCh* const attrName , XMLBuffer& toFill ); bool scanContent(); void scanEndTag(bool& gotData); bool scanStartTag(bool& gotData); bool scanStartTagNS(bool& gotData); // ----------------------------------------------------------------------- // IdentityConstraints Activation methods // ----------------------------------------------------------------------- inline bool toCheckIdentityConstraint() const; // ----------------------------------------------------------------------- // Grammar preparsing methods // ----------------------------------------------------------------------- Grammar* loadXMLSchemaGrammar(const InputSource& src, const bool toCache = false); Grammar* loadDTDGrammar(const InputSource& src, const bool toCache = false); // ----------------------------------------------------------------------- // PSVI handling methods // ----------------------------------------------------------------------- void endElementPSVI(SchemaElementDecl* const elemDecl, DatatypeValidator* const memberDV); void resetPSVIElemContext(); // ----------------------------------------------------------------------- // Data members // // fRawAttrList // During the initial scan of the attributes we can only do a raw // scan for key/value pairs. So this vector is used to store them // until they can be processed (and put into fAttrList.) // // fDTDValidator // The DTD validator instance. // // fSchemaValidator // The Schema validator instance. // // fSeeXsi // This flag indicates a schema has been seen. // // fElemState // fElemLoopState // fElemStateSize // Stores an element next state from DFA content model - used for // wildcard validation // // fDTDElemNonDeclPool // registry of "faulted-in" DTD element decls // fSchemaElemNonDeclPool // registry for elements without decls in the grammar // fElemCount // count of the number of start tags seen so far (starts at 1). // Used for duplicate attribute detection/processing of required/defaulted attributes // fAttDefRegistry // mapping from XMLAttDef instances to the count of the last // start tag where they were utilized. // fUndeclaredAttrRegistry // set of attr QNames to detect duplicates // fPSVIAttrList // PSVI attribute list implementation that needs to be // filled when a PSVIHandler is registered // fSchemaInfoList // Transient schema info list that is passed to TraverseSchema instances. // fCachedSchemaInfoList // Cached Schema info list that is passed to TraverseSchema instances. // // ----------------------------------------------------------------------- bool fSeeXsi; Grammar::GrammarType fGrammarType; unsigned int fElemStateSize; unsigned int* fElemState; unsigned int* fElemLoopState; XMLBuffer fContent; RefVectorOf* fRawAttrList; unsigned int fRawAttrColonListSize; int* fRawAttrColonList; DTDValidator* fDTDValidator; SchemaValidator* fSchemaValidator; DTDGrammar* fDTDGrammar; IdentityConstraintHandler* fICHandler; ValueVectorOf* fLocationPairs; NameIdPool* fDTDElemNonDeclPool; RefHash3KeysIdPool* fSchemaElemNonDeclPool; unsigned int fElemCount; RefHashTableOf*fAttDefRegistry; Hash2KeysSetOf* fUndeclaredAttrRegistry; PSVIAttributeList * fPSVIAttrList; XSModel* fModel; PSVIElement* fPSVIElement; ValueStackOf* fErrorStack; PSVIElemContext fPSVIElemContext; RefHash2KeysTableOf* fSchemaInfoList; RefHash2KeysTableOf* fCachedSchemaInfoList; }; inline const XMLCh* IGXMLScanner::getName() const { return XMLUni::fgIGXMLScanner; } inline bool IGXMLScanner::toCheckIdentityConstraint() const { return fValidate && fIdentityConstraintChecking && fICHandler; } inline Grammar::GrammarType IGXMLScanner::getCurrentGrammarType() const { return fGrammarType; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/XProtoType.hpp000644 000765 000024 00000005514 13241160334 022712 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XProtoType.hpp 1798772 2017-06-14 21:32:44Z rleigh $ */ #if !defined(XERCESC_INCLUDE_GUARD_XPROTOTYPE_HPP) #define XERCESC_INCLUDE_GUARD_XPROTOTYPE_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XSerializeEngine; class XSerializable; class XMLUTIL_EXPORT XProtoType { public: void store(XSerializeEngine& serEng) const; static void load(XSerializeEngine& serEng , XMLByte* const name , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); // ------------------------------------------------------------------------------- // data // // fClassName: // name of the XSerializable derivatives // // fCreateObject: // pointer to the factory method (createObject()) // of the XSerializable derivatives // // ------------------------------------------------------------------------------- XMLByte* fClassName; XSerializable* (*fCreateObject)(MemoryManager*); }; #define DECL_XPROTOTYPE(class_name) \ static XProtoType class##class_name; \ static XSerializable* createObject(MemoryManager* manager); /*** * For non-abstract class ***/ #define IMPL_XPROTOTYPE_TOCREATE(class_name) \ IMPL_XPROTOTYPE_INSTANCE(class_name) \ XSerializable* class_name::createObject(MemoryManager* manager) \ {return new (manager) class_name(manager);} /*** * For abstract class ***/ #define IMPL_XPROTOTYPE_NOCREATE(class_name) \ IMPL_XPROTOTYPE_INSTANCE(class_name) \ XSerializable* class_name::createObject(MemoryManager*) \ {return 0;} /*** * Helper Macro ***/ #define XPROTOTYPE_CLASS(class_name) ((XProtoType*)(&class_name::class##class_name)) #define IMPL_XPROTOTYPE_INSTANCE(class_name) \ XProtoType class_name::class##class_name = \ {const_cast(reinterpret_cast(#class_name)), class_name::createObject }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/XSAXMLScanner.cpp000644 000765 000024 00000062413 13241160334 023137 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSAXMLScanner.cpp 833045 2009-11-05 13:21:27Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSAXMLScanner: Constructors and Destructor // --------------------------------------------------------------------------- XSAXMLScanner::XSAXMLScanner( GrammarResolver* const grammarResolver , XMLStringPool* const uriStringPool , SchemaGrammar* const xsaGrammar , MemoryManager* const manager) : SGXMLScanner(0, grammarResolver, manager) { fSchemaGrammar = xsaGrammar; setURIStringPool(uriStringPool); } XSAXMLScanner::~XSAXMLScanner() { } // --------------------------------------------------------------------------- // XSAXMLScanner: SGXMLScanner virtual methods // --------------------------------------------------------------------------- // This method will kick off the scanning of the primary content of the void XSAXMLScanner::scanEndTag(bool& gotData) { // Assume we will still have data until proven otherwise. It will only // ever be false if this is the end of the root element. gotData = true; // Check if the element stack is empty. If so, then this is an unbalanced // element (i.e. more ends than starts, perhaps because of bad text // causing one to be skipped.) if (fElemStack.isEmpty()) { emitError(XMLErrs::MoreEndThanStartTags); fReaderMgr.skipPastChar(chCloseAngle); ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Scan_UnbalancedStartEnd, fMemoryManager); } // Pop the stack of the element we are supposed to be ending. Remember // that we don't own this. The stack just keeps them and reuses them. unsigned int uriId = fElemStack.getCurrentURI(); // Make sure that its the end of the element that we expect const XMLCh *elemName = fElemStack.getCurrentSchemaElemName(); const ElemStack::StackElem* topElem = fElemStack.popTop(); if (!fReaderMgr.skippedStringLong(elemName)) { emitError ( XMLErrs::ExpectedEndOfTagX, elemName ); fReaderMgr.skipPastChar(chCloseAngle); return; } // See if it was the root element, to avoid multiple calls below const bool isRoot = fElemStack.isEmpty(); // Make sure we are back on the same reader as where we started if (topElem->fReaderNum != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialTagMarkupError); // Skip optional whitespace fReaderMgr.skipPastSpaces(); // Make sure we find the closing bracket if (!fReaderMgr.skippedChar(chCloseAngle)) { emitError ( XMLErrs::UnterminatedEndTag, topElem->fThisElement->getFullName() ); } // If validation is enabled, then lets pass him the list of children and // this element and let him validate it. if (fValidate) { XMLSize_t failure; bool res = fValidator->checkContent ( topElem->fThisElement , topElem->fChildren , topElem->fChildCount , &failure ); if (!res) { // One of the elements is not valid for the content. NOTE that // if no children were provided but the content model requires // them, it comes back with a zero value. But we cannot use that // to index the child array in this case, and have to put out a // special message. if (!topElem->fChildCount) { fValidator->emitError ( XMLValid::EmptyNotValidForContent , topElem->fThisElement->getFormattedContentModel() ); } else if (failure >= topElem->fChildCount) { fValidator->emitError ( XMLValid::NotEnoughElemsForCM , topElem->fThisElement->getFormattedContentModel() ); } else { fValidator->emitError ( XMLValid::ElementNotValidForContent , topElem->fChildren[failure]->getRawName() , topElem->fThisElement->getFormattedContentModel() ); } } } // now we can reset the datatype buffer, since the // application has had a chance to copy the characters somewhere else ((SchemaValidator *)fValidator)->clearDatatypeBuffer(); // If we have a doc handler, tell it about the end tag if (fDocHandler) { if (topElem->fPrefixColonPos != -1) fPrefixBuf.set(elemName, topElem->fPrefixColonPos); else fPrefixBuf.reset(); fDocHandler->endElement ( *topElem->fThisElement , uriId , isRoot , fPrefixBuf.getRawBuffer() ); } // If this was the root, then done with content gotData = !isRoot; if (gotData) { // Restore the grammar fGrammar = fElemStack.getCurrentGrammar(); fGrammarType = fGrammar->getGrammarType(); fValidator->setGrammar(fGrammar); // Restore the validation flag fValidate = fElemStack.getValidationFlag(); } } bool XSAXMLScanner::scanStartTag(bool& gotData) { // Assume we will still have data until proven otherwise. It will only // ever be false if this is the root and its empty. gotData = true; // Reset element content fContent.reset(); // The current position is after the open bracket, so we need to read in // in the element name. int prefixColonPos; if (!fReaderMgr.getQName(fQNameBuf, &prefixColonPos)) { if (fQNameBuf.isEmpty()) emitError(XMLErrs::ExpectedElementName); else emitError(XMLErrs::InvalidElementName, fQNameBuf.getRawBuffer()); fReaderMgr.skipToChar(chOpenAngle); return false; } // See if its the root element const bool isRoot = fElemStack.isEmpty(); // Skip any whitespace after the name fReaderMgr.skipPastSpaces(); // First we have to do the rawest attribute scan. We don't do any // normalization of them at all, since we don't know yet what type they // might be (since we need the element decl in order to do that.) const XMLCh* qnameRawBuf = fQNameBuf.getRawBuffer(); bool isEmpty; XMLSize_t attCount = rawAttrScan(qnameRawBuf, *fRawAttrList, isEmpty); // save the contentleafname and currentscope before addlevel, for later use ContentLeafNameTypeVector* cv = 0; XMLContentModel* cm = 0; unsigned int currentScope = Grammar::TOP_LEVEL_SCOPE; bool laxThisOne = false; if (!isRoot) { // schema validator will have correct type if validating SchemaElementDecl* tempElement = (SchemaElementDecl*) fElemStack.topElement()->fThisElement; SchemaElementDecl::ModelTypes modelType = tempElement->getModelType(); ComplexTypeInfo *currType = 0; if (fValidate) { currType = ((SchemaValidator*)fValidator)->getCurrentTypeInfo(); if (currType) modelType = (SchemaElementDecl::ModelTypes)currType->getContentType(); else // something must have gone wrong modelType = SchemaElementDecl::Any; } else { currType = tempElement->getComplexTypeInfo(); } if ((modelType == SchemaElementDecl::Mixed_Simple) || (modelType == SchemaElementDecl::Mixed_Complex) || (modelType == SchemaElementDecl::Children)) { cm = currType->getContentModel(); cv = cm->getContentLeafNameTypeVector(); currentScope = fElemStack.getCurrentScope(); } else if (modelType == SchemaElementDecl::Any) { laxThisOne = true; } } // Now, since we might have to update the namespace map for this element, // but we don't have the element decl yet, we just tell the element stack // to expand up to get ready. XMLSize_t elemDepth = fElemStack.addLevel(); fElemStack.setValidationFlag(fValidate); fElemStack.setPrefixColonPos(prefixColonPos); // Make an initial pass through the list and find any xmlns attributes or // schema attributes. if (attCount) scanRawAttrListforNameSpaces(attCount); // Resolve the qualified name to a URI and name so that we can look up // the element decl for this element. We have now update the prefix to // namespace map so we should get the correct element now. unsigned int uriId = resolveQNameWithColon ( qnameRawBuf, fPrefixBuf, ElemStack::Mode_Element, prefixColonPos ); //if schema, check if we should lax or skip the validation of this element bool parentValidation = fValidate; if (cv) { QName element(fPrefixBuf.getRawBuffer(), &qnameRawBuf[prefixColonPos + 1], uriId, fMemoryManager); // elementDepth will be > 0, as cv is only constructed if element is not // root. laxThisOne = laxElementValidation(&element, cv, cm, elemDepth - 1); } // Look up the element now in the grammar. This will get us back a // generic element decl object. We tell him to fault one in if he does // not find it. bool wasAdded = false; const XMLCh* nameRawBuf = &qnameRawBuf[prefixColonPos + 1]; XMLElementDecl* elemDecl = fGrammar->getElemDecl ( uriId, nameRawBuf, qnameRawBuf, currentScope ); if (!elemDecl) { // URI is different, so we try to switch grammar if (uriId != fURIStringPool->getId(fGrammar->getTargetNamespace())) { switchGrammar(getURIText(uriId), laxThisOne); } // look for a global element declaration elemDecl = fGrammar->getElemDecl( uriId, nameRawBuf, qnameRawBuf, Grammar::TOP_LEVEL_SCOPE ); if (!elemDecl) { // if still not found, look in list of undeclared elements elemDecl = fElemNonDeclPool->getByKey( nameRawBuf, uriId, (int)Grammar::TOP_LEVEL_SCOPE); if (!elemDecl) { elemDecl = new (fMemoryManager) SchemaElementDecl ( fPrefixBuf.getRawBuffer(), nameRawBuf, uriId , SchemaElementDecl::Any, Grammar::TOP_LEVEL_SCOPE , fMemoryManager ); elemDecl->setId (fElemNonDeclPool->put( (void*)elemDecl->getBaseName(), uriId, (int)Grammar::TOP_LEVEL_SCOPE, (SchemaElementDecl*)elemDecl)); wasAdded = true; } } } // We do something different here according to whether we found the // element or not. bool bXsiTypeSet= (fValidator)?((SchemaValidator*)fValidator)->getIsXsiTypeSet():false; if (wasAdded || !elemDecl->isDeclared()) { if (laxThisOne && !bXsiTypeSet) { fValidate = false; fElemStack.setValidationFlag(fValidate); } // If validating then emit an error if (fValidate) { // This is to tell the reuse Validator that this element was // faulted-in, was not an element in the grammar pool originally elemDecl->setCreateReason(XMLElementDecl::JustFaultIn); if(!bXsiTypeSet) fValidator->emitError ( XMLValid::ElementNotDefined, elemDecl->getFullName() ); } } // Now we can update the element stack to set the current element // decl. We expanded the stack above, but couldn't store the element // decl because we didn't know it yet. fElemStack.setElement(elemDecl, fReaderMgr.getCurrentReaderNum()); fElemStack.setCurrentURI(uriId); if (isRoot) { fRootElemName = XMLString::replicate(qnameRawBuf, fMemoryManager); } // Validate the element if (fValidate) { fValidator->validateElement(elemDecl); } // squirrel away the element's QName, so that we can do an efficient // end-tag match fElemStack.setCurrentSchemaElemName(fQNameBuf.getRawBuffer()); ComplexTypeInfo* typeinfo = (fValidate) ? ((SchemaValidator*)fValidator)->getCurrentTypeInfo() : ((SchemaElementDecl*) elemDecl)->getComplexTypeInfo(); if (typeinfo) { currentScope = typeinfo->getScopeDefined(); // switch grammar if the typeinfo has a different grammar XMLCh* typeName = typeinfo->getTypeName(); int comma = XMLString::indexOf(typeName, chComma); if (comma > 0) { XMLBufBid bbPrefix(&fBufMgr); XMLBuffer& prefixBuf = bbPrefix.getBuffer(); prefixBuf.append(typeName, comma); switchGrammar(prefixBuf.getRawBuffer(), laxThisOne); } } fElemStack.setCurrentScope(currentScope); // Set element next state if (elemDepth >= fElemStateSize) { resizeElemState(); } fElemState[elemDepth] = 0; fElemLoopState[elemDepth] = 0; fElemStack.setCurrentGrammar(fGrammar); // If this is the first element and we are validating, check the root // element. if (!isRoot && parentValidation) { fElemStack.addChild(elemDecl->getElementName(), true); } // Now lets get the fAttrList filled in. This involves faulting in any // defaulted and fixed attributes and normalizing the values of any that // we got explicitly. // // We update the attCount value with the total number of attributes, but // it goes in with the number of values we got during the raw scan of // explictly provided attrs above. attCount = buildAttList(*fRawAttrList, attCount, elemDecl, *fAttrList); if(attCount) { // clean up after ourselves: // clear the map used to detect duplicate attributes fUndeclaredAttrRegistry->removeAll(); } // Since the element may have default values, call start tag now regardless if it is empty or not // If we have a document handler, then tell it about this start tag if (fDocHandler) { fDocHandler->startElement ( *elemDecl, uriId, fPrefixBuf.getRawBuffer(), *fAttrList , attCount, false, isRoot ); } // may be where we output something... // If empty, validate content right now if we are validating and then // pop the element stack top. Else, we have to update the current stack // top's namespace mapping elements. if (isEmpty) { // Pop the element stack back off since it'll never be used now fElemStack.popTop(); // If validating, then insure that its legal to have no content if (fValidate) { XMLSize_t failure; bool res = fValidator->checkContent(elemDecl, 0, 0, &failure); if (!res) { // REVISIT: in the case of xsi:type, this may // return the wrong string... fValidator->emitError ( XMLValid::ElementNotValidForContent , elemDecl->getFullName() , elemDecl->getFormattedContentModel() ); } } // If we have a doc handler, tell it about the end tag if (fDocHandler) { fDocHandler->endElement ( *elemDecl, uriId, isRoot, fPrefixBuf.getRawBuffer() ); } // If the elem stack is empty, then it was an empty root if (isRoot) { gotData = false; } else { // Restore the grammar fGrammar = fElemStack.getCurrentGrammar(); fGrammarType = fGrammar->getGrammarType(); fValidator->setGrammar(fGrammar); // Restore the validation flag fValidate = fElemStack.getValidationFlag(); } } return true; } // --------------------------------------------------------------------------- // XSAXMLScanner: XMLScanner virtual methods // --------------------------------------------------------------------------- // This method will reset the scanner data structures, and related plugged // in stuff, for a new scan session. We get the input source for the primary // XML entity, create the reader for it, and push it on the stack so that // upon successful return from here we are ready to go. void XSAXMLScanner::scanReset(const InputSource& src) { fGrammar = fSchemaGrammar; fGrammarType = Grammar::SchemaGrammarType; fRootGrammar = fSchemaGrammar; fValidator->setGrammar(fGrammar); // Reset validation fValidate = true; // And for all installed handlers, send reset events. This gives them // a chance to flush any cached data. if (fDocHandler) fDocHandler->resetDocument(); if (fEntityHandler) fEntityHandler->resetEntities(); if (fErrorReporter) fErrorReporter->resetErrors(); // Clear out the id reference list resetValidationContext(); // Reset the Root Element Name if (fRootElemName) { fMemoryManager->deallocate(fRootElemName);//delete [] fRootElemName; } fRootElemName = 0; // Reset the element stack, and give it the latest ids for the special // URIs it has to know about. fElemStack.reset ( fEmptyNamespaceId, fUnknownNamespaceId, fXMLNamespaceId, fXMLNSNamespaceId ); if (!fSchemaNamespaceId) fSchemaNamespaceId = fURIStringPool->addOrFind(SchemaSymbols::fgURI_XSI); // Reset some status flags fInException = false; fStandalone = false; fErrorCount = 0; fHasNoDTD = true; fSeeXsi = false; fDoNamespaces = true; fDoSchema = true; // Reset the validators fSchemaValidator->reset(); fSchemaValidator->setErrorReporter(fErrorReporter); fSchemaValidator->setExitOnFirstFatal(fExitOnFirstFatal); fSchemaValidator->setGrammarResolver(fGrammarResolver); // Handle the creation of the XML reader object for this input source. // This will provide us with transcoding and basic lexing services. XMLReader* newReader = fReaderMgr.createReader ( src , true , XMLReader::RefFrom_NonLiteral , XMLReader::Type_General , XMLReader::Source_External , fCalculateSrcOfs , fLowWaterMark ); if (!newReader) { if (src.getIssueFatalErrorIfNotFound()) ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Scan_CouldNotOpenSource, src.getSystemId(), fMemoryManager); else ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Scan_CouldNotOpenSource_Warning, src.getSystemId(), fMemoryManager); } // Push this read onto the reader manager fReaderMgr.pushReader(newReader, 0); // and reset security-related things if necessary: if(fSecurityManager != 0) { fEntityExpansionLimit = fSecurityManager->getEntityExpansionLimit(); fEntityExpansionCount = 0; } fElemCount = 0; if (fUIntPoolRowTotal >= 32) { // 8 KB tied up with validating attributes... fAttDefRegistry->removeAll(); recreateUIntPool(); } else { // note that this will implicitly reset the values of the hashtables, // though their buckets will still be tied up resetUIntPool(); } fUndeclaredAttrRegistry->removeAll(); } void XSAXMLScanner::scanRawAttrListforNameSpaces(XMLSize_t attCount) { // Make an initial pass through the list and find any xmlns attributes or // schema attributes. // When we find one, send it off to be used to update the element stack's // namespace mappings. XMLSize_t index = 0; for (index = 0; index < attCount; index++) { // each attribute has the prefix:suffix="value" const KVStringPair* curPair = fRawAttrList->elementAt(index); const XMLCh* rawPtr = curPair->getKey(); // If either the key begins with "xmlns:" or its just plain // "xmlns", then use it to update the map. if (!XMLString::compareNString(rawPtr, XMLUni::fgXMLNSColonString, 6) || XMLString::equals(rawPtr, XMLUni::fgXMLNSString)) { const XMLCh* valuePtr = curPair->getValue(); updateNSMap(rawPtr, valuePtr, fRawAttrColonList[index]); // if the schema URI is seen in the the valuePtr, set the boolean seeXsi if (XMLString::equals(valuePtr, SchemaSymbols::fgURI_XSI)) { fSeeXsi = true; } } } // walk through the list again to deal with "xsi:...." if (fSeeXsi) { // Schema Xsi Type yyyy (e.g. xsi:type="yyyyy") XMLBufBid bbXsi(&fBufMgr); XMLBuffer& fXsiType = bbXsi.getBuffer(); QName attName(fMemoryManager); for (index = 0; index < attCount; index++) { // each attribute has the prefix:suffix="value" const KVStringPair* curPair = fRawAttrList->elementAt(index); const XMLCh* rawPtr = curPair->getKey(); attName.setName(rawPtr, fEmptyNamespaceId); const XMLCh* prefPtr = attName.getPrefix(); // if schema URI has been seen, scan for the schema location and uri // and resolve the schema grammar; or scan for schema type if (resolvePrefix(prefPtr, ElemStack::Mode_Attribute) == fSchemaNamespaceId) { const XMLCh* valuePtr = curPair->getValue(); const XMLCh* suffPtr = attName.getLocalPart(); if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_TYPE)) { // normalize the attribute according to schema whitespace facet DatatypeValidator* tempDV = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_QNAME); ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, valuePtr, fXsiType, true); } else if (XMLString::equals(suffPtr, SchemaSymbols::fgATT_NILL)) { // normalize the attribute according to schema whitespace facet XMLBuffer& fXsiNil = fBufMgr.bidOnBuffer(); DatatypeValidator* tempDV = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_BOOLEAN); ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, valuePtr, fXsiNil, true); if(XMLString::equals(fXsiNil.getRawBuffer(), SchemaSymbols::fgATTVAL_TRUE)) ((SchemaValidator*)fValidator)->setNillable(true); else if(XMLString::equals(fXsiNil.getRawBuffer(), SchemaSymbols::fgATTVAL_FALSE)) ((SchemaValidator*)fValidator)->setNillable(false); else emitError(XMLErrs::InvalidAttValue, fXsiNil.getRawBuffer(), valuePtr); fBufMgr.releaseBuffer(fXsiNil); } } } if (!fXsiType.isEmpty()) { int colonPos = -1; unsigned int uriId = resolveQName ( fXsiType.getRawBuffer(), fPrefixBuf, ElemStack::Mode_Element, colonPos ); ((SchemaValidator*)fValidator)->setXsiType(fPrefixBuf.getRawBuffer(), fXsiType.getRawBuffer() + colonPos + 1, uriId); } } } void XSAXMLScanner::switchGrammar( const XMLCh* const uriStr , bool laxValidate) { Grammar* tempGrammar = 0; if (XMLString::equals(uriStr, SchemaSymbols::fgURI_SCHEMAFORSCHEMA)) { tempGrammar = fSchemaGrammar; } else { tempGrammar = fGrammarResolver->getGrammar(uriStr); } if (tempGrammar && tempGrammar->getGrammarType() == Grammar::SchemaGrammarType) { fGrammar = tempGrammar; fGrammarType = Grammar::SchemaGrammarType; fValidator->setGrammar(fGrammar); } else if(!laxValidate) { fValidator->emitError(XMLValid::GrammarNotFound, uriStr); } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/ReaderMgr.cpp000644 000765 000024 00000103136 13241160334 022457 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ReaderMgr.cpp 1137953 2011-06-21 10:52:28Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // ReaderMgr: Constructors and Destructor // --------------------------------------------------------------------------- ReaderMgr::ReaderMgr(MemoryManager* const manager) : fCurEntity(0) , fCurReader(0) , fEntityHandler(0) , fEntityStack(0) , fNextReaderNum(1) , fReaderStack(0) , fThrowEOE(false) , fXMLVersion(XMLReader::XMLV1_0) , fStandardUriConformant(false) , fMemoryManager(manager) { } ReaderMgr::~ReaderMgr() { // // Clean up the reader and entity stacks. Note that we don't own the // entities, so we don't delete the current entity (and the entity stack // does not own its elements either, so deleting it will not delete the // entities it still references!) // delete fCurReader; delete fReaderStack; delete fEntityStack; } // --------------------------------------------------------------------------- // ReaderMgr: Getter methods // --------------------------------------------------------------------------- bool ReaderMgr::isEmpty() const { return fReaderStack->empty(); } // --------------------------------------------------------------------------- // ReaderMgr: Scanning APIs // --------------------------------------------------------------------------- XMLCh ReaderMgr::getNextChar() { XMLCh chRet; if (fCurReader->getNextChar(chRet)) return chRet; // // Didn't get anything back so this reader is hosed. So lets move to // the next reader on the stack. If this fails, it will be because // its the end of the original file, and we just return zero. // // If its the end of an entity and fThrowEOE is set, it will throw out // of here. Otherwise, it will take us down to the next reader and // we'll have more chars. // if (!popReader()) return XMLCh(0); // Else try again and return the new character fCurReader->getNextChar(chRet); return chRet; } void ReaderMgr::getSpaces(XMLBuffer& toFill) { // Reset the buffer before we start toFill.reset(); // // Get all the spaces from the current reader. If it returns true, // it hit a non-space and we are done. Else we have to pop a reader // and keep going. // while (!fCurReader->getSpaces(toFill)) { // We wore that one out, so lets pop a reader and try again if (!popReader()) break; } } void ReaderMgr::getUpToCharOrWS(XMLBuffer& toFill, const XMLCh toCheck) { // Reset the target buffer before we start toFill.reset(); // // Ok, enter a loop where we ask the current reader to get chars until // it meets the criteria. It returns false if it came back due to eating // up all of its data. Else it returned because something matched, and // we are done. // while (!fCurReader->getUpToCharOrWS(toFill, toCheck)) { // We ate that one up, lets try to pop another. If not, break out if (!popReader()) break; } } XMLCh ReaderMgr::peekNextChar() { XMLCh chRet; if (fCurReader->peekNextChar(chRet)) return chRet; // // Didn't get anything back so this reader is hosed. So lets move to // the next reader on the stack. If this fails, it will be because // its the end of the original file, and we just return zero. // if (!popReader()) return XMLCh(0); // Else peek again and return the character fCurReader->peekNextChar(chRet); return chRet; } bool ReaderMgr::skippedChar(const XMLCh toCheck) { while (true) { // If we get it, then just return true now if (fCurReader->skippedChar(toCheck)) return true; // // Check to see if we hit end of input on this reader. If so, then // lets pop and try again. Else, we failed. If we cannot pop another // then we failed. // if (!fCurReader->getNoMoreFlag()) break; if (!popReader()) break; } return false; } bool ReaderMgr::skippedSpace() { while (true) { // If we get it, then just return true now if (fCurReader->skippedSpace()) return true; // // Check to see if we hit end of input on this reader. If so, then // lets pop and try again. Else, we failed. If we cannot pop another // then we failed. // if (!fCurReader->getNoMoreFlag()) break; if (!popReader()) break; } return false; } bool ReaderMgr::skipIfQuote(XMLCh& chGotten) { while (true) { // If we get it, then just return true now if (fCurReader->skipIfQuote(chGotten)) return true; // // Check to see if we hit end of input on this reader. If so, then // lets pop and try again. Else, we failed. If we cannot pop another // then we failed. // if (!fCurReader->getNoMoreFlag()) break; if (!popReader()) break; } return false; } void ReaderMgr::skipPastSpaces(bool& skippedSomething, bool inDecl /* = false */) { // we rely on the fact that fCurReader->skipSpaces will NOT reset the flag to false, but only // set it to true if a space is found skippedSomething = false; // // Skip all the spaces in the current reader. If it returned because // it hit a non-space, break out. Else we have to pop another entity // and keep going. // while (!fCurReader->skipSpaces(skippedSomething, inDecl)) { // Try to pop another entity. If we can't then we are done if (!popReader()) break; } } void ReaderMgr::skipPastSpaces() { // we are not using it, so we don't care to initialize it bool tmpFlag; // // Skip all the spaces in the current reader. If it returned because // it hit a non-space, break out. Else we have to pop another entity // and keep going. // while (!fCurReader->skipSpaces(tmpFlag, false)) { // Try to pop another entity. If we can't then we are done if (!popReader()) break; } } void ReaderMgr::skipQuotedString(const XMLCh quoteCh) { XMLCh nextCh; // If we get an end of file char, then return while ((nextCh = getNextChar())!=0) { // If we get the quote char, then break out if (nextCh == quoteCh) break; } } XMLCh ReaderMgr::skipUntilIn(const XMLCh* const listToSkip) { XMLCh nextCh; // If we get an end of file char, then return while ((nextCh = peekNextChar())!=0) { if (XMLString::indexOf(listToSkip, nextCh) != -1) break; // Its one of ours so eat it getNextChar(); } return nextCh; } XMLCh ReaderMgr::skipUntilInOrWS(const XMLCh* const listToSkip) { XMLCh nextCh; // If we get an end of file char, then return while ((nextCh = peekNextChar())!=0) { if (fCurReader->isWhitespace(nextCh)) break; if (XMLString::indexOf(listToSkip, nextCh) != -1) break; // Its one of ours, so eat it getNextChar(); } return nextCh; } // --------------------------------------------------------------------------- // ReaderMgr: Control methods // --------------------------------------------------------------------------- // // If the reader stack is empty, then there is only the original main XML // entity left. If its empty, then we have no more input. // bool ReaderMgr::atEOF() const { return fReaderStack->empty() && fCurReader->getNoMoreFlag(); } // // This method is called in the case of errors to clean up the stack when // entities have been incorrectly left on the stack due to syntax errors. // It just cleans back the stack, and sends no entity events. // void ReaderMgr::cleanStackBackTo(const XMLSize_t readerNum) { // // Just start popping readers until we find the one with the indicated // reader number. // while (true) { if (fCurReader->getReaderNum() == readerNum) break; if (fReaderStack->empty()) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::RdrMgr_ReaderIdNotFound, fMemoryManager); delete fCurReader; fCurReader = fReaderStack->pop(); fCurEntity = fEntityStack->pop(); } } XMLReader* ReaderMgr::createReader( const InputSource& src , const bool , const XMLReader::RefFrom refFrom , const XMLReader::Types type , const XMLReader::Sources source , const bool calcSrcOfs , XMLSize_t lowWaterMark) { // // Ask the input source to create us an input stream. The particular // type of input source will know what kind to create. // BinInputStream* newStream = src.makeStream(); if (!newStream) return 0; Janitor streamJanitor(newStream); // // Create a new reader and return it. If the source has an encoding that // it wants to force, then we call the constructor that does that. // Otherwise, we just call the one that provides the provisional encoding // to be possibly updated later by the encoding="" setting. // XMLReader* retVal = 0; // XMLReader ctor invokes refreshRawBuffer() which calls // newStream->readBytes(). // This readBytes() may throw exception, which neither // refresRawBuffer(), nor XMLReader ctor catches. // We need to handle this exception to avoid leak on newStream. try { const XMLCh* encoding = src.getEncoding(); if(encoding == 0) encoding = newStream->getEncoding(); if (encoding) { retVal = new (fMemoryManager) XMLReader ( src.getPublicId() , src.getSystemId() , newStream , encoding , refFrom , type , source , false , calcSrcOfs , lowWaterMark , fXMLVersion , fMemoryManager ); } else { retVal = new (fMemoryManager) XMLReader ( src.getPublicId() , src.getSystemId() , newStream , refFrom , type , source , false , calcSrcOfs , lowWaterMark , fXMLVersion , fMemoryManager ); } } catch(const OutOfMemoryException&) { streamJanitor.release(); throw; } assert(retVal); streamJanitor.release(); // Set the next available reader number on this reader retVal->setReaderNum(fNextReaderNum++); return retVal; } XMLReader* ReaderMgr::createReader( const XMLCh* const sysId , const XMLCh* const pubId , const bool xmlDecl , const XMLReader::RefFrom refFrom , const XMLReader::Types type , const XMLReader::Sources source , InputSource*& srcToFill , const bool calcSrcOfs , XMLSize_t lowWaterMark , const bool disableDefaultEntityResolution) { //Normalize sysId XMLBuffer normalizedSysId(1023, fMemoryManager); if(sysId) XMLString::removeChar(sysId, 0xFFFF, normalizedSysId); const XMLCh* normalizedURI = normalizedSysId.getRawBuffer(); // Create a buffer for expanding the system id XMLBuffer expSysId(1023, fMemoryManager); // // Allow the entity handler to expand the system id if they choose // to do so. // if (fEntityHandler) { if (!fEntityHandler->expandSystemId(normalizedURI, expSysId)) expSysId.set(normalizedURI); } else { expSysId.set(normalizedURI); } // Call the entity resolver interface to get an input source srcToFill = 0; if (fEntityHandler) { LastExtEntityInfo lastInfo; getLastExtEntityInfo(lastInfo); XMLResourceIdentifier resourceIdentifier(XMLResourceIdentifier::ExternalEntity, expSysId.getRawBuffer(), XMLUni::fgZeroLenString, pubId, lastInfo.systemId, this); srcToFill = fEntityHandler->resolveEntity(&resourceIdentifier); } // // If they didn't create a source via the entity resolver, then we // have to create one on our own. // if (!srcToFill) { if (disableDefaultEntityResolution) return 0; LastExtEntityInfo lastInfo; getLastExtEntityInfo(lastInfo); // Keep this #if 0 block as it was exposing a threading problem on AIX. // Got rid of the problem by changing XMLURL to not throw malformedurl // exceptions. #if 0 try { XMLURL urlTmp(lastInfo.systemId, expSysId.getRawBuffer(), fMemoryManager); if (urlTmp.isRelative()) { ThrowXMLwithMemMgr ( MalformedURLException , XMLExcepts::URL_NoProtocolPresent , fMemoryManager ); } else { if (fStandardUriConformant && urlTmp.hasInvalidChar()) ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_MalformedURL, fMemoryManager); srcToFill = new (fMemoryManager) URLInputSource(urlTmp, fMemoryManager); } } catch(const MalformedURLException& e) { // Its not a URL, so lets assume its a local file name if non-standard uri is allowed if (!fStandardUriConformant) srcToFill = new (fMemoryManager) LocalFileInputSource ( lastInfo.systemId , expSysId.getRawBuffer() , fMemoryManager ); else throw e; } #else XMLURL urlTmp(fMemoryManager); if ((!urlTmp.setURL(lastInfo.systemId, expSysId.getRawBuffer(), urlTmp)) || (urlTmp.isRelative())) { if (!fStandardUriConformant) { XMLBuffer resolvedSysId(1023, fMemoryManager); XMLUri::normalizeURI(expSysId.getRawBuffer(), resolvedSysId); srcToFill = new (fMemoryManager) LocalFileInputSource ( lastInfo.systemId , resolvedSysId.getRawBuffer() , fMemoryManager ); } else ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_MalformedURL, fMemoryManager); } else { if (fStandardUriConformant && urlTmp.hasInvalidChar()) ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_MalformedURL, fMemoryManager); srcToFill = new (fMemoryManager) URLInputSource(urlTmp, fMemoryManager); } #endif } // Put a janitor on the input source Janitor janSrc(srcToFill); // // Now call the other version with the input source that we have, and // return the resulting reader. // XMLReader* retVal = createReader ( *srcToFill , xmlDecl , refFrom , type , source , calcSrcOfs , lowWaterMark ); // Either way, we can release the input source now janSrc.orphan(); // If it failed for any reason, then return zero. if (!retVal) return 0; // Give this reader the next available reader number and return it retVal->setReaderNum(fNextReaderNum++); return retVal; } XMLReader* ReaderMgr::createReader( const XMLCh* const baseURI , const XMLCh* const sysId , const XMLCh* const pubId , const bool xmlDecl , const XMLReader::RefFrom refFrom , const XMLReader::Types type , const XMLReader::Sources source , InputSource*& srcToFill , const bool calcSrcOfs , XMLSize_t lowWaterMark , const bool disableDefaultEntityResolution) { //Normalize sysId XMLBuffer normalizedSysId(1023, fMemoryManager); XMLString::removeChar(sysId, 0xFFFF, normalizedSysId); const XMLCh* normalizedURI = normalizedSysId.getRawBuffer(); // Create a buffer for expanding the system id XMLBuffer expSysId(1023, fMemoryManager); // // Allow the entity handler to expand the system id if they choose // to do so. // if (fEntityHandler) { if (!fEntityHandler->expandSystemId(normalizedURI, expSysId)) expSysId.set(normalizedURI); } else { expSysId.set(normalizedURI); } // Call the entity resolver interface to get an input source srcToFill = 0; if (fEntityHandler) { XMLResourceIdentifier resourceIdentifier(XMLResourceIdentifier::ExternalEntity, expSysId.getRawBuffer(), XMLUni::fgZeroLenString, pubId, baseURI, this); srcToFill = fEntityHandler->resolveEntity(&resourceIdentifier); } // // If they didn't create a source via the entity resolver, then we // have to create one on our own. // if (!srcToFill) { if (disableDefaultEntityResolution) return 0; LastExtEntityInfo lastInfo; const XMLCh* baseuri=baseURI; if(!baseuri || !*baseuri) { getLastExtEntityInfo(lastInfo); baseuri = lastInfo.systemId; } XMLURL urlTmp(fMemoryManager); if ((!urlTmp.setURL(baseuri, expSysId.getRawBuffer(), urlTmp)) || (urlTmp.isRelative())) { if (!fStandardUriConformant) { XMLBuffer resolvedSysId(1023, fMemoryManager); XMLUri::normalizeURI(expSysId.getRawBuffer(), resolvedSysId); srcToFill = new (fMemoryManager) LocalFileInputSource ( baseuri , resolvedSysId.getRawBuffer() , fMemoryManager ); } else ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_MalformedURL, fMemoryManager); } else { if (fStandardUriConformant && urlTmp.hasInvalidChar()) ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_MalformedURL, fMemoryManager); srcToFill = new (fMemoryManager) URLInputSource(urlTmp, fMemoryManager); } } // Put a janitor on the input source Janitor janSrc(srcToFill); // // Now call the other version with the input source that we have, and // return the resulting reader. // XMLReader* retVal = createReader ( *srcToFill , xmlDecl , refFrom , type , source , calcSrcOfs , lowWaterMark ); // Either way, we can release the input source now janSrc.orphan(); // If it failed for any reason, then return zero. if (!retVal) return 0; // Give this reader the next available reader number and return it retVal->setReaderNum(fNextReaderNum++); return retVal; } XMLReader* ReaderMgr::createIntEntReader( const XMLCh* const sysId , const XMLReader::RefFrom refFrom , const XMLReader::Types type , const XMLCh* const dataBuf , const XMLSize_t dataLen , const bool copyBuf , const bool calcSrcOfs , XMLSize_t lowWaterMark) { // // This one is easy, we just create an input stream for the data and // provide a few extra goodies. // // NOTE: We use a special encoding string that will be recognized // as a 'do nothing' transcoder for the already internalized XMLCh // data that makes up an internal entity. // BinMemInputStream* newStream = new (fMemoryManager) BinMemInputStream ( (const XMLByte*)dataBuf , dataLen * sizeof(XMLCh) , copyBuf ? BinMemInputStream::BufOpt_Copy : BinMemInputStream::BufOpt_Reference , fMemoryManager ); if (!newStream) return 0; XMLReader* retVal = new (fMemoryManager) XMLReader ( sysId , 0 , newStream , XMLRecognizer::XERCES_XMLCH , refFrom , type , XMLReader::Source_Internal , false , calcSrcOfs , lowWaterMark , fXMLVersion , fMemoryManager ); // If it failed for any reason, then return zero. if (!retVal) { delete newStream; return 0; } // Set the reader number to the next available number retVal->setReaderNum(fNextReaderNum++); return retVal; } const XMLCh* ReaderMgr::getCurrentEncodingStr() const { const XMLEntityDecl* theEntity; const XMLReader* theReader = getLastExtEntity(theEntity); return theReader->getEncodingStr(); } const XMLEntityDecl* ReaderMgr::getCurrentEntity() const { return fCurEntity; } XMLEntityDecl* ReaderMgr::getCurrentEntity() { return fCurEntity; } XMLSize_t ReaderMgr::getReaderDepth() const { // If the stack doesn't exist, its obviously zero if (!fEntityStack) return 0; // // The return is the stack size, plus one if there is a current // reader. So if there is no current reader and none on the stack, // its zero, else its some non-zero value. // XMLSize_t retVal = fEntityStack->size(); if (fCurReader) retVal++; return retVal; } void ReaderMgr::getLastExtEntityInfo(LastExtEntityInfo& lastInfo) const { // // If the reader stack never got created or we've not managed to open any // main entity yet, then we can't give this information. // if (!fReaderStack || !fCurReader) { lastInfo.systemId = XMLUni::fgZeroLenString; lastInfo.publicId = XMLUni::fgZeroLenString; lastInfo.lineNumber = 0; lastInfo.colNumber = 0; return; } // We have at least one entity so get the data const XMLEntityDecl* theEntity; const XMLReader* theReader = getLastExtEntity(theEntity); // Fill in the info structure with the reader we found lastInfo.systemId = theReader->getSystemId(); lastInfo.publicId = theReader->getPublicId(); lastInfo.lineNumber = theReader->getLineNumber(); lastInfo.colNumber = theReader->getColumnNumber(); } bool ReaderMgr::isScanningPERefOutOfLiteral() const { // If the current reader is not for an entity, then definitely not if (!fCurEntity) return false; // // If this is a PE entity, and its not being expanded in a literal // then its true. // if ((fCurReader->getType() == XMLReader::Type_PE) && (fCurReader->getRefFrom() == XMLReader::RefFrom_NonLiteral)) { return true; } return false; } bool ReaderMgr::pushReader( XMLReader* const reader , XMLEntityDecl* const entity) { // // First, if an entity was passed, we have to confirm that this entity // is not already on the entity stack. If so, then this is a recursive // entity expansion, so we issue an error and refuse to put the reader // on the stack. // // If there is no entity passed, then its not an entity being pushed, so // nothing to do. If there is no entity stack yet, then of coures it // cannot already be there. // if (entity && fEntityStack) { const XMLSize_t count = fEntityStack->size(); const XMLCh* const theName = entity->getName(); for (XMLSize_t index = 0; index < count; index++) { const XMLEntityDecl* curDecl = fEntityStack->elementAt(index); if (curDecl) { if (XMLString::equals(theName, curDecl->getName())) { // Oops, already there so delete reader and return delete reader; return false; } } } } // // Fault in the reader stack. Give it an initial capacity of 16, and // tell it it does own its elements. // if (!fReaderStack) fReaderStack = new (fMemoryManager) RefStackOf(16, true, fMemoryManager); // And the entity stack, which does not own its elements if (!fEntityStack) fEntityStack = new (fMemoryManager) RefStackOf(16, false, fMemoryManager); // // Push the current reader and entity onto their respective stacks. // Note that the the current entity can be null if the current reader // is not for an entity. // if (fCurReader) { fReaderStack->push(fCurReader); fEntityStack->push(fCurEntity); } // // Make the passed reader and entity the current top of stack. The // passed entity can (and often is) null. // fCurReader = reader; fCurEntity = entity; return true; } void ReaderMgr::reset() { // Reset all of the flags fThrowEOE = false; // Delete the current reader and flush the reader stack delete fCurReader; fCurReader = 0; if (fReaderStack) fReaderStack->removeAllElements(); // // And do the same for the entity stack, but don't delete the current // entity (if any) since we don't own them. // fCurEntity = 0; if (fEntityStack) fEntityStack->removeAllElements(); } // --------------------------------------------------------------------------- // ReaderMgr: Implement the SAX Locator interface // --------------------------------------------------------------------------- const XMLCh* ReaderMgr::getPublicId() const { if (!fReaderStack && !fCurReader) return XMLUni::fgZeroLenString; const XMLEntityDecl* theEntity; return getLastExtEntity(theEntity)->getPublicId(); } const XMLCh* ReaderMgr::getSystemId() const { if (!fReaderStack && !fCurReader) return XMLUni::fgZeroLenString; const XMLEntityDecl* theEntity; return getLastExtEntity(theEntity)->getSystemId(); } XMLFileLoc ReaderMgr::getColumnNumber() const { if (!fReaderStack && !fCurReader) return 0; const XMLEntityDecl* theEntity; return getLastExtEntity(theEntity)->getColumnNumber(); } XMLFileLoc ReaderMgr::getLineNumber() const { if (!fReaderStack && !fCurReader) return 0; const XMLEntityDecl* theEntity; return getLastExtEntity(theEntity)->getLineNumber(); } // --------------------------------------------------------------------------- // ReaderMgr: Private helper methods // --------------------------------------------------------------------------- const XMLReader* ReaderMgr::getLastExtEntity(const XMLEntityDecl*& itsEntity) const { // // Scan down the reader stack until we find a reader for an entity that // is external. First check that there is anything in the stack at all, // in which case the current reader is the main file and that's the one // that we want. // const XMLReader* theReader = fCurReader; // // If there is a current entity and it is not an external entity, then // search the stack; else, keep the reader that we've got since its // either an external entity reader or the main file reader. // const XMLEntityDecl* curEntity = fCurEntity; if (curEntity && !curEntity->isExternal()) { XMLSize_t index = fReaderStack->size(); if (index) { while (true) { // Move down to the previous element and get a pointer to it index--; curEntity = fEntityStack->elementAt(index); // // If its null or its an external entity, then this reader // is what we want, so break out with that one. // if (!curEntity) { theReader = fReaderStack->elementAt(index); break; } else if (curEntity->isExternal()) { theReader = fReaderStack->elementAt(index); break; } // We hit the end, so leave the main file reader as the one if (!index) break; } } } itsEntity = curEntity; return theReader; } bool ReaderMgr::popReader() { // // We didn't get any more, so try to pop off a reader. If the reader // stack is empty, then we are at the end, so return false. // if (fReaderStack->empty()) return false; // // Remember the current entity, before we pop off a new one. We might // need this to throw the end of entity exception at the end. // XMLEntityDecl* prevEntity = fCurEntity; const bool prevReaderThrowAtEnd = fCurReader->getThrowAtEnd(); const XMLSize_t readerNum = fCurReader->getReaderNum(); // // Delete the current reader and pop a new reader and entity off // the stacks. // delete fCurReader; fCurReader = fReaderStack->pop(); fCurEntity = fEntityStack->pop(); // // If there was a previous entity, and either the fThrowEOE flag is set // or reader was marked as such, then throw an end of entity. // if (prevEntity && (fThrowEOE || prevReaderThrowAtEnd)) throw EndOfEntityException(prevEntity, readerNum); while (true) { // // They don't want us to throw, so lets just return with a new // reader. Here we have to do a loop because we might have multiple // readers on these stack that are empty (i.e. the last char in them // was the ';' at the end of the entity ref that caused the next // entity to be pushed. // // So we loop until we find a non-empty reader, or hit the main // file entity. If we find one with some chars available, then break // out and take that one. // if (fCurReader->charsLeftInBuffer()) break; fCurReader->refreshCharBuffer(); if (fCurReader->charsLeftInBuffer()) break; // // The current one is hosed. So, if the reader stack is empty we // are dead meat and can give up now. // if (fReaderStack->empty()) return false; // Else pop again and try it one more time delete fCurReader; fCurReader = fReaderStack->pop(); fCurEntity = fEntityStack->pop(); } return true; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/IGXMLScanner2.cpp000644 000765 000024 00000426343 13241160334 023073 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IGXMLScanner2.cpp 1799520 2017-06-21 21:34:26Z scantor $ */ // --------------------------------------------------------------------------- // This file holds some of the grunt work methods of IGXMLScanner.cpp to keep // it a little more readable. // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN inline XMLAttDefList& getAttDefList(bool isSchemaGrammar , ComplexTypeInfo* currType , XMLElementDecl* elemDecl); // --------------------------------------------------------------------------- // IGXMLScanner: Private helper methods // --------------------------------------------------------------------------- // This method is called from scanStartTagNS() to build up the list of // XMLAttr objects that will be passed out in the start tag callout. We // get the key/value pairs from the raw scan of explicitly provided attrs, // which have not been normalized. And we get the element declaration from // which we will get any defaulted or fixed attribute defs and add those // in as well. XMLSize_t IGXMLScanner::buildAttList(const RefVectorOf& providedAttrs , const XMLSize_t attCount , XMLElementDecl* elemDecl , RefVectorOf& toFill) { // If doing DTD's, Ask the element to clear the 'provided' flag on all of the att defs // that it owns, and to return us a boolean indicating whether it has // any defs. If schemas are being validated, the complexType // at the top of the SchemaValidator's stack will // know what's best. REVISIT: don't modify grammar at all; eliminate // this step... ComplexTypeInfo *currType = 0; DatatypeValidator *currDV = 0; if(fGrammar->getGrammarType() == Grammar::SchemaGrammarType && fValidate) { currType = ((SchemaValidator*)fValidator)->getCurrentTypeInfo(); if (!currType) { currDV = ((SchemaValidator*)fValidator)->getCurrentDatatypeValidator(); } } const bool hasDefs = (currType && fValidate) ? currType->hasAttDefs() : elemDecl->hasAttDefs(); // another set of attributes; increment element counter fElemCount++; // If there are no expliclitily provided attributes and there are no // defined attributes for the element, the we don't have anything to do. // So just return zero in this case. if (!hasDefs && !attCount) return 0; // Keep up with how many attrs we end up with total XMLSize_t retCount = 0; // And get the current size of the output vector. This lets us use // existing elements until we fill it, then start adding new ones. const XMLSize_t curAttListSize = toFill.size(); // We need a buffer into which raw scanned attribute values will be // normalized. XMLBufBid bbNormal(&fBufMgr); XMLBuffer& normBuf = bbNormal.getBuffer(); // // Decide if to use hash table to do duplicate checking // bool toUseHashTable = false; if (fGrammarType == Grammar::DTDGrammarType) { setAttrDupChkRegistry(attCount, toUseHashTable); } XMLBufBid bbPrefix(&fBufMgr); XMLBuffer& prefixBuf = bbPrefix.getBuffer(); // Loop through our explicitly provided attributes, which are in the raw // scanned form, and build up XMLAttr objects. XMLSize_t index; const XMLCh* prefPtr, *suffPtr; for (index = 0; index < attCount; index++) { PSVIItem::VALIDITY_STATE attrValid = PSVIItem::VALIDITY_VALID; PSVIItem::ASSESSMENT_TYPE attrAssessed = PSVIItem::VALIDATION_FULL; const KVStringPair* curPair = providedAttrs.elementAt(index); // We have to split the name into its prefix and name parts. Then // we map the prefix to its URI. const XMLCh* const namePtr = curPair->getKey(); const int colonInd = fRawAttrColonList[index]; unsigned int uriId; if (colonInd != -1) { prefixBuf.set(namePtr, colonInd); prefPtr = prefixBuf.getRawBuffer(); suffPtr = namePtr + colonInd + 1; // Map the prefix to a URI id uriId = resolvePrefix(prefPtr, ElemStack::Mode_Attribute); } else { // No colon, so we just have a name with no prefix prefPtr = XMLUni::fgZeroLenString; suffPtr = namePtr; // an empty prefix is always the empty namespace, when dealing with attributes uriId = fEmptyNamespaceId; } // If the uri comes back as the xmlns or xml URI or its just a name // and that name is 'xmlns', then we handle it specially. So set a // boolean flag that lets us quickly below know which we are dealing // with. const bool isNSAttr = (uriId == fEmptyNamespaceId)? XMLString::equals(suffPtr, XMLUni::fgXMLNSString) : (uriId == fXMLNSNamespaceId || XMLString::equals(getURIText(uriId), SchemaSymbols::fgURI_XSI)); // If its not a special case namespace attr of some sort, then we // do normal checking and processing. XMLAttDef::AttTypes attType = XMLAttDef::CData; DatatypeValidator *attrValidator = 0; PSVIAttribute *psviAttr = 0; bool otherXSI = false; if (isNSAttr && fGrammarType == Grammar::SchemaGrammarType) { if(!fUndeclaredAttrRegistry->putIfNotPresent(suffPtr, uriId)) { emitError ( XMLErrs::AttrAlreadyUsedInSTag , namePtr , elemDecl->getFullName() ); fPSVIElemContext.fErrorOccurred = true; } else { bool ValueValidate = false; bool tokenizeBuffer = false; if (uriId == fXMLNSNamespaceId) { attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_ANYURI); } else if (XMLString::equals(getURIText(uriId), SchemaSymbols::fgURI_XSI)) { if (XMLString::equals(suffPtr, SchemaSymbols::fgATT_NILL)) { attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_BOOLEAN); ValueValidate = true; } else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_SCHEMALOCATION)) { // use anyURI as the validator // tokenize the data and use the anyURI data for each piece attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_ANYURI); //We should validate each value in the schema location however //this lead to a performance degradation of around 4%. Since //the first value of each pair needs to match what is in the //schema document and the second value needs to be valid in //order to open the document we won't validate it. Need to //do performance analysis of the anyuri datatype. //ValueValidate = true; ValueValidate = false; tokenizeBuffer = true; } else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCATION)) { attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_ANYURI); //We should validate this value however //this lead to a performance degradation of around 4%. Since //the value needs to be valid in //order to open the document we won't validate it. Need to //do performance analysis of the anyuri datatype. //ValueValidate = true; ValueValidate = false; } else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_TYPE)) { attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_QNAME); ValueValidate = true; } else { otherXSI = true; } } if (!otherXSI) { normalizeAttRawValue ( namePtr , curPair->getValue() , normBuf ); if (fValidate && attrValidator && ValueValidate) { ((SchemaValidator*) fValidator)->normalizeWhiteSpace(attrValidator, normBuf.getRawBuffer(), normBuf, true); ValidationContext* const theContext = getValidationContext(); if (theContext) { try { if (tokenizeBuffer) { XMLStringTokenizer tokenizer(normBuf.getRawBuffer(), fMemoryManager); while (tokenizer.hasMoreTokens()) { attrValidator->validate( tokenizer.nextToken(), theContext, fMemoryManager); } } else { attrValidator->validate( normBuf.getRawBuffer(), theContext, fMemoryManager); } } catch (const XMLException& idve) { fValidator->emitError (XMLValid::DatatypeError, idve.getCode(), idve.getMessage()); } } } if(getPSVIHandler()) { psviAttr = fPSVIAttrList->getPSVIAttributeToFill(suffPtr, fURIStringPool->getValueForId(uriId)); XSSimpleTypeDefinition *validatingType = (attrValidator) ? (XSSimpleTypeDefinition *)fModel->getXSObject(attrValidator) : 0; // no attribute declarations for these... psviAttr->reset( fRootElemName , PSVIItem::VALIDITY_NOTKNOWN , PSVIItem::VALIDATION_NONE , validatingType , 0 , 0 , false , 0 , attrValidator ); } } } } if (!isNSAttr || fGrammarType == Grammar::DTDGrammarType || otherXSI) { // Some checking for attribute wild card first (for schema) bool laxThisOne = false; bool skipThisOne = false; XMLAttDef* attDefForWildCard = 0; XMLAttDef* attDef = 0; if (fGrammarType == Grammar::SchemaGrammarType) { //retrieve the att def SchemaAttDef* attWildCard = 0; if (currType) { attDef = currType->getAttDef(suffPtr, uriId); attWildCard = currType->getAttWildCard(); } else if (!currDV) { // check explicitly-set wildcard attDef = ((SchemaElementDecl*)elemDecl)->getAttDef(suffPtr, uriId); attWildCard = ((SchemaElementDecl*)elemDecl)->getAttWildCard(); } // if not found or faulted in - check for a matching wildcard attribute // if no matching wildcard attribute, check (un)qualifed cases and flag // appropriate errors if (!attDef || (attDef->getCreateReason() == XMLAttDef::JustFaultIn)) { if (attWildCard) { //if schema, see if we should lax or skip the validation of this attribute if (anyAttributeValidation(attWildCard, uriId, skipThisOne, laxThisOne)) { if(!skipThisOne) { SchemaGrammar* sGrammar = (SchemaGrammar*) fGrammarResolver->getGrammar(getURIText(uriId)); if (sGrammar && sGrammar->getGrammarType() == Grammar::SchemaGrammarType) { RefHashTableOf* attRegistry = sGrammar->getAttributeDeclRegistry(); if (attRegistry) { attDefForWildCard = attRegistry->get(suffPtr); } } } } } else if (currType) { // not found, see if the attDef should be qualified or not if (uriId == fEmptyNamespaceId) { attDef = currType->getAttDef(suffPtr , fURIStringPool->getId(fGrammar->getTargetNamespace())); if (fValidate && attDef && attDef->getCreateReason() != XMLAttDef::JustFaultIn) { // the attribute should be qualified fValidator->emitError ( XMLValid::AttributeNotQualified , attDef->getFullName() ); if(fGrammarType == Grammar::SchemaGrammarType) { fPSVIElemContext.fErrorOccurred = true; if (getPSVIHandler()) { attrValid = PSVIItem::VALIDITY_INVALID; } } } } else { attDef = currType->getAttDef(suffPtr , fEmptyNamespaceId); if (fValidate && attDef && attDef->getCreateReason() != XMLAttDef::JustFaultIn) { // the attribute should be qualified fValidator->emitError ( XMLValid::AttributeNotUnQualified , attDef->getFullName() ); if(fGrammarType == Grammar::SchemaGrammarType) { fPSVIElemContext.fErrorOccurred = true; if (getPSVIHandler()) { attrValid = PSVIItem::VALIDITY_INVALID; } } } } } } } // Find this attribute within the parent element. We pass both // the uriID/name and the raw QName buffer, since we don't know // how the derived validator and its elements store attributes. else { if(fGrammarType == Grammar::DTDGrammarType) attDef = ((DTDElementDecl *)elemDecl)->getAttDef ( namePtr); } // now need to prepare for duplicate detection if(attDef) { unsigned int *curCountPtr = fAttDefRegistry->get(attDef); if(!curCountPtr) { curCountPtr = getNewUIntPtr(); *curCountPtr = fElemCount; fAttDefRegistry->put(attDef, curCountPtr); } else if(*curCountPtr < fElemCount) *curCountPtr = fElemCount; else { emitError ( XMLErrs::AttrAlreadyUsedInSTag , attDef->getFullName() , elemDecl->getFullName() ); fPSVIElemContext.fErrorOccurred = true; } } else { if(fGrammarType == Grammar::DTDGrammarType) { if(!fUndeclaredAttrRegistry->putIfNotPresent(namePtr, 0)) { emitError ( XMLErrs::AttrAlreadyUsedInSTag , namePtr , elemDecl->getFullName() ); } } else // schema grammar { if(!fUndeclaredAttrRegistry->putIfNotPresent(suffPtr, uriId)) { emitError ( XMLErrs::AttrAlreadyUsedInSTag , namePtr , elemDecl->getFullName() ); fPSVIElemContext.fErrorOccurred = true; } } } if(fGrammarType == Grammar::SchemaGrammarType ) { // if we've found either an attDef or an attDefForWildCard, // then we're doing full validation and it may still be valid. if(!attDef && !attDefForWildCard) { if(!laxThisOne && !skipThisOne) { fPSVIElemContext.fErrorOccurred = true; } if(getPSVIHandler()) { if(!laxThisOne && !skipThisOne) { attrValid = PSVIItem::VALIDITY_INVALID; } else if(laxThisOne) { attrValid = PSVIItem::VALIDITY_NOTKNOWN; attrAssessed = PSVIItem::VALIDATION_PARTIAL; } else { attrValid = PSVIItem::VALIDITY_NOTKNOWN; attrAssessed = PSVIItem::VALIDATION_NONE; } } } } bool errorCondition = fValidate && !attDefForWildCard && !attDef; if (errorCondition && !skipThisOne && !laxThisOne) { // // Its not valid for this element, so issue an error if we are // validating. // XMLBufBid bbMsg(&fBufMgr); XMLBuffer& bufMsg = bbMsg.getBuffer(); if (uriId != fEmptyNamespaceId) { XMLBufBid bbURI(&fBufMgr); XMLBuffer& bufURI = bbURI.getBuffer(); getURIText(uriId, bufURI); bufMsg.append(chOpenCurly); bufMsg.append(bufURI.getRawBuffer()); bufMsg.append(chCloseCurly); } bufMsg.append(suffPtr); fValidator->emitError ( XMLValid::AttNotDefinedForElement , bufMsg.getRawBuffer() , elemDecl->getFullName() ); } // Now normalize the raw value since we have the attribute type. We // don't care about the return status here. If it failed, an error // was issued, which is all we care about. if (attDefForWildCard) { normalizeAttValue( attDefForWildCard, namePtr, curPair->getValue(), normBuf ); // If we found an attdef for this one, then lets validate it. const XMLCh* xsNormalized = normBuf.getRawBuffer(); DatatypeValidator* tempDV = ((SchemaAttDef*) attDefForWildCard)->getDatatypeValidator(); if (tempDV && tempDV->getWSFacet() != DatatypeValidator::PRESERVE) { // normalize the attribute according to schema whitespace facet ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, xsNormalized, fWSNormalizeBuf, true); xsNormalized = fWSNormalizeBuf.getRawBuffer(); if (fNormalizeData && fValidate) { normBuf.set(xsNormalized); } } if (fValidate ) { fValidator->validateAttrValue( attDefForWildCard, xsNormalized, false, elemDecl ); attrValidator = ((SchemaValidator*)fValidator)->getMostRecentAttrValidator(); if(((SchemaValidator *)fValidator)->getErrorOccurred()) { fPSVIElemContext.fErrorOccurred = true; if(getPSVIHandler()) attrValid = PSVIItem::VALIDITY_INVALID; } } else { // no decl; default DOMTypeInfo to anySimpleType attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_ANYSIMPLETYPE); } // Save the type for later use attType = attDefForWildCard->getType(); } else { normalizeAttValue( attDef, namePtr, curPair->getValue(), normBuf ); // If we found an attdef for this one, then lets validate it. if (attDef) { const XMLCh* xsNormalized = normBuf.getRawBuffer(); if (fGrammarType == Grammar::SchemaGrammarType) { DatatypeValidator* tempDV = ((SchemaAttDef*) attDef)->getDatatypeValidator(); if (tempDV && tempDV->getWSFacet() != DatatypeValidator::PRESERVE) { // normalize the attribute according to schema whitespace facet ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, xsNormalized, fWSNormalizeBuf, true); xsNormalized = fWSNormalizeBuf.getRawBuffer(); if (fNormalizeData && fValidate && !skipThisOne) { normBuf.set(xsNormalized); } } } if (fValidate && !skipThisOne) { fValidator->validateAttrValue( attDef, xsNormalized, false, elemDecl ); if(fGrammarType == Grammar::SchemaGrammarType) { attrValidator = ((SchemaValidator*)fValidator)->getMostRecentAttrValidator(); if(((SchemaValidator *)fValidator)->getErrorOccurred()) { fPSVIElemContext.fErrorOccurred = true; if (getPSVIHandler()) attrValid = PSVIItem::VALIDITY_INVALID; } } } else if(fGrammarType == Grammar::SchemaGrammarType) { attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_ANYSIMPLETYPE); } } else // no attDef at all; default to anySimpleType { if(fGrammarType == Grammar::SchemaGrammarType) { attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_ANYSIMPLETYPE); } } // Save the type for later use if (attDef) { attType = attDef->getType(); } } // now fill in the PSVIAttributes entry for this attribute: if(getPSVIHandler() && fGrammarType == Grammar::SchemaGrammarType) { psviAttr = fPSVIAttrList->getPSVIAttributeToFill(suffPtr, fURIStringPool->getValueForId(uriId)); SchemaAttDef *actualAttDef = 0; if(attDef) actualAttDef = (SchemaAttDef *)attDef; else if (attDefForWildCard) actualAttDef = (SchemaAttDef *)attDefForWildCard; if(actualAttDef) { XSAttributeDeclaration *attrDecl = (XSAttributeDeclaration *)fModel->getXSObject(actualAttDef); DatatypeValidator * attrDataType = actualAttDef->getDatatypeValidator(); XSSimpleTypeDefinition *validatingType = (XSSimpleTypeDefinition *)fModel->getXSObject(attrDataType); if(attrValid != PSVIItem::VALIDITY_VALID) { psviAttr->reset ( fRootElemName , attrValid , attrAssessed , validatingType , 0 , actualAttDef->getValue() , false , attrDecl , 0 ); } else { XSSimpleTypeDefinition *memberType = 0; if(validatingType->getVariety() == XSSimpleTypeDefinition::VARIETY_UNION) memberType = (XSSimpleTypeDefinition *)fModel->getXSObject(attrValidator); psviAttr->reset ( fRootElemName , attrValid , attrAssessed , validatingType , memberType , actualAttDef->getValue() , false , attrDecl , (memberType)?attrValidator:attrDataType ); } } else { psviAttr->reset ( fRootElemName , attrValid , attrAssessed , 0 , 0 , 0 , false , 0 , 0 ); } } } // Add this attribute to the attribute list that we use to pass them // to the handler. We reuse its existing elements but expand it as // required. XMLAttr* curAttr; // check for duplicate namespace attributes: // by checking for qualified names with the same local part and with prefixes // which have been bound to namespace names that are identical. if (fGrammarType == Grammar::DTDGrammarType) { if (!toUseHashTable) { for (XMLSize_t attrIndex=0; attrIndex < retCount; attrIndex++) { curAttr = toFill.elementAt(attrIndex); if (uriId == curAttr->getURIId() && XMLString::equals(suffPtr, curAttr->getName())) { emitError ( XMLErrs::AttrAlreadyUsedInSTag , curAttr->getName() , elemDecl->getFullName() ); } } } else { if (fAttrDupChkRegistry->containsKey((void*)suffPtr, uriId)) { emitError ( XMLErrs::AttrAlreadyUsedInSTag , suffPtr , elemDecl->getFullName() ); } } } if (retCount >= curAttListSize) { curAttr = new (fMemoryManager) XMLAttr ( uriId , suffPtr , prefPtr , normBuf.getRawBuffer() , attType , true , fMemoryManager ); toFill.addElement(curAttr); } else { curAttr = toFill.elementAt(retCount); curAttr->set ( uriId , suffPtr , prefPtr , normBuf.getRawBuffer() , attType ); curAttr->setSpecified(true); } if (toUseHashTable) { fAttrDupChkRegistry->put((void*)suffPtr, uriId, curAttr); } if(psviAttr) psviAttr->setValue(curAttr->getValue()); // Bump the count of attrs in the list retCount++; } // Now, if there are any attributes declared by this element, let's // go through them and make sure that any required ones are provided, // and fault in any fixed ones and defaulted ones that are not provided // literally. if (hasDefs) { // Check after all specified attrs are scanned // (1) report error for REQUIRED attrs that are missing (V_TAGc) // (2) add default attrs if missing (FIXED and NOT_FIXED) XMLAttDefList &attDefList = getAttDefList(fGrammarType == Grammar::SchemaGrammarType, currType, elemDecl); for(XMLSize_t i=0; igetDefaultType(); unsigned int *attCountPtr = fAttDefRegistry->get((void *)curDef); if (!attCountPtr || *attCountPtr < fElemCount) { // did not occur // note that since there is no attribute information // item present, there is no PSVI infoset to augment here *except* // that the element is invalid //the attribute is not provided if (fValidate) { // If we are validating and its required, then an error if ((defType == XMLAttDef::Required) || (defType == XMLAttDef::Required_And_Fixed) ) { fValidator->emitError ( XMLValid::RequiredAttrNotProvided , curDef->getFullName() ); if(fGrammarType == Grammar::SchemaGrammarType) { fPSVIElemContext.fErrorOccurred = true; } } else if ((defType == XMLAttDef::Default) || (defType == XMLAttDef::Fixed) ) { if (fStandalone && curDef->isExternal()) { // XML 1.0 Section 2.9 // Document is standalone, so attributes must not be defaulted. fValidator->emitError(XMLValid::NoDefAttForStandalone, curDef->getFullName(), elemDecl->getFullName()); if(fGrammarType == Grammar::SchemaGrammarType) { fPSVIElemContext.fErrorOccurred = true; } } } } // Fault in the value if needed, and bump the att count. if ((defType == XMLAttDef::Default) || (defType == XMLAttDef::Fixed)) { // Let the validator pass judgement on the attribute value if (fValidate) { fValidator->validateAttrValue ( curDef , curDef->getValue() , false , elemDecl ); } XMLAttr* curAtt; if (retCount >= curAttListSize) { curAtt = new (fMemoryManager) XMLAttr(fMemoryManager); fValidator->faultInAttr(*curAtt, *curDef); fAttrList->addElement(curAtt); } else { curAtt = fAttrList->elementAt(retCount); fValidator->faultInAttr(*curAtt, *curDef); } if (fGrammarType == Grammar::DTDGrammarType) { // Map the new attribute's prefix to a URI id and store // that in the attribute object. curAtt->setURIId ( resolvePrefix(curAtt->getPrefix(), ElemStack::Mode_Attribute) ); } // Indicate it was not explicitly specified and bump count curAtt->setSpecified(false); retCount++; if(getPSVIHandler() && fGrammarType == Grammar::SchemaGrammarType) { QName *attName = ((SchemaAttDef *)curDef)->getAttName(); PSVIAttribute *defAttrToFill = fPSVIAttrList->getPSVIAttributeToFill ( attName->getLocalPart(), fURIStringPool->getValueForId( attName->getURI()) ); XSAttributeDeclaration *defAttrDecl = (XSAttributeDeclaration *)fModel->getXSObject((void *)curDef); DatatypeValidator * attrDataType = ((SchemaAttDef *)curDef)->getDatatypeValidator(); XSSimpleTypeDefinition *defAttrType = (XSSimpleTypeDefinition*)fModel->getXSObject(attrDataType); // would have occurred during validation of default value if(((SchemaValidator *)fValidator)->getErrorOccurred()) { defAttrToFill->reset( fRootElemName , PSVIItem::VALIDITY_INVALID , PSVIItem::VALIDATION_FULL , defAttrType , 0 , curDef->getValue() , true , defAttrDecl , 0 ); } else { XSSimpleTypeDefinition *defAttrMemberType = 0; if(defAttrType->getVariety() == XSSimpleTypeDefinition::VARIETY_UNION) { defAttrMemberType = (XSSimpleTypeDefinition *)fModel->getXSObject ( ((SchemaValidator*)fValidator)->getMostRecentAttrValidator() ); } defAttrToFill->reset( fRootElemName , PSVIItem::VALIDITY_VALID , PSVIItem::VALIDATION_FULL , defAttrType , defAttrMemberType , curDef->getValue() , true , defAttrDecl , (defAttrMemberType)?((SchemaValidator *)fValidator)->getMostRecentAttrValidator():attrDataType ); } defAttrToFill->setValue(curDef->getValue()); } } } else if(attCountPtr) { //attribute is provided // (schema) report error for PROHIBITED attrs that are present (V_TAGc) if (defType == XMLAttDef::Prohibited && fValidate) { fValidator->emitError ( XMLValid::ProhibitedAttributePresent , curDef->getFullName() ); if(fGrammarType == Grammar::SchemaGrammarType) { fPSVIElemContext.fErrorOccurred = true; if (getPSVIHandler()) { QName *attQName = ((SchemaAttDef *)curDef)->getAttName(); // bad luck... PSVIAttribute *prohibitedAttr = fPSVIAttrList->getAttributePSVIByName ( attQName->getLocalPart(), fURIStringPool->getValueForId(attQName->getURI()) ); prohibitedAttr->updateValidity(PSVIItem::VALIDITY_INVALID); } } } } } } return retCount; } // This method will take a raw attribute value and normalize it according to // the rules of the attribute type. It will put the resulting value into the // passed buffer. // // This code assumes that escaped characters in the original value (via char // refs) are prefixed by a 0xFFFF character. This is because some characters // are legal if escaped only. And some escape chars are not subject to // normalization rules. bool IGXMLScanner::normalizeAttValue( const XMLAttDef* const attDef , const XMLCh* const attName , const XMLCh* const value , XMLBuffer& toFill) { // A simple state value for a whitespace processing state machine enum States { InWhitespace , InContent }; // Get the type and name const XMLAttDef::AttTypes type = (attDef)?attDef->getType():XMLAttDef::CData; // check to see if it's a tokenized type that is declared externally bool isAttTokenizedExternal = (attDef) ?attDef->isExternal() && (type == XMLAttDef::ID || type == XMLAttDef::IDRef || type == XMLAttDef::IDRefs || type == XMLAttDef::Entity || type == XMLAttDef::Entities || type == XMLAttDef::NmToken || type == XMLAttDef::NmTokens) :false; // Assume its going to go fine, and empty the target buffer in preperation bool retVal = true; toFill.reset(); // Loop through the chars of the source value and normalize it according // to the type. XMLCh nextCh; const XMLCh* srcPtr = value; if (type == XMLAttDef::CData || type > XMLAttDef::Notation) { // Get the next character from the source. We have to watch for // escaped characters (which are indicated by a 0xFFFF value followed // by the char that was escaped.) while ((nextCh = *srcPtr++)!=0) { switch(nextCh) { // Do we have an escaped character ? case 0xFFFF: nextCh = *srcPtr++; break; case 0x09: case 0x0A: case 0x0D: // Check Validity Constraint for Standalone document declaration // XML 1.0, Section 2.9 if (fStandalone && fValidate && isAttTokenizedExternal) { // Can't have a standalone document declaration of "yes" if attribute // values are subject to normalisation fValidator->emitError(XMLValid::NoAttNormForStandalone, attName); } nextCh = chSpace; break; case chOpenAngle: // If its not escaped, then make sure its not a < character, which is // not allowed in attribute values. emitError(XMLErrs::BracketInAttrValue, attName); retVal = false; break; } // Add this char to the target buffer toFill.append(nextCh); } } else { States curState = InContent; bool firstNonWS = false; // Get the next character from the source. We have to watch for // escaped characters (which are indicated by a 0xFFFF value followed // by the char that was escaped.) while ((nextCh = *srcPtr)!=0) { // Do we have an escaped character ? if (nextCh == 0xFFFF) { nextCh = *++srcPtr; } else if (nextCh == chOpenAngle) { // If its not escaped, then make sure its not a < character, which is // not allowed in attribute values. emitError(XMLErrs::BracketInAttrValue, attName); retVal = false; } if (curState == InWhitespace) { if (!fReaderMgr.getCurrentReader()->isWhitespace(nextCh)) { if (firstNonWS) toFill.append(chSpace); curState = InContent; firstNonWS = true; } else { srcPtr++; continue; } } else if (curState == InContent) { if (fReaderMgr.getCurrentReader()->isWhitespace(nextCh)) { curState = InWhitespace; srcPtr++; // Check Validity Constraint for Standalone document declaration // XML 1.0, Section 2.9 if (fStandalone && fValidate && isAttTokenizedExternal) { if (!firstNonWS || (nextCh != chSpace && *srcPtr && fReaderMgr.getCurrentReader()->isWhitespace(*srcPtr))) { // Can't have a standalone document declaration of "yes" if attribute // values are subject to normalisation fValidator->emitError(XMLValid::NoAttNormForStandalone, attName); } } continue; } firstNonWS = true; } // Add this char to the target buffer toFill.append(nextCh); // And move up to the next character in the source srcPtr++; } } return retVal; } // This method will just normalize the input value as CDATA without // any standalone checking. bool IGXMLScanner::normalizeAttRawValue( const XMLCh* const attrName , const XMLCh* const value , XMLBuffer& toFill) { // Assume its going to go fine, and empty the target buffer in preperation bool retVal = true; toFill.reset(); // Loop through the chars of the source value and normalize it according // to the type. bool escaped; XMLCh nextCh; const XMLCh* srcPtr = value; while (*srcPtr) { // Get the next character from the source. We have to watch for // escaped characters (which are indicated by a 0xFFFF value followed // by the char that was escaped.) nextCh = *srcPtr; escaped = (nextCh == 0xFFFF); if (escaped) nextCh = *++srcPtr; // If its not escaped, then make sure its not a < character, which is // not allowed in attribute values. if (!escaped && (*srcPtr == chOpenAngle)) { emitError(XMLErrs::BracketInAttrValue, attrName); retVal = false; } if (!escaped) { // NOTE: Yes this is a little redundant in that a 0x20 is // replaced with an 0x20. But its faster to do this (I think) // than checking for 9, A, and D separately. if (fReaderMgr.getCurrentReader()->isWhitespace(nextCh)) nextCh = chSpace; } // Add this char to the target buffer toFill.append(nextCh); // And move up to the next character in the source srcPtr++; } return retVal; } // This method will reset the scanner data structures, and related plugged // in stuff, for a new scan session. We get the input source for the primary // XML entity, create the reader for it, and push it on the stack so that // upon successful return from here we are ready to go. void IGXMLScanner::scanReset(const InputSource& src) { // This call implicitly tells us that we are going to reuse the scanner // if it was previously used. So tell the validator to reset itself. // // But, if the fUseCacheGrammar flag is set, then don't reset it. // // NOTE: The ReaderMgr is flushed on the way out, because that is // required to insure that files are closed. fGrammarResolver->cacheGrammarFromParse(fToCacheGrammar); fGrammarResolver->useCachedGrammarInParse(fUseCachedGrammar); // Clear transient schema info list. // fSchemaInfoList->removeAll (); // fModel may need updating, as fGrammarResolver could have cleaned it if(getPSVIHandler()) fModel = fGrammarResolver->getXSModel(); { XMLDTDDescriptionImpl theDTDDescription(XMLUni::fgDTDEntityString, fMemoryManager); fDTDGrammar = (DTDGrammar*) fGrammarResolver->getGrammar(&theDTDDescription); } if (!fDTDGrammar) { fDTDGrammar = new (fGrammarPoolMemoryManager) DTDGrammar(fGrammarPoolMemoryManager); fGrammarResolver->putGrammar(fDTDGrammar); } else fDTDGrammar->reset(); fGrammar = fDTDGrammar; fGrammarType = fGrammar->getGrammarType(); fRootGrammar = 0; if (fValidatorFromUser) { if (fValidator->handlesDTD()) fValidator->setGrammar(fGrammar); else if (fValidator->handlesSchema()) { ((SchemaValidator*) fValidator)->setErrorReporter(fErrorReporter); ((SchemaValidator*) fValidator)->setGrammarResolver(fGrammarResolver); ((SchemaValidator*) fValidator)->setExitOnFirstFatal(fExitOnFirstFatal); } } else { // set fValidator as fDTDValidator fValidator = fDTDValidator; fValidator->setGrammar(fGrammar); } // Reset validation fValidate = (fValScheme == Val_Always) ? true : false; // Ignore skipDTDValidation flag if no schema processing is taking place */ fSkipDTDValidation = fSkipDTDValidation && fDoSchema; // And for all installed handlers, send reset events. This gives them // a chance to flush any cached data. if (fDocHandler) fDocHandler->resetDocument(); if (fEntityHandler) fEntityHandler->resetEntities(); if (fErrorReporter) fErrorReporter->resetErrors(); // Clear out the id reference list resetValidationContext(); // Reset the Root Element Name fMemoryManager->deallocate(fRootElemName);//delete [] fRootElemName; fRootElemName = 0; // Reset IdentityConstraints if (fICHandler) fICHandler->reset(); // Reset the element stack, and give it the latest ids for the special // URIs it has to know about. fElemStack.reset ( fEmptyNamespaceId , fUnknownNamespaceId , fXMLNamespaceId , fXMLNSNamespaceId ); if (!fSchemaNamespaceId) fSchemaNamespaceId = fURIStringPool->addOrFind(SchemaSymbols::fgURI_XSI); // Reset some status flags fInException = false; fStandalone = false; fErrorCount = 0; fHasNoDTD = true; fSeeXsi = false; // Reset PSVI context // note that we always need this around for DOMTypeInfo if (!fPSVIElement) fPSVIElement = new (fMemoryManager) PSVIElement(fMemoryManager); if (!fErrorStack) { fErrorStack = new (fMemoryManager) ValueStackOf(8, fMemoryManager); } else { fErrorStack->removeAllElements(); } resetPSVIElemContext(); // Reset the validators fDTDValidator->reset(); fDTDValidator->setErrorReporter(fErrorReporter); fSchemaValidator->reset(); fSchemaValidator->setErrorReporter(fErrorReporter); fSchemaValidator->setExitOnFirstFatal(fExitOnFirstFatal); fSchemaValidator->setGrammarResolver(fGrammarResolver); if (fValidatorFromUser) fValidator->reset(); // Handle the creation of the XML reader object for this input source. // This will provide us with transcoding and basic lexing services. XMLReader* newReader = fReaderMgr.createReader ( src , true , XMLReader::RefFrom_NonLiteral , XMLReader::Type_General , XMLReader::Source_External , fCalculateSrcOfs , fLowWaterMark ); if (!newReader) { if (src.getIssueFatalErrorIfNotFound()) ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Scan_CouldNotOpenSource, src.getSystemId(), fMemoryManager); else ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Scan_CouldNotOpenSource_Warning, src.getSystemId(), fMemoryManager); } // Push this read onto the reader manager fReaderMgr.pushReader(newReader, 0); // and reset security-related things if necessary: if(fSecurityManager != 0) { fEntityExpansionLimit = fSecurityManager->getEntityExpansionLimit(); fEntityExpansionCount = 0; } fElemCount = 0; if(fUIntPoolRowTotal >= 32) { // 8 KB tied up with validating attributes... fAttDefRegistry->removeAll(); recreateUIntPool(); } else { // note that this will implicitly reset the values of the hashtables, // though their buckets will still be tied up resetUIntPool(); } fUndeclaredAttrRegistry->removeAll(); fDTDElemNonDeclPool->removeAll(); } // This method is called between markup in content. It scans for character // data that is sent to the document handler. It watches for any markup // characters that would indicate that the character data has ended. It also // handles expansion of general and character entities. // // sendData() is a local static helper for this method which handles some // code that must be done in three different places here. void IGXMLScanner::sendCharData(XMLBuffer& toSend) { // If no data in the buffer, then nothing to do if (toSend.isEmpty()) return; // We do different things according to whether we are validating or // not. If not, its always just characters; else, it depends on the // current element's content model. if (fValidate) { // Get the raw data we need for the callback const XMLCh* rawBuf = toSend.getRawBuffer(); XMLSize_t len = toSend.getLen(); // And see if the current element is a 'Children' style content model const ElemStack::StackElem* topElem = fElemStack.topElement(); // Get the character data opts for the current element XMLElementDecl::CharDataOpts charOpts = XMLElementDecl::AllCharData; if(fGrammar->getGrammarType() == Grammar::SchemaGrammarType) { // And see if the current element is a 'Children' style content model ComplexTypeInfo *currType = ((SchemaValidator*)fValidator)->getCurrentTypeInfo(); if(currType) { SchemaElementDecl::ModelTypes modelType = (SchemaElementDecl::ModelTypes) currType->getContentType(); if(modelType == SchemaElementDecl::Children || modelType == SchemaElementDecl::ElementOnlyEmpty) charOpts = XMLElementDecl::SpacesOk; else if(modelType == SchemaElementDecl::Empty) charOpts = XMLElementDecl::NoCharData; } } else // DTD grammar charOpts = topElem->fThisElement->getCharDataOpts(); if (charOpts == XMLElementDecl::NoCharData) { // They definitely cannot handle any type of char data fValidator->emitError(XMLValid::NoCharDataInCM); //if(fGrammarType == Grammar::SchemaGrammarType) //{ // if (getPSVIHandler()) // { // REVISIT: // PSVIElement->setValidity(PSVIItem::VALIDITY_INVALID); // } // } } else if (fReaderMgr.getCurrentReader()->isAllSpaces(rawBuf, len)) { // Its all spaces. So, if they can take spaces, then send it // as ignorable whitespace. If they can handle any char data // send it as characters. if (charOpts == XMLElementDecl::SpacesOk) { if (fDocHandler) fDocHandler->ignorableWhitespace(rawBuf, len, false); } else if (charOpts == XMLElementDecl::AllCharData) { if (fGrammarType != Grammar::SchemaGrammarType) { if (fDocHandler) fDocHandler->docCharacters(rawBuf, len, false); } else { XMLSize_t xsLen; const XMLCh* xsNormalized; SchemaValidator *schemaValidator = (SchemaValidator *)fValidator; DatatypeValidator* tempDV = ((SchemaValidator*) fValidator)->getCurrentDatatypeValidator(); if (tempDV && tempDV->getWSFacet() != DatatypeValidator::PRESERVE) { // normalize the character according to schema whitespace facet ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, rawBuf, fWSNormalizeBuf); xsNormalized = fWSNormalizeBuf.getRawBuffer(); xsLen = fWSNormalizeBuf.getLen(); } else { xsNormalized = rawBuf; xsLen = len ; } // tell the schema validation about the character data for checkContent later schemaValidator->setDatatypeBuffer(xsNormalized); // call all active identity constraints if (toCheckIdentityConstraint() && fICHandler->getMatcherCount()) { fContent.append(xsNormalized, xsLen); } if (fDocHandler) { if (fNormalizeData) { fDocHandler->docCharacters(xsNormalized, xsLen, false); } else { fDocHandler->docCharacters(rawBuf, len, false); } } } } } else { // If they can take any char data, then send it. Otherwise, they // can only handle whitespace and can't handle this stuff so // issue an error. if (charOpts == XMLElementDecl::AllCharData) { if (fGrammarType != Grammar::SchemaGrammarType) { if (fDocHandler) fDocHandler->docCharacters(rawBuf, len, false); } else { XMLSize_t xsLen; const XMLCh* xsNormalized; SchemaValidator *schemaValidator = (SchemaValidator*)fValidator; DatatypeValidator* tempDV = ((SchemaValidator*) fValidator)->getCurrentDatatypeValidator(); if (tempDV && tempDV->getWSFacet() != DatatypeValidator::PRESERVE) { // normalize the character according to schema whitespace facet ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, rawBuf, fWSNormalizeBuf); xsNormalized = fWSNormalizeBuf.getRawBuffer(); xsLen = fWSNormalizeBuf.getLen(); } else { xsNormalized = rawBuf; xsLen = len; } // tell the schema validation about the character data for checkContent later schemaValidator->setDatatypeBuffer(xsNormalized); // call all active identity constraints if (toCheckIdentityConstraint() && fICHandler->getMatcherCount()) { fContent.append(xsNormalized, xsLen); } if (fDocHandler) { if (fNormalizeData) { fDocHandler->docCharacters(xsNormalized, xsLen, false); } else { fDocHandler->docCharacters(rawBuf, len, false); } } } } else { fValidator->emitError(XMLValid::NoCharDataInCM); if(fGrammarType == Grammar::SchemaGrammarType) { if (getPSVIHandler()) { // REVISIT: // PSVIAttribute->setValidity(PSVIItem::VALIDITY_INVALID); } } } } } else { // call all active identity constraints if (fGrammarType == Grammar::SchemaGrammarType) { if (toCheckIdentityConstraint() && fICHandler->getMatcherCount()) fContent.append(toSend.getRawBuffer(), toSend.getLen()); } // Always assume its just char data if not validating if (fDocHandler) fDocHandler->docCharacters(toSend.getRawBuffer(), toSend.getLen(), false); } // Reset buffer toSend.reset(); } // This method is called with a key/value string pair that represents an // xmlns="yyy" or xmlns:xxx="yyy" attribute. This method will update the // current top of the element stack based on this data. We know that when // we get here, that it is one of these forms, so we don't bother confirming // it. // // But we have to ensure // 1. xxx is not xmlns // 2. if xxx is xml, then yyy must match XMLUni::fgXMLURIName, and vice versa // 3. yyy is not XMLUni::fgXMLNSURIName // 4. if xxx is not null, then yyy cannot be an empty string. void IGXMLScanner::updateNSMap(const XMLCh* const attrName , const XMLCh* const attrValue) { updateNSMap(attrName, attrValue, XMLString::indexOf(attrName, chColon)); } void IGXMLScanner::updateNSMap(const XMLCh* const attrName , const XMLCh* const attrValue , const int colonOfs) { // We need a buffer to normalize the attribute value into XMLBufBid bbNormal(&fBufMgr); XMLBuffer& normalBuf = bbNormal.getBuffer(); // Normalize the value into the passed buffer. In this case, we don't // care about the return value. An error was issued for the error, which // is all we care about here. normalizeAttRawValue(attrName, attrValue, normalBuf); XMLCh* namespaceURI = normalBuf.getRawBuffer(); // We either have the default prefix (""), or we point it into the attr // name parameter. Note that the xmlns is not the prefix we care about // here. To us, the 'prefix' is really the local part of the attrName // parameter. // // Check 1. xxx is not xmlns // 2. if xxx is xml, then yyy must match XMLUni::fgXMLURIName, and vice versa // 3. yyy is not XMLUni::fgXMLNSURIName // 4. if xxx is not null, then yyy cannot be an empty string. const XMLCh* prefPtr = XMLUni::fgZeroLenString; if (colonOfs != -1) { prefPtr = &attrName[colonOfs + 1]; if (XMLString::equals(prefPtr, XMLUni::fgXMLNSString)) emitError(XMLErrs::NoUseOfxmlnsAsPrefix); else if (XMLString::equals(prefPtr, XMLUni::fgXMLString)) { if (!XMLString::equals(namespaceURI, XMLUni::fgXMLURIName)) emitError(XMLErrs::PrefixXMLNotMatchXMLURI); } if (!namespaceURI) emitError(XMLErrs::NoEmptyStrNamespace, attrName); else if(!*namespaceURI && fXMLVersion == XMLReader::XMLV1_0) emitError(XMLErrs::NoEmptyStrNamespace, attrName); } if (XMLString::equals(namespaceURI, XMLUni::fgXMLNSURIName)) emitError(XMLErrs::NoUseOfxmlnsURI); else if (XMLString::equals(namespaceURI, XMLUni::fgXMLURIName)) { if (!XMLString::equals(prefPtr, XMLUni::fgXMLString)) emitError(XMLErrs::XMLURINotMatchXMLPrefix); } // Ok, we have to get the unique id for the attribute value, which is the // URI that this value should be mapped to. The validator has the // namespace string pool, so we ask him to find or add this new one. Then // we ask the element stack to add this prefix to URI Id mapping. fElemStack.addPrefix ( prefPtr , fURIStringPool->addOrFind(namespaceURI) ); } void IGXMLScanner::scanRawAttrListforNameSpaces(XMLSize_t attCount) { // Make an initial pass through the list and find any xmlns attributes or // schema attributes. // When we find one, send it off to be used to update the element stack's // namespace mappings. for (XMLSize_t index = 0; index < attCount; index++) { // each attribute has the prefix:suffix="value" const KVStringPair* curPair = fRawAttrList->elementAt(index); const XMLCh* rawPtr = curPair->getKey(); // If either the key begins with "xmlns:" or its just plain // "xmlns", then use it to update the map. if (!XMLString::compareNString(rawPtr, XMLUni::fgXMLNSColonString, 6) || XMLString::equals(rawPtr, XMLUni::fgXMLNSString)) { const XMLCh* valuePtr = curPair->getValue(); updateNSMap(rawPtr, valuePtr, fRawAttrColonList[index]); // if the schema URI is seen in the the valuePtr, set the boolean seeXsi if (XMLString::equals(valuePtr, SchemaSymbols::fgURI_XSI)) { fSeeXsi = true; } } } // walk through the list again to deal with "xsi:...." if (fDoSchema && fSeeXsi) { for (XMLSize_t index = 0; index < attCount; index++) { // each attribute has the prefix:suffix="value" const KVStringPair* curPair = fRawAttrList->elementAt(index); const XMLCh* rawPtr = curPair->getKey(); const XMLCh* prefPtr = XMLUni::fgZeroLenString; int colonInd = fRawAttrColonList[index]; if (colonInd != -1) { fURIBuf.set(rawPtr, colonInd); prefPtr = fURIBuf.getRawBuffer(); } // if schema URI has been seen, scan for the schema location and uri // and resolve the schema grammar if (resolvePrefix(prefPtr, ElemStack::Mode_Attribute) == fSchemaNamespaceId) { const XMLCh* valuePtr = curPair->getValue(); const XMLCh* suffPtr = &rawPtr[colonInd + 1]; if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_SCHEMALOCATION)) parseSchemaLocation(valuePtr); else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCATION)) resolveSchemaGrammar(valuePtr, XMLUni::fgZeroLenString); } } // do it another time, as xsi:type and xsi:nill only work if the schema grammar has been already // loaded (JIRA XERCESC-1937) for (XMLSize_t index = 0; index < attCount; index++) { const KVStringPair* curPair = fRawAttrList->elementAt(index); const XMLCh* rawPtr = curPair->getKey(); const XMLCh* prefPtr = XMLUni::fgZeroLenString; int colonInd = fRawAttrColonList[index]; if (colonInd != -1) { fURIBuf.set(rawPtr, colonInd); prefPtr = fURIBuf.getRawBuffer(); } // scan for schema type if (resolvePrefix(prefPtr, ElemStack::Mode_Attribute) == fSchemaNamespaceId) { const XMLCh* valuePtr = curPair->getValue(); const XMLCh* suffPtr = &rawPtr[colonInd + 1]; if(XMLString::equals(suffPtr, SchemaSymbols::fgXSI_TYPE) || XMLString::equals(suffPtr, SchemaSymbols::fgATT_NILL)) { if (!fValidator || !fValidator->handlesSchema()) { // If we are in the DTD mode, try to switch to the Schema // mode. For that we need to find any XML Schema grammar // that we can switch to. Such a grammar can only come // from the cache (if it came from the schemaLocation // attribute, we would be in the Schema mode already). // XMLGrammarPool* pool = fGrammarResolver->getGrammarPool (); RefHashTableOfEnumerator i = pool->getGrammarEnumerator (); while (i.hasMoreElements ()) { Grammar& gr (i.nextElement ()); if (gr.getGrammarType () == Grammar::SchemaGrammarType) { switchGrammar (gr.getTargetNamespace ()); break; } } } if( fValidator && fValidator->handlesSchema() ) { if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_TYPE)) { XMLBufBid bbXsi(&fBufMgr); XMLBuffer& fXsiType = bbXsi.getBuffer(); // normalize the attribute according to schema whitespace facet DatatypeValidator* tempDV = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_QNAME); normalizeAttRawValue(SchemaSymbols::fgXSI_TYPE, valuePtr, fXsiType); ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, fXsiType.getRawBuffer(), fXsiType, true); if (!fXsiType.isEmpty()) { int colonPos = -1; unsigned int uriId = resolveQName ( fXsiType.getRawBuffer() , fPrefixBuf , ElemStack::Mode_Element , colonPos ); ((SchemaValidator*)fValidator)->setXsiType(fPrefixBuf.getRawBuffer(), fXsiType.getRawBuffer() + colonPos + 1, uriId); } } else if (XMLString::equals(suffPtr, SchemaSymbols::fgATT_NILL)) { // normalize the attribute according to schema whitespace facet XMLBufBid bbXsi(&fBufMgr); XMLBuffer& fXsiNil = bbXsi.getBuffer(); DatatypeValidator* tempDV = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_BOOLEAN); normalizeAttRawValue(SchemaSymbols::fgATT_NILL, valuePtr, fXsiNil); ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, fXsiNil.getRawBuffer(), fXsiNil, true); if(XMLString::equals(fXsiNil.getRawBuffer(), SchemaSymbols::fgATTVAL_TRUE)) ((SchemaValidator*)fValidator)->setNillable(true); else if(XMLString::equals(fXsiNil.getRawBuffer(), SchemaSymbols::fgATTVAL_FALSE)) ((SchemaValidator*)fValidator)->setNillable(false); else emitError(XMLErrs::InvalidAttValue, fXsiNil.getRawBuffer(), valuePtr); } } } } } } } void IGXMLScanner::parseSchemaLocation(const XMLCh* const schemaLocationStr, bool ignoreLoadSchema) { XMLCh* locStr = XMLString::replicate(schemaLocationStr, fMemoryManager); ArrayJanitor janLoc(locStr, fMemoryManager); processSchemaLocation(locStr); XMLSize_t size = fLocationPairs->size(); if (size % 2 != 0 ) { emitError(XMLErrs::BadSchemaLocation); } else { // We need a buffer to normalize the attribute value into XMLBuffer normalBuf(1023, fMemoryManager); for(XMLSize_t i=0; ielementAt(i), normalBuf); resolveSchemaGrammar(fLocationPairs->elementAt(i+1), normalBuf.getRawBuffer(), ignoreLoadSchema); } } } void IGXMLScanner::resolveSchemaGrammar(const XMLCh* const loc, const XMLCh* const uri, bool ignoreLoadSchema) { Grammar* grammar = 0; { XMLSchemaDescriptionImpl theSchemaDescription(uri, fMemoryManager); theSchemaDescription.setLocationHints(loc); grammar = fGrammarResolver->getGrammar(&theSchemaDescription); } // If multi-import is enabled, make sure the existing grammar came // from the import directive. Otherwise we may end up reloading // the same schema that came from the external grammar pool. Ideally, // we would move fSchemaInfoList to XMLGrammarPool so that it survives // the destruction of the scanner in which case we could rely on the // same logic we use to weed out duplicate schemas below. // if (!grammar || grammar->getGrammarType() == Grammar::DTDGrammarType || (getHandleMultipleImports() && ((XMLSchemaDescription*)grammar->getGrammarDescription())-> getContextType () == XMLSchemaDescription::CONTEXT_IMPORT)) { if (fLoadSchema || ignoreLoadSchema) { XSDDOMParser parser(0, fMemoryManager, 0); parser.setValidationScheme(XercesDOMParser::Val_Never); parser.setDoNamespaces(true); parser.setUserEntityHandler(fEntityHandler); parser.setUserErrorReporter(fErrorReporter); //Normalize loc XMLBufBid nnSys(&fBufMgr); XMLBuffer& normalizedSysId = nnSys.getBuffer(); XMLString::removeChar(loc, 0xFFFF, normalizedSysId); const XMLCh* normalizedURI = normalizedSysId.getRawBuffer(); // Create a buffer for expanding the system id XMLBufBid bbSys(&fBufMgr); XMLBuffer& expSysId = bbSys.getBuffer(); // Allow the entity handler to expand the system id if they choose // to do so. InputSource* srcToFill = 0; if (fEntityHandler) { if (!fEntityHandler->expandSystemId(normalizedURI, expSysId)) expSysId.set(normalizedURI); ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr.getLastExtEntityInfo(lastInfo); XMLResourceIdentifier resourceIdentifier(XMLResourceIdentifier::SchemaGrammar, expSysId.getRawBuffer(), uri, XMLUni::fgZeroLenString, lastInfo.systemId, &fReaderMgr); srcToFill = fEntityHandler->resolveEntity(&resourceIdentifier); } else { expSysId.set(normalizedURI); } // If they didn't create a source via the entity handler, then we // have to create one on our own. if (!srcToFill) { if (fDisableDefaultEntityResolution) return; ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr.getLastExtEntityInfo(lastInfo); XMLURL urlTmp(fMemoryManager); if ((!urlTmp.setURL(lastInfo.systemId, expSysId.getRawBuffer(), urlTmp)) || (urlTmp.isRelative())) { if (!fStandardUriConformant) { XMLBufBid ddSys(&fBufMgr); XMLBuffer& resolvedSysId = ddSys.getBuffer(); XMLUri::normalizeURI(expSysId.getRawBuffer(), resolvedSysId); srcToFill = new (fMemoryManager) LocalFileInputSource ( lastInfo.systemId , resolvedSysId.getRawBuffer() , fMemoryManager ); } else ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_MalformedURL, fMemoryManager); } else { if (fStandardUriConformant && urlTmp.hasInvalidChar()) ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_MalformedURL, fMemoryManager); srcToFill = new (fMemoryManager) URLInputSource(urlTmp, fMemoryManager); } } // Put a janitor on the input source Janitor janSrc(srcToFill); // Check if this exact schema has already been seen. // const XMLCh* sysId = srcToFill->getSystemId(); unsigned int uriId = (uri && *uri) ? fURIStringPool->addOrFind(uri) : fEmptyNamespaceId; SchemaInfo* importSchemaInfo = 0; if (fUseCachedGrammar) importSchemaInfo = fCachedSchemaInfoList->get(sysId, uriId); if (!importSchemaInfo && !fToCacheGrammar) importSchemaInfo = fSchemaInfoList->get(sysId, uriId); if (importSchemaInfo) { // We haven't added any new grammars so it is safe to just // return. // return; } // Should just issue warning if the schema is not found bool flag = srcToFill->getIssueFatalErrorIfNotFound(); srcToFill->setIssueFatalErrorIfNotFound(false); parser.parse(*srcToFill); // Reset the InputSource srcToFill->setIssueFatalErrorIfNotFound(flag); if (parser.getSawFatal() && fExitOnFirstFatal) emitError(XMLErrs::SchemaScanFatalError); DOMDocument* document = parser.getDocument(); //Our Grammar if (document != 0) { DOMElement* root = document->getDocumentElement();// This is what we pass to TraverserSchema if (root != 0) { const XMLCh* newUri = root->getAttribute(SchemaSymbols::fgATT_TARGETNAMESPACE); bool newGrammar = false; if (!XMLString::equals(newUri, uri)) { if (fValidate || fValScheme == Val_Auto) { fValidator->emitError(XMLValid::WrongTargetNamespace, loc, uri); } grammar = fGrammarResolver->getGrammar(newUri); newGrammar = true; } if (!grammar || grammar->getGrammarType() == Grammar::DTDGrammarType || (getHandleMultipleImports() && ((XMLSchemaDescription*)grammar->getGrammarDescription())-> getContextType () == XMLSchemaDescription::CONTEXT_IMPORT)) { // If we switched namespace URI, recheck the schema info. // if (newGrammar) { unsigned int newUriId = (newUri && *newUri) ? fURIStringPool->addOrFind(newUri) : fEmptyNamespaceId; if (fUseCachedGrammar) importSchemaInfo = fCachedSchemaInfoList->get(sysId, newUriId); if (!importSchemaInfo && !fToCacheGrammar) importSchemaInfo = fSchemaInfoList->get(sysId, newUriId); if (importSchemaInfo) return; } // Since we have seen a grammar, set our validation flag // at this point if the validation scheme is auto if (fValScheme == Val_Auto && !fValidate) { fValidate = true; fElemStack.setValidationFlag(fValidate); } // we have seen a schema, so set up the fValidator as fSchemaValidator if (!fValidator->handlesSchema()) { if (fValidatorFromUser) { // the fValidator is from user ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Gen_NoSchemaValidator, fMemoryManager); } else { fValidator = fSchemaValidator; } } bool grammarFound = grammar && grammar->getGrammarType() == Grammar::SchemaGrammarType; SchemaGrammar* schemaGrammar; if (grammarFound) { schemaGrammar = (SchemaGrammar*) grammar; } else { schemaGrammar = new (fGrammarPoolMemoryManager) SchemaGrammar(fGrammarPoolMemoryManager); } XMLSchemaDescription* gramDesc = (XMLSchemaDescription*) schemaGrammar->getGrammarDescription(); gramDesc->setContextType(XMLSchemaDescription::CONTEXT_PREPARSE); gramDesc->setLocationHints(sysId); TraverseSchema traverseSchema ( root , fURIStringPool , schemaGrammar , fGrammarResolver , fUseCachedGrammar ? fCachedSchemaInfoList : fSchemaInfoList , fToCacheGrammar ? fCachedSchemaInfoList : fSchemaInfoList , this , sysId , fEntityHandler , fErrorReporter , fMemoryManager , grammarFound ); // Reset the now invalid schema roots in the collected // schema info entries. // { RefHash2KeysTableOfEnumerator i ( fToCacheGrammar ? fCachedSchemaInfoList : fSchemaInfoList); while (i.hasMoreElements ()) i.nextElement().resetRoot (); } if (fGrammarType == Grammar::DTDGrammarType) { fGrammar = schemaGrammar; fGrammarType = Grammar::SchemaGrammarType; fValidator->setGrammar(fGrammar); } if (fValidate) { // validate the Schema scan so far fValidator->preContentValidation(false); } } } } } } else { // Since we have seen a grammar, set our validation flag // at this point if the validation scheme is auto if (fValScheme == Val_Auto && !fValidate) { fValidate = true; fElemStack.setValidationFlag(fValidate); } // we have seen a schema, so set up the fValidator as fSchemaValidator if (!fValidator->handlesSchema()) { if (fValidatorFromUser) { // the fValidator is from user ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Gen_NoSchemaValidator, fMemoryManager); } else { fValidator = fSchemaValidator; } } if (fGrammarType == Grammar::DTDGrammarType) { fGrammar = grammar; fGrammarType = Grammar::SchemaGrammarType; fValidator->setGrammar(fGrammar); } } // fModel may need updating: if(getPSVIHandler()) fModel = fGrammarResolver->getXSModel(); } InputSource* IGXMLScanner::resolveSystemId(const XMLCh* const sysId ,const XMLCh* const pubId) { //Normalize sysId XMLBufBid nnSys(&fBufMgr); XMLBuffer& normalizedSysId = nnSys.getBuffer(); XMLString::removeChar(sysId, 0xFFFF, normalizedSysId); const XMLCh* normalizedURI = normalizedSysId.getRawBuffer(); // Create a buffer for expanding the system id XMLBufBid bbSys(&fBufMgr); XMLBuffer& expSysId = bbSys.getBuffer(); // Allow the entity handler to expand the system id if they choose // to do so. InputSource* srcToFill = 0; if (fEntityHandler) { if (!fEntityHandler->expandSystemId(normalizedURI, expSysId)) expSysId.set(normalizedURI); ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr.getLastExtEntityInfo(lastInfo); XMLResourceIdentifier resourceIdentifier(XMLResourceIdentifier::ExternalEntity, expSysId.getRawBuffer(), 0, pubId, lastInfo.systemId, &fReaderMgr); srcToFill = fEntityHandler->resolveEntity(&resourceIdentifier); } else { expSysId.set(normalizedURI); } // If they didn't create a source via the entity handler, then we // have to create one on our own. if (!srcToFill) { if (fDisableDefaultEntityResolution) return srcToFill; ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr.getLastExtEntityInfo(lastInfo); XMLURL urlTmp(fMemoryManager); if ((!urlTmp.setURL(lastInfo.systemId, expSysId.getRawBuffer(), urlTmp)) || (urlTmp.isRelative())) { if (!fStandardUriConformant) { XMLBufBid ddSys(&fBufMgr); XMLBuffer& resolvedSysId = ddSys.getBuffer(); XMLUri::normalizeURI(expSysId.getRawBuffer(), resolvedSysId); srcToFill = new (fMemoryManager) LocalFileInputSource ( lastInfo.systemId , resolvedSysId.getRawBuffer() , fMemoryManager ); } else ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_MalformedURL, fMemoryManager); } else { if (fStandardUriConformant && urlTmp.hasInvalidChar()) ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_MalformedURL, fMemoryManager); srcToFill = new (fMemoryManager) URLInputSource(urlTmp, fMemoryManager); } } return srcToFill; } // --------------------------------------------------------------------------- // IGXMLScanner: Private grammar preparsing methods // --------------------------------------------------------------------------- Grammar* IGXMLScanner::loadXMLSchemaGrammar(const InputSource& src, const bool toCache) { // Reset the validators fSchemaValidator->reset(); fSchemaValidator->setErrorReporter(fErrorReporter); fSchemaValidator->setExitOnFirstFatal(fExitOnFirstFatal); fSchemaValidator->setGrammarResolver(fGrammarResolver); if (fValidatorFromUser) fValidator->reset(); if (!fValidator->handlesSchema()) { if (fValidatorFromUser && fValidate) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Gen_NoSchemaValidator, fMemoryManager); else { fValidator = fSchemaValidator; } } XSDDOMParser parser(0, fMemoryManager, 0); parser.setValidationScheme(XercesDOMParser::Val_Never); parser.setDoNamespaces(true); parser.setUserEntityHandler(fEntityHandler); parser.setUserErrorReporter(fErrorReporter); // Should just issue warning if the schema is not found bool flag = src.getIssueFatalErrorIfNotFound(); ((InputSource&) src).setIssueFatalErrorIfNotFound(false); parser.parse(src); // Reset the InputSource ((InputSource&) src).setIssueFatalErrorIfNotFound(flag); if (parser.getSawFatal() && fExitOnFirstFatal) emitError(XMLErrs::SchemaScanFatalError); DOMDocument* document = parser.getDocument(); //Our Grammar if (document != 0) { DOMElement* root = document->getDocumentElement();// This is what we pass to TraverserSchema if (root != 0) { const XMLCh* nsUri = root->getAttribute(SchemaSymbols::fgATT_TARGETNAMESPACE); Grammar* grammar = fGrammarResolver->getGrammar(nsUri); // Check if this exact schema has already been seen. // const XMLCh* sysId = src.getSystemId(); SchemaInfo* importSchemaInfo = 0; if (grammar) { if (nsUri && *nsUri) importSchemaInfo = fCachedSchemaInfoList->get(sysId, fURIStringPool->addOrFind(nsUri)); else importSchemaInfo = fCachedSchemaInfoList->get(sysId, fEmptyNamespaceId); } if (!importSchemaInfo) { bool grammarFound = grammar && grammar->getGrammarType() == Grammar::SchemaGrammarType && getHandleMultipleImports(); SchemaGrammar* schemaGrammar; if (grammarFound) schemaGrammar = (SchemaGrammar*) grammar; else schemaGrammar = new (fGrammarPoolMemoryManager) SchemaGrammar(fGrammarPoolMemoryManager); XMLSchemaDescription* gramDesc = (XMLSchemaDescription*) schemaGrammar->getGrammarDescription(); gramDesc->setContextType(XMLSchemaDescription::CONTEXT_PREPARSE); gramDesc->setLocationHints(sysId); TraverseSchema traverseSchema ( root , fURIStringPool , schemaGrammar , fGrammarResolver , fCachedSchemaInfoList , toCache ? fCachedSchemaInfoList : fSchemaInfoList , this , sysId , fEntityHandler , fErrorReporter , fMemoryManager , grammarFound ); grammar = schemaGrammar; // Reset the now invalid schema roots in the collected // schema info entries. // { RefHash2KeysTableOfEnumerator i ( toCache ? fCachedSchemaInfoList : fSchemaInfoList); while (i.hasMoreElements ()) i.nextElement().resetRoot (); } } if (fValidate) { // validate the Schema scan so far fValidator->setGrammar(grammar); fValidator->preContentValidation(false); } if (toCache) { fGrammarResolver->cacheGrammars(); } if(getPSVIHandler()) fModel = fGrammarResolver->getXSModel(); return grammar; } } return 0; } // --------------------------------------------------------------------------- // IGXMLScanner: Private parsing methods // --------------------------------------------------------------------------- // This method is called to do a raw scan of an attribute value. It does not // do normalization (since we don't know their types yet.) It just scans the // value and does entity expansion. // // End of entity's must be dealt with here. During DTD scan, they can come // from external entities. During content, they can come from any entity. // We just eat the end of entity and continue with our scan until we come // to the closing quote. If an unterminated value causes us to go through // subsequent entities, that will cause errors back in the calling code, // but there's little we can do about it here. bool IGXMLScanner::basicAttrValueScan(const XMLCh* const attrName, XMLBuffer& toFill) { // Reset the target buffer toFill.reset(); // Get the next char which must be a single or double quote XMLCh quoteCh; if (!fReaderMgr.skipIfQuote(quoteCh)) return false; // We have to get the current reader because we have to ignore closing // quotes until we hit the same reader again. const XMLSize_t curReader = fReaderMgr.getCurrentReaderNum(); // Loop until we get the attribute value. Note that we use a double // loop here to avoid the setup/teardown overhead of the exception // handler on every round. while (true) { try { while(true) { XMLCh nextCh = fReaderMgr.getNextChar(); if (nextCh != quoteCh) { if (nextCh != chAmpersand) { if ((nextCh < 0xD800) || (nextCh > 0xDFFF)) { // Its got to at least be a valid XML character if (!fReaderMgr.getCurrentReader()->isXMLChar(nextCh)) { if (nextCh == 0) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); emitError(XMLErrs::InvalidCharacterInAttrValue, attrName, tmpBuf); } } else // its a surrogate { // Deal with surrogate pairs // we expect a a leading surrogate. if (nextCh <= 0xDBFF) { toFill.append(nextCh); // process the trailing surrogate nextCh = fReaderMgr.getNextChar(); // it should be a trailing surrogate. if ((nextCh < 0xDC00) || (nextCh > 0xDFFF)) { emitError(XMLErrs::Expected2ndSurrogateChar); } } else { // Its a trailing surrogate, but we are not expecting it emitError(XMLErrs::Unexpected2ndSurrogateChar); } } } else // its a chAmpersand { // Check for an entity ref . We ignore the empty flag in // this one. bool escaped; XMLCh firstCh; XMLCh secondCh ; // If it was not returned directly, then jump back up if (scanEntityRef(true, firstCh, secondCh, escaped) == EntityExp_Returned) { // If it was escaped, then put in a 0xFFFF value. This will // be used later during validation and normalization of the // value to know that the following character was via an // escape char. if (escaped) toFill.append(0xFFFF); toFill.append(firstCh); if (secondCh) toFill.append(secondCh); } continue; } } else // its a quoteCh { // Check for our ending quote. It has to be in the same entity // as where we started. Quotes in nested entities are ignored. if (curReader == fReaderMgr.getCurrentReaderNum()) { return true; } // Watch for spillover into a previous entity if (curReader > fReaderMgr.getCurrentReaderNum()) { emitError(XMLErrs::PartialMarkupInEntity); return false; } } // add it to the buffer toFill.append(nextCh); } } catch(const EndOfEntityException&) { // Just eat it and continue. } } return true; } bool IGXMLScanner::scanAttValue( const XMLAttDef* const attDef , const XMLCh* const attrName , XMLBuffer& toFill) { enum States { InWhitespace , InContent }; // Get the type and name const XMLAttDef::AttTypes type = (attDef) ?attDef->getType() :XMLAttDef::CData; // Reset the target buffer toFill.reset(); // Get the next char which must be a single or double quote XMLCh quoteCh; if (!fReaderMgr.skipIfQuote(quoteCh)) return false; // We have to get the current reader because we have to ignore closing // quotes until we hit the same reader again. const XMLSize_t curReader = fReaderMgr.getCurrentReaderNum(); // check to see if it's a tokenized type that is declared externally bool isAttTokenizedExternal = (attDef) ?attDef->isExternal() && (type == XMLAttDef::ID || type == XMLAttDef::IDRef || type == XMLAttDef::IDRefs || type == XMLAttDef::Entity || type == XMLAttDef::Entities || type == XMLAttDef::NmToken || type == XMLAttDef::NmTokens) :false; // Loop until we get the attribute value. Note that we use a double // loop here to avoid the setup/teardown overhead of the exception // handler on every round. XMLCh nextCh; XMLCh secondCh = 0; States curState = InContent; bool firstNonWS = false; bool gotLeadingSurrogate = false; bool escaped; while (true) { try { while(true) { nextCh = fReaderMgr.getNextChar(); if (!nextCh) ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); // Check for our ending quote in the same entity if (nextCh == quoteCh) { if (curReader == fReaderMgr.getCurrentReaderNum()) return true; // Watch for spillover into a previous entity if (curReader > fReaderMgr.getCurrentReaderNum()) { emitError(XMLErrs::PartialMarkupInEntity); return false; } } // Check for an entity ref now, before we let it affect our // whitespace normalization logic below. We ignore the empty flag // in this one. escaped = false; if (nextCh == chAmpersand) { if (scanEntityRef(true, nextCh, secondCh, escaped) != EntityExp_Returned) { gotLeadingSurrogate = false; continue; } } else if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { // Deal with surrogate pairs // Its a leading surrogate. If we already got one, then // issue an error, else set leading flag to make sure that // we look for a trailing next time. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); else gotLeadingSurrogate = true; } else { // If its a trailing surrogate, make sure that we are // prepared for that. Else, its just a regular char so make // sure that we were not expected a trailing surrogate. if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) { // Its trailing, so make sure we were expecting it if (!gotLeadingSurrogate) emitError(XMLErrs::Unexpected2ndSurrogateChar); } else { // Its just a char, so make sure we were not expecting a // trailing surrogate. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); // Its got to at least be a valid XML character if (!fReaderMgr.getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); emitError(XMLErrs::InvalidCharacterInAttrValue, attrName, tmpBuf); } } gotLeadingSurrogate = false; } // If its not escaped, then make sure its not a < character, which // is not allowed in attribute values. if (!escaped && (nextCh == chOpenAngle)) emitError(XMLErrs::BracketInAttrValue, attrName); // If the attribute is a CDATA type we do simple replacement of // tabs and new lines with spaces, if the character is not escaped // by way of a char ref. // // Otherwise, we do the standard non-CDATA normalization of // compressing whitespace to single spaces and getting rid of leading // and trailing whitespace. if (type == XMLAttDef::CData) { if (!escaped) { if ((nextCh == 0x09) || (nextCh == 0x0A) || (nextCh == 0x0D)) { // Check Validity Constraint for Standalone document declaration // XML 1.0, Section 2.9 if (fStandalone && fValidate && isAttTokenizedExternal) { // Can't have a standalone document declaration of "yes" if attribute // values are subject to normalisation fValidator->emitError(XMLValid::NoAttNormForStandalone, attrName); } nextCh = chSpace; } } } else { if (curState == InWhitespace) { if ((escaped && nextCh != chSpace) || !fReaderMgr.getCurrentReader()->isWhitespace(nextCh)) { if (firstNonWS) toFill.append(chSpace); curState = InContent; firstNonWS = true; } else { continue; } } else if (curState == InContent) { if ((nextCh == chSpace) || (fReaderMgr.getCurrentReader()->isWhitespace(nextCh) && !escaped)) { curState = InWhitespace; // Check Validity Constraint for Standalone document declaration // XML 1.0, Section 2.9 if (fStandalone && fValidate && isAttTokenizedExternal) { if (!firstNonWS || (nextCh != chSpace && fReaderMgr.lookingAtSpace())) { // Can't have a standalone document declaration of "yes" if attribute // values are subject to normalisation fValidator->emitError(XMLValid::NoAttNormForStandalone, attrName); } } continue; } firstNonWS = true; } } // Else add it to the buffer toFill.append(nextCh); if (secondCh) { toFill.append(secondCh); secondCh=0; } } } catch(const EndOfEntityException&) { // Just eat it and continue. gotLeadingSurrogate = false; escaped = false; } } return true; } // This method scans a CDATA section. It collects the character into one // of the temp buffers and calls the document handler, if any, with the // characters. It assumes that the getGrammarType() == Grammar::SchemaGrammarType) { // And see if the current element is a 'Children' style content model ComplexTypeInfo *currType = ((SchemaValidator*)fValidator)->getCurrentTypeInfo(); if(currType) { SchemaElementDecl::ModelTypes modelType = (SchemaElementDecl::ModelTypes) currType->getContentType(); if(modelType == SchemaElementDecl::Children || modelType == SchemaElementDecl::ElementOnlyEmpty) charOpts = XMLElementDecl::SpacesOk; else if(modelType == SchemaElementDecl::Empty) charOpts = XMLElementDecl::NoCharData; } } else // DTD grammar charOpts = topElem->fThisElement->getCharDataOpts(); while (true) { const XMLCh nextCh = fReaderMgr.getNextChar(); // Watch for unexpected end of file if (!nextCh) { emitError(XMLErrs::UnterminatedCDATASection); ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager); } if (fValidate && fStandalone && (fReaderMgr.getCurrentReader()->isWhitespace(nextCh))) { // This document is standalone; this ignorable CDATA whitespace is forbidden. // XML 1.0, Section 2.9 // And see if the current element is a 'Children' style content model if (topElem->fThisElement->isExternal()) { if (charOpts == XMLElementDecl::SpacesOk) // Element Content { // Error - standalone should have a value of "no" as whitespace detected in an // element type with element content whose element declaration was external fValidator->emitError(XMLValid::NoWSForStandalone); if(fGrammarType == Grammar::SchemaGrammarType) { if (getPSVIHandler()) { // REVISIT: // PSVIElement->setValidity(PSVIItem::VALIDITY_INVALID); } } } } } // If this is a close square bracket it could be our closing // sequence. if (nextCh == chCloseSquare && fReaderMgr.skippedString(CDataClose)) { // make sure we were not expecting a trailing surrogate. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); if (fGrammarType == Grammar::SchemaGrammarType) { XMLSize_t xsLen = bbCData.getLen(); const XMLCh* xsNormalized = bbCData.getRawBuffer(); DatatypeValidator* tempDV = ((SchemaValidator*) fValidator)->getCurrentDatatypeValidator(); if (tempDV && tempDV->getWSFacet() != DatatypeValidator::PRESERVE) { // normalize the character according to schema whitespace facet ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, xsNormalized, fWSNormalizeBuf); xsNormalized = fWSNormalizeBuf.getRawBuffer(); xsLen = fWSNormalizeBuf.getLen(); if (fNormalizeData && fValidate) { bbCData.set(xsNormalized); } } if (fValidate) { // tell the schema validation about the character data for checkContent later ((SchemaValidator*)fValidator)->setDatatypeBuffer(xsNormalized); if (charOpts != XMLElementDecl::AllCharData) { // They definitely cannot handle any type of char data fValidator->emitError(XMLValid::NoCharDataInCM); if (getPSVIHandler()) { // REVISIT: // PSVIElement->setValidity(PSVIItem::VALIDITY_INVALID); } } } // call all active identity constraints if (toCheckIdentityConstraint() && fICHandler->getMatcherCount()) { fContent.append(xsNormalized, xsLen); } } else { if (fValidate) { if (charOpts != XMLElementDecl::AllCharData) { // They definitely cannot handle any type of char data fValidator->emitError(XMLValid::NoCharDataInCM); } } } // If we have a doc handler, call it if (fDocHandler) { fDocHandler->docCharacters( bbCData.getRawBuffer(), bbCData.getLen(), true ); } // And we are done break; } // Make sure its a valid character. But if we've emitted an error // already, don't bother with the overhead since we've already told // them about it. if (!emittedError) { // Deal with surrogate pairs if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { // Its a leading surrogate. If we already got one, then // issue an error, else set leading flag to make sure that // we look for a trailing next time. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); else gotLeadingSurrogate = true; } else { // If its a trailing surrogate, make sure that we are // prepared for that. Else, its just a regular char so make // sure that we were not expected a trailing surrogate. if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) { // Its trailing, so make sure we were expecting it if (!gotLeadingSurrogate) emitError(XMLErrs::Unexpected2ndSurrogateChar); } else { // Its just a char, so make sure we were not expecting a // trailing surrogate. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); // Its got to at least be a valid XML character else if (!fReaderMgr.getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); emitError(XMLErrs::InvalidCharacter, tmpBuf); emittedError = true; } } gotLeadingSurrogate = false; } } // Add it to the buffer bbCData.append(nextCh); } } void IGXMLScanner::scanCharData(XMLBuffer& toUse) { // We have to watch for the stupid ]]> sequence, which is illegal in // character data. So this is a little state machine that handles that. enum States { State_Waiting , State_GotOne , State_GotTwo }; // Reset the buffer before we start toUse.reset(); // Turn on the 'throw at end' flag of the reader manager ThrowEOEJanitor jan(&fReaderMgr, true); // In order to be more efficient we have to use kind of a deeply nested // set of blocks here. The outer block puts on a try and catches end of // entity exceptions. The inner loop is the per-character loop. If we // put the try inside the inner loop, it would work but would require // the exception handling code setup/teardown code to be invoked for // each character. XMLCh nextCh; XMLCh secondCh = 0; States curState = State_Waiting; bool escaped = false; bool gotLeadingSurrogate = false; bool notDone = true; while (notDone) { try { while (true) { // Eat through as many plain content characters as possible without // needing special handling. Moving most content characters here, // in this one call, rather than running the overall loop once // per content character, is a speed optimization. if (curState == State_Waiting && !gotLeadingSurrogate) { fReaderMgr.movePlainContentChars(toUse); } // Try to get another char from the source // The code from here on down covers all contengencies, if (!fReaderMgr.getNextCharIfNot(chOpenAngle, nextCh)) { // If we were waiting for a trailing surrogate, its an error if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); notDone = false; break; } // Watch for a reference. Note that the escapement mechanism // is ignored in this content. escaped = false; if (nextCh == chAmpersand) { sendCharData(toUse); // Turn off the throwing at the end of entity during this ThrowEOEJanitor jan(&fReaderMgr, false); if (scanEntityRef(false, nextCh, secondCh, escaped) != EntityExp_Returned) { gotLeadingSurrogate = false; continue; } else { if (escaped && !fElemStack.isEmpty()) fElemStack.setReferenceEscaped(); } } else if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { // Deal with surrogate pairs // Its a leading surrogate. If we already got one, then // issue an error, else set leading flag to make sure that // we look for a trailing next time. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); else gotLeadingSurrogate = true; } else { // If its a trailing surrogate, make sure that we are // prepared for that. Else, its just a regular char so make // sure that we were not expected a trailing surrogate. if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) { // Its trailing, so make sure we were expecting it if (!gotLeadingSurrogate) emitError(XMLErrs::Unexpected2ndSurrogateChar); } else { // Its just a char, so make sure we were not expecting a // trailing surrogate. if (gotLeadingSurrogate) emitError(XMLErrs::Expected2ndSurrogateChar); // Make sure the returned char is a valid XML char if (!fReaderMgr.getCurrentReader()->isXMLChar(nextCh)) { XMLCh tmpBuf[9]; XMLString::binToText ( nextCh , tmpBuf , 8 , 16 , fMemoryManager ); emitError(XMLErrs::InvalidCharacter, tmpBuf); } } gotLeadingSurrogate = false; } // Keep the state machine up to date if (!escaped) { if (nextCh == chCloseSquare) { if (curState == State_Waiting) curState = State_GotOne; else if (curState == State_GotOne) curState = State_GotTwo; } else if (nextCh == chCloseAngle) { if (curState == State_GotTwo) emitError(XMLErrs::BadSequenceInCharData); curState = State_Waiting; } else { curState = State_Waiting; } } else { curState = State_Waiting; } // Add this char to the buffer toUse.append(nextCh); if (secondCh) { toUse.append(secondCh); secondCh=0; } } } catch(const EndOfEntityException& toCatch) { // Some entity ended, so we have to send any accumulated // chars and send an end of entity event. sendCharData(toUse); gotLeadingSurrogate = false; if (fDocHandler) fDocHandler->endEntityReference(toCatch.getEntity()); } } // Check the validity constraints as per XML 1.0 Section 2.9 if (fValidate && fStandalone) { // See if the text contains whitespace // Get the raw data we need for the callback const XMLCh* rawBuf = toUse.getRawBuffer(); const XMLSize_t len = toUse.getLen(); const bool isSpaces = fReaderMgr.getCurrentReader()->containsWhiteSpace(rawBuf, len); if (isSpaces) { // And see if the current element is a 'Children' style content model const ElemStack::StackElem* topElem = fElemStack.topElement(); if (topElem->fThisElement->isExternal()) { // Get the character data opts for the current element XMLElementDecl::CharDataOpts charOpts = XMLElementDecl::AllCharData; if(fGrammar->getGrammarType() == Grammar::SchemaGrammarType) { // And see if the current element is a 'Children' style content model ComplexTypeInfo *currType = ((SchemaValidator*)fValidator)->getCurrentTypeInfo(); if(currType) { SchemaElementDecl::ModelTypes modelType = (SchemaElementDecl::ModelTypes) currType->getContentType(); if(modelType == SchemaElementDecl::Children || modelType == SchemaElementDecl::ElementOnlyEmpty) charOpts = XMLElementDecl::SpacesOk; else if(modelType == SchemaElementDecl::Empty) charOpts = XMLElementDecl::NoCharData; } } else // DTD grammar charOpts = topElem->fThisElement->getCharDataOpts(); if (charOpts == XMLElementDecl::SpacesOk) // => Element Content { // Error - standalone should have a value of "no" as whitespace detected in an // element type with element content whose element declaration was external // fValidator->emitError(XMLValid::NoWSForStandalone); if(fGrammarType == Grammar::SchemaGrammarType) { if (getPSVIHandler()) { // REVISIT: // PSVIElement->setValidity(PSVIItem::VALIDITY_INVALID); } } } } } } // Send any char data that we accumulated into the buffer sendCharData(toUse); } // This method will scan a general/character entity ref. It will either // expand a char ref and return it directly, or push a reader for a general // entity. // // The return value indicates whether the char parameters hold the value // or whether the value was pushed as a reader, or that it failed. // // The escaped flag tells the caller whether the returned parameter resulted // from a character reference, which escapes the character in some cases. It // only makes any difference if the return value indicates the value was // returned directly. IGXMLScanner::EntityExpRes IGXMLScanner::scanEntityRef( const bool inAttVal , XMLCh& firstCh , XMLCh& secondCh , bool& escaped) { // Assume no escape secondCh = 0; escaped = false; // We have to insure that its all in one entity const XMLSize_t curReader = fReaderMgr.getCurrentReaderNum(); // If the next char is a pound, then its a character reference and we // need to expand it always. if (fReaderMgr.skippedChar(chPound)) { // Its a character reference, so scan it and get back the numeric // value it represents. if (!scanCharRef(firstCh, secondCh)) return EntityExp_Failed; escaped = true; if (curReader != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialMarkupInEntity); return EntityExp_Returned; } // Expand it since its a normal entity ref XMLBufBid bbName(&fBufMgr); int colonPosition; bool validName = fDoNamespaces ? fReaderMgr.getQName(bbName.getBuffer(), &colonPosition) : fReaderMgr.getName(bbName.getBuffer()); if (!validName) { if (bbName.isEmpty()) emitError(XMLErrs::ExpectedEntityRefName); else emitError(XMLErrs::InvalidEntityRefName, bbName.getRawBuffer()); return EntityExp_Failed; } // Next char must be a semi-colon. But if its not, just emit // an error and try to continue. if (!fReaderMgr.skippedChar(chSemiColon)) emitError(XMLErrs::UnterminatedEntityRef, bbName.getRawBuffer()); // Make sure we ended up on the same entity reader as the & char if (curReader != fReaderMgr.getCurrentReaderNum()) emitError(XMLErrs::PartialMarkupInEntity); // Look up the name in the general entity pool XMLEntityDecl* decl = fDTDGrammar->getEntityDecl(bbName.getRawBuffer()); // If it does not exist, then obviously an error if (!decl) { // XML 1.0 Section 4.1 // Well-formedness Constraint for entity not found: // In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, // or a document with "standalone='yes'", for an entity reference that does not occur within the external subset // or a parameter entity // // Else it's Validity Constraint if (fStandalone || fHasNoDTD) emitError(XMLErrs::EntityNotFound, bbName.getRawBuffer()); else { if (fValidate) fValidator->emitError(XMLValid::VC_EntityNotFound, bbName.getRawBuffer()); } return EntityExp_Failed; } // XML 1.0 Section 4.1 // If we are a standalone document, then it has to have been declared // in the internal subset. if (fStandalone && !decl->getDeclaredInIntSubset()) emitError(XMLErrs::IllegalRefInStandalone, bbName.getRawBuffer()); if (decl->isExternal()) { // If its unparsed, then its not valid here if (decl->isUnparsed()) { emitError(XMLErrs::NoUnparsedEntityRefs, bbName.getRawBuffer()); return EntityExp_Failed; } // If we are in an attribute value, then not valid but keep going if (inAttVal) emitError(XMLErrs::NoExtRefsInAttValue); // And now create a reader to read this entity InputSource* srcUsed; XMLReader* reader = fReaderMgr.createReader ( decl->getBaseURI() , decl->getSystemId() , decl->getPublicId() , false , XMLReader::RefFrom_NonLiteral , XMLReader::Type_General , XMLReader::Source_External , srcUsed , fCalculateSrcOfs , fLowWaterMark , fDisableDefaultEntityResolution ); // Put a janitor on the source so it gets cleaned up on exit Janitor janSrc(srcUsed); // If the creation failed, and its not because the source was empty, // then emit an error and return. if (!reader) ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::Gen_CouldNotOpenExtEntity, srcUsed ? srcUsed->getSystemId() : decl->getSystemId(), fMemoryManager); // Push the reader. If its a recursive expansion, then emit an error // and return an failure. if (!fReaderMgr.pushReader(reader, decl)) { emitError(XMLErrs::RecursiveEntity, decl->getName()); return EntityExp_Failed; } // here's where we need to check if there's a SecurityManager, // how many entity references we've had if(fSecurityManager != 0 && ++fEntityExpansionCount > fEntityExpansionLimit) { XMLCh expLimStr[32]; XMLString::sizeToText(fEntityExpansionLimit, expLimStr, 31, 10, fMemoryManager); emitError ( XMLErrs::EntityExpansionLimitExceeded , expLimStr ); // there seems nothing better to be done than to reset the entity expansion counter fEntityExpansionCount = 0; } // Do a start entity reference event. // // For now, we supress them in att values. Later, when // the stuff is in place to correctly allow DOM to handle them // we'll turn this back on. if (fDocHandler && !inAttVal) fDocHandler->startEntityReference(*decl); // If it starts with the XML string, then parse a text decl if (checkXMLDecl(true)) scanXMLDecl(Decl_Text); } else { // If its one of the special char references, then we can return // it as a character, and its considered escaped. if (decl->getIsSpecialChar()) { firstCh = decl->getValue()[0]; escaped = true; return EntityExp_Returned; } // Create a reader over a memory stream over the entity value // We force it to assume UTF-16 by passing in an encoding // string. This way it won't both trying to predecode the // first line, looking for an XML/TextDecl. XMLReader* valueReader = fReaderMgr.createIntEntReader ( decl->getName() , XMLReader::RefFrom_NonLiteral , XMLReader::Type_General , decl->getValue() , decl->getValueLen() , false ); // Try to push the entity reader onto the reader manager stack, // where it will become the subsequent input. If it fails, that // means the entity is recursive, so issue an error. The reader // will have just been discarded, but we just keep going. if (!fReaderMgr.pushReader(valueReader, decl)) emitError(XMLErrs::RecursiveEntity, decl->getName()); // here's where we need to check if there's a SecurityManager, // how many entity references we've had if(fSecurityManager != 0 && ++fEntityExpansionCount > fEntityExpansionLimit) { XMLCh expLimStr[32]; XMLString::sizeToText(fEntityExpansionLimit, expLimStr, 31, 10, fMemoryManager); emitError ( XMLErrs::EntityExpansionLimitExceeded , expLimStr ); } // Do a start entity reference event. // // For now, we supress them in att values. Later, when // the stuff is in place to correctly allow DOM to handle them // we'll turn this back on. if (fDocHandler && !inAttVal) fDocHandler->startEntityReference(*decl); // If it starts with the XML string, then it's an error if (checkXMLDecl(true)) { emitError(XMLErrs::TextDeclNotLegalHere); fReaderMgr.skipPastChar(chCloseAngle); } } return EntityExp_Pushed; } bool IGXMLScanner::switchGrammar(const XMLCh* const newGrammarNameSpace) { Grammar* tempGrammar = fGrammarResolver->getGrammar(newGrammarNameSpace); if (!tempGrammar && !fSkipDTDValidation) { // This is a case where namespaces is on with a DTD grammar. tempGrammar = fDTDGrammar; } if (!tempGrammar) { return false; } else { Grammar::GrammarType tempGrammarType = tempGrammar->getGrammarType(); if (tempGrammarType == Grammar::SchemaGrammarType && !fValidator->handlesSchema()) { if (fValidatorFromUser) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Gen_NoSchemaValidator, fMemoryManager); else { fValidator = fSchemaValidator; } } else if (tempGrammarType == Grammar::DTDGrammarType) { if (fSkipDTDValidation) { return false; } if (!fValidator->handlesDTD()) { if (fValidatorFromUser) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Gen_NoDTDValidator, fMemoryManager); else { fValidator = fDTDValidator; } } } fGrammarType = tempGrammarType; fGrammar = tempGrammar; fValidator->setGrammar(fGrammar); return true; } } // check if we should skip or lax the validation of the element // if skip - no validation // if lax - validate only if the element if found bool IGXMLScanner::laxElementValidation(QName* element, ContentLeafNameTypeVector* cv, const XMLContentModel* const cm, const XMLSize_t parentElemDepth) { bool skipThisOne = false; bool laxThisOne = false; unsigned int elementURI = element->getURI(); unsigned int currState = fElemState[parentElemDepth]; unsigned int currLoop = fElemLoopState[parentElemDepth]; if (currState == XMLContentModel::gInvalidTrans) { return laxThisOne; } SubstitutionGroupComparator comparator(fGrammarResolver, fURIStringPool); if (cv) { XMLSize_t i = 0; XMLSize_t leafCount = cv->getLeafCount(); unsigned int nextState = 0; for (; i < leafCount; i++) { QName* fElemMap = cv->getLeafNameAt(i); unsigned int uri = fElemMap->getURI(); ContentSpecNode::NodeTypes type = cv->getLeafTypeAt(i); if (type == ContentSpecNode::Leaf) { if (((uri == elementURI) && XMLString::equals(fElemMap->getLocalPart(), element->getLocalPart())) || comparator.isEquivalentTo(element, fElemMap)) { nextState = cm->getNextState(currState, i); if (nextState != XMLContentModel::gInvalidTrans) break; } } else if ((type & 0x0f) == ContentSpecNode::Any) { nextState = cm->getNextState(currState, i); if (nextState != XMLContentModel::gInvalidTrans) break; } else if ((type & 0x0f) == ContentSpecNode::Any_Other) { if (uri != elementURI && elementURI != fEmptyNamespaceId) { nextState = cm->getNextState(currState, i); if (nextState != XMLContentModel::gInvalidTrans) break; } } else if ((type & 0x0f) == ContentSpecNode::Any_NS) { if (uri == elementURI) { nextState = cm->getNextState(currState, i); if (nextState != XMLContentModel::gInvalidTrans) break; } } } // for if (i == leafCount) { // no match fElemState[parentElemDepth] = XMLContentModel::gInvalidTrans; fElemLoopState[parentElemDepth] = 0; return laxThisOne; } unsigned int nextLoop = 0; if(!cm->handleRepetitions(element, currState, currLoop, nextState, nextLoop, i, &comparator)) { fElemState[parentElemDepth] = XMLContentModel::gInvalidTrans; fElemLoopState[parentElemDepth] = 0; return laxThisOne; } ContentSpecNode::NodeTypes type = cv->getLeafTypeAt(i); if ((type & 0x0f) == ContentSpecNode::Any || (type & 0x0f) == ContentSpecNode::Any_Other || (type & 0x0f) == ContentSpecNode::Any_NS) { if (type == ContentSpecNode::Any_Skip || type == ContentSpecNode::Any_NS_Skip || type == ContentSpecNode::Any_Other_Skip) { skipThisOne = true; } else if (type == ContentSpecNode::Any_Lax || type == ContentSpecNode::Any_NS_Lax || type == ContentSpecNode::Any_Other_Lax) { laxThisOne = true; } } fElemState[parentElemDepth] = nextState; fElemLoopState[parentElemDepth] = nextLoop; } // if if (skipThisOne) { fValidate = false; fElemStack.setValidationFlag(fValidate); } return laxThisOne; } // check if there is an AnyAttribute, and if so, see if we should lax or skip // if skip - no validation // if lax - validate only if the attribute if found bool IGXMLScanner::anyAttributeValidation(SchemaAttDef* attWildCard, unsigned int uriId, bool& skipThisOne, bool& laxThisOne) { XMLAttDef::AttTypes wildCardType = attWildCard->getType(); bool anyEncountered = false; skipThisOne = false; laxThisOne = false; if (wildCardType == XMLAttDef::Any_Any) anyEncountered = true; else if (wildCardType == XMLAttDef::Any_Other) { if (attWildCard->getAttName()->getURI() != uriId && uriId != fEmptyNamespaceId) anyEncountered = true; } else if (wildCardType == XMLAttDef::Any_List) { ValueVectorOf* nameURIList = attWildCard->getNamespaceList(); XMLSize_t listSize = (nameURIList) ? nameURIList->size() : 0; if (listSize) { for (XMLSize_t i=0; i < listSize; i++) { if (nameURIList->elementAt(i) == uriId) anyEncountered = true; } } } if (anyEncountered) { XMLAttDef::DefAttTypes defType = attWildCard->getDefaultType(); if (defType == XMLAttDef::ProcessContents_Skip) { // attribute should just be bypassed, skipThisOne = true; } else if (defType == XMLAttDef::ProcessContents_Lax) { laxThisOne = true; } } return anyEncountered; } inline XMLAttDefList& getAttDefList(bool isSchemaGrammar , ComplexTypeInfo* currType , XMLElementDecl* elemDecl) { if (isSchemaGrammar && currType) return currType->getAttDefList(); else return elemDecl->getAttDefList(); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/DGXMLScanner.hpp000644 000765 000024 00000015757 13241160334 023014 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DGXMLScanner.hpp 810580 2009-09-02 15:52:22Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DGXMLSCANNER_HPP) #define XERCESC_INCLUDE_GUARD_DGXMLSCANNER_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class DTDElementDecl; class DTDGrammar; class DTDValidator; // This is an integrated scanner class, which does DTD/XML Schema grammar // processing. class XMLPARSER_EXPORT DGXMLScanner : public XMLScanner { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- DGXMLScanner ( XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); DGXMLScanner ( XMLDocumentHandler* const docHandler , DocTypeHandler* const docTypeHandler , XMLEntityHandler* const entityHandler , XMLErrorReporter* const errReporter , XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~DGXMLScanner(); // ----------------------------------------------------------------------- // XMLScanner public virtual methods // ----------------------------------------------------------------------- virtual const XMLCh* getName() const; virtual NameIdPool* getEntityDeclPool(); virtual const NameIdPool* getEntityDeclPool() const; virtual void scanDocument ( const InputSource& src ); virtual bool scanNext(XMLPScanToken& toFill); virtual Grammar* loadGrammar ( const InputSource& src , const short grammarType , const bool toCache = false ); virtual Grammar::GrammarType getCurrentGrammarType() const; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- DGXMLScanner(); DGXMLScanner(const DGXMLScanner&); DGXMLScanner& operator=(const DGXMLScanner&); // ----------------------------------------------------------------------- // XMLScanner virtual methods // ----------------------------------------------------------------------- virtual void scanCDSection(); virtual void scanCharData(XMLBuffer& toToUse); virtual EntityExpRes scanEntityRef ( const bool inAttVal , XMLCh& firstCh , XMLCh& secondCh , bool& escaped ); virtual void scanDocTypeDecl(); virtual void scanReset(const InputSource& src); virtual void sendCharData(XMLBuffer& toSend); virtual InputSource* resolveSystemId(const XMLCh* const sysId ,const XMLCh* const pubId); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void commonInit(); void cleanUp(); XMLSize_t buildAttList ( const XMLSize_t attCount , XMLElementDecl* elemDecl , RefVectorOf& toFill ); void updateNSMap ( const XMLCh* const attrPrefix , const XMLCh* const attrLocalName , const XMLCh* const attrValue ); void scanAttrListforNameSpaces(RefVectorOf* theAttrList, XMLSize_t attCount, XMLElementDecl* elemDecl); // ----------------------------------------------------------------------- // Private scanning methods // ----------------------------------------------------------------------- bool scanAttValue ( const XMLAttDef* const attDef , const XMLCh *const attrName , XMLBuffer& toFill ); bool scanContent(); void scanEndTag(bool& gotData); bool scanStartTag(bool& gotData); bool scanStartTagNS(bool& gotData); // ----------------------------------------------------------------------- // Grammar preparsing methods // ----------------------------------------------------------------------- Grammar* loadDTDGrammar(const InputSource& src, const bool toCache = false); // ----------------------------------------------------------------------- // Data members // // fRawAttrList // During the initial scan of the attributes we can only do a raw // scan for key/value pairs. So this vector is used to store them // until they can be processed (and put into fAttrList.) // // fDTDValidator // The DTD validator instance. // // fDTDElemNonDeclPool // registry of "faulted-in" DTD element decls // fElemCount // count of the number of start tags seen so far (starts at 1). // Used for duplicate attribute detection/processing of required/defaulted attributes // fAttDefRegistry // mapping from XMLAttDef instances to the count of the last // start tag where they were utilized. // fUndeclaredAttrRegistry // mapping of attr QNames to detect duplicates // // ----------------------------------------------------------------------- ValueVectorOf* fAttrNSList; DTDValidator* fDTDValidator; DTDGrammar* fDTDGrammar; NameIdPool* fDTDElemNonDeclPool; unsigned int fElemCount; RefHashTableOf* fAttDefRegistry; Hash2KeysSetOf* fUndeclaredAttrRegistry; }; inline const XMLCh* DGXMLScanner::getName() const { return XMLUni::fgDGXMLScanner; } inline Grammar::GrammarType DGXMLScanner::getCurrentGrammarType() const { return Grammar::DTDGrammarType; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/XSObjectFactory.cpp000644 000765 000024 00000112112 13241160334 023612 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN static XMLCh regexSeparator[] = {chPipe, chNull}; // --------------------------------------------------------------------------- // XSObjectFactory: Constructors and Destructor // --------------------------------------------------------------------------- XSObjectFactory::XSObjectFactory(MemoryManager* const manager) : fMemoryManager(manager) , fXercesToXSMap(0) , fDeleteVector(0) { fDeleteVector = new (manager) RefVectorOf(20, true, manager); fXercesToXSMap = new (manager) RefHashTableOf ( 109, false, manager); } XSObjectFactory::~XSObjectFactory() { delete fXercesToXSMap; delete fDeleteVector; } // --------------------------------------------------------------------------- // XSObjectFactory: factory methods // --------------------------------------------------------------------------- XSParticle* XSObjectFactory::createModelGroupParticle(const ContentSpecNode* const rootNode, XSModel* const xsModel) { if (rootNode == 0) return 0; ContentSpecNode::NodeTypes nodeType = rootNode->getType(); if (nodeType == ContentSpecNode::All || nodeType == ContentSpecNode::ModelGroupChoice || nodeType == ContentSpecNode::ModelGroupSequence) { XSParticleList* particleList = new (fMemoryManager) RefVectorOf (4, true, fMemoryManager); XSAnnotation* annot = getAnnotationFromModel(xsModel, rootNode); XSModelGroup* modelGroup = 0; if (nodeType == ContentSpecNode::All) { modelGroup = new (fMemoryManager) XSModelGroup(XSModelGroup::COMPOSITOR_ALL, particleList, annot, xsModel, fMemoryManager); buildAllParticles(rootNode, particleList, xsModel); } else { if (nodeType == ContentSpecNode::ModelGroupChoice) modelGroup = new (fMemoryManager) XSModelGroup(XSModelGroup::COMPOSITOR_CHOICE, particleList, annot, xsModel, fMemoryManager); else modelGroup = new (fMemoryManager) XSModelGroup(XSModelGroup::COMPOSITOR_SEQUENCE, particleList, annot, xsModel, fMemoryManager); buildChoiceSequenceParticles(rootNode->getFirst(), particleList, xsModel); buildChoiceSequenceParticles(rootNode->getSecond(), particleList, xsModel); } int m = rootNode->getMaxOccurs(); XSParticle* groupParticle = new (fMemoryManager) XSParticle ( XSParticle::TERM_MODELGROUP , xsModel , modelGroup , (XMLSize_t)rootNode->getMinOccurs() , (XMLSize_t)m , m == -1 , fMemoryManager ); return groupParticle; } else return 0; } void XSObjectFactory::buildAllParticles(const ContentSpecNode* const rootNode, XSParticleList* const particleList, XSModel* const xsModel) { // Get the type of spec node our current node is const ContentSpecNode::NodeTypes nodeType = rootNode->getType(); if (nodeType == ContentSpecNode::All) { const ContentSpecNode* rightNode = rootNode->getSecond(); buildAllParticles(rootNode->getFirst(), particleList, xsModel); if (rightNode) buildAllParticles(rightNode, particleList, xsModel); } else if (nodeType == ContentSpecNode::Leaf) { XSParticle* elemParticle = createElementParticle(rootNode, xsModel); if (elemParticle) particleList->addElement(elemParticle); } } void XSObjectFactory::buildChoiceSequenceParticles(const ContentSpecNode* const rootNode, XSParticleList* const particleList, XSModel* const xsModel) { if (rootNode) { const ContentSpecNode::NodeTypes nodeType = rootNode->getType(); if (nodeType == ContentSpecNode::Sequence) { buildChoiceSequenceParticles(rootNode->getFirst(), particleList, xsModel); buildChoiceSequenceParticles(rootNode->getSecond(), particleList, xsModel); } else if (nodeType == ContentSpecNode::Choice) { buildChoiceSequenceParticles(rootNode->getFirst(), particleList, xsModel); buildChoiceSequenceParticles(rootNode->getSecond(), particleList, xsModel); } else if ((nodeType & 0x0f) == ContentSpecNode::Any || (nodeType & 0x0f) == ContentSpecNode::Any_Other || (nodeType & 0x0f) == ContentSpecNode::Any_NS || nodeType == ContentSpecNode::Any_NS_Choice) { XSParticle* wildcardParticle = createWildcardParticle(rootNode, xsModel); if (wildcardParticle) particleList->addElement(wildcardParticle); } else if (nodeType == ContentSpecNode::Leaf) { XSParticle* elemParticle = createElementParticle(rootNode, xsModel); if (elemParticle) particleList->addElement(elemParticle); } // must be a model group else { XSParticle* xsParticle = createModelGroupParticle(rootNode, xsModel); if (xsParticle) particleList->addElement(xsParticle); } } } XSParticle* XSObjectFactory::createElementParticle(const ContentSpecNode* const rootNode, XSModel* const xsModel) { if (rootNode->getElementDecl()) { XSElementDeclaration* xsElemDecl = addOrFind( (SchemaElementDecl*) rootNode->getElementDecl(), xsModel); if (xsElemDecl) { int m = rootNode->getMaxOccurs(); XSParticle* particle = new (fMemoryManager) XSParticle ( XSParticle::TERM_ELEMENT , xsModel , xsElemDecl , (XMLSize_t)rootNode->getMinOccurs() , (XMLSize_t)m , m == -1 , fMemoryManager ); return particle; } } return 0; } XSParticle* XSObjectFactory::createWildcardParticle(const ContentSpecNode* const rootNode, XSModel* const xsModel) { XSWildcard* xsWildcard = createXSWildcard(rootNode, xsModel); if (xsWildcard) { int m = rootNode->getMaxOccurs(); XSParticle* particle = new (fMemoryManager) XSParticle ( XSParticle::TERM_WILDCARD , xsModel , xsWildcard , (XMLSize_t)rootNode->getMinOccurs() , (XMLSize_t)m , m == -1 , fMemoryManager ); return particle; } return 0; } XSAttributeDeclaration* XSObjectFactory::addOrFind(SchemaAttDef* const attDef, XSModel* const xsModel, XSComplexTypeDefinition* const enclosingTypeDef) { XSAttributeDeclaration* xsObj = (XSAttributeDeclaration*) xsModel->getXSObject(attDef); if (xsObj) { if (xsObj->getScope() == XSConstants::SCOPE_LOCAL && xsObj->getEnclosingCTDefinition() == 0 && enclosingTypeDef) xsObj->setEnclosingCTDefinition(enclosingTypeDef); } else { XSSimpleTypeDefinition* xsType = 0; if (attDef->getDatatypeValidator()) xsType = addOrFind(attDef->getDatatypeValidator(), xsModel); XSConstants::SCOPE scope = XSConstants::SCOPE_ABSENT; XSComplexTypeDefinition* enclosingCTDefinition = 0; if (attDef->getPSVIScope() == PSVIDefs::SCP_GLOBAL) scope = XSConstants::SCOPE_GLOBAL; else if (attDef->getPSVIScope() == PSVIDefs::SCP_LOCAL) { scope = XSConstants::SCOPE_LOCAL; enclosingCTDefinition = enclosingTypeDef; } xsObj = new (fMemoryManager) XSAttributeDeclaration ( attDef , xsType , getAnnotationFromModel(xsModel, attDef) , xsModel , scope , enclosingCTDefinition , fMemoryManager ); putObjectInMap(attDef, xsObj); } return xsObj; } XSSimpleTypeDefinition* XSObjectFactory::addOrFind(DatatypeValidator* const validator, XSModel* const xsModel, bool isAnySimpleType) { XSSimpleTypeDefinition* xsObj = (XSSimpleTypeDefinition*) xsModel->getXSObject(validator); if (!xsObj) { XSTypeDefinition* baseType = 0; XSSimpleTypeDefinitionList* memberTypes = 0; XSSimpleTypeDefinition* primitiveOrItemType = 0; XSSimpleTypeDefinition::VARIETY typeVariety = XSSimpleTypeDefinition::VARIETY_ATOMIC; bool primitiveTypeSelf = false; //REVISIT: the getFixed method is protected so added friend XSObjectFactory // to DatatypeValidator class... DatatypeValidator::ValidatorType dvType = validator->getType(); DatatypeValidator* baseDV = validator->getBaseValidator(); if (dvType == DatatypeValidator::Union) { typeVariety = XSSimpleTypeDefinition::VARIETY_UNION; RefVectorOf* membersDV = ((UnionDatatypeValidator*)validator)->getMemberTypeValidators(); XMLSize_t size = membersDV->size(); if (size) { memberTypes = new (fMemoryManager) RefVectorOf(size, false, fMemoryManager); for (XMLSize_t i=0; iaddElement(addOrFind(membersDV->elementAt(i), xsModel)); } if (baseDV) { baseType = addOrFind(baseDV, xsModel); } else { baseType = (XSSimpleTypeDefinition*) xsModel->getTypeDefinition ( SchemaSymbols::fgDT_ANYSIMPLETYPE , SchemaSymbols::fgURI_SCHEMAFORSCHEMA ); } } else if (dvType == DatatypeValidator::List) { typeVariety = XSSimpleTypeDefinition::VARIETY_LIST; if (baseDV->getType() == DatatypeValidator::List) { baseType = addOrFind(baseDV, xsModel); primitiveOrItemType = ((XSSimpleTypeDefinition*) baseType)->getItemType(); } else { baseType = (XSSimpleTypeDefinition*) xsModel->getTypeDefinition ( SchemaSymbols::fgDT_ANYSIMPLETYPE , SchemaSymbols::fgURI_SCHEMAFORSCHEMA ); primitiveOrItemType = addOrFind(baseDV, xsModel); } } else if (!isAnySimpleType) { if (baseDV) { baseType = addOrFind(baseDV, xsModel); primitiveOrItemType = ((XSSimpleTypeDefinition*) baseType)->getPrimitiveType(); } else // built-in { baseType = (XSSimpleTypeDefinition*) xsModel->getTypeDefinition ( SchemaSymbols::fgDT_ANYSIMPLETYPE , SchemaSymbols::fgURI_SCHEMAFORSCHEMA ); primitiveTypeSelf = true; } } else { baseType = xsModel->getTypeDefinition(SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); } xsObj = new (fMemoryManager) XSSimpleTypeDefinition ( validator , typeVariety , baseType , primitiveOrItemType , memberTypes , getAnnotationFromModel(xsModel, validator) , xsModel , fMemoryManager ); putObjectInMap(validator, xsObj); if (primitiveTypeSelf) xsObj->setPrimitiveType(xsObj); // process facets processFacets(validator, xsModel, xsObj); } return xsObj; } XSElementDeclaration* XSObjectFactory::addOrFind(SchemaElementDecl* const elemDecl, XSModel* const xsModel, XSComplexTypeDefinition* const enclosingTypeDef) { XSElementDeclaration* xsObj = (XSElementDeclaration*) xsModel->getXSObject(elemDecl); if (xsObj) { if (!xsObj->getEnclosingCTDefinition() && enclosingTypeDef) xsObj->setEnclosingCTDefinition(enclosingTypeDef); } else { XSElementDeclaration* xsSubElem = 0; XSTypeDefinition* xsType = 0; XSNamedMap* icMap = 0; if (elemDecl->getSubstitutionGroupElem()) xsSubElem = addOrFind(elemDecl->getSubstitutionGroupElem(), xsModel); // defer checking for complexTypeInfo until later as it could // eventually need this elemement // but don't check simple type unless no complexTypeInfo present if (!elemDecl->getComplexTypeInfo() && elemDecl->getDatatypeValidator()) xsType = addOrFind(elemDecl->getDatatypeValidator(), xsModel); XMLSize_t count = elemDecl->getIdentityConstraintCount(); if (count) { //REVISIT: size of hash table.... icMap = new (fMemoryManager) XSNamedMap ( count , 29 , xsModel->getURIStringPool() , false , fMemoryManager ); for (XMLSize_t i = 0; i < count; i++) { XSIDCDefinition* icDef = addOrFind ( elemDecl->getIdentityConstraintAt(i) , xsModel ); if (icDef) { icMap->addElement ( icDef , icDef->getName() , icDef->getNamespace() ); } } } XSConstants::SCOPE elemScope = XSConstants::SCOPE_ABSENT; if (elemDecl->getPSVIScope() == PSVIDefs::SCP_LOCAL) elemScope = XSConstants::SCOPE_LOCAL; else if (elemDecl->getPSVIScope() == PSVIDefs::SCP_GLOBAL) elemScope = XSConstants::SCOPE_GLOBAL; xsObj = new (fMemoryManager) XSElementDeclaration ( elemDecl , xsType , xsSubElem , getAnnotationFromModel(xsModel, elemDecl) , icMap , xsModel , elemScope , enclosingTypeDef , fMemoryManager ); putObjectInMap(elemDecl, xsObj); if (elemDecl->getComplexTypeInfo()) { xsType = addOrFind(elemDecl->getComplexTypeInfo(), xsModel); xsObj->setTypeDefinition(xsType); } else if (!xsType) { xsType = xsModel->getTypeDefinition ( SchemaSymbols::fgATTVAL_ANYTYPE , SchemaSymbols::fgURI_SCHEMAFORSCHEMA ); xsObj->setTypeDefinition(xsType); } } return xsObj; } XSComplexTypeDefinition* XSObjectFactory::addOrFind(ComplexTypeInfo* const typeInfo, XSModel* const xsModel) { XSComplexTypeDefinition* xsObj = (XSComplexTypeDefinition*) xsModel->getXSObject(typeInfo); if (!xsObj) { XSWildcard* xsWildcard = 0; XSSimpleTypeDefinition* xsSimpleType = 0; XSAttributeUseList* xsAttList = 0; XSTypeDefinition* xsBaseType = 0; XSParticle* xsParticle = 0; if (typeInfo->getAttWildCard()) xsWildcard = createXSWildcard(typeInfo->getAttWildCard(), xsModel); if ((typeInfo->getContentType() == SchemaElementDecl::Simple) && (typeInfo->getDatatypeValidator())) xsSimpleType = addOrFind(typeInfo->getDatatypeValidator(), xsModel); XMLSize_t attCount=0; if (typeInfo->hasAttDefs()) { SchemaAttDefList& attDefList = (SchemaAttDefList&) typeInfo->getAttDefList(); attCount = attDefList.getAttDefCount(); xsAttList = new (fMemoryManager) RefVectorOf(attCount, false, fMemoryManager); // create list now put fill it in after we put complextype into map // otherwise we may encounter an infinite loop: complextype needs to // addorfind attdef, which does an addorfind on the enclosingCTdefintion. } // compute fBase bool isAnyType = false; if (typeInfo->getBaseComplexTypeInfo() == typeInfo) // case of anyType isAnyType = true; else if (typeInfo->getBaseComplexTypeInfo()) xsBaseType = addOrFind(typeInfo->getBaseComplexTypeInfo(), xsModel); else if (typeInfo->getBaseDatatypeValidator()) xsBaseType = addOrFind(typeInfo->getBaseDatatypeValidator(), xsModel); else // base is anyType xsBaseType = xsModel->getTypeDefinition(SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA); // compute particle ContentSpecNode* contentSpec = typeInfo->getContentSpec(); if (contentSpec) xsParticle = createModelGroupParticle(contentSpec, xsModel); xsObj = new (fMemoryManager) XSComplexTypeDefinition ( typeInfo , xsWildcard , xsSimpleType , xsAttList , xsBaseType , xsParticle , getAnnotationFromModel(xsModel, typeInfo) , xsModel , fMemoryManager ); putObjectInMap(typeInfo, xsObj); if (isAnyType) xsObj->setBaseType(xsObj); if (typeInfo->hasAttDefs()) { // now create the xsattributedeclarations... SchemaAttDefList& attDefList = (SchemaAttDefList&) typeInfo->getAttDefList(); for(unsigned int i=0; iput(&attDef, xsAttDecl); } else xsAttDecl = addOrFind(&attDef, xsModel, xsObj); if (attDef.getDefaultType() != XMLAttDef::Prohibited) { XSAttributeUse* attUse = createXSAttributeUse(xsAttDecl, xsModel); xsAttList->addElement(attUse); processAttUse(&attDef, attUse); } } } // process local elements XMLSize_t elemCount = typeInfo->elementCount(); for (XMLSize_t j=0; jelementAt(j); if (elemDecl->getEnclosingScope() == typeInfo->getScopeDefined() && elemDecl->getPSVIScope() == PSVIDefs::SCP_LOCAL) addOrFind(elemDecl, xsModel, xsObj); } } return xsObj; } XSIDCDefinition* XSObjectFactory::addOrFind(IdentityConstraint* const ic, XSModel* const xsModel) { XSIDCDefinition* xsObj = (XSIDCDefinition*) xsModel->getXSObject(ic); if (!xsObj) { XSIDCDefinition* keyIC = 0; StringList* stringList = 0; XMLSize_t fieldCount = ic->getFieldCount(); if (fieldCount) { stringList = new (fMemoryManager) RefArrayVectorOf( fieldCount, true, fMemoryManager); for(XMLSize_t i=0; igetFieldAt(i)->getXPath()->getExpression() , fMemoryManager ); stringList->addElement(expr); } } if (ic->getType() == IdentityConstraint::ICType_KEYREF) keyIC = addOrFind(((IC_KeyRef*) ic)->getKey(), xsModel); xsObj= new (fMemoryManager) XSIDCDefinition ( ic , keyIC , getAnnotationFromModel(xsModel, ic) , stringList , xsModel , fMemoryManager ); putObjectInMap(ic, xsObj); } return xsObj; } XSNotationDeclaration* XSObjectFactory::addOrFind(XMLNotationDecl* const notDecl, XSModel* const xsModel) { XSNotationDeclaration* xsObj = (XSNotationDeclaration*) xsModel->getXSObject(notDecl); if (!xsObj) { xsObj = new (fMemoryManager) XSNotationDeclaration ( notDecl , getAnnotationFromModel(xsModel, notDecl) , xsModel , fMemoryManager ); putObjectInMap(notDecl, xsObj); } return xsObj; } XSAttributeUse* XSObjectFactory::createXSAttributeUse(XSAttributeDeclaration* const xsAttDecl, XSModel* const xsModel) { XSAttributeUse* attrUse = new (fMemoryManager) XSAttributeUse(xsAttDecl, xsModel, fMemoryManager); fDeleteVector->addElement(attrUse); return attrUse; } XSWildcard* XSObjectFactory::createXSWildcard(SchemaAttDef* const attDef, XSModel* const xsModel) { XSAnnotation* annot = (attDef->getBaseAttDecl()) ? getAnnotationFromModel(xsModel, attDef->getBaseAttDecl()) : getAnnotationFromModel(xsModel, attDef); XSWildcard* xsWildcard = new (fMemoryManager) XSWildcard ( attDef , annot , xsModel , fMemoryManager ); fDeleteVector->addElement(xsWildcard); return xsWildcard; } XSWildcard* XSObjectFactory::createXSWildcard(const ContentSpecNode* const rootNode, XSModel* const xsModel) { XSWildcard* xsWildcard = new (fMemoryManager) XSWildcard ( rootNode , getAnnotationFromModel(xsModel, rootNode) , xsModel , fMemoryManager ); fDeleteVector->addElement(xsWildcard); return xsWildcard; } XSModelGroupDefinition* XSObjectFactory::createXSModelGroupDefinition(XercesGroupInfo* const groupInfo, XSModel* const xsModel) { XSParticle* particle = createModelGroupParticle( groupInfo->getContentSpec(), xsModel); XSModelGroupDefinition* xsObj = new (fMemoryManager) XSModelGroupDefinition ( groupInfo , particle , getAnnotationFromModel(xsModel, groupInfo) , xsModel , fMemoryManager ); fDeleteVector->addElement(xsObj); // process local elements XMLSize_t elemCount = groupInfo->elementCount(); for (XMLSize_t j=0; jelementAt(j); if (elemDecl->getEnclosingScope() == groupInfo->getScope()) addOrFind(elemDecl, xsModel); } return xsObj; } XSAttributeGroupDefinition* XSObjectFactory::createXSAttGroupDefinition(XercesAttGroupInfo* const attGroupInfo, XSModel* const xsModel) { XSAttributeUseList* xsAttList = 0; XSWildcard* xsWildcard = 0; XMLSize_t attCount = attGroupInfo->attributeCount(); if (attCount) { xsAttList = new (fMemoryManager) RefVectorOf(attCount, false, fMemoryManager); for (XMLSize_t i=0; i < attCount; i++) { SchemaAttDef* attDef = attGroupInfo->attributeAt(i); XSAttributeDeclaration* xsAttDecl = 0; if (attDef->getBaseAttDecl()) xsAttDecl = addOrFind(attDef->getBaseAttDecl(), xsModel); else xsAttDecl = addOrFind(attDef, xsModel); if (xsAttDecl && (attDef->getDefaultType() != XMLAttDef::Prohibited)) // just for sanity { XSAttributeUse* attUse = createXSAttributeUse(xsAttDecl, xsModel); xsAttList->addElement(attUse); processAttUse(attDef, attUse); } } } if (attGroupInfo->getCompleteWildCard()) xsWildcard = createXSWildcard(attGroupInfo->getCompleteWildCard(), xsModel); XSAttributeGroupDefinition* xsObj = new (fMemoryManager) XSAttributeGroupDefinition ( attGroupInfo , xsAttList , xsWildcard , getAnnotationFromModel(xsModel, attGroupInfo) , xsModel , fMemoryManager ); fDeleteVector->addElement(xsObj); return xsObj; } XSAnnotation* XSObjectFactory::getAnnotationFromModel(XSModel* const xsModel, const void* const key) { XSNamespaceItemList* namespaceItemList = xsModel->getNamespaceItems(); XSAnnotation* annot = 0; for (unsigned int i=0; isize(); i++) { XSNamespaceItem* nsItem = namespaceItemList->elementAt(i); if (nsItem->fGrammar) { annot = nsItem->fGrammar->getAnnotation(key); if (annot) return annot; } } if (xsModel->fParent) return getAnnotationFromModel(xsModel->fParent, key); return 0; } void XSObjectFactory::putObjectInMap(void* key, XSObject* const object) { fXercesToXSMap->put(key, object); fDeleteVector->addElement(object); } void XSObjectFactory::processFacets(DatatypeValidator* const dv, XSModel* const xsModel, XSSimpleTypeDefinition* const xsST) { // NOTE: XSMultiValueFacetList is not owned by XSModel! // NOTE: XSFacetList is not owned by XSModel! bool isFixed = false; int dvFacetsDefined = dv->getFacetsDefined(); int dvFixedFacets = dv->getFixed(); int definedFacets = 0; int fixedFacets = 0; XSMultiValueFacetList* xsMultiFacetList = 0; StringList* patternList = 0; XSFacetList* xsFacetList = new (fMemoryManager) RefVectorOf(4, false, fMemoryManager); if (isMultiValueFacetDefined(dv)) xsMultiFacetList = new (fMemoryManager) RefVectorOf(2, false, fMemoryManager); if (dvFacetsDefined & DatatypeValidator::FACET_ENUMERATION) { RefArrayVectorOf* enumList = (RefArrayVectorOf*) dv->getEnumString(); if (dvFixedFacets & DatatypeValidator::FACET_ENUMERATION) { isFixed = true; fixedFacets |= XSSimpleTypeDefinition::FACET_ENUMERATION; } XSMultiValueFacet* mvFacet = new (fMemoryManager) XSMultiValueFacet( XSSimpleTypeDefinition::FACET_ENUMERATION , enumList, isFixed , getAnnotationFromModel(xsModel, enumList), xsModel, fMemoryManager ); fDeleteVector->addElement(mvFacet); xsMultiFacetList->addElement(mvFacet); definedFacets |= XSSimpleTypeDefinition::FACET_ENUMERATION; } if (dv->getFacets()) { RefHashTableOfEnumerator e(dv->getFacets(), false, fMemoryManager); while (e.hasMoreElements()) { KVStringPair& pair = e.nextElement(); XMLCh* key = pair.getKey(); XSSimpleTypeDefinition::FACET facetType; XSAnnotation* annot = getAnnotationFromModel(xsModel, &pair); if (XMLString::equals(key, SchemaSymbols::fgELT_MAXINCLUSIVE)) { facetType = XSSimpleTypeDefinition::FACET_MAXINCLUSIVE; isFixed = ((dvFixedFacets & DatatypeValidator::FACET_MAXINCLUSIVE) != 0); } else if (XMLString::equals(key, SchemaSymbols::fgELT_MAXEXCLUSIVE)) { facetType = XSSimpleTypeDefinition::FACET_MAXEXCLUSIVE; isFixed = ((dvFixedFacets & DatatypeValidator::FACET_MAXEXCLUSIVE) !=0); } else if (XMLString::equals(key, SchemaSymbols::fgELT_MININCLUSIVE)) { facetType = XSSimpleTypeDefinition::FACET_MININCLUSIVE; isFixed = ((dvFixedFacets & DatatypeValidator::FACET_MININCLUSIVE) !=0); } else if (XMLString::equals(key, SchemaSymbols::fgELT_MINEXCLUSIVE)) { facetType = XSSimpleTypeDefinition::FACET_MINEXCLUSIVE; isFixed = ((dvFixedFacets & DatatypeValidator::FACET_MINEXCLUSIVE) != 0); } else if (XMLString::equals(key, SchemaSymbols::fgELT_LENGTH)) { facetType = XSSimpleTypeDefinition::FACET_LENGTH; isFixed = ((dvFixedFacets & DatatypeValidator::FACET_LENGTH) != 0); } else if (XMLString::equals(key, SchemaSymbols::fgELT_MINLENGTH)) { facetType = XSSimpleTypeDefinition::FACET_MINLENGTH; isFixed = ((dvFixedFacets & DatatypeValidator::FACET_MINLENGTH) != 0); } else if (XMLString::equals(key, SchemaSymbols::fgELT_MAXLENGTH)) { facetType = XSSimpleTypeDefinition::FACET_MAXLENGTH; isFixed = ((dvFixedFacets & DatatypeValidator::FACET_MAXLENGTH) != 0); } else if (XMLString::equals(key, SchemaSymbols::fgELT_TOTALDIGITS)) { facetType = XSSimpleTypeDefinition::FACET_TOTALDIGITS; isFixed = ((dvFixedFacets & DatatypeValidator::FACET_TOTALDIGITS) != 0); } else if (XMLString::equals(key, SchemaSymbols::fgELT_FRACTIONDIGITS)) { facetType = XSSimpleTypeDefinition::FACET_FRACTIONDIGITS; isFixed = ((dvFixedFacets & DatatypeValidator::FACET_FRACTIONDIGITS) != 0); } else if (XMLString::equals(key, SchemaSymbols::fgELT_WHITESPACE)) { facetType = XSSimpleTypeDefinition::FACET_WHITESPACE; isFixed = ((dvFixedFacets & DatatypeValidator::FACET_WHITESPACE) != 0); } else if (XMLString::equals(key, SchemaSymbols::fgELT_PATTERN) && xsMultiFacetList) { XMLStringTokenizer tokenizer(dv->getPattern(), regexSeparator, fMemoryManager); patternList = new (fMemoryManager) RefArrayVectorOf( tokenizer.countTokens(), true, fMemoryManager ); while (tokenizer.hasMoreTokens()) patternList->addElement(XMLString::replicate(tokenizer.nextToken(), fMemoryManager)); if (dvFixedFacets & DatatypeValidator::FACET_PATTERN) { isFixed = true; fixedFacets |= XSSimpleTypeDefinition::FACET_PATTERN; } XSMultiValueFacet* mvFacet = new (fMemoryManager) XSMultiValueFacet( XSSimpleTypeDefinition::FACET_PATTERN, patternList , isFixed, annot, xsModel, fMemoryManager ); fDeleteVector->addElement(mvFacet); xsMultiFacetList->addElement(mvFacet); definedFacets |= XSSimpleTypeDefinition::FACET_PATTERN; continue; } else { // REVISIT: hmm... what about XSSimpleTypeDefinition::FACET_NONE // don't think I need to create an empty Facet? continue; } XSFacet* xsFacet = new (fMemoryManager) XSFacet( facetType, pair.getValue(), isFixed, annot, xsModel, fMemoryManager); fDeleteVector->addElement(xsFacet); xsFacetList->addElement(xsFacet); definedFacets |= facetType; if (isFixed) fixedFacets |= facetType; } } // add whistespace facet if missing if ((definedFacets & XSSimpleTypeDefinition::FACET_WHITESPACE) == 0) { XSFacet* xsFacet = new (fMemoryManager) XSFacet( XSSimpleTypeDefinition::FACET_WHITESPACE , dv->getWSstring(dv->getWSFacet()) , false, 0, xsModel, fMemoryManager); fDeleteVector->addElement(xsFacet); xsFacetList->addElement(xsFacet); definedFacets |= XSSimpleTypeDefinition::FACET_WHITESPACE; } // inherit facets from base if (xsST->getBaseType() && xsST->getBaseType()->getTypeCategory() == XSTypeDefinition::SIMPLE_TYPE) { XSSimpleTypeDefinition* baseST = (XSSimpleTypeDefinition*) xsST->getBaseType(); XSFacetList* baseFacets = baseST->getFacets(); for (unsigned int i=0; isize(); i++) { XSFacet* bFacet = baseFacets->elementAt(i); if ((definedFacets & bFacet->getFacetKind()) == 0) { definedFacets |= bFacet->getFacetKind(); xsFacetList->addElement(bFacet); if (bFacet->isFixed()) fixedFacets |= bFacet->getFacetKind(); } } if (baseST->getMultiValueFacets() && xsMultiFacetList) { XSMultiValueFacetList* baseMVFacets = baseST->getMultiValueFacets(); for (unsigned int j=0; jsize(); j++) { XSMultiValueFacet* bFacet = baseMVFacets->elementAt(j); if ((definedFacets & bFacet->getFacetKind()) == 0) { definedFacets |= bFacet->getFacetKind(); xsMultiFacetList->addElement(bFacet); if (bFacet->isFixed()) fixedFacets |= bFacet->getFacetKind(); } } } } xsST->setFacetInfo(definedFacets, fixedFacets, xsFacetList, xsMultiFacetList, patternList); } void XSObjectFactory::processAttUse(SchemaAttDef* const attDef, XSAttributeUse* const xsAttUse) { bool isRequired = false; XSConstants::VALUE_CONSTRAINT constraintType = XSConstants::VALUE_CONSTRAINT_NONE; if (attDef->getDefaultType() == XMLAttDef::Default) { constraintType = XSConstants::VALUE_CONSTRAINT_DEFAULT; } else if ((attDef->getDefaultType() == XMLAttDef::Fixed) || (attDef->getDefaultType() == XMLAttDef::Required_And_Fixed)) { constraintType = XSConstants::VALUE_CONSTRAINT_FIXED; } if (attDef->getDefaultType() == XMLAttDef::Required || attDef->getDefaultType() == XMLAttDef::Required_And_Fixed) isRequired = true; xsAttUse->set(isRequired, constraintType, attDef->getValue()); } bool XSObjectFactory::isMultiValueFacetDefined(DatatypeValidator* const dv) { DatatypeValidator* tmpDV = dv; while (tmpDV) { if ((tmpDV->getFacetsDefined() & DatatypeValidator::FACET_PATTERN) || (tmpDV->getFacetsDefined() & DatatypeValidator::FACET_ENUMERATION)) return true; tmpDV = tmpDV->getBaseValidator(); } return false; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/WFXMLScanner.hpp000644 000765 000024 00000013001 13241160334 023012 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: WFXMLScanner.hpp 810580 2009-09-02 15:52:22Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_WFXMLSCANNER_HPP) #define XERCESC_INCLUDE_GUARD_WFXMLSCANNER_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // This is a a non-validating scanner. No DOCTYPE or XML Schema processing // will take place. class XMLPARSER_EXPORT WFXMLScanner : public XMLScanner { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- WFXMLScanner ( XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); WFXMLScanner ( XMLDocumentHandler* const docHandler , DocTypeHandler* const docTypeHandler , XMLEntityHandler* const entityHandler , XMLErrorReporter* const errReporter , XMLValidator* const valToAdopt , GrammarResolver* const grammarResolver , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~WFXMLScanner(); // ----------------------------------------------------------------------- // XMLScanner public virtual methods // ----------------------------------------------------------------------- virtual const XMLCh* getName() const; virtual NameIdPool* getEntityDeclPool(); virtual const NameIdPool* getEntityDeclPool() const; virtual void scanDocument ( const InputSource& src ); virtual bool scanNext(XMLPScanToken& toFill); virtual Grammar* loadGrammar ( const InputSource& src , const short grammarType , const bool toCache = false ); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- WFXMLScanner(); WFXMLScanner(const WFXMLScanner&); WFXMLScanner& operator=(const WFXMLScanner&); // ----------------------------------------------------------------------- // XMLScanner virtual methods // ----------------------------------------------------------------------- virtual void scanCDSection(); virtual void scanCharData(XMLBuffer& toToUse); virtual EntityExpRes scanEntityRef ( const bool inAttVal , XMLCh& firstCh , XMLCh& secondCh , bool& escaped ); virtual void scanDocTypeDecl(); virtual void scanReset(const InputSource& src); virtual void sendCharData(XMLBuffer& toSend); virtual InputSource* resolveSystemId(const XMLCh* const sysId ,const XMLCh* const pubId); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void commonInit(); void cleanUp(); // ----------------------------------------------------------------------- // Private scanning methods // ----------------------------------------------------------------------- bool scanAttValue ( const XMLCh* const attrName , XMLBuffer& toFill ); bool scanContent(); void scanEndTag(bool& gotData); bool scanStartTag(bool& gotData); bool scanStartTagNS(bool& gotData); // ----------------------------------------------------------------------- // Data members // // fEntityTable // This the table that contains the default entity entries. // // fAttrNameHashList // This contains the hash value for attribute names. It's used when // checking for duplicate attributes. // // fAttrNSList // This contains XMLAttr objects that we need to map their prefixes // to URIs when namespace is enabled. // // ----------------------------------------------------------------------- unsigned int fElementIndex; RefVectorOf* fElements; ValueHashTableOf* fEntityTable; ValueVectorOf* fAttrNameHashList; ValueVectorOf* fAttrNSList; RefHashTableOf* fElementLookup; }; inline const XMLCh* WFXMLScanner::getName() const { return XMLUni::fgWFXMLScanner; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/XSerializable.hpp000644 000765 000024 00000007222 13241160334 023351 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSerializable.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSERIALIZABLE_HPP) #define XERCESC_INCLUDE_GUARD_XSERIALIZABLE_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT XSerializable { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- virtual ~XSerializable() {} ; // ----------------------------------------------------------------------- // Serialization Interface // ----------------------------------------------------------------------- virtual bool isSerializable() const = 0; virtual void serialize(XSerializeEngine& ) = 0; virtual XProtoType* getProtoType() const = 0; protected: XSerializable() {} XSerializable(const XSerializable& ) {} private: // ----------------------------------------------------------------------- // Unimplemented assignment operator // ----------------------------------------------------------------------- XSerializable& operator=(const XSerializable&); }; inline void XSerializable::serialize(XSerializeEngine& ) { } /*** * Macro to be included in XSerializable derivatives' * declaration's public section ***/ #define DECL_XSERIALIZABLE(class_name) \ public: \ \ DECL_XPROTOTYPE(class_name) \ \ virtual bool isSerializable() const ; \ virtual XProtoType* getProtoType() const; \ virtual void serialize(XSerializeEngine&); \ \ inline friend XSerializeEngine& operator>>(XSerializeEngine& serEng \ , class_name*& objPtr) \ {objPtr = (class_name*) serEng.read(XPROTOTYPE_CLASS(class_name)); \ return serEng; \ }; /*** * Macro to be included in the implementation file * of XSerializable derivatives' which is instantiable ***/ #define IMPL_XSERIALIZABLE_TOCREATE(class_name) \ IMPL_XPROTOTYPE_TOCREATE(class_name) \ IMPL_XSERIAL(class_name) /*** * Macro to be included in the implementation file * of XSerializable derivatives' which is UN-instantiable ***/ #define IMPL_XSERIALIZABLE_NOCREATE(class_name) \ IMPL_XPROTOTYPE_NOCREATE(class_name) \ IMPL_XSERIAL(class_name) /*** * Helper Macro ***/ #define IMPL_XSERIAL(class_name) \ bool class_name::isSerializable() const \ {return true; } \ XProtoType* class_name::getProtoType() const \ {return XPROTOTYPE_CLASS(class_name); } #define IS_EQUIVALENT(lptr, rptr) \ if (lptr == rptr) \ return true; \ if (( lptr && !rptr) || (!lptr && rptr)) \ return false; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/MemoryManagerImpl.cpp000644 000765 000024 00000003173 13241160334 024174 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: MemoryManagerImpl.cpp 1329216 2012-04-23 12:44:51Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN MemoryManager* MemoryManagerImpl::getExceptionMemoryManager() { return this; } void* MemoryManagerImpl::allocate(XMLSize_t size) { void* memptr; try { memptr = ::operator new(size); } catch(...) { throw OutOfMemoryException(); } if(memptr==NULL && size!=0) throw OutOfMemoryException(); return memptr; } void MemoryManagerImpl::deallocate(void* p) { if (p) ::operator delete(p); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/VecAttributesImpl.cpp000644 000765 000024 00000015753 13241160334 024224 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: VecAttributesImpl.cpp 672311 2008-06-27 16:05:01Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- VecAttributesImpl::VecAttributesImpl() : fAdopt(false) , fCount(0) , fVector(0) , fScanner(0) { } VecAttributesImpl::~VecAttributesImpl() { // // Note that some compilers can't deal with the fact that the pointer // is to a const object, so we have to cast off the const'ness here! // if (fAdopt) delete (RefVectorOf*)fVector; } // --------------------------------------------------------------------------- // Implementation of the attribute list interface // --------------------------------------------------------------------------- XMLSize_t VecAttributesImpl::getLength() const { return fCount; } const XMLCh* VecAttributesImpl::getURI(const XMLSize_t index) const { // since this func really needs to be const, like the rest, not sure how we // make it const and re-use the fURIBuffer member variable. we're currently // creating a buffer each time you need a URI. there has to be a better // way to do this... //XMLBuffer tempBuf; if (index >= fCount) { return 0; } //fValidator->getURIText(fVector->elementAt(index)->getURIId(), tempBuf) ; //return tempBuf.getRawBuffer() ; return fScanner->getURIText(fVector->elementAt(index)->getURIId()); } const XMLCh* VecAttributesImpl::getLocalName(const XMLSize_t index) const { if (index >= fCount) { return 0; } return fVector->elementAt(index)->getName(); } const XMLCh* VecAttributesImpl::getQName(const XMLSize_t index) const { if (index >= fCount) { return 0; } return fVector->elementAt(index)->getQName(); } const XMLCh* VecAttributesImpl::getType(const XMLSize_t index) const { if (index >= fCount) { return 0; } return XMLAttDef::getAttTypeString(fVector->elementAt(index)->getType(), fVector->getMemoryManager()); } const XMLCh* VecAttributesImpl::getValue(const XMLSize_t index) const { if (index >= fCount) { return 0; } return fVector->elementAt(index)->getValue(); } bool VecAttributesImpl::getIndex(const XMLCh* const uri, const XMLCh* const localPart, XMLSize_t& index) const { // // Search the vector for the attribute with the given name and return // its type. // XMLBuffer uriBuffer(1023, fVector->getMemoryManager()) ; for (index = 0; index < fCount; index++) { const XMLAttr* curElem = fVector->elementAt(index); fScanner->getURIText(curElem->getURIId(), uriBuffer) ; if ( (XMLString::equals(curElem->getName(), localPart)) && (XMLString::equals(uriBuffer.getRawBuffer(), uri)) ) return true; } return false; } int VecAttributesImpl::getIndex(const XMLCh* const uri, const XMLCh* const localPart ) const { // // Search the vector for the attribute with the given name and return // its type. // XMLBuffer uriBuffer(1023, fVector->getMemoryManager()) ; for (XMLSize_t index = 0; index < fCount; index++) { const XMLAttr* curElem = fVector->elementAt(index); fScanner->getURIText(curElem->getURIId(), uriBuffer) ; if ( (XMLString::equals(curElem->getName(), localPart)) && (XMLString::equals(uriBuffer.getRawBuffer(), uri)) ) return (int)index ; } return -1; } bool VecAttributesImpl::getIndex(const XMLCh* const qName, XMLSize_t& index) const { // // Search the vector for the attribute with the given name and return // its type. // for (index = 0; index < fCount; index++) { const XMLAttr* curElem = fVector->elementAt(index); if (XMLString::equals(curElem->getQName(), qName)) return true; } return false; } int VecAttributesImpl::getIndex(const XMLCh* const qName ) const { // // Search the vector for the attribute with the given name and return // its type. // for (XMLSize_t index = 0; index < fCount; index++) { const XMLAttr* curElem = fVector->elementAt(index); if (XMLString::equals(curElem->getQName(), qName)) return (int)index ; } return -1; } const XMLCh* VecAttributesImpl::getType(const XMLCh* const uri, const XMLCh* const localPart ) const { XMLSize_t i; if (getIndex(uri, localPart, i)) return getType(i); else return 0; } const XMLCh* VecAttributesImpl::getType(const XMLCh* const qName) const { XMLSize_t i; if (getIndex(qName, i)) return getType(i); else return 0; } const XMLCh* VecAttributesImpl::getValue(const XMLCh* const uri, const XMLCh* const localPart ) const { XMLSize_t i; if (getIndex(uri, localPart, i)) return getValue(i); else return 0; } const XMLCh* VecAttributesImpl::getValue(const XMLCh* const qName) const { XMLSize_t i; if (getIndex(qName, i)) return getValue(i); else return 0; } // --------------------------------------------------------------------------- // Setter methods // --------------------------------------------------------------------------- void VecAttributesImpl::setVector(const RefVectorOf* const srcVec , const XMLSize_t count , const XMLScanner * const scanner , const bool adopt) { // // Delete the previous vector (if any) if we are adopting. Note that some // compilers can't deal with the fact that the pointer is to a const // object, so we have to cast off the const'ness here! // if (fAdopt) delete (RefVectorOf*)fVector; fAdopt = adopt; fCount = count; fVector = srcVec; fScanner = scanner ; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/internal/ValidationContextImpl.hpp000644 000765 000024 00000013450 13241160334 025074 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ValidationContextImpl.hpp 729944 2008-12-29 17:03:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_VALIDATION_CONTEXTIMPL_HPP) #define XERCESC_INCLUDE_GUARD_VALIDATION_CONTEXTIMPL_HPP #include XERCES_CPP_NAMESPACE_BEGIN class ElemStack; class NamespaceScope; class XMLPARSER_EXPORT ValidationContextImpl : public ValidationContext { public : // ----------------------------------------------------------------------- /** @name Virtual destructor for derived classes */ // ----------------------------------------------------------------------- //@{ /** * virtual destructor * */ virtual ~ValidationContextImpl(); ValidationContextImpl(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager); //@} // ----------------------------------------------------------------------- /** @name The ValidationContextImpl Interface */ // ----------------------------------------------------------------------- //@{ /** * IDRefList * */ virtual RefHashTableOf* getIdRefList() const; virtual void setIdRefList(RefHashTableOf* const); virtual void clearIdRefList(); virtual void addId(const XMLCh * const ); virtual void addIdRef(const XMLCh * const ); virtual void toCheckIdRefList(bool); /** * EntityDeclPool * */ virtual const NameIdPool* getEntityDeclPool() const; virtual const NameIdPool* setEntityDeclPool(const NameIdPool* const); virtual void checkEntity(const XMLCh * const ) const; /** * Union datatype handling * */ virtual DatatypeValidator * getValidatingMemberType() const; virtual void setValidatingMemberType(DatatypeValidator * validatingMemberType) ; /** * QName datatype handling * Create default implementations for source code compatibility */ virtual bool isPrefixUnknown(XMLCh* prefix); virtual void setElemStack(ElemStack* elemStack); virtual const XMLCh* getURIForPrefix(XMLCh* prefix); virtual void setScanner(XMLScanner* scanner); virtual void setNamespaceScope(NamespaceScope* nsStack); //@} private: // ----------------------------------------------------------------------- /** name Unimplemented copy constructor and operator= */ // ----------------------------------------------------------------------- //@{ ValidationContextImpl(const ValidationContextImpl& ); ValidationContextImpl& operator=(const ValidationContextImpl& ); //@} // ----------------------------------------------------------------------- // Data members // // fIDRefList: owned/adopted // This is a list of XMLRefInfo objects. This member lets us do all // needed ID-IDREF balancing checks. // // fEntityDeclPool: referenced only // This is a pool of EntityDecl objects, which contains all of the // general entities that are declared in the DTD subsets, plus the // default entities (such as > < ...) defined by the XML Standard. // // fToAddToList // fValidatingMemberType // The member type in a union that actually // validated some text. Note that the validationContext does not // own this object, and the value of getValidatingMemberType // will not be accurate unless the type of the most recently-validated // element/attribute is in fact a union datatype. // fElemStack // Need access to elemstack to look up URI's that are inscope (while validating an XML). // fNamespaceScope // Need access to namespace scope to look up URI's that are inscope (while loading a schema). // ----------------------------------------------------------------------- RefHashTableOf* fIdRefList; const NameIdPool* fEntityDeclPool; bool fToCheckIdRefList; DatatypeValidator * fValidatingMemberType; ElemStack* fElemStack; XMLScanner* fScanner; NamespaceScope* fNamespaceScope; }; inline DatatypeValidator * ValidationContextImpl::getValidatingMemberType() const { return fValidatingMemberType; } inline void ValidationContextImpl::setValidatingMemberType(DatatypeValidator * validatingMemberType) { fValidatingMemberType = validatingMemberType; } inline void ValidationContextImpl::setElemStack(ElemStack* elemStack) { fElemStack = elemStack; } inline void ValidationContextImpl::setScanner(XMLScanner* scanner) { fScanner = scanner; } inline void ValidationContextImpl::setNamespaceScope(NamespaceScope* nsStack) { fNamespaceScope = nsStack; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/XSerializeEngine.hpp000644 000765 000024 00000055453 13241160334 024031 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSerializeEngine.hpp 679296 2008-07-24 08:13:42Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSERIALIZE_ENGINE_HPP) #define XERCESC_INCLUDE_GUARD_XSERIALIZE_ENGINE_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XSerializable; class XProtoType; class MemoryManager; class XSerializedObjectId; class BinOutputStream; class BinInputStream; class XMLGrammarPool; class XMLGrammarPoolImpl; class XMLStringPool; class XMLUTIL_EXPORT XSerializeEngine { public: enum { mode_Store , mode_Load }; static const bool toReadBufferLen; typedef unsigned int XSerializedObjectId_t; /*** * * Destructor * ***/ ~XSerializeEngine(); /*** * * Constructor for de-serialization(loading) * * Application needs to make sure that the instance of * BinInputStream, persists beyond the life of this * SerializeEngine. * * Param * inStream input stream * gramPool Grammar Pool * bufSize the size of the internal buffer * ***/ XSerializeEngine(BinInputStream* inStream , XMLGrammarPool* const gramPool , XMLSize_t bufSize = 8192 ); /*** * * Constructor for serialization(storing) * * Application needs to make sure that the instance of * BinOutputStream, persists beyond the life of this * SerializeEngine. * * Param * outStream output stream * gramPool Grammar Pool * bufSize the size of the internal buffer * ***/ XSerializeEngine(BinOutputStream* outStream , XMLGrammarPool* const gramPool , XMLSize_t bufSize = 8192 ); /*** * * When serialization, flush out the internal buffer * * Return: * ***/ void flush(); /*** * * Checking if the serialize engine is doing serialization(storing) * * Return: true, if it is * false, otherwise * ***/ inline bool isStoring() const; /*** * * Checking if the serialize engine is doing de-serialization(loading) * * Return: true, if it is * false, otherwise * ***/ inline bool isLoading() const; /*** * * Get the GrammarPool * * Return: XMLGrammarPool * ***/ XMLGrammarPool* getGrammarPool() const; /*** * * Get the StringPool * * Return: XMLStringPool * ***/ XMLStringPool* getStringPool() const; /*** * * Get the embeded Memory Manager * * Return: MemoryManager * ***/ MemoryManager* getMemoryManager() const; /*** * * Get the storer level (the level of the serialize engine * which created the binary stream that this serialize engine * is loading). * * The level returned is meaningful only when * the engine isLoading. * * Return: level * ***/ inline unsigned int getStorerLevel() const; /*** * * Write object to the internal buffer. * * Param * objectToWrite: the object to be serialized * * Return: * ***/ void write(XSerializable* const objectToWrite); /*** * * Write prototype info to the internal buffer. * * Param * protoType: instance of prototype * * Return: * ***/ void write(XProtoType* const protoType); /*** * * Write a stream of XMLByte to the internal buffer. * * Param * toWrite: the stream of XMLByte to write * writeLen: the length of the stream * * Return: * ***/ void write(const XMLByte* const toWrite , XMLSize_t writeLen); /*** * * Write a stream of XMLCh to the internal buffer. * * Param * toWrite: the stream of XMLCh to write * writeLen: the length of the stream * * Return: * ***/ void write(const XMLCh* const toWrite , XMLSize_t writeLen); /*** * * Write a stream of XMLCh to the internal buffer. * * Write the bufferLen first if requested, then the length * of the stream followed by the stream. * * Param * toWrite: the stream of XMLCh to write * bufferLen: the maximum size of the buffer * toWriteBufLen: specify if the bufferLen need to be written or not * * Return: * ***/ void writeString(const XMLCh* const toWrite , const XMLSize_t bufferLen = 0 , bool toWriteBufLen = false); /*** * * Write a stream of XMLByte to the internal buffer. * * Write the bufferLen first if requested, then the length * of the stream followed by the stream. * * Param * toWrite: the stream of XMLByte to write * bufferLen: the maximum size of the buffer * toWriteBufLen: specify if the bufferLen need to be written or not * * Return: * ***/ void writeString(const XMLByte* const toWrite , const XMLSize_t bufferLen = 0 , bool toWriteBufLen = false); static const bool toWriteBufferLen; /*** * * Read/Create object from the internal buffer. * * Param * protoType: an instance of prototype of the object anticipated * * Return: to object read/created * ***/ XSerializable* read(XProtoType* const protoType); /*** * * Read prototype object from the internal buffer. * Verify if the same prototype object found in buffer. * * Param * protoType: an instance of prototype of the object anticipated * objTag: the object Tag to an existing object * * Return: true : if matching found * false : otherwise * ***/ bool read(XProtoType* const protoType , XSerializedObjectId_t* objTag); /*** * * Read XMLByte stream from the internal buffer. * * Param * toRead: the buffer to hold the XMLByte stream * readLen: the length of the XMLByte to read in * * Return: * ***/ void read(XMLByte* const toRead , XMLSize_t readLen); /*** * * Read XMLCh stream from the internal buffer. * * Param * toRead: the buffer to hold the XMLCh stream * readLen: the length of the XMLCh to read in * * Return: * ***/ void read(XMLCh* const toRead , XMLSize_t readLen); /*** * * Read a stream of XMLCh from the internal buffer. * * Read the bufferLen first if requested, then the length * of the stream followed by the stream. * * Param * toRead: the pointer to the buffer to hold the XMLCh stream * bufferLen: the size of the buffer created * dataLen: the length of the stream * toReadBufLen: specify if the bufferLen need to be read or not * * Return: * ***/ void readString(XMLCh*& toRead , XMLSize_t& bufferLen , XMLSize_t& dataLen , bool toReadBufLen = false); /*** * * Read a stream of XMLCh from the internal buffer. * * Read the bufferLen first if requested, then the length * of the stream followed by the stream. * * Param * toRead: the pointer to the buffer to hold the XMLCh stream * bufferLen: the size of the buffer created * * Return: * ***/ inline void readString(XMLCh*& toRead , XMLSize_t& bufferLen); /*** * * Read a stream of XMLCh from the internal buffer. * * Param * toRead: the pointer to the buffer to hold the XMLCh stream * * Return: * ***/ inline void readString(XMLCh*& toRead); /*** * * Read a stream of XMLByte from the internal buffer. * * Read the bufferLen first if requested, then the length * of the stream followed by the stream. * * Param * toRead: the pointer to the buffer to hold the XMLByte stream * bufferLen: the size of the buffer created * dataLen: the length of the stream * toReadBufLen: specify if the bufferLen need to be read or not * * Return: * ***/ void readString(XMLByte*& toRead , XMLSize_t& bufferLen , XMLSize_t& dataLen , bool toReadBufLen = false); /*** * * Read a stream of XMLByte from the internal buffer. * * Read the bufferLen first if requested, then the length * of the stream followed by the stream. * * Param * toRead: the pointer to the buffer to hold the XMLByte stream * bufferLen: the size of the buffer created * * Return: * ***/ inline void readString(XMLByte*& toRead , XMLSize_t& bufferLen); /*** * * Read a stream of XMLByte from the internal buffer. * * Read the bufferLen first if requested, then the length * of the stream followed by the stream. * * Param * toRead: the pointer to the buffer to hold the XMLByte stream * bufferLen: the size of the buffer created * dataLen: the length of the stream * toReadBufLen: specify if the bufferLen need to be read or not * * Return: * ***/ inline void readString(XMLByte*& toRead); /*** * * Check if the template object has been stored or not * * Param * objectPtr: the template object pointer * * Return: true : the object has NOT been stored yet * false : otherwise * ***/ bool needToStoreObject(void* const templateObjectToWrite); /*** * * Check if the template object has been loaded or not * * Param * objectPtr: the address of the template object pointer * * Return: true : the object has NOT been loaded yet * false : otherwise * ***/ bool needToLoadObject(void** templateObjectToRead); /*** * * In the case of needToLoadObject() return true, the client * application needs to instantiate an expected template object, and * register the address to the engine. * * Param * objectPtr: the template object pointer newly instantiated * * Return: * ***/ void registerObject(void* const templateObjectToRegister); /*** * * Insertion operator for serializable classes * ***/ friend XSerializeEngine& operator<<(XSerializeEngine& , XSerializable* const ); /*** * * Insertion operators for * . basic Xerces data types * . built-in types * ***/ XSerializeEngine& operator<<(XMLByte); XSerializeEngine& operator<<(XMLCh); XSerializeEngine& operator<<(char); XSerializeEngine& operator<<(short); XSerializeEngine& operator<<(int); XSerializeEngine& operator<<(unsigned int); XSerializeEngine& operator<<(long); XSerializeEngine& operator<<(unsigned long); XSerializeEngine& operator<<(float); XSerializeEngine& operator<<(double); XSerializeEngine& operator<<(bool); // These cannot be done as operators since on some platforms they // may collide with int/long types. // void writeSize (XMLSize_t); void writeInt64 (XMLInt64); void writeUInt64 (XMLUInt64); /*** * * Extraction operators for * . basic Xerces data types * . built-in types * ***/ XSerializeEngine& operator>>(XMLByte&); XSerializeEngine& operator>>(XMLCh&); XSerializeEngine& operator>>(char&); XSerializeEngine& operator>>(short&); XSerializeEngine& operator>>(int&); XSerializeEngine& operator>>(unsigned int&); XSerializeEngine& operator>>(long&); XSerializeEngine& operator>>(unsigned long&); XSerializeEngine& operator>>(float&); XSerializeEngine& operator>>(double&); XSerializeEngine& operator>>(bool&); void readSize (XMLSize_t&); void readInt64 (XMLInt64&); void readUInt64 (XMLUInt64&); /*** * * Getters * ***/ inline XMLSize_t getBufSize() const; inline XMLSize_t getBufCur() const; inline XMLSize_t getBufCurAccumulated() const; inline unsigned long getBufCount() const; void trace(char*) const; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSerializeEngine(); XSerializeEngine(const XSerializeEngine&); XSerializeEngine& operator=(const XSerializeEngine&); /*** * * Store Pool Opertions * ***/ XSerializedObjectId_t lookupStorePool(void* const objectPtr) const; void addStorePool(void* const objectPtr); /*** * * Load Pool Opertions * ***/ XSerializable* lookupLoadPool(XSerializedObjectId_t objectTag) const; void addLoadPool(void* const objectPtr); /*** * * Intenal Buffer Operations * ***/ inline void checkAndFillBuffer(XMLSize_t bytesNeedToRead); inline void checkAndFlushBuffer(XMLSize_t bytesNeedToWrite); void fillBuffer(); void flushBuffer(); void pumpCount(); inline void resetBuffer(); /*** * * Helper * ***/ inline void ensureStoring() const; inline void ensureLoading() const; inline void ensureStoreBuffer() const; inline void ensureLoadBuffer() const; inline void ensurePointer(void* const) const; inline void Assert(bool toEval , const XMLExcepts::Codes toThrow) const; inline XMLSize_t calBytesNeeded(XMLSize_t) const; inline XMLSize_t alignAdjust(XMLSize_t) const; inline void alignBufCur(XMLSize_t); // Make XTemplateSerializer friend of XSerializeEngine so that // we can call lookupStorePool and lookupLoadPool in the case of // annotations. friend class XTemplateSerializer; // ------------------------------------------------------------------------------- // data // // fStoreLoad: // Indicator: storing(serialization) or loading(de-serialization) // // fStorerLevel: // The level of the serialize engine which created the binary // stream that this serialize engine is loading // // It is set by GrammarPool when loading // // fGrammarPool: // Thw owning GrammarPool which instantiate this SerializeEngine // instance // // fInputStream: // Binary stream to read from (de-serialization), provided // by client application, not owned. // // fOutputStream: // Binary stream to write to (serialization), provided // by client application, not owned. // // fBufSize: // The size of the internal buffer // // fBufStart/fBufEnd: // // The internal buffer. // fBufEnd: // one beyond the last valid cell // fBufEnd === (fBufStart + fBufSize) // // fBufCur: // The cursor of the buffer // // fBufLoadMax: // Indicating the end of the valid content in the buffer // // fStorePool: // Object collection for storing // // fLoadPool: // Object collection for loading // // fMapCount: // ------------------------------------------------------------------------------- const short fStoreLoad; unsigned int fStorerLevel; XMLGrammarPool* const fGrammarPool; BinInputStream* const fInputStream; BinOutputStream* const fOutputStream; unsigned long fBufCount; //buffer const XMLSize_t fBufSize; XMLByte* const fBufStart; XMLByte* const fBufEnd; XMLByte* fBufCur; XMLByte* fBufLoadMax; /*** * Map for storing object * * key: XSerializable* * XProtoType* * * value: XMLInteger*, owned * ***/ RefHashTableOf* fStorePool; /*** * Vector for loading object, objects are NOT owned * * data: XSerializable* * XProtoType* * ***/ ValueVectorOf* fLoadPool; /*** * object counter ***/ XSerializedObjectId_t fObjectCount; //to allow grammar pool to set storer level when loading friend class XMLGrammarPoolImpl; }; inline bool XSerializeEngine::isStoring() const { return (fStoreLoad == mode_Store); } inline bool XSerializeEngine::isLoading() const { return (fStoreLoad == mode_Load); } inline XSerializeEngine& operator<<(XSerializeEngine& serEng , XSerializable* const serObj) { serEng.write(serObj); return serEng; } inline void XSerializeEngine::ensureStoring() const { Assert(isStoring(), XMLExcepts::XSer_Storing_Violation); } inline void XSerializeEngine::ensureLoading() const { Assert(isLoading(), XMLExcepts::XSer_Loading_Violation); } inline void XSerializeEngine::Assert(bool toEval , const XMLExcepts::Codes toThrow) const { if (!toEval) { ThrowXMLwithMemMgr(XSerializationException, toThrow, getMemoryManager()); } } inline void XSerializeEngine::readString(XMLCh*& toRead , XMLSize_t& bufferLen) { XMLSize_t dummyDataLen; readString(toRead, bufferLen, dummyDataLen); } inline void XSerializeEngine::readString(XMLCh*& toRead) { XMLSize_t dummyBufferLen; XMLSize_t dummyDataLen; readString(toRead, dummyBufferLen, dummyDataLen); } inline void XSerializeEngine::readString(XMLByte*& toRead , XMLSize_t& bufferLen) { XMLSize_t dummyDataLen; readString(toRead, bufferLen, dummyDataLen); } inline void XSerializeEngine::readString(XMLByte*& toRead) { XMLSize_t dummyBufferLen; XMLSize_t dummyDataLen; readString(toRead, dummyBufferLen, dummyDataLen); } inline XMLSize_t XSerializeEngine::getBufSize() const { return fBufSize; } inline XMLSize_t XSerializeEngine::getBufCur() const { return (fBufCur-fBufStart); } inline XMLSize_t XSerializeEngine::getBufCurAccumulated() const { return (fBufCount - (isStoring() ? 0: 1)) * fBufSize + (fBufCur-fBufStart); } inline unsigned long XSerializeEngine::getBufCount() const { return fBufCount; } inline unsigned int XSerializeEngine::getStorerLevel() const { return fStorerLevel; } /*** * Ought to be nested class ***/ class XSerializedObjectId : public XMemory { public: ~XSerializedObjectId(){}; private: inline XSerializedObjectId(XSerializeEngine::XSerializedObjectId_t val): fData(val) { }; inline XSerializeEngine::XSerializedObjectId_t getValue() const {return fData; }; friend class XSerializeEngine; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSerializedObjectId(); XSerializedObjectId(const XSerializedObjectId&); XSerializedObjectId& operator=(const XSerializedObjectId&); XSerializeEngine::XSerializedObjectId_t fData; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/EndOfEntityException.hpp000644 000765 000024 00000007223 13241160334 024663 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: EndOfEntityException.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_ENDOFENTITYEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_ENDOFENTITYEXCEPTION_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLEntityDecl; // // This class is only used internally. Its thrown by the ReaderMgr class, // when an entity ends, and is caught in the scanner. This tells the scanner // that an entity has ended, and allows it to do the right thing according // to what was going on when the entity ended. // // Since its internal, it does not bother implementing XMLException. // class XMLPARSER_EXPORT EndOfEntityException { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- EndOfEntityException( XMLEntityDecl* entityThatEnded , const XMLSize_t readerNum) : fEntity(entityThatEnded) , fReaderNum(readerNum) { } EndOfEntityException(const EndOfEntityException& toCopy) : fEntity(toCopy.fEntity) , fReaderNum(toCopy.fReaderNum) { } ~EndOfEntityException() { } // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- XMLEntityDecl& getEntity(); const XMLEntityDecl& getEntity() const; XMLSize_t getReaderNum() const; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- EndOfEntityException& operator = (const EndOfEntityException&); // ----------------------------------------------------------------------- // Private data members // // fEntity // This is a reference to the entity that ended, causing this // exception. // // fReaderNum // The unique reader number of the reader that was handling this // entity. This is used to know whether a particular entity has // ended. // ----------------------------------------------------------------------- XMLEntityDecl* fEntity; XMLSize_t fReaderNum; }; // --------------------------------------------------------------------------- // EndOfEntityException: Getter methods // --------------------------------------------------------------------------- inline XMLEntityDecl& EndOfEntityException::getEntity() { return *fEntity; } inline const XMLEntityDecl& EndOfEntityException::getEntity() const { return *fEntity; } inline XMLSize_t EndOfEntityException::getReaderNum() const { return fReaderNum; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/internal/XSerializationException.hpp000644 000765 000024 00000002277 13241160334 025444 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSerializationException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSERIALIZATION_EXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_XSERIALIZATION_EXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(XSerializationException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax/DocumentHandler.hpp000644 000765 000024 00000024177 13241160334 022656 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DocumentHandler.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DOCUMENTHANDLER_HPP) #define XERCESC_INCLUDE_GUARD_DOCUMENTHANDLER_HPP #include XERCES_CPP_NAMESPACE_BEGIN class AttributeList; class Locator; /** * Receive notification of general document events. * *

This is the main interface that most SAX applications * implement: if the application needs to be informed of basic parsing * events, it implements this interface and registers an instance with * the SAX parser using the setDocumentHandler method. The parser * uses the instance to report basic document-related events like * the start and end of elements and character data.

* *

The order of events in this interface is very important, and * mirrors the order of information in the document itself. For * example, all of an element's content (character data, processing * instructions, and/or subelements) will appear, in order, between * the startElement event and the corresponding endElement event.

* *

Application writers who do not want to implement the entire * interface while can derive a class from HandlerBase, which implements * the default functionality; parser writers can instantiate * HandlerBase to obtain a default handler. The application can find * the location of any document event using the Locator interface * supplied by the Parser through the setDocumentLocator method.

* * @see Parser#setDocumentHandler * @see Locator#Locator * @see HandlerBase#HandlerBase */ class SAX_EXPORT DocumentHandler { public: /** @name Constructors and Destructor */ //@{ /** Default constructor */ DocumentHandler() { } /** Destructor */ virtual ~DocumentHandler() { } //@} /** @name The virtual document handler interface */ //@{ /** * Receive notification of character data. * *

The Parser will call this method to report each chunk of * character data. SAX parsers may return all contiguous character * data in a single chunk, or they may split it into several * chunks; however, all of the characters in any single event * must come from the same external entity, so that the Locator * provides useful information.

* *

The application must not attempt to read from the array * outside of the specified range.

* *

Note that some parsers will report whitespace using the * ignorableWhitespace() method rather than this one (validating * parsers must do so).

* * @param chars The characters from the XML document. * @param length The number of characters to read from the array. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see #ignorableWhitespace * @see Locator#Locator */ virtual void characters ( const XMLCh* const chars , const XMLSize_t length ) = 0; /** * Receive notification of the end of a document. * *

The SAX parser will invoke this method only once, and it will * be the last method invoked during the parse. The parser shall * not invoke this method until it has either abandoned parsing * (because of an unrecoverable error) or reached the end of * input.

* * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void endDocument () = 0; /** * Receive notification of the end of an element. * *

The SAX parser will invoke this method at the end of every * element in the XML document; there will be a corresponding * startElement() event for every endElement() event (even when the * element is empty).

* *

If the element name has a namespace prefix, the prefix will * still be attached to the name.

* * @param name The element type name * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void endElement(const XMLCh* const name) = 0; /** * Receive notification of ignorable whitespace in element content. * *

Validating Parsers must use this method to report each chunk * of ignorable whitespace (see the W3C XML 1.0 recommendation, * section 2.10): non-validating parsers may also use this method * if they are capable of parsing and using content models.

* *

SAX parsers may return all contiguous whitespace in a single * chunk, or they may split it into several chunks; however, all of * the characters in any single event must come from the same * external entity, so that the Locator provides useful * information.

* *

The application must not attempt to read from the array * outside of the specified range.

* * @param chars The characters from the XML document. * @param length The number of characters to read from the array. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see #characters */ virtual void ignorableWhitespace ( const XMLCh* const chars , const XMLSize_t length ) = 0; /** * Receive notification of a processing instruction. * *

The Parser will invoke this method once for each processing * instruction found: note that processing instructions may occur * before or after the main document element.

* *

A SAX parser should never report an XML declaration (XML 1.0, * section 2.8) or a text declaration (XML 1.0, section 4.3.1) * using this method.

* * @param target The processing instruction target. * @param data The processing instruction data, or null if * none was supplied. * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void processingInstruction ( const XMLCh* const target , const XMLCh* const data ) = 0; /** * Reset the Document object on its reuse * *

This method helps in reseting the document implementation * defaults each time the document is begun.

* */ virtual void resetDocument() = 0; /** * Receive an object for locating the origin of SAX document events. * * SAX parsers are strongly encouraged (though not absolutely * required) to supply a locator: if it does so, it must supply * the locator to the application by invoking this method before * invoking any of the other methods in the DocumentHandler * interface. * * The locator allows the application to determine the end * position of any document-related event, even if the parser is * not reporting an error. Typically, the application will * use this information for reporting its own errors (such as * character content that does not match an application's * business rules). The information returned by the locator * is probably not sufficient for use with a search engine. * * Note that the locator will return correct information only * during the invocation of the events in this interface. The * application should not attempt to use it at any other time. * * @param locator An object that can return the location of * any SAX document event. The object is only * 'on loan' to the client code and they are not * to attempt to delete or modify it in any way! * * @see Locator#Locator */ virtual void setDocumentLocator(const Locator* const locator) = 0; /** * Receive notification of the beginning of a document. * *

The SAX parser will invoke this method only once, before any * other methods in this interface or in DTDHandler (except for * setDocumentLocator).

* * @exception SAXException Any SAX exception, possibly * wrapping another exception. */ virtual void startDocument() = 0; /** * Receive notification of the beginning of an element. * *

The Parser will invoke this method at the beginning of every * element in the XML document; there will be a corresponding * endElement() event for every startElement() event (even when the * element is empty). All of the element's content will be * reported, in order, before the corresponding endElement() * event.

* *

If the element name has a namespace prefix, the prefix will * still be attached. Note that the attribute list provided will * contain only attributes with explicit values (specified or * defaulted): \#IMPLIED attributes will be omitted.

* * @param name The element type name. * @param attrs The attributes attached to the element, if any. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see #endElement * @see AttributeList#AttributeList */ virtual void startElement ( const XMLCh* const name , AttributeList& attrs ) = 0; //@} private : /* Unimplemented Constructors and operators */ /* Copy constructor */ DocumentHandler(const DocumentHandler&); /** Assignment operator */ DocumentHandler& operator=(const DocumentHandler&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax/SAXParseException.cpp000644 000765 000024 00000010524 13241160333 023070 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SAXParseException.cpp 672273 2008-06-27 13:57:00Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // SAXParseException: Constructors and Destructor // --------------------------------------------------------------------------- SAXParseException::SAXParseException(const XMLCh* const message , const Locator& locator , MemoryManager* const manager) : SAXException(message, manager) , fColumnNumber(locator.getColumnNumber()) , fLineNumber(locator.getLineNumber()) , fPublicId(XMLString::replicate(locator.getPublicId(), manager)) , fSystemId(XMLString::replicate(locator.getSystemId(), manager)) { } SAXParseException::SAXParseException(const XMLCh* const message , const XMLCh* const publicId , const XMLCh* const systemId , const XMLFileLoc lineNumber , const XMLFileLoc columnNumber , MemoryManager* const manager) : SAXException(message, manager) , fColumnNumber(columnNumber) , fLineNumber(lineNumber) , fPublicId(XMLString::replicate(publicId, manager)) , fSystemId(XMLString::replicate(systemId, manager)) { } SAXParseException::SAXParseException(const SAXParseException& toCopy) : SAXException(toCopy) , fColumnNumber(toCopy.fColumnNumber) , fLineNumber(toCopy.fLineNumber) , fPublicId(0) , fSystemId(0) { fPublicId = XMLString::replicate(toCopy.fPublicId, toCopy.fMemoryManager); fSystemId = XMLString::replicate(toCopy.fSystemId, toCopy.fMemoryManager); } SAXParseException::~SAXParseException() { fMemoryManager->deallocate(fPublicId);//XMLString::release(&fPublicId); fMemoryManager->deallocate(fSystemId);//XMLString::release(&fSystemId); } // --------------------------------------------------------------------------- // SAXParseException: Public operators // --------------------------------------------------------------------------- SAXParseException& SAXParseException::operator=(const SAXParseException& toAssign) { if (this == &toAssign) return *this; fMemoryManager->deallocate(fPublicId);//XMLString::release(&fPublicId); fMemoryManager->deallocate(fSystemId);//XMLString::release(&fSystemId); this->SAXException::operator =(toAssign); fColumnNumber = toAssign.fColumnNumber; fLineNumber = toAssign.fLineNumber; fPublicId = XMLString::replicate(toAssign.fPublicId, fMemoryManager); fSystemId = XMLString::replicate(toAssign.fSystemId, fMemoryManager); return *this; } // --------------------------------------------------------------------------- // SAXParseException: Getter methods // --------------------------------------------------------------------------- const XMLCh* SAXParseException::getPublicId() const { return fPublicId; } const XMLCh* SAXParseException::getSystemId() const { return fSystemId; } XMLFileLoc SAXParseException::getLineNumber() const { return fLineNumber; } XMLFileLoc SAXParseException::getColumnNumber() const { return fColumnNumber; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/sax/InputSource.hpp000644 000765 000024 00000026157 13241160334 022062 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: InputSource.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_INPUTSOURCE_HPP) #define XERCESC_INCLUDE_GUARD_INPUTSOURCE_HPP #include XERCES_CPP_NAMESPACE_BEGIN class BinInputStream; /** * A single input source for an XML entity. * *

This class encapsulates information about an input source in a * single object, which may include a public identifier or a system * identifier

* *

There are two places that the application will deliver this input * source to the parser: as the argument to the Parser::parse method, or as * the return value of the EntityResolver::resolveEntity method.

* *

InputSource is never used directly, but is the base class for a number * of derived classes for particular types of input sources. Derivatives are * provided (in the framework/ directory) for URL input sources, memory buffer * input sources, and so on.

* *

When it is time to parse the input described by an input source, it * will be asked to create a binary stream for that source. That stream will * be used to input the data of the source. The derived class provides the * implementation of the makeStream() method, and provides a type of stream * of the correct type for the input source it represents. * *

An InputSource object belongs to the application: the parser never * modifies them in any way. They are always passed by const reference so * the parser will make a copy of any input sources that it must keep * around beyond the call.

* * @see Parser#parse * @see EntityResolver#resolveEntity */ class SAX_EXPORT InputSource : public XMemory { public: // ----------------------------------------------------------------------- // All constructors are hidden, just the destructor is available // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor * */ virtual ~InputSource(); //@} // ----------------------------------------------------------------------- /** @name Virtual input source interface */ //@{ /** * Makes the byte stream for this input source. * *

The derived class must create and return a binary input stream of an * appropriate type for its kind of data source. The returned stream must * be dynamically allocated and becomes the parser's property. *

* * @see BinInputStream */ virtual BinInputStream* makeStream() const = 0; //@} // ----------------------------------------------------------------------- /** @name Getter methods */ //@{ /** * An input source can be set to force the parser to assume a particular * encoding for the data that input source represents, via the setEncoding() * method. This method returns name of the encoding that is to be forced. * If the encoding has never been forced, it returns a null pointer. * * @return The forced encoding, or null if none was supplied. * @see #setEncoding */ virtual const XMLCh* getEncoding() const; /** * Get the public identifier for this input source. * * @return The public identifier, or null if none was supplied. * @see #setPublicId */ virtual const XMLCh* getPublicId() const; /** * Get the system identifier for this input source. * *

If the system ID is a URL, it will be fully resolved.

* * @return The system identifier. * @see #setSystemId */ virtual const XMLCh* getSystemId() const; /** * Get the flag that indicates if the parser should issue fatal error if this input source * is not found. * * @return True if the parser should issue fatal error if this input source is not found. * False if the parser issue warning message instead. * @see #setIssueFatalErrorIfNotFound */ virtual bool getIssueFatalErrorIfNotFound() const; MemoryManager* getMemoryManager() const; //@} // ----------------------------------------------------------------------- /** @name Setter methods */ //@{ /** * Set the encoding which will be required for use with the XML text read * via a stream opened by this input source. * *

This is usually not set, allowing the encoding to be sensed in the * usual XML way. However, in some cases, the encoding in the file is known * to be incorrect because of intermediate transcoding, for instance * encapsulation within a MIME document. * * @param encodingStr The name of the encoding to force. */ virtual void setEncoding(const XMLCh* const encodingStr); /** * Set the public identifier for this input source. * *

The public identifier is always optional: if the application writer * includes one, it will be provided as part of the location information.

* * @param publicId The public identifier as a string. * @see Locator#getPublicId * @see SAXParseException#getPublicId * @see #getPublicId */ virtual void setPublicId(const XMLCh* const publicId); /** * Set the system identifier for this input source. * *

Set the system identifier for this input source. * *

The system id is always required. The public id may be used to map * to another system id, but the system id must always be present as a fall * back. * *

If the system ID is a URL, it must be fully resolved.

* * @param systemId The system identifier as a string. * @see #getSystemId * @see Locator#getSystemId * @see SAXParseException#getSystemId */ virtual void setSystemId(const XMLCh* const systemId); /** * Indicates if the parser should issue fatal error if this input source * is not found. If set to false, the parser issue warning message instead. * * @param flag True if the parser should issue fatal error if this input source is not found. * If set to false, the parser issue warning message instead. (Default: true) * * @see #getIssueFatalErrorIfNotFound */ virtual void setIssueFatalErrorIfNotFound(const bool flag); //@} protected : // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ /** Default constructor */ InputSource(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Constructor with a system identifier as XMLCh type. * @param systemId The system identifier (URI). * @param manager Pointer to the memory manager to be used to * allocate objects. */ InputSource(const XMLCh* const systemId, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Constructor with a system and public identifiers * @param systemId The system identifier (URI). * @param publicId The public identifier as in the entity definition. * @param manager Pointer to the memory manager to be used to * allocate objects. */ InputSource ( const XMLCh* const systemId , const XMLCh* const publicId , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Constructor witha system identifier as string * @param systemId The system identifier (URI). * @param manager Pointer to the memory manager to be used to * allocate objects. */ InputSource(const char* const systemId, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Constructor witha system and public identifiers. Both as string * @param systemId The system identifier (URI). * @param publicId The public identifier as in the entity definition. * @param manager Pointer to the memory manager to be used to * allocate objects. */ InputSource ( const char* const systemId , const char* const publicId , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- InputSource(const InputSource&); InputSource& operator=(const InputSource&); // ----------------------------------------------------------------------- // Private data members // // fEncoding // This is the encoding to use. Usually this is null, which means // to use the information found in the file itself. But, if set, // this encoding will be used without question. // // fPublicId // This is the optional public id for the input source. It can be // null if none is desired. // // fSystemId // This is the system id for the input source. This is what is // actually used to open the source. // // fFatalErrorIfNotFound // ----------------------------------------------------------------------- MemoryManager* const fMemoryManager; XMLCh* fEncoding; XMLCh* fPublicId; XMLCh* fSystemId; bool fFatalErrorIfNotFound; }; // --------------------------------------------------------------------------- // InputSource: Getter methods // --------------------------------------------------------------------------- inline const XMLCh* InputSource::getEncoding() const { return fEncoding; } inline const XMLCh* InputSource::getPublicId() const { return fPublicId; } inline const XMLCh* InputSource::getSystemId() const { return fSystemId; } inline bool InputSource::getIssueFatalErrorIfNotFound() const { return fFatalErrorIfNotFound; } inline MemoryManager* InputSource::getMemoryManager() const { return fMemoryManager; } // --------------------------------------------------------------------------- // InputSource: Setter methods // --------------------------------------------------------------------------- inline void InputSource::setIssueFatalErrorIfNotFound(const bool flag) { fFatalErrorIfNotFound = flag; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax/SAXException.cpp000644 000765 000024 00000004323 13241160333 022075 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SAXException.cpp 471747 2006-11-06 14:31:56Z amassari $ */ #include "SAXException.hpp" XERCES_CPP_NAMESPACE_BEGIN // SAXNotSupportedException Constructors SAXNotSupportedException::SAXNotSupportedException(MemoryManager* const manager) : SAXException(manager) { } SAXNotSupportedException::SAXNotSupportedException(const XMLCh* const msg, MemoryManager* const manager) : SAXException(msg, manager) { } SAXNotSupportedException::SAXNotSupportedException(const char* const msg, MemoryManager* const manager) : SAXException(msg, manager) { } SAXNotSupportedException::SAXNotSupportedException(const SAXException& toCopy) : SAXException(toCopy) { } // SAXNotRecognizedException Constructors SAXNotRecognizedException::SAXNotRecognizedException(MemoryManager* const manager) : SAXException(manager) { } SAXNotRecognizedException::SAXNotRecognizedException(const XMLCh* const msg, MemoryManager* const manager) : SAXException(msg, manager) { } SAXNotRecognizedException::SAXNotRecognizedException(const char* const msg, MemoryManager* const manager) : SAXException(msg, manager) { } SAXNotRecognizedException::SAXNotRecognizedException(const SAXException& toCopy) : SAXException(toCopy) { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/sax/Parser.hpp000644 000765 000024 00000020222 13241160333 021020 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Parser.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_PARSER_HPP) #define XERCESC_INCLUDE_GUARD_PARSER_HPP #include XERCES_CPP_NAMESPACE_BEGIN class DTDHandler; class EntityResolver; class DocumentHandler; class ErrorHandler; class InputSource; /** * Basic interface for SAX (Simple API for XML) parsers. * * All SAX parsers must implement this basic interface: it allows * applications to register handlers for different types of events * and to initiate a parse from a URI, or a character stream. * * All SAX parsers must also implement a zero-argument constructor * (though other constructors are also allowed). * * SAX parsers are reusable but not re-entrant: the application * may reuse a parser object (possibly with a different input source) * once the first parse has completed successfully, but it may not * invoke the parse() methods recursively within a parse. * * @see EntityResolver#EntityResolver * @see DTDHandler#DTDHandler * @see DocumentHandler#DocumentHandler * @see ErrorHandler#ErrorHandler * @see HandlerBase#HandlerBase * @see InputSource#InputSource */ #include class SAX_EXPORT Parser { public: /** @name Constructors and Destructor */ // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- //@{ /** The default constructor */ Parser() { } /** The destructor */ virtual ~Parser() { } //@} //----------------------------------------------------------------------- // The parser interface //----------------------------------------------------------------------- /** @name The parser interfaces */ //@{ /** * Allow an application to register a custom entity resolver. * * If the application does not register an entity resolver, the * SAX parser will resolve system identifiers and open connections * to entities itself (this is the default behaviour implemented in * HandlerBase). * * Applications may register a new or different entity resolver * in the middle of a parse, and the SAX parser must begin using * the new resolver immediately. * * @param resolver The object for resolving entities. * @see EntityResolver#EntityResolver * @see HandlerBase#HandlerBase */ virtual void setEntityResolver(EntityResolver* const resolver) = 0; /** * Allow an application to register a DTD event handler. * * If the application does not register a DTD handler, all DTD * events reported by the SAX parser will be silently ignored (this * is the default behaviour implemented by HandlerBase). * * Applications may register a new or different handler in the middle * of a parse, and the SAX parser must begin using the new handler * immediately. * * @param handler The DTD handler. * @see DTDHandler#DTDHandler * @see HandlerBase#HandlerBase */ virtual void setDTDHandler(DTDHandler* const handler) = 0; /** * Allow an application to register a document event handler. * * If the application does not register a document handler, all * document events reported by the SAX parser will be silently * ignored (this is the default behaviour implemented by * HandlerBase). * * Applications may register a new or different handler in the * middle of a parse, and the SAX parser must begin using the new * handler immediately. * * @param handler The document handler. * @see DocumentHandler#DocumentHandler * @see HandlerBase#HandlerBase */ virtual void setDocumentHandler(DocumentHandler* const handler) = 0; /** * Allow an application to register an error event handler. * * If the application does not register an error event handler, * all error events reported by the SAX parser will be silently * ignored, except for fatalError, which will throw a SAXException * (this is the default behaviour implemented by HandlerBase). * * Applications may register a new or different handler in the * middle of a parse, and the SAX parser must begin using the new * handler immediately. * * @param handler The error handler. * @see ErrorHandler#ErrorHandler * @see SAXException#SAXException * @see HandlerBase#HandlerBase */ virtual void setErrorHandler(ErrorHandler* const handler) = 0; /** * Parse an XML document. * * The application can use this method to instruct the SAX parser * to begin parsing an XML document from any valid input * source (a character stream, a byte stream, or a URI). * * Applications may not invoke this method while a parse is in * progress (they should create a new Parser instead for each * additional XML document). Once a parse is complete, an * application may reuse the same Parser object, possibly with a * different input source. * * @param source The input source for the top-level of the * XML document. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @exception XMLException An exception from the parser or client * handler code. * @see InputSource#InputSource * @see #setEntityResolver * @see #setDTDHandler * @see #setDocumentHandler * @see #setErrorHandler */ virtual void parse ( const InputSource& source ) = 0; /** * Parse an XML document from a system identifier (URI). * * This method is a shortcut for the common case of reading a * document from a system identifier. It is the exact equivalent * of the following: * * parse(new URLInputSource(systemId)); * * If the system identifier is a URL, it must be fully resolved * by the application before it is passed to the parser. * * @param systemId The system identifier (URI). * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @exception XMLException An exception from the parser or client * handler code. * @see #parse(const InputSource&) */ virtual void parse ( const XMLCh* const systemId ) = 0; /** * Parse an XML document from a system identifier (URI). * * This method is a shortcut for the common case of reading a * document from a system identifier. It is the exact equivalent * of the following: * * parse(new URLInputSource(systemId)); * * If the system identifier is a URL, it must be fully resolved * by the application before it is passed to the parser. * * @param systemId The system identifier (URI). * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @exception XMLException An exception from the parser or client * handler code. * @see #parse(const InputSource&) */ virtual void parse ( const char* const systemId ) = 0; //@} private : /* The copy constructor, you cannot call this directly */ Parser(const Parser&); /* The assignment operator, you cannot call this directly */ Parser& operator=(const Parser&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax/DTDHandler.hpp000644 000765 000024 00000011750 13241160333 021503 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DTDHandler.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_DTDHANDLER_HPP) #define XERCESC_INCLUDE_GUARD_DTDHANDLER_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Receive notification of basic DTD-related events. * *

If a SAX application needs information about notations and * unparsed entities, then the application implements this * interface and registers an instance with the SAX parser using * the parser's setDTDHandler method. The parser uses the * instance to report notation and unparsed entity declarations to * the application.

* *

The SAX parser may report these events in any order, regardless * of the order in which the notations and unparsed entities were * declared; however, all DTD events must be reported after the * document handler's startDocument event, and before the first * startElement event.

* *

It is up to the application to store the information for * future use (perhaps in a hash table or object tree). * If the application encounters attributes of type "NOTATION", * "ENTITY", or "ENTITIES", it can use the information that it * obtained through this interface to find the entity and/or * notation corresponding with the attribute value.

* *

The HandlerBase class provides a default implementation * of this interface, which simply ignores the events.

* * @see Parser#setDTDHandler * @see HandlerBase#HandlerBase */ class SAX_EXPORT DTDHandler { public: /** @name Constructors and Destructor */ //@{ /** Default Constructor */ DTDHandler() { } /** Destructor */ virtual ~DTDHandler() { } //@} /** @name The DTD handler interface */ //@{ /** * Receive notification of a notation declaration event. * *

It is up to the application to record the notation for later * reference, if necessary.

* *

If a system identifier is present, and it is a URL, the SAX * parser must resolve it fully before passing it to the * application.

* * @param name The notation name. * @param publicId The notation's public identifier, or null if * none was given. * @param systemId The notation's system identifier, or null if * none was given. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see #unparsedEntityDecl * @see AttributeList#AttributeList */ virtual void notationDecl ( const XMLCh* const name , const XMLCh* const publicId , const XMLCh* const systemId ) = 0; /** * Receive notification of an unparsed entity declaration event. * *

Note that the notation name corresponds to a notation * reported by the notationDecl() event. It is up to the * application to record the entity for later reference, if * necessary.

* *

If the system identifier is a URL, the parser must resolve it * fully before passing it to the application.

* * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @param name The unparsed entity's name. * @param publicId The entity's public identifier, or null if none * was given. * @param systemId The entity's system identifier (it must always * have one). * @param notationName The name of the associated notation. * @see #notationDecl * @see AttributeList#AttributeList */ virtual void unparsedEntityDecl ( const XMLCh* const name , const XMLCh* const publicId , const XMLCh* const systemId , const XMLCh* const notationName ) = 0; /** * Reset the DocType object on its reuse * *

This method helps in reseting the DTD object implementation * defaults each time the DTD is begun.

* */ virtual void resetDocType() = 0; //@} private : /* Unimplemented constructors and operators */ /* Copy constructor */ DTDHandler(const DTDHandler&); /* Assignment operator */ DTDHandler& operator=(const DTDHandler&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax/AttributeList.hpp000644 000765 000024 00000017044 13241160334 022374 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: AttributeList.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_ATTRIBUTELIST_HPP) #define XERCESC_INCLUDE_GUARD_ATTRIBUTELIST_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Interface for an element's attribute specifications. * * The SAX parser implements this interface and passes an instance * to the SAX application as the second argument of each startElement * event. * * The instance provided will return valid results only during the * scope of the startElement invocation (to save it for future * use, the application must make a copy: the AttributeListImpl * helper class provides a convenient constructor for doing so). * * An AttributeList includes only attributes that have been * specified or defaulted: \#IMPLIED attributes will not be included. * * There are two ways for the SAX application to obtain information * from the AttributeList. First, it can iterate through the entire * list: * * * public void startElement (String name, AttributeList atts) {
*  for (XMLSize_t i = 0; i < atts.getLength(); i++) {
*   String name = atts.getName(i);
*   String type = atts.getType(i);
*   String value = atts.getValue(i);
*   [...]
*  }
* } *
* * (Note that the result of getLength() will be zero if there * are no attributes.) * * As an alternative, the application can request the value or * type of specific attributes: * * * public void startElement (String name, AttributeList atts) {
*  String identifier = atts.getValue("id");
*  String label = atts.getValue("label");
*  [...]
* } *
* * The AttributeListImpl helper class provides a convenience * implementation for use by parser or application writers. * * @see DocumentHandler#startElement * @see AttributeListImpl#AttributeListImpl */ class SAX_EXPORT AttributeList { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors and Destructor */ //@{ /** Default constructor */ AttributeList() { } /** Destructor */ virtual ~AttributeList() { } //@} /** @name The virtual attribute list interface */ //@{ /** * Return the number of attributes in this list. * * The SAX parser may provide attributes in any * arbitrary order, regardless of the order in which they were * declared or specified. The number of attributes may be * zero. * * @return The number of attributes in the list. */ virtual XMLSize_t getLength() const = 0; /** * Return the name of an attribute in this list (by position). * * The names must be unique: the SAX parser shall not include the * same attribute twice. Attributes without values (those declared * \#IMPLIED without a value specified in the start tag) will be * omitted from the list. * * If the attribute name has a namespace prefix, the prefix * will still be attached. * * @param index The index of the attribute in the list (starting at 0). * @return The name of the indexed attribute, or null * if the index is out of range. * @see #getLength */ virtual const XMLCh* getName(const XMLSize_t index) const = 0; /** * Return the type of an attribute in the list (by position). * * The attribute type is one of the strings "CDATA", "ID", * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", * or "NOTATION" (always in upper case). * * If the parser has not read a declaration for the attribute, * or if the parser does not report attribute types, then it must * return the value "CDATA" as stated in the XML 1.0 Recommendation * (clause 3.3.3, "Attribute-Value Normalization"). * * For an enumerated attribute that is not a notation, the * parser will report the type as "NMTOKEN". * * @param index The index of the attribute in the list (starting at 0). * @return The attribute type as a string, or * null if the index is out of range. * @see #getLength * @see #getType */ virtual const XMLCh* getType(const XMLSize_t index) const = 0; /** * Return the value of an attribute in the list (by position). * * If the attribute value is a list of tokens (IDREFS, * ENTITIES, or NMTOKENS), the tokens will be concatenated * into a single string separated by whitespace. * * @param index The index of the attribute in the list (starting at 0). * @return The attribute value as a string, or * null if the index is out of range. * @see #getLength * @see #getValue */ virtual const XMLCh* getValue(const XMLSize_t index) const = 0; /** * Return the type of an attribute in the list (by name). * * The return value is the same as the return value for * getType(XMLSize_t). * * If the attribute name has a namespace prefix in the document, * the application must include the prefix here. * * @param name The name of the attribute. * @return The attribute type as a string, or null if no * such attribute exists. * @see #getType */ virtual const XMLCh* getType(const XMLCh* const name) const = 0; /** * Return the value of an attribute in the list (by name). * * The return value is the same as the return value for * getValue(XMLSize_t). * * If the attribute name has a namespace prefix in the document, * the application must include the prefix here. * * @param name The name of the attribute in the list. * @return The attribute value as a string, or null if * no such attribute exists. * @see #getValue */ virtual const XMLCh* getValue(const XMLCh* const name) const = 0; /** * Return the value of an attribute in the list (by name). * * The return value is the same as the return value for * getValue(XMLSize_t). * * If the attribute name has a namespace prefix in the document, * the application must include the prefix here. * * @param name The name of the attribute in the list. * @return The attribute value as a string, or null if * no such attribute exists. * @see #getValue */ virtual const XMLCh* getValue(const char* const name) const = 0; //@} private : /* Constructors and operators */ /* Copy constructor */ AttributeList(const AttributeList&); /* Assignment operator */ AttributeList& operator=(const AttributeList&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax/Locator.hpp000644 000765 000024 00000007666 13241160333 021210 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Locator.hpp 672273 2008-06-27 13:57:00Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_LOCATOR_HPP) #define XERCESC_INCLUDE_GUARD_LOCATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Interface for associating a SAX event with a document location. * *

If a SAX parser provides location information to the SAX * application, it does so by implementing this interface and then * passing an instance to the application using the document * handler's setDocumentLocator method. The application can use the * object to obtain the location of any other document handler event * in the XML source document.

* *

Note that the results returned by the object will be valid only * during the scope of each document handler method: the application * will receive unpredictable results if it attempts to use the * locator at any other time.

* *

SAX parsers are not required to supply a locator, but they are * very strong encouraged to do so. If the parser supplies a * locator, it must do so before reporting any other document events. * If no locator has been set by the time the application receives * the startDocument event, the application should assume that a * locator is not available.

* * @see DocumentHandler#setDocumentLocator */ class SAX_EXPORT Locator { public: /** @name Constructors and Destructor */ //@{ /** Default constructor */ Locator() { } /** Destructor */ virtual ~Locator() { } //@} /** @name The locator interface */ //@{ /** * Return the public identifier for the current document event. *

This will be the public identifier * @return A string containing the public identifier, or * null if none is available. * @see #getSystemId */ virtual const XMLCh* getPublicId() const = 0; /** * Return the system identifier for the current document event. * *

If the system identifier is a URL, the parser must resolve it * fully before passing it to the application.

* * @return A string containing the system identifier, or null * if none is available. * @see #getPublicId */ virtual const XMLCh* getSystemId() const = 0; /** * Return the line number where the current document event ends. * Note that this is the line position of the first character * after the text associated with the document event. * @return The line number, or 0 if none is available. * @see #getColumnNumber */ virtual XMLFileLoc getLineNumber() const = 0; /** * Return the column number where the current document event ends. * Note that this is the column number of the first * character after the text associated with the document * event. The first column in a line is position 1. * @return The column number, or 0 if none is available. * @see #getLineNumber */ virtual XMLFileLoc getColumnNumber() const = 0; //@} private : /* Copy constructor */ Locator(const Locator&); /* Assignment operator */ Locator& operator=(const Locator&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax/Dummy.cpp000644 000765 000024 00000002521 13241160333 020654 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Dummy.cpp 471747 2006-11-06 14:31:56Z amassari $ */ #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/sax/EntityResolver.hpp000644 000765 000024 00000013171 13241160333 022567 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: EntityResolver.hpp 1701582 2015-09-07 09:21:15Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_ENTITYRESOLVER_HPP) #define XERCESC_INCLUDE_GUARD_ENTITYRESOLVER_HPP #include XERCES_CPP_NAMESPACE_BEGIN class InputSource; /** * Basic interface for resolving entities. * *

If a SAX application needs to implement customized handling * for external entities, it must implement this interface and * register an instance with the SAX parser using the parser's * setEntityResolver method.

* *

The parser will then allow the application to intercept any * external entities (including the external DTD subset and external * parameter entities, if any) before including them.

* *

Many SAX applications will not need to implement this interface, * but it will be especially useful for applications that build * XML documents from databases or other specialised input sources, * or for applications that use URI types other than URLs.

* *

The following resolver would provide the application * with a special character stream for the entity with the system * identifier "http://www.myhost.com/today":

* * *\#include
*\#include
*
*class MyResolver : public EntityResolver {
* public:
  * InputSource* resolveEntity (const XMLCh* const publicId, const XMLCh* const systemId);
   *
* ...
   * };
  *
* MyResolver::resolveEntity {
*  if (XMLString::compareString(systemId, "http://www.myhost.com/today")) {
*   MyReader* reader = new MyReader();
*   return new InputSource(reader);
*  } else {
*   return null;
*  }
* }
*
*
* *

The application can also use this interface to redirect system * identifiers to local URIs or to look up replacements in a catalog * (possibly by using the public identifier).

* *

The HandlerBase class implements the default behaviour for * this interface, which is simply always to return null (to request * that the parser use the default system identifier).

* * @see Parser#setEntityResolver * @see InputSource#InputSource * @see HandlerBase#HandlerBase */ class SAX_EXPORT EntityResolver { public: /** @name Constructors and Destructor */ //@{ /** Default Constructor */ EntityResolver() { } /** Destructor */ virtual ~EntityResolver() { } //@} /** @name The EntityResolver interface */ //@{ /** * Allow the application to resolve external entities. * *

The Parser will call this method before opening any external * entity except the top-level document entity (including the * external DTD subset, external entities referenced within the * DTD, and external entities referenced within the document * element): the application may request that the parser resolve * the entity itself, that it use an alternative URI, or that it * use an entirely different input source.

* *

Application writers can use this method to redirect external * system identifiers to secure and/or local URIs, to look up * public identifiers in a catalogue, or to read an entity from a * database or other input source (including, for example, a dialog * box).

* *

If the system identifier is a URL, the SAX parser must * resolve it fully before reporting it to the application.

* * @param publicId The public identifier of the external entity * being referenced, or null if none was supplied. * @param systemId The system identifier of the external entity * being referenced. * @return An InputSource object describing the new input source, * or null to request that the parser open a regular * URI connection to the system identifier. * The returned InputSource is owned by the parser which is * responsible to clean up the memory. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @exception IOException An IO exception, * possibly the result of creating a new InputStream * or Reader for the InputSource. * @see InputSource#InputSource */ virtual InputSource* resolveEntity ( const XMLCh* const publicId , const XMLCh* const systemId ) = 0; //@} private : /* Unimplemented constructors and operators */ /* Copy constructor */ EntityResolver(const EntityResolver&); /* Assignment operator */ EntityResolver& operator=(const EntityResolver&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax/ErrorHandler.hpp000644 000765 000024 00000013316 13241160334 022162 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ErrorHandler.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_ERRORHANDLER_HPP) #define XERCESC_INCLUDE_GUARD_ERRORHANDLER_HPP #include XERCES_CPP_NAMESPACE_BEGIN class SAXParseException; /** * Basic interface for SAX error handlers. * *

If a SAX application needs to implement customized error * handling, it must implement this interface and then register an * instance with the SAX parser using the parser's setErrorHandler * method. The parser will then report all errors and warnings * through this interface.

* *

The parser shall use this interface instead of throwing an * exception: it is up to the application whether to throw an * exception for different types of errors and warnings. Note, * however, that there is no requirement that the parser continue to * provide useful information after a call to fatalError (in other * words, a SAX driver class could catch an exception and report a * fatalError).

* *

The HandlerBase class provides a default implementation of this * interface, ignoring warnings and recoverable errors and throwing a * SAXParseException for fatal errors. An application may extend * that class rather than implementing the complete interface * itself.

* * @see Parser#setErrorHandler * @see SAXParseException#SAXParseException * @see HandlerBase#HandlerBase */ class SAX_EXPORT ErrorHandler { public: /** @name Constructors and Destructor */ //@{ /** Default constructor */ ErrorHandler() { } /** Destructor */ virtual ~ErrorHandler() { } //@} /** @name The error handler interface */ //@{ /** * Receive notification of a warning. * *

SAX parsers will use this method to report conditions that * are not errors or fatal errors as defined by the XML 1.0 * recommendation. The default behaviour is to take no action.

* *

The SAX parser must continue to provide normal parsing events * after invoking this method: it should still be possible for the * application to process the document through to the end.

* * @param exc The warning information encapsulated in a * SAX parse exception. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see SAXParseException#SAXParseException */ virtual void warning(const SAXParseException& exc) = 0; /** * Receive notification of a recoverable error. * *

This corresponds to the definition of "error" in section 1.2 * of the W3C XML 1.0 Recommendation. For example, a validating * parser would use this callback to report the violation of a * validity constraint. The default behaviour is to take no * action.

* *

The SAX parser must continue to provide normal parsing events * after invoking this method: it should still be possible for the * application to process the document through to the end. If the * application cannot do so, then the parser should report a fatal * error even if the XML 1.0 recommendation does not require it to * do so.

* * @param exc The error information encapsulated in a * SAX parse exception. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see SAXParseException#SAXParseException */ virtual void error(const SAXParseException& exc) = 0; /** * Receive notification of a non-recoverable error. * *

This corresponds to the definition of "fatal error" in * section 1.2 of the W3C XML 1.0 Recommendation. For example, a * parser would use this callback to report the violation of a * well-formedness constraint.

* *

The application must assume that the document is unusable * after the parser has invoked this method, and should continue * (if at all) only for the sake of collecting addition error * messages: in fact, SAX parsers are free to stop reporting any * other events once this method has been invoked.

* * @param exc The error information encapsulated in a * SAX parse exception. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see SAXParseException#SAXParseException */ virtual void fatalError(const SAXParseException& exc) = 0; /** * Reset the Error handler object on its reuse * *

This method helps in reseting the Error handler object * implementation defaults each time the Error handler is begun.

* */ virtual void resetErrors() = 0; //@} private : /* Unimplemented constructors and operators */ /* Copy constructor */ ErrorHandler(const ErrorHandler&); /* Assignment operator */ ErrorHandler& operator=(const ErrorHandler&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax/HandlerBase.hpp000644 000765 000024 00000034341 13241160333 021743 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: HandlerBase.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_HANDLERBASE_HPP) #define XERCESC_INCLUDE_GUARD_HANDLERBASE_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class Locator; class AttributeList; /** * Default base class for handlers. * *

This class implements the default behaviour for four SAX * interfaces: EntityResolver, DTDHandler, DocumentHandler, * and ErrorHandler.

* *

Application writers can extend this class when they need to * implement only part of an interface; parser writers can * instantiate this class to provide default handlers when the * application has not supplied its own.

* *

Note that the use of this class is optional.

* * @see EntityResolver#EntityResolver * @see DTDHandler#DTDHandler * @see DocumentHandler#DocumentHandler * @see ErrorHandler#ErrorHandler */ class SAX_EXPORT HandlerBase : public EntityResolver, public DTDHandler, public DocumentHandler , public ErrorHandler { public: /** @name Default handlers for the DocumentHandler interface */ //@{ /** * Receive notification of character data inside an element. * *

By default, do nothing. Application writers may override this * method to take specific actions for each chunk of character data * (such as adding the data to a node or buffer, or printing it to * a file).

* * @param chars The characters. * @param length The number of characters to use from the * character array. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see DocumentHandler#characters */ virtual void characters ( const XMLCh* const chars , const XMLSize_t length ); /** * Receive notification of the end of the document. * *

By default, do nothing. Application writers may override this * method in a subclass to take specific actions at the beginning * of a document (such as finalising a tree or closing an output * file).

* * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see DocumentHandler#endDocument */ virtual void endDocument(); /** * Receive notification of the end of an element. * *

By default, do nothing. Application writers may override this * method in a subclass to take specific actions at the end of * each element (such as finalising a tree node or writing * output to a file).

* * @param name The element type name. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see DocumentHandler#endElement */ virtual void endElement(const XMLCh* const name); /** * Receive notification of ignorable whitespace in element content. * *

By default, do nothing. Application writers may override this * method to take specific actions for each chunk of ignorable * whitespace (such as adding data to a node or buffer, or printing * it to a file).

* * @param chars The whitespace characters. * @param length The number of characters to use from the * character array. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see DocumentHandler#ignorableWhitespace */ virtual void ignorableWhitespace ( const XMLCh* const chars , const XMLSize_t length ); /** * Receive notification of a processing instruction. * *

By default, do nothing. Application writers may override this * method in a subclass to take specific actions for each * processing instruction, such as setting status variables or * invoking other methods.

* * @param target The processing instruction target. * @param data The processing instruction data, or null if * none is supplied. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see DocumentHandler#processingInstruction */ virtual void processingInstruction ( const XMLCh* const target , const XMLCh* const data ); /** * Reset the Document object on its reuse * * @see DocumentHandler#resetDocument */ virtual void resetDocument(); //@} /** @name Default implementation of DocumentHandler interface */ //@{ /** * Receive a Locator object for document events. * *

By default, do nothing. Application writers may override this * method in a subclass if they wish to store the locator for use * with other document events.

* * @param locator A locator for all SAX document events. * @see DocumentHandler#setDocumentLocator * @see Locator */ virtual void setDocumentLocator(const Locator* const locator); /** * Receive notification of the beginning of the document. * *

By default, do nothing. Application writers may override this * method in a subclass to take specific actions at the beginning * of a document (such as allocating the root node of a tree or * creating an output file).

* * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see DocumentHandler#startDocument */ virtual void startDocument(); /** * Receive notification of the start of an element. * *

By default, do nothing. Application writers may override this * method in a subclass to take specific actions at the start of * each element (such as allocating a new tree node or writing * output to a file).

* * @param name The element type name. * @param attributes The specified or defaulted attributes. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see DocumentHandler#startElement */ virtual void startElement ( const XMLCh* const name , AttributeList& attributes ); //@} /** @name Default implementation of the EntityResolver interface. */ //@{ /** * Resolve an external entity. * *

Always return null, so that the parser will use the system * identifier provided in the XML document. This method implements * the SAX default behaviour: application writers can override it * in a subclass to do special translations such as catalog lookups * or URI redirection.

* * @param publicId The public identifier, or null if none is * available. * @param systemId The system identifier provided in the XML * document. * @return The new input source, or null to require the * default behaviour. * The returned InputSource is owned by the parser which is * responsible to clean up the memory. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see EntityResolver#resolveEntity */ virtual InputSource* resolveEntity ( const XMLCh* const publicId , const XMLCh* const systemId ); //@} /** @name Default implementation of the ErrorHandler interface */ //@{ /** * Receive notification of a recoverable parser error. * *

The default implementation does nothing. Application writers * may override this method in a subclass to take specific actions * for each error, such as inserting the message in a log file or * printing it to the console.

* * @param exc The warning information encoded as an exception. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see ErrorHandler#warning * @see SAXParseException#SAXParseException */ virtual void error(const SAXParseException& exc); /** * Report a fatal XML parsing error. * *

The default implementation throws a SAXParseException. * Application writers may override this method in a subclass if * they need to take specific actions for each fatal error (such as * collecting all of the errors into a single report): in any case, * the application must stop all regular processing when this * method is invoked, since the document is no longer reliable, and * the parser may no longer report parsing events.

* * @param exc The error information encoded as an exception. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see ErrorHandler#fatalError * @see SAXParseException#SAXParseException */ virtual void fatalError(const SAXParseException& exc); /** * Receive notification of a parser warning. * *

The default implementation does nothing. Application writers * may override this method in a subclass to take specific actions * for each warning, such as inserting the message in a log file or * printing it to the console.

* * @param exc The warning information encoded as an exception. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @see ErrorHandler#warning * @see SAXParseException#SAXParseException */ virtual void warning(const SAXParseException& exc); /** * Reset the Error handler object on its reuse * * @see ErrorHandler#resetErrors */ virtual void resetErrors(); //@} /** @name Default implementation of DTDHandler interface. */ //@{ /** * Receive notification of a notation declaration. * *

By default, do nothing. Application writers may override this * method in a subclass if they wish to keep track of the notations * declared in a document.

* * @param name The notation name. * @param publicId The notation public identifier, or null if not * available. * @param systemId The notation system identifier. * @see DTDHandler#notationDecl */ virtual void notationDecl ( const XMLCh* const name , const XMLCh* const publicId , const XMLCh* const systemId ); /** * Reset the DTD object on its reuse * * @see DTDHandler#resetDocType */ virtual void resetDocType(); /** * Receive notification of an unparsed entity declaration. * *

By default, do nothing. Application writers may override this * method in a subclass to keep track of the unparsed entities * declared in a document.

* * @param name The entity name. * @param publicId The entity public identifier, or null if not * available. * @param systemId The entity system identifier. * @param notationName The name of the associated notation. * @see DTDHandler#unparsedEntityDecl */ virtual void unparsedEntityDecl ( const XMLCh* const name , const XMLCh* const publicId , const XMLCh* const systemId , const XMLCh* const notationName ); //@} HandlerBase() {}; virtual ~HandlerBase() {}; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- HandlerBase(const HandlerBase&); HandlerBase& operator=(const HandlerBase&); }; // --------------------------------------------------------------------------- // HandlerBase: Inline default implementations // --------------------------------------------------------------------------- inline void HandlerBase::characters(const XMLCh* const , const XMLSize_t) { } inline void HandlerBase::endDocument() { } inline void HandlerBase::endElement(const XMLCh* const) { } inline void HandlerBase::error(const SAXParseException&) { } inline void HandlerBase::fatalError(const SAXParseException& exc) { throw exc; } inline void HandlerBase::ignorableWhitespace( const XMLCh* const , const XMLSize_t) { } inline void HandlerBase::notationDecl( const XMLCh* const , const XMLCh* const , const XMLCh* const) { } inline void HandlerBase::processingInstruction( const XMLCh* const , const XMLCh* const) { } inline void HandlerBase::resetErrors() { } inline void HandlerBase::resetDocument() { } inline void HandlerBase::resetDocType() { } inline InputSource* HandlerBase::resolveEntity( const XMLCh* const , const XMLCh* const) { return 0; } inline void HandlerBase::unparsedEntityDecl(const XMLCh* const , const XMLCh* const , const XMLCh* const , const XMLCh* const) { } inline void HandlerBase::setDocumentLocator(const Locator* const) { } inline void HandlerBase::startDocument() { } inline void HandlerBase::startElement( const XMLCh* const , AttributeList&) { } inline void HandlerBase::warning(const SAXParseException&) { } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax/SAXParseException.hpp000644 000765 000024 00000013524 13241160333 023100 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SAXParseException.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_SAXPARSEEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_SAXPARSEEXCEPTION_HPP #include XERCES_CPP_NAMESPACE_BEGIN class Locator; /** * Encapsulate an XML parse error or warning. * *

This exception will include information for locating the error * in the original XML document. Note that although the application * will receive a SAXParseException as the argument to the handlers * in the ErrorHandler interface, the application is not actually * required to throw the exception; instead, it can simply read the * information in it and take a different action.

* *

Since this exception is a subclass of SAXException, it * inherits the ability to wrap another exception.

* * @see SAXException#SAXException * @see Locator#Locator * @see ErrorHandler#ErrorHandler */ class SAX_EXPORT SAXParseException : public SAXException { public: /** @name Constructors and Destructor */ //@{ /** * Create a new SAXParseException from a message and a Locator. * *

This constructor is especially useful when an application is * creating its own exception from within a DocumentHandler * callback.

* * @param message The error or warning message. * @param locator The locator object for the error or warning. * @param manager Pointer to the memory manager to be used to * allocate objects. * @see Locator#Locator * @see Parser#setLocale */ SAXParseException(const XMLCh* const message, const Locator& locator, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Create a new SAXParseException. * *

This constructor is most useful for parser writers.

* *

If the system identifier is a URL, the parser must resolve it * fully before creating the exception.

* * @param message The error or warning message. * @param publicId The public identifier of the entity that generated * the error or warning. * @param systemId The system identifier of the entity that generated * the error or warning. * @param lineNumber The line number of the end of the text that * caused the error or warning. * @param columnNumber The column number of the end of the text that * caused the error or warning. * @param manager Pointer to the memory manager to be used to * allocate objects. * @see Parser#setLocale */ SAXParseException ( const XMLCh* const message , const XMLCh* const publicId , const XMLCh* const systemId , const XMLFileLoc lineNumber , const XMLFileLoc columnNumber , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Copy constructor * * @param toCopy The object to be copied */ SAXParseException(const SAXParseException& toCopy); /** * Destructor */ ~SAXParseException(); //@} /** @name Assignment operator */ //@{ /** * Assignment operator * * @param toAssign The object to be copied through assignment * */ SAXParseException& operator=(const SAXParseException& toAssign); //@} /** @name Getter methods */ //@{ /** * The column number of the end of the text where the exception occurred. * *

The first column in a line is position 1.

* * @return An integer representing the column number, or 0 * if none is available. * @see Locator#getColumnNumber */ XMLFileLoc getColumnNumber() const; /** * The line number of the end of the text where the exception occurred. * * @return An integer representing the line number, or 0 * if none is available. * @see Locator#getLineNumber */ XMLFileLoc getLineNumber() const; /** * Get the public identifier of the entity where the exception occurred. * * @return A string containing the public identifier, or null * if none is available. * @see Locator#getPublicId */ const XMLCh* getPublicId() const; /** * Get the system identifier of the entity where the exception occurred. * *

If the system identifier is a URL, it will be resolved * fully.

* * @return A string containing the system identifier, or null * if none is available. * @see Locator#getSystemId */ const XMLCh* getSystemId() const; //@} private: /* Data Members */ /* The column in the source text where the error occured. */ XMLFileLoc fColumnNumber; /* The line in the source text where the error occured. */ XMLFileLoc fLineNumber; /* The public id of the file where the error occured. */ XMLCh* fPublicId; /* The system id of the file where the error occured. */ XMLCh* fSystemId; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax/SAXException.hpp000644 000765 000024 00000015214 13241160333 022103 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SAXException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_SAXEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_SAXEXCEPTION_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN /** * Encapsulate a general SAX error or warning. * *

This class can contain basic error or warning information from * either the XML SAX parser or the application: a parser writer or * application writer can subclass it to provide additional * functionality. SAX handlers may throw this exception or * any exception subclassed from it.

* *

If the application needs to pass through other types of * exceptions, it must wrap those exceptions in a SAXException * or an exception derived from a SAXException.

* *

If the parser or application needs to include information * about a specific location in an XML document, it should use the * SAXParseException subclass.

* * @see SAXParseException#SAXParseException */ class SAX_EXPORT SAXException : public XMemory { public: /** @name Constructors and Destructor */ //@{ /** Default constructor * @param manager Pointer to the memory manager to be used to * allocate objects. */ SAXException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) : fMsg(XMLString::replicate(XMLUni::fgZeroLenString, manager)) , fMemoryManager(manager) { } /** * Create a new SAXException. * * @param msg The error or warning message. * @param manager Pointer to the memory manager to be used to * allocate objects. */ SAXException(const XMLCh* const msg, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) : fMsg(XMLString::replicate(msg, manager)) , fMemoryManager(manager) { } /** * Create a new SAXException. * * @param msg The error or warning message. * @param manager Pointer to the memory manager to be used to * allocate objects. */ SAXException(const char* const msg, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) : fMsg(XMLString::transcode(msg, manager)) , fMemoryManager(manager) { } /** * Copy constructor * * @param toCopy The exception to be copy constructed */ SAXException(const SAXException& toCopy) : XMemory(toCopy) , fMsg(XMLString::replicate(toCopy.fMsg, toCopy.fMemoryManager)) , fMemoryManager(toCopy.fMemoryManager) { } /** Destructor */ virtual ~SAXException() { fMemoryManager->deallocate(fMsg);//delete [] fMsg; } //@} /** @name Public Operators */ //@{ /** * Assignment operator * * @param toCopy The object to be copied */ SAXException& operator=(const SAXException& toCopy) { if (this == &toCopy) return *this; fMemoryManager->deallocate(fMsg);//delete [] fMsg; fMsg = XMLString::replicate(toCopy.fMsg, toCopy.fMemoryManager); fMemoryManager = toCopy.fMemoryManager; return *this; } //@} /** @name Getter Methods */ //@{ /** * Get the contents of the message * */ virtual const XMLCh* getMessage() const { return fMsg; } //@} protected : // ----------------------------------------------------------------------- // Protected data members // // fMsg // This is the text of the error that is being thrown. // ----------------------------------------------------------------------- XMLCh* fMsg; MemoryManager* fMemoryManager; }; class SAX_EXPORT SAXNotSupportedException : public SAXException { public: SAXNotSupportedException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Create a new SAXException. * * @param msg The error or warning message. * @param manager Pointer to the memory manager to be used to * allocate objects. */ SAXNotSupportedException(const XMLCh* const msg, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Create a new SAXException. * * @param msg The error or warning message. * @param manager Pointer to the memory manager to be used to * allocate objects. */ SAXNotSupportedException(const char* const msg, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Copy constructor * * @param toCopy The exception to be copy constructed */ SAXNotSupportedException(const SAXException& toCopy); }; class SAX_EXPORT SAXNotRecognizedException : public SAXException { public: SAXNotRecognizedException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Create a new SAXException. * * @param msg The error or warning message. * @param manager Pointer to the memory manager to be used to * allocate objects. */ SAXNotRecognizedException(const XMLCh* const msg, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Create a new SAXException. * * @param msg The error or warning message. * @param manager Pointer to the memory manager to be used to * allocate objects. */ SAXNotRecognizedException(const char* const msg, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Copy constructor * * @param toCopy The exception to be copy constructed */ SAXNotRecognizedException(const SAXException& toCopy); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/sax/InputSource.cpp000644 000765 000024 00000007741 13241160334 022053 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: InputSource.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // InputSource: Destructor // --------------------------------------------------------------------------- InputSource::~InputSource() { fMemoryManager->deallocate(fEncoding); fMemoryManager->deallocate(fPublicId); fMemoryManager->deallocate(fSystemId); } // --------------------------------------------------------------------------- // InputSource: Setter methods // --------------------------------------------------------------------------- void InputSource::setEncoding(const XMLCh* const encodingStr) { fMemoryManager->deallocate(fEncoding); fEncoding = XMLString::replicate(encodingStr, fMemoryManager); } void InputSource::setPublicId(const XMLCh* const publicId) { fMemoryManager->deallocate(fPublicId); fPublicId = XMLString::replicate(publicId, fMemoryManager); } void InputSource::setSystemId(const XMLCh* const systemId) { fMemoryManager->deallocate(fSystemId); fSystemId = XMLString::replicate(systemId, fMemoryManager); } // --------------------------------------------------------------------------- // InputSource: Hidden Constructors // --------------------------------------------------------------------------- InputSource::InputSource(MemoryManager* const manager) : fMemoryManager(manager) , fEncoding(0) , fPublicId(0) , fSystemId(0) , fFatalErrorIfNotFound(true) { } InputSource::InputSource(const XMLCh* const systemId, MemoryManager* const manager) : fMemoryManager(manager) , fEncoding(0) , fPublicId(0) , fSystemId(0) , fFatalErrorIfNotFound(true) { fSystemId = XMLString::replicate(systemId, fMemoryManager); } InputSource::InputSource(const XMLCh* const systemId , const XMLCh* const publicId , MemoryManager* const manager) : fMemoryManager(manager) , fEncoding(0) , fPublicId(0) , fSystemId(0) , fFatalErrorIfNotFound(true) { fPublicId = XMLString::replicate(publicId, fMemoryManager); fSystemId = XMLString::replicate(systemId, fMemoryManager); } InputSource::InputSource(const char* const systemId, MemoryManager* const manager) : fMemoryManager(manager) , fEncoding(0) , fPublicId(0) , fSystemId(0) , fFatalErrorIfNotFound(true) { fSystemId = XMLString::transcode(systemId, fMemoryManager); } InputSource::InputSource(const char* const systemId , const char* const publicId , MemoryManager* const manager) : fMemoryManager(manager) , fEncoding(0) , fPublicId(0) , fSystemId(0) , fFatalErrorIfNotFound(true) { fPublicId = XMLString::transcode(publicId, fMemoryManager); fSystemId = XMLString::transcode(systemId, fMemoryManager); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/XMLEntityDecl.hpp000644 000765 000024 00000036373 13241160334 023432 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLEntityDecl.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLENTITYDECL_HPP) #define XERCESC_INCLUDE_GUARD_XMLENTITYDECL_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN /** * This class defines that core information that defines an XML entity, no * matter what validator is used. Each validator will create a derivative * of this class which adds any extra information it requires. * * This class supports keyed collection semantics via the getKey() method * which extracts the key field, the entity name in this case. The name will * have whatever form is deemed appropriate for the type of validator in * use. * * When setting the fields of this class, you must make sure that you do * not set conflicting values. For instance, an internal entity cannot have * a notation name. And an external entity cannot have a value string. * These rules are defined by the XML specification. In most cases, these * objects are created by validator objects as they parse a DTD or Schema * or whatever, at which time they confirm the correctness of the data before * creating the entity decl object. */ class XMLPARSER_EXPORT XMLEntityDecl : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * Default Constructor */ XMLEntityDecl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Constructor with a const entity name * * @param entName The new name to give to this entity. * @param manager Pointer to the memory manager to be used to * allocate objects. */ XMLEntityDecl ( const XMLCh* const entName , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Constructor with a const entity name and value * * @param entName The new name to give to this entity. * @param value The new value to give to this entity name. * @param manager Pointer to the memory manager to be used to * allocate objects. */ XMLEntityDecl ( const XMLCh* const entName , const XMLCh* const value , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Constructor with a const entity name and single XMLCh value * * @param entName The new name to give to this entity. * @param value The new value to give to this entity name. * @param manager Pointer to the memory manager to be used to * allocate objects. */ XMLEntityDecl ( const XMLCh* const entName , const XMLCh value , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** @name Destructor */ //@{ /** * Default destructor */ virtual ~XMLEntityDecl(); //@} // ----------------------------------------------------------------------- // Virtual entity decl interface // ----------------------------------------------------------------------- /** @name The pure virtual methods in this interface. */ //@{ /** Get the 'declared in internal subset' flag * * Gets the state of the flag which indicates whether the entity was * declared in the internal or external subset. Some structural * description languages might not have an internal subset concept, in * which case this will always return false. */ virtual bool getDeclaredInIntSubset() const = 0; /** Get the 'is parameter entity' flag * * Gets the state of the flag which indicates whether this entity is * a parameter entity. If not, then its a general entity. */ virtual bool getIsParameter() const = 0; /** Get the 'is special char entity' flag * * Gets the state of the flag that indicates whether this entity is * one of the special, intrinsically supported character entities. */ virtual bool getIsSpecialChar() const = 0; //@} // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** @name Getter methods */ //@{ /** * Gets the pool id of this entity. Validators maintain all decls in * pools, from which they can be quickly extracted via id. */ XMLSize_t getId() const; /** * Returns a const pointer to the name of this entity decl. This name * will be in whatever format is appropriate for the type of validator * in use. */ const XMLCh* getName() const; /** * Gets the notation name, if any, declared for this entity. If this * entity is not a notation type entity, it will be a null pointer. */ const XMLCh* getNotationName() const; /** * Gets the public id declared for this entity. Public ids are optional * so it can be a null pointer. */ const XMLCh* getPublicId() const; /** * Gets the system id declared for this entity. The system id is required * so this method should never return a null pointers. */ const XMLCh* getSystemId() const; /** * Gets the base URI for this entity. */ const XMLCh* getBaseURI() const; /** * This method returns the value of an internal entity. If this is not * an internal entity (i.e. its external), then this will be a null * pointer. */ const XMLCh* getValue() const; /** * This method returns the number of characters in the value returned * by getValue(). If this entity is external, this will be zero since * an external entity has no internal value. */ XMLSize_t getValueLen() const; /** * Indicates that this entity is an external entity. If not, then it is * assumed to be an internal entity, surprise. */ bool isExternal() const; /** * Indicates whether this entity is unparsed. This is meaningless for * internal entities. Some external entities are unparsed in that they * refer to something other than XML source. */ bool isUnparsed() const; /** Get the plugged-in memory manager * * This method returns the plugged-in memory manager user for dynamic * memory allocation/deallocation. * * @return the plugged-in memory manager */ MemoryManager* getMemoryManager() const; //@} // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** @name Setter methods */ //@{ /** * This method will set the entity name. The format of this name is * defined by the particular validator in use, since it will be the * one who creates entity definitions as it parses the DTD, Schema, * ect... * * @param entName The new name to give to this entity. */ void setName ( const XMLCh* const entName ); /** * This method will mark whether the entity is external. * * @param value The new value for the 'is external' flag. */ void setIsExternal(bool value); /** * This method will set the notation name for this entity. By setting * this, you are indicating that this is an unparsed external entity. * * @param newName The new notation name to give to this entity. */ void setNotationName(const XMLCh* const newName); /** * This method will set a new public id on this entity. The public id * has no particular form and is purely for client consumption. * * @param newId The new public id to give to this entity. */ void setPublicId(const XMLCh* const newId); /** * This method will set a new sysetm id on this entity. This will * then control where the source for this entity lives. If it is * an internal entity, then the system id is only for bookkeeping * purposes, and to allow any external entities referenced from * within the entity to be correctly resolved. * * @param newId The new system id to give to the entity. */ void setSystemId(const XMLCh* const newId); /** * This method will set a new baseURI on this entity. This will * then control the URI used to resolve the relative system Id. * * @param newId The new base URI to give to the entity. */ void setBaseURI(const XMLCh* const newId); /** * This method will set a new value for this entity. This is only * valid if the entity is to be an internal entity. By setting this * field, you are indicating that the entity is internal. * * @param newValue The new value to give to this entity. */ void setValue(const XMLCh* const newValue); //@} /* For internal use only */ void setId(const XMLSize_t newId); // ----------------------------------------------------------------------- // Support named pool syntax // ----------------------------------------------------------------------- /** @name Setter methods */ //@{ /** * This method allows objects of this class to be used within a standard * keyed collection used commonly within the parser system. The collection * calls this method to get the key (usually to hash it) by which the * object is to be stored. */ const XMLCh* getKey() const; //@} /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLEntityDecl) private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLEntityDecl(const XMLEntityDecl&); XMLEntityDecl& operator=(XMLEntityDecl&); // ----------------------------------------------------------------------- // XMLEntityDecl: Private helper methods // ----------------------------------------------------------------------- void cleanUp(); // ----------------------------------------------------------------------- // Private data members // // fId // This is the unique id given to this entity decl. // // fName // The name of the entity. Entity names are never namespace based. // // fNotationName // The optional notation of the entity. If there was none, then its // empty. // // fPublicId // The public id of the entity, which can be empty. // // fSystemId // The system id of the entity. // // fValue // fValueLen // The entity's value and length, which is only valid if its an // internal style entity. // // fBaseURI // The base URI of the entity. According to XML InfoSet, such value // is the URI where it is declared (NOT referenced). // ----------------------------------------------------------------------- XMLSize_t fId; XMLSize_t fValueLen; XMLCh* fValue; XMLCh* fName; XMLCh* fNotationName; XMLCh* fPublicId; XMLCh* fSystemId; XMLCh* fBaseURI; bool fIsExternal; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // XMLEntityDecl: Getter methods // --------------------------------------------------------------------------- inline XMLSize_t XMLEntityDecl::getId() const { return fId; } inline const XMLCh* XMLEntityDecl::getName() const { return fName; } inline const XMLCh* XMLEntityDecl::getNotationName() const { return fNotationName; } inline const XMLCh* XMLEntityDecl::getPublicId() const { return fPublicId; } inline const XMLCh* XMLEntityDecl::getSystemId() const { return fSystemId; } inline const XMLCh* XMLEntityDecl::getBaseURI() const { return fBaseURI; } inline const XMLCh* XMLEntityDecl::getValue() const { return fValue; } inline XMLSize_t XMLEntityDecl::getValueLen() const { return fValueLen; } inline bool XMLEntityDecl::isExternal() const { return fIsExternal; } inline bool XMLEntityDecl::isUnparsed() const { // If it has a notation, its unparsed return (fNotationName != 0); } inline MemoryManager* XMLEntityDecl::getMemoryManager() const { return fMemoryManager; } // --------------------------------------------------------------------------- // XMLEntityDecl: Setter methods // --------------------------------------------------------------------------- inline void XMLEntityDecl::setId(const XMLSize_t newId) { fId = newId; } inline void XMLEntityDecl::setIsExternal(bool value) { fIsExternal = value; } inline void XMLEntityDecl::setNotationName(const XMLCh* const newName) { if (fNotationName) fMemoryManager->deallocate(fNotationName); fNotationName = XMLString::replicate(newName, fMemoryManager); } inline void XMLEntityDecl::setPublicId(const XMLCh* const newId) { if (fPublicId) fMemoryManager->deallocate(fPublicId); fPublicId = XMLString::replicate(newId, fMemoryManager); } inline void XMLEntityDecl::setSystemId(const XMLCh* const newId) { if (fSystemId) fMemoryManager->deallocate(fSystemId); fSystemId = XMLString::replicate(newId, fMemoryManager); } inline void XMLEntityDecl::setBaseURI(const XMLCh* const newId) { if (fBaseURI) fMemoryManager->deallocate(fBaseURI); fBaseURI = XMLString::replicate(newId, fMemoryManager); } inline void XMLEntityDecl::setValue(const XMLCh* const newValue) { if (fValue) fMemoryManager->deallocate(fValue); fValue = XMLString::replicate(newValue, fMemoryManager); fValueLen = XMLString::stringLen(newValue); } // --------------------------------------------------------------------------- // XMLEntityDecl: Support named pool syntax // --------------------------------------------------------------------------- inline const XMLCh* XMLEntityDecl::getKey() const { return fName; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLFormatter.cpp000644 000765 000024 00000054505 13241160334 023321 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: XMLFormatter.cpp 1799526 2017-06-21 22:24:33Z scantor $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local data // // gXXXRef // These are hard coded versions of the char refs we put out for the // standard char refs. // // gEscapeChars // For each style of escape, we have a list of the chars that must // be escaped for that style. The first null hit in each list indicates // no more valid entries in that list. The first entry is a dummy for // the NoEscapes style. // --------------------------------------------------------------------------- static const XMLCh gAmpRef[] = { chAmpersand, chLatin_a, chLatin_m, chLatin_p, chSemiColon, chNull }; static const XMLCh gAposRef[] = { chAmpersand, chLatin_a, chLatin_p, chLatin_o, chLatin_s, chSemiColon, chNull }; static const XMLCh gGTRef[] = { chAmpersand, chLatin_g, chLatin_t, chSemiColon, chNull }; static const XMLCh gLTRef[] = { chAmpersand, chLatin_l, chLatin_t, chSemiColon, chNull }; static const XMLCh gQuoteRef[] = { chAmpersand, chLatin_q, chLatin_u, chLatin_o, chLatin_t, chSemiColon, chNull }; static const unsigned int kEscapeCount = 7; static const XMLCh gEscapeChars[XMLFormatter::EscapeFlags_Count][kEscapeCount] = { { chNull , chNull , chNull , chNull , chNull , chNull , chNull } , { chAmpersand , chCloseAngle , chDoubleQuote , chOpenAngle , chSingleQuote , chNull , chNull } , { chAmpersand , chOpenAngle , chDoubleQuote , chLF , chCR , chHTab , chNull } , { chAmpersand , chOpenAngle , chCloseAngle , chCR , chNull , chNull , chNull } }; // --------------------------------------------------------------------------- // Local methods // --------------------------------------------------------------------------- bool XMLFormatter::inEscapeList(const XMLFormatter::EscapeFlags escStyle , const XMLCh toCheck) { const XMLCh* escList = gEscapeChars[escStyle]; while (*escList) { if (*escList++ == toCheck) return true; } /*** * XML1.1 * * Finally, there is considerable demand to define a standard representation of * arbitrary Unicode characters in XML documents. Therefore, XML 1.1 allows the * use of character references to the control characters #x1 through #x1F, * most of which are forbidden in XML 1.0. For reasons of robustness, however, * these characters still cannot be used directly in documents. * In order to improve the robustness of character encoding detection, the * additional control characters #x7F through #x9F, which were freely allowed in * XML 1.0 documents, now must also appear only as character references. * (Whitespace characters are of course exempt.) The minor sacrifice of backward * compatibility is considered not significant. * Due to potential problems with APIs, #x0 is still forbidden both directly and * as a character reference. * ***/ if (fIsXML11) { // for XML11 if ( XMLChar1_1::isControlChar(toCheck, 0) && !XMLChar1_1::isWhitespace(toCheck, 0) ) { return true; } else { return false; } } else { return false; } } // --------------------------------------------------------------------------- // XMLFormatter: Constructors and Destructor // --------------------------------------------------------------------------- XMLFormatter::XMLFormatter( const char* const outEncoding , const char* const docVersion , XMLFormatTarget* const target , const EscapeFlags escapeFlags , const UnRepFlags unrepFlags , MemoryManager* const manager) : fEscapeFlags(escapeFlags) , fOutEncoding(0) , fTarget(target) , fUnRepFlags(unrepFlags) , fXCoder(0) , fAposRef(0) , fAposLen(0) , fAmpRef(0) , fAmpLen(0) , fGTRef(0) , fGTLen(0) , fLTRef(0) , fLTLen(0) , fQuoteRef(0) , fQuoteLen(0) , fIsXML11(false) , fMemoryManager(manager) { // Transcode the encoding string fOutEncoding = XMLString::transcode(outEncoding, fMemoryManager); // Try to create a transcoder for this encoding XMLTransService::Codes resCode; fXCoder = XMLPlatformUtils::fgTransService->makeNewTranscoderFor ( fOutEncoding , resCode , kTmpBufSize , fMemoryManager ); if (!fXCoder) { fMemoryManager->deallocate(fOutEncoding); //delete [] fOutEncoding; ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Trans_CantCreateCvtrFor , outEncoding , fMemoryManager ); } XMLCh* const tmpDocVer = XMLString::transcode(docVersion, fMemoryManager); ArrayJanitor jname(tmpDocVer, fMemoryManager); fIsXML11 = XMLString::equals(tmpDocVer, XMLUni::fgVersion1_1); } XMLFormatter::XMLFormatter( const XMLCh* const outEncoding , const XMLCh* const docVersion , XMLFormatTarget* const target , const EscapeFlags escapeFlags , const UnRepFlags unrepFlags , MemoryManager* const manager) : fEscapeFlags(escapeFlags) , fOutEncoding(0) , fTarget(target) , fUnRepFlags(unrepFlags) , fXCoder(0) , fAposRef(0) , fAposLen(0) , fAmpRef(0) , fAmpLen(0) , fGTRef(0) , fGTLen(0) , fLTRef(0) , fLTLen(0) , fQuoteRef(0) , fQuoteLen(0) , fIsXML11(false) , fMemoryManager(manager) { // Try to create a transcoder for this encoding XMLTransService::Codes resCode; fXCoder = XMLPlatformUtils::fgTransService->makeNewTranscoderFor ( outEncoding , resCode , kTmpBufSize , fMemoryManager ); if (!fXCoder) { ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Trans_CantCreateCvtrFor , outEncoding , fMemoryManager ); } // Copy the encoding string fOutEncoding = XMLString::replicate(outEncoding, fMemoryManager); fIsXML11 = XMLString::equals(docVersion, XMLUni::fgVersion1_1); } XMLFormatter::XMLFormatter( const char* const outEncoding , XMLFormatTarget* const target , const EscapeFlags escapeFlags , const UnRepFlags unrepFlags , MemoryManager* const manager) : fEscapeFlags(escapeFlags) , fOutEncoding(0) , fTarget(target) , fUnRepFlags(unrepFlags) , fXCoder(0) , fAposRef(0) , fAposLen(0) , fAmpRef(0) , fAmpLen(0) , fGTRef(0) , fGTLen(0) , fLTRef(0) , fLTLen(0) , fQuoteRef(0) , fQuoteLen(0) , fIsXML11(false) , fMemoryManager(manager) { // this constructor uses "1.0" for the docVersion // Transcode the encoding string fOutEncoding = XMLString::transcode(outEncoding, fMemoryManager); // Try to create a transcoder for this encoding XMLTransService::Codes resCode; fXCoder = XMLPlatformUtils::fgTransService->makeNewTranscoderFor ( fOutEncoding , resCode , kTmpBufSize , fMemoryManager ); if (!fXCoder) { fMemoryManager->deallocate(fOutEncoding); //delete [] fOutEncoding; ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Trans_CantCreateCvtrFor , outEncoding , fMemoryManager ); } //XMLCh* const tmpDocVer = XMLString::transcode("1.0", fMemoryManager); //ArrayJanitor jname(tmpDocVer, fMemoryManager); //fIsXML11 = XMLString::equals(tmpDocVer, XMLUni::fgVersion1_1); fIsXML11 = false; // docVersion 1.0 is not 1.1! } XMLFormatter::XMLFormatter( const XMLCh* const outEncoding , XMLFormatTarget* const target , const EscapeFlags escapeFlags , const UnRepFlags unrepFlags , MemoryManager* const manager) : fEscapeFlags(escapeFlags) , fOutEncoding(0) , fTarget(target) , fUnRepFlags(unrepFlags) , fXCoder(0) , fAposRef(0) , fAposLen(0) , fAmpRef(0) , fAmpLen(0) , fGTRef(0) , fGTLen(0) , fLTRef(0) , fLTLen(0) , fQuoteRef(0) , fQuoteLen(0) , fIsXML11(false) , fMemoryManager(manager) { // this constructor uses XMLUni::fgVersion1_0 for the docVersion // Try to create a transcoder for this encoding XMLTransService::Codes resCode; fXCoder = XMLPlatformUtils::fgTransService->makeNewTranscoderFor ( outEncoding , resCode , kTmpBufSize , fMemoryManager ); if (!fXCoder) { ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Trans_CantCreateCvtrFor , outEncoding , fMemoryManager ); } // Copy the encoding string fOutEncoding = XMLString::replicate(outEncoding, fMemoryManager); //fIsXML11 = XMLString::equals(docVersion, XMLUni::fgVersion1_1); fIsXML11 = false; // docVersion 1.0 is not 1.1! } XMLFormatter::~XMLFormatter() { fMemoryManager->deallocate(fAposRef); //delete [] fAposRef; fMemoryManager->deallocate(fAmpRef); //delete [] fAmpRef; fMemoryManager->deallocate(fGTRef); //delete [] fGTRef; fMemoryManager->deallocate(fLTRef); //delete [] fLTRef; fMemoryManager->deallocate(fQuoteRef); //delete [] fQuoteRef; fMemoryManager->deallocate(fOutEncoding); //delete [] fOutEncoding; delete fXCoder; // We DO NOT own the target object! } // --------------------------------------------------------------------------- // XMLFormatter: Formatting methods // --------------------------------------------------------------------------- void XMLFormatter::formatBuf(const XMLCh* const toFormat , const XMLSize_t count , const EscapeFlags escapeFlags , const UnRepFlags unrepFlags) { // // Figure out the actual escape flag value. If the parameter is not // the default, then take it. Else take the current default. // const EscapeFlags actualEsc = (escapeFlags == DefaultEscape) ? fEscapeFlags : escapeFlags; // And do the same for the unrep flags const UnRepFlags actualUnRep = (unrepFlags == DefaultUnRep) ? fUnRepFlags : unrepFlags; // // If the actual unrep action is that they want to provide char refs // for unrepresentable chars, then this one is a much more difficult // one to do cleanly, and we handle it separately. // if (actualUnRep == UnRep_CharRef) { specialFormat(toFormat, count, actualEsc); return; } // // If we don't have any escape flags set, then we can do the most // efficient loop, else we have to do it the hard way. // const XMLCh* srcPtr = toFormat; const XMLCh* endPtr = toFormat + count; if (actualEsc == NoEscapes) { // // Just do a whole buffer at a time into the temp buffer, cap // it off, and send it to the target. // if (srcPtr < endPtr) srcPtr += handleUnEscapedChars(srcPtr, endPtr - srcPtr, actualUnRep); } else { // // Escape chars that require it according to the scale flags // we were given. For the others, try to accumulate them and // format them in as big as bulk as we can. // while (srcPtr < endPtr) { // // Run a temp pointer up until we hit a character that we have // to escape. Then we can convert all the chars between our // current source pointer and here all at once. // const XMLCh* tmpPtr = srcPtr; while ((tmpPtr < endPtr) && !inEscapeList(actualEsc, *tmpPtr)) tmpPtr++; // // If we got any chars, then lets convert them and write them // out. // if (tmpPtr > srcPtr) srcPtr += handleUnEscapedChars(srcPtr, tmpPtr - srcPtr, actualUnRep); else if (tmpPtr < endPtr) { // // Ok, so we've hit a char that must be escaped. So do // this one specially. // const XMLByte * theChars; switch (*srcPtr) { case chAmpersand : theChars = getCharRef(fAmpLen, fAmpRef, gAmpRef); fTarget->writeChars(theChars, fAmpLen, this); break; case chSingleQuote : theChars = getCharRef(fAposLen, fAposRef, gAposRef); fTarget->writeChars(theChars, fAposLen, this); break; case chDoubleQuote : theChars = getCharRef(fQuoteLen, fQuoteRef, gQuoteRef); fTarget->writeChars(theChars, fQuoteLen, this); break; case chCloseAngle : theChars = getCharRef(fGTLen, fGTRef, gGTRef); fTarget->writeChars(theChars, fGTLen, this); break; case chOpenAngle : theChars = getCharRef(fLTLen, fLTRef, gLTRef); fTarget->writeChars(theChars, fLTLen, this); break; default: // control characters writeCharRef(*srcPtr); break; } srcPtr++; } } } } XMLSize_t XMLFormatter::handleUnEscapedChars(const XMLCh * srcPtr, const XMLSize_t oCount, const UnRepFlags actualUnRep) { // // Use that to figure out what I should pass to the transcoder. If we // are doing character references or failing for unrepresentable chars, // then we just throw, since we should never get a call for something // we cannot represent. Else, we tell it to just use the replacement // char. // const XMLTranscoder::UnRepOpts unRepOpts = (actualUnRep == UnRep_Replace) ? XMLTranscoder::UnRep_RepChar : XMLTranscoder::UnRep_Throw; XMLSize_t charsEaten; XMLSize_t count = oCount; while (count) { const XMLSize_t srcChars = (count > XMLSize_t (kTmpBufSize)) ? XMLSize_t (kTmpBufSize) : count; const XMLSize_t outBytes = fXCoder->transcodeTo(srcPtr, srcChars, fTmpBuf, kTmpBufSize, charsEaten, unRepOpts); if (outBytes) { fTmpBuf[outBytes] = 0; fTmpBuf[outBytes + 1] = 0; fTmpBuf[outBytes + 2] = 0; fTmpBuf[outBytes + 3] = 0; fTarget->writeChars(fTmpBuf, outBytes, this); } srcPtr += charsEaten; count -= charsEaten; } return oCount; // This should be an assertion that count == 0. } XMLFormatter& XMLFormatter::operator<<(const XMLCh* const toFormat) { const XMLSize_t len = XMLString::stringLen(toFormat); formatBuf(toFormat, len); return *this; } XMLFormatter& XMLFormatter::operator<<(const XMLCh toFormat) { // Make a temp string format that XMLCh szTmp[2]; szTmp[0] = toFormat; szTmp[1] = 0; formatBuf(szTmp, 1); return *this; } /** * the parameter, count, is needed since stringLen() * does not work on a BOM like "0xFE0xFF0x000x00" or * "0x000x000xFF0xFE" **/ void XMLFormatter::writeBOM(const XMLByte* const toFormat , const XMLSize_t count) { fTarget->writeChars(toFormat, count, this); } // --------------------------------------------------------------------------- // XMLFormatter: Private helper methods // --------------------------------------------------------------------------- void XMLFormatter::writeCharRef(const XMLCh &toWrite) { XMLCh tmpBuf[32]; tmpBuf[0] = chAmpersand; tmpBuf[1] = chPound; tmpBuf[2] = chLatin_x; // Build a char ref for the current char XMLString::binToText(toWrite, &tmpBuf[3], 8, 16, fMemoryManager); const XMLSize_t bufLen = XMLString::stringLen(tmpBuf); tmpBuf[bufLen] = chSemiColon; tmpBuf[bufLen+1] = chNull; // write it out formatBuf(tmpBuf , bufLen + 1 , XMLFormatter::NoEscapes , XMLFormatter::UnRep_Fail); } void XMLFormatter::writeCharRef(XMLSize_t toWrite) { XMLCh tmpBuf[64]; tmpBuf[0] = chAmpersand; tmpBuf[1] = chPound; tmpBuf[2] = chLatin_x; // Build a char ref for the current char XMLString::sizeToText(toWrite, &tmpBuf[3], 32, 16, fMemoryManager); const XMLSize_t bufLen = XMLString::stringLen(tmpBuf); tmpBuf[bufLen] = chSemiColon; tmpBuf[bufLen+1] = chNull; // write it out formatBuf(tmpBuf , bufLen + 1 , XMLFormatter::NoEscapes , XMLFormatter::UnRep_Fail); } const XMLByte* XMLFormatter::getCharRef(XMLSize_t &count, XMLByte* &ref, const XMLCh * stdRef) { if (!ref) { XMLSize_t charsEaten; const XMLSize_t outBytes = fXCoder->transcodeTo(stdRef, XMLString::stringLen(stdRef), fTmpBuf, kTmpBufSize, charsEaten, XMLTranscoder::UnRep_Throw); fTmpBuf[outBytes] = 0; fTmpBuf[outBytes + 1] = 0; fTmpBuf[outBytes + 2] = 0; fTmpBuf[outBytes + 3] = 0; ref = (XMLByte*) fMemoryManager->allocate ( (outBytes + 4) * sizeof(XMLByte) );//new XMLByte[outBytes + 4]; memcpy(ref, fTmpBuf, outBytes + 4); count = outBytes; } return ref; } void XMLFormatter::specialFormat(const XMLCh* const toFormat , const XMLSize_t count , const EscapeFlags escapeFlags) { // // We have to check each character and see if it could be represented. // As long as it can, we just keep up with where we started and how // many chars we've checked. When we hit an unrepresentable one, we // stop, transcode everything we've collected, then start handling // the unrepresentables via char refs. We repeat this until we get all // the chars done. // const XMLCh* srcPtr = toFormat; const XMLCh* endPtr = toFormat + count; while (srcPtr < endPtr) { const XMLCh* tmpPtr = srcPtr; while (tmpPtr < endPtr) { if (fXCoder->canTranscodeTo(*tmpPtr)) tmpPtr++; else break; } if (tmpPtr > srcPtr) { // We got at least some chars that can be done normally formatBuf ( srcPtr , tmpPtr - srcPtr , escapeFlags , XMLFormatter::UnRep_Fail ); // Update the source pointer to our new spot srcPtr = tmpPtr; } else { // We hit something unrepresentable. So continue forward doing // char refs until we hit something representable again or the // end of input. // while (srcPtr < endPtr) { if ((*srcPtr & 0xFC00) == 0xD800) { // we have encountered a surrogate, need to recombine before printing out // use writeCharRef that takes XMLSize_t to get values larger than // hex 0xFFFF printed. tmpPtr = srcPtr; tmpPtr++; // point at low surrogate writeCharRef((XMLSize_t) (0x10000+((*srcPtr-0xD800)<<10)+*tmpPtr-0xDC00)); srcPtr++; // advance to low surrogate (will advance again below) } else { writeCharRef(*srcPtr); } // Move up the source pointer and break out if needed srcPtr++; if (fXCoder->canTranscodeTo(*srcPtr)) break; } } } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/XMLEntityHandler.hpp000644 000765 000024 00000012347 13241160334 024133 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLEntityHandler.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLENTITYHANDLER_HPP) #define XERCESC_INCLUDE_GUARD_XMLENTITYHANDLER_HPP #include XERCES_CPP_NAMESPACE_BEGIN class InputSource; class XMLBuffer; class XMLResourceIdentifier; /** * This abstract class is a callback mechanism for the scanner. By creating * a derivative of this class and plugging into the scanner, the scanner * will call back on the object's methods to entity events. * * This class is primarily for use by those writing their own parser classes. * If you use the standard parser classes, DOMParser and SAXParser, you won't * use this API. You will instead use a similar mechanism defined by the SAX * API, called EntityResolver. */ class XMLPARSER_EXPORT XMLEntityHandler { public: // ----------------------------------------------------------------------- // Constructors are hidden, only the virtual destructor is exposed // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Default destructor */ virtual ~XMLEntityHandler() { } //@} // ----------------------------------------------------------------------- // The virtual entity handler interface // ----------------------------------------------------------------------- /** @name The pure virtual methods in this interface. */ //@{ /** * This method get called after the scanner has finished reading from * the given input source while processing external entity references. * * @param inputSource The input source for the entity */ virtual void endInputSource(const InputSource& inputSource) = 0; /** * This method allows the passes the scanned systemId to the entity * handler, thereby giving it a chance to provide any customized * handling like resolving relative path names. The scanner first * calls this method before calling resolveEntity. * * @param systemId The system id extracted by the scanner from the * input source. * @param toFill The buffer in which the fully expanded system id needs * to be stored. */ virtual bool expandSystemId ( const XMLCh* const systemId , XMLBuffer& toFill ) = 0; /** * This method allows the entity handler to reset itself, so that * it can be used again. It is called prior to a new document parse * operation. */ virtual void resetEntities() = 0; /** * This method allows the entity handler to provide customized * application specific entity resolution. * * Only one resolveEntity method will be used. If both setEntityResolver and * setXMLEntityResolver are called, then the last one is used. * * @param resourceIdentifier An object containing the type of * resource to be resolved and the associated data members * corresponding to this type. * @return The value returned by the resolveEntity method or * NULL otherwise to indicate no processing was done. * The returned InputSource is owned by the parser which is * responsible to clean up the memory. */ virtual InputSource* resolveEntity ( XMLResourceIdentifier* resourceIdentifier ) = 0; /** * This method will be called before the scanner starts reading * from an input source while processing external entity references. * * @param inputSource The external input source. */ virtual void startInputSource(const InputSource& inputSource) = 0; //@} protected : // ----------------------------------------------------------------------- // Hidden Constructors // ----------------------------------------------------------------------- /** @name Constructor */ //@{ /** * Protected default constructor */ XMLEntityHandler() { } //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and destructor // ----------------------------------------------------------------------- XMLEntityHandler(const XMLEntityHandler&); XMLEntityHandler& operator=(const XMLEntityHandler&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/MemBufInputSource.hpp000644 000765 000024 00000021401 13241160334 024343 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: MemBufInputSource.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_MEMBUFINPUTSOURCE_HPP) #define XERCESC_INCLUDE_GUARD_MEMBUFINPUTSOURCE_HPP #include XERCES_CPP_NAMESPACE_BEGIN class BinInputStream; /** * This class is a derivative of the standard InputSource class. It provides * for the parser access to data stored in a memory buffer. The type of * buffer and its host specific attributes are of little concern here. The * only real requirement is that the memory be readable by the current * process. * * Note that the memory buffer size is expressed in bytes, not in * characters. If you pass it text data, you must account for the bytes * per character when indicating the buffer size. * * As with all InputSource derivatives. The primary objective of an input * source is to create an input stream via which the parser can spool in * data from the referenced source. In this case, there are two options * available. * * The passed buffer can be adopted or merely referenced. If it is adopted, * then it must be dynamically allocated and will be destroyed when the * input source is destroyed (no reference counting!.) If not adopted, the * caller must insure that it remains valid until the input source object * is destroyed. * * The other option indicates whether each stream created for this input * source should get its own copy of the data, or whether it should just * stream the data directly from this object's copy of the data. The same * rules apply here, in that the buffer must either be copied by the * stream or it must remain valid until the stream is destroyed. */ class XMLPARSER_EXPORT MemBufInputSource : public InputSource { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * A memory buffer input source is constructed from a buffer of byte * data, and the count of bytes in that buffer. The parser will parse * from this memory buffer until it has eaten the indicated number of * bytes. * * Note that the system id provided serves two purposes. Firstly it is * going to be displayed in error messages as the source of the error. * And secondly, any entities which are referred to from this entity * via relative paths/URLs will be relative to this fake system id. * * @param srcDocBytes The actual data buffer to be parsed from. * @param byteCount The count of bytes (not characters, bytes!) * in the buffer. * @param bufId A fake system id for the buffer. * @param adoptBuffer Indicates whether this object should adopt * the buffer (i.e. become responsible for * deletion) or just * use it in place. * @param manager Pointer to the memory manager to be used to * allocate objects. */ MemBufInputSource ( const XMLByte* const srcDocBytes , const XMLSize_t byteCount , const XMLCh* const bufId , const bool adoptBuffer = false , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * This constructor is identical to the previous one, except that it takes * the fake system id in local code page form and transcodes it internally. */ MemBufInputSource ( const XMLByte* const srcDocBytes , const XMLSize_t byteCount , const char* const bufId , const bool adoptBuffer = false , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** @name Destructor */ //@{ /** * If the buffer was adopted, the copy made during construction is deleted * at this point. */ ~MemBufInputSource(); //@} // ----------------------------------------------------------------------- // Virtual input source interface // ----------------------------------------------------------------------- /** @name Virtual methods */ //@{ /** * This method will return a binary input stream derivative that will * parse from the memory buffer. If setCopyBufToStream() has been set, * then the stream will make its own copy. Otherwise, it will use the * buffer as is (in which case it must remain valid until the stream * is no longer in use, i.e. the parse completes.) * * @return A dynamically allocated binary input stream derivative that * can parse from the memory buffer. */ BinInputStream* makeStream() const; //@} // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** @name Setter methods */ //@{ /** * By default, for safety's sake, each newly created stream from this * input source will make its own copy of the buffer to stream from. This * avoids having to deal with aliasing of the buffer for simple work. But, * for higher performance applications or for large buffers, this is * obviously not optimal. * * In such cases, you can call this method to turn off that default * action. Once turned off, the streams will just get a pointer to the * buffer and parse directly from that. In this case, you must insure that * the buffer remains valid for as long as any parse events are still * using it. * * @param newState The new boolean flag state to set. */ void setCopyBufToStream(const bool newState); /** * This methods allows the MemBufInputSource to be used for more than * one input source, instead of destructing/constructing another * MemBufInputSource. * * @param srcDocBytes The actual data buffer to be parsed from. * @param byteCount The count of bytes (not characters, bytes!) * in the buffer. */ void resetMemBufInputSource(const XMLByte* const srcDocBytes , const XMLSize_t byteCount); //@} private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- MemBufInputSource(const MemBufInputSource&); MemBufInputSource& operator=(const MemBufInputSource&); // ----------------------------------------------------------------------- // Private data members // // fAdopted // Indicates whether the buffer is adopted or not. If so, then it // is destroyed when the input source is destroyed. // // fByteCount // The size of the source document. // // fCopyBufToStream // This defaults to true (the safe option), which causes it to // give a copy of the buffer to any streams it creates. If you set // it to false, it will allow the streams to just reference the // buffer (in which case this input source must stay alive as long // as the buffer is in use by the stream.) // // fSrcBytes // The source memory buffer that is being spooled from. Whether it // belongs to the this input source or not is controlled by the // fAdopted flag. // ----------------------------------------------------------------------- bool fAdopted; XMLSize_t fByteCount; bool fCopyBufToStream; const XMLByte* fSrcBytes; }; inline void MemBufInputSource::setCopyBufToStream(const bool newState) { fCopyBufToStream = newState; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLBufferMgr.cpp000644 000765 000024 00000007235 13241160334 023233 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: XMLBufferMgr.cpp 673679 2008-07-03 13:50:10Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- //#include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- XMLBufferMgr::XMLBufferMgr(MemoryManager* const manager) : fBufCount(32) , fMemoryManager(manager) , fBufList(0) { // Allocate the buffer list and zero it out fBufList = (XMLBuffer**) fMemoryManager->allocate(fBufCount * sizeof(XMLBuffer*)); // new XMLBuffer*[fBufCount]; for (XMLSize_t index = 0; index < fBufCount; index++) fBufList[index] = 0; } XMLBufferMgr::~XMLBufferMgr() { // Delete any buffers that got allocated for (XMLSize_t index = 0; index < fBufCount; index++) delete fBufList[index]; // And then the buffer list fMemoryManager->deallocate(fBufList); //delete [] fBufList; } // --------------------------------------------------------------------------- // Buffer management // --------------------------------------------------------------------------- XMLBuffer& XMLBufferMgr::bidOnBuffer() { // // Look for a buffer that is not in use. If we hit a null entry, then // we have to add one. // for (XMLSize_t index = 0; index < fBufCount; index++) { // No more buffers available, so create one and take it if (!fBufList[index]) { fBufList[index] = new (fMemoryManager) XMLBuffer(1023, fMemoryManager); fBufList[index]->setInUse(true); return *fBufList[index]; } // // There's one here, so see if its use. If not, mark it, reset it, // and take it // if (!fBufList[index]->getInUse()) { fBufList[index]->reset(); fBufList[index]->setInUse(true); return *(fBufList[index]); } } // We did not find one, so freak out ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::BufMgr_NoMoreBuffers, fMemoryManager); // NOTE: Dummy return to make some compilers happy. Never really gets called! return *fBufList[0]; } void XMLBufferMgr::releaseBuffer(XMLBuffer& toRelease) { // Look for this buffer in the list for (XMLSize_t index = 0; index < fBufCount; index++) { if (fBufList[index] == &toRelease) { // Unmark it toRelease.setInUse(false); return; } } // It was not a legal buffer ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::BufMgr_BufferNotInPool, fMemoryManager); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/MemBufFormatTarget.cpp000644 000765 000024 00000006167 13241160334 024471 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: MemBufFormatTarget.cpp 932889 2010-04-11 13:10:10Z borisk $ */ #include #include #include XERCES_CPP_NAMESPACE_BEGIN MemBufFormatTarget::MemBufFormatTarget( XMLSize_t initCapacity , MemoryManager* const manager) : fMemoryManager(manager) , fDataBuf(0) , fIndex(0) , fCapacity(initCapacity) { // Buffer is one larger than capacity, to allow for zero term fDataBuf = (XMLByte*) fMemoryManager->allocate ( (fCapacity + 4) * sizeof(XMLByte) );//new XMLByte[fCapacity+4]; // Keep it null terminated fDataBuf[0] = XMLByte(0); } MemBufFormatTarget::~MemBufFormatTarget() { fMemoryManager->deallocate(fDataBuf);//delete [] fDataBuf; } void MemBufFormatTarget::writeChars(const XMLByte* const toWrite , const XMLSize_t count , XMLFormatter * const) { if (count) { if (fIndex + count >= fCapacity) ensureCapacity(count); memcpy(&fDataBuf[fIndex], toWrite, count * sizeof(XMLByte)); fIndex += count; } } const XMLByte* MemBufFormatTarget::getRawBuffer() const { fDataBuf[fIndex] = 0; fDataBuf[fIndex + 1] = 0; fDataBuf[fIndex + 2] = 0; fDataBuf[fIndex + 3] = 0; return fDataBuf; } void MemBufFormatTarget::reset() { fIndex = 0; fDataBuf[0] = 0; fDataBuf[fIndex + 1] = 0; fDataBuf[fIndex + 2] = 0; fDataBuf[fIndex + 3] = 0; } // --------------------------------------------------------------------------- // MemBufFormatTarget: Private helper methods // --------------------------------------------------------------------------- void MemBufFormatTarget::ensureCapacity(const XMLSize_t extraNeeded) { // Oops, not enough room. Calc new capacity and allocate new buffer const XMLSize_t newCap = ((fIndex + extraNeeded) * 2); XMLByte* newBuf = (XMLByte*) fMemoryManager->allocate ( (newCap+4) * sizeof(XMLByte) );//new XMLByte[newCap+4]; // Copy over the old stuff memcpy(newBuf, fDataBuf, fIndex * sizeof(XMLByte)); // Clean up old buffer and store new stuff fMemoryManager->deallocate(fDataBuf); //delete [] fDataBuf; fDataBuf = newBuf; fCapacity = newCap; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/StdInInputSource.cpp000644 000765 000024 00000003513 13241160334 024210 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: StdInInputSource.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // StdInInputSource: Implementation of the input source interface // --------------------------------------------------------------------------- BinInputStream* StdInInputSource::makeStream() const { // Open a binary file stream for the standard input file handle BinFileInputStream* retStream = new (getMemoryManager()) BinFileInputStream ( XMLPlatformUtils::openStdInHandle(getMemoryManager()) ); if (!retStream->getIsOpen()) { delete retStream; return 0; } return retStream; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/URLInputSource.cpp000644 000765 000024 00000006670 13241160335 023641 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: URLInputSource.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // URLInputSource: Constructors and Destructor // --------------------------------------------------------------------------- URLInputSource::URLInputSource( const XMLURL& urlId , MemoryManager* const manager) : InputSource(manager) , fURL(urlId) { setSystemId(fURL.getURLText()); } URLInputSource::URLInputSource( const XMLCh* const baseId , const XMLCh* const systemId , MemoryManager* const manager) : InputSource(manager) , fURL(baseId, systemId) { // Create a URL that will build up the full URL and store as the system id setSystemId(fURL.getURLText()); } URLInputSource::URLInputSource( const XMLCh* const baseId , const XMLCh* const systemId , const XMLCh* const publicId , MemoryManager* const manager) : InputSource(0, publicId, manager) , fURL(baseId, systemId) { setSystemId(fURL.getURLText()); } URLInputSource::URLInputSource( const XMLCh* const baseId , const char* const systemId , MemoryManager* const manager) : InputSource(manager) , fURL(baseId, systemId) { setSystemId(fURL.getURLText()); } URLInputSource::URLInputSource( const XMLCh* const baseId , const char* const systemId , const char* const publicId , MemoryManager* const manager) : InputSource(0, publicId, manager) , fURL(baseId, systemId) { setSystemId(fURL.getURLText()); } URLInputSource::~URLInputSource() { } // --------------------------------------------------------------------------- // URLInputSource: Implementation of the input source interface // --------------------------------------------------------------------------- BinInputStream* URLInputSource::makeStream() const { // Ask the URL to create us an appropriate input stream return fURL.makeNewStream(); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/XMLElementDecl.hpp000644 000765 000024 00000046161 13241160335 023544 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLElementDecl.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLELEMENTDECL_HPP) #define XERCESC_INCLUDE_GUARD_XMLELEMENTDECL_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class ContentSpecNode; class XMLContentModel; /** * This class defines the core information of an element declaration. Each * validator (DTD, Schema, etc...) will have its own information that it * associations with the declaration of an element, but they must all share * at least this core information, i.e. they must all derive from this * class. The set of info enforced at this level is driven by the needs of * XML 1.0 spec validation and well formedness checks. * * This class defines some special element id values for invalid elements * and PCDATA elements, as well as a string for the special PCDATA element * name. All validators must honor these special values in order to allow * content models to work generically (i.e. to let code know when its dealing * with invalid or PCDATA element ids without having to know what type of * validator its messing with.) */ class XMLPARSER_EXPORT XMLElementDecl : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Class specific types // // CreateReasons // This type is used to store how an element declaration got into // the grammar's element pool. They are faulted in for various // reasons. // // LookupOpts // These are the values used by the attribute lookup methods. // // CharDataOpts // This is used to indicate how this type of element reacts to // character data as content. // ----------------------------------------------------------------------- enum CreateReasons { NoReason , Declared , AttList , InContentModel , AsRootElem , JustFaultIn }; enum CharDataOpts { NoCharData , SpacesOk , AllCharData }; // ----------------------------------------------------------------------- // Public static data // // fgInvalidElemId // A value to represent an invalid element node id. // // fgPCDataElemId // This is the value to use to represent a PCDATA node when an // element id is required. // // fgPCDataElemName // This is the value to use to represent a PCDATA node when an // element name is required. // ----------------------------------------------------------------------- static const unsigned int fgInvalidElemId; static const unsigned int fgPCDataElemId; static const XMLCh fgPCDataElemName[]; // ----------------------------------------------------------------------- // Destructor // ----------------------------------------------------------------------- /** @name Destructor */ //@{ virtual ~XMLElementDecl(); //@} // ----------------------------------------------------------------------- // The virtual element decl interface // ----------------------------------------------------------------------- /** @name Virual ElementDecl interface */ //@{ /** Get a list of attributes defined for this element. * * The derived class should return a reference to some member object which * implements the XMLAttDefList interface. This object gives the scanner the * ability to look through the attributes defined for this element. * * It is done this way for efficiency, though of course this is not thread * safe. The scanner guarantees that it won't ever call this method in any * nested way, but the outside world must be careful about when it calls * this method, and optimally never would. */ virtual XMLAttDefList& getAttDefList() const = 0; /** The character data options for this element type * * The derived class should return an appropriate character data opts value * which correctly represents its tolerance towards whitespace or character * data inside of its instances. This allows the scanner to do all of the * validation of character data. */ virtual CharDataOpts getCharDataOpts() const = 0; /** Indicate whether this element type defined any attributes * * The derived class should return a boolean that indicates whether this * element has any attributes defined for it or not. This is an optimization * that allows the scanner to skip some work if no attributes exist. */ virtual bool hasAttDefs() const = 0; /** Get a pointer to the content spec node * * This method will return a const pointer to the content spec node object * of this element. * * @return A const pointer to the element's content spec node */ virtual const ContentSpecNode* getContentSpec() const = 0; /** Get a pointer to the content spec node * * This method is identical to the previous one, except that it is non * const. */ virtual ContentSpecNode* getContentSpec() = 0; /** Set the content spec node object for this element type * * This method will adopt the based content spec node object. This is called * by the actual validator which is parsing its DTD or Schema or whatever * and store it on the element decl object via this method. * * @param toAdopt This method will adopt the passed content node spec * object. Any previous object is destroyed. */ virtual void setContentSpec(ContentSpecNode* toAdopt) = 0; /** Get a pointer to the abstract content model * * This method will return a const pointer to the content model object * of this element. This class is a simple abstraction that allows an * element to define and use multiple, specialized content model types * internally but still allow the outside world to do simple stuff with * them. * * @return A pointer to the element's content model, via the basic * abstract content model type. */ virtual XMLContentModel* getContentModel() = 0; /** Set the content model object for this element type * * This method will adopt the based content model object. This is called * by the actual validator which is parsing its DTD or Schema or whatever * a creating an element decl. It will build what it feels is the correct * content model type object and store it on the element decl object via * this method. * * @param newModelToAdopt This method will adopt the passed content model * object. Any previous object is destroyed. */ virtual void setContentModel(XMLContentModel* const newModelToAdopt) = 0; /** Geta formatted string of the content model * * This method is a convenience method which will create a formatted * representation of the content model of the element. It will not always * exactly recreate the original model, since some normalization or * or reformatting may occur. But, it will be a technically accurate * representation of the original content model. * * @return A pointer to an internal buffer which contains the formatted * content model. The caller does not own this buffer and should * copy it if it needs to be kept around. */ virtual const XMLCh* getFormattedContentModel () const = 0; //@} // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** @name Getter methods */ //@{ /** Get the base name of this element type. * * Return the base name part of the element's name. This is the * same regardless of whether namespaces are enabled or not. * * @return A const pointer to the base name of the element decl. */ const XMLCh* getBaseName() const; XMLCh* getBaseName(); /** Get the URI id of this element type. * * Return the URI Id of this element. * * @return The URI Id of the element decl, or the emptyNamespaceId if not applicable. */ unsigned int getURI() const; /** Get the QName of this element type. * * Return the QName part of the element's name. This is the * same regardless of whether namespaces are enabled or not. * * @return A const pointer to the QName of the element decl. */ const QName* getElementName() const; QName* getElementName(); /** Get the full name of this element type. * * Return the full name of the element. If namespaces * are not enabled, then this is the qName. Else it is the {uri}baseName * form. For those validators that always require namespace processing, it * will always be in the latter form because namespace processing will always * be on. */ const XMLCh* getFullName() const; /** Get the create reason for this element type * * This method returns an enumeration which indicates why this element * declaration exists. Elements can be used before they are actually * declared, so they will often be faulted into the pool and marked as * to why they are there. * * @return An enumerated value that indicates the reason why this element * was added to the element decl pool. */ CreateReasons getCreateReason() const; /** Get the element decl pool id for this element type * * This method will return the element decl pool id of this element * declaration. This uniquely identifies this element type within the * parse event that it is declared within. This value is assigned by the * grammar whose decl pool this object belongs to. * * @return The element decl id of this element declaration. */ XMLSize_t getId() const; /** Indicate whether this element type has been declared yet * * This method returns a boolean that indicates whether this element * has been declared yet. There are a number of reasons why an element * declaration can be faulted in, but eventually it must be declared or * its an error. See the CreateReasons enumeration. * * @return true if this element has been declared, else false. */ bool isDeclared() const; /** Indicate whether this element type has been declared externally * * This method returns a boolean that indicates whether this element * has been declared externally. * * @return true if this element has been declared externally, else false. */ bool isExternal() const; /** Get the memory manager * * This method returns the configurable memory manager used by the * element declaration for dynamic allocation/deallocation. * * @return the memory manager */ MemoryManager* getMemoryManager() const; //@} // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** @name Setter methods */ //@{ /** Set the element name object for this element type * * This method will adopt the based content spec node object. This is called * by the actual validator which is parsing its DTD or Schema or whatever * and store it on the element decl object via this method. * * @param prefix Prefix of the element * @param localPart Base Name of the element * @param uriId The uriId of the element */ void setElementName(const XMLCh* const prefix , const XMLCh* const localPart , const int uriId ); /** Set the element name object for this element type * * This method will adopt the based content spec node object. This is called * by the actual validator which is parsing its DTD or Schema or whatever * and store it on the element decl object via this method. * * @param rawName Full Name of the element * @param uriId The uriId of the element */ void setElementName(const XMLCh* const rawName , const int uriId ); /** Set the element name object for this element type * * This method will adopt the based content spec node object. This is called * by the actual validator which is parsing its DTD or Schema or whatever * and store it on the element decl object via this method. * * @param elementName QName of the element */ void setElementName(const QName* const elementName); /** Update the create reason for this element type. * * This method will update the 'create reason' field for this element * decl object. As the validator parses its DTD, Schema, etc... it will * encounter various references to an element declaration, which will * cause the element declaration to either be declared or to be faulted * into the pool in preparation for some future declaration. As it does * so,it will update this field to indicate the current status of the * decl object. */ void setCreateReason(const CreateReasons newReason); /** Set the element decl pool id for this element type * * This method will set the pool id of this element decl. This is called * by the grammar which created this object, and will provide this * decl object with a unique id within the parse event that created it. */ void setId(const XMLSize_t newId); /** Set the element decl to indicate external declaration * */ void setExternalElemDeclaration(const bool aValue); //@} // ----------------------------------------------------------------------- // Miscellaneous methods // ----------------------------------------------------------------------- /** @name Miscellaneous methods */ //@{ //@} /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLElementDecl) enum objectType { Schema , DTD , UnKnown }; virtual XMLElementDecl::objectType getObjectType() const = 0; static void storeElementDecl(XSerializeEngine& serEng , XMLElementDecl* const element); static XMLElementDecl* loadElementDecl(XSerializeEngine& serEng); protected : // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- XMLElementDecl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLElementDecl(const XMLElementDecl&); XMLElementDecl& operator=(const XMLElementDecl&); // ----------------------------------------------------------------------- // Data members // // fElementName // This is the name of the element decl. // // fCreateReason // We sometimes have to put an element decl object into the elem // decl pool before the element's declaration is seen, such as when // its used in another element's content model or an att list is // seen for it. This flag tells us whether its been declared, and // if not why it had to be created. // // fId // The unique id of this element. This is created by the derived // class, or more accurately the grammar that owns the objects // of the derived types. But, since they all have to have them, we // let them all store the id here. It is defaulted to have the // value fgInvalidElem until explicitly set. // // fExternalElement // This flag indicates whether or the element was declared externally. // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; QName* fElementName; CreateReasons fCreateReason; XMLSize_t fId; bool fExternalElement; }; // --------------------------------------------------------------------------- // XMLElementDecl: Getter methods // --------------------------------------------------------------------------- inline const XMLCh* XMLElementDecl::getBaseName() const { return fElementName->getLocalPart(); } inline XMLCh* XMLElementDecl::getBaseName() { return fElementName->getLocalPart(); } inline unsigned int XMLElementDecl::getURI() const { return fElementName->getURI(); } inline const QName* XMLElementDecl::getElementName() const { return fElementName; } inline QName* XMLElementDecl::getElementName() { return fElementName; } inline const XMLCh* XMLElementDecl::getFullName() const { return fElementName->getRawName(); } inline XMLElementDecl::CreateReasons XMLElementDecl::getCreateReason() const { return fCreateReason; } inline XMLSize_t XMLElementDecl::getId() const { return fId; } inline bool XMLElementDecl::isDeclared() const { return (fCreateReason == Declared); } inline bool XMLElementDecl::isExternal() const { return fExternalElement; } inline MemoryManager* XMLElementDecl::getMemoryManager() const { return fMemoryManager; } // --------------------------------------------------------------------------- // XMLElementDecl: Setter methods // --------------------------------------------------------------------------- inline void XMLElementDecl::setCreateReason(const XMLElementDecl::CreateReasons newReason) { fCreateReason = newReason; } inline void XMLElementDecl::setId(const XMLSize_t newId) { fId = newId; } inline void XMLElementDecl::setExternalElemDeclaration(const bool aValue) { fExternalElement = aValue; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLRecognizer.cpp000644 000765 000024 00000025073 13241160335 023464 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: XMLRecognizer.cpp 555320 2007-07-11 16:05:13Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local data // // gEncodingNameMap // This array maps the Encodings enum values to their canonical names. // Be sure to keep this in sync with that enum! // --------------------------------------------------------------------------- static const XMLCh* gEncodingNameMap[XMLRecognizer::Encodings_Count] = { XMLUni::fgEBCDICEncodingString , XMLUni::fgUCS4BEncodingString , XMLUni::fgUCS4LEncodingString , XMLUni::fgUSASCIIEncodingString , XMLUni::fgUTF8EncodingString , XMLUni::fgUTF16BEncodingString , XMLUni::fgUTF16LEncodingString , XMLUni::fgXMLChEncodingString }; // --------------------------------------------------------------------------- // XMLRecognizer: Public, const static data // // gXXXPre // gXXXPreLen // The byte sequence prefixes for all of the encodings that we can // auto sense. Also included is the length of each sequence. // --------------------------------------------------------------------------- const char XMLRecognizer::fgASCIIPre[] = { 0x3C, 0x3F, 0x78, 0x6D, 0x6C, 0x20 }; const XMLSize_t XMLRecognizer::fgASCIIPreLen = 6; const XMLByte XMLRecognizer::fgEBCDICPre[] = { 0x4C, 0x6F, 0xA7, 0x94, 0x93, 0x40 }; const XMLSize_t XMLRecognizer::fgEBCDICPreLen = 6; const XMLByte XMLRecognizer::fgUTF16BPre[] = { 0x00, 0x3C, 0x00, 0x3F, 0x00, 0x78, 0x00, 0x6D, 0x00, 0x6C, 0x00, 0x20 }; const XMLByte XMLRecognizer::fgUTF16LPre[] = { 0x3C, 0x00, 0x3F, 0x00, 0x78, 0x00, 0x6D, 0x00, 0x6C, 0x00, 0x20, 0x00 }; const XMLSize_t XMLRecognizer::fgUTF16PreLen = 12; const XMLByte XMLRecognizer::fgUCS4BPre[] = { 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x3F , 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x6D , 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x20 }; const XMLByte XMLRecognizer::fgUCS4LPre[] = { 0x3C, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00 , 0x78, 0x00, 0x00, 0x00, 0x6D, 0x00, 0x00, 0x00 , 0x6C, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00 }; const XMLSize_t XMLRecognizer::fgUCS4PreLen = 24; const char XMLRecognizer::fgUTF8BOM[] = {(char)0xEF, (char)0xBB, (char)0xBF}; const XMLSize_t XMLRecognizer::fgUTF8BOMLen = 3; // --------------------------------------------------------------------------- // XMLRecognizer: Encoding recognition methods // --------------------------------------------------------------------------- XMLRecognizer::Encodings XMLRecognizer::basicEncodingProbe( const XMLByte* const rawBuffer , const XMLSize_t rawByteCount) { // // As an optimization to check the 90% case, check first for the ASCII // sequence '= fgASCIIPreLen) { if (!memcmp(rawBuffer, fgASCIIPre, fgASCIIPreLen)) return UTF_8; } // // If the count of raw bytes is less than 2, it cannot be anything // we understand, so return UTF-8 as a fallback. // if (rawByteCount < 2) return UTF_8; // // We have two to four bytes, so lets check for a UTF-16 BOM. That // is quick to check and enough to identify two major encodings. // if (rawByteCount < 4) { if ((rawBuffer[0] == 0xFE) && (rawBuffer[1] == 0xFF)) return UTF_16B; else if ((rawBuffer[0] == 0xFF) && (rawBuffer[1] == 0xFE)) return UTF_16L; else return UTF_8; } /*** * F.1 Detection Without External Encoding Information * * Because each XML entity not accompanied by external encoding information and * not in UTF-8 or UTF-16 encoding must begin with an XML encoding declaration, * in which the first characters must be '= fgUCS4PreLen && !memcmp(rawBuffer, fgUCS4BPre, fgUCS4PreLen)) return UCS_4B; else if (rawByteCount >= fgUCS4PreLen && !memcmp(rawBuffer, fgUCS4LPre, fgUCS4PreLen)) return UCS_4L; else if (rawByteCount >= fgUTF16PreLen && !memcmp(rawBuffer, fgUTF16BPre, fgUTF16PreLen)) return UTF_16B; else if (rawByteCount >= fgUTF16PreLen && !memcmp(rawBuffer, fgUTF16LPre, fgUTF16PreLen)) return UTF_16L; } // // See if we have enough bytes to possibly match the EBCDIC prefix. // If so, try it. // if (rawByteCount > fgEBCDICPreLen) { if (!memcmp(rawBuffer, fgEBCDICPre, fgEBCDICPreLen)) return EBCDIC; } // // Does not seem to be anything we know, so go with UTF-8 to get at // least through the first line and see what it really is. // return UTF_8; } XMLRecognizer::Encodings XMLRecognizer::encodingForName(const XMLCh* const encName) { // // Compare the passed string, assume input string is already uppercased, // to the variations that we recognize. // // !!NOTE: Note that we don't handle EBCDIC here because we don't handle // that one ourselves. It is allowed to fall into 'other'. // if (encName == XMLUni::fgXMLChEncodingString || !XMLString::compareString(encName, XMLUni::fgXMLChEncodingString)) { return XMLRecognizer::XERCES_XMLCH; } else if (!XMLString::compareString(encName, XMLUni::fgUTF8EncodingString) || !XMLString::compareString(encName, XMLUni::fgUTF8EncodingString2)) { return XMLRecognizer::UTF_8; } else if (!XMLString::compareString(encName, XMLUni::fgUSASCIIEncodingString) || !XMLString::compareString(encName, XMLUni::fgUSASCIIEncodingString2) || !XMLString::compareString(encName, XMLUni::fgUSASCIIEncodingString3) || !XMLString::compareString(encName, XMLUni::fgUSASCIIEncodingString4)) { return XMLRecognizer::US_ASCII; } else if (!XMLString::compareString(encName, XMLUni::fgUTF16LEncodingString) || !XMLString::compareString(encName, XMLUni::fgUTF16LEncodingString2)) { return XMLRecognizer::UTF_16L; } else if (!XMLString::compareString(encName, XMLUni::fgUTF16BEncodingString) || !XMLString::compareString(encName, XMLUni::fgUTF16BEncodingString2)) { return XMLRecognizer::UTF_16B; } else if (!XMLString::compareString(encName, XMLUni::fgUTF16EncodingString)) { return XMLPlatformUtils::fgXMLChBigEndian?XMLRecognizer::UTF_16B:XMLRecognizer::UTF_16L; } else if (!XMLString::compareString(encName, XMLUni::fgUCS4LEncodingString) || !XMLString::compareString(encName, XMLUni::fgUCS4LEncodingString2)) { return XMLRecognizer::UCS_4L; } else if (!XMLString::compareString(encName, XMLUni::fgUCS4BEncodingString) || !XMLString::compareString(encName, XMLUni::fgUCS4BEncodingString2)) { return XMLRecognizer::UCS_4B; } else if (!XMLString::compareString(encName, XMLUni::fgUCS4EncodingString)) { return XMLPlatformUtils::fgXMLChBigEndian?XMLRecognizer::UCS_4B:XMLRecognizer::UCS_4L; } // Return 'other' since we don't recognizer it return XMLRecognizer::OtherEncoding; } const XMLCh* XMLRecognizer::nameForEncoding(const XMLRecognizer::Encodings theEncoding , MemoryManager* const manager) { if (theEncoding >= Encodings_Count) ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::XMLRec_UnknownEncoding, manager); return gEncodingNameMap[theEncoding]; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/XMLErrorReporter.hpp000644 000765 000024 00000013207 13241160335 024172 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLErrorReporter.hpp 672273 2008-06-27 13:57:00Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLERRORREPORTER_HPP) #define XERCESC_INCLUDE_GUARD_XMLERRORREPORTER_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * This abstract class defines a callback mechanism for the scanner. By * creating a class that implements this interface and plugging an instance * of that class into the scanner, the scanner will call back on the object's * virtual methods to report error events. This class is also used with the * validator, to allow it to report errors. * * This class is primarily for use by those writing their own parser classes. * If you use the standard parser classes, DOMParser and SAXParser, you won't * use this API. You will instead use a similar mechanism defined by the SAX * API, called ErrorHandler. */ class XMLPARSER_EXPORT XMLErrorReporter { public: // ----------------------------------------------------------------------- // The types of errors we can issue // ----------------------------------------------------------------------- enum ErrTypes { ErrType_Warning , ErrType_Error , ErrType_Fatal , ErrTypes_Unknown }; // ----------------------------------------------------------------------- // Constructors are hidden, only the virtual destructor is exposed // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Default destructor */ virtual ~XMLErrorReporter() { } //@} // ----------------------------------------------------------------------- // The error handler interface // ----------------------------------------------------------------------- /** @name Error Handler interface */ //@{ /** Called to report errors from the scanner or validator * * This method is called back on by the scanner or validator (or any other * internal parser component which might need to report an error in the * future.) It contains all the information that the client code might * need to report or log the error. * * @param errCode The error code of the error being reported. What * this means is dependent on the domain it is from. * * @param errDomain The domain from which the error occured. The domain * is a means of providing a hierarchical layering to * the error system, so that a single set of error id * numbers don't have to be split up. * * @param type The error type, which is defined mostly by XML which * categorizes errors into warning, errors and validity * constraints. * * @param errorText The actual text of the error. This is translatable, * so can possibly be in the local language if a * translation has been provided. * * @param systemId The system id of the entity where the error occured, * fully qualified. * * @param publicId The optional public id of the entity were the error * occured. It can be an empty string if non was provided. * * @param lineNum The line number within the source XML of the error. * * @param colNum The column number within the source XML of the error. * Because of the parsing style, this is usually just * after the actual offending text. */ virtual void error ( const unsigned int errCode , const XMLCh* const errDomain , const ErrTypes type , const XMLCh* const errorText , const XMLCh* const systemId , const XMLCh* const publicId , const XMLFileLoc lineNum , const XMLFileLoc colNum ) = 0; /** Called before a new parse event to allow the handler to reset * * This method is called by the scanner before a new parse event is * about to start. It gives the error handler a chance to reset its * internal state. */ virtual void resetErrors() = 0; //@} protected : /** @name Constructor */ //@{ /** * Default constructor */ XMLErrorReporter() { } //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and destructor // ----------------------------------------------------------------------- XMLErrorReporter(const XMLErrorReporter&); XMLErrorReporter& operator=(const XMLErrorReporter&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLGrammarPoolImpl.hpp000644 000765 000024 00000023300 13241160335 024413 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLGrammarPoolImpl.hpp 671531 2008-06-25 12:38:28Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLGRAMMARPOOLIMPL_HPP) #define XERCESC_INCLUDE_GUARD_XMLGRAMMARPOOLIMPL_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLSynchronizedStringPool; class XMLUTIL_EXPORT XMLGrammarPoolImpl : public XMLGrammarPool { public : // ----------------------------------------------------------------------- /** @name constructor and destructor */ // ----------------------------------------------------------------------- //@{ XMLGrammarPoolImpl(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager); ~XMLGrammarPoolImpl(); //@} // ----------------------------------------------------------------------- /** @name Implementation of Grammar Pool Interface */ // ----------------------------------------------------------------------- //@{ /** * cacheGrammar * * Provide the grammar pool with an opportunity * to cache the given grammar. If the pool does not choose to do so, * it should return false; otherwise, it should return true, so that * the caller knows whether the grammar has been adopted. * * @param gramToCache: the Grammar to be cached in the grammar pool * @return true if the grammar pool has elected to cache the grammar (in which case * it is assumed to have adopted it); false if it does not cache it * */ virtual bool cacheGrammar(Grammar* const gramToCache); /** * retrieveGrammar * * @param gramDesc: the Grammar Description used to search for grammar * cached in the grammar pool * */ virtual Grammar* retrieveGrammar(XMLGrammarDescription* const gramDesc); /** * orphanGrammar * * grammar removed from the grammar pool and owned by the caller * * @param nameSpaceKey: Key used to search for grammar in the grammar pool * */ virtual Grammar* orphanGrammar(const XMLCh* const nameSpaceKey); /** * Get an enumeration of the cached Grammars in the Grammar pool * * @return enumeration of the cached Grammars in Grammar pool */ virtual RefHashTableOfEnumerator getGrammarEnumerator() const; /** * clear * * all grammars are removed from the grammar pool and deleted. * @return true if the grammar pool was cleared. false if it did not. */ virtual bool clear(); /** * lockPool * * When this method is called by the application, the * grammar pool should stop adding new grammars to the cache. */ virtual void lockPool(); /** * unlockPool * * After this method has been called, the grammar pool implementation * should return to its default behaviour when cacheGrammars(...) is called. * * For PSVI support any previous XSModel that was produced will be deleted. */ virtual void unlockPool(); //@} // ----------------------------------------------------------------------- /** @name Implementation of Factory interface */ // ----------------------------------------------------------------------- //@{ /** * createDTDGrammar * */ virtual DTDGrammar* createDTDGrammar(); /** * createSchemaGrammar * */ virtual SchemaGrammar* createSchemaGrammar(); /** * createDTDDescription * */ virtual XMLDTDDescription* createDTDDescription(const XMLCh* const systemId); /** * createSchemaDescription * */ virtual XMLSchemaDescription* createSchemaDescription(const XMLCh* const targetNamespace); //@} // ----------------------------------------------------------------------- /** @name schema component model support */ // ----------------------------------------------------------------------- //@{ /*** * Return an XSModel derived from the components of all SchemaGrammars * in the grammar pool. If the pool is locked, this should * be a thread-safe operation. * * NOTE: The function should NEVER return NULL. If there are no grammars in * the pool it should return an XSModel containing the Schema for Schema. * * Calling getXSModel() on an unlocked grammar pool may result in the * creation of a new XSModel with the old XSModel being deleted. * The bool parameter will indicate if the XSModel was changed. * * In this implementation, when the pool is not locked a new XSModel will be * computed each this time the pool is called if the pool has changed (and the * previous one will be destroyed at that time). When the lockPool() * method is called, an XSModel will be generated and returned whenever this method is called * while the pool is in the locked state. This will be destroyed if the unlockPool() * operation is called. The XSModel will not be serialized, * but will be recreated if a deserialized pool is in the * locked state. * */ virtual XSModel *getXSModel(bool& XSModelWasChanged); // @} // ----------------------------------------------------------------------- /** @name Getter */ // ----------------------------------------------------------------------- //@{ /** * Return an XMLStringPool for use by validation routines. * Implementations should not create a string pool on each call to this * method, but should maintain one string pool for all grammars * for which this pool is responsible. */ virtual XMLStringPool *getURIStringPool(); // @} // ----------------------------------------------------------------------- // serialization and deserialization support // ----------------------------------------------------------------------- /*** * * Multiple serializations * * For multiple serializations, if the same file name is given, then the * last result will be in the file (overwriting mode), if different file * names are given, then there are multiple data stores for each serialization. * * Multiple deserializations * * Not supported * * Versioning * * Only binary data serialized with the current XercesC Version and * SerializationLevel is supported. * * Clean up * * In the event of an exception thrown due to a corrupted data store during * deserialization, this implementation may not be able to clean up all resources * allocated, and therefore it is the client application's responsibility to * clean up those unreleased resources. * * Coupling of Grammars and StringPool * * This implementation assumes that StringPool shall always be * serialized/deserialized together with the grammars. In the case that such a * coupling is not desired, client application can modify this behaviour by * either derivate from this imlementation and overwrite the serializeGrammars() * and/or deserializeGrammars() to decouple grammars and string pool, or * Once deserializeGrammars() is done, insert another StringPool through * setStringPool(). * * Client application shall be aware of the unpredicatable/undefined consequence * of this decoupling. */ virtual void serializeGrammars(BinOutputStream* const); virtual void deserializeGrammars(BinInputStream* const); private: virtual void createXSModel(); void cleanUp(); // ----------------------------------------------------------------------- /** name Unimplemented copy constructor and operator= */ // ----------------------------------------------------------------------- //@{ XMLGrammarPoolImpl(const XMLGrammarPoolImpl& ); XMLGrammarPoolImpl& operator=(const XMLGrammarPoolImpl& ); //@} // ----------------------------------------------------------------------- // // fGrammarRegistry: // // container // fStringPool // grammars need a string pool for URI -> int mappings // fSynchronizedStringPool // When the grammar pool is locked, provide a string pool // that can be updated in a thread-safe manner. // fLocked // whether the pool has been locked // // ----------------------------------------------------------------------- RefHashTableOf* fGrammarRegistry; XMLStringPool* fStringPool; XMLSynchronizedStringPool* fSynchronizedStringPool; XSModel* fXSModel; bool fLocked; bool fXSModelIsValid; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLGrammarPool.hpp000644 000765 000024 00000026323 13241160334 023600 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLGrammarPool.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLGRAMMARPOOL_HPP) #define XERCESC_INCLUDE_GUARD_XMLGRAMMARPOOL_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class Grammar; class XMLGrammarDescription; class DTDGrammar; class SchemaGrammar; class XMLDTDDescription; class XMLSchemaDescription; class XMLStringPool; class BinInputStream; class BinOutputStream; class XMLPARSER_EXPORT XMLGrammarPool : public XMemory { public : // ----------------------------------------------------------------------- /** @name Virtual destructor for derived classes */ // ----------------------------------------------------------------------- //@{ /** * virtual destructor * */ virtual ~XMLGrammarPool(){}; //@} // ----------------------------------------------------------------------- /** @name The Grammar Pool Interface */ // ----------------------------------------------------------------------- //@{ /** * cacheGrammar * * Provide the grammar pool with an opportunity * to cache the given grammar. If the pool does not choose to do so, * it should return false; otherwise, it should return true, so that * the caller knows whether the grammar has been adopted. * * @param gramToCache the Grammar to be cached in the grammar pool * @return true if the grammar pool has elected to cache the grammar (in which case * it is assumed to have adopted it); false if it does not cache it * */ virtual bool cacheGrammar(Grammar* const gramToCache) = 0; /** * retrieveGrammar * * @param gramDesc the Grammar Description used to search for grammar * cached in the grammar pool * */ virtual Grammar* retrieveGrammar(XMLGrammarDescription* const gramDesc) = 0; /** * orphanGrammar * * grammar removed from the grammar pool and owned by the caller * * @param nameSpaceKey Key used to search for grammar in the grammar pool * @return the grammar that was removed from the pool (0 if none) */ virtual Grammar* orphanGrammar(const XMLCh* const nameSpaceKey) = 0; /** * Get an enumeration of the cached Grammars in the Grammar pool * * @return enumeration of the cached Grammars in Grammar pool */ virtual RefHashTableOfEnumerator getGrammarEnumerator() const = 0; /** * clear * * all grammars are removed from the grammar pool and deleted. * @return true if the grammar pool was cleared. false if it did not. */ virtual bool clear() = 0; /** * lockPool * * When this method is called by the application, the * grammar pool should stop adding new grammars to the cache. * This should result in the grammar pool being sharable * among parsers operating in different threads. * */ virtual void lockPool() = 0; /** * unlockPool * * After this method has been called, the grammar pool implementation * should return to its default behaviour when cacheGrammars(...) is called. * One effect, depending on the underlying implementation, is that the grammar pool * may no longer be thread-safe (even on read operations). * * For PSVI support any previous XSModel that was produced will be deleted. */ virtual void unlockPool() = 0; //@} // ----------------------------------------------------------------------- /** @name Factory interface */ // ----------------------------------------------------------------------- //@{ /** * createDTDGrammar * */ virtual DTDGrammar* createDTDGrammar() = 0; /** * createSchemaGrammar * */ virtual SchemaGrammar* createSchemaGrammar() = 0; /** * createDTDDescription * */ virtual XMLDTDDescription* createDTDDescription(const XMLCh* const systemId) = 0; /** * createSchemaDescription * */ virtual XMLSchemaDescription* createSchemaDescription(const XMLCh* const targetNamespace) = 0; //@} // ----------------------------------------------------------------------- /** @name schema component model support */ // ----------------------------------------------------------------------- //@{ /*** * Return an XSModel derived from the components of all SchemaGrammars * in the grammar pool. If the pool is locked, this should * be a thread-safe operation. * * NOTE: The function should NEVER return NULL. If there are no grammars in * the pool it should return an XSModel containing the Schema for Schema. * * Calling getXSModel() on an unlocked grammar pool may result in the * creation of a new XSModel with the old XSModel being deleted. * The bool parameter will indicate if the XSModel was changed. * */ virtual XSModel *getXSModel(bool& XSModelWasChanged) = 0; // @} // ----------------------------------------------------------------------- /** @name Getter */ // ----------------------------------------------------------------------- //@{ /** * getMemoryManager * */ inline MemoryManager* getMemoryManager() { return fMemMgr; } /** * Return an XMLStringPool for use by validation routines. * Implementations should not create a string pool on each call to this * method, but should maintain one string pool for all grammars * for which this pool is responsible. */ virtual XMLStringPool *getURIStringPool() = 0; //@} // ----------------------------------------------------------------------- /** serialization and deserialization support */ // ----------------------------------------------------------------------- /*** * * 1. Context: Serialize/Deserialize All Grammars In One Session * * Since it is common that a declaration in one grammar may reference * to definitions in other grammars, it is required to serialize those * related (or interdependent) grammars in to one persistent data store * in one serialization session (storing), and deserialize them from the * persistent data store in one deserialization session (loading) back * to the grammar pool. * * 2. Multiple serializations * * It is acceptable that client application requests more than one * grammar serialization on a particular grammar pool, to track the * different grammars cached, or for whatever reasons that client * application is interested in. * * 3. Multiple deserializations * * Request for grammar deserialization either after the grammar pool has * its own cached grammars, or request for more than one grammar * deserialization, may cause undesired and unpredictable consequence * and therefore client application shall be aware that individual * implementationis may NOT support this. * * However it is strongly recommended that the client application requests * no more than one grammar deserialization even a particular implementation * may allow multiple deserializations. * * 4. Locking * * Both serialization and deserialization requires to lock the grammar pool * before operation and unlock after operation. In the case the grammar pool * is locked by a third party, the request for serialization/deserialization * will NOT be entertained. * * 5. Versioning * * The Persistent data store has a version tag to be verified during * deserialization, thus a grammar pool may decide if it supports * a binary data created by a different release of Xerces. * * 6. Clean up * * The client application shall be aware that in the event of an exception * thrown due to a corrupted data store during deserialization, implementation * may not be able to clean up all resources allocated, and therefore it is * client application's responsibility to clean up those unreleased resources. * * */ virtual void serializeGrammars(BinOutputStream* const) = 0; virtual void deserializeGrammars(BinInputStream* const) = 0; /* * Set/get a flag to not create XSAnnotations when deserializing the grammar. * Defaults to false (create XSAnnotations when deserializing the grammar). */ inline void setIgnoreSerializedAnnotations(const bool flag) { fIgnoreSerializedAnnotations = flag; }; inline bool getIgnoreSerializedAnnotations() const { return fIgnoreSerializedAnnotations; }; protected : // ----------------------------------------------------------------------- /** Hidden Constructors */ // ----------------------------------------------------------------------- //@{ XMLGrammarPool(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager) :fMemMgr(memMgr) ,fIgnoreSerializedAnnotations(false) { }; //@} private : // ----------------------------------------------------------------------- /** name Unimplemented copy constructor and operator= */ // ----------------------------------------------------------------------- //@{ XMLGrammarPool(const XMLGrammarPool& ); XMLGrammarPool& operator=(const XMLGrammarPool& ); //@} // ----------------------------------------------------------------------- // // fMemMgr: plugged-in (or defaulted-in) memory manager // not owned // no reset after initialization // // ----------------------------------------------------------------------- MemoryManager* const fMemMgr; bool fIgnoreSerializedAnnotations; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/LocalFileFormatTarget.hpp000644 000765 000024 00000006635 13241160335 025156 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: LocalFileFormatTarget.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_LOCALFILEFORMATTARGET_HPP) #define XERCESC_INCLUDE_GUARD_LOCALFILEFORMATTARGET_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLPARSER_EXPORT LocalFileFormatTarget : public XMLFormatTarget { public: /** @name constructors and destructor */ //@{ LocalFileFormatTarget ( const XMLCh* const , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); LocalFileFormatTarget ( const char* const , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~LocalFileFormatTarget(); //@} // ----------------------------------------------------------------------- // Implementations of the format target interface // ----------------------------------------------------------------------- virtual void writeChars(const XMLByte* const toWrite , const XMLSize_t count , XMLFormatter* const formatter); virtual void flush(); private: // ----------------------------------------------------------------------- // Unimplemented methods. // ----------------------------------------------------------------------- LocalFileFormatTarget(const LocalFileFormatTarget&); LocalFileFormatTarget& operator=(const LocalFileFormatTarget&); // ----------------------------------------------------------------------- // Private helpers // ----------------------------------------------------------------------- void ensureCapacity(const XMLSize_t extraNeeded); // ----------------------------------------------------------------------- // Private data members // // fSource // The source file that we represent. The FileHandle type is defined // per platform. // // fDataBuf // The pointer to the buffer data. Its always // one larger than fCapacity, to leave room for the null terminator. // // fIndex // The current index into the buffer, as characters are appended // to it. If its zero, then the buffer is empty. // // fCapacity // The current capacity of the buffer. Its actually always one // larger, to leave room for the null terminator. // ----------------------------------------------------------------------- FileHandle fSource; XMLByte* fDataBuf; XMLSize_t fIndex; XMLSize_t fCapacity; MemoryManager* fMemoryManager; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLAttr.cpp000644 000765 000024 00000012364 13241160335 022266 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: XMLAttr.cpp 901107 2010-01-20 08:45:02Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLAttr: Constructors and Destructor // --------------------------------------------------------------------------- XMLAttr::XMLAttr(MemoryManager* const manager) : fSpecified(false) , fType(XMLAttDef::CData) , fValueBufSz(0) , fValue(0) , fAttName(0) , fMemoryManager(manager) { fAttName = new (fMemoryManager) QName(fMemoryManager); } typedef JanitorMemFunCall CleanupType; XMLAttr::XMLAttr( const unsigned int uriId , const XMLCh* const attrName , const XMLCh* const attrPrefix , const XMLCh* const attrValue , const XMLAttDef::AttTypes type , const bool specified , MemoryManager* const manager , DatatypeValidator* , const bool /*isSchema*/ ): fSpecified(specified) , fType(type) , fValueBufSz(0) , fValue(0) , fAttName(0) , fMemoryManager(manager) { CleanupType cleanup(this, &XMLAttr::cleanUp); try { // // Just call the local setters to set up everything. Too much // work is required to replicate that functionality here. // fAttName = new (fMemoryManager) QName(attrPrefix, attrName, uriId, fMemoryManager); setValue(attrValue); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XMLAttr::XMLAttr( const unsigned int uriId , const XMLCh* const rawName , const XMLCh* const attrValue , const XMLAttDef::AttTypes type , const bool specified , MemoryManager* const manager , DatatypeValidator * , const bool /*isSchema*/ ): fSpecified(specified) , fType(type) , fValueBufSz(0) , fValue(0) , fAttName(0) , fMemoryManager(manager) { CleanupType cleanup(this, &XMLAttr::cleanUp); try { // Just call the local setters to set up everything. Too much // work is required to replicate that functionality here. fAttName = new (fMemoryManager) QName(rawName, uriId, fMemoryManager); setValue(attrValue); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } // --------------------------------------------------------------------------- // XMLAttr: Getter methods // --------------------------------------------------------------------------- const XMLCh* XMLAttr::getQName() const { return fAttName->getRawName(); } // --------------------------------------------------------------------------- // XMLAttr: Setter methods // --------------------------------------------------------------------------- void XMLAttr::setName( const unsigned int uriId , const XMLCh* const attrName , const XMLCh* const attrPrefix) { fAttName->setName(attrPrefix, attrName, uriId); } void XMLAttr::setURIId(const unsigned int uriId) { fAttName->setURI(uriId); } void XMLAttr::setValue(const XMLCh* const newValue) { const XMLSize_t newLen = XMLString::stringLen(newValue); if (!fValueBufSz || (newLen > fValueBufSz)) { fMemoryManager->deallocate(fValue); //delete [] fValue; fValue = 0; fValueBufSz = newLen + 8; fValue = (XMLCh*) fMemoryManager->allocate((fValueBufSz+1) * sizeof(XMLCh)); //new XMLCh[fValueBufSz + 1]; } XMLString::moveChars(fValue, newValue, newLen + 1); } // --------------------------------------------------------------------------- // XMLAttr: Private, helper methods // --------------------------------------------------------------------------- void XMLAttr::cleanUp() { delete fAttName; fMemoryManager->deallocate(fValue); //delete [] fValue; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/XMLContentModel.hpp000644 000765 000024 00000012433 13241160334 023750 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLContentModel.hpp 677705 2008-07-17 20:15:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLCONTENTMODEL_HPP) #define XERCESC_INCLUDE_GUARD_XMLCONTENTMODEL_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class ContentLeafNameTypeVector; class GrammarResolver; class XMLStringPool; class XMLValidator; class SchemaGrammar; class SubstitutionGroupComparator; /** * This class defines the abstract interface for all content models. All * elements have a content model against which (if validating) its content * is checked. Each type of validator (DTD, Schema, etc...) can have * different types of content models, and even with each type of validator * there can be specialized content models. So this simple class provides * the abstract API via which all the types of contents models are dealt * with generically. Its pretty simple. */ class XMLPARSER_EXPORT XMLContentModel : public XMemory { public: // --------------------------------------------------------------------------- // Public static data // // gInvalidTrans // This value represents an invalid transition in each line of the // transition table. // // gEOCFakeId // gEpsilonFakeId // We have to put in a couple of special CMLeaf nodes to represent // special values, using fake element ids that we know won't conflict // with real element ids. // // // --------------------------------------------------------------------------- static const unsigned int gInvalidTrans; static const unsigned int gEOCFakeId; static const unsigned int gEpsilonFakeId; // ----------------------------------------------------------------------- // Constructors are hidden, only the virtual Destructor is exposed // ----------------------------------------------------------------------- /** @name Destructor */ //@{ virtual ~XMLContentModel() { } //@} // ----------------------------------------------------------------------- // The virtual content model interface provided by derived classes // ----------------------------------------------------------------------- virtual bool validateContent ( QName** const children , XMLSize_t childCount , unsigned int emptyNamespaceId , XMLSize_t* indexFailingChild , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) const = 0; virtual bool validateContentSpecial ( QName** const children , XMLSize_t childCount , unsigned int emptyNamespaceId , GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool , XMLSize_t* indexFailingChild , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) const =0; virtual void checkUniqueParticleAttribution ( SchemaGrammar* const pGrammar , GrammarResolver* const pGrammarResolver , XMLStringPool* const pStringPool , XMLValidator* const pValidator , unsigned int* const pContentSpecOrgURI , const XMLCh* pComplexTypeName = 0 ) =0; virtual ContentLeafNameTypeVector* getContentLeafNameTypeVector() const = 0; virtual unsigned int getNextState(unsigned int currentState, XMLSize_t elementIndex) const = 0; virtual bool handleRepetitions( const QName* const curElem, unsigned int curState, unsigned int currentLoop, unsigned int& nextState, unsigned int& nextLoop, XMLSize_t elementIndex, SubstitutionGroupComparator * comparator) const = 0; protected : // ----------------------------------------------------------------------- // Hidden Constructors // ----------------------------------------------------------------------- XMLContentModel() { } private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLContentModel(const XMLContentModel&); XMLContentModel& operator=(const XMLContentModel&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLRefInfo.hpp000644 000765 000024 00000013346 13241160335 022712 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLRefInfo.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLREFINFO_HPP) #define XERCESC_INCLUDE_GUARD_XMLREFINFO_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN /** * This class provides a simple means to track ID Ref usage. Since id/idref * semantics are part of XML 1.0, any validator will likely to be able to * track them. Instances of this class represent a reference and two markers, * one for its being declared and another for its being used. When the * document is done, one can look at each instance and, if used but not * declared, its an error. * * The getKey() method allows it to support keyed collection semantics. It * returns the referenced name, so these objects will be stored via the hash * of the name. This name will either be a standard QName if namespaces are * not enabled/supported by the validator, or it will be in the form * {url}name if namespace processing is enabled. */ class XMLPARSER_EXPORT XMLRefInfo : public XSerializable, public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructor */ //@{ XMLRefInfo ( const XMLCh* const refName , const bool fDeclared = false , const bool fUsed = false , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** @name Destructor */ //@{ ~XMLRefInfo(); //@} // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- bool getDeclared() const; const XMLCh* getRefName() const; bool getUsed() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setDeclared(const bool newValue); void setUsed(const bool newValue); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLRefInfo) XMLRefInfo ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLRefInfo(const XMLRefInfo&); XMLRefInfo& operator=(XMLRefInfo&); // ----------------------------------------------------------------------- // Private data members // // fDeclared // The name was declared somewhere as an ID attribute. // // fRefName // The name of the ref that this object represents. This is not a // name of the attribute, but of the value of an ID or IDREF attr // in content. // // fUsed // The name was used somewhere in an IDREF/IDREFS attribute. If this // is true, but fDeclared is false, then the ref does not refer to // a declared ID. // ----------------------------------------------------------------------- bool fDeclared; bool fUsed; XMLCh* fRefName; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // XMLRefInfo: Constructors and Destructor // --------------------------------------------------------------------------- inline XMLRefInfo::XMLRefInfo( const XMLCh* const refName , const bool declared , const bool used , MemoryManager* const manager) : fDeclared(declared) , fUsed(used) , fRefName(0) , fMemoryManager(manager) { fRefName = XMLString::replicate(refName, fMemoryManager); } inline XMLRefInfo::~XMLRefInfo() { fMemoryManager->deallocate(fRefName); } // --------------------------------------------------------------------------- // XMLRefInfo: Getter methods // --------------------------------------------------------------------------- inline bool XMLRefInfo::getDeclared() const { return fDeclared; } inline const XMLCh* XMLRefInfo::getRefName() const { return fRefName; } inline bool XMLRefInfo::getUsed() const { return fUsed; } // --------------------------------------------------------------------------- // XMLRefInfo: Setter methods // --------------------------------------------------------------------------- inline void XMLRefInfo::setDeclared(const bool newValue) { fDeclared = newValue; } inline void XMLRefInfo::setUsed(const bool newValue) { fUsed = newValue; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/Wrapper4DOMLSInput.hpp000644 000765 000024 00000016405 13241160334 024322 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Wrapper4DOMLSInput.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_WRAPPER4DOMLSINPUT_HPP) #define XERCESC_INCLUDE_GUARD_WRAPPER4DOMLSINPUT_HPP #include XERCES_CPP_NAMESPACE_BEGIN class DOMLSInput; class DOMLSResourceResolver; /** * Wrap a DOMLSInput object and make it behave like a SAX InputSource. */ class XMLPARSER_EXPORT Wrapper4DOMLSInput: public InputSource { public: /** @name Constructors and Destructor */ //@{ /** * Constructor * * Wrap a DOMLSInput and make it behave like a SAX InputSource. * By default, the wrapper will adopt the DOMLSInput that is wrapped. * * @param inputSource The DOMLSInput to be wrapped * @param entityResolver The DOMLSResourceResolver to be used when resolving publicID entries * @param adoptFlag Indicates if the wrapper should adopt the wrapped * DOMLSInput. Default is true. * @param manager Pointer to the memory manager to be used to * allocate objects. */ Wrapper4DOMLSInput ( DOMLSInput* const inputSource , DOMLSResourceResolver* entityResolver = 0 , const bool adoptFlag = true , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Destructor * */ virtual ~Wrapper4DOMLSInput(); //@} // ----------------------------------------------------------------------- /** @name Virtual input source interface */ //@{ /** * * Makes the byte stream for this input source. * *

The function will call the makeStream of the wrapped input source. * The returned stream becomes the parser's property.

* * @see BinInputStream */ BinInputStream* makeStream() const; //@} // ----------------------------------------------------------------------- /** @name Getter methods */ //@{ /** * * An input source can be set to force the parser to assume a particular * encoding for the data that input source reprsents, via the setEncoding() * method. This method will delegate to the wrapped input source to return * name of the encoding that is to be forced. If the encoding has never * been forced, it returns a null pointer. * * @return The forced encoding, or null if none was supplied. * @see #setEncoding */ const XMLCh* getEncoding() const; /** * * Get the public identifier for this input source. Delegated to the * wrapped input source object. * * @return The public identifier, or null if none was supplied. * @see #setPublicId */ const XMLCh* getPublicId() const; /** * * Get the system identifier for this input source. Delegated to the * wrapped input source object. * *

If the system ID is a URL, it will be fully resolved.

* * @return The system identifier. * @see #setSystemId */ const XMLCh* getSystemId() const; /** * * Get the flag that indicates if the parser should issue fatal error if * this input source is not found. Delegated to the wrapped input source * object. * * @return True if the parser should issue fatal error if this input source * is not found. * False if the parser issue warning message instead. * @see #setIssueFatalErrorIfNotFound */ bool getIssueFatalErrorIfNotFound() const; //@} // ----------------------------------------------------------------------- /** @name Setter methods */ //@{ /** * * Set the encoding which will be required for use with the XML text read * via a stream opened by this input source. This will update the wrapped * input source object. * *

This is usually not set, allowing the encoding to be sensed in the * usual XML way. However, in some cases, the encoding in the file is known * to be incorrect because of intermediate transcoding, for instance * encapsulation within a MIME document. * * @param encodingStr The name of the encoding to force. */ void setEncoding(const XMLCh* const encodingStr); /** * * Set the public identifier for this input source. This will update the * wrapped input source object. * *

The public identifier is always optional: if the application writer * includes one, it will be provided as part of the location information.

* * @param publicId The public identifier as a string. * @see Locator#getPublicId * @see SAXParseException#getPublicId * @see #getPublicId */ void setPublicId(const XMLCh* const publicId); /** * * Set the system identifier for this input source. This will update the * wrapped input source object. * *

The system id is always required. The public id may be used to map * to another system id, but the system id must always be present as a fall * back.

* *

If the system ID is a URL, it must be fully resolved.

* * @param systemId The system identifier as a string. * @see #getSystemId * @see Locator#getSystemId * @see SAXParseException#getSystemId */ void setSystemId(const XMLCh* const systemId); /** * * Indicates if the parser should issue fatal error if this input source * is not found. If set to false, the parser issue warning message instead. * This will update the wrapped input source object. * * @param flag True if the parser should issue fatal error if this input source is not found. * If set to false, the parser issue warning message instead. (Default: true) * * @see #getIssueFatalErrorIfNotFound */ void setIssueFatalErrorIfNotFound(const bool flag); //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- Wrapper4DOMLSInput(const Wrapper4DOMLSInput&); Wrapper4DOMLSInput& operator=(const Wrapper4DOMLSInput&); // ----------------------------------------------------------------------- // Private data members // ----------------------------------------------------------------------- bool fAdoptInputSource, fForceXMLChEncoding; DOMLSInput* fInputSource; DOMLSResourceResolver* fEntityResolver; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLSchemaDescription.cpp000644 000765 000024 00000003035 13241160335 024753 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: XMLSchemaDescription.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN XMLSchemaDescription::~XMLSchemaDescription() { } XMLSchemaDescription::XMLSchemaDescription(MemoryManager* const memMgr) :XMLGrammarDescription(memMgr) { } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_NOCREATE(XMLSchemaDescription) void XMLSchemaDescription::serialize(XSerializeEngine& serEng) { XMLGrammarDescription::serialize(serEng); //no data } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/BinOutputStream.cpp000644 000765 000024 00000003144 13241160335 024074 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BinOutputStream.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // BinOutputStream: Virtual destructor! // --------------------------------------------------------------------------- BinOutputStream::~BinOutputStream() { } // --------------------------------------------------------------------------- // BinOutputStream: Hidden Constructors // --------------------------------------------------------------------------- BinOutputStream::BinOutputStream() { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/XMLAttDefList.cpp000644 000765 000024 00000002454 13241160335 023356 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: XMLAttDefList.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_NOCREATE(XMLAttDefList) void XMLAttDefList::serialize(XSerializeEngine&) { //no data } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/LocalFileInputSource.hpp000644 000765 000024 00000013361 13241160334 025030 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: LocalFileInputSource.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_LOCALFILEINPUTSOURCE_HPP) #define XERCESC_INCLUDE_GUARD_LOCALFILEINPUTSOURCE_HPP #include XERCES_CPP_NAMESPACE_BEGIN class BinInputStream; /** * This class is a derivative of the standard InputSource class. It provides * for the parser access to data which is referenced via a local file path, * as apposed to remote file or URL. This is the most efficacious mechanism * by which local files can be parsed, since the parse knows that it refers * to a local file and will make no other attempts to interpret the passed * path. * * The path provided can either be a fully qualified path or a relative path. * If relative, it will be completed either relative to a passed base path * or relative to the current working directory of the process. * * As with all InputSource derivatives. The primary objective of an input * source is to create an input stream via which the parser can spool in * data from the referenced source. */ class XMLPARSER_EXPORT LocalFileInputSource : public InputSource { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * A local file input source requires a path to the file to load. This * can be provided either as a fully qualified path, a path relative to * the current working directly, or a path relative to a provided base * path. * * The completed path will become the system id of this input source. * The constructors don't take any public id for local files, but you * still set them via the parent class' setPublicId() method of course. * * This constructor takes an explicit base path and a possibly relative * path. If the relative path is seen to be fully qualified, it is used * as is. Otherwise, it is made relative to the passed base path. * * @param basePath The base path from which the passed relative path * will be based, if the relative part is indeed * relative. * * @param relativePath The relative part of the path. It can actually * be fully qualified, in which case it is taken * as is. * * @param manager Pointer to the memory manager to be used to * allocate objects. * * @exception XMLException If the path is relative and doesn't properly * resolve to a file. */ LocalFileInputSource ( const XMLCh* const basePath , const XMLCh* const relativePath , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * This constructor takes a single parameter which is the fully qualified * or relative path. If it is fully qualified, it is taken as is. If it is * relative, then it is completed relative to the current working directory * (or the equivalent on the local host machine.) * * The completed path will become the system id of this input source. * The constructors don't take any public id for local files, but you * still set them via the parent class' setPublicId() method of course. * * @param filePath The relative or fully qualified path. * * @param manager Pointer to the memory manager to be used to * allocate objects. * * @exception XMLException If the path is relative and doesn't properly * resolve to a file. */ LocalFileInputSource ( const XMLCh* const filePath , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** @name Destructor */ //@{ ~LocalFileInputSource(); //@} // ----------------------------------------------------------------------- // Virtual input source interface // ----------------------------------------------------------------------- /** @name Virtual methods */ //@{ /** * This method will return a binary input stream derivative that will * parse from the local file indicatedby the system id. * * @return A dynamically allocated binary input stream derivative that * can parse from the file indicated by the system id. */ virtual BinInputStream* makeStream() const; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- LocalFileInputSource(const LocalFileInputSource&); LocalFileInputSource& operator=(const LocalFileInputSource&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLNotationDecl.cpp000644 000765 000024 00000010023 13241160335 023725 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: XMLNotationDecl.cpp 679359 2008-07-24 11:15:19Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLNotationDecl: Constructors and operators // --------------------------------------------------------------------------- XMLNotationDecl::XMLNotationDecl(MemoryManager* const manager) : fId(0) , fNameSpaceId(0) , fName(0) , fPublicId(0) , fSystemId(0) , fBaseURI(0) , fMemoryManager(manager) { } typedef JanitorMemFunCall CleanupType; XMLNotationDecl::XMLNotationDecl( const XMLCh* const notName , const XMLCh* const pubId , const XMLCh* const sysId , const XMLCh* const baseURI , MemoryManager* const manager) : fId(0) , fNameSpaceId(0) , fName(0) , fPublicId(0) , fSystemId(0) , fBaseURI(0) , fMemoryManager(manager) { CleanupType cleanup(this, &XMLNotationDecl::cleanUp); try { fName = XMLString::replicate(notName, fMemoryManager); fPublicId = XMLString::replicate(pubId, fMemoryManager); fSystemId = XMLString::replicate(sysId, fMemoryManager); fBaseURI = XMLString::replicate(baseURI, fMemoryManager); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XMLNotationDecl::~XMLNotationDecl() { cleanUp(); } // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void XMLNotationDecl::setName(const XMLCh* const notName) { // Clean up the current name stuff and replicate the passed name if (fName) fMemoryManager->deallocate(fName); fName = XMLString::replicate(notName, fMemoryManager); } // --------------------------------------------------------------------------- // XMLNotationDecl: Private helper methods // --------------------------------------------------------------------------- void XMLNotationDecl::cleanUp() { fMemoryManager->deallocate(fName); fMemoryManager->deallocate(fPublicId); fMemoryManager->deallocate(fSystemId); fMemoryManager->deallocate(fBaseURI); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(XMLNotationDecl) void XMLNotationDecl::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng.writeSize (fId); serEng<>fNameSpaceId; serEng.readString(fName); serEng.readString(fPublicId); serEng.readString(fSystemId); serEng.readString(fBaseURI); } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/XMLDocumentHandler.hpp000644 000765 000024 00000025135 13241160335 024435 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLDocumentHandler.hpp 673679 2008-07-03 13:50:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLDOCUMENTHANDLER_HPP) #define XERCESC_INCLUDE_GUARD_XMLDOCUMENTHANDLER_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLElementDecl; class XMLEntityDecl; /** * This abstract class provides the interface for the scanner to return * XML document information up to the parser as it scans through the * document. * * The interface is very similar to org.sax.DocumentHandler, but * has some extra methods required to get all the data out. */ class XMLPARSER_EXPORT XMLDocumentHandler { public: // ----------------------------------------------------------------------- // Constructors are hidden, just the virtual destructor is exposed // ----------------------------------------------------------------------- /** @name Destructor */ //@{ virtual ~XMLDocumentHandler() { } //@} /** @name The document handler interface */ //@{ /** Receive notification of character data. * *

The scanner will call this method to report each chunk of * character data. The scanner may return all contiguous character * data in a single chunk, or they may split it into several * chunks; however, all of the characters in any single event * will come from the same external entity, so that the Locator * provides useful information.

* *

The parser must not attempt to read from the array * outside of the specified range.

* * @param chars The content (characters) between markup from the XML * document. * @param length The number of characters to read from the array. * @param cdataSection Indicates that this data is inside a CDATA * section. * @see #ignorableWhitespace * @see Locator */ virtual void docCharacters ( const XMLCh* const chars , const XMLSize_t length , const bool cdataSection ) = 0; /** Receive notification of comments in the XML content being parsed. * * This scanner will call this method for any comments found in the * content of the document. * * @param comment The text of the comment. */ virtual void docComment ( const XMLCh* const comment ) = 0; /** Receive notification of PI's parsed in the XML content. * * The scanner will call this method for any PIs it finds within the * content of the document. * * @param target The name of the PI. * @param data The body of the PI. This may be an empty string since * the body is optional. */ virtual void docPI ( const XMLCh* const target , const XMLCh* const data ) = 0; /** Receive notification after the scanner has parsed the end of the * document. * * The scanner will call this method when the current document has been * fully parsed. The handler may use this opportunity to do something with * the data, clean up temporary data, etc... */ virtual void endDocument() = 0; /** Receive notification of the end of an element. * * This method is called when scanner encounters the end of element tag. * There will be a corresponding startElement() event for every * endElement() event, but not necessarily the other way around. For * empty tags, there is only a startElement() call. * * @param elemDecl The name of the element whose end tag was just * parsed. * @param uriId The ID of the URI in the URI pool (only valid if * name spaces is enabled) * @param isRoot Indicates if this is the root element. * @param prefixName The string representing the prefix name */ virtual void endElement ( const XMLElementDecl& elemDecl , const unsigned int uriId , const bool isRoot , const XMLCh* const prefixName = 0 ) = 0; /** Receive notification when a referenced entity's content ends * * This method is called when scanner encounters the end of an entity * reference. * * @param entDecl The name of the entity reference just scanned. */ virtual void endEntityReference ( const XMLEntityDecl& entDecl ) = 0; /** Receive notification of ignorable whitespace in element content. * *

Validating Parsers must use this method to report each chunk * of ignorable whitespace (see the W3C XML 1.0 recommendation, * section 2.10): non-validating parsers may also use this method * if they are capable of parsing and using content models.

* *

The scanner may return all contiguous whitespace in a single * chunk, or it may split it into several chunks; however, all of * the characters in any single event will come from the same * external entity, so that the Locator provides useful * information.

* *

The parser must not attempt to read from the array * outside of the specified range.

* * @param chars The whitespace characters from the XML document. * @param length The number of characters to read from the array. * @param cdataSection Indicates that this data is inside a CDATA * section. * @see #docCharacters */ virtual void ignorableWhitespace ( const XMLCh* const chars , const XMLSize_t length , const bool cdataSection ) = 0; /** Reset the document handler's state, if required * * This method is used to give the registered document handler a * chance to reset itself. Its called by the scanner at the start of * every parse. */ virtual void resetDocument() = 0; /** Receive notification of the start of a new document * * This method is the first callback called the scanner at the * start of every parse. This is before any content is parsed. */ virtual void startDocument() = 0; /** Receive notification of a new start tag * * This method is called when scanner encounters the start of an element tag. * All elements must always have a startElement() tag. Empty tags will * only have the startElement() tag and no endElement() tag. * * @param elemDecl The name of the element whose start tag was just * parsed. * @param uriId The ID of the URI in the URI pool (only valid if * name spaces is enabled) * @param prefixName The string representing the prefix name * @param attrList List of attributes in the element * @param attrCount Count of the attributes in the element * @param isEmpty Indicates if the element is empty, in which case * you should not expect an endElement() event. * @param isRoot Indicates if this is the root element. */ virtual void startElement ( const XMLElementDecl& elemDecl , const unsigned int uriId , const XMLCh* const prefixName , const RefVectorOf& attrList , const XMLSize_t attrCount , const bool isEmpty , const bool isRoot ) = 0; /** Receive notification when the scanner hits an entity reference. * * This is currently useful only to DOM parser configurations as SAX * does not provide any api to return this information. * * @param entDecl The name of the entity that was referenced. */ virtual void startEntityReference(const XMLEntityDecl& entDecl) = 0; /** Receive notification of an XML declaration * * Currently neither DOM nor SAX provide API's to return back this * information. * * @param versionStr The value of the version pseudoattribute * of the XML decl. * @param encodingStr The value of the encoding pseudoattribute * of the XML decl. * @param standaloneStr The value of the standalone * pseudoattribute of the XML decl. * @param autoEncodingStr The encoding string auto-detected by the * scanner. In absence of any 'encoding' attribute in the * XML decl, the XML standard specifies how a parser can * auto-detect. If there is no encodingStr * this is what will be used to try to decode the file. */ virtual void XMLDecl ( const XMLCh* const versionStr , const XMLCh* const encodingStr , const XMLCh* const standaloneStr , const XMLCh* const autoEncodingStr ) = 0; //@} protected : // ----------------------------------------------------------------------- // Hidden Constructors // ----------------------------------------------------------------------- XMLDocumentHandler() { } private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLDocumentHandler(const XMLDocumentHandler&); XMLDocumentHandler& operator=(const XMLDocumentHandler&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLBuffer.cpp000644 000765 000024 00000006352 13241160335 022565 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: XMLBuffer.cpp 932889 2010-04-11 13:10:10Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLBuffer: Buffer management // --------------------------------------------------------------------------- void XMLBuffer::ensureCapacity(const XMLSize_t extraNeeded) { // If we can't handle it, try doubling the buffer size. XMLSize_t newCap = (fIndex + extraNeeded) * 2; // If a maximum size is set, and double the current buffer size exceeds that // maximum, first check if the maximum size will accomodate the extra needed. if (fFullHandler && (newCap > fFullSize)) { // If the maximum buffer size accomodates the extra needed, resize to // the maximum if (fIndex + extraNeeded <= fFullSize) { newCap = fFullSize; } // Otherwise, allow the registered full-handler to try to empty the buffer. // If it claims success, and we can accommodate the extra needed in the buffer // to be expanded, resize to the maximum // Note the order of evaluation: bufferFull() has the intentional side-effect // of modifying fIndex. else if (fFullHandler->bufferFull(*this) && (fIndex + extraNeeded <= fFullSize)) { newCap = fFullSize; } // Finally, if the full-handler failed, or the buffer (of maximum size) // still can't accomodate the extra needed, we must fail. else ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Array_BadNewSize, fMemoryManager); } // Note the previous if block can modify newCap, so we may not need to allocate // at all. if (newCap > fCapacity) { // Allocate new buffer XMLCh* newBuf = (XMLCh*) fMemoryManager->allocate((newCap+1) * sizeof(XMLCh)); //new XMLCh[newCap+1]; // Copy over the old stuff memcpy(newBuf, fBuffer, fIndex * sizeof(XMLCh)); // Clean up old buffer and store new stuff fMemoryManager->deallocate(fBuffer); //delete [] fBuffer; fBuffer = newBuf; fCapacity = newCap; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/XMLAttDef.hpp000644 000765 000024 00000042566 13241160334 022536 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLAttDef.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLATTDEF_HPP) #define XERCESC_INCLUDE_GUARD_XMLATTDEF_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLAttr; /** Represents the core information of an attribute definition * * This class defines the basic characteristics of an attribute, no matter * what type of validator is used. If a particular schema associates more * information with an attribute it will create a derivative of this class. * So this class provides an abstract way to get basic information on * attributes from any type of validator. * * This class supports keyed collection semantics on the fully qualified * attribute name, by providing a getKey() method to extract the key string. * getKey(), in this case, just calls the virtual method getFullName() to * get the fully qualified name, as defined by the derived class. * * Note that the 'value' of an attribute type definition is the default or * of fixed value given to it in its definition. If the attribute is of the * enumerated or notation type, it will have an 'enumeration value' as well * which is a space separated list of its possible vlaues. */ class XMLPARSER_EXPORT XMLAttDef : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Class specific types // // AttTypes // The list of possible types that an attribute can have, according // to the XML 1.0 spec and schema. // // DefAttTypes // The modifiers that an attribute decl can have, which indicates // whether instances of that attributes are required, implied, etc.. // // CreateReasons // This type is used to store how an attribute declaration got into // the elementdecl's attribute pool. // // ----------------------------------------------------------------------- enum AttTypes { CData = 0 , ID = 1 , IDRef = 2 , IDRefs = 3 , Entity = 4 , Entities = 5 , NmToken = 6 , NmTokens = 7 , Notation = 8 , Enumeration = 9 , Simple = 10 , Any_Any = 11 , Any_Other = 12 , Any_List = 13 , AttTypes_Count , AttTypes_Min = 0 , AttTypes_Max = 13 , AttTypes_Unknown = -1 }; enum DefAttTypes { Default = 0 , Fixed = 1 , Required = 2 , Required_And_Fixed = 3 , Implied = 4 , ProcessContents_Skip = 5 , ProcessContents_Lax = 6 , ProcessContents_Strict = 7 , Prohibited = 8 , DefAttTypes_Count , DefAttTypes_Min = 0 , DefAttTypes_Max = 8 , DefAttTypes_Unknown = -1 }; enum CreateReasons { NoReason , JustFaultIn }; // ----------------------------------------------------------------------- // Public static data members // ----------------------------------------------------------------------- static const unsigned int fgInvalidAttrId; // ----------------------------------------------------------------------- // Public, static methods // ----------------------------------------------------------------------- /** @name Public, static methods */ //@{ /** Get a string representation of the passed attribute type enum * * This method allows you to get a textual representation of an attribute * type, mostly for debug or display. * * @param attrType The attribute type value to get the string for. * @param manager The MemoryManager to use to allocate objects * @return A const pointer to the static string that holds the text * description of the passed type. */ static const XMLCh* getAttTypeString(const AttTypes attrType , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Get a string representation of the passed def attribute type enum * * This method allows you to get a textual representation of an default * attributetype, mostly for debug or display. * * @param attrType The default attribute type value to get the string for. * @param manager The MemoryManager to use to allocate objects * @return A const pointer to the static string that holds the text * description of the passed default type. */ static const XMLCh* getDefAttTypeString(const DefAttTypes attrType , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); //@} // ----------------------------------------------------------------------- // Destructor // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Destructor */ virtual ~XMLAttDef(); //@} // ----------------------------------------------------------------------- // The virtual attribute def interface // ----------------------------------------------------------------------- /** @name Virtual interface */ //@{ /** Get the full name of this attribute type * * The derived class should return a const pointer to the full name of * this attribute. This will vary depending on the type of validator in * use. * * @return A const pointer to the full name of this attribute type. */ virtual const XMLCh* getFullName() const = 0; /** * The derived class should implement any cleaning up required between * each use of an instance of this class for validation */ virtual void reset() = 0; //@} // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** @name Getter methods */ //@{ /** Get the default type of this attribute type * * This method returns the 'default type' of the attribute. Default * type in this case refers to the XML concept of a default type for * an attribute, i.e. \#FIXED, \#IMPLIED, etc... * * @return The default type enum for this attribute type. */ DefAttTypes getDefaultType() const; /** Get the enumeration value (if any) of this attribute type * * If the attribute is of an enumeration or notation type, then this * method will return a const reference to a string that contains the * space separated values that can the attribute can have. * * @return A const pointer to a string that contains the space separated * legal values for this attribute. */ const XMLCh* getEnumeration() const; /** Get the pool id of this attribute type * * This method will return the id of this attribute in the validator's * attribute pool. It was set by the validator when this attribute was * created. * * @return The pool id of this attribute type. */ XMLSize_t getId() const; /** Get the type of this attribute * * Gets the type of this attribute. This type is represented by an enum * that converts the types of attributes allowed by XML, e.g. CDATA, NMTOKEN, * NOTATION, etc... * * @return The attribute type enumeration value for this type of * attribute. */ AttTypes getType() const; /** Get the default/fixed value of this attribute (if any.) * * If the attribute defined a default/fixed value, then it is stored * and this method will retrieve it. If it has non, then a null pointer * is returned. * * @return A const pointer to the default/fixed value for this attribute * type. */ const XMLCh* getValue() const; /** Get the create reason for this attribute * * This method returns an enumeration which indicates why this attribute * declaration exists. * * @return An enumerated value that indicates the reason why this attribute * was added to the attribute table. */ CreateReasons getCreateReason() const; /** Indicate whether this attribute has been declared externally * * This method returns a boolean that indicates whether this attribute * has been declared externally. * * @return true if this attribute has been declared externally, else false. */ bool isExternal() const; /** Get the plugged-in memory manager * * This method returns the plugged-in memory manager user for dynamic * memory allocation/deallocation. * * @return the plugged-in memory manager */ MemoryManager* getMemoryManager() const; //@} // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** @name Setter methods */ //@{ /** Set the default attribute type * * This method sets the default attribute type for this attribute. * This setting controls whether the attribute is required, fixed, * implied, etc... * * @param newValue The new default attribute to set */ void setDefaultType(const XMLAttDef::DefAttTypes newValue); /** Set the pool id for this attribute type. * * This method sets the pool id of this attribute type. This is usually * called by the validator that creates the actual instance (which is of * a derived type known only by the validator.) * * @param newId The new pool id to set. */ void setId(const XMLSize_t newId); /** Set the type of this attribute type. * * This method will set the type of the attribute. The type of an attribute * controls how it is normalized and what kinds of characters it can hold. * * @param newValue The new attribute type to set */ void setType(const XMLAttDef::AttTypes newValue); /** Set the default/fixed value of this attribute type. * * This method set the fixed/default value for the attribute. This value * will be used when instances of this attribute type are faulted in. It * must be a valid value for the type set by setType(). If the * type is enumeration or notation, this must be one of the valid values * set in the setEnumeration() call. * * @param newValue The new fixed/default value to set. */ void setValue(const XMLCh* const newValue); /** Set the enumerated value of this attribute type. * * This method sets the enumerated/notation value list for this attribute * type. It is a space separated set of possible values. These values must * meet the constrains of the XML spec for such values of this type of * attribute. This should only be set if the setType() method is used to * set the type to the enumeration or notation types. * * @param newValue The new enumerated/notation value list to set. */ void setEnumeration(const XMLCh* const newValue); /** Update the create reason for this attribute type. * * This method will update the 'create reason' field for this attribute * decl object. * * @param newReason The new create reason. */ void setCreateReason(const CreateReasons newReason); /** * Set the attribute decl to indicate external declaration * * @param aValue The new value to indicate external declaration. */ void setExternalAttDeclaration(const bool aValue); //@} /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLAttDef) protected : // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- XMLAttDef ( const AttTypes type = CData , const DefAttTypes defType= Implied , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); XMLAttDef ( const XMLCh* const attValue , const AttTypes type , const DefAttTypes defType , const XMLCh* const enumValues = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLAttDef(const XMLAttDef&); XMLAttDef& operator=(const XMLAttDef&); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void cleanUp(); // ----------------------------------------------------------------------- // Private data members // // fDefaultType // Indicates what, if any, default stuff this attribute has. // // fEnumeration // If its an enumeration, this is the list of values as space // separated values. // // fId // This is the unique id of this attribute, given to it when its put // into the validator's attribute decl pool. It defaults to the // special value XMLAttrDef::fgInvalidAttrId. // // fType // The type of attribute, which is one of the AttTypes values. // // fValue // This is the value of the attribute, which is the default value // given in the attribute declaration. // // fCreateReason // This flag tells us how this attribute got created. Sometimes even // the attribute was not declared for the element, we want to fault // fault it into the pool to avoid lots of redundant errors. // // fExternalAttribute // This flag indicates whether or not the attribute was declared externally. // ----------------------------------------------------------------------- DefAttTypes fDefaultType; AttTypes fType; CreateReasons fCreateReason; bool fExternalAttribute; XMLSize_t fId; XMLCh* fValue; XMLCh* fEnumeration; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // Getter methods // --------------------------------------------------------------------------- inline XMLAttDef::DefAttTypes XMLAttDef::getDefaultType() const { return fDefaultType; } inline const XMLCh* XMLAttDef::getEnumeration() const { return fEnumeration; } inline XMLSize_t XMLAttDef::getId() const { return fId; } inline XMLAttDef::AttTypes XMLAttDef::getType() const { return fType; } inline const XMLCh* XMLAttDef::getValue() const { return fValue; } inline XMLAttDef::CreateReasons XMLAttDef::getCreateReason() const { return fCreateReason; } inline bool XMLAttDef::isExternal() const { return fExternalAttribute; } inline MemoryManager* XMLAttDef::getMemoryManager() const { return fMemoryManager; } // --------------------------------------------------------------------------- // XMLAttDef: Setter methods // --------------------------------------------------------------------------- inline void XMLAttDef::setDefaultType(const XMLAttDef::DefAttTypes newValue) { fDefaultType = newValue; } inline void XMLAttDef::setEnumeration(const XMLCh* const newValue) { if (fEnumeration) fMemoryManager->deallocate(fEnumeration); fEnumeration = XMLString::replicate(newValue, fMemoryManager); } inline void XMLAttDef::setId(const XMLSize_t newId) { fId = newId; } inline void XMLAttDef::setType(const XMLAttDef::AttTypes newValue) { fType = newValue; } inline void XMLAttDef::setValue(const XMLCh* const newValue) { if (fValue) fMemoryManager->deallocate(fValue); fValue = XMLString::replicate(newValue, fMemoryManager); } inline void XMLAttDef::setCreateReason(const XMLAttDef::CreateReasons newReason) { fCreateReason = newReason; } inline void XMLAttDef::setExternalAttDeclaration(const bool aValue) { fExternalAttribute = aValue; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLErrorCodes.hpp000644 000765 000024 00000037117 13241160334 023432 0ustar00scantorstaff000000 000000 // This file is generated, don't edit it!! #if !defined(XERCESC_INCLUDE_GUARD_ERRHEADER_XMLErrs) #define XERCESC_INCLUDE_GUARD_ERRHEADER_XMLErrs #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLErrs { public : enum Codes { NoError = 0 , W_LowBounds = 1 , NotationAlreadyExists = 2 , AttListAlreadyExists = 3 , ContradictoryEncoding = 4 , UndeclaredElemInCM = 5 , UndeclaredElemInAttList = 6 , XMLException_Warning = 7 , XIncludeResourceErrorWarning = 8 , XIncludeCannotOpenFile = 9 , XIncludeIncludeFailedResourceError = 10 , W_HighBounds = 11 , E_LowBounds = 12 , FeatureUnsupported = 13 , TopLevelNoNameComplexType = 14 , TopLevelNoNameAttribute = 15 , NoNameRefAttribute = 16 , NoNameRefElement = 17 , NoNameRefGroup = 18 , NoNameRefAttGroup = 19 , AnonComplexTypeWithName = 20 , AnonSimpleTypeWithName = 21 , InvalidElementContent = 22 , SimpleTypeContentError = 23 , ExpectedSimpleTypeInList = 24 , ListUnionRestrictionError = 25 , SimpleTypeDerivationByListError = 26 , ExpectedSimpleTypeInRestriction = 27 , DuplicateFacet = 28 , ExpectedSimpleTypeInUnion = 29 , EmptySimpleTypeContent = 30 , InvalidSimpleContent = 31 , UnspecifiedBase = 32 , InvalidComplexContent = 33 , SchemaElementContentError = 34 , ContentError = 35 , UnknownSimpleType = 36 , UnknownComplexType = 37 , UnresolvedPrefix = 38 , RefElementNotFound = 39 , TypeNotFound = 40 , TopLevelAttributeNotFound = 41 , InvalidChildInComplexType = 42 , BaseTypeNotFound = 43 , DatatypeValidatorCreationError = 44 , InvalidChildFollowingSimpleContent = 45 , InvalidChildFollowingConplexContent = 46 , AttributeDefaultFixedValue = 47 , NotOptionalDefaultAttValue = 48 , DuplicateAttribute = 49 , AttributeWithTypeAndSimpleType = 50 , AttributeSimpleTypeNotFound = 51 , ElementWithFixedAndDefault = 52 , InvalidDeclarationName = 53 , ElementWithTypeAndAnonType = 54 , NotSimpleOrMixedElement = 55 , DisallowedSimpleTypeExtension = 56 , InvalidSimpleContentBase = 57 , InvalidComplexTypeBase = 58 , InvalidChildInSimpleContent = 59 , InvalidChildInComplexContent = 60 , AnnotationError = 61 , DisallowedBaseDerivation = 62 , InvalidBlockValue = 63 , InvalidFinalValue = 64 , InvalidSubstitutionGroupElement = 65 , SubstitutionGroupTypeMismatch = 66 , DuplicateElementDeclaration = 67 , InvalidAttValue = 68 , AttributeRefContentError = 69 , DuplicateRefAttribute = 70 , ForbiddenDerivationByRestriction = 71 , ForbiddenDerivationByExtension = 72 , BaseNotComplexType = 73 , ImportNamespaceDifference = 74 , DeclarationNoSchemaLocation = 75 , IncludeNamespaceDifference = 76 , OnlyAnnotationExpected = 77 , InvalidAttributeContent = 78 , AttributeRequiredGlobal = 79 , AttributeRequiredLocal = 80 , AttributeDisallowedGlobal = 81 , AttributeDisallowedLocal = 82 , InvalidMin2MaxOccurs = 83 , AnyAttributeContentError = 84 , NoNameGlobalElement = 85 , NoCircularDefinition = 86 , DuplicateGlobalType = 87 , DuplicateGlobalDeclaration = 88 , WS_CollapseExpected = 89 , Import_1_1 = 90 , Import_1_2 = 91 , ElemIDValueConstraint = 92 , NoNotationType = 93 , EmptiableMixedContent = 94 , EmptyComplexRestrictionDerivation = 95 , MixedOrElementOnly = 96 , InvalidContentRestriction = 97 , ForbiddenDerivation = 98 , AtomicItemType = 99 , GroupContentError = 100 , AttGroupContentError = 101 , MinMaxOnGroupChild = 102 , DeclarationNotFound = 103 , AllContentLimited = 104 , BadMinMaxAllCT = 105 , BadMinMaxAllElem = 106 , DuplicateAttInDerivation = 107 , NotExpressibleWildCardIntersection = 108 , BadAttDerivation_1 = 109 , BadAttDerivation_2 = 110 , BadAttDerivation_3 = 111 , BadAttDerivation_4 = 112 , BadAttDerivation_5 = 113 , BadAttDerivation_6 = 114 , BadAttDerivation_7 = 115 , BadAttDerivation_8 = 116 , BadAttDerivation_9 = 117 , AllContentError = 118 , RedefineNamespaceDifference = 119 , Redefine_InvalidSimpleType = 120 , Redefine_InvalidSimpleTypeBase = 121 , Redefine_InvalidComplexType = 122 , Redefine_InvalidComplexTypeBase = 123 , Redefine_InvalidGroupMinMax = 124 , Redefine_DeclarationNotFound = 125 , Redefine_GroupRefCount = 126 , Redefine_AttGroupRefCount = 127 , Redefine_InvalidChild = 128 , Notation_DeclNotFound = 129 , IC_DuplicateDecl = 130 , IC_BadContent = 131 , IC_KeyRefReferNotFound = 132 , IC_KeyRefCardinality = 133 , IC_XPathExprMissing = 134 , AttUseCorrect = 135 , AttDeclPropCorrect3 = 136 , AttDeclPropCorrect5 = 137 , AttGrpPropCorrect3 = 138 , InvalidTargetNSValue = 139 , XMLException_Error = 140 , InvalidRedefine = 141 , InvalidNSReference = 142 , NotAllContent = 143 , InvalidAnnotationContent = 144 , InvalidFacetName = 145 , InvalidXMLSchemaRoot = 146 , CircularSubsGroup = 147 , ELTSchemaNS = 148 , InvalidAttTNS = 149 , NSDeclInvalid = 150 , DOMLevel1Node = 151 , DuplicateAnyAttribute = 152 , AnyAttributeBeforeAttribute = 153 , E_HighBounds = 154 , F_LowBounds = 155 , EntityExpansionLimitExceeded = 156 , ExpectedCommentOrCDATA = 157 , ExpectedAttrName = 158 , ExpectedNotationName = 159 , NoRepInMixed = 160 , ExpectedDefAttrDecl = 161 , ExpectedEqSign = 162 , ExpectedElementName = 163 , CommentsMustStartWith = 164 , InvalidDocumentStructure = 165 , ExpectedDeclString = 166 , BadXMLVersion = 167 , UnsupportedXMLVersion = 168 , UnterminatedXMLDecl = 169 , BadXMLEncoding = 170 , BadStandalone = 171 , UnterminatedComment = 172 , PINameExpected = 173 , UnterminatedPI = 174 , InvalidCharacter = 175 , UnterminatedStartTag = 176 , ExpectedAttrValue = 177 , UnterminatedEndTag = 178 , ExpectedAttributeType = 179 , ExpectedEndOfTagX = 180 , ExpectedMarkup = 181 , NotValidAfterContent = 182 , ExpectedComment = 183 , ExpectedCommentOrPI = 184 , ExpectedWhitespace = 185 , NoRootElemInDOCTYPE = 186 , ExpectedQuotedString = 187 , ExpectedPublicId = 188 , InvalidPublicIdChar = 189 , UnterminatedDOCTYPE = 190 , InvalidCharacterInIntSubset = 191 , UnexpectedWhitespace = 192 , InvalidCharacterInAttrValue = 193 , ExpectedMarkupDecl = 194 , TextDeclNotLegalHere = 195 , ConditionalSectInIntSubset = 196 , ExpectedPEName = 197 , UnterminatedEntityDecl = 198 , InvalidCharacterRef = 199 , UnterminatedCharRef = 200 , ExpectedEntityRefName = 201 , EntityNotFound = 202 , NoUnparsedEntityRefs = 203 , UnterminatedEntityRef = 204 , RecursiveEntity = 205 , PartialMarkupInEntity = 206 , UnterminatedElementDecl = 207 , ExpectedContentSpecExpr = 208 , ExpectedAsterisk = 209 , UnterminatedContentModel = 210 , ExpectedSystemOrPublicId = 211 , UnterminatedNotationDecl = 212 , ExpectedSeqChoiceLeaf = 213 , ExpectedChoiceOrCloseParen = 214 , ExpectedSeqOrCloseParen = 215 , ExpectedEnumValue = 216 , ExpectedEnumSepOrParen = 217 , UnterminatedEntityLiteral = 218 , MoreEndThanStartTags = 219 , ExpectedOpenParen = 220 , AttrAlreadyUsedInSTag = 221 , BracketInAttrValue = 222 , Expected2ndSurrogateChar = 223 , ExpectedEndOfConditional = 224 , ExpectedIncOrIgn = 225 , ExpectedINCLUDEBracket = 226 , UnexpectedEOE = 227 , PEPropogated = 228 , ExtraCloseSquare = 229 , PERefInMarkupInIntSubset = 230 , EntityPropogated = 231 , ExpectedNumericalCharRef = 232 , ExpectedOpenSquareBracket = 233 , BadSequenceInCharData = 234 , IllegalSequenceInComment = 235 , UnterminatedCDATASection = 236 , ExpectedNDATA = 237 , NDATANotValidForPE = 238 , HexRadixMustBeLowerCase = 239 , DeclStringRep = 240 , DeclStringsInWrongOrder = 241 , NoExtRefsInAttValue = 242 , XMLDeclMustBeLowerCase = 243 , ExpectedEntityValue = 244 , BadDigitForRadix = 245 , EndedWithTagsOnStack = 246 , NestedCDATA = 247 , UnknownPrefix = 248 , PartialTagMarkupError = 249 , EmptyMainEntity = 250 , CDATAOutsideOfContent = 251 , Unexpected2ndSurrogateChar = 252 , NoPIStartsWithXML = 253 , XMLDeclMustBeFirst = 254 , XMLVersionRequired = 255 , StandaloneNotLegal = 256 , EncodingRequired = 257 , ColonNotLegalWithNS = 258 , XMLException_Fatal = 259 , BadSchemaLocation = 260 , SchemaScanFatalError = 261 , IllegalRefInStandalone = 262 , PEBetweenDecl = 263 , NoEmptyStrNamespace = 264 , NoUseOfxmlnsAsPrefix = 265 , NoUseOfxmlnsURI = 266 , PrefixXMLNotMatchXMLURI = 267 , XMLURINotMatchXMLPrefix = 268 , NoXMLNSAsElementPrefix = 269 , CT_SimpleTypeChildRequired = 270 , InvalidRootElemInDOCTYPE = 271 , InvalidElementName = 272 , InvalidAttrName = 273 , InvalidEntityRefName = 274 , DuplicateDocTypeDecl = 275 , XIncludeOrphanFallback = 276 , XIncludeNoHref = 277 , XIncludeXPointerNotSupported = 278 , XIncludeInvalidParseVal = 279 , XIncludeMultipleFallbackElems = 280 , XIncludeIncludeFailedNoFallback = 281 , XIncludeCircularInclusionLoop = 282 , XIncludeCircularInclusionDocIncludesSelf = 283 , XIncludeDisallowedChild = 284 , XIncludeConflictingNotation = 285 , XIncludeConflictingEntity = 286 , F_HighBounds = 287 }; static bool isFatal(const XMLErrs::Codes toCheck) { return ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds)); } static bool isWarning(const XMLErrs::Codes toCheck) { return ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds)); } static bool isError(const XMLErrs::Codes toCheck) { return ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds)); } static XMLErrorReporter::ErrTypes errorType(const XMLErrs::Codes toCheck) { if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds)) return XMLErrorReporter::ErrType_Warning; else if ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds)) return XMLErrorReporter::ErrType_Fatal; else if ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds)) return XMLErrorReporter::ErrType_Error; return XMLErrorReporter::ErrTypes_Unknown; } static DOMError::ErrorSeverity DOMErrorType(const XMLErrs::Codes toCheck) { if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds)) return DOMError::DOM_SEVERITY_WARNING; else if ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds)) return DOMError::DOM_SEVERITY_FATAL_ERROR; else return DOMError::DOM_SEVERITY_ERROR; } private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLErrs(); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/Wrapper4InputSource.hpp000644 000765 000024 00000022210 13241160335 024674 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Wrapper4InputSource.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_WRAPPER4INPUTSOURCE_HPP) #define XERCESC_INCLUDE_GUARD_WRAPPER4INPUTSOURCE_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class InputSource; /** * Wrap a SAX InputSource object and make it behave like DOMLSInput. */ class XMLPARSER_EXPORT Wrapper4InputSource: public DOMLSInput { public: /** @name Constructors and Destructor */ //@{ /** * Constructor * * Wrap a SAX InputSource and make it behave like a DOMLSInput. * By default, the wrapper will adopt the SAX InputSource that is wrapped. * * @param inputSource The SAX InputSource to be wrapped * @param adoptFlag Indicates if the wrapper should adopt the wrapped * SAX InputSource. Default is true. * @param manager The MemoryManager to use to allocate objects */ Wrapper4InputSource(InputSource* const inputSource , const bool adoptFlag = true , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Destructor * */ virtual ~Wrapper4InputSource(); //@} // ----------------------------------------------------------------------- /** @name Virtual input source interface */ //@{ /** * This wrapper doesn't support string data * */ virtual const XMLCh* getStringData() const; /** * Makes the byte stream for this input source. * *

The function will call the makeStream of the wrapped input source. * The returned stream becomes the parser's property.

* * @see InputSource */ virtual InputSource* getByteStream() const; //@} // ----------------------------------------------------------------------- /** @name Getter methods */ //@{ /** * An input source can be set to force the parser to assume a particular * encoding for the data that input source represents, via the setEncoding() * method. This method will delegate to the wrapped input source to return * name of the encoding that is to be forced. If the encoding has never * been forced, it returns a null pointer. * * @return The forced encoding, or null if none was supplied. * @see #setEncoding */ virtual const XMLCh* getEncoding() const; /** * Get the public identifier for this input source. Delegated to the * wrapped input source object. * * @return The public identifier, or null if none was supplied. * @see #setPublicId */ const XMLCh* getPublicId() const; /** * Get the system identifier for this input source. Delegated to the * wrapped input source object. * *

If the system ID is a URL, it will be fully resolved.

* * @return The system identifier. * @see #setSystemId */ const XMLCh* getSystemId() const; /** * Get the base URI to be used for resolving relative URIs to absolute * URIs. If the baseURI is itself a relative URI, the behavior is * implementation dependent. Delegated to the wrapped intput source * object. * * @return The base URI. * @see #setBaseURI * @since DOM Level 3 */ const XMLCh* getBaseURI() const; /** * Get the flag that indicates if the parser should issue fatal error if this input source * is not found. Delegated to the wrapped input source object. * * @return True if the parser should issue fatal error if this input source is not found. * False if the parser issue warning message instead. * @see #setIssueFatalErrorIfNotFound */ bool getIssueFatalErrorIfNotFound() const; //@} // ----------------------------------------------------------------------- /** @name Setter methods */ //@{ /** * This wrapper only exposes the given InputSource, no setting allowed * */ virtual void setStringData(const XMLCh* data); /** * This wrapper only exposes the given InputSource, no setting allowed * */ virtual void setByteStream(InputSource* stream); /** * Set the encoding which will be required for use with the XML text read * via a stream opened by this input source. This will update the wrapped * input source object. * *

This is usually not set, allowing the encoding to be sensed in the * usual XML way. However, in some cases, the encoding in the file is known * to be incorrect because of intermediate transcoding, for instance * encapsulation within a MIME document. * * @param encodingStr The name of the encoding to force. */ void setEncoding(const XMLCh* const encodingStr); /** * Set the public identifier for this input source. This will update the * wrapped input source object. * *

The public identifier is always optional: if the application writer * includes one, it will be provided as part of the location information.

* * @param publicId The public identifier as a string. * @see Locator#getPublicId * @see SAXParseException#getPublicId * @see #getPublicId */ void setPublicId(const XMLCh* const publicId); /** * Set the system identifier for this input source. This will update the * wrapped input source object. * *

The system id is always required. The public id may be used to map * to another system id, but the system id must always be present as a fall * back.

* *

If the system ID is a URL, it must be fully resolved.

* * @param systemId The system identifier as a string. * @see #getSystemId * @see Locator#getSystemId * @see SAXParseException#getSystemId */ void setSystemId(const XMLCh* const systemId); /** * Set the base URI to be used for resolving relative URIs to absolute * URIs. If the baseURI is itself a relative URI, the behavior is * implementation dependent. This will update the wrapped input source * object. * * @param baseURI The base URI. * @see #getBaseURI * @since DOM Level 3 */ void setBaseURI(const XMLCh* const baseURI); /** * Indicates if the parser should issue fatal error if this input source * is not found. If set to false, the parser issue warning message * instead. This will update the wrapped input source object. * * @param flag True if the parser should issue fatal error if this input * source is not found. * If set to false, the parser issue warning message instead. * (Default: true) * * @see #getIssueFatalErrorIfNotFound */ void setIssueFatalErrorIfNotFound(bool flag); /** * Called to indicate that this DOMInputSource is no longer in use * and that the implementation may relinquish any resources associated with it. * * Access to a released object will lead to unexpected result. */ void release(); //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- Wrapper4InputSource(const Wrapper4InputSource&); Wrapper4InputSource& operator=(const Wrapper4InputSource&); // ----------------------------------------------------------------------- // Private data members // ----------------------------------------------------------------------- bool fAdoptInputSource; InputSource* fInputSource; }; // --------------------------------------------------------------------------- // Wrapper4InputSource: Getter methods // --------------------------------------------------------------------------- inline const XMLCh* Wrapper4InputSource::getBaseURI() const { return 0; // REVISIT - should we return an empty string? } inline const XMLCh* Wrapper4InputSource::getStringData() const { return 0; } // --------------------------------------------------------------------------- // Wrapper4InputSource: Setter methods // --------------------------------------------------------------------------- inline void Wrapper4InputSource::setBaseURI(const XMLCh* const) { } inline void Wrapper4InputSource::setStringData(const XMLCh*) { } inline void Wrapper4InputSource::setByteStream(InputSource*) { } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLGrammarDescription.cpp000644 000765 000024 00000002741 13241160335 025144 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: XMLGrammarDescription.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN XMLGrammarDescription::~XMLGrammarDescription() { } XMLGrammarDescription::XMLGrammarDescription(MemoryManager* const memMgr) :fMemMgr(memMgr) { } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_NOCREATE(XMLGrammarDescription) void XMLGrammarDescription::serialize(XSerializeEngine&) { //no data } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/MemoryManager.hpp000644 000765 000024 00000007206 13241160335 023542 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: MemoryManager.hpp 673975 2008-07-04 09:23:56Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_MEMORYMANAGER_HPP) #define XERCESC_INCLUDE_GUARD_MEMORYMANAGER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * Configurable memory manager * *

This interface allows outside applications to plug in their own memory * manager to be used by Xerces for memory allocation/deallocation.

*/ class XMLPARSER_EXPORT MemoryManager { public: // ----------------------------------------------------------------------- // Constructors are hidden, only the virtual destructor is exposed // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * Default destructor */ virtual ~MemoryManager() { } //@} /** * This method is called to obtain the memory manager that should be * used to allocate memory used in exceptions. If the same memory * manager can be used, simply return 'this' from this function. * Note, however, that if there is a possibility that an exception * thrown can outlive the memory manager (for example, because the * memory manager object is allocated on the stack or is managed by * a stack-bound object), it is recommended that you return * XMLPlatformUtils::fgMemoryManager. * * @return A pointer to the memory manager */ virtual MemoryManager* getExceptionMemoryManager() = 0; // ----------------------------------------------------------------------- // The virtual memory manager interface // ----------------------------------------------------------------------- /** @name The pure virtual methods in this interface. */ //@{ /** * This method allocates requested memory. * * @param size The requested memory size * * @return A pointer to the allocated memory */ virtual void* allocate(XMLSize_t size) = 0; /** * This method deallocates memory * * @param p The pointer to the allocated memory to be deleted */ virtual void deallocate(void* p) = 0; //@} protected : // ----------------------------------------------------------------------- // Hidden Constructors // ----------------------------------------------------------------------- /** @name Constructor */ //@{ /** * Protected default constructor */ MemoryManager() { } //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- MemoryManager(const MemoryManager&); MemoryManager& operator=(const MemoryManager&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLDTDDescription.hpp000644 000765 000024 00000006325 13241160335 024200 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLDTDDescription.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLDTDDESCRIPTION_HPP) #define XERCESC_INCLUDE_GUARD_XMLDTDDESCRIPTION_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLPARSER_EXPORT XMLDTDDescription : public XMLGrammarDescription { public : // ----------------------------------------------------------------------- /** @name Virtual destructor for derived classes */ // ----------------------------------------------------------------------- //@{ /** * virtual destructor * */ virtual ~XMLDTDDescription(); //@} // ----------------------------------------------------------------------- /** @name Implementation of Grammar Description Interface */ // ----------------------------------------------------------------------- //@{ /** * getGrammarType * */ virtual Grammar::GrammarType getGrammarType() const { return Grammar::DTDGrammarType; } //@} // ----------------------------------------------------------------------- /** @name The DTDDescription Interface */ // ----------------------------------------------------------------------- //@{ /** * Getter * */ virtual const XMLCh* getRootName() const = 0; virtual const XMLCh* getSystemId() const {return 0;}; /** * Setter * */ virtual void setRootName(const XMLCh* const) = 0; virtual void setSystemId(const XMLCh* const) {}; //@} /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLDTDDescription) protected : // ----------------------------------------------------------------------- /** Hidden Constructors */ // ----------------------------------------------------------------------- //@{ XMLDTDDescription(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager); //@} private : // ----------------------------------------------------------------------- /** name Unimplemented copy constructor and operator= */ // ----------------------------------------------------------------------- //@{ XMLDTDDescription(const XMLDTDDescription& ); XMLDTDDescription& operator=(const XMLDTDDescription& ); //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLValidator.cpp000644 000765 000024 00000023602 13241160335 023276 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLValidator.cpp 635560 2008-03-10 14:10:09Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN static XMLMsgLoader* sMsgLoader = 0; void XMLInitializer::initializeXMLValidator() { sMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgValidityDomain); if (!sMsgLoader) XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain); } void XMLInitializer::terminateXMLValidator() { delete sMsgLoader; sMsgLoader = 0; } // --------------------------------------------------------------------------- // XMLValidator: Error emitting methods // --------------------------------------------------------------------------- // // These methods are called whenever the scanner wants to emit an error. // It handles getting the message loaded, doing token replacement, etc... // and then calling the error handler, if its installed. // void XMLValidator::emitError(const XMLValid::Codes toEmit) { // Bump the error count if it is not a warning if (XMLValid::errorType(toEmit) != XMLErrorReporter::ErrType_Warning) fScanner->incrementErrorCount(); // Call error reporter if we have one if (fErrorReporter) { // Load the message into a local for display const XMLSize_t msgSize = 1023; XMLCh errText[msgSize + 1]; // load the text if (!sMsgLoader->loadMsg(toEmit, errText, msgSize)) { // Probably should load a default msg here } // // Create a LastExtEntityInfo structure and get the reader manager // to fill it in for us. This will give us the information about // the last reader on the stack that was an external entity of some // sort (i.e. it will ignore internal entities. // ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr->getLastExtEntityInfo(lastInfo); fErrorReporter->error ( toEmit , XMLUni::fgValidityDomain , XMLValid::errorType(toEmit) , errText , lastInfo.systemId , lastInfo.publicId , lastInfo.lineNumber , lastInfo.colNumber ); } // Bail out if its fatal an we are to give up on the first fatal error if (((XMLValid::isError(toEmit) && fScanner->getValidationConstraintFatal()) || XMLValid::isFatal(toEmit)) && fScanner->getExitOnFirstFatal() && !fScanner->getInException()) { throw toEmit; } } void XMLValidator::emitError(const XMLValid::Codes toEmit , const XMLCh* const text1 , const XMLCh* const text2 , const XMLCh* const text3 , const XMLCh* const text4) { // Bump the error count if it is not a warning if (XMLValid::errorType(toEmit) != XMLErrorReporter::ErrType_Warning) fScanner->incrementErrorCount(); // Call error reporter if we have one if (fErrorReporter) { // // Load the message into alocal and replace any tokens found in // the text. // const XMLSize_t maxChars = 2047; XMLCh errText[maxChars + 1]; // load the text if (!sMsgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4, fScanner->getMemoryManager())) { // Should probably load a default message here } // // Create a LastExtEntityInfo structure and get the reader manager // to fill it in for us. This will give us the information about // the last reader on the stack that was an external entity of some // sort (i.e. it will ignore internal entities. // ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr->getLastExtEntityInfo(lastInfo); fErrorReporter->error ( toEmit , XMLUni::fgValidityDomain , XMLValid::errorType(toEmit) , errText , lastInfo.systemId , lastInfo.publicId , lastInfo.lineNumber , lastInfo.colNumber ); } // Bail out if its fatal an we are to give up on the first fatal error if (((XMLValid::isError(toEmit) && fScanner->getValidationConstraintFatal()) || XMLValid::isFatal(toEmit)) && fScanner->getExitOnFirstFatal() && !fScanner->getInException()) { throw toEmit; } } void XMLValidator::emitError(const XMLValid::Codes toEmit , const char* const text1 , const char* const text2 , const char* const text3 , const char* const text4) { // Bump the error count if it is not a warning if (XMLValid::errorType(toEmit) != XMLErrorReporter::ErrType_Warning) fScanner->incrementErrorCount(); // Call error reporter if we have one if (fErrorReporter) { // // Load the message into alocal and replace any tokens found in // the text. // const XMLSize_t maxChars = 2047; XMLCh errText[maxChars + 1]; // load the text if (!sMsgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4, fScanner->getMemoryManager())) { // Should probably load a default message here } // // Create a LastExtEntityInfo structure and get the reader manager // to fill it in for us. This will give us the information about // the last reader on the stack that was an external entity of some // sort (i.e. it will ignore internal entities. // ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr->getLastExtEntityInfo(lastInfo); fErrorReporter->error ( toEmit , XMLUni::fgValidityDomain , XMLValid::errorType(toEmit) , errText , lastInfo.systemId , lastInfo.publicId , lastInfo.lineNumber , lastInfo.colNumber ); } // Bail out if its fatal an we are to give up on the first fatal error if (((XMLValid::isError(toEmit) && fScanner->getValidationConstraintFatal()) || XMLValid::isFatal(toEmit)) && fScanner->getExitOnFirstFatal() && !fScanner->getInException()) { throw toEmit; } } void XMLValidator::emitError(const XMLValid::Codes toEmit , const XMLExcepts::Codes originalExceptCode , const XMLCh* const text1 , const XMLCh* const text2 , const XMLCh* const text3 , const XMLCh* const text4) { // Bump the error count if it is not a warning if (XMLValid::errorType(toEmit) != XMLErrorReporter::ErrType_Warning) fScanner->incrementErrorCount(); // Call error reporter if we have one if (fErrorReporter) { // // Load the message into alocal and replace any tokens found in // the text. // const XMLSize_t maxChars = 2047; XMLCh errText[maxChars + 1]; // load the text if (!sMsgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4, fScanner->getMemoryManager())) { // Should probably load a default message here } // // Create a LastExtEntityInfo structure and get the reader manager // to fill it in for us. This will give us the information about // the last reader on the stack that was an external entity of some // sort (i.e. it will ignore internal entities. // ReaderMgr::LastExtEntityInfo lastInfo; fReaderMgr->getLastExtEntityInfo(lastInfo); fErrorReporter->error ( originalExceptCode , XMLUni::fgExceptDomain //XMLUni::fgValidityDomain , XMLValid::errorType(toEmit) , errText , lastInfo.systemId , lastInfo.publicId , lastInfo.lineNumber , lastInfo.colNumber ); } // Bail out if its fatal an we are to give up on the first fatal error if (((XMLValid::isError(toEmit) && fScanner->getValidationConstraintFatal()) || XMLValid::isFatal(toEmit)) && fScanner->getExitOnFirstFatal() && !fScanner->getInException()) { throw toEmit; } } // --------------------------------------------------------------------------- // XMLValidator: Hidden Constructors // --------------------------------------------------------------------------- XMLValidator::XMLValidator(XMLErrorReporter* const errReporter) : fBufMgr(0) , fErrorReporter(errReporter) , fReaderMgr(0) , fScanner(0) { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/StdOutFormatTarget.cpp000644 000765 000024 00000003027 13241160335 024531 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: StdOutFormatTarget.cpp 881225 2009-11-17 10:19:57Z borisk $ */ #include #include XERCES_CPP_NAMESPACE_BEGIN StdOutFormatTarget::StdOutFormatTarget() {} StdOutFormatTarget::~StdOutFormatTarget() { flush (); } void StdOutFormatTarget::flush() { fflush(stdout); } void StdOutFormatTarget::writeChars(const XMLByte* const toWrite , const XMLSize_t count , XMLFormatter* const) { XMLSize_t written=fwrite(toWrite, sizeof(XMLByte), count, stdout); if(written!=count) ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotWriteToFile); fflush(stdout); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/ValidationContext.hpp000644 000765 000024 00000010656 13241160335 024441 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ValidationContext.hpp 729944 2008-12-29 17:03:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_VALIDATION_CONTEXT_HPP) #define XERCESC_INCLUDE_GUARD_VALIDATION_CONTEXT_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLRefInfo; class DTDEntityDecl; class DatatypeValidator; class ElemStack; class NamespaceScope; class XMLScanner; class XMLPARSER_EXPORT ValidationContext : public XMemory { public : // ----------------------------------------------------------------------- /** @name Virtual destructor for derived classes */ // ----------------------------------------------------------------------- //@{ /** * virtual destructor * */ virtual ~ValidationContext(){}; //@} // ----------------------------------------------------------------------- /** @name The ValidationContext Interface */ // ----------------------------------------------------------------------- //@{ /** * IDRefList * */ virtual RefHashTableOf* getIdRefList() const = 0; virtual void setIdRefList(RefHashTableOf* const) = 0; virtual void clearIdRefList() = 0; virtual void addId(const XMLCh * const ) = 0; virtual void addIdRef(const XMLCh * const ) = 0; virtual void toCheckIdRefList(bool) = 0; /** * EntityDeclPool * */ virtual const NameIdPool* getEntityDeclPool() const = 0; virtual const NameIdPool* setEntityDeclPool(const NameIdPool* const) = 0; virtual void checkEntity(const XMLCh * const ) const = 0 ; /** * Union datatype handling * */ virtual DatatypeValidator * getValidatingMemberType() const = 0 ; virtual void setValidatingMemberType(DatatypeValidator * validatingMemberType) = 0 ; /** * QName datatype handling * Create default implementations for source code compatibility */ virtual bool isPrefixUnknown(XMLCh* /* prefix */) { return true; }; virtual void setElemStack(ElemStack* /* elemStack */) {}; virtual const XMLCh* getURIForPrefix(XMLCh* /*prefix */) { return 0; }; virtual void setScanner(XMLScanner* /* scanner */) { }; virtual void setNamespaceScope(NamespaceScope* /* nsStack */) { }; //@} protected : // ----------------------------------------------------------------------- /** Hidden Constructors */ // ----------------------------------------------------------------------- //@{ ValidationContext(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager) :fMemoryManager(memMgr) { }; //@} // ----------------------------------------------------------------------- // Data members // // fMemoryManager // Pluggable memory manager for dynamic allocation/deallocation. // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; private : // ----------------------------------------------------------------------- /** name Unimplemented copy constructor and operator= */ // ----------------------------------------------------------------------- //@{ ValidationContext(const ValidationContext& ); ValidationContext& operator=(const ValidationContext& ); //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLAttDefList.hpp000644 000765 000024 00000012611 13241160335 023357 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLAttDefList.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLATTDEFLIST_HPP) #define XERCESC_INCLUDE_GUARD_XMLATTDEFLIST_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLAttDef; /** * This class defines an abstract interface that all validators must support. * When the scanner scans the attributes in a start tag, it must have a list * of the defined attributes for that element. This is used to fault in * defaulted and fixed attributes, to know which ones are required, and to * know the their types in order to do the correct normalization. * * Since each validator will have its own derivatives of XMLAttDef and will * have its own specialized storage mechanisms for elements and the att * defs that they own, there must be an abstracted way for the scanner to * deal with this list. * * It does not derive from the generic Enumerator template class, because * there are portability issues with deriving from a template class in a * DLL. It does though provide a similar enumerator interface. */ class XMLPARSER_EXPORT XMLAttDefList : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Destructor */ //@{ virtual ~XMLAttDefList(); //@} // ----------------------------------------------------------------------- // The virtual interface // ----------------------------------------------------------------------- virtual bool isEmpty() const = 0; virtual XMLAttDef* findAttDef ( const unsigned int uriID , const XMLCh* const attName ) = 0; virtual const XMLAttDef* findAttDef ( const unsigned int uriID , const XMLCh* const attName ) const = 0; virtual XMLAttDef* findAttDef ( const XMLCh* const attURI , const XMLCh* const attName ) = 0; virtual const XMLAttDef* findAttDef ( const XMLCh* const attURI , const XMLCh* const attName ) const = 0; /** * return total number of attributes in this list */ virtual XMLSize_t getAttDefCount() const = 0; /** * return attribute at the index-th position in the list. */ virtual XMLAttDef &getAttDef(XMLSize_t index) = 0; /** * return attribute at the index-th position in the list. */ virtual const XMLAttDef &getAttDef(XMLSize_t index) const = 0; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLAttDefList) // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** @name Getter methods */ //@{ /** Get the memory manager * * This method returns the configurable memory manager used by the * element declaration for dynamic allocation/deallocation. * * @return the memory manager */ MemoryManager* getMemoryManager() const; //@} protected : // ----------------------------------------------------------------------- // Hidden constructors and operators // ----------------------------------------------------------------------- XMLAttDefList(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); private: // unimplemented XMLAttDefList(const XMLAttDefList&); XMLAttDefList& operator=(const XMLAttDefList&); MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // XMLAttDefList: Getter methods // --------------------------------------------------------------------------- inline MemoryManager* XMLAttDefList::getMemoryManager() const { return fMemoryManager; } // --------------------------------------------------------------------------- // XMLAttDefList: Constructors and Destructor // --------------------------------------------------------------------------- inline XMLAttDefList::~XMLAttDefList() { } // --------------------------------------------------------------------------- // XMLAttDefList: Protected Constructor // --------------------------------------------------------------------------- inline XMLAttDefList::XMLAttDefList(MemoryManager* const manager): fMemoryManager(manager) { } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLValidityCodes.hpp000644 000765 000024 00000013512 13241160335 024120 0ustar00scantorstaff000000 000000 // This file is generated, don't edit it!! #if !defined(XERCESC_INCLUDE_GUARD_ERRHEADER_XMLValid) #define XERCESC_INCLUDE_GUARD_ERRHEADER_XMLValid #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLValid { public : enum Codes { NoError = 0 , E_LowBounds = 1 , ElementNotDefined = 2 , AttNotDefined = 3 , NotationNotDeclared = 4 , RootElemNotLikeDocType = 5 , RequiredAttrNotProvided = 6 , ElementNotValidForContent = 7 , BadIDAttrDefType = 8 , InvalidEmptyAttValue = 9 , ElementAlreadyExists = 10 , MultipleIdAttrs = 11 , ReusedIDValue = 12 , IDNotDeclared = 13 , UnknownNotRefAttr = 14 , UndeclaredElemInDocType = 15 , EmptyNotValidForContent = 16 , AttNotDefinedForElement = 17 , BadEntityRefAttr = 18 , UnknownEntityRefAttr = 19 , ColonNotValidWithNS = 20 , NotEnoughElemsForCM = 21 , NoCharDataInCM = 22 , DoesNotMatchEnumList = 23 , AttrValNotName = 24 , NoMultipleValues = 25 , NotSameAsFixedValue = 26 , RepElemInMixed = 27 , FeatureUnsupported = 28 , GroupContentRestricted = 29 , UnknownBaseDatatype = 30 , NoContentForRef = 31 , DatatypeError = 32 , ProhibitedAttributePresent = 33 , IllegalXMLSpace = 34 , WrongTargetNamespace = 35 , SimpleTypeHasChild = 36 , NoDatatypeValidatorForSimpleType = 37 , GrammarNotFound = 38 , DisplayErrorMessage = 39 , NillNotAllowed = 40 , NilAttrNotEmpty = 41 , FixedDifferentFromActual = 42 , NoDatatypeValidatorForAttribute = 43 , GenericError = 44 , ElementNotQualified = 45 , ElementNotUnQualified = 46 , VC_IllegalRefInStandalone = 47 , NoDefAttForStandalone = 48 , NoAttNormForStandalone = 49 , NoWSForStandalone = 50 , VC_EntityNotFound = 51 , PartialMarkupInPE = 52 , DatatypeValidationFailure = 53 , UniqueParticleAttributionFail = 54 , NoAbstractInXsiType = 55 , NoDirectUseAbstractElement = 56 , NoUseAbstractType = 57 , BadXsiType = 58 , NonDerivedXsiType = 59 , ElemNoSubforBlock = 60 , TypeNoSubforBlock = 61 , AttributeNotQualified = 62 , AttributeNotUnQualified = 63 , IC_FieldMultipleMatch = 64 , IC_UnknownField = 65 , IC_AbsentKeyValue = 66 , IC_KeyNotEnoughValues = 67 , IC_KeyMatchesNillable = 68 , IC_DuplicateUnique = 69 , IC_DuplicateKey = 70 , IC_KeyRefOutOfScope = 71 , IC_KeyNotFound = 72 , NonWSContent = 73 , EmptyElemNotationAttr = 74 , EmptyElemHasContent = 75 , ElemOneNotationAttr = 76 , AttrDupToken = 77 , ElemChildrenHasInvalidWS = 78 , E_HighBounds = 79 , W_LowBounds = 80 , W_HighBounds = 81 , F_LowBounds = 82 , F_HighBounds = 83 }; static bool isFatal(const XMLValid::Codes toCheck) { return ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds)); } static bool isWarning(const XMLValid::Codes toCheck) { return ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds)); } static bool isError(const XMLValid::Codes toCheck) { return ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds)); } static XMLErrorReporter::ErrTypes errorType(const XMLValid::Codes toCheck) { if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds)) return XMLErrorReporter::ErrType_Warning; else if ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds)) return XMLErrorReporter::ErrType_Fatal; else if ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds)) return XMLErrorReporter::ErrType_Error; return XMLErrorReporter::ErrTypes_Unknown; } static DOMError::ErrorSeverity DOMErrorType(const XMLValid::Codes toCheck) { if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds)) return DOMError::DOM_SEVERITY_WARNING; else if ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds)) return DOMError::DOM_SEVERITY_FATAL_ERROR; else return DOMError::DOM_SEVERITY_ERROR; } private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLValid(); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLPScanToken.hpp000644 000765 000024 00000011412 13241160334 023356 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLPScanToken.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLPSCANTOKEN_HPP) #define XERCESC_INCLUDE_GUARD_XMLPSCANTOKEN_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLScanner; /** * This simple class is used as a sanity check when the scanner is used to * do progressive parsing. It insures that things are not done out of * sequence and that sequences of scan calls are made correctly to the * right scanner instances. * * To client code, it is just a magic cookie which is obtained when a * progressive parse is begun, and which is passed back in on each subsequent * call of the progressive parse. */ class XMLPARSER_EXPORT XMLPScanToken : public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructor */ //@{ XMLPScanToken(); XMLPScanToken(const XMLPScanToken& toCopy); //@} /** @name Destructor */ //@{ ~XMLPScanToken(); //@} // ----------------------------------------------------------------------- // Public operators // ----------------------------------------------------------------------- XMLPScanToken& operator=(const XMLPScanToken& toCopy); protected : // ----------------------------------------------------------------------- // XMLScanner is our friend, can you say friend? Sure... // ----------------------------------------------------------------------- friend class XMLScanner; // ----------------------------------------------------------------------- // Hidden methods for use by XMLScanner // ----------------------------------------------------------------------- void set ( const XMLUInt32 scannerId , const XMLUInt32 sequenceId ); private : // ----------------------------------------------------------------------- // Private data members // // fScannerId // This field is set to the id of the scanner, to catch problems // where a token is gotten from one scanner and passed to another. // Each scanner is assigned an incrementing id. // // fSequenceId // In order to avoid problems such as calling scanNext() without // a call to scanFirst() and such, this value is set when scanFirst() // is called and matches this token to the current sequence id of // the scanner. // ----------------------------------------------------------------------- XMLUInt32 fScannerId; XMLUInt32 fSequenceId; }; // --------------------------------------------------------------------------- // XMLPScanToken: Constructors and Operators // --------------------------------------------------------------------------- inline XMLPScanToken::XMLPScanToken() : fScannerId(0) , fSequenceId(0) { } inline XMLPScanToken::XMLPScanToken(const XMLPScanToken& toCopy) : XMemory(toCopy) , fScannerId(toCopy.fScannerId) , fSequenceId(toCopy.fSequenceId) { } inline XMLPScanToken::~XMLPScanToken() { } // --------------------------------------------------------------------------- // XMLPScanToken: Public operators // --------------------------------------------------------------------------- inline XMLPScanToken& XMLPScanToken::operator=(const XMLPScanToken& toCopy) { if (this == &toCopy) return *this; fScannerId = toCopy.fScannerId; fSequenceId = toCopy.fSequenceId; return *this; } // --------------------------------------------------------------------------- // XMLPScanToken: Hidden methods // --------------------------------------------------------------------------- inline void XMLPScanToken::set( const XMLUInt32 scannerId , const XMLUInt32 sequenceId) { fScannerId = scannerId; fSequenceId = sequenceId; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/BinOutputStream.hpp000644 000765 000024 00000004400 13241160335 024075 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BinOutputStream.hpp 553915 2007-07-06 14:57:08Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_BIN_OUTPUT_STREAM_HPP) #define XERCESC_INCLUDE_GUARD_BIN_OUTPUT_STREAM_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT BinOutputStream : public XMemory { public : // ----------------------------------------------------------------------- // Virtual destructor for derived classes // ----------------------------------------------------------------------- virtual ~BinOutputStream(); // ----------------------------------------------------------------------- // The virtual output stream interface // ----------------------------------------------------------------------- virtual XMLFilePos curPos() const = 0; virtual void writeBytes ( const XMLByte* const toGo , const XMLSize_t maxToWrite ) = 0; protected : // ----------------------------------------------------------------------- // Hidden Constructors // ----------------------------------------------------------------------- BinOutputStream(); private : // ----------------------------------------------------------------------- // Unimplemented Constructors // ----------------------------------------------------------------------- BinOutputStream(const BinOutputStream&); BinOutputStream& operator=(const BinOutputStream&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/LocalFileInputSource.cpp000644 000765 000024 00000015151 13241160335 025023 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN /*** * * Originated by Chris larsson * * Issue: * * There is an inconsistency in URI resolution in the case where the file itself is a * symbolic link to another path (or the path has path segment which is a symbolic * link to another path). So, is the base path the directory where the symbolic link resides * or the directory where the real file resides? I'm sure one could argue either way, * but I think that having the base path be the directory where the symbolic link resides * is more intuitive. * * Defining it this way would then make the behavior consistent with using an absolute * path as well as with the java behavior. * * Proposal: * * The URI is resolved within the parser code, and is somewhat independant of the OS. * * A relative path is resolved by querying the current directory and appending the * relative part onto the returned current directory string to obtain the base URI. * An absolute path is simply used as the base URI. * Then remove all "./" and "../" path segments using an algorithm like weavepath to obtain * the resolved base URI. * * When you need to access another file such as a dtd, use the resolved base URI and add on * the relative URI of the dtd file. Then resolve it using the same weavepath algorithm. * * Note: * * Java parser behaves differently for a path containning symbolic path segment. When * it is given an absolute path, it can locate the primary instance document, while given * relative path, it might not. * * It is because Java parser uses URI solution where "/segment/../" is required to be removed * from the resultant path if a relative URI is merged to a baseURI. While this is NOT required * for an absolute URI. * * So if a path segment, which is symbolic link, happen to be followed by the '/../', it is * NOT removed from the path if it is given in absolute form, and the underlying file system * will locate the file, if in relative form, that symbolic link path segment together with * '../' is removed from the resultant path, and the file system may NOT be able to locate * the file, if there is a one, it is definitely not the one expected, in fact by accident. * * Therefore, to keep consistent with Java parser, for now, we do not apply removeDotDotSlash() * for absolute path. * ***/ // --------------------------------------------------------------------------- // LocalFileInputSource: Constructors and Destructor // --------------------------------------------------------------------------- LocalFileInputSource::LocalFileInputSource( const XMLCh* const basePath , const XMLCh* const relativePath , MemoryManager* const manager) : InputSource(manager) { // // If the relative part is really relative, then weave it together // with the base path. If not, just take the relative path as the // entire path. // if (XMLPlatformUtils::isRelative(relativePath, manager)) { XMLCh* tmpBuf = XMLPlatformUtils::weavePaths(basePath, relativePath, manager); setSystemId(tmpBuf); manager->deallocate(tmpBuf); //delete [] tmpBuf; } else { XMLCh* tmpBuf = XMLString::replicate(relativePath, manager); XMLPlatformUtils::removeDotSlash(tmpBuf, manager); setSystemId(tmpBuf); manager->deallocate(tmpBuf);//delete [] tmpBuf; } } LocalFileInputSource::LocalFileInputSource(const XMLCh* const filePath, MemoryManager* const manager) : InputSource(manager) { // // If the path is relative, then complete it acording to the current // working directory rules of the current platform. Else, just take // it as is. // if (XMLPlatformUtils::isRelative(filePath, manager)) { XMLCh* curDir = XMLPlatformUtils::getCurrentDirectory(manager); XMLSize_t curDirLen = XMLString::stringLen(curDir); XMLSize_t filePathLen = XMLString::stringLen(filePath); XMLCh* fullDir = (XMLCh*) manager->allocate ( (curDirLen + filePathLen + 2) * sizeof(XMLCh) );//new XMLCh [ curDirLen + filePathLen + 2]; XMLString::copyString(fullDir, curDir); fullDir[curDirLen] = chForwardSlash; XMLString::copyString(&fullDir[curDirLen+1], filePath); XMLPlatformUtils::removeDotSlash(fullDir, manager); XMLPlatformUtils::removeDotDotSlash(fullDir, manager); setSystemId(fullDir); manager->deallocate(curDir);//delete [] curDir; manager->deallocate(fullDir);//delete [] fullDir; } else { XMLCh* tmpBuf = XMLString::replicate(filePath, manager); XMLPlatformUtils::removeDotSlash(tmpBuf, manager); setSystemId(tmpBuf); manager->deallocate(tmpBuf);//delete [] tmpBuf; } } LocalFileInputSource::~LocalFileInputSource() { } // --------------------------------------------------------------------------- // LocalFileInputSource: InputSource interface implementation // --------------------------------------------------------------------------- BinInputStream* LocalFileInputSource::makeStream() const { BinFileInputStream* retStrm = new (getMemoryManager()) BinFileInputStream(getSystemId(), getMemoryManager()); if (!retStrm->getIsOpen()) { delete retStrm; return 0; } return retStrm; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/XMLNotationDecl.hpp000644 000765 000024 00000015577 13241160334 023754 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLNotationDecl.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLNOTATIONDECL_HPP) #define XERCESC_INCLUDE_GUARD_XMLNOTATIONDECL_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN /** * This class represents the core information about a notation declaration * that all validators must at least support. Each validator will create a * derivative of this class which adds any information it requires for its * own extra needs. * * At this common level, the information supported is the notation name * and the public and sysetm ids indicated in the notation declaration. */ class XMLPARSER_EXPORT XMLNotationDecl : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ XMLNotationDecl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); XMLNotationDecl ( const XMLCh* const notName , const XMLCh* const pubId , const XMLCh* const sysId , const XMLCh* const baseURI = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** @name Destructor */ //@{ ~XMLNotationDecl(); //@} // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- XMLSize_t getId() const; const XMLCh* getName() const; const XMLCh* getPublicId() const; const XMLCh* getSystemId() const; const XMLCh* getBaseURI() const; unsigned int getNameSpaceId() const; MemoryManager* getMemoryManager() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setId(const XMLSize_t newId); void setName ( const XMLCh* const notName ); void setPublicId(const XMLCh* const newId); void setSystemId(const XMLCh* const newId); void setBaseURI(const XMLCh* const newId); void setNameSpaceId(const unsigned int newId); // ----------------------------------------------------------------------- // Support named collection element semantics // ----------------------------------------------------------------------- const XMLCh* getKey() const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLNotationDecl) private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLNotationDecl(const XMLNotationDecl&); XMLNotationDecl& operator=(const XMLNotationDecl&); // ----------------------------------------------------------------------- // XMLNotationDecl: Private helper methods // ----------------------------------------------------------------------- void cleanUp(); // ----------------------------------------------------------------------- // Private data members // // fId // This is the unique id given to this notation decl. // // fName // The notation's name, which identifies the type of notation it // applies to. // // fPublicId // The text of the notation's public id, if any. // // fSystemId // The text of the notation's system id, if any. // // fBaseURI // The text of the notation's base URI // ----------------------------------------------------------------------- XMLSize_t fId; unsigned int fNameSpaceId; XMLCh* fName; XMLCh* fPublicId; XMLCh* fSystemId; XMLCh* fBaseURI; MemoryManager* fMemoryManager; }; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- inline XMLSize_t XMLNotationDecl::getId() const { return fId; } inline const XMLCh* XMLNotationDecl::getName() const { return fName; } inline unsigned int XMLNotationDecl::getNameSpaceId() const { return fNameSpaceId; } inline const XMLCh* XMLNotationDecl::getPublicId() const { return fPublicId; } inline const XMLCh* XMLNotationDecl::getSystemId() const { return fSystemId; } inline const XMLCh* XMLNotationDecl::getBaseURI() const { return fBaseURI; } inline MemoryManager* XMLNotationDecl::getMemoryManager() const { return fMemoryManager; } // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- inline void XMLNotationDecl::setId(const XMLSize_t newId) { fId = newId; } inline void XMLNotationDecl::setNameSpaceId(const unsigned int newId) { fNameSpaceId = newId; } inline void XMLNotationDecl::setPublicId(const XMLCh* const newId) { if (fPublicId) fMemoryManager->deallocate(fPublicId); fPublicId = XMLString::replicate(newId, fMemoryManager); } inline void XMLNotationDecl::setSystemId(const XMLCh* const newId) { if (fSystemId) fMemoryManager->deallocate(fSystemId); fSystemId = XMLString::replicate(newId, fMemoryManager); } inline void XMLNotationDecl::setBaseURI(const XMLCh* const newId) { if (fBaseURI) fMemoryManager->deallocate(fBaseURI); fBaseURI = XMLString::replicate(newId, fMemoryManager); } // --------------------------------------------------------------------------- // XMLNotationDecl: Support named pool element semantics // --------------------------------------------------------------------------- inline const XMLCh* XMLNotationDecl::getKey() const { return fName; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/000755 000765 000024 00000000000 13345765733 021264 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/framework/XMLBuffer.hpp000644 000765 000024 00000021676 13241160334 022577 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLBuffer.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLBUFFER_HPP) #define XERCESC_INCLUDE_GUARD_XMLBUFFER_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLBufferFullHandler; /** * XMLBuffer is a lightweight, expandable Unicode text buffer. Since XML is * inherently theoretically unbounded in terms of the sizes of things, we * very often need to have expandable buffers. The primary concern here is * that appends of characters and other buffers or strings be very fast, so * it always maintains the current buffer size. * * The buffer is not null terminated until some asks to see the raw buffer * contents. This also avoids overhead during append operations. */ class XMLPARSER_EXPORT XMLBuffer : public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructor */ //@{ XMLBuffer(const XMLSize_t capacity = 1023 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) : fIndex(0) , fCapacity(capacity) , fFullSize(0) , fUsed(false) , fMemoryManager(manager) , fFullHandler(0) , fBuffer(0) { // Buffer is one larger than capacity, to allow for zero term fBuffer = (XMLCh*) manager->allocate((capacity+1) * sizeof(XMLCh)); //new XMLCh[fCapacity+1]; // Keep it null terminated fBuffer[0] = XMLCh(0); } //@} /** @name Destructor */ //@{ ~XMLBuffer() { fMemoryManager->deallocate(fBuffer); //delete [] fBuffer; } //@} // ----------------------------------------------------------------------- // Buffer Full Handler Management // ----------------------------------------------------------------------- void setFullHandler(XMLBufferFullHandler* handler, const XMLSize_t fullSize) { if (handler && fullSize) { fFullHandler = handler; fFullSize = fullSize; // Need to consider the case that the fullsize is less than the current capacity. // For example, say fullSize = 100 and fCapacity is 1023 (the default). // If the fIndex is less than the fullSize, then no problem. We can just carry // on by resetting fCapacity to fullsize and proceed business as usual. // If the fIndex is already bigger than the fullSize then we call ensureCapacity // to see if it can handle emptying the current buffer (it will throw an // exception if it can't). if (fullSize < fCapacity) { fCapacity = fullSize; if (fIndex >= fullSize) { ensureCapacity(0); } } } else { // reset fFullHandler to zero because setFullHandler had bad input fFullHandler = 0; } } // ----------------------------------------------------------------------- // Buffer Management // ----------------------------------------------------------------------- void append(const XMLCh toAppend) { // Put in char and bump the index if (fIndex == fCapacity) ensureCapacity(1); fBuffer[fIndex++] = toAppend; } void append (const XMLCh* const chars, const XMLSize_t count) { if (count) { if (fIndex + count >= fCapacity) { ensureCapacity(count); } memcpy(&fBuffer[fIndex], chars, count * sizeof(XMLCh)); fIndex += count; } else { append(chars); } } void append (const XMLCh* const chars) { if (chars != 0 && *chars != 0) { // get length of chars XMLSize_t count = 0; for (; *(chars+count); count++ ) /*noop*/; if (fIndex + count >= fCapacity) { ensureCapacity(count); } memcpy(&fBuffer[fIndex], chars, count * sizeof(XMLCh)); fIndex += count; } } void set (const XMLCh* const chars, const XMLSize_t count) { fIndex = 0; append(chars, count); } void set (const XMLCh* const chars) { fIndex = 0; if (chars != 0 && *chars != 0) append(chars); } const XMLCh* getRawBuffer() const { fBuffer[fIndex] = 0; return fBuffer; } XMLCh* getRawBuffer() { fBuffer[fIndex] = 0; return fBuffer; } void reset() { fIndex = 0; } // ----------------------------------------------------------------------- // Getters // ----------------------------------------------------------------------- bool getInUse() const { return fUsed; } XMLSize_t getLen() const { return fIndex; } bool isEmpty() const { return (fIndex == 0); } // ----------------------------------------------------------------------- // Setters // ----------------------------------------------------------------------- void setInUse(const bool newValue) { fUsed = newValue; } private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLBuffer(const XMLBuffer&); XMLBuffer& operator=(const XMLBuffer&); // ----------------------------------------------------------------------- // Declare our friends // ----------------------------------------------------------------------- friend class XMLBufBid; // ----------------------------------------------------------------------- // Private helpers // ----------------------------------------------------------------------- void ensureCapacity(const XMLSize_t extraNeeded); // ----------------------------------------------------------------------- // Private data members // // fBuffer // The pointer to the buffer data. Its grown as needed. Its always // one larger than fCapacity, to leave room for the null terminator. // // fIndex // The current index into the buffer, as characters are appended // to it. If its zero, then the buffer is empty. // // fCapacity // The current capacity of the buffer. Its actually always one // larger, to leave room for the null terminator. // // fUsed // Indicates whether this buffer is in use or not. // // fFullHandler, fFullSize // If fFullHandler is non-null, the buffer has a maximum size // indicated by fFullSize. If writing to the buffer would exceed the // buffer's maximum size, fFullHandler's bufferFull callback is // invoked, to empty the buffer. // ----------------------------------------------------------------------- XMLSize_t fIndex; XMLSize_t fCapacity; XMLSize_t fFullSize; bool fUsed; MemoryManager* const fMemoryManager; XMLBufferFullHandler* fFullHandler; XMLCh* fBuffer; }; /** * XMLBufferFullHandler is a callback interface for clients of * XMLBuffers that impose a size restriction (e.g. XMLScanner). * Note that this is intended solely as a mix-in for internal * use, and therefore does not derive from XMemory (to avoid * the ambiguous base class problem). */ class XMLPARSER_EXPORT XMLBufferFullHandler { public : virtual ~XMLBufferFullHandler() {} /** * Callback method, intended to allow clients of an XMLBuffer which has * become full to empty it appropriately. * @return true if the handler was able to empty the buffer (either * partially or completely), otherwise false to indicate an error. */ virtual bool bufferFull(XMLBuffer&) = 0; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLAttDef.cpp000644 000765 000024 00000015161 13241160335 022521 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: XMLAttDef.cpp 679359 2008-07-24 11:15:19Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local const data // // gAttTypeStrings // A list of strings which are used to map attribute type numbers to // attribute type names. // // gDefAttTypesStrings // A list of strings which are used to map default attribute type // numbers to default attribute type names. // --------------------------------------------------------------------------- const XMLCh* const gAttTypeStrings[XMLAttDef::AttTypes_Count] = { XMLUni::fgCDATAString , XMLUni::fgIDString , XMLUni::fgIDRefString , XMLUni::fgIDRefsString , XMLUni::fgEntityString , XMLUni::fgEntitiesString , XMLUni::fgNmTokenString , XMLUni::fgNmTokensString , XMLUni::fgNotationString , XMLUni::fgEnumerationString , XMLUni::fgCDATAString , XMLUni::fgCDATAString , XMLUni::fgCDATAString , XMLUni::fgCDATAString }; const XMLCh* const gDefAttTypeStrings[XMLAttDef::DefAttTypes_Count] = { XMLUni::fgDefaultString , XMLUni::fgFixedString , XMLUni::fgRequiredString , XMLUni::fgImpliedString , XMLUni::fgImpliedString , XMLUni::fgImpliedString , XMLUni::fgImpliedString , XMLUni::fgImpliedString , XMLUni::fgImpliedString }; // --------------------------------------------------------------------------- // XMLAttDef: Public, static data members // --------------------------------------------------------------------------- const unsigned int XMLAttDef::fgInvalidAttrId = 0xFFFFFFFE; // --------------------------------------------------------------------------- // XMLAttDef: Public, static methods // --------------------------------------------------------------------------- const XMLCh* XMLAttDef::getAttTypeString(const XMLAttDef::AttTypes attrType , MemoryManager* const manager) { // Check for an invalid attribute type and return a null if ((attrType < AttTypes_Min) || (attrType > AttTypes_Max)) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::AttDef_BadAttType, manager); return gAttTypeStrings[attrType]; } const XMLCh* XMLAttDef::getDefAttTypeString(const XMLAttDef::DefAttTypes attrType , MemoryManager* const manager) { // Check for an invalid attribute type and return a null if ((attrType < DefAttTypes_Min) || (attrType > DefAttTypes_Max)) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::AttDef_BadDefAttType, manager); return gDefAttTypeStrings[attrType]; } // --------------------------------------------------------------------------- // XMLAttDef: Destructor // --------------------------------------------------------------------------- XMLAttDef::~XMLAttDef() { cleanUp(); } // --------------------------------------------------------------------------- // XMLAttDef: Hidden constructors // --------------------------------------------------------------------------- XMLAttDef::XMLAttDef( const XMLAttDef::AttTypes type , const XMLAttDef::DefAttTypes defType , MemoryManager* const manager) : fDefaultType(defType) , fType(type) , fCreateReason(XMLAttDef::NoReason) , fExternalAttribute(false) , fId(XMLAttDef::fgInvalidAttrId) , fValue(0) , fEnumeration(0) , fMemoryManager(manager) { } typedef JanitorMemFunCall CleanupType; XMLAttDef::XMLAttDef( const XMLCh* const attrValue , const XMLAttDef::AttTypes type , const XMLAttDef::DefAttTypes defType , const XMLCh* const enumValues , MemoryManager* const manager) : fDefaultType(defType) , fType(type) , fCreateReason(XMLAttDef::NoReason) , fExternalAttribute(false) , fId(XMLAttDef::fgInvalidAttrId) , fValue(0) , fEnumeration(0) , fMemoryManager(manager) { CleanupType cleanup(this, &XMLAttDef::cleanUp); try { fValue = XMLString::replicate(attrValue, fMemoryManager); fEnumeration = XMLString::replicate(enumValues, fMemoryManager); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } // --------------------------------------------------------------------------- // XMLAttDef: Private helper methods // --------------------------------------------------------------------------- void XMLAttDef::cleanUp() { if (fEnumeration) fMemoryManager->deallocate(fEnumeration); if (fValue) fMemoryManager->deallocate(fValue); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_NOCREATE(XMLAttDef) void XMLAttDef::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng<<(int)fDefaultType; serEng<<(int)fType; serEng<<(int)fCreateReason; serEng<>i; fDefaultType = (DefAttTypes) i; serEng>>i; fType = (AttTypes)i; serEng>>i; fCreateReason = (CreateReasons)i; serEng>>fExternalAttribute; serEng.readSize (fId); serEng.readString(fValue); serEng.readString(fEnumeration); } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/Wrapper4InputSource.cpp000644 000765 000024 00000007417 13241160335 024703 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Wrapper4InputSource.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Wrapper4InputSource: Constructor and Destructor // --------------------------------------------------------------------------- Wrapper4InputSource::Wrapper4InputSource(InputSource* const inputSource, const bool adoptFlag , MemoryManager* const manager) : fAdoptInputSource(adoptFlag) , fInputSource(inputSource) { if (!inputSource) ThrowXMLwithMemMgr(NullPointerException, XMLExcepts::CPtr_PointerIsZero, manager); } Wrapper4InputSource::~Wrapper4InputSource() { if (fAdoptInputSource) delete fInputSource; } // --------------------------------------------------------------------------- // Wrapper4InputSource: Getter methods // --------------------------------------------------------------------------- bool Wrapper4InputSource::getIssueFatalErrorIfNotFound() const { return fInputSource->getIssueFatalErrorIfNotFound(); } const XMLCh* Wrapper4InputSource::getEncoding() const { return fInputSource->getEncoding(); } const XMLCh* Wrapper4InputSource::getSystemId() const { return fInputSource->getSystemId(); } const XMLCh* Wrapper4InputSource::getPublicId() const { return fInputSource->getPublicId(); } // --------------------------------------------------------------------------- // Wrapper4InputSource: Setter methods // --------------------------------------------------------------------------- void Wrapper4InputSource::setIssueFatalErrorIfNotFound(bool flag) { fInputSource->setIssueFatalErrorIfNotFound(flag); } void Wrapper4InputSource::setEncoding(const XMLCh* const encodingStr) { fInputSource->setEncoding(encodingStr); } void Wrapper4InputSource::setPublicId(const XMLCh* const publicId) { fInputSource->setPublicId(publicId); } void Wrapper4InputSource::setSystemId(const XMLCh* const systemId) { fInputSource->setSystemId(systemId); } // --------------------------------------------------------------------------- // Wrapper4InputSource: Stream methods // --------------------------------------------------------------------------- InputSource* Wrapper4InputSource::getByteStream() const { return fInputSource; } // --------------------------------------------------------------------------- // Wrapper4InputSource: Memory methods // --------------------------------------------------------------------------- void Wrapper4InputSource::release() { Wrapper4InputSource* src = (Wrapper4InputSource*) this; delete src; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/XMLGrammarDescription.hpp000644 000765 000024 00000006573 13241160335 025160 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLGrammarDescription.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLGRAMMARDESCRIPTION_HPP) #define XERCESC_INCLUDE_GUARD_XMLGRAMMARDESCRIPTION_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLPARSER_EXPORT XMLGrammarDescription : public XSerializable, public XMemory { public : // ----------------------------------------------------------------------- /** @name Virtual destructor for derived classes */ // ----------------------------------------------------------------------- //@{ /** * virtual destructor * */ virtual ~XMLGrammarDescription(); //@} // ----------------------------------------------------------------------- /** @name The Grammar Description Interface */ // ----------------------------------------------------------------------- //@{ /** * getGrammarType * */ virtual Grammar::GrammarType getGrammarType() const = 0; /** * getGrammarKey * */ virtual const XMLCh* getGrammarKey() const = 0; //@} inline MemoryManager* getMemoryManager() const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLGrammarDescription) protected : // ----------------------------------------------------------------------- /** Hidden Constructors */ // ----------------------------------------------------------------------- //@{ XMLGrammarDescription(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager); //@} private : // ----------------------------------------------------------------------- /** name Unimplemented copy constructor and operator= */ // ----------------------------------------------------------------------- //@{ XMLGrammarDescription(const XMLGrammarDescription& ); XMLGrammarDescription& operator=(const XMLGrammarDescription& ); //@} // ----------------------------------------------------------------------- // // fMemMgr: plugged-in (or defaulted-in) memory manager, // not owned // no reset after initialization // allow derivatives to access directly // // ----------------------------------------------------------------------- MemoryManager* const fMemMgr; }; inline MemoryManager* XMLGrammarDescription::getMemoryManager() const { return fMemMgr; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLValidator.hpp000644 000765 000024 00000034464 13241160335 023313 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLValidator.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_XMLVALIDATOR_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class ReaderMgr; class XMLBufferMgr; class XMLElementDecl; class XMLScanner; class Grammar; /** * This abstract class provides the interface for all validators. This is * the simple amount of API that all validators must honor, in order for * the scanner to use them to do validation. All validators will actually * contain much more functionality than is accessible via this common API, * but that functionality requires that you know what type of validator you * are dealing with. * * Basically, at this level, the primary concern is to be able to query * core information about elements and attributes. Adding decls to the * validator requires that you go through the derived interface because they * all have their own decl types. At this level, we can return information * via the base decl classes, from which each validator derives its own * decl classes. */ class XMLPARSER_EXPORT XMLValidator : public XMemory { public: // ----------------------------------------------------------------------- // Constructors are hidden, just the virtual destructor is exposed // ----------------------------------------------------------------------- /** @name Destructor */ //@{ /** * The derived class should clean up its allocated data, then this class * will do the same for data allocated at this level. */ virtual ~XMLValidator() { } //@} // ----------------------------------------------------------------------- // The virtual validator interface // ----------------------------------------------------------------------- /** @name Virtual validator interface */ //@{ /** * The derived class should look up its declaration of the passed element * from its element pool. It should then use the content model description * contained in that element declaration to validate that the passed list * of child elements are valid for that content model. The count can be * zero, indicating no child elements. * * Note that whitespace and text content are not validated here. Those are * handled by the scanner. So only element ids are provided here. * * @param elemDecl The element whose content is to be checked. * * @param children An array of element QName which represent the elements * found within the parent element, i.e. the content * to be validated. * * @param childCount The number of elements in the childIds array. It can * be zero if the element had none. * * @param indexFailingChild On return, it will contain the index of the * children failing validation, if the retun value * is false * */ virtual bool checkContent ( XMLElementDecl* const elemDecl , QName** const children , XMLSize_t childCount , XMLSize_t* indexFailingChild ) = 0; /** * The derived class should fault in the passed XMLAttr value. It should * use the passeed attribute definition (which is passed via the base * type so it must often be downcast to the appropriate type for the * derived validator class), to fill in the passed attribute. This is done * as a performance enhancement since the derived class has more direct * access to the information. */ virtual void faultInAttr ( XMLAttr& toFill , const XMLAttDef& attDef ) const = 0; /** * This method is called by the scanner after a Grammar is scanned. */ virtual void preContentValidation(bool reuseGrammar, bool validateDefAttr = false) = 0; /** * This method is called by the scanner after the parse has completed. It * gives the validator a chance to check certain things that can only be * checked after the whole document has been parsed, such as referential * integrity of ID/IDREF pairs and so forth. The validator should just * issue errors for any problems it finds. */ virtual void postParseValidation() = 0; /** * This method is called by the scanner before a new document is about * to start. It gives the validator a change to reset itself in preparation * for another validation pass. */ virtual void reset() = 0; /** * The derived class should return a boolean that indicates whether it * requires namespace processing or not. Some do and some allow it to be * optional. This flag is used to control whether the client code's * requests to disable namespace processing can be honored or not. */ virtual bool requiresNamespaces() const = 0; /** * The derived class should apply any rules to the passed attribute value * that are above and beyond those defined by XML 1.0. The scanner itself * will impose XML 1.0 rules, based on the type of the attribute. This * will generally be used to check things such as range checks and other * datatype related validation. * * If the value breaks any rules as defined by the derived class, it * should just issue errors as usual. */ virtual void validateAttrValue ( const XMLAttDef* attDef , const XMLCh* const attrValue , bool preValidation = false , const XMLElementDecl* elemDecl = 0 ) = 0; /** * The derived class should apply any rules to the passed element decl * that are above and beyond those defined by XML 1.0. * * If the value breaks any rules as defined by the derived class, it * should just issue errors as usual. */ virtual void validateElement ( const XMLElementDecl* elemDef ) = 0; /** * Retrieve the Grammar used */ virtual Grammar* getGrammar() const =0; /** * Set the Grammar */ virtual void setGrammar(Grammar* aGrammar) =0; //@} // ----------------------------------------------------------------------- // Virtual DTD handler interface. // ----------------------------------------------------------------------- /** @name Virtual DTD handler interface */ //@{ /** * This method allows the scanner to ask the validator if it handles * DTDs or not. */ virtual bool handlesDTD() const = 0; // ----------------------------------------------------------------------- // Virtual Schema handler interface. // ----------------------------------------------------------------------- /** @name Virtual Schema handler interface */ /** * This method allows the scanner to ask the validator if it handles * Schema or not. */ virtual bool handlesSchema() const = 0; //@} // ----------------------------------------------------------------------- // Setter methods // // setScannerInfo() is called by the scanner to tell the validator // about the stuff it needs to have access to. // ----------------------------------------------------------------------- /** @name Setter methods */ //@{ /** * @param owningScanner This is a pointer to the scanner to which the * validator belongs. The validator will often * need to query state data from the scanner. * * @param readerMgr This is a pointer to the reader manager that is * being used by the scanner. * * @param bufMgr This is the buffer manager of the scanner. This * is provided as a convenience so that the validator * doesn't have to create its own buffer manager * during the parse process. */ void setScannerInfo ( XMLScanner* const owningScanner , ReaderMgr* const readerMgr , XMLBufferMgr* const bufMgr ); /** * This method is called to set an error reporter on the validator via * which it will report any errors it sees during parsing or validation. * This is generally called by the owning scanner. * * @param errorReporter A pointer to the error reporter to use. This * is not adopted, just referenced so the caller * remains responsible for its cleanup, if any. */ void setErrorReporter ( XMLErrorReporter* const errorReporter ); //@} // ----------------------------------------------------------------------- // Error emitter methods // ----------------------------------------------------------------------- /** @name Error emittor methods */ //@{ /** * This call is a convenience by which validators can emit errors. Most * of the grunt work of loading the text, getting the current source * location, ect... is handled here. * * If the loaded text has replacement parameters, then text strings can be * passed. These will be used to replace the tokens {0}, {1}, {2}, and {3} * in the order passed. So text1 will replace {0}, text2 will replace {1}, * and so forth. * * textX Up to four replacement parameters. They can be provided * as either XMLCh strings, or local code page strings which * will be transcoded internally. * * @param toEmit The error code to emit. it must be one of the defined * validator error codes. * */ void emitError(const XMLValid::Codes toEmit); void emitError ( const XMLValid::Codes toEmit , const XMLCh* const text1 , const XMLCh* const text2 = 0 , const XMLCh* const text3 = 0 , const XMLCh* const text4 = 0 ); void emitError ( const XMLValid::Codes toEmit , const char* const text1 , const char* const text2 = 0 , const char* const text3 = 0 , const char* const text4 = 0 ); void emitError ( const XMLValid::Codes toEmit , const XMLExcepts::Codes originalErrorCode , const XMLCh* const text1 = 0 , const XMLCh* const text2 = 0 , const XMLCh* const text3 = 0 , const XMLCh* const text4 = 0 ); //@} protected : // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- XMLValidator ( XMLErrorReporter* const errReporter = 0 ); // ----------------------------------------------------------------------- // Protected getters // ----------------------------------------------------------------------- const XMLBufferMgr* getBufMgr() const; XMLBufferMgr* getBufMgr(); const ReaderMgr* getReaderMgr() const; ReaderMgr* getReaderMgr(); const XMLScanner* getScanner() const; XMLScanner* getScanner(); private : // ----------------------------------------------------------------------- // Unimplemented Constructors and Operators // ----------------------------------------------------------------------- XMLValidator(const XMLValidator&); XMLValidator& operator=(const XMLValidator&); // ----------------------------------------------------------------------- // Private data members // // fErrorReporter // The error reporter we are to use, if any. // // ----------------------------------------------------------------------- XMLBufferMgr* fBufMgr; XMLErrorReporter* fErrorReporter; ReaderMgr* fReaderMgr; XMLScanner* fScanner; }; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- inline void XMLValidator::setScannerInfo(XMLScanner* const owningScanner , ReaderMgr* const readerMgr , XMLBufferMgr* const bufMgr) { // We don't own any of these, we just reference them fScanner = owningScanner; fReaderMgr = readerMgr; fBufMgr = bufMgr; } inline void XMLValidator::setErrorReporter(XMLErrorReporter* const errorReporter) { fErrorReporter = errorReporter; } // --------------------------------------------------------------------------- // XMLValidator: Protected getter // --------------------------------------------------------------------------- inline const XMLBufferMgr* XMLValidator::getBufMgr() const { return fBufMgr; } inline XMLBufferMgr* XMLValidator::getBufMgr() { return fBufMgr; } inline const ReaderMgr* XMLValidator::getReaderMgr() const { return fReaderMgr; } inline ReaderMgr* XMLValidator::getReaderMgr() { return fReaderMgr; } inline const XMLScanner* XMLValidator::getScanner() const { return fScanner; } inline XMLScanner* XMLValidator::getScanner() { return fScanner; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLDTDDescription.cpp000644 000765 000024 00000003006 13241160335 024164 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: XMLDTDDescription.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN XMLDTDDescription::~XMLDTDDescription() { } XMLDTDDescription::XMLDTDDescription(MemoryManager* const memMgr) :XMLGrammarDescription(memMgr) { } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_NOCREATE(XMLDTDDescription) void XMLDTDDescription::serialize(XSerializeEngine& serEng) { XMLGrammarDescription::serialize(serEng); //no data } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/StdOutFormatTarget.hpp000644 000765 000024 00000003756 13241160334 024546 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: StdOutFormatTarget.hpp 553937 2007-07-06 16:02:19Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_STDOUTFORMATTARGET_HPP) #define XERCESC_INCLUDE_GUARD_STDOUTFORMATTARGET_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLPARSER_EXPORT StdOutFormatTarget : public XMLFormatTarget { public: /** @name constructors and destructor */ //@{ StdOutFormatTarget() ; ~StdOutFormatTarget(); //@} // ----------------------------------------------------------------------- // Implementations of the format target interface // ----------------------------------------------------------------------- virtual void writeChars(const XMLByte* const toWrite , const XMLSize_t count , XMLFormatter* const formatter); virtual void flush(); private: // ----------------------------------------------------------------------- // Unimplemented methods. // ----------------------------------------------------------------------- StdOutFormatTarget(const StdOutFormatTarget&); StdOutFormatTarget& operator=(const StdOutFormatTarget&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLFormatter.hpp000644 000765 000024 00000041431 13241160335 023321 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLFormatter.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLFORMATTER_HPP) #define XERCESC_INCLUDE_GUARD_XMLFORMATTER_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLFormatTarget; class XMLTranscoder; /** * This class provides the basic formatting capabilities that are required * to turn the Unicode based XML data from the parsers into a form that can * be used on non-Unicode based systems, that is, into local or generic text * encodings. * * A number of flags are provided to control whether various optional * formatting operations are performed. */ class XMLPARSER_EXPORT XMLFormatter : public XMemory { public: // ----------------------------------------------------------------------- // Class types // ----------------------------------------------------------------------- /** @name Public Constants */ //@{ /** * EscapeFlags - Different styles of escape flags to control various formatting. * *

NoEscapes: * No character needs to be escaped. Just write them out as is.

*

StdEscapes: * The following characters need to be escaped:

* * * * * * * * * * * * * * * * * * * * * * * * * *
charactershould be escaped and written as
&&amp;
>&gt;
"&quot;
<&lt;
'&apos;
*

AttrEscapes: * The following characters need to be escaped:

* * * * * * * * * * * * * * * * * *
charactershould be escaped and written as
&&amp;
>&gt;
"&quot;
*

CharEscapes: * The following characters need to be escaped:

* * * * * * * * * * * * * *
charactershould be escaped and written as
&&amp;
>&gt;
*

EscapeFlags_Count: * Special value, do not use directly.

*

DefaultEscape: * Special value, do not use directly.

* */ enum EscapeFlags { NoEscapes , StdEscapes , AttrEscapes , CharEscapes // Special values, don't use directly , EscapeFlags_Count , DefaultEscape = 999 }; /** * UnRepFlags * * The unrepresentable flags that indicate how to react when a * character cannot be represented in the target encoding. * *

UnRep_Fail: * Fail the operation.

*

UnRep_CharRef: * Display the unrepresented character as reference.

*

UnRep_Replace: * Replace the unrepresented character with the replacement character.

*

DefaultUnRep: * Special value, do not use directly.

* */ enum UnRepFlags { UnRep_Fail , UnRep_CharRef , UnRep_Replace , DefaultUnRep = 999 }; //@} // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructor and Destructor */ //@{ /** * @param outEncoding the encoding for the formatted content. * @param docVersion the document version. * @param target the formatTarget where the formatted content is written to. * @param escapeFlags the escape style for certain character. * @param unrepFlags the reaction to unrepresentable character. * @param manager Pointer to the memory manager to be used to * allocate objects. */ XMLFormatter ( const XMLCh* const outEncoding , const XMLCh* const docVersion , XMLFormatTarget* const target , const EscapeFlags escapeFlags = NoEscapes , const UnRepFlags unrepFlags = UnRep_Fail , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); XMLFormatter ( const char* const outEncoding , const char* const docVersion , XMLFormatTarget* const target , const EscapeFlags escapeFlags = NoEscapes , const UnRepFlags unrepFlags = UnRep_Fail , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); XMLFormatter ( const XMLCh* const outEncoding , XMLFormatTarget* const target , const EscapeFlags escapeFlags = NoEscapes , const UnRepFlags unrepFlags = UnRep_Fail , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); XMLFormatter ( const char* const outEncoding , XMLFormatTarget* const target , const EscapeFlags escapeFlags = NoEscapes , const UnRepFlags unrepFlags = UnRep_Fail , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~XMLFormatter(); //@} // ----------------------------------------------------------------------- // Formatting methods // ----------------------------------------------------------------------- /** @name Formatting methods */ //@{ /** * @param toFormat the string to be formatted * @param count length of the string * @param escapeFlags the escape style for formatting toFormat * @param unrepFlags the reaction for any unrepresentable character in toFormat * */ void formatBuf ( const XMLCh* const toFormat , const XMLSize_t count , const EscapeFlags escapeFlags = DefaultEscape , const UnRepFlags unrepFlags = DefaultUnRep ); /** * @see formatBuf */ XMLFormatter& operator<< ( const XMLCh* const toFormat ); XMLFormatter& operator<< ( const XMLCh toFormat ); void writeBOM(const XMLByte* const toFormat , const XMLSize_t count); //@} // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** @name Getter methods */ //@{ /** * @return return the encoding set for the formatted content */ const XMLCh* getEncodingName() const; /** * @return return constant transcoder used internally for transcoding the formatter conent */ inline const XMLTranscoder* getTranscoder() const; /** * @return return the transcoder used internally for transcoding the formatter content */ inline XMLTranscoder* getTranscoder(); //@} // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** @name Setter methods */ //@{ /** * @param newFlags set the escape style for the follow-on formatted content */ void setEscapeFlags ( const EscapeFlags newFlags ); /** * @param newFlags set the reaction for unrepresentable character */ void setUnRepFlags ( const UnRepFlags newFlags ); /** * @param newFlags set the escape style for the follow-on formatted content * @see setEscapeFlags */ XMLFormatter& operator<< ( const EscapeFlags newFlags ); /** * @param newFlags set the reaction for unrepresentable character * @see setUnRepFlags */ XMLFormatter& operator<< ( const UnRepFlags newFlags ); //@} // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** @name Setter methods */ //@{ /** * @return return the escape style for the formatted content */ EscapeFlags getEscapeFlags() const; /** * @return return the reaction for unrepresentable character */ UnRepFlags getUnRepFlags() const; //@} private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLFormatter(); XMLFormatter(const XMLFormatter&); XMLFormatter& operator=(const XMLFormatter&); // ----------------------------------------------------------------------- // Private class constants // ----------------------------------------------------------------------- enum Constants { kTmpBufSize = 16 * 1024 }; // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- const XMLByte* getCharRef(XMLSize_t &count, XMLByte* &ref, const XMLCh * stdRef); void writeCharRef(const XMLCh &toWrite); void writeCharRef(XMLSize_t toWrite); bool inEscapeList(const XMLFormatter::EscapeFlags escStyle , const XMLCh toCheck); XMLSize_t handleUnEscapedChars(const XMLCh * srcPtr, const XMLSize_t count, const UnRepFlags unrepFlags); void specialFormat ( const XMLCh* const toFormat , const XMLSize_t count , const EscapeFlags escapeFlags ); // ----------------------------------------------------------------------- // Private, non-virtual methods // // fEscapeFlags // The escape flags we were told to use in formatting. These are // defaults set in the ctor, which can be overridden on a particular // call. // // fOutEncoding // This the name of the output encoding. Saved mainly for meaningful // error messages. // // fTarget // This is the target object for the formatting operation. // // fUnRepFlags // The unrepresentable flags that indicate how to react when a // character cannot be represented in the target encoding. // // fXCoder // This the transcoder that we will use. It is created using the // encoding name we were told to use. // // fTmpBuf // An output buffer that we use to transcode chars into before we // send them off to be output. // // fAposRef // fAmpRef // fGTRef // fLTRef // fQuoteRef // These are character refs for the standard char refs, in the // output encoding. They are faulted in as required, by transcoding // them from fixed Unicode versions. // // fIsXML11 // for performance reason, we do not store the actual version string // and do the string comparison again and again. // // ----------------------------------------------------------------------- EscapeFlags fEscapeFlags; XMLCh* fOutEncoding; XMLFormatTarget* fTarget; UnRepFlags fUnRepFlags; XMLTranscoder* fXCoder; XMLByte fTmpBuf[kTmpBufSize + 4]; XMLByte* fAposRef; XMLSize_t fAposLen; XMLByte* fAmpRef; XMLSize_t fAmpLen; XMLByte* fGTRef; XMLSize_t fGTLen; XMLByte* fLTRef; XMLSize_t fLTLen; XMLByte* fQuoteRef; XMLSize_t fQuoteLen; bool fIsXML11; MemoryManager* fMemoryManager; }; class XMLPARSER_EXPORT XMLFormatTarget : public XMemory { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- virtual ~XMLFormatTarget() {} // ----------------------------------------------------------------------- // Virtual interface // ----------------------------------------------------------------------- virtual void writeChars ( const XMLByte* const toWrite , const XMLSize_t count , XMLFormatter* const formatter ) = 0; virtual void flush() {}; protected : // ----------------------------------------------------------------------- // Hidden constructors and operators // ----------------------------------------------------------------------- XMLFormatTarget() {}; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLFormatTarget(const XMLFormatTarget&); XMLFormatTarget& operator=(const XMLFormatTarget&); }; // --------------------------------------------------------------------------- // XMLFormatter: Getter methods // --------------------------------------------------------------------------- inline const XMLCh* XMLFormatter::getEncodingName() const { return fOutEncoding; } inline const XMLTranscoder* XMLFormatter::getTranscoder() const { return fXCoder; } inline XMLTranscoder* XMLFormatter::getTranscoder() { return fXCoder; } // --------------------------------------------------------------------------- // XMLFormatter: Setter methods // --------------------------------------------------------------------------- inline void XMLFormatter::setEscapeFlags(const EscapeFlags newFlags) { fEscapeFlags = newFlags; } inline void XMLFormatter::setUnRepFlags(const UnRepFlags newFlags) { fUnRepFlags = newFlags; } inline XMLFormatter& XMLFormatter::operator<<(const EscapeFlags newFlags) { fEscapeFlags = newFlags; return *this; } inline XMLFormatter& XMLFormatter::operator<<(const UnRepFlags newFlags) { fUnRepFlags = newFlags; return *this; } // --------------------------------------------------------------------------- // XMLFormatter: Getter methods // --------------------------------------------------------------------------- inline XMLFormatter::EscapeFlags XMLFormatter::getEscapeFlags() const { return fEscapeFlags; } inline XMLFormatter::UnRepFlags XMLFormatter::getUnRepFlags() const { return fUnRepFlags; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLEntityDecl.cpp000644 000765 000024 00000012522 13241160335 023414 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: XMLEntityDecl.cpp 679359 2008-07-24 11:15:19Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLEntityDecl: Constructors and Destructor // --------------------------------------------------------------------------- XMLEntityDecl::XMLEntityDecl(MemoryManager* const manager) : fId(0) , fValueLen(0) , fValue(0) , fName(0) , fNotationName(0) , fPublicId(0) , fSystemId(0) , fBaseURI(0) , fIsExternal(false) , fMemoryManager(manager) { } XMLEntityDecl::XMLEntityDecl(const XMLCh* const entName, MemoryManager* const manager) : fId(0) , fValueLen(0) , fValue(0) , fName(0) , fNotationName(0) , fPublicId(0) , fSystemId(0) , fBaseURI(0) , fIsExternal(false) , fMemoryManager(manager) { fName = XMLString::replicate(entName, fMemoryManager); } typedef JanitorMemFunCall CleanupType; XMLEntityDecl::XMLEntityDecl(const XMLCh* const entName , const XMLCh* const value , MemoryManager* const manager) : fId(0) , fValueLen(XMLString::stringLen(value)) , fValue(0) , fName(0) , fNotationName(0) , fPublicId(0) , fSystemId(0) , fBaseURI(0) , fIsExternal(false) , fMemoryManager(manager) { CleanupType cleanup(this, &XMLEntityDecl::cleanUp); try { fValue = XMLString::replicate(value, fMemoryManager); fName = XMLString::replicate(entName, fMemoryManager); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XMLEntityDecl::XMLEntityDecl(const XMLCh* const entName , const XMLCh value , MemoryManager* const manager) : fId(0) , fValueLen(1) , fValue(0) , fName(0) , fNotationName(0) , fPublicId(0) , fSystemId(0) , fBaseURI(0) , fIsExternal(false) , fMemoryManager(manager) { CleanupType cleanup(this, &XMLEntityDecl::cleanUp); try { XMLCh dummy[2] = { chNull, chNull }; dummy[0] = value; fValue = XMLString::replicate(dummy, fMemoryManager); fName = XMLString::replicate(entName, fMemoryManager); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XMLEntityDecl::~XMLEntityDecl() { cleanUp(); } // --------------------------------------------------------------------------- // XMLEntityDecl: Setter methods // --------------------------------------------------------------------------- void XMLEntityDecl::setName(const XMLCh* const entName) { // Clean up the current name stuff if (fName) fMemoryManager->deallocate(fName); fName = XMLString::replicate(entName, fMemoryManager); } // --------------------------------------------------------------------------- // XMLEntityDecl: Private helper methods // --------------------------------------------------------------------------- void XMLEntityDecl::cleanUp() { fMemoryManager->deallocate(fName); fMemoryManager->deallocate(fNotationName); fMemoryManager->deallocate(fValue); fMemoryManager->deallocate(fPublicId); fMemoryManager->deallocate(fSystemId); fMemoryManager->deallocate(fBaseURI); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_NOCREATE(XMLEntityDecl) void XMLEntityDecl::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng.writeSize (fId); serEng.writeSize (fValueLen); serEng.writeString(fValue); serEng.writeString(fName); serEng.writeString(fNotationName); serEng.writeString(fPublicId); serEng.writeString(fSystemId); serEng.writeString(fBaseURI); serEng<>fIsExternal; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/XMLBufferMgr.hpp000644 000765 000024 00000014147 13241160335 023241 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLBufferMgr.hpp 673679 2008-07-03 13:50:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLBUFFERMGR_HPP) #define XERCESC_INCLUDE_GUARD_XMLBUFFERMGR_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLBufBid; /** * There are many places where XMLBuffer objects are needed. In order to * avoid either constantly creating and destroying them or maintaining a * fixed set and worrying about accidental reuse, a buffer manager can * provide a pool of buffers which can be temporarily used and then put * back into the pool. This provides a good compromise between performance * and easier maintenance. */ class XMLPARSER_EXPORT XMLBufferMgr : public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructor */ //@{ XMLBufferMgr(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); //@} /** @name Destructor */ //@{ ~XMLBufferMgr(); //@} // ----------------------------------------------------------------------- // Buffer management // ----------------------------------------------------------------------- XMLBuffer& bidOnBuffer(); void releaseBuffer(XMLBuffer& toRelease); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- XMLSize_t getBufferCount() const; XMLSize_t getAvailableBufferCount() const; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLBufferMgr(const XMLBufferMgr&); XMLBufferMgr& operator=(const XMLBufferMgr&); // ----------------------------------------------------------------------- // Private data members // // fBufCount // The count of buffers that have been allocated so far. // // fBufList; // The list of pointers to buffers that are loaned out. There will // never be a lot of them, so a flat list is good enough. // ----------------------------------------------------------------------- XMLSize_t fBufCount; MemoryManager* fMemoryManager; XMLBuffer** fBufList; }; inline XMLSize_t XMLBufferMgr::getBufferCount() const { return fBufCount; } inline XMLSize_t XMLBufferMgr::getAvailableBufferCount() const { XMLSize_t available = fBufCount; for (XMLSize_t index = 0; index < fBufCount && fBufList[index]; index++) { if (fBufList[index]->getInUse()) --available; } return available; } /** * XMLBufBid is a scoped based janitor that allows the scanner code to ask * for a buffer on a scoped basis and then insure that it gets freed back * into the pool no matter how the scope is exited (exception or normal exit.) */ class XMLBufBid : public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- XMLBufBid(XMLBufferMgr* const srcMgr) : fBuffer(srcMgr->bidOnBuffer()) , fMgr(srcMgr) { } ~XMLBufBid() { fMgr->releaseBuffer(fBuffer); } // ----------------------------------------------------------------------- // Buffer access // ----------------------------------------------------------------------- void append(const XMLCh toAppend) { fBuffer.append(toAppend); } void append(const XMLCh* const toAppend, const XMLSize_t count = 0) { fBuffer.append(toAppend, count); } const XMLBuffer& getBuffer() const { return fBuffer; } XMLBuffer& getBuffer() { return fBuffer; } const XMLCh* getRawBuffer() const { fBuffer.fBuffer[fBuffer.fIndex] = 0; return fBuffer.fBuffer; } XMLCh* getRawBuffer() { fBuffer.fBuffer[fBuffer.fIndex] = 0; return fBuffer.fBuffer; } XMLSize_t getLen() const { return fBuffer.fIndex; } bool isEmpty() const { return (fBuffer.fIndex == 0); } void reset() { fBuffer.reset(); } void set(const XMLCh* const chars, const XMLSize_t count = 0) { fBuffer.set(chars, count); } private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLBufBid(const XMLBufBid&); XMLBufBid& operator=(const XMLBufBid&); // ----------------------------------------------------------------------- // Private data members // // fBuffer // This is the buffer we got, and which we will release. // // fMgr // This is the buffer manager we got the buffer from. This is needed // to release the buffer later. // ----------------------------------------------------------------------- XMLBuffer& fBuffer; XMLBufferMgr* const fMgr; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/MemBufInputSource.cpp000644 000765 000024 00000006616 13241160335 024352 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: MemBufInputSource.cpp 553941 2007-07-06 16:14:22Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // MemBufInputSource: Constructors and Destructor // --------------------------------------------------------------------------- MemBufInputSource::MemBufInputSource( const XMLByte* const srcDocBytes , const XMLSize_t byteCount , const XMLCh* const bufId , const bool adoptBuffer , MemoryManager* const manager) : InputSource(bufId, manager) , fAdopted(adoptBuffer) , fByteCount(byteCount) , fCopyBufToStream(true) , fSrcBytes(srcDocBytes) { } MemBufInputSource::MemBufInputSource( const XMLByte* const srcDocBytes , const XMLSize_t byteCount , const char* const bufId , const bool adoptBuffer , MemoryManager* const manager) : InputSource(bufId, manager) , fAdopted(adoptBuffer) , fByteCount(byteCount) , fCopyBufToStream(true) , fSrcBytes(srcDocBytes) { } MemBufInputSource::~MemBufInputSource() { if (fAdopted) delete [] (XMLByte*)fSrcBytes; } void MemBufInputSource::resetMemBufInputSource(const XMLByte* const srcDocBytes , const XMLSize_t byteCount) { fByteCount = byteCount; fSrcBytes = srcDocBytes; } // --------------------------------------------------------------------------- // MemBufInputSource: InputSource interface implementation // --------------------------------------------------------------------------- BinInputStream* MemBufInputSource::makeStream() const { // // Create a memory input stream over our buffer. According to our // fCopyBufToStream flag, we either tell it to copy the buffer or to // just reference it. // return new (getMemoryManager()) BinMemInputStream ( fSrcBytes , fByteCount , fCopyBufToStream ? BinMemInputStream::BufOpt_Copy : BinMemInputStream::BufOpt_Reference , getMemoryManager() ); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/MemBufFormatTarget.hpp000644 000765 000024 00000010646 13241160335 024474 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: MemBufFormatTarget.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_MEMBUFFORMATTARGET_HPP) #define XERCESC_INCLUDE_GUARD_MEMBUFFORMATTARGET_HPP #include XERCES_CPP_NAMESPACE_BEGIN /* * The MemBufFormatTarget is a derivative from XMLFormatTarget, which user code * may plug into DOMLSSerializer to retrieve the serialized XML stream (from DOM Tree) * in a memory buffer. * * The MemBufFormatTarget is initialized to have a memory buffer of 1023 upon * construction, which grows as needed. The buffer will be deleted when * MemBufFormatTarget is destructed; or will be reset when the reset() function * is called. * * The MemBufFormatTarget returns a NULL terminated XMLByte stream upon request, * through the method getRawBuffer(), and user should make its own copy of the * returned buffer if it intends to keep it independent on the state of the * MemBufFormatTarget. */ class XMLPARSER_EXPORT MemBufFormatTarget : public XMLFormatTarget { public: /** @name constructors and destructor */ //@{ MemBufFormatTarget ( XMLSize_t initCapacity = 1023 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) ; ~MemBufFormatTarget(); //@} // ----------------------------------------------------------------------- // Implementations of the format target interface // ----------------------------------------------------------------------- virtual void writeChars(const XMLByte* const toWrite , const XMLSize_t count , XMLFormatter* const formatter); // ----------------------------------------------------------------------- // Getter // ----------------------------------------------------------------------- /** @name getRawBuffer */ //@{ /** * Returned the internal raw buffer. * */ //@} const XMLByte* getRawBuffer() const; /** @name getLen */ //@{ /** * Returned the length of the raw buffer. * */ //@} XMLSize_t getLen() const { return fIndex; } /** @name reset */ //@{ /** * Reset the internal string buffer. * */ void reset(); //@} private: // ----------------------------------------------------------------------- // Unimplemented methods. // ----------------------------------------------------------------------- MemBufFormatTarget(const MemBufFormatTarget&); MemBufFormatTarget& operator=(const MemBufFormatTarget&); // ----------------------------------------------------------------------- // Private helpers // ----------------------------------------------------------------------- void ensureCapacity(const XMLSize_t extraNeeded); // ----------------------------------------------------------------------- // Private data members // // fDataBuf // The pointer to the buffer data. Its grown as needed. Its always // one larger than fCapacity, to leave room for the null terminator. // // fIndex // The current index into the buffer, as characters are appended // to it. If its zero, then the buffer is empty. // // fCapacity // The current capacity of the buffer. Its actually always one // larger, to leave room for the null terminator. // // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; XMLByte* fDataBuf; XMLSize_t fIndex; XMLSize_t fCapacity; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/URLInputSource.hpp000644 000765 000024 00000020361 13241160335 023637 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: URLInputSource.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_URLINPUTSOURCE_HPP) #define XERCESC_INCLUDE_GUARD_URLINPUTSOURCE_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class BinInputStream; /** * This class is a derivative of the standard InputSource class. It provides * for the parser access to data which is referenced via a URL, as apposed to * a local file name. The URL can be provided via an XMLURL class, as a fully * qualified system id, or a base system id and a system id which may be * fully qualified or may be relative to the base. * * As with all InputSource derivatives. The primary objective of an input * source is to create an input stream via which the parser can spool in * data from the referenced source. * * Note that the parse system does not necessarily support URL based XML * entities out of the box. Support for socket based access is optional and * controlled by the per-platform support. */ class XMLPARSER_EXPORT URLInputSource : public InputSource { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * This constructor accepts an already built URL. It is assumed that * it is correct and it will be used as is. In this case, no public id * accepted, but it can still be set via the parent class' setPublicId() * method. * * @param urlId The URL which holds the system id of the entity * to parse. * @param manager Pointer to the memory manager to be used to * allocate objects. */ URLInputSource ( const XMLURL& urlId , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * This constructor takes a base system id URL and a possibly relative * system id. The relative part is parsed and, if it is indeed relative, * it will be made relative to the passed base id. Otherwise, it will be * taken as is. * * @param baseId The base system id URL which provides the base * for any relative id part. * * @param systemId The possibly relative system id URL. If its relative * its based on baseId, else its taken as is. * @param manager Pointer to the memory manager to be used to * allocate objects. */ URLInputSource ( const XMLCh* const baseId , const XMLCh* const systemId , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * This constructor is identical to the previous one, except that it also * allows you to set a public id if you want to. * * @param baseId The base system id URL which provides the base * for any relative id part. * * @param systemId The possibly relative system id URL. If its relative * its based on baseId, else its taken as is. * * @param publicId The optional public id to set. This is just passed * on to the parent class for storage. * * @param manager Pointer to the memory manager to be used to * allocate objects. */ URLInputSource ( const XMLCh* const baseId , const XMLCh* const systemId , const XMLCh* const publicId , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * This constructor is identical to the second constructor above, except that * it accepts the relative system id part as a local code page string and * just transcodes it internally, as a convenience. * * @param baseId The base system id URL which provides the base * for any relative id part. * * @param systemId The possibly relative system id URL. If its relative * its based on baseId, else its taken as is. * * @param manager Pointer to the memory manager to be used to * allocate objects. */ URLInputSource ( const XMLCh* const baseId , const char* const systemId , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * This constructor is identical to the third constructor above, except that * it accepts the relative and public ids as local code page strings and just * transcodes them internally, as a convenience. * * @param baseId The base system id URL which provides the base * for any relative id part. * * @param systemId The possibly relative system id URL. If its relative * its based on baseId, else its taken as is. * * @param publicId The optional public id to set. This is just passed * on to the parent class for storage. * on to the parent class for storage. * * @param manager Pointer to the memory manager to be used to * allocate objects. */ URLInputSource ( const XMLCh* const baseId , const char* const systemId , const char* const publicId , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** @name Destructor */ //@{ ~URLInputSource(); //@} // ----------------------------------------------------------------------- // Virtual input source interface // ----------------------------------------------------------------------- /** @name Virtual methods */ //@{ /** * This method will return a binary input stream derivative that will * parse from the source referred to by the URL system id. */ BinInputStream* makeStream() const; //@} // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** @name Getter methods */ //@{ /** * This method will return a const reference to the URL member which * contains the system id in pre-parsed URL form. If you just want the * string format, call getSystemId() on the parent class. * * @return A const reference to a URL object that contains the current * system id set for this input source. */ const XMLURL& urlSrc() const; //@} private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- URLInputSource(const URLInputSource&); URLInputSource& operator=(const URLInputSource&); // ----------------------------------------------------------------------- // Private data members // // fURL // This is the URL created from the passed ids. // ----------------------------------------------------------------------- XMLURL fURL; }; inline const XMLURL& URLInputSource::urlSrc() const { return fURL; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/StdInInputSource.hpp000644 000765 000024 00000006506 13241160335 024223 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: StdInInputSource.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_STDININPUTSOURCE_HPP) #define XERCESC_INCLUDE_GUARD_STDININPUTSOURCE_HPP #include XERCES_CPP_NAMESPACE_BEGIN class BinInputStream; /** * This class is a derivative of the standard InputSource class. It provides * for the parser access to data via the standard input. This input source * is not commonly used, but can be useful when implementing such things * as pipe based tools which exchange XML data. * * As with all InputSource derivatives. The primary objective of an input * source is to create an input stream via which the parser can spool in * data from the referenced source. */ class XMLPARSER_EXPORT StdInInputSource : public InputSource { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructor */ //@{ /** * Since the standard input is a canned source, the constructor is very * simple. It just uses local platform services to open up the standard * input source as file, a new handleof which it gives to each new stream * it creates. */ StdInInputSource(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); //@} /** @name Destructor */ //@{ ~StdInInputSource(); //@} // ----------------------------------------------------------------------- // Virtual input source interface // ----------------------------------------------------------------------- /** @name Virtual methods */ //@{ /** * This method will return a binary input stream derivative that will * parse from the standard input of the local host. * * @return A dynamically allocated binary input stream derivative that * can parse from the standardinput. */ BinInputStream* makeStream() const; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- StdInInputSource(const StdInInputSource&); StdInInputSource& operator=(const StdInInputSource&); }; inline StdInInputSource::StdInInputSource(MemoryManager* const manager) : InputSource("stdin", manager) { } inline StdInInputSource::~StdInInputSource() { } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLElementDecl.cpp000644 000765 000024 00000011510 13241160334 023524 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: XMLElementDecl.cpp 679359 2008-07-24 11:15:19Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLElementDecl: Public, static data // --------------------------------------------------------------------------- const unsigned int XMLElementDecl::fgInvalidElemId = 0xFFFFFFFE; const unsigned int XMLElementDecl::fgPCDataElemId = 0xFFFFFFFF; const XMLCh XMLElementDecl::fgPCDataElemName[] = { chPound, chLatin_P, chLatin_C, chLatin_D, chLatin_A , chLatin_T, chLatin_A, chNull }; // --------------------------------------------------------------------------- // XMLElementDecl: Destructor // --------------------------------------------------------------------------- XMLElementDecl::~XMLElementDecl() { delete fElementName; } // --------------------------------------------------------------------------- // XMLElementDecl: Setter Methods // --------------------------------------------------------------------------- void XMLElementDecl::setElementName(const XMLCh* const prefix , const XMLCh* const localPart , const int uriId ) { if (fElementName) fElementName->setName(prefix, localPart, uriId); else fElementName = new (fMemoryManager) QName(prefix, localPart, uriId, fMemoryManager); } void XMLElementDecl::setElementName(const XMLCh* const rawName , const int uriId ) { if (fElementName) fElementName->setName(rawName, uriId); else fElementName = new (fMemoryManager) QName(rawName, uriId, fMemoryManager); } void XMLElementDecl::setElementName(const QName* const elementName) { if (fElementName) fElementName->setValues(*elementName); else fElementName = new (fMemoryManager) QName(*elementName); } // --------------------------------------------------------------------------- // ElementDecl: Hidden constructors // --------------------------------------------------------------------------- XMLElementDecl::XMLElementDecl(MemoryManager* const manager) : fMemoryManager(manager) , fElementName(0) , fCreateReason(XMLElementDecl::NoReason) , fId(XMLElementDecl::fgInvalidElemId) , fExternalElement(false) { } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_NOCREATE(XMLElementDecl) void XMLElementDecl::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng<>fElementName; int i; serEng>>i; fCreateReason=(CreateReasons)i; serEng.readSize (fId); serEng>>fExternalElement; } } void XMLElementDecl::storeElementDecl(XSerializeEngine& serEng , XMLElementDecl* const element) { if (element) { serEng<<(int) element->getObjectType(); serEng<>type; switch((XMLElementDecl::objectType)type) { case Schema: SchemaElementDecl* schemaElementDecl; serEng>>schemaElementDecl; return schemaElementDecl; case DTD: DTDElementDecl* dtdElementDecl; serEng>>dtdElementDecl; return dtdElementDecl; case UnKnown: //fall through default: return 0; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/XMLRecognizer.hpp000644 000765 000024 00000011762 13241160334 023470 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLRecognizer.hpp 555320 2007-07-11 16:05:13Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLRECOGNIZER_HPP) #define XERCESC_INCLUDE_GUARD_XMLRECOGNIZER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * This class provides some simple code to recognize the encodings of * XML files. This recognition only does very basic sensing of the encoding * in a broad sense. Basically its just enough to let us get started and * read the XMLDecl line. The scanner, once it reads the XMLDecl, will * tell the reader any actual encoding string it found and the reader can * update itself to be more specific at that point. */ class XMLPARSER_EXPORT XMLRecognizer { public : // ----------------------------------------------------------------------- // Class types // // This enum represents the various encoding families that we have to // deal with individually at the scanner level. This does not indicate // the exact encoding, just the rough family that would let us scan // the XML/TextDecl to find the encoding string. // // The 'L's and 'B's stand for little or big endian. // // OtherEncoding means that its some transcoder based encoding, i.e. not // one of the ones that we do internally. Its a special case and should // never be used directly outside of the reader. // // NOTE: Keep this in sync with the name map array in the Cpp file!! // ----------------------------------------------------------------------- enum Encodings { EBCDIC = 0 , UCS_4B = 1 , UCS_4L = 2 , US_ASCII = 3 , UTF_8 = 4 , UTF_16B = 5 , UTF_16L = 6 , XERCES_XMLCH = 7 , Encodings_Count , Encodings_Min = EBCDIC , Encodings_Max = XERCES_XMLCH , OtherEncoding = 999 }; // ----------------------------------------------------------------------- // Public, const static data // // These are the byte sequences for each of the encodings that we can // auto sense, and their lengths. // ----------------------------------------------------------------------- static const char fgASCIIPre[]; static const XMLSize_t fgASCIIPreLen; static const XMLByte fgEBCDICPre[]; static const XMLSize_t fgEBCDICPreLen; static const XMLByte fgUTF16BPre[]; static const XMLByte fgUTF16LPre[]; static const XMLSize_t fgUTF16PreLen; static const XMLByte fgUCS4BPre[]; static const XMLByte fgUCS4LPre[]; static const XMLSize_t fgUCS4PreLen; static const char fgUTF8BOM[]; static const XMLSize_t fgUTF8BOMLen; // ----------------------------------------------------------------------- // Encoding recognition methods // ----------------------------------------------------------------------- static Encodings basicEncodingProbe ( const XMLByte* const rawBuffer , const XMLSize_t rawByteCount ); static Encodings encodingForName ( const XMLCh* const theEncName ); static const XMLCh* nameForEncoding(const Encodings theEncoding , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); protected : // ----------------------------------------------------------------------- // Unimplemented constructors, operators, and destructor // // This class is effectively being used as a namespace for some static // methods. // // (these functions are protected rather than private only to get rid of // some annoying compiler warnings.) // // ----------------------------------------------------------------------- XMLRecognizer(); ~XMLRecognizer(); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLRecognizer(const XMLRecognizer&); XMLRecognizer& operator=(const XMLRecognizer&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/XMLGrammarPoolImpl.cpp000644 000765 000024 00000024106 13241160335 024413 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLGrammarPoolImpl.cpp 676823 2008-07-15 07:57:44Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // private function used to update fXSModel void XMLGrammarPoolImpl::createXSModel() { delete fXSModel; fXSModel = 0; fXSModel = new (getMemoryManager()) XSModel(this, getMemoryManager()); fXSModelIsValid = true; } // --------------------------------------------------------------------------- // XMLGrammarPoolImpl: constructor and destructor // --------------------------------------------------------------------------- XMLGrammarPoolImpl::~XMLGrammarPoolImpl() { delete fGrammarRegistry; delete fStringPool; if(fSynchronizedStringPool) delete fSynchronizedStringPool; if(fXSModel) delete fXSModel; } XMLGrammarPoolImpl::XMLGrammarPoolImpl(MemoryManager* const memMgr) :XMLGrammarPool(memMgr) ,fGrammarRegistry(0) ,fStringPool(0) ,fSynchronizedStringPool(0) ,fXSModel(0) ,fLocked(false) ,fXSModelIsValid(false) { fGrammarRegistry = new (memMgr) RefHashTableOf(29, true, memMgr); fStringPool = new (memMgr) XMLStringPool(109, memMgr); } // ----------------------------------------------------------------------- // Implementation of Grammar Pool Interface // ----------------------------------------------------------------------- bool XMLGrammarPoolImpl::cacheGrammar(Grammar* const gramToCache ) { if(fLocked || !gramToCache) return false; const XMLCh* grammarKey = gramToCache->getGrammarDescription()->getGrammarKey(); if (fGrammarRegistry->containsKey(grammarKey)) { return false; } fGrammarRegistry->put((void*) grammarKey, gramToCache); if (fXSModelIsValid && gramToCache->getGrammarType() == Grammar::SchemaGrammarType) { fXSModelIsValid = false; } return true; } Grammar* XMLGrammarPoolImpl::retrieveGrammar(XMLGrammarDescription* const gramDesc) { if (!gramDesc) return 0; /*** * This implementation simply use GrammarKey */ return fGrammarRegistry->get(gramDesc->getGrammarKey()); } Grammar* XMLGrammarPoolImpl::orphanGrammar(const XMLCh* const nameSpaceKey) { if (!fLocked) { Grammar* grammar = fGrammarRegistry->orphanKey(nameSpaceKey); if (fXSModelIsValid && grammar && grammar->getGrammarType() == Grammar::SchemaGrammarType) { fXSModelIsValid = false; } return grammar; } return 0; } RefHashTableOfEnumerator XMLGrammarPoolImpl::getGrammarEnumerator() const { return RefHashTableOfEnumerator(fGrammarRegistry, false, fGrammarRegistry->getMemoryManager()); } bool XMLGrammarPoolImpl::clear() { if (!fLocked) { fGrammarRegistry->removeAll(); fXSModelIsValid = false; if (fXSModel) { delete fXSModel; fXSModel = 0; } return true; } return false; } void XMLGrammarPoolImpl::lockPool() { if (!fLocked) { fLocked = true; MemoryManager *memMgr = getMemoryManager(); if(!fSynchronizedStringPool) { fSynchronizedStringPool = new (memMgr) XMLSynchronizedStringPool(fStringPool, 109, memMgr); } if (!fXSModelIsValid) { createXSModel(); } } } void XMLGrammarPoolImpl::unlockPool() { if (fLocked) { fLocked = false; if(fSynchronizedStringPool) { fSynchronizedStringPool->flushAll(); // if user calls Lock again, need to have null fSynchronizedStringPool delete fSynchronizedStringPool; fSynchronizedStringPool = 0; } fXSModelIsValid = false; if (fXSModel) { delete fXSModel; fXSModel = 0; } } } // ----------------------------------------------------------------------- // Implementation of Factory Interface // ----------------------------------------------------------------------- DTDGrammar* XMLGrammarPoolImpl::createDTDGrammar() { return new (getMemoryManager()) DTDGrammar(getMemoryManager()); } SchemaGrammar* XMLGrammarPoolImpl::createSchemaGrammar() { return new (getMemoryManager()) SchemaGrammar(getMemoryManager()); } XMLDTDDescription* XMLGrammarPoolImpl::createDTDDescription(const XMLCh* const systemId) { return new (getMemoryManager()) XMLDTDDescriptionImpl(systemId, getMemoryManager()); } XMLSchemaDescription* XMLGrammarPoolImpl::createSchemaDescription(const XMLCh* const targetNamespace) { return new (getMemoryManager()) XMLSchemaDescriptionImpl(targetNamespace, getMemoryManager()); } XSModel *XMLGrammarPoolImpl::getXSModel(bool& XSModelWasChanged) { XSModelWasChanged = false; if (fLocked || fXSModelIsValid) return fXSModel; createXSModel(); XSModelWasChanged = true; return fXSModel; } XMLStringPool *XMLGrammarPoolImpl::getURIStringPool() { if(fLocked) return fSynchronizedStringPool; return fStringPool; } // ----------------------------------------------------------------------- // serialization and deserialization support // ----------------------------------------------------------------------- /*** * * don't serialize * * XMLSynchronizedStringPool* fSynchronizedStringPool; */ /*** * .non-empty gramamrRegistry ***/ void XMLGrammarPoolImpl::serializeGrammars(BinOutputStream* const binOut) { RefHashTableOfEnumerator grammarEnum(fGrammarRegistry, false, getMemoryManager()); if (!(grammarEnum.hasMoreElements())) { ThrowXMLwithMemMgr(XSerializationException, XMLExcepts::XSer_GrammarPool_Empty, getMemoryManager()); } XSerializeEngine serEng(binOut, this); //version information serEng<<(unsigned int)XERCES_GRAMMAR_SERIALIZATION_LEVEL; //lock status serEng<serialize(serEng); /*** * Serialize RefHashTableOf* fGrammarRegistry; ***/ XTemplateSerializer::storeObject(fGrammarRegistry, serEng); } /*** * .empty stringPool * .empty gramamrRegistry ***/ void XMLGrammarPoolImpl::deserializeGrammars(BinInputStream* const binIn) { MemoryManager *memMgr = getMemoryManager(); unsigned int stringCount = fStringPool->getStringCount(); if (stringCount) { /*** * it contains only the four predefined one, that is ok * but we need to reset the string before deserialize it * ***/ if ( stringCount <= 4 ) { fStringPool->flushAll(); } else { ThrowXMLwithMemMgr(XSerializationException, XMLExcepts::XSer_StringPool_NotEmpty, memMgr); } } RefHashTableOfEnumerator grammarEnum(fGrammarRegistry, false, memMgr); if (grammarEnum.hasMoreElements()) { ThrowXMLwithMemMgr(XSerializationException, XMLExcepts::XSer_GrammarPool_NotEmpty, memMgr); } // This object will take care of cleaning up if an exception is // thrown during deserialization. JanitorMemFunCall cleanup(this, &XMLGrammarPoolImpl::cleanUp); try { XSerializeEngine serEng(binIn, this); //version information unsigned int StorerLevel; serEng>>StorerLevel; serEng.fStorerLevel = StorerLevel; // The storer level must match the loader level. // if (StorerLevel != (unsigned int)XERCES_GRAMMAR_SERIALIZATION_LEVEL) { XMLCh StorerLevelChar[5]; XMLCh LoaderLevelChar[5]; XMLString::binToText(StorerLevel, StorerLevelChar, 4, 10, memMgr); XMLString::binToText(XERCES_GRAMMAR_SERIALIZATION_LEVEL, LoaderLevelChar, 4, 10, memMgr); ThrowXMLwithMemMgr2(XSerializationException , XMLExcepts::XSer_Storer_Loader_Mismatch , StorerLevelChar , LoaderLevelChar , memMgr); } //lock status serEng>>fLocked; //StringPool, don't use >> fStringPool->serialize(serEng); /*** * Deserialize RefHashTableOf* fGrammarRegistry; ***/ XTemplateSerializer::loadObject(&fGrammarRegistry, 29, true, serEng); } catch(const OutOfMemoryException&) { // This is a special case, because we don't want // to execute cleanup code on out-of-memory // conditions. cleanup.release(); throw; } // Everything is OK, so we can release the cleanup object. cleanup.release(); if (fLocked) { createXSModel(); } } void XMLGrammarPoolImpl::cleanUp() { fLocked = false; clear(); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/XMLAttr.hpp000644 000765 000024 00000044172 13241160334 022274 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLAttr.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLATTR_HPP) #define XERCESC_INCLUDE_GUARD_XMLATTR_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN /** * This class defines the information about an attribute that will come out * of the scanner during parsing. This information does not depend upon the * type of validator because it is not tied to any scheme/DTD type info. Its * just the raw XML 1.0 information that will be reported about an attribute * in the startElement() callback method of the XMLDocumentHandler class. * Hence it is not intended to be extended or derived from. Its designed to * be used as is. * * The 'specified' field of this class indicates whether the attribute was * actually present or whether it was faulted in because it had a fixed or * default value. * * The code receiving this information can ask its validator for more info * about the attribute, i.e. get its declaration from the DTD/Schema info. * * Because of the heavy use (and reuse) of instances of this class, and the * number of string members it has, this class takes pains to not reallocate * string members unless it has to. It keeps up with how long each buffer * is and only reallocates if the new value won't fit. */ class XMLPARSER_EXPORT XMLAttr : public XMemory { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor just setsup an empty attribute to be filled * in the later. Though the initial state is a reasonable one, it is * not documented because it should not be depended on. * * @param manager The configurable memory manager */ XMLAttr(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * This is the primary constructor which takes all of the information * required to construct a complete attribute object. * * @param uriId The id into the validator's URI pool of the URI * that the prefix mapped to. Only used if namespaces * are enabled/supported. * * @param attrName The base name of the attribute, i.e. the part * after any prefix. * * @param attrPrefix The prefix, if any, of this attribute's name. If * this is empty, then uriID is meaningless as well. * * @param attrValue The value string of the attribute, which should * be fully normalized by XML rules! * * @param type The type of the attribute. This will indicate * the type of normalization done and constrains * the value content. Make sure that the value * set meets the constraints! * * @param specified Indicates whether the attribute was explicitly * specified or not. If not, then it was faulted * in from a FIXED or DEFAULT value. * * @param manager The configurable memory manager * @param datatypeValidator type used to validate the attribute, * if it was validated by an XML Schema * @param isSchema true if and only if this attribute was validated * by an XML Schema */ XMLAttr ( const unsigned int uriId , const XMLCh* const attrName , const XMLCh* const attrPrefix , const XMLCh* const attrValue , const XMLAttDef::AttTypes type = XMLAttDef::CData , const bool specified = true , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager , DatatypeValidator * datatypeValidator = 0 , const bool isSchema = false ); /** * This is the primary constructor which takes all of the information * required to construct a complete attribute object. * * @param uriId The id into the validator's URI pool of the URI * that the prefix mapped to. Only used if namespaces * are enabled/supported. * * @param rawName The raw name of the attribute. * * @param attrValue The value string of the attribute, which should * be fully normalized by XML rules! * * @param type The type of the attribute. This will indicate * the type of normalization done and constrains * the value content. Make sure that the value * set meets the constraints! * * @param specified Indicates whether the attribute was explicitly * specified or not. If not, then it was faulted * in from a FIXED or DEFAULT value. * * @param manager The configurable memory manager * @param datatypeValidator type used to validate the attribute, * if it was validated by an XML Schema * @param isSchema true if and only if this attribute was validated * by an XML Schema */ XMLAttr ( const unsigned int uriId , const XMLCh* const rawName , const XMLCh* const attrValue , const XMLAttDef::AttTypes type = XMLAttDef::CData , const bool specified = true , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager , DatatypeValidator * datatypeValidator = 0 , const bool isSchema = false ); //@} /** @name Destructor */ //@{ ~XMLAttr(); //@} // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** @name Getter methods */ //@{ /** * This method returns the attribute name in a QName format. */ QName* getAttName() const; /** * This method gets a const pointer to the name of the attribute. The * form of this name is defined by the validator in use. */ const XMLCh* getName() const; /** * This method will get a const pointer to the prefix string of this * attribute. Since prefixes are optional, it may be zero. */ const XMLCh* getPrefix() const; /** * This method will get the QName of this attribute, which will be the * prefix if any, then a colon, then the base name. If there was no * prefix, its the same as the getName() method. */ const XMLCh* getQName() const; /** * This method will get the specified flag, which indicates whether * the attribute was explicitly specified or just faulted in. */ bool getSpecified() const; /** * This method will get the type of the attribute. The available types * are defined by the XML specification. */ XMLAttDef::AttTypes getType() const; /** * This method will get the value of the attribute. The value can be * be an empty string, but never null if the object is correctly * set up. */ const XMLCh* getValue() const; /** * This method will get the id of the URI that this attribute's prefix * mapped to. If namespaces are not on, then its value is meaningless. */ unsigned int getURIId() const; //@} // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** @name Setter methods */ //@{ /** * This method is called to set up a default constructed object after * the fact, or to reuse a previously used object. * * @param uriId The id into the validator's URI pool of the URI * that the prefix mapped to. Only used if namespaces * are enabled/supported. * * @param attrName The base name of the attribute, i.e. the part * after any prefix. * * @param attrPrefix The prefix, if any, of this attribute's name. If * this is empty, then uriID is meaningless as well. * * @param attrValue The value string of the attribute, which should * be fully normalized by XML rules according to the * attribute type. * * @param type The type of the attribute. This will indicate * the type of normalization done and constrains * the value content. Make sure that the value * set meets the constraints! * @param datatypeValidator type used to validate the attribute, * if it was validated by an XML Schema * @param isSchema true if and only if this attribute was validated * by an XML Schema * */ void set ( const unsigned int uriId , const XMLCh* const attrName , const XMLCh* const attrPrefix , const XMLCh* const attrValue , const XMLAttDef::AttTypes type = XMLAttDef::CData , DatatypeValidator * datatypeValidator = 0 , const bool isSchema = false ); /** * This method is called to set up a default constructed object after * the fact, or to reuse a previously used object. * * @param uriId The id into the validator's URI pool of the URI * that the prefix mapped to. Only used if namespaces * are enabled/supported. * * @param attrRawName The raw name of the attribute. * * @param attrValue The value string of the attribute, which should * be fully normalized by XML rules according to the * attribute type. * * @param type The type of the attribute. This will indicate * the type of normalization done and constrains * the value content. Make sure that the value * set meets the constraints! * @param datatypeValidator type used to validate the attribute, * if it was validated by an XML Schema * @param isSchema true if and only if this attribute was validated * by an XML Schema */ void set ( const unsigned int uriId , const XMLCh* const attrRawName , const XMLCh* const attrValue , const XMLAttDef::AttTypes type = XMLAttDef::CData , DatatypeValidator * datatypeValidator = 0 , const bool isSchema = false ); /** * This method will update just the name related fields of the * attribute object. The other fields are left as is. * * @param uriId The id into the validator's URI pool of the URI * that the prefix mapped to. Only used if namespaces * are enabled/supported. * * @param attrName The base name of the attribute, i.e. the part * after any prefix. * * @param attrPrefix The prefix, if any, of this attribute's name. If * this is empty, then uriID is meaningless as well. */ void setName ( const unsigned int uriId , const XMLCh* const attrName , const XMLCh* const attrPrefix ); /** * This method will update the specified state of the object. * * @param newValue Indicates whether the attribute was explicitly * specified or not. If not, then it was faulted * in from a FIXED or DEFAULT value. */ void setSpecified(const bool newValue); /** * This method will update the attribute type of the object. * * @param newType The type of the attribute. This will indicate * the type of normalization done and constrains * the value content. Make sure that the value * set meets the constraints! */ void setType(const XMLAttDef::AttTypes newType); /** * This method will update the value field of the attribute. * * @param newValue The value string of the attribute, which should * be fully normalized by XML rules according to the * attribute type. */ void setValue(const XMLCh* const newValue); /** * This method will set the URI id field of this attribute. This is * generally only ever called internally by the parser itself during * the parsing process. * * @param uriId The uriId of the attribute. */ void setURIId(const unsigned int uriId); //@} private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLAttr(const XMLAttr&); XMLAttr& operator=(const XMLAttr&); // ----------------------------------------------------------------------- // Private, helper methods // ----------------------------------------------------------------------- void cleanUp(); // ----------------------------------------------------------------------- // Private instance variables // // fAttName // The Attribute Name; // // fSpecified // True if this attribute appeared in the element; else, false if // it was defaulted from an AttDef. // // fType // The attribute type enum value for this attribute. Indicates what // type of attribute it was. // // fValue // fValueBufSz // The attribute value that was given in the attribute instance, and // its current buffer size (minus one, where the null is.) // // fMemoryManager // The memory manager used for dynamic memory allocation/deallocation // ----------------------------------------------------------------------- bool fSpecified; XMLAttDef::AttTypes fType; XMLSize_t fValueBufSz; XMLCh* fValue; QName* fAttName; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // XMLAttr: Constructors and Destructor // --------------------------------------------------------------------------- inline XMLAttr::~XMLAttr() { cleanUp(); } // --------------------------------------------------------------------------- // XMLAttr: Getter methods // --------------------------------------------------------------------------- inline QName* XMLAttr::getAttName() const { return fAttName; } inline const XMLCh* XMLAttr::getName() const { return fAttName->getLocalPart(); } inline const XMLCh* XMLAttr::getPrefix() const { return fAttName->getPrefix(); } inline bool XMLAttr::getSpecified() const { return fSpecified; } inline XMLAttDef::AttTypes XMLAttr::getType() const { return fType; } inline const XMLCh* XMLAttr::getValue() const { return fValue; } inline unsigned int XMLAttr::getURIId() const { return fAttName->getURI(); } // --------------------------------------------------------------------------- // XMLAttr: Setter methods // --------------------------------------------------------------------------- inline void XMLAttr::set(const unsigned int uriId , const XMLCh* const attrName , const XMLCh* const attrPrefix , const XMLCh* const attrValue , const XMLAttDef::AttTypes type , DatatypeValidator * /*datatypeValidator */ , const bool /*isSchema*/ ) { // Set the name info and the value via their respective calls fAttName->setName(attrPrefix, attrName, uriId); setValue(attrValue); // And store the type fType = type; } inline void XMLAttr::set(const unsigned int uriId , const XMLCh* const attrRawName , const XMLCh* const attrValue , const XMLAttDef::AttTypes type , DatatypeValidator * /*datatypeValidator */ , const bool /*isSchema*/ ) { // Set the name info and the value via their respective calls fAttName->setName(attrRawName, uriId); setValue(attrValue); // And store the type fType = type; } inline void XMLAttr::setType(const XMLAttDef::AttTypes newValue) { fType = newValue; } inline void XMLAttr::setSpecified(const bool newValue) { fSpecified = newValue; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/LocalFileFormatTarget.cpp000644 000765 000024 00000011125 13241160335 025137 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: LocalFileFormatTarget.cpp 1603373 2014-06-18 08:49:41Z amassari $ */ #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN const XMLSize_t MAX_BUFFER_SIZE = 65536; LocalFileFormatTarget::LocalFileFormatTarget( const XMLCh* const fileName , MemoryManager* const manager) : fSource(0) , fDataBuf(0) , fIndex(0) , fCapacity(1024) , fMemoryManager(manager) { fSource = XMLPlatformUtils::openFileToWrite(fileName, manager); if (fSource == (FileHandle) XERCES_Invalid_File_Handle) ThrowXMLwithMemMgr1(IOException, XMLExcepts::File_CouldNotOpenFile, fileName, fMemoryManager); fDataBuf = (XMLByte*) fMemoryManager->allocate ( fCapacity * sizeof(XMLByte)); } LocalFileFormatTarget::LocalFileFormatTarget( const char* const fileName , MemoryManager* const manager) : fSource(0) , fDataBuf(0) , fIndex(0) , fCapacity(1024) , fMemoryManager(manager) { fSource = XMLPlatformUtils::openFileToWrite(fileName, manager); if (fSource == (FileHandle) XERCES_Invalid_File_Handle) ThrowXMLwithMemMgr1(IOException, XMLExcepts::File_CouldNotOpenFile, fileName, fMemoryManager); fDataBuf = (XMLByte*) fMemoryManager->allocate ( fCapacity * sizeof(XMLByte)); } LocalFileFormatTarget::~LocalFileFormatTarget() { if (fSource && fSource != (FileHandle) XERCES_Invalid_File_Handle) { try { // flush remaining buffer before destroy flush(); } catch (...) { // There is nothing we can do about it here. } // XERCESC-2024: use separate try/catch so that we close the handle // even when flush() failed (e.g. because of a disk full) try { XMLPlatformUtils::closeFile(fSource, fMemoryManager); } catch (...) { // There is nothing we can do about it here. } } fMemoryManager->deallocate(fDataBuf);//delete [] fDataBuf; } void LocalFileFormatTarget::flush() { XMLPlatformUtils::writeBufferToFile(fSource, fIndex, fDataBuf, fMemoryManager); fIndex = 0; } void LocalFileFormatTarget::writeChars(const XMLByte* const toWrite , const XMLSize_t count , XMLFormatter * const) { if (count == 0) return; if (count < MAX_BUFFER_SIZE) { // If we don't have enough space, see if we can grow the buffer. // if (fIndex + count > fCapacity && fCapacity < MAX_BUFFER_SIZE) ensureCapacity (count); // If still not enough space, flush the buffer. // if (fIndex + count > fCapacity) flush(); memcpy(&fDataBuf[fIndex], toWrite, count * sizeof(XMLByte)); fIndex += count; } else { // block is too big to cache, flush the current cache... // if (fIndex) flush(); //... then write the data directly to disk // XMLPlatformUtils::writeBufferToFile(fSource, count, toWrite, fMemoryManager); } } void LocalFileFormatTarget::ensureCapacity(const XMLSize_t extraNeeded) { XMLSize_t newCap = fCapacity * 2; while (fIndex + extraNeeded > newCap) newCap *= 2; XMLByte* newBuf = (XMLByte*) fMemoryManager->allocate ( newCap * sizeof(XMLByte)); // Copy over the old stuff memcpy(newBuf, fDataBuf, fIndex * sizeof(XMLByte)); // Clean up old buffer and store new stuff fMemoryManager->deallocate(fDataBuf); fDataBuf = newBuf; fCapacity = newCap; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/XMLContentModel.cpp000644 000765 000024 00000003010 13241160335 023733 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: XMLContentModel.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // public static data // --------------------------------------------------------------------------- const unsigned int XMLContentModel::gInvalidTrans = 0xFFFFFFFF; const unsigned int XMLContentModel::gEOCFakeId = 0xFFFFFFF1; const unsigned int XMLContentModel::gEpsilonFakeId = 0xFFFFFFF2; XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/XMLRefInfo.cpp000644 000765 000024 00000003207 13241160335 022700 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLRefInfo.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(XMLRefInfo) void XMLRefInfo::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng<>fDeclared; serEng>>fUsed; serEng.readString(fRefName); } } XMLRefInfo::XMLRefInfo(MemoryManager* const manager) :fDeclared(false) ,fUsed(false) ,fRefName(0) ,fMemoryManager(manager) { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/XMLSchemaDescription.hpp000644 000765 000024 00000011506 13241160335 024762 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLSchemaDescription.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLSCHEMADESCRIPTION_HPP) #define XERCESC_INCLUDE_GUARD_XMLSCHEMADESCRIPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN typedef const XMLCh* const LocationHint; class XMLPARSER_EXPORT XMLSchemaDescription : public XMLGrammarDescription { public : // ----------------------------------------------------------------------- /** @name Virtual destructor for derived classes */ // ----------------------------------------------------------------------- //@{ /** * virtual destructor * */ virtual ~XMLSchemaDescription(); //@} // ----------------------------------------------------------------------- /** @name Implementation of Grammar Description Interface */ // ----------------------------------------------------------------------- //@{ /** * getGrammarType * */ virtual Grammar::GrammarType getGrammarType() const { return Grammar::SchemaGrammarType; } //@} // ----------------------------------------------------------------------- /** @name The SchemaDescription Interface */ // ----------------------------------------------------------------------- //@{ enum ContextType { CONTEXT_INCLUDE, CONTEXT_REDEFINE, CONTEXT_IMPORT, CONTEXT_PREPARSE, CONTEXT_INSTANCE, CONTEXT_ELEMENT, CONTEXT_ATTRIBUTE, CONTEXT_XSITYPE, CONTEXT_UNKNOWN }; /** * getContextType * */ virtual ContextType getContextType() const = 0; /** * getTargetNamespace * */ virtual const XMLCh* getTargetNamespace() const = 0; /** * getLocationHints * */ virtual const RefArrayVectorOf* getLocationHints() const = 0; /** * getTriggeringComponent * */ virtual const QName* getTriggeringComponent() const = 0; /** * getenclosingElementName * */ virtual const QName* getEnclosingElementName() const = 0; /** * getAttributes * */ virtual const XMLAttDef* getAttributes() const = 0; /** * setContextType * */ virtual void setContextType(ContextType) = 0; /** * setTargetNamespace * */ virtual void setTargetNamespace(const XMLCh* const) = 0; /** * setLocationHints * */ virtual void setLocationHints(const XMLCh* const) = 0; /** * setTriggeringComponent * */ virtual void setTriggeringComponent(QName* const) = 0; /** * getenclosingElementName * */ virtual void setEnclosingElementName(QName* const) = 0; /** * setAttributes * */ virtual void setAttributes(XMLAttDef* const) = 0; //@} /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLSchemaDescription) protected : // ----------------------------------------------------------------------- /** Hidden Constructors */ // ----------------------------------------------------------------------- //@{ XMLSchemaDescription(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager); //@} private : // ----------------------------------------------------------------------- /** name Unimplemented copy constructor and operator= */ // ----------------------------------------------------------------------- //@{ XMLSchemaDescription(const XMLSchemaDescription& ); XMLSchemaDescription& operator=(const XMLSchemaDescription& ); //@} }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/Wrapper4DOMLSInput.cpp000644 000765 000024 00000013040 13241160335 024306 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Wrapper4DOMLSInput.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Wrapper4DOMLSInput: Constructor and Destructor // --------------------------------------------------------------------------- Wrapper4DOMLSInput::Wrapper4DOMLSInput(DOMLSInput* const inputSource, DOMLSResourceResolver* entityResolver, const bool adoptFlag, MemoryManager* const manager) : InputSource(manager) , fAdoptInputSource(adoptFlag) , fForceXMLChEncoding(false) , fInputSource(inputSource) , fEntityResolver(entityResolver) { if (!inputSource) ThrowXMLwithMemMgr(NullPointerException, XMLExcepts::CPtr_PointerIsZero, getMemoryManager()); } Wrapper4DOMLSInput::~Wrapper4DOMLSInput() { if (fAdoptInputSource) delete fInputSource; } // --------------------------------------------------------------------------- // Wrapper4DOMLSInput: Getter methods // --------------------------------------------------------------------------- bool Wrapper4DOMLSInput::getIssueFatalErrorIfNotFound() const { return fInputSource->getIssueFatalErrorIfNotFound(); } const XMLCh* Wrapper4DOMLSInput::getEncoding() const { if(fForceXMLChEncoding) return XMLUni::fgXMLChEncodingString; return fInputSource->getEncoding(); } const XMLCh* Wrapper4DOMLSInput::getSystemId() const { return fInputSource->getSystemId(); } const XMLCh* Wrapper4DOMLSInput::getPublicId() const { return fInputSource->getPublicId(); } // --------------------------------------------------------------------------- // Wrapper4DOMLSInput: Setter methods // --------------------------------------------------------------------------- void Wrapper4DOMLSInput::setIssueFatalErrorIfNotFound(const bool flag) { fInputSource->setIssueFatalErrorIfNotFound(flag); } void Wrapper4DOMLSInput::setEncoding(const XMLCh* const encodingStr) { fInputSource->setEncoding(encodingStr); } void Wrapper4DOMLSInput::setPublicId(const XMLCh* const publicId) { fInputSource->setPublicId(publicId); } void Wrapper4DOMLSInput::setSystemId(const XMLCh* const systemId) { fInputSource->setSystemId(systemId); } // --------------------------------------------------------------------------- // Wrapper4DOMLSInput: Stream methods // --------------------------------------------------------------------------- BinInputStream* Wrapper4DOMLSInput::makeStream() const { // The LSParser will use the LSInput object to determine how to read data. The LSParser will look at the different inputs specified in the // LSInput in the following order to know which one to read from, the first one that is not null and not an empty string will be used: // 1. LSInput.characterStream // 2. LSInput.byteStream // 3. LSInput.stringData // 4. LSInput.systemId // 5. LSInput.publicId InputSource* binStream=fInputSource->getByteStream(); if(binStream) return binStream->makeStream(); const XMLCh* xmlString=fInputSource->getStringData(); if(xmlString) { MemBufInputSource is((const XMLByte*)xmlString, XMLString::stringLen(xmlString)*sizeof(XMLCh), "", false, getMemoryManager()); is.setCopyBufToStream(false); return is.makeStream(); } const XMLCh* szSystemId=fInputSource->getSystemId(); if(szSystemId) { XMLURL urlTmp(getMemoryManager()); if (urlTmp.setURL(szSystemId, fInputSource->getBaseURI(), urlTmp) && !urlTmp.isRelative()) { URLInputSource src(urlTmp, getMemoryManager()); return src.makeStream(); } LocalFileInputSource src(szSystemId, getMemoryManager()); return src.makeStream(); } const XMLCh* szPublicId=fInputSource->getPublicId(); if(szPublicId && fEntityResolver) { DOMLSInput* is = fEntityResolver->resolveResource(XMLUni::fgDOMDTDType, 0, szPublicId, 0, fInputSource->getBaseURI()); if (is) return Wrapper4DOMLSInput(is, fEntityResolver, true, getMemoryManager()).makeStream(); } return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSValue.hpp000644 000765 000024 00000032110 13241160335 023277 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSValue.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSVALUE_HPP) #define XERCESC_INCLUDE_GUARD_XSVALUE_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class RegularExpression; class XMLPARSER_EXPORT XSValue : public XMemory { public: enum DataType { dt_string = 0, dt_boolean = 1, dt_decimal = 2, dt_float = 3, dt_double = 4, dt_duration = 5, dt_dateTime = 6, dt_time = 7, dt_date = 8, dt_gYearMonth = 9, dt_gYear = 10, dt_gMonthDay = 11, dt_gDay = 12, dt_gMonth = 13, dt_hexBinary = 14, dt_base64Binary = 15, dt_anyURI = 16, dt_QName = 17, dt_NOTATION = 18, dt_normalizedString = 19, dt_token = 20, dt_language = 21, dt_NMTOKEN = 22, dt_NMTOKENS = 23, dt_Name = 24, dt_NCName = 25, dt_ID = 26, dt_IDREF = 27, dt_IDREFS = 28, dt_ENTITY = 29, dt_ENTITIES = 30, dt_integer = 31, dt_nonPositiveInteger = 32, dt_negativeInteger = 33, dt_long = 34, dt_int = 35, dt_short = 36, dt_byte = 37, dt_nonNegativeInteger = 38, dt_unsignedLong = 39, dt_unsignedInt = 40, dt_unsignedShort = 41, dt_unsignedByte = 42, dt_positiveInteger = 43, dt_MAXCOUNT = 44 }; enum XMLVersion { ver_10, ver_11 }; enum Status { st_Init, st_NoContent, st_NoCanRep, st_NoActVal, st_NotSupported, st_CantCreateRegEx, st_FOCA0002, //invalid lexical value st_FOCA0001, //input value too large/too small for decimal st_FOCA0003, //input value too large for integer st_FODT0003, //invalid timezone value st_UnknownType }; enum DataGroup { dg_numerics, dg_datetimes, dg_strings }; enum DoubleFloatType { DoubleFloatType_NegINF, DoubleFloatType_PosINF, DoubleFloatType_NaN, DoubleFloatType_Zero, DoubleFloatType_Normal }; // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Destructor */ //@{ ~XSValue(); //@} //--------------------------------- /** @name Externalization methods */ //@{ /** * Validate a given string of the data type specified * * @param content data to be validated * @param datatype schema datatype * @param status validation status which is set upon validation fails * @param version xml version * @param manager memory manager provided */ static bool validate ( const XMLCh* const content , DataType datatype , Status& status , XMLVersion version = ver_10 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Get the canonical representation for a given string of the * data type specified * * @param content raw data * @param datatype schema datatype * @param status validation status which is set upon validation fails * @param version xml version * @param toValidate to validate the content before generate canonical representation * @param manager memory manager provided */ static XMLCh* getCanonicalRepresentation ( const XMLCh* const content , DataType datatype , Status& status , XMLVersion version = ver_10 , bool toValidate = true , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Get the actual value, in the form of XSValue, for a given string of the * data type specified * * Client application is responsible for the deletion of the XSValue returned. * * @param content raw data * @param datatype schema datatype * @param status validation status which is set upon validation fails * @param version xml version * @param toValidate to validate the content before generate actual value * @param manager memory manager provided */ static XSValue* getActualValue ( const XMLCh* const content , DataType datatype , Status& status , XMLVersion version = ver_10 , bool toValidate = true , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); static DataType getDataType (const XMLCh* const dtString); //@} //---------------------------------- /** public data */ struct XSValue_Data { DataType f_datatype; union { bool f_bool; char f_char; unsigned char f_uchar; short f_short; unsigned short f_ushort; int f_int; unsigned int f_uint; long f_long; unsigned long f_ulong; float f_float; double f_double; XMLCh* f_strVal; XMLByte* f_byteVal; struct decimal { double f_dvalue; } f_decimal; struct datetime { int f_year; int f_month; int f_day; int f_hour; int f_min; int f_second; double f_milisec; } f_datetime; struct doubletype { double f_double; DoubleFloatType f_doubleEnum; } f_doubleType; struct floattype { float f_float; DoubleFloatType f_floatEnum; } f_floatType; } fValue; } fData; private: typedef union { long f_long; unsigned long f_ulong; } t_value; /** @name Constructors */ //@{ /** * The default constructor * */ XSValue( DataType const dt , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@}; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSValue(const XSValue&); XSValue & operator=(const XSValue &); //--------------------------------- /** @name Helpers */ //@{ static const XSValue::DataGroup inGroup[]; static const bool numericSign[]; //@} static bool validateNumerics ( const XMLCh* const content , DataType datatype , Status& status , MemoryManager* const manager ); static bool validateDateTimes ( const XMLCh* const content , DataType datatype , Status& status , MemoryManager* const manager ); static bool validateStrings ( const XMLCh* const content , DataType datatype , Status& status , XMLVersion version , MemoryManager* const manager ); static XMLCh* getCanRepNumerics ( const XMLCh* const content , DataType datatype , Status& status , bool toValidate , MemoryManager* const manager ); static XMLCh* getCanRepDateTimes ( const XMLCh* const content , DataType datatype , Status& status , bool toValidate , MemoryManager* const manager ); static XMLCh* getCanRepStrings ( const XMLCh* const content , DataType datatype , Status& status , XMLVersion version , bool toValidate , MemoryManager* const manager ); static XSValue* getActValNumerics ( const XMLCh* const content , DataType datatype , Status& status , bool toValidate , MemoryManager* const manager ); static XSValue* getActValDateTimes ( const XMLCh* const content , DataType datatype , Status& status , MemoryManager* const manager ); static XSValue* getActValStrings ( const XMLCh* const content , DataType datatype , Status& status , XMLVersion version , bool toValidate , MemoryManager* const manager ); static bool getActualNumericValue ( const XMLCh* const content , Status& status , t_value& retVal , MemoryManager* const manager , DataType datatype ); static ValueHashTableOf* fDataTypeRegistry; // ----------------------------------------------------------------------- // static helper methods // ----------------------------------------------------------------------- static void initializeRegistry(); friend class XMLInitializer; // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- bool fMemAllocated; MemoryManager* fMemoryManager; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSFacet.cpp000644 000765 000024 00000003255 13241160335 023250 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSFacet.cpp 471747 2006-11-06 14:31:56Z amassari $ */ #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSFacet: Constructors and Destructor // --------------------------------------------------------------------------- XSFacet::XSFacet(XSSimpleTypeDefinition::FACET facetKind, const XMLCh* const lexicalValue, bool isFixed, XSAnnotation* const annot, XSModel* const xsModel, MemoryManager* const manager) : XSObject(XSConstants::FACET, xsModel, manager) , fFacetKind(facetKind) , fIsFixed(isFixed) , fLexicalValue(lexicalValue) , fAnnotation(annot) { } XSFacet::~XSFacet() { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSComplexTypeDefinition.cpp000644 000765 000024 00000015017 13241160335 026507 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSComplexTypeDefinition.cpp 1801237 2017-07-07 21:55:11Z scantor $ */ #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSComplexTypeDefinition: Constructors and Destructor // --------------------------------------------------------------------------- XSComplexTypeDefinition::XSComplexTypeDefinition ( ComplexTypeInfo* const complexTypeInfo , XSWildcard* const xsWildcard , XSSimpleTypeDefinition* const xsSimpleType , XSAttributeUseList* const xsAttList , XSTypeDefinition* const xsBaseType , XSParticle* const xsParticle , XSAnnotation* const headAnnot , XSModel* const xsModel , MemoryManager* const manager ) : XSTypeDefinition(COMPLEX_TYPE, xsBaseType, xsModel, manager) , fComplexTypeInfo(complexTypeInfo) , fXSWildcard(xsWildcard) , fXSAttributeUseList(xsAttList) , fXSSimpleTypeDefinition(xsSimpleType) , fXSAnnotationList(0) , fParticle(xsParticle) , fProhibitedSubstitution(0) { int blockset = fComplexTypeInfo->getBlockSet(); if (blockset) { if (blockset & SchemaSymbols::XSD_EXTENSION) fProhibitedSubstitution |= XSConstants::DERIVATION_EXTENSION; if (blockset & SchemaSymbols::XSD_RESTRICTION) fProhibitedSubstitution |= XSConstants::DERIVATION_RESTRICTION; } int finalSet = fComplexTypeInfo->getFinalSet(); if (finalSet) { if (finalSet & SchemaSymbols::XSD_EXTENSION) fFinal |= XSConstants::DERIVATION_EXTENSION; if (finalSet & SchemaSymbols::XSD_RESTRICTION) fFinal |= XSConstants::DERIVATION_RESTRICTION; } if (headAnnot) { fXSAnnotationList = new (manager) RefVectorOf(1, false, manager); XSAnnotation* annot = headAnnot; do { fXSAnnotationList->addElement(annot); annot = annot->getNext(); } while (annot); } } XSComplexTypeDefinition::~XSComplexTypeDefinition() { // don't delete fXSWildcard - deleted by XSModel // don't delete fXSSimpleTypeDefinition - deleted by XSModel if (fXSAttributeUseList) delete fXSAttributeUseList; if (fXSAnnotationList) delete fXSAnnotationList; if (fParticle) delete fParticle; } // --------------------------------------------------------------------------- // XSComplexTypeDefinition: access methods // --------------------------------------------------------------------------- XSConstants::DERIVATION_TYPE XSComplexTypeDefinition::getDerivationMethod() const { if(fComplexTypeInfo->getDerivedBy() == SchemaSymbols::XSD_EXTENSION) return XSConstants::DERIVATION_EXTENSION; return XSConstants::DERIVATION_RESTRICTION; } bool XSComplexTypeDefinition::getAbstract() const { return fComplexTypeInfo->getAbstract(); } XSComplexTypeDefinition::CONTENT_TYPE XSComplexTypeDefinition::getContentType() const { switch(fComplexTypeInfo->getContentType()) { case SchemaElementDecl::Simple: return CONTENTTYPE_SIMPLE; case SchemaElementDecl::Empty: case SchemaElementDecl::ElementOnlyEmpty: return CONTENTTYPE_EMPTY; case SchemaElementDecl::Children: return CONTENTTYPE_ELEMENT; default: //case SchemaElementDecl::Mixed_Complex: //case SchemaElementDecl::Mixed_Simple: //case SchemaElementDecl::Any: return CONTENTTYPE_MIXED; } } bool XSComplexTypeDefinition::isProhibitedSubstitution(XSConstants::DERIVATION_TYPE toTest) { if (fProhibitedSubstitution & toTest) return true; return false; } XSAnnotationList *XSComplexTypeDefinition::getAnnotations() { return fXSAnnotationList; } // --------------------------------------------------------------------------- // XSComplexTypeDefinition: virtual methods // --------------------------------------------------------------------------- const XMLCh *XSComplexTypeDefinition::getName() const { return fComplexTypeInfo->getTypeLocalName(); } const XMLCh *XSComplexTypeDefinition::getNamespace() const { return fComplexTypeInfo->getTypeUri(); } XSNamespaceItem *XSComplexTypeDefinition::getNamespaceItem() { return fXSModel->getNamespaceItem(getNamespace()); } bool XSComplexTypeDefinition::getAnonymous() const { return fComplexTypeInfo->getAnonymous(); } XSTypeDefinition *XSComplexTypeDefinition::getBaseType() { return fBaseType; } bool XSComplexTypeDefinition::derivedFromType(const XSTypeDefinition * const ancestorType) { if (!ancestorType) return false; XSTypeDefinition* type = (XSTypeDefinition*) ancestorType; if (ancestorType == type->getBaseType()) { // ancestor is anytype return true; } type = this; XSTypeDefinition* lastType = 0; // anytype has a basetype of anytype so will have infinite loop... while (type && (type != ancestorType) && (type != lastType)) { lastType = type; type = type->getBaseType(); } return (type == ancestorType); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSParticle.cpp000644 000765 000024 00000005127 13241160334 023770 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSParticle.cpp 674012 2008-07-04 11:18:21Z borisk $ */ #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSParticle: Constructors and Destructor // --------------------------------------------------------------------------- XSParticle::XSParticle(TERM_TYPE termType, XSModel* const xsModel, XSObject* const particleTerm, XMLSize_t minOccurs, XMLSize_t maxOccurs, bool unbounded, MemoryManager* const manager) : XSObject(XSConstants::PARTICLE, xsModel, manager) , fTermType(termType) , fMinOccurs(minOccurs) , fMaxOccurs(maxOccurs) , fUnbounded (unbounded) , fTerm(particleTerm) { } XSParticle::~XSParticle() { if (fTerm && (fTermType == TERM_MODELGROUP)) delete ((XSModelGroup*) fTerm); } // --------------------------------------------------------------------------- // XSParticle: methods // --------------------------------------------------------------------------- XSElementDeclaration *XSParticle::getElementTerm() { if (fTermType == TERM_ELEMENT) return (XSElementDeclaration*) fTerm; return 0; } XSModelGroup *XSParticle::getModelGroupTerm() { if (fTermType == TERM_MODELGROUP) return (XSModelGroup*) fTerm; return 0; } XSWildcard *XSParticle::getWildcardTerm() { if (fTermType == TERM_WILDCARD) return (XSWildcard*) fTerm; return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSObject.hpp000644 000765 000024 00000010527 13241160334 023440 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSObject.hpp 1804272 2017-08-06 20:25:24Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSOBJECT_HPP) #define XERCESC_INCLUDE_GUARD_XSOBJECT_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * The XSObject forms the base of the Schema Component Model. It contains * all properties common to the majority of XML Schema components. * This is *always* owned by the validator /parser object from which * it is obtained. It is designed to be subclassed; subclasses will * specify under what conditions it may be relied upon to have meaningful contents. */ // forward declarations class XSNamespaceItem; class XSModel; class XMLPARSER_EXPORT XSObject : public XMemory { public: // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param compType * @param xsModel * @param manager The configurable memory manager */ XSObject ( XSConstants::COMPONENT_TYPE compType , XSModel* const xsModel , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@}; /** @name Destructor */ //@{ virtual ~XSObject(); //@} //--------------------- /** @name XSObject methods */ //@{ /** * The type of this object, i.e. * ELEMENT_DECLARATION. */ XSConstants::COMPONENT_TYPE getType() const; /** * The name of type NCName of this declaration as defined in * XML Namespaces. */ virtual const XMLCh* getName() const; /** * The [target namespace] of this object, or null if it is * unspecified. */ virtual const XMLCh* getNamespace() const; /** * A namespace schema information item corresponding to the target * namespace of the component, if it's globally declared; or null * otherwise. */ virtual XSNamespaceItem *getNamespaceItem(); /** * Optional. Return a unique identifier for a component within this XSModel, to * optimize querying. May not be defined for all types of component. * @return id unique for this type of component within this XSModel or 0 * to indicate that this is not supported for this type of component. */ virtual XMLSize_t getId() const; //@} //---------------------------------- /** methods needed by implementation */ //@{ /** * Set the id to be returned on getId(). */ void setId(XMLSize_t id); //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSObject(const XSObject&); XSObject & operator=(const XSObject &); protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- // fMemoryManager: // used for any memory allocations // fComponentType // the type of the actual component XSConstants::COMPONENT_TYPE fComponentType; XSModel* fXSModel; MemoryManager* fMemoryManager; XMLSize_t fId; }; inline XSConstants::COMPONENT_TYPE XSObject::getType() const { return fComponentType; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/PSVIItem.cpp000644 000765 000024 00000010627 13241160335 023354 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: PSVIItem.cpp 471747 2006-11-06 14:31:56Z amassari $ */ #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN PSVIItem::PSVIItem( MemoryManager* const manager ): fMemoryManager(manager), fValidationContext(0), fNormalizedValue(0), fDefaultValue(0), fCanonicalValue(0), fValidityState(VALIDITY_NOTKNOWN), fAssessmentType(VALIDATION_FULL), fIsSpecified(false), fType(0), fMemberType(0) { } void PSVIItem::reset( const XMLCh* const validationContext , const XMLCh* const normalizedValue , const VALIDITY_STATE validityState , const ASSESSMENT_TYPE assessmentType ) { // this is just a wrapper method; fValidationContext will // be valid as long as and no longer than the thing to which // validationContext points fValidationContext = validationContext; fNormalizedValue = normalizedValue; fValidityState = validityState; fAssessmentType = assessmentType; } void PSVIItem::setValidationAttempted(PSVIItem::ASSESSMENT_TYPE attemptType) { fAssessmentType = attemptType; } void PSVIItem::setValidity(PSVIItem::VALIDITY_STATE validity) { fValidityState = validity; } XSValue* PSVIItem::getActualValue() const { /*** * assessment * VALIDATION_PARTIAL * VALIDATION_FULL * validity * VALIDITY_VALID ***/ if ((fAssessmentType==VALIDATION_NONE) || (fValidityState!=VALIDITY_VALID)) return 0; /*** * XSSimpleType or * XSComplexType's CONTENTTYPE_SIMPLE * allowed ***/ if ((!fType) || ((fType->getTypeCategory() == XSTypeDefinition::COMPLEX_TYPE) && (((XSComplexTypeDefinition*)fType)->getContentType() != XSComplexTypeDefinition::CONTENTTYPE_SIMPLE))) return 0; /*** * Resolve dv * * 1. If fMemberType is not null, use the fMemberType->fDataTypeValidator * 2. If fType is XSSimpleType, use fType->fDataTypeValidator * 3. If fType is XSComplexType, use fType->fXSSimpleTypeDefinition-> fDataTypeValidator * ***/ DatatypeValidator *dv = 0; if (fMemberType) { /*** * Now that fType is either XSSimpleTypeDefinition or * XSComlextTypeDefinition with CONTENTTYPE_SIMPLE, the * fMemberType must be XSSimpleTypeDefinition if present ***/ dv=((XSSimpleTypeDefinition*) fMemberType)->getDatatypeValidator(); } else if (fType->getTypeCategory() == XSTypeDefinition::SIMPLE_TYPE) { dv=((XSSimpleTypeDefinition*) fType)->getDatatypeValidator(); } else { XSSimpleTypeDefinition* simType = ((XSComplexTypeDefinition*)fType)->getSimpleType(); if (simType) dv = simType->getDatatypeValidator(); } if (!dv) return 0; /*** * Get the ultimate base dv in the datatype registry ***/ DatatypeValidator *basedv = DatatypeValidatorFactory::getBuiltInBaseValidator(dv); if (!basedv) return 0; XSValue::Status status=XSValue::st_Init; return XSValue::getActualValue(fNormalizedValue , XSValue::getDataType(basedv->getTypeLocalName()) , status , XSValue::ver_10 , false , fMemoryManager); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSModel.hpp000644 000765 000024 00000030361 13241160334 023270 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSModel.hpp 674012 2008-07-04 11:18:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSMODEL_HPP) #define XERCESC_INCLUDE_GUARD_XSMODEL_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN /** * This class contains all properties of the Schema infoitem as determined * after an entire validation episode. That is, it contains all the properties * of all the Schema Namespace Information objects that went into * the validation episode. * Since it is not like other components, it does not * inherit from the XSObject interface. * This is *always* owned by the validator /parser object from which * it is obtained. It is designed to be subclassed; subclasses will * specify under what conditions it may be relied upon to have meaningful contents. */ // forward declarations class Grammar; class XMLGrammarPool; class XSAnnotation; class XSAttributeDeclaration; class XSAttributeGroupDefinition; class XSElementDeclaration; class XSModelGroupDefinition; class XSNamespaceItem; class XSNotationDeclaration; class XSTypeDefinition; class XSObjectFactory; class XMLPARSER_EXPORT XSModel : public XMemory { public: // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The constructor to be used when a grammar pool contains all needed info * @param grammarPool the grammar pool containing the underlying data structures * @param manager The configurable memory manager */ XSModel( XMLGrammarPool *grammarPool , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * The constructor to be used when the XSModel must represent all * components in the union of an existing XSModel and a newly-created * Grammar(s) from the GrammarResolver * * @param baseModel the XSModel upon which this one is based * @param grammarResolver the grammar(s) whose components are to be merged * @param manager The configurable memory manager */ XSModel( XSModel *baseModel , GrammarResolver *grammarResolver , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); //@}; /** @name Destructor */ //@{ ~XSModel(); //@} //--------------------- /** @name XSModel methods */ //@{ /** * Convenience method. Returns a list of all namespaces that belong to * this schema. The value null is not a valid namespace * name, but if there are components that don't have a target namespace, * null is included in this list. */ StringList *getNamespaces(); /** * A set of namespace schema information information items ( of type * XSNamespaceItem), one for each namespace name which * appears as the target namespace of any schema component in the schema * used for that assessment, and one for absent if any schema component * in the schema had no target namespace. For more information see * schema information. */ XSNamespaceItemList *getNamespaceItems(); /** * [schema components]: a list of top-level components, i.e. element * declarations, attribute declarations, etc. * @param objectType The type of the declaration, i.e. * ELEMENT_DECLARATION, * TYPE_DEFINITION and any other component type that * may be a property of a schema component. * @return A list of top-level definition of the specified type in * objectType or null. */ XSNamedMap *getComponents(XSConstants::COMPONENT_TYPE objectType); /** * Convenience method. Returns a list of top-level component declarations * that are defined within the specified namespace, i.e. element * declarations, attribute declarations, etc. * @param objectType The type of the declaration, i.e. * ELEMENT_DECLARATION. * @param compNamespace The namespace to which declaration belongs or * null (for components with no target namespace). * @return A list of top-level definitions of the specified type in * objectType and defined in the specified * namespace or null. */ XSNamedMap *getComponentsByNamespace(XSConstants::COMPONENT_TYPE objectType, const XMLCh *compNamespace); /** * [annotations]: a set of annotations. */ XSAnnotationList *getAnnotations(); /** * Convenience method. Returns a top-level element declaration. * @param name The name of the declaration. * @param compNamespace The namespace of the declaration, null if absent. * @return A top-level element declaration or null if such * declaration does not exist. */ XSElementDeclaration *getElementDeclaration(const XMLCh *name , const XMLCh *compNamespace); /** * Convenience method. Returns a top-level attribute declaration. * @param name The name of the declaration. * @param compNamespace The namespace of the declaration, null if absent. * @return A top-level attribute declaration or null if such * declaration does not exist. */ XSAttributeDeclaration *getAttributeDeclaration(const XMLCh *name , const XMLCh *compNamespace); /** * Convenience method. Returns a top-level simple or complex type * definition. * @param name The name of the definition. * @param compNamespace The namespace of the declaration, null if absent. * @return An XSTypeDefinition or null if such * definition does not exist. */ XSTypeDefinition *getTypeDefinition(const XMLCh *name , const XMLCh *compNamespace); /** * Convenience method. Returns a top-level attribute group definition. * @param name The name of the definition. * @param compNamespace The namespace of the declaration, null if absent. * @return A top-level attribute group definition or null if * such definition does not exist. */ XSAttributeGroupDefinition *getAttributeGroup(const XMLCh *name , const XMLCh *compNamespace); /** * Convenience method. Returns a top-level model group definition. * @param name The name of the definition. * @param compNamespace The namespace of the declaration, null if absent. * @return A top-level model group definition definition or * null if such definition does not exist. */ XSModelGroupDefinition *getModelGroupDefinition(const XMLCh *name , const XMLCh *compNamespace); /** * Convenience method. Returns a top-level notation declaration. * @param name The name of the declaration. * @param compNamespace The namespace of the declaration, null if absent. * @return A top-level notation declaration or null if such * declaration does not exist. */ XSNotationDeclaration *getNotationDeclaration(const XMLCh *name , const XMLCh *compNamespace); /** * Optional. Return a component given a component type and a unique Id. * May not be supported for all component types. * @param compId unique Id of the component within its type * @param compType type of the component * @return the component of the given type with the given Id, or 0 * if no such component exists or this is unsupported for * this type of component. */ XSObject *getXSObjectById(XMLSize_t compId, XSConstants::COMPONENT_TYPE compType); //@} //---------------------------------- /** methods needed by implementation */ //@{ XMLStringPool* getURIStringPool(); XSNamespaceItem* getNamespaceItem(const XMLCh* const key); /** * Get the XSObject (i.e. XSElementDeclaration) that corresponds to * to a schema grammar component (i.e. SchemaElementDecl) * @param key schema component object * * @return the corresponding XSObject */ XSObject* getXSObject(void* key); //@} private: // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- void addGrammarToXSModel ( XSNamespaceItem* namespaceItem ); void addS4SToXSModel ( XSNamespaceItem* const namespaceItem , RefHashTableOf* const builtInDV ); void addComponentToNamespace ( XSNamespaceItem* const namespaceItem , XSObject* const component , XMLSize_t componentIndex , bool addToXSModel = true ); void addComponentToIdVector ( XSObject* const component , XMLSize_t componentIndex ); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSModel(const XSModel&); XSModel & operator=(const XSModel &); protected: friend class XSObjectFactory; friend class XSObject; // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- // fMemoryManager: // used for any memory allocations MemoryManager* const fMemoryManager; StringList* fNamespaceStringList; XSNamespaceItemList* fXSNamespaceItemList; RefVectorOf* fIdVector[XSConstants::MULTIVALUE_FACET]; /* Need a XSNamedMap for each component top-level? ATTRIBUTE_DECLARATION = 1, ELEMENT_DECLARATION = 2, TYPE_DEFINITION = 3, ATTRIBUTE_USE = 4, no ATTRIBUTE_GROUP_DEFINITION= 5, MODEL_GROUP_DEFINITION = 6, MODEL_GROUP = 7, no PARTICLE = 8, no WILDCARD = 9, no IDENTITY_CONSTRAINT = 10, no NOTATION_DECLARATION = 11, ANNOTATION = 12, no FACET = 13, no MULTIVALUE_FACET = 14 no */ XSNamedMap* fComponentMap[XSConstants::MULTIVALUE_FACET]; XMLStringPool* fURIStringPool; XSAnnotationList* fXSAnnotationList; RefHashTableOf* fHashNamespace; XSObjectFactory* fObjFactory; RefVectorOf* fDeleteNamespace; XSModel* fParent; bool fDeleteParent; bool fAddedS4SGrammar; }; inline XMLStringPool* XSModel::getURIStringPool() { return fURIStringPool; } inline StringList *XSModel::getNamespaces() { return fNamespaceStringList; } inline XSNamespaceItemList *XSModel::getNamespaceItems() { return fXSNamespaceItemList; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSAnnotation.hpp000644 000765 000024 00000012355 13241160335 024346 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSAnnotation.hpp 672273 2008-06-27 13:57:00Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSANNOTATION_HPP) #define XERCESC_INCLUDE_GUARD_XSANNOTATION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * This class describes all properties of a Schema Annotation * component. * This is *always* owned by the validator /parser object from which * it is obtained. */ // forward declarations class DOMNode; class ContentHandler; class XMLPARSER_EXPORT XSAnnotation : public XSerializable, public XSObject { public: // TargetType enum ANNOTATION_TARGET { /** * The object type is org.w3c.dom.Element. */ W3C_DOM_ELEMENT = 1, /** * The object type is org.w3c.dom.Document. */ W3C_DOM_DOCUMENT = 2 }; // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param contents The string that is to be the content of this XSAnnotation * @param manager The configurable memory manager */ XSAnnotation ( const XMLCh* const contents , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@}; /** @name Destructor */ //@{ ~XSAnnotation(); //@} //--------------------- /** @name XSAnnotation methods */ //@{ /** * Write contents of the annotation to the specified DOM object. In-scope * namespace declarations for annotation element are added as * attribute nodes of the serialized annotation. * @param node A target pointer to the annotation target object, i.e. * either DOMDocument or DOMElement cast as * DOMNode. * @param targetType A target type. */ void writeAnnotation(DOMNode* node, ANNOTATION_TARGET targetType); /** * Write contents of the annotation to the specified object. * The corresponding events for all in-scope namespace declarations are * sent via the specified document handler. * @param handler A target pointer to the annotation target object, i.e. * ContentHandler. */ void writeAnnotation(ContentHandler* handler); /** * A text representation of annotation. */ const XMLCh *getAnnotationString() const; XMLCh *getAnnotationString(); //@} //---------------------------------- /** methods needed by implementation */ //@{ void setNext(XSAnnotation* const nextAnnotation); XSAnnotation* getNext(); //@} //----------------------------- /** Getter */ //@{ inline void getLineCol(XMLFileLoc& line, XMLFileLoc& col) const; inline const XMLCh* getSystemId() const; //@} //----------------------------- /** Setter */ //@{ inline void setLineCol(XMLFileLoc line, XMLFileLoc col); void setSystemId(const XMLCh* const systemId); //@} /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XSAnnotation) XSAnnotation(MemoryManager* const manager); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSAnnotation(const XSAnnotation&); XSAnnotation & operator=(const XSAnnotation &); protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- XMLCh* fContents; XSAnnotation* fNext; private: XMLCh* fSystemId; XMLFileLoc fLine; XMLFileLoc fCol; }; inline const XMLCh *XSAnnotation::getAnnotationString() const { return fContents; } inline XMLCh *XSAnnotation::getAnnotationString() { return fContents; } inline void XSAnnotation::getLineCol(XMLFileLoc& line, XMLFileLoc& col) const { line = fLine; col = fCol; } inline const XMLCh* XSAnnotation::getSystemId() const { return fSystemId; } inline void XSAnnotation::setLineCol(XMLFileLoc line, XMLFileLoc col) { fLine = line; fCol = col; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/PSVIAttributeList.cpp000644 000765 000024 00000007004 13241160334 025247 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: PSVIAttributeList.cpp 674012 2008-07-04 11:18:21Z borisk $ */ #include #include #include XERCES_CPP_NAMESPACE_BEGIN PSVIAttributeList::PSVIAttributeList( MemoryManager* const manager ): fMemoryManager(manager) , fAttrList(0) , fAttrPos(0) { fAttrList= new (fMemoryManager) RefVectorOf (10, true, fMemoryManager); } /* * Get the number of attributes whose PSVI contributions * are contained in this list. */ XMLSize_t PSVIAttributeList::getLength() const { return fAttrPos; } /* * Get the PSVI contribution of attribute at position i * in this list. Indeces start from 0. * @param index index from which the attribute PSVI contribution * is to come. * @return PSVIAttribute containing the attributes PSVI contributions; * null is returned if the index is out of range. */ PSVIAttribute *PSVIAttributeList::getAttributePSVIAtIndex(const XMLSize_t index) { if(index >= fAttrPos) return 0; return fAttrList->elementAt(index)->fPSVIAttribute; } /* * Get local part of attribute name at position index in the list. * Indeces start from 0. * @param index index from which the attribute name * is to come. * @return local part of the attribute's name; null is returned if the index * is out of range. */ const XMLCh *PSVIAttributeList::getAttributeNameAtIndex(const XMLSize_t index) { if(index >= fAttrPos) return 0; return fAttrList->elementAt(index)->fAttributeName; } /* * Get namespace of attribute at position index in the list. * Indeces start from 0. * @param index index from which the attribute namespace * is to come. * @return namespace of the attribute; * null is returned if the index is out of range. */ const XMLCh *PSVIAttributeList::getAttributeNamespaceAtIndex(const XMLSize_t index) { if(index >= fAttrPos) return 0; return fAttrList->elementAt(index)->fAttributeNamespace; } /* * Get the PSVI contribution of attribute with given * local name and namespace. * @param attrName local part of the attribute's name * @param attrNamespace namespace of the attribute * @return null if the attribute PSVI does not exist */ PSVIAttribute *PSVIAttributeList::getAttributePSVIByName(const XMLCh *attrName , const XMLCh * attrNamespace) { for (XMLSize_t index=0; index < fAttrPos; index++) { PSVIAttributeStorage* storage = fAttrList->elementAt(index); if (XMLString::equals(attrName,storage->fAttributeName) && XMLString::equals(attrNamespace,storage->fAttributeNamespace)) return storage->fPSVIAttribute; } return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSAttributeUse.hpp000644 000765 000024 00000010113 13241160334 024641 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSAttributeUse.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSATTRIBUTEUSE_HPP) #define XERCESC_INCLUDE_GUARD_XSATTRIBUTEUSE_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * This class describes all properties of a Schema Attribute * Use component. * This is *always* owned by the validator /parser object from which * it is obtained. */ // forward declarations class XSAttributeDeclaration; class XMLPARSER_EXPORT XSAttributeUse : public XSObject { public: // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * @param xsAttDecl * @param xsModel * @param manager The configurable memory manager */ XSAttributeUse ( XSAttributeDeclaration* const xsAttDecl, XSModel* const xsModel, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@}; /** @name Destructor */ //@{ ~XSAttributeUse(); //@} //--------------------- /** @name XSAttributeUse methods */ //@{ /** * [required]: determines whether this use of an attribute declaration * requires an appropriate attribute information item to be present, or * merely allows it. */ bool getRequired() const; /** * [attribute declaration]: provides the attribute declaration itself, * which will in turn determine the simple type definition used. */ XSAttributeDeclaration *getAttrDeclaration() const; /** * Value Constraint: one of default, fixed. */ XSConstants::VALUE_CONSTRAINT getConstraintType() const; /** * Value Constraint: The actual value. */ const XMLCh *getConstraintValue(); //@} //---------------------------------- /** methods needed by implementation */ //@{ //@} private: // set data void set ( const bool isRequired , XSConstants::VALUE_CONSTRAINT constraintType , const XMLCh* const constraintValue ); friend class XSObjectFactory; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSAttributeUse(const XSAttributeUse&); XSAttributeUse & operator=(const XSAttributeUse &); protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- bool fRequired; XSConstants::VALUE_CONSTRAINT fConstraintType; const XMLCh* fConstraintValue; XSAttributeDeclaration* fXSAttributeDeclaration; }; inline XSAttributeDeclaration *XSAttributeUse::getAttrDeclaration() const { return fXSAttributeDeclaration; } inline bool XSAttributeUse::getRequired() const { return fRequired; } inline XSConstants::VALUE_CONSTRAINT XSAttributeUse::getConstraintType() const { return fConstraintType; } inline const XMLCh *XSAttributeUse::getConstraintValue() { return fConstraintValue; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/PSVIElement.hpp000644 000765 000024 00000012453 13241160334 024052 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: PSVIElement.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_PSVIELEMENT_HPP) #define XERCESC_INCLUDE_GUARD_PSVIELEMENT_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Represent the PSVI contributions for one element information item. * This is *always* owned by the scanner/parser object from which * it is obtained. The validator will specify * under what conditions it may be relied upon to have meaningful contents. */ // forward declarations class XSElementDeclaration; class XSNotationDeclaration; class XSModel; class XMLPARSER_EXPORT PSVIElement : public PSVIItem { public: // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param manager The configurable memory manager */ PSVIElement( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); //@}; /** @name Destructor */ //@{ ~PSVIElement(); //@} //--------------------- /** @name PSVIElement methods */ //@{ /** * An item isomorphic to the element declaration used to validate * this element. * * @return an element declaration */ XSElementDeclaration *getElementDeclaration(); /** * [notation] * @see XML Schema Part 1: Structures [notation] * @return The notation declaration. */ XSNotationDeclaration *getNotationDeclaration(); /** * [schema information] * @see XML Schema Part 1: Structures [schema information] * @return The schema information property if it's the validation root, * null otherwise. */ XSModel *getSchemaInformation(); /** * An item isomorphic to the type definition used to validate this element. * * @return a type declaration */ XSTypeDefinition *getTypeDefinition(); /** * If and only if that type definition is a simple type definition * with {variety} union, or a complex type definition whose {content type} * is a simple type definition with {variety} union, then an item isomorphic * to that member of the union's {member type definitions} which actually * validated the element item's normalized value. * * @return a simple type declaration */ XSSimpleTypeDefinition *getMemberTypeDefinition(); //@} //---------------------------------- /** methods needed by implementation */ //@{ void reset ( const VALIDITY_STATE validityState , const ASSESSMENT_TYPE assessmentType , const XMLCh* const validationContext , bool isSpecified , XSElementDeclaration* const elemDecl , XSTypeDefinition* const typeDef , XSSimpleTypeDefinition* const memberType , XSModel* const schemaInfo , const XMLCh* const defaultValue , const XMLCh* const normalizedValue = 0 , XMLCh* const canonicalValue = 0 , XSNotationDeclaration* const notationDecl = 0 ); //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- PSVIElement(const PSVIElement&); PSVIElement & operator=(const PSVIElement &); // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- // fElementDecl // element declaration component that validated this element // fNotationDecl // (optional) notation decl associated with this element // fSchemaInfo // Schema Information Item with which this validation episode is associated XSElementDeclaration *fElementDecl; XSNotationDeclaration *fNotationDecl; XSModel *fSchemaInfo; }; inline XSElementDeclaration *PSVIElement::getElementDeclaration() { return fElementDecl; } inline XSNotationDeclaration* PSVIElement::getNotationDeclaration() { return fNotationDecl; } inline XSModel* PSVIElement::getSchemaInformation() { return fSchemaInfo; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSElementDeclaration.cpp000644 000765 000024 00000013135 13241160334 025762 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSElementDeclaration.cpp 1804272 2017-08-06 20:25:24Z scantor $ */ #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSElementDeclaration: Constructors and Destructor // --------------------------------------------------------------------------- XSElementDeclaration::XSElementDeclaration ( SchemaElementDecl* const schemaElementDecl , XSTypeDefinition* const typeDefinition , XSElementDeclaration* const substitutionGroupAffiliation , XSAnnotation* const annot , XSNamedMap* const identityConstraints , XSModel* const xsModel , XSConstants::SCOPE elemScope , XSComplexTypeDefinition* const enclosingTypeDefinition , MemoryManager* const manager ) : XSObject(XSConstants::ELEMENT_DECLARATION, xsModel, manager) , fDisallowedSubstitutions(0) , fSubstitutionGroupExclusions(0) , fScope(elemScope) , fSchemaElementDecl(schemaElementDecl) , fTypeDefinition(typeDefinition) , fEnclosingTypeDefinition(enclosingTypeDefinition) , fSubstitutionGroupAffiliation(substitutionGroupAffiliation) , fAnnotation(annot) , fIdentityConstraints(identityConstraints) { // set block and final information // NOTE: rest of setup will be taken care of in construct() int blockFinalSet = fSchemaElementDecl->getBlockSet(); if (blockFinalSet) { if (blockFinalSet & SchemaSymbols::XSD_EXTENSION) fDisallowedSubstitutions |= XSConstants::DERIVATION_EXTENSION; if (blockFinalSet & SchemaSymbols::XSD_RESTRICTION) fDisallowedSubstitutions |= XSConstants::DERIVATION_RESTRICTION; if (blockFinalSet & SchemaSymbols::XSD_SUBSTITUTION) fDisallowedSubstitutions |= XSConstants::DERIVATION_SUBSTITUTION; } if (0 != (blockFinalSet = fSchemaElementDecl->getFinalSet())) { if (blockFinalSet & SchemaSymbols::XSD_EXTENSION) fSubstitutionGroupExclusions |= XSConstants::DERIVATION_EXTENSION; if (blockFinalSet & SchemaSymbols::XSD_RESTRICTION) fSubstitutionGroupExclusions |= XSConstants::DERIVATION_RESTRICTION; } } XSElementDeclaration::~XSElementDeclaration() { // don't delete fTypeDefinition - deleted by XSModel // don't delete fSubstitutionGroupAffiliation - deleted by XSModel if (fIdentityConstraints) delete fIdentityConstraints; } // --------------------------------------------------------------------------- // XSElementDeclaration: XSObject virtual methods // --------------------------------------------------------------------------- const XMLCh *XSElementDeclaration::getName() const { return fSchemaElementDecl->getElementName()->getLocalPart(); } const XMLCh *XSElementDeclaration::getNamespace() const { return fXSModel->getURIStringPool()->getValueForId(fSchemaElementDecl->getURI()); } XSNamespaceItem *XSElementDeclaration::getNamespaceItem() { return fXSModel->getNamespaceItem(getNamespace()); } // --------------------------------------------------------------------------- // XSElementDeclaration: access methods // --------------------------------------------------------------------------- XSConstants::VALUE_CONSTRAINT XSElementDeclaration::getConstraintType() const { if (fSchemaElementDecl->getMiscFlags() & SchemaSymbols::XSD_FIXED) return XSConstants::VALUE_CONSTRAINT_FIXED; if (fSchemaElementDecl->getDefaultValue()) return XSConstants::VALUE_CONSTRAINT_DEFAULT; return XSConstants::VALUE_CONSTRAINT_NONE; } const XMLCh *XSElementDeclaration::getConstraintValue() { return fSchemaElementDecl->getDefaultValue(); } bool XSElementDeclaration::getNillable() const { if (fSchemaElementDecl->getMiscFlags() & SchemaSymbols::XSD_NILLABLE) return true; return false; } bool XSElementDeclaration::isSubstitutionGroupExclusion(XSConstants::DERIVATION_TYPE exclusion) { if (fSubstitutionGroupExclusions & exclusion) return true; return false; } bool XSElementDeclaration::isDisallowedSubstitution(XSConstants::DERIVATION_TYPE disallowed) { if (fDisallowedSubstitutions & disallowed) return true; return false; } bool XSElementDeclaration::getAbstract() const { if (fSchemaElementDecl->getMiscFlags() & SchemaSymbols::XSD_ABSTRACT) return true; return false; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSModelGroupDefinition.hpp000644 000765 000024 00000007602 13241160335 026321 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSModelGroupDefinition.hpp 1804272 2017-08-06 20:25:24Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSMODELGROUPDEFINITION_HPP) #define XERCESC_INCLUDE_GUARD_XSMODELGROUPDEFINITION_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * This class describes all properties of a Schema Model Group * Definition component. * This is *always* owned by the validator /parser object from which * it is obtained. */ // forward declarations class XSAnnotation; class XSModelGroup; class XSParticle; class XercesGroupInfo; class XMLPARSER_EXPORT XSModelGroupDefinition : public XSObject { public: // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param groupInfo * @param groupParticle * @param annot * @param xsModel * @param manager The configurable memory manager */ XSModelGroupDefinition ( XercesGroupInfo* const groupInfo , XSParticle* const groupParticle , XSAnnotation* const annot , XSModel* const xsModel , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@}; /** @name Destructor */ //@{ ~XSModelGroupDefinition(); //@} //--------------------- /** @name overridden XSXSObject methods */ //@{ /** * The name of type NCName of this declaration as defined in * XML Namespaces. */ const XMLCh* getName() const; /** * The [target namespace] of this object, or null if it is * unspecified. */ const XMLCh* getNamespace() const; /** * A namespace schema information item corresponding to the target * namespace of the component, if it's globally declared; or null * otherwise. */ XSNamespaceItem *getNamespaceItem(); //@} //--------------------- /** @name XSModelGroupDefinition methods */ //@{ /** * A model group. */ XSModelGroup *getModelGroup(); /** * Optional. An [annotation]. */ XSAnnotation *getAnnotation() const; //@} //---------------------------------- /** methods needed by implementation */ //@{ //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSModelGroupDefinition(const XSModelGroupDefinition&); XSModelGroupDefinition & operator=(const XSModelGroupDefinition &); protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- XercesGroupInfo* fGroupInfo; XSParticle* fModelGroupParticle; XSAnnotation* fAnnotation; }; inline XSAnnotation* XSModelGroupDefinition::getAnnotation() const { return fAnnotation; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSIDCDefinition.hpp000644 000765 000024 00000011431 13241160334 024635 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSIDCDefinition.hpp 1804272 2017-08-06 20:25:24Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSIDCDEFINITION_HPP) #define XERCESC_INCLUDE_GUARD_XSIDCDEFINITION_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * This class describes all properties of a Schema Identity Constraint * Definition component. * This is *always* owned by the validator /parser object from which * it is obtained. */ // forward declarations class XSAnnotation; class IdentityConstraint; class XMLPARSER_EXPORT XSIDCDefinition : public XSObject { public: // Identity Constraints enum IC_CATEGORY { /** * */ IC_KEY = 1, /** * */ IC_KEYREF = 2, /** * */ IC_UNIQUE = 3 }; // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param identityConstraint * @param keyIC * @param headAnnot * @param stringList * @param xsModel * @param manager The configurable memory manager */ XSIDCDefinition ( IdentityConstraint* const identityConstraint , XSIDCDefinition* const keyIC , XSAnnotation* const headAnnot , StringList* const stringList , XSModel* const xsModel , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@}; /** @name Destructor */ //@{ ~XSIDCDefinition(); //@} //--------------------- /** @name overridden XSXSObject methods */ //@{ /** * The name of type NCName of this declaration as defined in * XML Namespaces. */ const XMLCh* getName() const; /** * The [target namespace] of this object, or null if it is * unspecified. */ const XMLCh* getNamespace() const; /** * A namespace schema information item corresponding to the target * namespace of the component, if it's globally declared; or null * otherwise. */ XSNamespaceItem *getNamespaceItem(); //@} //--------------------- /** @name XSIDCDefinition methods */ //@{ /** * [identity-constraint category]: one of IC_KEY, IC_KEYREF or IC_UNIQUE. */ IC_CATEGORY getCategory() const; /** * [selector]: a restricted XPath expression. */ const XMLCh *getSelectorStr(); /** * [fields]: a non-empty list of restricted XPath ([XPath]) expressions. */ StringList *getFieldStrs(); /** * [referenced key]: required if [identity-constraint category] is IC_KEYREF, * forbidden otherwise (when an identity-constraint definition with [ * identity-constraint category] equal to IC_KEY or IC_UNIQUE). */ XSIDCDefinition *getRefKey() const; /** * A set of [annotations]. */ XSAnnotationList *getAnnotations(); //@} //---------------------------------- /** methods needed by implementation */ //@{ //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSIDCDefinition(const XSIDCDefinition&); XSIDCDefinition & operator=(const XSIDCDefinition &); protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- IdentityConstraint* fIdentityConstraint; XSIDCDefinition* fKey; StringList* fStringList; XSAnnotationList* fXSAnnotationList; }; inline StringList* XSIDCDefinition::getFieldStrs() { return fStringList; } inline XSIDCDefinition* XSIDCDefinition::getRefKey() const { return fKey; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSMultiValueFacet.cpp000644 000765 000024 00000004417 13241160334 025260 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSMultiValueFacet.cpp 471747 2006-11-06 14:31:56Z amassari $ */ #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSMultiValueFacet: Constructors and Destructors // --------------------------------------------------------------------------- XSMultiValueFacet::XSMultiValueFacet(XSSimpleTypeDefinition::FACET facetKind, StringList* lexicalValues, bool isFixed, XSAnnotation* const headAnnot, XSModel* const xsModel, MemoryManager* const manager) : XSObject(XSConstants::MULTIVALUE_FACET, xsModel, manager) , fFacetKind(facetKind) , fIsFixed(isFixed) , fLexicalValues(lexicalValues) , fXSAnnotationList(0) { if (headAnnot) { fXSAnnotationList = new (manager) RefVectorOf(1, false, manager); XSAnnotation* annot = headAnnot; do { fXSAnnotationList->addElement(annot); annot = annot->getNext(); } while (annot); } } XSMultiValueFacet::~XSMultiValueFacet() { if (fXSAnnotationList) delete fXSAnnotationList; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSAttributeDeclaration.cpp000644 000765 000024 00000010115 13241160334 026327 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSAttributeDeclaration.cpp 1804272 2017-08-06 20:25:24Z scantor $ */ #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSAttributeDeclaration: Constructors and Destructor // --------------------------------------------------------------------------- XSAttributeDeclaration::XSAttributeDeclaration(SchemaAttDef* const attDef, XSSimpleTypeDefinition* const typeDef, XSAnnotation* const annot, XSModel* const xsModel, XSConstants::SCOPE scope, XSComplexTypeDefinition* enclosingCTDefinition, MemoryManager * const manager) : XSObject(XSConstants::ATTRIBUTE_DECLARATION, xsModel, manager) , fAttDef(attDef) , fTypeDefinition(typeDef) , fAnnotation(annot) , fScope(scope) , fEnclosingCTDefinition(enclosingCTDefinition) { } XSAttributeDeclaration::~XSAttributeDeclaration() { // don't delete fTypeDefinition - deleted by XSModel } // --------------------------------------------------------------------------- // XSAttributeDeclaration: XSObject virtual methods // --------------------------------------------------------------------------- const XMLCh *XSAttributeDeclaration::getName() const { return fAttDef->getAttName()->getLocalPart(); } const XMLCh *XSAttributeDeclaration::getNamespace() const { return fXSModel->getURIStringPool()->getValueForId(fAttDef->getAttName()->getURI()); } XSNamespaceItem *XSAttributeDeclaration::getNamespaceItem() { return fXSModel->getNamespaceItem(getNamespace()); } // --------------------------------------------------------------------------- // XSAttributeDeclaration: access methods // --------------------------------------------------------------------------- XSConstants::VALUE_CONSTRAINT XSAttributeDeclaration::getConstraintType() const { if (fScope != XSConstants::SCOPE_GLOBAL) return XSConstants::VALUE_CONSTRAINT_NONE; if (fAttDef->getDefaultType() == XMLAttDef::Default) return XSConstants::VALUE_CONSTRAINT_DEFAULT; if ((fAttDef->getDefaultType() == XMLAttDef::Fixed) || (fAttDef->getDefaultType() == XMLAttDef::Required_And_Fixed)) return XSConstants::VALUE_CONSTRAINT_FIXED; return XSConstants::VALUE_CONSTRAINT_NONE; } const XMLCh *XSAttributeDeclaration::getConstraintValue() { if (fScope == XSConstants::SCOPE_GLOBAL) return fAttDef->getValue(); return 0; } bool XSAttributeDeclaration::getRequired() const { if (fAttDef->getDefaultType() == XMLAttDef::Required || fAttDef->getDefaultType() == XMLAttDef::Required_And_Fixed) return true; return false; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSNamespaceItem.cpp000644 000765 000024 00000016450 13241160335 024742 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSNamespaceItem.cpp 674012 2008-07-04 11:18:21Z borisk $ */ #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSNamespaceItem: Constructors and Destructors // --------------------------------------------------------------------------- XSNamespaceItem::XSNamespaceItem(XSModel* const xsModel, SchemaGrammar* const grammar, MemoryManager* const manager) : fMemoryManager(manager) , fGrammar(grammar) , fXSModel(xsModel) , fXSAnnotationList(0) , fSchemaNamespace(grammar->getTargetNamespace()) { // Populate XSNamedMaps by going through the components for (XMLSize_t i=0; i ( 20, // size 29, // modulus fXSModel->getURIStringPool(), false, // adoptElems fMemoryManager ); fHashMap[i] = new (fMemoryManager) RefHashTableOf ( 29, false, fMemoryManager ); break; default: // ATTRIBUTE_USE // MODEL_GROUP // PARTICLE // IDENTITY_CONSTRAINT // WILDCARD // ANNOTATION // FACET // MULTIVALUE fComponentMap[i] = 0; fHashMap[i] = 0; break; } } fXSAnnotationList = new (manager) RefVectorOf (5, false, manager); } XSNamespaceItem::XSNamespaceItem(XSModel* const xsModel, const XMLCh* const schemaNamespace, MemoryManager* const manager) : fMemoryManager(manager) , fGrammar(0) , fXSModel(xsModel) , fXSAnnotationList(0) , fSchemaNamespace(schemaNamespace) { // Populate XSNamedMaps by going through the components for (XMLSize_t i=0; i ( 20, // size 29, // modulus fXSModel->getURIStringPool(), false, // adoptElems fMemoryManager ); fHashMap[i] = new (fMemoryManager) RefHashTableOf ( 29, false, fMemoryManager ); break; default: // ATTRIBUTE_USE // MODEL_GROUP // PARTICLE // IDENTITY_CONSTRAINT // WILDCARD // ANNOTATION // FACET // MULTIVALUE fComponentMap[i] = 0; fHashMap[i] = 0; break; } } fXSAnnotationList = new (manager) RefVectorOf (5, false, manager); } XSNamespaceItem::~XSNamespaceItem() { for (XMLSize_t i=0; i *XSNamespaceItem::getComponents(XSConstants::COMPONENT_TYPE objectType) { return fComponentMap[objectType -1]; } XSElementDeclaration *XSNamespaceItem::getElementDeclaration(const XMLCh *name) { if (name) return (XSElementDeclaration*) fHashMap[XSConstants::ELEMENT_DECLARATION -1]->get(name); return 0; } XSAttributeDeclaration *XSNamespaceItem::getAttributeDeclaration(const XMLCh *name) { if (name) return (XSAttributeDeclaration*) fHashMap[XSConstants::ATTRIBUTE_DECLARATION -1]->get(name); return 0; } XSTypeDefinition *XSNamespaceItem::getTypeDefinition(const XMLCh *name) { if (name) return (XSTypeDefinition*) fHashMap[XSConstants::TYPE_DEFINITION -1]->get(name); return 0; } XSAttributeGroupDefinition *XSNamespaceItem::getAttributeGroup(const XMLCh *name) { if (name) return (XSAttributeGroupDefinition*) fHashMap[XSConstants::ATTRIBUTE_GROUP_DEFINITION -1]->get(name); return 0; } XSModelGroupDefinition *XSNamespaceItem::getModelGroupDefinition(const XMLCh *name) { if (name) return (XSModelGroupDefinition*) fHashMap[XSConstants::MODEL_GROUP_DEFINITION -1]->get(name); return 0; } XSNotationDeclaration *XSNamespaceItem::getNotationDeclaration(const XMLCh *name) { if (name) return (XSNotationDeclaration*) fHashMap[XSConstants::NOTATION_DECLARATION -1]->get(name); return 0; } const StringList *XSNamespaceItem::getDocumentLocations() { if (fGrammar) return ((XMLSchemaDescriptionImpl*) fGrammar->getGrammarDescription())->getLocationHints(); return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSTypeDefinition.cpp000644 000765 000024 00000004526 13241160334 025161 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSTypeDefinition.cpp 471747 2006-11-06 14:31:56Z amassari $ */ #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSTypeDefinition: Constructors and Destructor // --------------------------------------------------------------------------- XSTypeDefinition::XSTypeDefinition(TYPE_CATEGORY typeCategory, XSTypeDefinition* const xsBaseType, XSModel* const xsModel, MemoryManager* const manager) : XSObject(XSConstants::TYPE_DEFINITION, xsModel, manager) , fTypeCategory(typeCategory) , fFinal(0) , fBaseType(xsBaseType) { } XSTypeDefinition::~XSTypeDefinition() { } // --------------------------------------------------------------------------- // XSTypeDefinition: access methods // --------------------------------------------------------------------------- bool XSTypeDefinition::isFinal(short toTest) { if (fFinal & toTest) return true; return false; } bool XSTypeDefinition::derivedFrom(const XMLCh *typeNamespace, const XMLCh *name) { if (!name) return false; XSTypeDefinition* type = fXSModel->getTypeDefinition(name, typeNamespace); if (!type) return false; return derivedFromType(type); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/PSVIAttribute.cpp000644 000765 000024 00000004422 13241160334 024414 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: PSVIAttribute.cpp 471747 2006-11-06 14:31:56Z amassari $ */ #include XERCES_CPP_NAMESPACE_BEGIN PSVIAttribute::PSVIAttribute( MemoryManager* const manager ): PSVIItem(manager) , fAttributeDecl(0) , fDV(0) { } void PSVIAttribute::reset( const XMLCh * const valContext , PSVIItem::VALIDITY_STATE state , PSVIItem::ASSESSMENT_TYPE assessmentType , XSSimpleTypeDefinition * validatingType , XSSimpleTypeDefinition * memberType , const XMLCh * const defaultValue , const bool isSpecified , XSAttributeDeclaration * attrDecl , DatatypeValidator *dv ) { fValidationContext = valContext; fValidityState = state; fAssessmentType = assessmentType; fType = validatingType; fMemberType = memberType; fDefaultValue = defaultValue; fIsSpecified = isSpecified; fMemoryManager->deallocate((void *)fCanonicalValue); fCanonicalValue = 0; fNormalizedValue = 0; fAttributeDecl = attrDecl; fDV = dv; } void PSVIAttribute::setValue(const XMLCh * const normalizedValue) { if(normalizedValue) { fNormalizedValue = normalizedValue; if(fDV && fValidityState == PSVIItem::VALIDITY_VALID) fCanonicalValue = (XMLCh *)fDV->getCanonicalRepresentation(normalizedValue, fMemoryManager); } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSWildcard.cpp000644 000765 000024 00000015163 13241160335 023760 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSWildcard.cpp 674012 2008-07-04 11:18:21Z borisk $ */ #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSWildcard: Constructors and Destructor // --------------------------------------------------------------------------- XSWildcard::XSWildcard(SchemaAttDef* const attWildCard, XSAnnotation* const annot, XSModel* const xsModel, MemoryManager* const manager) : XSObject(XSConstants::WILDCARD, xsModel, manager) , fConstraintType(NSCONSTRAINT_ANY) , fProcessContents(PC_STRICT) , fNsConstraintList(0) , fAnnotation(annot) { XMLAttDef::AttTypes attType = attWildCard->getType(); if (attType == XMLAttDef::Any_Other) { fConstraintType = NSCONSTRAINT_NOT; fNsConstraintList = new (manager) RefArrayVectorOf(1, true, manager); fNsConstraintList->addElement ( XMLString::replicate(fXSModel->getURIStringPool()->getValueForId( attWildCard->getAttName()->getURI()), manager) ); } else if (attType == XMLAttDef::Any_List) { fConstraintType = NSCONSTRAINT_DERIVATION_LIST; ValueVectorOf* nsList = attWildCard->getNamespaceList(); if (nsList) { XMLSize_t nsListSize = nsList->size(); if (nsListSize) { fNsConstraintList = new (manager) RefArrayVectorOf(nsListSize, true, manager); for (XMLSize_t i=0; i < nsListSize; i++) { fNsConstraintList->addElement ( XMLString::replicate ( fXSModel->getURIStringPool()->getValueForId ( nsList->elementAt(i) ) , manager ) ); } } } } XMLAttDef::DefAttTypes attDefType = attWildCard->getDefaultType(); if (attDefType == XMLAttDef::ProcessContents_Skip) fProcessContents = PC_SKIP; else if (attDefType == XMLAttDef::ProcessContents_Lax) fProcessContents = PC_LAX; } XSWildcard::XSWildcard(const ContentSpecNode* const elmWildCard, XSAnnotation* const annot, XSModel* const xsModel, MemoryManager* const manager) : XSObject(XSConstants::WILDCARD, xsModel, manager) , fConstraintType(NSCONSTRAINT_ANY) , fProcessContents(PC_STRICT) , fNsConstraintList(0) , fAnnotation(annot) { ContentSpecNode::NodeTypes nodeType = elmWildCard->getType(); if ((nodeType & 0x0f) == ContentSpecNode::Any_Other) { fConstraintType = NSCONSTRAINT_NOT; if (nodeType == ContentSpecNode::Any_Other_Lax) fProcessContents = PC_LAX; else if (nodeType == ContentSpecNode::Any_Other_Skip) fProcessContents = PC_SKIP; } else if ((nodeType & 0x0f) == ContentSpecNode::Any_NS) { fConstraintType = NSCONSTRAINT_DERIVATION_LIST; if (nodeType == ContentSpecNode::Any_NS_Lax) fProcessContents = PC_LAX; else if (nodeType == ContentSpecNode::Any_NS_Skip) fProcessContents = PC_SKIP; } else if (nodeType == ContentSpecNode::Any_NS_Choice) { fConstraintType = NSCONSTRAINT_DERIVATION_LIST; // inspect the second child, not the first one, as the first could hold another Any_NS_Choice wrapper // if the choices are more than 2, while the second child is always a leaf node ContentSpecNode::NodeTypes anyType = elmWildCard->getSecond()->getType(); if (anyType == ContentSpecNode::Any_NS_Lax) fProcessContents = PC_LAX; else if (anyType == ContentSpecNode::Any_NS_Skip) fProcessContents = PC_SKIP; fNsConstraintList = new (manager) RefArrayVectorOf(4, true, manager); buildNamespaceList(elmWildCard); } // must be any else { if (nodeType == ContentSpecNode::Any_Lax) fProcessContents = PC_LAX; else if (nodeType == ContentSpecNode::Any_Skip) fProcessContents = PC_SKIP; } if (fConstraintType == NSCONSTRAINT_NOT || (fConstraintType == NSCONSTRAINT_DERIVATION_LIST && !fNsConstraintList)) { fNsConstraintList = new (manager) RefArrayVectorOf(1, true, manager); fNsConstraintList->addElement ( XMLString::replicate(fXSModel->getURIStringPool()->getValueForId( elmWildCard->getElement()->getURI()), manager) ); } } XSWildcard::~XSWildcard() { if (fNsConstraintList) delete fNsConstraintList; } // --------------------------------------------------------------------------- // XSWildcard: helper methods // --------------------------------------------------------------------------- void XSWildcard::buildNamespaceList(const ContentSpecNode* const rootNode) { ContentSpecNode::NodeTypes nodeType = rootNode->getType(); if (nodeType == ContentSpecNode::Any_NS_Choice) { buildNamespaceList(rootNode->getFirst()); buildNamespaceList(rootNode->getSecond()); } else { fNsConstraintList->addElement ( XMLString::replicate(fXSModel->getURIStringPool()->getValueForId( rootNode->getElement()->getURI()), fMemoryManager) ); } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSNotationDeclaration.hpp000644 000765 000024 00000010034 13241160335 026165 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSNotationDeclaration.hpp 1804272 2017-08-06 20:25:24Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSNOTATIONDECLARATION_HPP) #define XERCESC_INCLUDE_GUARD_XSNOTATIONDECLARATION_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * This class describes all properties of a Schema Notation Declaration * component. * This is *always* owned by the validator /parser object from which * it is obtained. */ // forward declarations class XSAnnotation; class XMLNotationDecl; class XMLPARSER_EXPORT XSNotationDeclaration : public XSObject { public: // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param xmlNotationDecl * @param annot * @param xsModel * @param manager The configurable memory manager */ XSNotationDeclaration ( XMLNotationDecl* const xmlNotationDecl , XSAnnotation* const annot , XSModel* const xsModel , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@}; /** @name Destructor */ //@{ ~XSNotationDeclaration(); //@} //--------------------- /** @name overridden XSXSObject methods */ //@{ /** * The name of type NCName of this declaration as defined in * XML Namespaces. */ const XMLCh* getName() const; /** * The [target namespace] of this object, or null if it is * unspecified. */ const XMLCh* getNamespace() const; /** * A namespace schema information item corresponding to the target * namespace of the component, if it's globally declared; or null * otherwise. */ XSNamespaceItem *getNamespaceItem(); //@} //--------------------- /** @name XSNotationDeclaration methods */ //@{ /** * The URI reference representing the system identifier for the notation * declaration, if present, null otherwise. */ const XMLCh *getSystemId(); /** * The string representing the public identifier for this notation * declaration, if present; null otherwise. */ const XMLCh *getPublicId(); /** * Optional. An [annotation]. */ XSAnnotation *getAnnotation() const; //@} //---------------------------------- /** methods needed by implementation */ //@{ //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSNotationDeclaration(const XSNotationDeclaration&); XSNotationDeclaration & operator=(const XSNotationDeclaration &); protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- XMLNotationDecl* fXMLNotationDecl; XSAnnotation* fAnnotation; }; inline XSAnnotation* XSNotationDeclaration::getAnnotation() const { return fAnnotation; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSNamedMap.hpp000644 000765 000024 00000011010 13241160334 023700 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSNamedMap.hpp 674012 2008-07-04 11:18:21Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSNAMEDMAP_HPP) #define XERCESC_INCLUDE_GUARD_XSNAMEDMAP_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLStringPool; /* * This template provides convenient mappings between name,namespace * pairs and individual components, as well as means to iterate through all the * named components on some object. */ template class XSNamedMap: public XMemory { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ XSNamedMap(const XMLSize_t maxElems, const XMLSize_t modulus, XMLStringPool* uriStringPool, const bool adoptElems, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** @name Destructor */ //@{ ~XSNamedMap(); //@} // ----------------------------------------------------------------------- // XSNamedMap methods // ----------------------------------------------------------------------- /** @name XSNamedMap methods */ //@{ /** * The number of XSObjects in the XSObjectList. * The range of valid child object indices is 0 to * mapLength-1 inclusive. */ XMLSize_t getLength() const; /** * Returns the indexth item in the collection. The index * starts at 0. If index is greater than or equal to the * number of objects in the list, this returns null. * @param index index into the collection. * @return The XSObject at the indexth * position in the XSObjectList, or null if * that is not a valid index. */ TVal *item(XMLSize_t index); const TVal *item(XMLSize_t index) const; /** * Retrieves a component specified by local name and namespace URI. *
applications must use the value null as the * compNamespace parameter for components whose targetNamespace property * is absent. * @param compNamespace The namespace URI of the component to retrieve. * @param localName The local name of the component to retrieve. * @return A component (of any type) with the specified local * name and namespace URI, or null if they do not * identify any node in this map. */ TVal *itemByName(const XMLCh *compNamespace, const XMLCh *localName); //@} //---------------------------------- /** methods needed by implementation */ //@{ void addElement(TVal* const toAdd, const XMLCh* key1, const XMLCh* key2); //@} private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSNamedMap(const XSNamedMap&); XSNamedMap& operator=(const XSNamedMap&); // ----------------------------------------------------------------------- // Data members // // fMemoryManager // manager used to allocate memory needed by this object MemoryManager *const fMemoryManager; XMLStringPool* fURIStringPool; RefVectorOf* fVector; RefHash2KeysTableOf* fHash; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/framework/psvi/PSVIHandler.hpp000644 000765 000024 00000012303 13241160334 024030 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: PSVIHandler.hpp 676796 2008-07-15 05:04:13Z dbertoni $ */ #if !defined(XERCESC_INCLUDE_GUARD_PSVIHANDLER_HPP) #define XERCESC_INCLUDE_GUARD_PSVIHANDLER_HPP XERCES_CPP_NAMESPACE_BEGIN class PSVIElement; class PSVIAttributeList; /** * This abstract class provides the interface for the scanner to return * PSVI information to the application. * */ class XMLPARSER_EXPORT PSVIHandler { public: // ----------------------------------------------------------------------- // Constructors are hidden, just the virtual destructor is exposed // ----------------------------------------------------------------------- /** @name Destructor */ //@{ virtual ~PSVIHandler() { } //@} /** @name The PSVI handler interface */ //@{ /** Receive notification of the PSVI properties of an element. * The scanner will issue this call after the XMLDocumentHandler * endElement call. Since the scanner will issue the psviAttributes * call immediately after reading the start tag of an element, all element * content will be effectively bracketed by these two calls. * @param localName The name of the element whose end tag was just * parsed. * @param uri The namespace to which the element is bound * @param elementInfo Object containing the element's PSVI properties */ virtual void handleElementPSVI ( const XMLCh* const localName , const XMLCh* const uri , PSVIElement * elementInfo ) = 0; /** * Receive notification of partial PSVI properties of an element. * This callback is made right after the psviAttributes * call for non-empty element. * * The PSVIElement passed in has all fields properly set and it * can be safely accessed the same way as the one passed in handleElementPSVI. * However, fields listed below always have default values. * * getValidity() PSVIItem::VALIDITY_NOTKNOWN * getValidationAttemped() PSVIItem::VALIDATION_NONE * getMemberTypeDefinition() 0 * getSchemaNormalizedValue() 0 * getCanonicalRepresentation() 0 * getNotationDeclaration() 0 * * * @param localName The name of the element upon which start tag * these attributes were encountered. * @param uri The namespace to which the element is bound * @param elementInfo Object containing the element's partial PSVI properties */ virtual void handlePartialElementPSVI ( const XMLCh* const localName , const XMLCh* const uri , PSVIElement * elementInfo ); /** * Enables PSVI information about attributes to be passed back to the * application. This callback will be made on *all* * elements; on elements with no attributes, the final parameter will * be null. * @param localName The name of the element upon which start tag * these attributes were encountered. * @param uri The namespace to which the element is bound * @param psviAttributes Object containing the attributes' PSVI properties * with information to identify them. */ virtual void handleAttributesPSVI ( const XMLCh* const localName , const XMLCh* const uri , PSVIAttributeList * psviAttributes ) = 0; //@} protected : // ----------------------------------------------------------------------- // Hidden Constructors // ----------------------------------------------------------------------- PSVIHandler() { } private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- PSVIHandler(const PSVIHandler&); PSVIHandler& operator=(const PSVIHandler&); }; inline void PSVIHandler::handlePartialElementPSVI(const XMLCh* const /*localName*/ , const XMLCh* const /*uri*/ , PSVIElement * /*elementInfo*/ ) { } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSAttributeGroupDefinition.hpp000644 000765 000024 00000010675 13241160334 027227 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSAttributeGroupDefinition.hpp 1804272 2017-08-06 20:25:24Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSATTRIBUTEGROUPDEFINITION_HPP) #define XERCESC_INCLUDE_GUARD_XSATTRIBUTEGROUPDEFINITION_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * This class describes all properties of a Schema Attribute * Group Definition component. * This is *always* owned by the validator /parser object from which * it is obtained. */ // forward declarations class XSAnnotation; class XSAttributeUse; class XSWildcard; class XercesAttGroupInfo; class XMLPARSER_EXPORT XSAttributeGroupDefinition : public XSObject { public: // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param xercesAttGroupInfo * @param xsAttList * @param xsWildcard * @param xsAnnot * @param xsModel * @param manager The configurable memory manager */ XSAttributeGroupDefinition ( XercesAttGroupInfo* const xercesAttGroupInfo , XSAttributeUseList* const xsAttList , XSWildcard* const xsWildcard , XSAnnotation* const xsAnnot , XSModel* const xsModel , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@}; /** @name Destructor */ //@{ ~XSAttributeGroupDefinition(); //@} //--------------------- /** @name overridden XSObject methods */ //@{ /** * The name of type NCName of this declaration as defined in * XML Namespaces. */ const XMLCh* getName() const; /** * The [target namespace] of this object, or null if it is * unspecified. */ const XMLCh* getNamespace() const; /** * A namespace schema information item corresponding to the target * namespace of the component, if it's globally declared; or null * otherwise. */ XSNamespaceItem* getNamespaceItem(); //@} //--------------------- /** @name XSAttributeGroupDefinition methods */ //@{ /** * A set of [attribute uses]. */ XSAttributeUseList *getAttributeUses(); /** * Optional. A [wildcard]. */ XSWildcard *getAttributeWildcard() const; /** * Optional. An [annotation]. */ XSAnnotation *getAnnotation() const; //@} //---------------------------------- /** methods needed by implementation */ //@{ //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSAttributeGroupDefinition(const XSAttributeGroupDefinition&); XSAttributeGroupDefinition & operator=(const XSAttributeGroupDefinition &); protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- XercesAttGroupInfo* fXercesAttGroupInfo; XSAttributeUseList* fXSAttributeUseList; XSWildcard* fXSWildcard; XSAnnotation* fAnnotation; }; inline XSAttributeUseList* XSAttributeGroupDefinition::getAttributeUses() { return fXSAttributeUseList; } inline XSWildcard* XSAttributeGroupDefinition::getAttributeWildcard() const { return fXSWildcard; } inline XSAnnotation* XSAttributeGroupDefinition::getAnnotation() const { return fAnnotation; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSSimpleTypeDefinition.hpp000644 000765 000024 00000030010 13241160335 026324 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSSimpleTypeDefinition.hpp 1801237 2017-07-07 21:55:11Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSSIMPLETYPEDEFINITION_HPP) #define XERCESC_INCLUDE_GUARD_XSSIMPLETYPEDEFINITION_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * This class represents a simpleType definition * schema component. * This is *always* owned by the validator /parser object from which * it is obtained. * */ // forward declarations class XSAnnotation; class XSFacet; class XSMultiValueFacet; class DatatypeValidator; class XMLPARSER_EXPORT XSSimpleTypeDefinition : public XSTypeDefinition { public: // Variety definitions enum VARIETY { /** * The variety is absent for the anySimpleType definition. */ VARIETY_ABSENT = 0, /** * Atomic type. */ VARIETY_ATOMIC = 1, /** * List type. */ VARIETY_LIST = 2, /** * Union type. */ VARIETY_UNION = 3 }; // Facets enum FACET { /** * No facets defined. */ FACET_NONE = 0, /** * 4.3.1 Length */ FACET_LENGTH = 1, /** * 4.3.2 minLength. */ FACET_MINLENGTH = 2, /** * 4.3.3 maxLength. */ FACET_MAXLENGTH = 4, /** * 4.3.4 pattern. */ FACET_PATTERN = 8, /** * 4.3.5 whitespace. */ FACET_WHITESPACE = 16, /** * 4.3.7 maxInclusive. */ FACET_MAXINCLUSIVE = 32, /** * 4.3.9 maxExclusive. */ FACET_MAXEXCLUSIVE = 64, /** * 4.3.9 minExclusive. */ FACET_MINEXCLUSIVE = 128, /** * 4.3.10 minInclusive. */ FACET_MININCLUSIVE = 256, /** * 4.3.11 totalDigits . */ FACET_TOTALDIGITS = 512, /** * 4.3.12 fractionDigits. */ FACET_FRACTIONDIGITS = 1024, /** * 4.3.5 enumeration. */ FACET_ENUMERATION = 2048 }; // possible order relations enum ORDERING { /** * A constant defined for the 'ordered' fundamental facet: Not ordered. */ ORDERED_FALSE = 0, /** * A constant defined for the 'ordered' fundamental facet: partially * ordered. */ ORDERED_PARTIAL = 1, /** * A constant defined for the 'ordered' fundamental facet: total ordered. */ ORDERED_TOTAL = 2 }; // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param datatypeValidator * @param stVariety * @param xsBaseType * @param primitiveOrItemType * @param memberTypes * @param headAnnot * @param xsModel * @param manager The configurable memory manager */ XSSimpleTypeDefinition ( DatatypeValidator* const datatypeValidator , VARIETY stVariety , XSTypeDefinition* const xsBaseType , XSSimpleTypeDefinition* const primitiveOrItemType , XSSimpleTypeDefinitionList* const memberTypes , XSAnnotation* headAnnot , XSModel* const xsModel , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@}; /** @name Destructor */ //@{ ~XSSimpleTypeDefinition(); //@} //--------------------- /** @name XSSimpleTypeDefinition methods */ //@{ /** * [variety]: one of {atomic, list, union} or absent */ VARIETY getVariety() const; /** * If variety is atomic the primitive type definition (a * built-in primitive datatype definition or the simple ur-type * definition) is available, otherwise null. */ XSSimpleTypeDefinition *getPrimitiveType(); /** * If variety is list the item type definition (an atomic or * union simple type definition) is available, otherwise * null. */ XSSimpleTypeDefinition *getItemType(); /** * If variety is union the list of member type definitions (a * non-empty sequence of simple type definitions) is available, * otherwise null. */ XSSimpleTypeDefinitionList *getMemberTypes() const; /** * [facets]: get all facets defined on this type. The value is a bit * combination of FACET_XXX constants of all defined facets. */ int getDefinedFacets() const; /** * Convenience method. [Facets]: check whether a facet is defined on this * type. * @param facetName The name of the facet. * @return True if the facet is defined, false otherwise. */ bool isDefinedFacet(FACET facetName); /** * [facets]: get all facets defined and fixed on this type. */ int getFixedFacets() const; /** * Convenience method. [Facets]: check whether a facet is defined and * fixed on this type. * @param facetName The name of the facet. * @return True if the facet is fixed, false otherwise. */ bool isFixedFacet(FACET facetName); /** * Convenience method. Returns a value of a single constraining facet for * this simple type definition. This method must not be used to retrieve * values for enumeration and pattern facets. * @param facetName The name of the facet, i.e. * FACET_LENGTH, FACET_TOTALDIGITS (see * XSConstants).To retrieve value for pattern or * enumeration, see enumeration and pattern. * @return A value of the facet specified in facetName for * this simple type definition or null. */ const XMLCh *getLexicalFacetValue(FACET facetName); /** * Returns a list of enumeration values. */ StringList *getLexicalEnumeration(); /** * Returns a list of pattern values. */ StringList *getLexicalPattern(); /** * Fundamental Facet: ordered */ ORDERING getOrdered() const; /** * Fundamental Facet: cardinality. */ bool getFinite() const; /** * Fundamental Facet: bounded. */ bool getBounded() const; /** * Fundamental Facet: numeric. */ bool getNumeric() const; /** * Optional. A set of [annotation]s. */ XSAnnotationList *getAnnotations(); /** * @return list of constraining facets. * This method must not be used to retrieve * values for enumeration and pattern facets. */ XSFacetList *getFacets(); /** * @return list of enumeration and pattern facets. */ XSMultiValueFacetList *getMultiValueFacets(); /** * The name of type NCName of this declaration as defined in * XML Namespaces. */ const XMLCh* getName() const; /** * The [target namespace] of this object, or null if it is * unspecified. */ const XMLCh* getNamespace() const; /** * A namespace schema information item corresponding to the target * namespace of the component, if it's globally declared; or null * otherwise. */ XSNamespaceItem *getNamespaceItem(); /** * A boolean that specifies if the type definition is * anonymous. Convenience attribute. */ bool getAnonymous() const; /** * {base type definition}: either a simple type definition or a complex * type definition. */ XSTypeDefinition *getBaseType(); /** * Convenience method: check if this type is derived from the given * ancestorType. * @param ancestorType An ancestor type definition. * @return Return true if this type is derived from * ancestorType. */ bool derivedFromType(const XSTypeDefinition* const ancestorType); /** * */ inline DatatypeValidator* getDatatypeValidator() const; //@} //---------------------------------- /** methods needed by implementation */ //@{ //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSSimpleTypeDefinition(const XSSimpleTypeDefinition&); XSSimpleTypeDefinition & operator=(const XSSimpleTypeDefinition &); /** * Helper method for construct */ void setFacetInfo ( int definedFacets , int fixedFacets , XSFacetList* const xsFacetList , XSMultiValueFacetList* const xsMultiValueFacetList , StringList* const patternList ); void setPrimitiveType(XSSimpleTypeDefinition* const toSet); friend class XSObjectFactory; protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- int fDefinedFacets; int fFixedFacets; VARIETY fVariety; DatatypeValidator* fDatatypeValidator; XSFacetList* fXSFacetList; XSMultiValueFacetList* fXSMultiValueFacetList; StringList* fPatternList; XSSimpleTypeDefinition* fPrimitiveOrItemType; XSSimpleTypeDefinitionList* fMemberTypes; XSAnnotationList* fXSAnnotationList; }; inline XSSimpleTypeDefinition::VARIETY XSSimpleTypeDefinition::getVariety() const { return fVariety; } inline XSSimpleTypeDefinition* XSSimpleTypeDefinition::getPrimitiveType() { if (fVariety == VARIETY_ATOMIC) return fPrimitiveOrItemType; return 0; } inline XSSimpleTypeDefinition* XSSimpleTypeDefinition::getItemType() { if (fVariety == VARIETY_LIST) return fPrimitiveOrItemType; return 0; } inline XSSimpleTypeDefinitionList* XSSimpleTypeDefinition::getMemberTypes() const { return fMemberTypes; } inline int XSSimpleTypeDefinition::getDefinedFacets() const { return fDefinedFacets; } inline int XSSimpleTypeDefinition::getFixedFacets() const { return fFixedFacets; } inline StringList* XSSimpleTypeDefinition::getLexicalPattern() { return fPatternList; } inline XSFacetList* XSSimpleTypeDefinition::getFacets() { return fXSFacetList; } inline XSMultiValueFacetList* XSSimpleTypeDefinition::getMultiValueFacets() { return fXSMultiValueFacetList; } inline XSAnnotationList *XSSimpleTypeDefinition::getAnnotations() { return fXSAnnotationList; } inline void XSSimpleTypeDefinition::setPrimitiveType(XSSimpleTypeDefinition* const toSet) { fPrimitiveOrItemType = toSet; } inline DatatypeValidator* XSSimpleTypeDefinition::getDatatypeValidator() const { return fDatatypeValidator; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSModelGroup.hpp000644 000765 000024 00000010115 13241160335 024301 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSModelGroup.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSMODELGROUP_HPP) #define XERCESC_INCLUDE_GUARD_XSMODELGROUP_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * This class describes all properties of a Schema Model Group * component. * This is *always* owned by the validator /parser object from which * it is obtained. */ // forward declarations class XSAnnotation; class XSParticle; class XMLPARSER_EXPORT XSModelGroup : public XSObject { public: // Content model compositors enum COMPOSITOR_TYPE { /** * This constant value signifies a sequence operator. */ COMPOSITOR_SEQUENCE = 1, /** * This constant value signifies a choice operator. */ COMPOSITOR_CHOICE = 2, /** * This content model represents a simplified version of the SGML * &-Connector and is limited to the top-level of any content model. * No element in the all content model may appear more than once. */ COMPOSITOR_ALL = 3 }; // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param compositorType * @param particleList * @param annot * @param xsModel * @param manager The configurable memory manager */ XSModelGroup ( COMPOSITOR_TYPE compositorType , XSParticleList* const particleList , XSAnnotation* const annot , XSModel* const xsModel , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@}; /** @name Destructor */ //@{ ~XSModelGroup(); //@} //--------------------- /** @name XSModelGroup methods */ //@{ /** * [compositor]: one of all, choice or sequence. The valid constants * values are: * COMPOSITOR_SEQUENCE, COMPOSITOR_CHOICE, COMPOSITOR_ALL. */ COMPOSITOR_TYPE getCompositor() const; /** * A list of [particles]. */ XSParticleList *getParticles() const; /** * Optional. An [annotation]. */ XSAnnotation *getAnnotation() const; //@} //---------------------------------- /** methods needed by implementation */ //@{ //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSModelGroup(const XSModelGroup&); XSModelGroup & operator=(const XSModelGroup &); protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- COMPOSITOR_TYPE fCompositorType; XSParticleList* fParticleList; XSAnnotation* fAnnotation; }; inline XSModelGroup::COMPOSITOR_TYPE XSModelGroup::getCompositor() const { return fCompositorType; } inline XSParticleList* XSModelGroup::getParticles() const { return fParticleList; } inline XSAnnotation* XSModelGroup::getAnnotation() const { return fAnnotation; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/PSVIElement.cpp000644 000765 000024 00000006341 13241160335 024045 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: PSVIElement.cpp 471747 2006-11-06 14:31:56Z amassari $ */ #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN PSVIElement::PSVIElement(MemoryManager* const manager): PSVIItem(manager), fElementDecl(0), fNotationDecl(0), fSchemaInfo(0) { } PSVIElement::~PSVIElement() { fMemoryManager->deallocate(fCanonicalValue); } XSTypeDefinition* PSVIElement::getTypeDefinition() { return fType; } /** * If and only if that type definition is a simple type definition * with {variety} union, or a complex type definition whose {content type} * is a simple type definition with {variety} union, * then an item isomorphic * to that member of the union's {member type definitions} which actually * validated the element item's normalized value. * * @return a simple type declaration */ XSSimpleTypeDefinition* PSVIElement::getMemberTypeDefinition() { return fMemberType; } void PSVIElement::reset( const VALIDITY_STATE validityState , const ASSESSMENT_TYPE assessmentType , const XMLCh* const validationContext , bool isSpecified , XSElementDeclaration* const elemDecl , XSTypeDefinition* const typeDef , XSSimpleTypeDefinition* const memberType , XSModel* const schemaInfo , const XMLCh* const defaultValue , const XMLCh* const normalizedValue , XMLCh* const canonicalValue , XSNotationDeclaration* const notationDecl) { fValidationContext = validationContext; fValidityState = validityState; fAssessmentType = assessmentType; fIsSpecified = isSpecified; fType = typeDef; fMemberType = memberType; fElementDecl = elemDecl; fNotationDecl = notationDecl; fSchemaInfo = schemaInfo; fDefaultValue = defaultValue; fNormalizedValue = normalizedValue; fMemoryManager->deallocate(fCanonicalValue); fCanonicalValue = canonicalValue; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSElementDeclaration.hpp000644 000765 000024 00000022643 13241160334 025773 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSElementDeclaration.hpp 1804272 2017-08-06 20:25:24Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSELEMENTDECLARATION_HPP) #define XERCESC_INCLUDE_GUARD_XSELEMENTDECLARATION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * This class describes all properties of a Schema Element Declaration * component. * This is *always* owned by the validator /parser object from which * it is obtained. */ // forward declarations class XSAnnotation; class XSComplexTypeDefinition; class XSIDCDefinition; class XSTypeDefinition; class SchemaElementDecl; class XMLPARSER_EXPORT XSElementDeclaration : public XSObject { public: // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param schemaElementDecl * @param typeDefinition * @param substitutionGroupAffiliation * @param annot * @param identityConstraints * @param xsModel * @param elemScope * @param enclosingTypeDefinition * @param manager The configurable memory manager */ XSElementDeclaration ( SchemaElementDecl* const schemaElementDecl , XSTypeDefinition* const typeDefinition , XSElementDeclaration* const substitutionGroupAffiliation , XSAnnotation* const annot , XSNamedMap* const identityConstraints , XSModel* const xsModel , XSConstants::SCOPE elemScope = XSConstants::SCOPE_ABSENT , XSComplexTypeDefinition* const enclosingTypeDefinition = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@}; /** @name Destructor */ //@{ ~XSElementDeclaration(); //@} //--------------------- /** @name overridden XSXSObject methods */ //@{ /** * The name of type NCName of this declaration as defined in * XML Namespaces. */ const XMLCh* getName() const; /** * The [target namespace] of this object, or null if it is * unspecified. */ const XMLCh* getNamespace() const; /** * A namespace schema information item corresponding to the target * namespace of the component, if it's globally declared; or null * otherwise. */ XSNamespaceItem *getNamespaceItem(); //@} //--------------------- /** @name XSElementDeclaration methods */ //@{ /** * [type definition]: either a simple type definition or a complex type * definition. */ XSTypeDefinition *getTypeDefinition() const; /** * Optional. One of SCOPE_GLOBAL, SCOPE_LOCAL, * or SCOPE_ABSENT. If the scope is local, then the * enclosingCTDefinition is present. */ XSConstants::SCOPE getScope() const; /** * The complex type definition for locally scoped declarations (see * scope). */ XSComplexTypeDefinition *getEnclosingCTDefinition() const; /** * [Value constraint]: one of VC_NONE, VC_DEFAULT, VC_FIXED. */ XSConstants::VALUE_CONSTRAINT getConstraintType() const; /** * [Value constraint]: the actual value with respect to the [type * definition]. */ const XMLCh *getConstraintValue(); /** * If nillable is true, then an element may also be valid if it carries * the namespace qualified attribute with local name nil * from namespace http://www.w3.org/2001/XMLSchema-instance * and value true (xsi:nil) even if it has no text or * element content despite a content type which would * otherwise require content. */ bool getNillable() const; /** * identity-constraint definitions: a set of constraint definitions. */ XSNamedMap *getIdentityConstraints(); /** * [substitution group affiliation]: optional. A top-level element * definition. */ XSElementDeclaration *getSubstitutionGroupAffiliation() const; /** * Convenience method. Check if exclusion is a substitution * group exclusion for this element declaration. * @param exclusion * DERIVATION_EXTENSION, DERIVATION_RESTRICTION or * DERIVATION_NONE. Represents final set for the element. * @return True if exclusion is a part of the substitution * group exclusion subset. */ bool isSubstitutionGroupExclusion(XSConstants::DERIVATION_TYPE exclusion); /** * [substitution group exclusions]: the returned value is a bit * combination of the subset of { * DERIVATION_EXTENSION, DERIVATION_RESTRICTION} or * DERIVATION_NONE. */ short getSubstitutionGroupExclusions() const; /** * Convenience method. Check if disallowed is a disallowed * substitution for this element declaration. * @param disallowed { * DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION * } or DERIVATION_NONE. Represents a block set for the * element. * @return True if disallowed is a part of the substitution * group exclusion subset. */ bool isDisallowedSubstitution(XSConstants::DERIVATION_TYPE disallowed); /** * [disallowed substitutions]: the returned value is a bit combination of * the subset of { * DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION * } corresponding to substitutions disallowed by this * XSElementDeclaration or DERIVATION_NONE. */ short getDisallowedSubstitutions() const; /** * {abstract} A boolean. */ bool getAbstract() const; /** * Optional. Annotation. */ XSAnnotation *getAnnotation() const; //@} //---------------------------------- /** methods needed by implementation */ //@{ void setTypeDefinition(XSTypeDefinition* typeDefinition); //@} private: void setEnclosingCTDefinition(XSComplexTypeDefinition* const toSet); friend class XSObjectFactory; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSElementDeclaration(const XSElementDeclaration&); XSElementDeclaration & operator=(const XSElementDeclaration &); protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- short fDisallowedSubstitutions; short fSubstitutionGroupExclusions; XSConstants::SCOPE fScope; SchemaElementDecl* fSchemaElementDecl; XSTypeDefinition* fTypeDefinition; XSComplexTypeDefinition* fEnclosingTypeDefinition; XSElementDeclaration* fSubstitutionGroupAffiliation; XSAnnotation* fAnnotation; XSNamedMap* fIdentityConstraints; }; inline XSTypeDefinition* XSElementDeclaration::getTypeDefinition() const { return fTypeDefinition; } inline XSNamedMap* XSElementDeclaration::getIdentityConstraints() { return fIdentityConstraints; } inline XSElementDeclaration* XSElementDeclaration::getSubstitutionGroupAffiliation() const { return fSubstitutionGroupAffiliation; } inline short XSElementDeclaration::getSubstitutionGroupExclusions() const { return fSubstitutionGroupExclusions; } inline short XSElementDeclaration::getDisallowedSubstitutions() const { return fDisallowedSubstitutions; } inline XSAnnotation *XSElementDeclaration::getAnnotation() const { return fAnnotation; } inline XSConstants::SCOPE XSElementDeclaration::getScope() const { return fScope; } inline XSComplexTypeDefinition *XSElementDeclaration::getEnclosingCTDefinition() const { return fEnclosingTypeDefinition; } inline void XSElementDeclaration::setTypeDefinition(XSTypeDefinition* typeDefinition) { fTypeDefinition = typeDefinition; } inline void XSElementDeclaration::setEnclosingCTDefinition(XSComplexTypeDefinition* const toSet) { fEnclosingTypeDefinition = toSet; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSIDCDefinition.cpp000644 000765 000024 00000010201 13241160335 024623 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSIDCDefinition.cpp 1804272 2017-08-06 20:25:24Z scantor $ */ #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSIDCDefinition: Constructors and Destructor // --------------------------------------------------------------------------- XSIDCDefinition::XSIDCDefinition(IdentityConstraint* const identityConstraint, XSIDCDefinition* const keyIC, XSAnnotation* const headAnnot, StringList* const stringList, XSModel* const xsModel, MemoryManager* const manager) : XSObject(XSConstants::IDENTITY_CONSTRAINT, xsModel, manager) , fIdentityConstraint(identityConstraint) , fKey(keyIC) , fStringList(stringList) , fXSAnnotationList(0) { if (headAnnot) { fXSAnnotationList = new (manager) RefVectorOf(1, false, manager); XSAnnotation* annot = headAnnot; do { fXSAnnotationList->addElement(annot); annot = annot->getNext(); } while (annot); } } XSIDCDefinition::~XSIDCDefinition() { if (fStringList) delete fStringList; // don't delete fKey - deleted by XSModel if (fXSAnnotationList) delete fXSAnnotationList; } // --------------------------------------------------------------------------- // XSIDCDefinition: XSObject virtual methods // --------------------------------------------------------------------------- const XMLCh *XSIDCDefinition::getName() const { return fIdentityConstraint->getIdentityConstraintName(); } const XMLCh *XSIDCDefinition::getNamespace() const { return fXSModel->getURIStringPool()->getValueForId(fIdentityConstraint->getNamespaceURI()); } XSNamespaceItem *XSIDCDefinition::getNamespaceItem() { return fXSModel->getNamespaceItem(getNamespace()); } // --------------------------------------------------------------------------- // XSIDCDefinition: access methods // --------------------------------------------------------------------------- XSIDCDefinition::IC_CATEGORY XSIDCDefinition::getCategory() const { switch(fIdentityConstraint->getType()) { case IdentityConstraint::ICType_UNIQUE: return IC_UNIQUE; case IdentityConstraint::ICType_KEY: return IC_KEY; case IdentityConstraint::ICType_KEYREF: return IC_KEYREF; default: // REVISIT: // should never really get here... IdentityConstraint::Unknown is the other // choice so need a default case for completeness; should issues error? return IC_KEY; } } const XMLCh *XSIDCDefinition::getSelectorStr() { return fIdentityConstraint->getSelector()->getXPath()->getExpression(); } XSAnnotationList *XSIDCDefinition::getAnnotations() { return fXSAnnotationList; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSModelGroupDefinition.cpp000644 000765 000024 00000005774 13241160335 026324 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSModelGroupDefinition.cpp 1804272 2017-08-06 20:25:24Z scantor $ */ #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSModelGroupDefinition: Constructors and Destructors // --------------------------------------------------------------------------- XSModelGroupDefinition::XSModelGroupDefinition(XercesGroupInfo* const groupInfo, XSParticle* const groupParticle, XSAnnotation* const annot, XSModel* const xsModel, MemoryManager* const manager) : XSObject(XSConstants::MODEL_GROUP_DEFINITION, xsModel, manager) , fGroupInfo(groupInfo) , fModelGroupParticle(groupParticle) , fAnnotation(annot) { } XSModelGroupDefinition::~XSModelGroupDefinition() { if (fModelGroupParticle) // Not owned by XSModel delete fModelGroupParticle; } // --------------------------------------------------------------------------- // XSModelGroupDefinition: XSModel virtual methods // --------------------------------------------------------------------------- const XMLCh *XSModelGroupDefinition::getName() const { return fXSModel->getURIStringPool()->getValueForId(fGroupInfo->getNameId()); } const XMLCh *XSModelGroupDefinition::getNamespace() const { return fXSModel->getURIStringPool()->getValueForId(fGroupInfo->getNamespaceId()); } XSNamespaceItem *XSModelGroupDefinition::getNamespaceItem() { return fXSModel->getNamespaceItem(getNamespace()); } // --------------------------------------------------------------------------- // XSModelGroupDefinition: access methods // --------------------------------------------------------------------------- XSModelGroup* XSModelGroupDefinition::getModelGroup() { if (fModelGroupParticle) return fModelGroupParticle->getModelGroupTerm(); return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSAttributeDeclaration.hpp000644 000765 000024 00000013423 13241160335 026342 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSAttributeDeclaration.hpp 1804272 2017-08-06 20:25:24Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSATTRIBUTEDECLARATION_HPP) #define XERCESC_INCLUDE_GUARD_XSATTRIBUTEDECLARATION_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * This class describes all properties of a Schema Attribute * Declaration component. * This is *always* owned by the validator /parser object from which * it is obtained. */ // forward declarations class XSAnnotation; class XSComplexTypeDefinition; class XSSimpleTypeDefinition; class SchemaAttDef; class XMLPARSER_EXPORT XSAttributeDeclaration : public XSObject { public: // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param attDef * @param typeDef * @param annot * @param xsModel * @param scope * @param enclosingCTDefinition * @param manager The configurable memory manager */ XSAttributeDeclaration ( SchemaAttDef* const attDef , XSSimpleTypeDefinition* const typeDef , XSAnnotation* const annot , XSModel* const xsModel , XSConstants::SCOPE scope , XSComplexTypeDefinition* enclosingCTDefinition , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@}; /** @name Destructor */ //@{ ~XSAttributeDeclaration(); //@} //--------------------- /** @name overridden XSObject methods */ //@{ /** * The name of type NCName of this declaration as defined in * XML Namespaces. */ const XMLCh* getName() const; /** * The [target namespace] of this object, or null if it is * unspecified. */ const XMLCh* getNamespace() const; /** * A namespace schema information item corresponding to the target * namespace of the component, if it's globally declared; or null * otherwise. */ XSNamespaceItem* getNamespaceItem(); //@} /** @name XSAttributeDeclaration methods **/ //@{ /** * [type definition]: A simple type definition */ XSSimpleTypeDefinition *getTypeDefinition() const; /** * Optional. One of SCOPE_GLOBAL, SCOPE_LOCAL, * or SCOPE_ABSENT. If the scope is local, then the * enclosingCTDefinition is present. */ XSConstants::SCOPE getScope() const; /** * The complex type definition for locally scoped declarations (see * scope). */ XSComplexTypeDefinition *getEnclosingCTDefinition(); /** * Value constraint: one of VC_NONE, VC_DEFAULT, VC_FIXED. */ XSConstants::VALUE_CONSTRAINT getConstraintType() const; /** * Value constraint: The actual value with respect to the [type definition * ]. */ const XMLCh *getConstraintValue(); /** * Optional. Annotation. */ XSAnnotation *getAnnotation() const; //@} //---------------------------------- /** methods needed by implementation */ //@{ bool getRequired() const; //@} private: void setEnclosingCTDefinition(XSComplexTypeDefinition* const toSet); friend class XSObjectFactory; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSAttributeDeclaration(const XSAttributeDeclaration&); XSAttributeDeclaration & operator=(const XSAttributeDeclaration &); protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- SchemaAttDef* fAttDef; XSSimpleTypeDefinition* fTypeDefinition; XSAnnotation* fAnnotation; XSConstants::SCOPE fScope; XSComplexTypeDefinition* fEnclosingCTDefinition; }; // --------------------------------------------------------------------------- // XSAttributeDeclaration: inline methods // --------------------------------------------------------------------------- inline XSSimpleTypeDefinition* XSAttributeDeclaration::getTypeDefinition() const { return fTypeDefinition; } inline XSAnnotation *XSAttributeDeclaration::getAnnotation() const { return fAnnotation; } inline XSConstants::SCOPE XSAttributeDeclaration::getScope() const { return fScope; } inline XSComplexTypeDefinition *XSAttributeDeclaration::getEnclosingCTDefinition() { return fEnclosingCTDefinition; } inline void XSAttributeDeclaration::setEnclosingCTDefinition ( XSComplexTypeDefinition* const toSet ) { fEnclosingCTDefinition = toSet; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSNamespaceItem.hpp000644 000765 000024 00000020054 13241160335 024742 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSNamespaceItem.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSNAMESPACEITEM_HPP) #define XERCESC_INCLUDE_GUARD_XSNAMESPACEITEM_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN /** * This class contains all properties of the Schema Namespace Information infoitem. * These items correspond to the result of processing a schema document * and all its included/redefined schema documents. It corresponds to the * schema component discussed in the schema specifications, but since it * is not like other components does not inherit from the XSObject interface. * This is *always* owned by the validator /parser object from which * it is obtained. It is designed to be subclassed; subclasses will * specify under what conditions it may be relied upon to have meaningful contents. */ // forward declarations class XSAnnotation; class XSAttributeDeclaration; class XSAttributeGroupDefinition; class XSElementDeclaration; class XSModelGroupDefinition; class XSNotationDeclaration; class XSTypeDefinition; class SchemaGrammar; class XSModel; class XMLPARSER_EXPORT XSNamespaceItem : public XMemory { public: // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param xsModel * @param grammar * @param manager The configurable memory manager */ XSNamespaceItem ( XSModel* const xsModel , SchemaGrammar* const grammar , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); XSNamespaceItem ( XSModel* const xsModel , const XMLCh* const schemaNamespace , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@}; /** @name Destructor */ //@{ ~XSNamespaceItem(); //@} //--------------------- /** @name XSNamespaceItem methods */ //@{ /** * [schema namespace]: A namespace name or null * corresponding to the target namespace of the schema document. */ const XMLCh *getSchemaNamespace() const; /** * [schema components]: a list of top-level components, i.e. element * declarations, attribute declarations, etc. * @param objectType The type of the declaration, i.e. * ELEMENT_DECLARATION, * TYPE_DEFINITION and any other component type that * may be a property of a schema component. * @return A list of top-level definition of the specified type in * objectType or null. */ XSNamedMap *getComponents(XSConstants::COMPONENT_TYPE objectType); /** * [annotations]: a set of annotations. */ XSAnnotationList *getAnnotations(); const XSAnnotationList *getAnnotations() const; /** * Convenience method. Returns a top-level element declaration. * @param name The name of the declaration. * @return A top-level element declaration or null if such * declaration does not exist. */ XSElementDeclaration *getElementDeclaration(const XMLCh *name); /** * Convenience method. Returns a top-level attribute declaration. * @param name The name of the declaration. * @return A top-level attribute declaration or null if such * declaration does not exist. */ XSAttributeDeclaration *getAttributeDeclaration(const XMLCh *name); /** * Convenience method. Returns a top-level simple or complex type * definition. * @param name The name of the definition. * @return An XSTypeDefinition or null if such * definition does not exist. */ XSTypeDefinition *getTypeDefinition(const XMLCh *name); /** * Convenience method. Returns a top-level attribute group definition. * @param name The name of the definition. * @return A top-level attribute group definition or null if * such definition does not exist. */ XSAttributeGroupDefinition *getAttributeGroup(const XMLCh *name); /** * Convenience method. Returns a top-level model group definition. * @param name The name of the definition. * @return A top-level model group definition definition or * null if such definition does not exist. */ XSModelGroupDefinition *getModelGroupDefinition(const XMLCh *name); /** * Convenience method. Returns a top-level notation declaration. * @param name The name of the declaration. * @return A top-level notation declaration or null if such * declaration does not exist. */ XSNotationDeclaration *getNotationDeclaration(const XMLCh *name); /** * [document location] - a list of locations URI for the documents that * contributed to the XSModel. */ const StringList *getDocumentLocations(); //@} //---------------------------------- /** methods needed by implementation */ //@{ //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSNamespaceItem(const XSNamespaceItem&); XSNamespaceItem & operator=(const XSNamespaceItem &); protected: friend class XSModel; friend class XSObjectFactory; // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- // fMemoryManager: // used for any memory allocations MemoryManager* const fMemoryManager; SchemaGrammar* fGrammar; XSModel* fXSModel; /* Need a XSNamedMap for each component top-level? that is top level. ATTRIBUTE_DECLARATION = 1, ELEMENT_DECLARATION = 2, TYPE_DEFINITION = 3, ATTRIBUTE_USE = 4, no ATTRIBUTE_GROUP_DEFINITION= 5, MODEL_GROUP_DEFINITION = 6, MODEL_GROUP = 7, no PARTICLE = 8, no WILDCARD = 9, no IDENTITY_CONSTRAINT = 10, no NOTATION_DECLARATION = 11, ANNOTATION = 12, no FACET = 13, no MULTIVALUE_FACET = 14 no */ XSNamedMap* fComponentMap[XSConstants::MULTIVALUE_FACET]; XSAnnotationList* fXSAnnotationList; RefHashTableOf* fHashMap[XSConstants::MULTIVALUE_FACET]; const XMLCh* fSchemaNamespace; }; inline XSAnnotationList* XSNamespaceItem::getAnnotations() { return fXSAnnotationList; } inline const XSAnnotationList* XSNamespaceItem::getAnnotations() const { return fXSAnnotationList; } inline const XMLCh *XSNamespaceItem::getSchemaNamespace() const { return fSchemaNamespace; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSMultiValueFacet.hpp000644 000765 000024 00000010124 13241160334 025255 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSMultiValueFacet.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSMULTIVALUEFACET_HPP) #define XERCESC_INCLUDE_GUARD_XSMULTIVALUEFACET_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * This class represents all Schema Facets which may possess multiple * lexical values/annotations (i.e., Pattern and Enumeration facets). * This is *always* owned by the validator /parser object from which * it is obtained. */ // forward declarations class XSAnnotation; class XMLPARSER_EXPORT XSMultiValueFacet : public XSObject { public: // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param facetKind * @param lexicalValues * @param isFixed * @param headAnnot * @param xsModel * @param manager The configurable memory manager */ XSMultiValueFacet ( XSSimpleTypeDefinition::FACET facetKind , StringList* lexicalValues , bool isFixed , XSAnnotation* const headAnnot , XSModel* const xsModel , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@}; /** @name Destructor */ //@{ ~XSMultiValueFacet(); //@} //--------------------- /** @name XSMultiValueFacet methods */ //@{ /** * @return An indication as to the facet's type; see XSSimpleTypeDefinition::FACET */ XSSimpleTypeDefinition::FACET getFacetKind() const; /** * @return Returns the values of a constraining facet. */ StringList *getLexicalFacetValues(); /** * Check whether a facet value is fixed. */ bool isFixed() const; /** * @return the annotations belonging to this facet's values */ XSAnnotationList *getAnnotations(); //@} //---------------------------------- /** methods needed by implementation */ //@{ //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSMultiValueFacet(const XSMultiValueFacet&); XSMultiValueFacet & operator=(const XSMultiValueFacet &); protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- XSSimpleTypeDefinition::FACET fFacetKind; bool fIsFixed; StringList* fLexicalValues; // not owned by this class XSAnnotationList* fXSAnnotationList; }; inline XSSimpleTypeDefinition::FACET XSMultiValueFacet::getFacetKind() const { return fFacetKind; } inline bool XSMultiValueFacet::isFixed() const { return fIsFixed; } inline StringList *XSMultiValueFacet::getLexicalFacetValues() { return fLexicalValues; } inline XSAnnotationList *XSMultiValueFacet::getAnnotations() { return fXSAnnotationList; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/PSVIAttribute.hpp000644 000765 000024 00000012412 13241160334 024417 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: PSVIAttribute.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_PSVIATTRIBUTE_HPP) #define XERCESC_INCLUDE_GUARD_PSVIATTRIBUTE_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN /** * Represent the PSVI contributions for one attribute information item. * This is *always* owned by the scanner/parser object from which * it is obtained. The validator will specify * under what conditions it may be relied upon to have meaningful contents. */ // forward declarations class XSAttributeDeclaration; class XMLPARSER_EXPORT PSVIAttribute : public PSVIItem { public: // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param manager The configurable memory manager */ PSVIAttribute( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); //@}; /** @name Destructor */ //@{ ~PSVIAttribute(); //@} //--------------------- /** @name PSVIAttribute methods */ //@{ /** * An item isomorphic to the attribute declaration used to validate * this attribute. * * @return an attribute declaration */ XSAttributeDeclaration *getAttributeDeclaration(); /** * An item isomorphic to the type definition used to validate this element. * * @return a type declaration */ XSTypeDefinition *getTypeDefinition(); /** * If and only if that type definition is a simple type definition * with {variety} union, or a complex type definition whose {content type} * is a simple thype definition with {variety} union, then an item isomorphic * to that member of the union's {member type definitions} which actually * validated the element item's normalized value. * * @return a simple type declaration */ XSSimpleTypeDefinition *getMemberTypeDefinition(); //@} //---------------------------------- /** methods needed by implementation */ //@{ /** * reset this object. Intended to be called by * the implementation. */ void reset( const XMLCh * const valContext , PSVIItem::VALIDITY_STATE state , PSVIItem::ASSESSMENT_TYPE assessmentType , XSSimpleTypeDefinition * validatingType , XSSimpleTypeDefinition * memberType , const XMLCh * const defaultValue , const bool isSpecified , XSAttributeDeclaration * attrDecl , DatatypeValidator * dv ); /** * set the schema normalized value (and * implicitly the canonical value) of this object; intended to be used * by the implementation. */ void setValue(const XMLCh * const normalizedValue); /** * set VALIDITY_STATE to specified value; intended to be * called by implementation. */ void updateValidity(VALIDITY_STATE newValue); //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- PSVIAttribute(const PSVIAttribute&); PSVIAttribute & operator=(const PSVIAttribute &); // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- // fAttributeDecl // attribute declaration component that validated this attribute // fDV // implementation-specific datatype validator used to validate this attribute XSAttributeDeclaration * fAttributeDecl; DatatypeValidator * fDV; }; inline PSVIAttribute::~PSVIAttribute() { fMemoryManager->deallocate((void *)fCanonicalValue); } inline XSAttributeDeclaration *PSVIAttribute::getAttributeDeclaration() { return fAttributeDecl; } inline XSTypeDefinition* PSVIAttribute::getTypeDefinition() { return fType; } inline XSSimpleTypeDefinition* PSVIAttribute::getMemberTypeDefinition() { return fMemberType; } inline void PSVIAttribute::updateValidity(VALIDITY_STATE newValue) { fValidityState = newValue; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSTypeDefinition.hpp000644 000765 000024 00000014471 13241160334 025166 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSTypeDefinition.hpp 1801237 2017-07-07 21:55:11Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSTYPEDEFINITION_HPP) #define XERCESC_INCLUDE_GUARD_XSTYPEDEFINITION_HPP #include XERCES_CPP_NAMESPACE_BEGIN // forward declarations class XSNamespaceItem; /** * This class represents a complexType or simpleType definition. * This is *always* owned by the validator /parser object from which * it is obtained. * */ class XMLPARSER_EXPORT XSTypeDefinition : public XSObject { public: enum TYPE_CATEGORY { /** * This constant value signifies a complex type. */ COMPLEX_TYPE = 15, /** * This constant value signifies a simple type. */ SIMPLE_TYPE = 16 }; // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param typeCategory * @param xsBaseType * @param xsModel * @param manager The configurable memory manager */ XSTypeDefinition ( TYPE_CATEGORY typeCategory , XSTypeDefinition* const xsBaseType , XSModel* const xsModel , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@}; /** @name Destructor */ //@{ virtual ~XSTypeDefinition(); //@} //--------------------- /** @name overloaded XSObject methods */ //@{ /** * The name of type NCName of this declaration as defined in * XML Namespaces. */ virtual const XMLCh* getName() const = 0; /** * The [target namespace] of this object, or null if it is * unspecified. */ virtual const XMLCh* getNamespace() const = 0; /** * A namespace schema information item corresponding to the target * namespace of the component, if it's globally declared; or null * otherwise. */ virtual XSNamespaceItem *getNamespaceItem() = 0; //@} //--------------------- /** @name XSTypeDefinition methods */ //@{ /** * Return whether this type definition is a simple type or complex type. */ TYPE_CATEGORY getTypeCategory() const; /** * {base type definition}: either a simple type definition or a complex * type definition. */ virtual XSTypeDefinition *getBaseType() = 0; /** * {final}. For complex type definition it is a subset of {extension, * restriction}. For simple type definition it is a subset of * {extension, list, restriction, union}. * @param toTest Extension, restriction, list, union constants * (defined in XSObject). * @return True if toTest is in the final set, otherwise false. */ bool isFinal(short toTest); /** * For complex types the returned value is a bit combination of the subset * of {DERIVATION_EXTENSION, DERIVATION_RESTRICTION} * corresponding to final set of this type or * DERIVATION_NONE. For simple types the returned value is * a bit combination of the subset of { * DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST * } corresponding to final set of this type or * DERIVATION_NONE. */ short getFinal() const; /** * A boolean that specifies if the type definition is * anonymous. Convenience attribute. */ virtual bool getAnonymous() const = 0; /** * Convenience method: check if this type is derived from the given * ancestorType. * @param ancestorType An ancestor type definition. * @return Return true if this type is derived from * ancestorType. */ virtual bool derivedFromType(const XSTypeDefinition* const ancestorType) = 0; /** * Convenience method: check if this type is derived from the given * ancestor type. * @param typeNamespace An ancestor type namespace. * @param name An ancestor type name. * @return Return true if this type is derived from * the ancestor defined by typeNamespace and name. */ bool derivedFrom(const XMLCh* typeNamespace, const XMLCh* name); //@} //---------------------------------- /** methods needed by implementation */ //@{ //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSTypeDefinition(const XSTypeDefinition&); XSTypeDefinition & operator=(const XSTypeDefinition &); protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- // fTypeCategory // whether this is a simpleType or complexType // fFinal // the final properties which is set by the derived class. TYPE_CATEGORY fTypeCategory; short fFinal; XSTypeDefinition* fBaseType; // owned by XSModel }; inline XSTypeDefinition::TYPE_CATEGORY XSTypeDefinition::getTypeCategory() const { return fTypeCategory; } inline short XSTypeDefinition::getFinal() const { return fFinal; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSNamedMap.c000644 000765 000024 00000010135 13241160335 023343 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: XSNamedMap.c 674012 2008-07-04 11:18:21Z borisk $ */ // --------------------------------------------------------------------------- // Include // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSNamedMap: Constructors and Destructor // --------------------------------------------------------------------------- template XSNamedMap::XSNamedMap(const XMLSize_t maxElems, const XMLSize_t modulus, XMLStringPool* uriStringPool, const bool adoptElems, MemoryManager* const manager) : fMemoryManager(manager) , fURIStringPool(uriStringPool) { // allow one of the Vector or Hash to own the data... but not both... fVector = new (manager) RefVectorOf (maxElems, false, manager); fHash = new (manager) RefHash2KeysTableOf (modulus, adoptElems, manager); } template XSNamedMap::~XSNamedMap() { delete fVector; delete fHash; } /** * The number of XSObjects in the XSObjectList. * The range of valid child object indices is 0 to * mapLength-1 inclusive. */ template XMLSize_t XSNamedMap::getLength() const { return fVector->size(); } /** * Returns the indexth item in the collection. The index * starts at 0. If index is greater than or equal to the * number of objects in the list, this returns null. * @param index index into the collection. * @return The XSObject at the indexth * position in the XSObjectList, or null if * that is not a valid index. */ template TVal* XSNamedMap::item(XMLSize_t index) { if (index >= fVector->size()) { return 0; } return fVector->elementAt(index); } template const TVal* XSNamedMap::item(XMLSize_t index) const { if (index >= fVector->size()) { return 0; } return fVector->elementAt(index); } /** * Retrieves a component specified by local name and namespace URI. *
applications must use the value null as the * compNamespace parameter for components whose targetNamespace property * is absent. * @param compNamespace The namespace URI of the component to retrieve. * @param localName The local name of the component to retrieve. * @return A component (of any type) with the specified local * name and namespace URI, or null if they do not * identify any node in this map. */ template TVal *XSNamedMap::itemByName(const XMLCh *compNamespace, const XMLCh *localName) { return fHash->get((void*)localName, fURIStringPool->getId(compNamespace)); } template void XSNamedMap::addElement(TVal* const toAdd, const XMLCh* key1, const XMLCh* key2) { fVector->addElement(toAdd); fHash->put((void*)key1, fURIStringPool->getId(key2), toAdd); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSNotationDeclaration.cpp000644 000765 000024 00000005246 13241160335 026171 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSNotationDeclaration.cpp 1804272 2017-08-06 20:25:24Z scantor $ */ #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSNotationDeclaration: Constructors and Destructors // --------------------------------------------------------------------------- XSNotationDeclaration::XSNotationDeclaration ( XMLNotationDecl* const xmlNotationDecl , XSAnnotation* const annot , XSModel* const xsModel , MemoryManager * const manager ) : XSObject(XSConstants::NOTATION_DECLARATION, xsModel, manager) , fXMLNotationDecl(xmlNotationDecl) , fAnnotation(annot) { } XSNotationDeclaration::~XSNotationDeclaration() { } // --------------------------------------------------------------------------- // XSNotationDeclaration: XSModel virtual methods // --------------------------------------------------------------------------- const XMLCh *XSNotationDeclaration::getName() const { return fXMLNotationDecl->getName(); } const XMLCh *XSNotationDeclaration::getNamespace() const { return fXSModel->getURIStringPool()->getValueForId(fXMLNotationDecl->getNameSpaceId()); } XSNamespaceItem *XSNotationDeclaration::getNamespaceItem() { return fXSModel->getNamespaceItem(getNamespace()); } // --------------------------------------------------------------------------- // XSNotationDeclaration: access methods // --------------------------------------------------------------------------- const XMLCh *XSNotationDeclaration::getSystemId() { return fXMLNotationDecl->getSystemId(); } const XMLCh *XSNotationDeclaration::getPublicId() { return fXMLNotationDecl->getPublicId(); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSWildcard.hpp000644 000765 000024 00000012637 13241160335 023770 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSWildcard.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSWILDCARD_HPP) #define XERCESC_INCLUDE_GUARD_XSWILDCARD_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * This class describes all properties of a Schema Wildcard * component. * This is *always* owned by the validator /parser object from which * it is obtained. */ // forward declarations class XSAnnotation; class SchemaAttDef; class ContentSpecNode; class XMLPARSER_EXPORT XSWildcard : public XSObject { public: // Namespace Constraint enum NAMESPACE_CONSTRAINT { /** * Namespace Constraint: any namespace is allowed. */ NSCONSTRAINT_ANY = 1, /** * Namespace Constraint: namespaces in the list are not allowed. */ NSCONSTRAINT_NOT = 2, /** * Namespace Constraint: namespaces in the list are allowed. */ NSCONSTRAINT_DERIVATION_LIST = 3 }; // Process contents enum PROCESS_CONTENTS { /** * There must be a top-level declaration for the item available, or the * item must have an xsi:type, and the item must be valid as appropriate. */ PC_STRICT = 1, /** * No constraints at all: the item must simply be well-formed XML. */ PC_SKIP = 2, /** * If the item, or any items among its [children] is an element * information item, has a uniquely determined declaration available, it * must be valid with respect to that definition, that is, validate * where you can, don't worry when you can't. */ PC_LAX = 3 }; // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param attWildCard * @param annot * @param xsModel * @param manager The configurable memory manager */ XSWildcard ( SchemaAttDef* const attWildCard , XSAnnotation* const annot , XSModel* const xsModel , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); XSWildcard ( const ContentSpecNode* const elmWildCard , XSAnnotation* const annot , XSModel* const xsModel , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** @name Destructor */ //@{ ~XSWildcard(); //@} //--------------------- /** @name XSWildcard methods */ //@{ /** * Namespace constraint: A constraint type: any, not, list. */ NAMESPACE_CONSTRAINT getConstraintType() const; /** * Namespace constraint. For constraintType * NSCONSTRAINT_DERIVATION_LIST, the list contains allowed namespaces. * For constraintType NSCONSTRAINT_NOT, the * list contains disallowed namespaces. */ StringList *getNsConstraintList(); /** * [process contents]: one of skip, lax or strict. Valid constants values * are: PC_SKIP, PC_LAX, PC_STRICT. */ PROCESS_CONTENTS getProcessContents() const; /** * Optional. An [annotation]. */ XSAnnotation *getAnnotation() const; //@} //---------------------------------- /** methods needed by implementation */ //@{ //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSWildcard(const XSWildcard&); XSWildcard & operator=(const XSWildcard &); /** * Build namespace list */ void buildNamespaceList(const ContentSpecNode* const rootNode); protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- NAMESPACE_CONSTRAINT fConstraintType; PROCESS_CONTENTS fProcessContents; StringList* fNsConstraintList; XSAnnotation* fAnnotation; }; inline XSAnnotation *XSWildcard::getAnnotation() const { return fAnnotation; } inline XSWildcard::PROCESS_CONTENTS XSWildcard::getProcessContents() const { return fProcessContents; } inline StringList* XSWildcard::getNsConstraintList() { return fNsConstraintList; } inline XSWildcard::NAMESPACE_CONSTRAINT XSWildcard::getConstraintType() const { return fConstraintType; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSAttributeGroupDefinition.cpp000644 000765 000024 00000005016 13241160334 027213 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSAttributeGroupDefinition.cpp 1804272 2017-08-06 20:25:24Z scantor $ */ #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSAttributeGroupDefinition: Constructors and Destructor // --------------------------------------------------------------------------- XSAttributeGroupDefinition::XSAttributeGroupDefinition ( XercesAttGroupInfo* const xercesAttGroupInfo , XSAttributeUseList* const xsAttList , XSWildcard* const xsWildcard , XSAnnotation* const xsAnnot , XSModel* const xsModel , MemoryManager * const manager ) : XSObject(XSConstants::ATTRIBUTE_GROUP_DEFINITION, xsModel, manager) , fXercesAttGroupInfo(xercesAttGroupInfo) , fXSAttributeUseList(xsAttList) , fXSWildcard(xsWildcard) , fAnnotation(xsAnnot) { } XSAttributeGroupDefinition::~XSAttributeGroupDefinition() { if (fXSAttributeUseList) delete fXSAttributeUseList; // don't delete fXSWildcard - deleted by XSModel } // XSObject methods const XMLCh *XSAttributeGroupDefinition::getName() const { return fXSModel->getURIStringPool()->getValueForId(fXercesAttGroupInfo->getNameId()); } const XMLCh *XSAttributeGroupDefinition::getNamespace() const { return fXSModel->getURIStringPool()->getValueForId(fXercesAttGroupInfo->getNamespaceId()); } XSNamespaceItem *XSAttributeGroupDefinition::getNamespaceItem() { return fXSModel->getNamespaceItem(getNamespace()); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSSimpleTypeDefinition.cpp000644 000765 000024 00000016643 13241160335 026337 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSSimpleTypeDefinition.cpp 1801237 2017-07-07 21:55:11Z scantor $ */ #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local, static functions // --------------------------------------------------------------------------- static bool XSSimpleTypeDefinitionTestFlag(int flag) { if (flag) return true; return false; } // --------------------------------------------------------------------------- // XSSimpleTypeDefinition: Constructors and Destructors // --------------------------------------------------------------------------- XSSimpleTypeDefinition::XSSimpleTypeDefinition ( DatatypeValidator* const datatypeValidator , VARIETY stVariety , XSTypeDefinition* const xsBaseType , XSSimpleTypeDefinition* const primitiveOrItemType , XSSimpleTypeDefinitionList* const memberTypes , XSAnnotation* headAnnot , XSModel* const xsModel , MemoryManager* const manager ) : XSTypeDefinition(SIMPLE_TYPE, xsBaseType, xsModel, manager) , fDefinedFacets(0) , fFixedFacets(0) , fVariety(stVariety) , fDatatypeValidator(datatypeValidator) , fXSFacetList(0) , fXSMultiValueFacetList(0) , fPatternList(0) , fPrimitiveOrItemType(primitiveOrItemType) , fMemberTypes(memberTypes) , fXSAnnotationList(0) { int finalset = fDatatypeValidator->getFinalSet(); if (finalset) { if (finalset & SchemaSymbols::XSD_EXTENSION) fFinal |= XSConstants::DERIVATION_EXTENSION; if (finalset & SchemaSymbols::XSD_RESTRICTION) fFinal |= XSConstants::DERIVATION_RESTRICTION; if (finalset & SchemaSymbols::XSD_LIST) fFinal |= XSConstants::DERIVATION_LIST; if (finalset & SchemaSymbols::XSD_UNION) fFinal |= XSConstants::DERIVATION_UNION; } if (headAnnot) { XSAnnotation* annot = headAnnot; fXSAnnotationList = new (manager) RefVectorOf(3, false, manager); do { fXSAnnotationList->addElement(annot); annot = annot->getNext(); } while (annot); } } XSSimpleTypeDefinition::~XSSimpleTypeDefinition() { if (fXSFacetList) delete fXSFacetList; if (fXSMultiValueFacetList) delete fXSMultiValueFacetList; if (fPatternList) delete fPatternList; // don't delete fPrimitiveOrItemType -> deleted by XSModel if (fMemberTypes) delete fMemberTypes; if (fXSAnnotationList) delete fXSAnnotationList; } // --------------------------------------------------------------------------- // XSSimpleTypeDefinition: access methods // --------------------------------------------------------------------------- bool XSSimpleTypeDefinition::isDefinedFacet(FACET facetName) { return XSSimpleTypeDefinitionTestFlag(fDefinedFacets & facetName); } bool XSSimpleTypeDefinition::isFixedFacet(FACET facetName) { return XSSimpleTypeDefinitionTestFlag(fFixedFacets & facetName); } const XMLCh *XSSimpleTypeDefinition::getLexicalFacetValue(FACET facetName) { XMLSize_t size = fXSFacetList->size(); for (XMLSize_t i=0; ielementAt(i))->getFacetKind()) == facetName) return (fXSFacetList->elementAt(i))->getLexicalFacetValue(); } return 0; } StringList *XSSimpleTypeDefinition::getLexicalEnumeration() { return (RefArrayVectorOf*) fDatatypeValidator->getEnumString(); } XSSimpleTypeDefinition::ORDERING XSSimpleTypeDefinition::getOrdered() const { return fDatatypeValidator->getOrdered(); } bool XSSimpleTypeDefinition::getFinite() const { return fDatatypeValidator->getFinite(); } bool XSSimpleTypeDefinition::getBounded() const { return fDatatypeValidator->getBounded(); } bool XSSimpleTypeDefinition::getNumeric() const { return fDatatypeValidator->getNumeric(); } // --------------------------------------------------------------------------- // XSSimpleTypeDefinition: virtual methods // --------------------------------------------------------------------------- const XMLCh *XSSimpleTypeDefinition::getName() const { return fDatatypeValidator->getTypeLocalName(); } const XMLCh *XSSimpleTypeDefinition::getNamespace() const { return fDatatypeValidator->getTypeUri(); } XSNamespaceItem *XSSimpleTypeDefinition::getNamespaceItem() { return fXSModel->getNamespaceItem(getNamespace()); } bool XSSimpleTypeDefinition::getAnonymous() const { return fDatatypeValidator->getAnonymous(); } XSTypeDefinition *XSSimpleTypeDefinition::getBaseType() { return fBaseType; } bool XSSimpleTypeDefinition::derivedFromType(const XSTypeDefinition * const ancestorType) { if (!ancestorType) return false; XSTypeDefinition* type; if (ancestorType->getTypeCategory() == XSTypeDefinition::COMPLEX_TYPE) { type = (XSTypeDefinition*) ancestorType; if (ancestorType == type->getBaseType()) { // ancestor is anytype return true; } return false; } type = this; XSTypeDefinition* lastType = 0; // anysimple type has a base type of anytype // anytype has a basetype of anytype so will have infinite loop... while (type && (type != ancestorType) && (type != lastType)) { lastType = type; type = type->getBaseType(); } return (type == ancestorType); } // --------------------------------------------------------------------------- // XSSimpleTypeDefinition: helper methods // --------------------------------------------------------------------------- void XSSimpleTypeDefinition::setFacetInfo ( int definedFacets , int fixedFacets , XSFacetList* const xsFacetList , XSMultiValueFacetList* const xsMultiValueFacetList , StringList* const patternList ) { fDefinedFacets = definedFacets; fFixedFacets = fixedFacets; fXSFacetList = xsFacetList; fXSMultiValueFacetList = xsMultiValueFacetList; fPatternList = patternList; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSModelGroup.cpp000644 000765 000024 00000003354 13241160335 024303 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSModelGroup.cpp 471747 2006-11-06 14:31:56Z amassari $ */ #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSModelGroup: Constructors and Destructor // --------------------------------------------------------------------------- XSModelGroup::XSModelGroup(COMPOSITOR_TYPE compositorType, XSParticleList* const particleList, XSAnnotation* const annot, XSModel* const xsModel, MemoryManager * const manager) : XSObject(XSConstants::MODEL_GROUP, xsModel, manager) , fCompositorType(compositorType) , fParticleList(particleList) , fAnnotation(annot) { } XSModelGroup::~XSModelGroup() { if (fParticleList) delete fParticleList; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSValue.cpp000644 000765 000024 00000204036 13241160334 023301 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSValue.cpp 932889 2010-04-11 13:10:10Z borisk $ */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN /*** issues * * 1. For float, double, datetime family, the validation is almost similar to getActualValue * * * DataType DataGroup * num dtm str validation canonical actual-value * ====================================================================================================== * dt_string str [2] Char NA content * dt_boolean str {true, false, 1, 0} {true, false} bool * dt_decimal num lexical only yes double * dt_float num lexical/value yes double * dt_double num lexical/value yes double * --------------------------------------------------------------------------------------------------------- * 5 dt_duration dtm yes NA struct datetime * dt_dateTime dtm yes yes struct datetime * dt_time dtm yes yes struct datetime * dt_date dtm yes NA struct datetime * dt_gYearMonth dtm yes NA struct datetime * --------------------------------------------------------------------------------------------------------- * 10 dt_gYear dtm yes NA struct datetime * dt_gMonthDay dtm yes NA struct datetime * dt_gDay dtm yes NA struct datetime * dt_gMonth dtm yes NA struct datetime * dt_hexBinary str decoding ([a-f]) unsigned long ? * --------------------------------------------------------------------------------------------------------- * 15 dt_base64Binary str decoding NA (errata?) unsigned long ? * dt_anyURI str yes NA content * dt_QName str a:b , [6]QName NA content * dt_NOTATION str [6]QName NA content * dt_normalizedString str no #xD #xA #x9 NA content * --------------------------------------------------------------------------------------------------------- * 20 dt_token str no #xD #xA #x9 traling NA content * dt_language str language id NA content * dt_NMTOKEN str [7] Nmtoken NA content * dt_NMTOKENS str [8] Nmtokens NA content * dt_Name str [5] Name NA content * --------------------------------------------------------------------------------------------------------- * 25 dt_NCName str [4] NCName NA content * dt_ID str [4] NCName NA content * dt_IDREF str [4] NCName NA content * dt_IDREFS str ws seped IDREF NA content * dt_ENTITY str [4] NCName NA content * --------------------------------------------------------------------------------------------------------- * 30 dt_ENTITIES str ws seped ENTITY NA content * dt_integer num lexical yes long * dt_nonPositiveInteger num lexical yes long * dt_negativeInteger num lexical yes long * dt_long num lexical yes long * --------------------------------------------------------------------------------------------------------- * 35 dt_int num lexical yes int * dt_short num lexical yes short * dt_byte num lexical yes char * dt_nonNegativeInteger num lexical yes unsigned long * dt_unsignedLong num lexical yes unsigned long * --------------------------------------------------------------------------------------------------------- * 40 dt_unsignedInt num lexical yes unsigned int * dt_unsignedShort num lexical yes unsigned short * dt_unsignedByte num lexical yes unsigned char * dt_positiveInteger num lexical yes unsigned long * ***/ const XSValue::DataGroup XSValue::inGroup[XSValue::dt_MAXCOUNT] = { dg_strings, dg_strings, dg_numerics, dg_numerics, dg_numerics, dg_datetimes, dg_datetimes, dg_datetimes, dg_datetimes, dg_datetimes, dg_datetimes, dg_datetimes, dg_datetimes, dg_datetimes, dg_strings, dg_strings, dg_strings, dg_strings, dg_strings, dg_strings, dg_strings, dg_strings, dg_strings, dg_strings, dg_strings, dg_strings, dg_strings, dg_strings, dg_strings, dg_strings, dg_strings, dg_numerics, dg_numerics, dg_numerics, dg_numerics, dg_numerics, dg_numerics, dg_numerics, dg_numerics, dg_numerics, dg_numerics, dg_numerics, dg_numerics, dg_numerics }; const bool XSValue::numericSign[XSValue::dt_MAXCOUNT] = { true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false, false }; // --------------------------------------------------------------------------- // Local static functions // --------------------------------------------------------------------------- static RegularExpression* sXSValueRegEx = 0; ValueHashTableOf* XSValue::fDataTypeRegistry = 0; void XMLInitializer::initializeXSValue() { sXSValueRegEx = new RegularExpression( XMLUni::fgLangPattern, SchemaSymbols::fgRegEx_XOption); XSValue::initializeRegistry(); } void XMLInitializer::terminateXSValue() { delete XSValue::fDataTypeRegistry; XSValue::fDataTypeRegistry = 0; delete sXSValueRegEx; sXSValueRegEx = 0; } XSValue::DataType XSValue::getDataType(const XMLCh* const dtString) { if (fDataTypeRegistry->containsKey(dtString)) { return fDataTypeRegistry->get(dtString); } return dt_MAXCOUNT; } void XSValue::initializeRegistry() { //using the XMLPlatformUtils::fgMemoryManager fDataTypeRegistry = new ValueHashTableOf(43); if (fDataTypeRegistry) { fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_STRING, XSValue::dt_string); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_BOOLEAN, XSValue::dt_boolean); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DECIMAL, XSValue::dt_decimal); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_FLOAT, XSValue::dt_float); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DOUBLE, XSValue::dt_double); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DURATION, XSValue::dt_duration); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DATETIME, XSValue::dt_dateTime); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_TIME, XSValue::dt_time); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DATE, XSValue::dt_date); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_YEARMONTH, XSValue::dt_gYearMonth); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_YEAR, XSValue::dt_gYear); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_MONTHDAY, XSValue::dt_gMonthDay); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DAY, XSValue::dt_gDay); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_MONTH, XSValue::dt_gMonth); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_HEXBINARY, XSValue::dt_hexBinary); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_BASE64BINARY, XSValue::dt_base64Binary); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_ANYURI, XSValue::dt_anyURI); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_QNAME, XSValue::dt_QName); fDataTypeRegistry->put((void*) XMLUni::fgNotationString, XSValue::dt_NOTATION); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NORMALIZEDSTRING, XSValue::dt_normalizedString); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_TOKEN, XSValue::dt_token); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_LANGUAGE, XSValue::dt_language); fDataTypeRegistry->put((void*) XMLUni::fgNmTokenString, XSValue::dt_NMTOKEN); fDataTypeRegistry->put((void*) XMLUni::fgNmTokensString, XSValue::dt_NMTOKENS); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NAME, XSValue::dt_Name); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NCNAME, XSValue::dt_NCName); fDataTypeRegistry->put((void*) XMLUni::fgIDString, XSValue::dt_ID); fDataTypeRegistry->put((void*) XMLUni::fgIDRefString, XSValue::dt_IDREF); fDataTypeRegistry->put((void*) XMLUni::fgIDRefsString, XSValue::dt_IDREFS); fDataTypeRegistry->put((void*) XMLUni::fgEntityString, XSValue::dt_ENTITY); fDataTypeRegistry->put((void*) XMLUni::fgEntitiesString, XSValue::dt_ENTITIES); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_INTEGER, XSValue::dt_integer); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NONPOSITIVEINTEGER, XSValue::dt_nonPositiveInteger); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NEGATIVEINTEGER, XSValue::dt_negativeInteger); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_LONG, XSValue::dt_long); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_INT, XSValue::dt_int); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_SHORT, XSValue::dt_short); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_BYTE, XSValue::dt_byte); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NONNEGATIVEINTEGER, XSValue::dt_nonNegativeInteger); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_ULONG, XSValue::dt_unsignedLong); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_UINT, XSValue::dt_unsignedInt); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_USHORT, XSValue::dt_unsignedShort); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_UBYTE, XSValue::dt_unsignedByte); fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_POSITIVEINTEGER, XSValue::dt_positiveInteger); } } static bool checkTimeZoneError(XSValue::DataType const &datatype , SchemaDateTimeException const &e ) { return (((datatype == XSValue::dt_dateTime) || (datatype == XSValue::dt_time) || (datatype == XSValue::dt_date)) && ((e.getCode() == XMLExcepts::DateTime_tz_noUTCsign) || (e.getCode() == XMLExcepts::DateTime_tz_stuffAfterZ) || (e.getCode() == XMLExcepts::DateTime_tz_invalid) || (e.getCode() == XMLExcepts::DateTime_tz_hh_invalid))); } // --------------------------------------------------------------------------- // Local Data // --------------------------------------------------------------------------- static const XMLCh Separator_20[] = {chSpace, chNull}; static const XMLCh Separator_ws[] = {chSpace, chLF, chCR, chHTab, chNull}; // --------------------------------------------------------------------------- // XSValue: Constructors and Destructor // --------------------------------------------------------------------------- XSValue::XSValue(DataType const dt , MemoryManager* const manager) :fMemAllocated(false) ,fMemoryManager(manager) { fData.f_datatype = dt; } XSValue::~XSValue() { if (fMemAllocated) fMemoryManager->deallocate(fData.fValue.f_byteVal); } // --------------------------------------------------------------------------- // XSValue: Public Interface // // No exception is thrown from these methods // // --------------------------------------------------------------------------- bool XSValue::validate(const XMLCh* const content , DataType datatype , Status& status , XMLVersion version , MemoryManager* const manager) { if (!content || !*content || ((version == ver_10) && (XMLChar1_0::isAllSpaces(content, XMLString::stringLen(content)))) || ((version == ver_11) && (XMLChar1_1::isAllSpaces(content, XMLString::stringLen(content)))) ) { switch (datatype) { case XSValue::dt_string: case XSValue::dt_normalizedString: case XSValue::dt_token: case XSValue::dt_anyURI: case XSValue::dt_hexBinary: case XSValue::dt_base64Binary: status = st_Init; return true; break; default: status = st_NoContent; return false; break; } } status = st_Init; switch (inGroup[datatype]) { case XSValue::dg_numerics: return validateNumerics(content, datatype, status, manager); break; case XSValue::dg_datetimes: return validateDateTimes(content, datatype, status, manager); break; case XSValue::dg_strings: return validateStrings(content, datatype, status, version, manager); break; default: status = st_UnknownType; return false; break; } return false; } XMLCh* XSValue::getCanonicalRepresentation(const XMLCh* const content , DataType datatype , Status& status , XMLVersion version , bool toValidate , MemoryManager* const manager) { if (!content || !*content || ((version == ver_10) && (XMLChar1_0::isAllSpaces(content, XMLString::stringLen(content)))) || ((version == ver_11) && (XMLChar1_1::isAllSpaces(content, XMLString::stringLen(content)))) ) { status = st_NoContent; return 0; } status = st_Init; switch (inGroup[datatype]) { case XSValue::dg_numerics: return getCanRepNumerics(content, datatype, status, toValidate, manager); break; case XSValue::dg_datetimes: return getCanRepDateTimes(content, datatype, status, toValidate, manager); break; case XSValue::dg_strings: return getCanRepStrings(content, datatype, status, version, toValidate, manager); break; default: status = st_UnknownType; return 0; break; } return 0; } XSValue* XSValue::getActualValue(const XMLCh* const content , DataType datatype , Status& status , XMLVersion version , bool toValidate , MemoryManager* const manager) { if (!content || !*content || ((version == ver_10) && (XMLChar1_0::isAllSpaces(content, XMLString::stringLen(content)))) || ((version == ver_11) && (XMLChar1_1::isAllSpaces(content, XMLString::stringLen(content)))) ) { status = st_NoContent; return 0; } status = st_Init; switch (inGroup[datatype]) { case XSValue::dg_numerics: return getActValNumerics(content, datatype, status, toValidate, manager); break; case XSValue::dg_datetimes: return getActValDateTimes(content, datatype, status, manager); break; case XSValue::dg_strings: return getActValStrings(content, datatype, status, version, toValidate, manager); break; default: status = st_UnknownType; return 0; break; } return 0; } // --------------------------------------------------------------------------- // XSValue: Helpers // --------------------------------------------------------------------------- /*** * * Boundary checking is done against Schema Type's lexcial space ***/ bool XSValue::validateNumerics(const XMLCh* const content , DataType datatype , Status& status , MemoryManager* const manager) { try { switch (datatype) { case XSValue::dt_decimal: XMLBigDecimal::parseDecimal(content, manager); break; case XSValue::dt_float: { //XMLFloat takes care of 0, -0, -INF, INF and NaN //XMLFloat::checkBoundary() handles error and outofbound issues XMLFloat data(content, manager); break; } case XSValue::dt_double: { //XMLDouble takes care of 0, -0, -INF, INF and NaN //XMLDouble::checkBoundary() handles error and outofbound issues XMLDouble data(content, manager); break; } /*** * For all potentially unrepresentable types * * For dt_long, dt_unsignedLong, doing lexical space * checking ensures consistent behaviour on 32/64 boxes * ***/ case XSValue::dt_integer: case XSValue::dt_negativeInteger: case XSValue::dt_nonPositiveInteger: case XSValue::dt_nonNegativeInteger: case XSValue::dt_positiveInteger: case XSValue::dt_long: case XSValue::dt_unsignedLong: { XMLCh* compareData = (XMLCh*) manager->allocate((XMLString::stringLen(content) + 1) * sizeof(XMLCh)); ArrayJanitor janName(compareData, manager); int signValue = 0; XMLBigInteger::parseBigInteger(content, compareData, signValue, manager); switch (datatype) { case XSValue::dt_integer: //error: no break; case XSValue::dt_negativeInteger: // error: > -1 if (XMLBigInteger::compareValues(compareData , signValue , &(XMLUni::fgNegOne[1]) , -1 , manager) == XMLNumber::GREATER_THAN) { status = st_FOCA0002; return false; } break; case XSValue::dt_nonPositiveInteger: // error: > 0 if (XMLBigInteger::compareValues(compareData , signValue , XMLUni::fgValueZero , 0 , manager) == XMLNumber::GREATER_THAN) { status = st_FOCA0002; return false; } break; case XSValue::dt_nonNegativeInteger: // error: < 0 if (XMLBigInteger::compareValues(compareData , signValue , XMLUni::fgValueZero , 0 , manager) == XMLNumber::LESS_THAN) { status = st_FOCA0002; return false; } break; case XSValue::dt_positiveInteger: // error: < 1 if (XMLBigInteger::compareValues(compareData , signValue , XMLUni::fgValueOne , 1 , manager) == XMLNumber::LESS_THAN) { status = st_FOCA0002; return false; } break; case XSValue::dt_long: // error: < -9223372036854775808 || > 9223372036854775807 if ((XMLBigInteger::compareValues(compareData , signValue , &(XMLUni::fgLongMinInc[1]) , -1 , manager) == XMLNumber::LESS_THAN) || (XMLBigInteger::compareValues(compareData , signValue , XMLUni::fgLongMaxInc , 1 , manager) == XMLNumber::GREATER_THAN)) { status = st_FOCA0002; return false; } break; case XSValue::dt_unsignedLong: // error: < 0 || > 18446744073709551615 if ((XMLBigInteger::compareValues(compareData , signValue , XMLUni::fgValueZero , 0 , manager) == XMLNumber::LESS_THAN) || (XMLBigInteger::compareValues(compareData , signValue , XMLUni::fgULongMaxInc , 1 , manager) == XMLNumber::GREATER_THAN)) { status = st_FOCA0002; return false; } break; default: status = st_NotSupported; return false; break; } break; } case XSValue::dt_int: case XSValue::dt_short: case XSValue::dt_byte: case XSValue::dt_unsignedInt: case XSValue::dt_unsignedShort: case XSValue::dt_unsignedByte: { t_value actVal; if ( !getActualNumericValue( content , status , actVal , manager , datatype ) ) { return false; } break; } default: return false; } // end switch } catch (const NumberFormatException&) { //getActValue()/getCanonical() need to know the failure details //if validation is required status = st_FOCA0002; return false; } return true; //both valid chars and within boundary } bool XSValue::validateDateTimes(const XMLCh* const input_content , DataType datatype , Status& status , MemoryManager* const manager) { XMLCh* content = XMLString::replicate(input_content, manager); ArrayJanitor janTmpName(content, manager); XMLString::trim(content); try { XMLDateTime coreDate = XMLDateTime(content, manager); switch (datatype) { case XSValue::dt_duration: coreDate.parseDuration(); break; case XSValue::dt_dateTime: coreDate.parseDateTime(); break; case XSValue::dt_time: coreDate.parseTime(); break; case XSValue::dt_date: coreDate.parseDate(); break; case XSValue::dt_gYearMonth: coreDate.parseYearMonth(); break; case XSValue::dt_gYear: coreDate.parseYear(); break; case XSValue::dt_gMonthDay: coreDate.parseMonthDay(); break; case XSValue::dt_gDay: coreDate.parseDay(); break; case XSValue::dt_gMonth: coreDate.parseMonth(); break; default: return false; break; } } catch (const SchemaDateTimeException &e) { status = checkTimeZoneError(datatype, e)? XSValue::st_FODT0003 : st_FOCA0002; return false; } catch (const NumberFormatException&) { //getActValue()/getCanonical() need to know the failure details //if validation is required status = st_FOCA0002; return false; } return true; //parsing succeed } bool XSValue::validateStrings(const XMLCh* const content , DataType datatype , Status& status , XMLVersion version , MemoryManager* const manager) { bool isValid = true; switch (datatype) { case XSValue::dt_boolean: { XMLSize_t i = 0; XMLCh* tmpStrValue = XMLString::replicate(content, manager); ArrayJanitor janTmpName(tmpStrValue, manager); XMLString::trim(tmpStrValue); for (; i < XMLUni::fgBooleanValueSpaceArraySize; i++) { if (XMLString::equals(tmpStrValue, XMLUni::fgBooleanValueSpace[i])) break; } if (XMLUni::fgBooleanValueSpaceArraySize == i) { isValid = false; } break; } case XSValue::dt_hexBinary: { XMLCh* tmpStrValue = XMLString::replicate(content, manager); ArrayJanitor janTmpName(tmpStrValue, manager); XMLString::trim(tmpStrValue); if (HexBin::getDataLength(tmpStrValue) == -1) { isValid = false; } } break; case XSValue::dt_base64Binary: if (Base64::getDataLength(content, manager) == -1) { isValid = false; } break; case XSValue::dt_anyURI: if (XMLUri::isValidURI(true, content, true) == false) { isValid = false; } break; case XSValue::dt_QName: { XMLCh* tmpStrValue = XMLString::replicate(content, manager); ArrayJanitor janTmpName(tmpStrValue, manager); XMLString::trim(tmpStrValue); isValid = (version == ver_10) ? XMLChar1_0::isValidQName(tmpStrValue, XMLString::stringLen(tmpStrValue)) : XMLChar1_1::isValidQName(tmpStrValue, XMLString::stringLen(tmpStrValue)); } break; case XSValue::dt_NOTATION: { XMLCh* tmpStrValue = XMLString::replicate(content, manager); ArrayJanitor janTmpName(tmpStrValue, manager); XMLString::trim(tmpStrValue); if ( XMLString::isValidNOTATION(tmpStrValue, manager) == false) { isValid = false; } } break; case XSValue::dt_string: { const XMLCh* rawPtr = content; if (version == ver_10) { while (*rawPtr) if (!XMLChar1_0::isXMLChar(*rawPtr++)) { isValid = false; break; } } else { while (*rawPtr) if (!XMLChar1_1::isXMLChar(*rawPtr++)) { isValid = false; break; } } break; } case XSValue::dt_normalizedString: { const XMLCh* rawPtr = content; if (version == ver_10) { while (*rawPtr) { if (!XMLChar1_0::isXMLChar(*rawPtr)) { isValid = false; break; } else if (*rawPtr == chCR || *rawPtr == chLF || *rawPtr == chHTab) { isValid = false; break; } else { rawPtr++; } } } else { while (*rawPtr) { if (!XMLChar1_1::isXMLChar(*rawPtr)) { isValid = false; break; } else if (*rawPtr == chCR || *rawPtr == chLF || *rawPtr == chHTab) { isValid = false; break; } else { rawPtr++; } } } break; } case XSValue::dt_token: case XSValue::dt_language: { XMLSize_t strLen = XMLString::stringLen(content); const XMLCh* rawPtr = content; bool inWS = false; if (version == ver_10) { // Check leading/Trailing white space if (XMLChar1_0::isWhitespace(content[0]) || XMLChar1_0::isWhitespace(content[strLen - 1]) ) { isValid = false; } else { while (*rawPtr) { if (!XMLChar1_0::isXMLChar(*rawPtr)) { isValid = false; break; } else if (*rawPtr == chCR || *rawPtr == chLF || *rawPtr == chHTab) { isValid = false; break; } else if (XMLChar1_0::isWhitespace(*rawPtr)) { if (inWS) { isValid = false; break; } else { inWS = true; } } else { inWS = false; } rawPtr++; } } } else { // Check leading/Trailing white space if (XMLChar1_1::isWhitespace(content[0]) || XMLChar1_1::isWhitespace(content[strLen - 1]) ) { isValid = false; } else { while (*rawPtr) { if (!XMLChar1_1::isXMLChar(*rawPtr)) { isValid = false; break; } else if (*rawPtr == chCR || *rawPtr == chLF || *rawPtr == chHTab) { isValid = false; break; } else if (XMLChar1_1::isWhitespace(*rawPtr)) { if (inWS) { isValid = false; break; } else { inWS = true; } } else { inWS = false; } rawPtr++; } } } if (isValid == true && datatype == XSValue::dt_language) { if (!sXSValueRegEx) { status = st_CantCreateRegEx; isValid = false; } else { if (sXSValueRegEx->matches(content, manager) == false) { isValid = false; } } } break; } case XSValue::dt_NMTOKEN: isValid = (version == ver_10) ? XMLChar1_0::isValidNmtoken(content, XMLString::stringLen(content)) : XMLChar1_1::isValidNmtoken(content, XMLString::stringLen(content)); break; case XSValue::dt_NMTOKENS: // [8] Nmtokens ::= Nmtoken (#x20 Nmtoken)* { XMLStringTokenizer tokenizer(content, Separator_20, manager); if (version == ver_10) { while (tokenizer.hasMoreTokens()) { const XMLCh* token = tokenizer.nextToken(); if (!XMLChar1_0::isValidNmtoken(token, XMLString::stringLen(token))) { isValid = false; break; } } } else { while (tokenizer.hasMoreTokens()) { const XMLCh* token = tokenizer.nextToken(); if (!XMLChar1_1::isValidNmtoken(token, XMLString::stringLen(token))) { isValid = false; break; } } } break; } case XSValue::dt_Name: isValid = (version == ver_10) ? XMLChar1_0::isValidName(content) : XMLChar1_1::isValidName(content); break; case XSValue::dt_NCName: case XSValue::dt_ID: case XSValue::dt_IDREF: case XSValue::dt_ENTITY: isValid = (version == ver_10) ? XMLChar1_0::isValidNCName(content, XMLString::stringLen(content)) : XMLChar1_1::isValidNCName(content, XMLString::stringLen(content)); break; case XSValue::dt_ENTITIES: case XSValue::dt_IDREFS: { XMLStringTokenizer tokenizer(content, Separator_ws, manager); if (version == ver_10 ) { while (tokenizer.hasMoreTokens()) { const XMLCh* token = tokenizer.nextToken(); if (!XMLChar1_0::isValidNCName(token, XMLString::stringLen(token))) { isValid = false; break; } } } else { while (tokenizer.hasMoreTokens()) { const XMLCh* token = tokenizer.nextToken(); if (!XMLChar1_1::isValidNCName(token, XMLString::stringLen(token))) { isValid = false; break; } } } } break; default: status = st_NotSupported; isValid = false; break; } if (isValid == false && status == st_Init) { status = st_FOCA0002; } return isValid; } XMLCh* XSValue::getCanRepNumerics(const XMLCh* const content , DataType datatype , Status& status , bool toValidate , MemoryManager* const manager) { try { // getCanonicalRepresentation does lexical space validation only // (no range checking), therefore if validation is required, // we need to pass the content to the validate interface for complete checking if (toValidate && !validateNumerics(content, datatype, status, manager)) return 0; XMLCh* retVal = 0; if (datatype == XSValue::dt_decimal) { retVal = XMLBigDecimal::getCanonicalRepresentation(content, manager); if (!retVal) status = st_FOCA0002; return retVal; } else if (datatype == XSValue::dt_float || datatype == XSValue::dt_double ) { // In XML4C, no float or double is treated as out of range // it gets converted to INF, -INF or zero. // The getCanonical method should treat double & float the // same way as the rest of XML4C for consistentcy so need // to getActualValue and see if it was converted. XSValue* xsval = getActValNumerics(content, datatype, status, false, manager); if (!xsval) { status = st_FOCA0002; return retVal; } DoubleFloatType enumVal; if (datatype == XSValue::dt_float) { enumVal = xsval->fData.fValue.f_floatType.f_floatEnum; } else { enumVal = xsval->fData.fValue.f_doubleType.f_doubleEnum; } delete xsval; switch(enumVal) { case DoubleFloatType_NegINF: retVal = XMLString::replicate(XMLUni::fgNegINFString, manager); break; case DoubleFloatType_PosINF: retVal = XMLString::replicate(XMLUni::fgPosINFString, manager); break; case DoubleFloatType_NaN: retVal = XMLString::replicate(XMLUni::fgNaNString, manager); break; case DoubleFloatType_Zero: retVal = XMLString::replicate(XMLUni::fgPosZeroString, manager); break; default: //DoubleFloatType_Normal retVal = XMLAbstractDoubleFloat::getCanonicalRepresentation(content, manager); if (!retVal) status = st_FOCA0002; break; } return retVal; } else { retVal = XMLBigInteger::getCanonicalRepresentation(content, manager, datatype == XSValue::dt_nonPositiveInteger); if (!retVal) status = st_FOCA0002; return retVal; } } catch (const NumberFormatException&) { status = st_FOCA0002; } return 0; } XMLCh* XSValue::getCanRepDateTimes(const XMLCh* const input_content , DataType datatype , Status& status , bool toValidate , MemoryManager* const manager) { XMLCh* content = XMLString::replicate(input_content, manager); ArrayJanitor janTmpName(content, manager); XMLString::trim(content); try { XMLDateTime coreDate = XMLDateTime(content, manager); switch (datatype) { case XSValue::dt_dateTime: //we need this parsing coreDate.parseDateTime(); return coreDate.getDateTimeCanonicalRepresentation(manager); break; case XSValue::dt_time: // we need this parsing coreDate.parseTime(); return coreDate.getTimeCanonicalRepresentation(manager); break; case XSValue::dt_date: // we need this parsing coreDate.parseDate(); return coreDate.getDateCanonicalRepresentation(manager); break; case XSValue::dt_duration: case XSValue::dt_gYearMonth: case XSValue::dt_gYear: case XSValue::dt_gMonthDay: case XSValue::dt_gDay: case XSValue::dt_gMonth: { if (!(toValidate && !validateDateTimes(content, datatype, status, manager))) status = st_NoCanRep; return 0; } break; default: return 0; break; } } catch (SchemaDateTimeException &e) { status = checkTimeZoneError(datatype, e)? XSValue::st_FODT0003 : st_FOCA0002; } catch (const NumberFormatException&) { status = st_FOCA0002; } return 0; } XMLCh* XSValue::getCanRepStrings(const XMLCh* const content , DataType datatype , Status& status , XMLVersion version , bool toValidate , MemoryManager* const manager) { switch (datatype) { case XSValue::dt_boolean: { XMLCh* tmpStrValue = XMLString::replicate(content, manager); ArrayJanitor janTmpName(tmpStrValue, manager); XMLString::trim(tmpStrValue); //always validate before getting canRep if (XMLString::equals(tmpStrValue, XMLUni::fgBooleanValueSpace[0]) || XMLString::equals(tmpStrValue, XMLUni::fgBooleanValueSpace[2]) ) { return XMLString::replicate(XMLUni::fgBooleanValueSpace[0], manager); } else if (XMLString::equals(tmpStrValue, XMLUni::fgBooleanValueSpace[1]) || XMLString::equals(tmpStrValue, XMLUni::fgBooleanValueSpace[3]) ) { return XMLString::replicate(XMLUni::fgBooleanValueSpace[1], manager); } else { status = st_FOCA0002; return 0; } } break; case XSValue::dt_hexBinary: { //HexBin::getCanonicalRepresentation does validation automatically XMLCh* tmpStrValue = XMLString::replicate(content, manager); ArrayJanitor janTmpName(tmpStrValue, manager); XMLString::trim(tmpStrValue); XMLCh* canRep = HexBin::getCanonicalRepresentation(tmpStrValue, manager); if (!canRep) status = st_FOCA0002; return canRep; break; } case XSValue::dt_base64Binary: { //Base64::getCanonicalRepresentation does validation automatically XMLCh* canRep = Base64::getCanonicalRepresentation(content, manager); if (!canRep) status = st_FOCA0002; return canRep; break; } case XSValue::dt_anyURI: case XSValue::dt_QName: case XSValue::dt_NOTATION: case XSValue::dt_string: case XSValue::dt_normalizedString: case XSValue::dt_token: case XSValue::dt_language: case XSValue::dt_NMTOKEN: case XSValue::dt_NMTOKENS: case XSValue::dt_Name: case XSValue::dt_NCName: case XSValue::dt_ID: case XSValue::dt_IDREF: case XSValue::dt_ENTITY: case XSValue::dt_ENTITIES: case XSValue::dt_IDREFS: if (toValidate && !validateStrings(content, datatype, status, version, manager)) status = st_FOCA0002; else status = st_NoCanRep; return 0; break; default: return 0; break; } return 0; } XSValue* XSValue::getActValNumerics(const XMLCh* const content , DataType datatype , Status& status , bool toValidate , MemoryManager* const manager) { try { switch (datatype) { case XSValue::dt_decimal: { if (toValidate) { XMLBigDecimal::parseDecimal(content, manager); } //Prepare the double value XMLDouble data(content, manager); if (data.isDataConverted()) { status = st_FOCA0001; return 0; } XSValue* retVal = new (manager) XSValue(dt_decimal, manager); retVal->fData.fValue.f_decimal.f_dvalue = data.getValue(); return retVal; break; } case XSValue::dt_float: { //XMLFloat takes care of 0, -0, -INF, INF and NaN //XMLFloat::checkBoundary() handles error and outofbound issues XMLFloat data(content, manager); XSValue* retVal = new (manager) XSValue(dt_float, manager); if (data.isDataConverted()) { retVal->fData.fValue.f_floatType.f_float = 0.0; retVal->fData.fValue.f_floatType.f_floatEnum = DoubleFloatType_Zero; switch(data.getType()) { case XMLAbstractDoubleFloat::NegINF: retVal->fData.fValue.f_floatType.f_floatEnum = DoubleFloatType_NegINF; break; case XMLAbstractDoubleFloat::PosINF: retVal->fData.fValue.f_floatType.f_floatEnum = DoubleFloatType_PosINF; break; case XMLAbstractDoubleFloat::NaN: retVal->fData.fValue.f_floatType.f_floatEnum = DoubleFloatType_NaN; break; default: break; } } else { retVal->fData.fValue.f_floatType.f_floatEnum = DoubleFloatType_Normal; retVal->fData.fValue.f_floatType.f_float = (float) data.getValue(); } return retVal; break; } case XSValue::dt_double: { //XMLDouble takes care of 0, -0, -INF, INF and NaN //XMLDouble::checkBoundary() handles error and outofbound issues XMLDouble data(content, manager); XSValue* retVal = new (manager) XSValue(dt_double, manager); if (data.isDataConverted()) { retVal->fData.fValue.f_doubleType.f_double = 0.0; retVal->fData.fValue.f_doubleType.f_doubleEnum = DoubleFloatType_Zero; switch(data.getType()) { case XMLAbstractDoubleFloat::NegINF: retVal->fData.fValue.f_doubleType.f_doubleEnum = DoubleFloatType_NegINF; break; case XMLAbstractDoubleFloat::PosINF: retVal->fData.fValue.f_doubleType.f_doubleEnum = DoubleFloatType_PosINF; break; case XMLAbstractDoubleFloat::NaN: retVal->fData.fValue.f_doubleType.f_doubleEnum = DoubleFloatType_NaN; break; default: break; } } else { retVal->fData.fValue.f_doubleType.f_doubleEnum = DoubleFloatType_Normal; retVal->fData.fValue.f_doubleType.f_double = data.getValue(); } return retVal; break; } case XSValue::dt_integer: case XSValue::dt_negativeInteger: case XSValue::dt_nonPositiveInteger: case XSValue::dt_nonNegativeInteger: case XSValue::dt_positiveInteger: case XSValue::dt_long: case XSValue::dt_int: case XSValue::dt_short: case XSValue::dt_byte: case XSValue::dt_unsignedLong: case XSValue::dt_unsignedInt: case XSValue::dt_unsignedShort: case XSValue::dt_unsignedByte: { t_value actVal; if ( !getActualNumericValue( content , status , actVal , manager , datatype ) ) { //status has been set by getActualNumericValue return 0; } XSValue* retVal = new (manager) XSValue(datatype, manager); switch (datatype) { case XSValue::dt_integer: retVal->fData.fValue.f_long = actVal.f_long; break; case XSValue::dt_negativeInteger: retVal->fData.fValue.f_long = actVal.f_long; break; case XSValue::dt_nonPositiveInteger: retVal->fData.fValue.f_long = actVal.f_long; break; case XSValue::dt_nonNegativeInteger: retVal->fData.fValue.f_long = actVal.f_ulong; break; case XSValue::dt_positiveInteger: retVal->fData.fValue.f_long = actVal.f_ulong; break; case XSValue::dt_long: retVal->fData.fValue.f_long = actVal.f_long; break; case XSValue::dt_int: retVal->fData.fValue.f_int = (int) actVal.f_long; break; case XSValue::dt_short: retVal->fData.fValue.f_short = (short) actVal.f_long; break; case XSValue::dt_byte: retVal->fData.fValue.f_char = (char) actVal.f_long; break; case XSValue::dt_unsignedLong: retVal->fData.fValue.f_ulong = actVal.f_ulong; break; case XSValue::dt_unsignedInt: retVal->fData.fValue.f_uint = (unsigned int) actVal.f_ulong; break; case XSValue::dt_unsignedShort: retVal->fData.fValue.f_ushort = (unsigned short) actVal.f_ulong; break; case XSValue::dt_unsignedByte: retVal->fData.fValue.f_uchar = (unsigned char) actVal.f_ulong; break; default: return 0; break; } return retVal; break; } default: return 0; break; } // end switch } catch (const NumberFormatException&) { status = st_FOCA0002; } return 0; } XSValue* XSValue::getActValDateTimes(const XMLCh* const input_content , DataType datatype , Status& status , MemoryManager* const manager) { XMLCh* content = XMLString::replicate(input_content, manager); ArrayJanitor janTmpName(content, manager); XMLString::trim(content); try { //Need not check if validation is requested since //parsing functions below does the validation automatically XMLDateTime coreDate = XMLDateTime(content, manager); switch (datatype) { case XSValue::dt_duration: coreDate.parseDuration(); break; case XSValue::dt_dateTime: coreDate.parseDateTime(); break; case XSValue::dt_time: coreDate.parseTime(); coreDate.fValue[XMLDateTime::CentYear] = 0; coreDate.fValue[XMLDateTime::Month] = 0; coreDate.fValue[XMLDateTime::Day] = 0; break; case XSValue::dt_date: coreDate.parseDate(); coreDate.fValue[XMLDateTime::Hour] = 0; coreDate.fValue[XMLDateTime::Minute] = 0; break; case XSValue::dt_gYearMonth: coreDate.parseYearMonth(); coreDate.fValue[XMLDateTime::Day] = 0; coreDate.fValue[XMLDateTime::Hour] = 0; coreDate.fValue[XMLDateTime::Minute] = 0; break; case XSValue::dt_gYear: coreDate.parseYear(); coreDate.fValue[XMLDateTime::Month] = 0; coreDate.fValue[XMLDateTime::Day] = 0; coreDate.fValue[XMLDateTime::Hour] = 0; coreDate.fValue[XMLDateTime::Minute] = 0; break; case XSValue::dt_gMonthDay: coreDate.parseMonthDay(); coreDate.fValue[XMLDateTime::CentYear] = 0; coreDate.fValue[XMLDateTime::Hour] = 0; coreDate.fValue[XMLDateTime::Minute] = 0; break; case XSValue::dt_gDay: coreDate.parseDay(); coreDate.fValue[XMLDateTime::CentYear] = 0; coreDate.fValue[XMLDateTime::Month] = 0; coreDate.fValue[XMLDateTime::Hour] = 0; coreDate.fValue[XMLDateTime::Minute] = 0; break; case XSValue::dt_gMonth: coreDate.parseMonth(); coreDate.fValue[XMLDateTime::CentYear] = 0; coreDate.fValue[XMLDateTime::Day] = 0; coreDate.fValue[XMLDateTime::Hour] = 0; coreDate.fValue[XMLDateTime::Minute] = 0; break; default: return 0; break; } XSValue* retVal = new (manager) XSValue(datatype, manager); retVal->fData.fValue.f_datetime.f_year = coreDate.fValue[XMLDateTime::CentYear]; retVal->fData.fValue.f_datetime.f_month = coreDate.fValue[XMLDateTime::Month]; retVal->fData.fValue.f_datetime.f_day = coreDate.fValue[XMLDateTime::Day]; retVal->fData.fValue.f_datetime.f_hour = coreDate.fValue[XMLDateTime::Hour]; retVal->fData.fValue.f_datetime.f_min = coreDate.fValue[XMLDateTime::Minute]; retVal->fData.fValue.f_datetime.f_second = coreDate.fValue[XMLDateTime::Second]; retVal->fData.fValue.f_datetime.f_milisec = coreDate.fMilliSecond; return retVal; } catch (SchemaDateTimeException const &e) { status = checkTimeZoneError(datatype, e)? XSValue::st_FODT0003 : st_FOCA0002; } catch (const NumberFormatException&) { status = st_FOCA0002; } return 0; } XSValue* XSValue::getActValStrings(const XMLCh* const content , DataType datatype , Status& status , XMLVersion version , bool toValidate , MemoryManager* const manager) { switch (datatype) { case XSValue::dt_boolean: { XMLCh* tmpStrValue = XMLString::replicate(content, manager); ArrayJanitor janTmpName(tmpStrValue, manager); XMLString::trim(tmpStrValue); //do validation here more efficiently if (XMLString::equals(tmpStrValue, XMLUni::fgBooleanValueSpace[0]) || XMLString::equals(tmpStrValue, XMLUni::fgBooleanValueSpace[2]) ) { XSValue* retVal = new (manager) XSValue(dt_boolean, manager); retVal->fData.fValue.f_bool = false; return retVal; } else if (XMLString::equals(tmpStrValue, XMLUni::fgBooleanValueSpace[1]) || XMLString::equals(tmpStrValue, XMLUni::fgBooleanValueSpace[3]) ) { XSValue* retVal = new (manager) XSValue(dt_boolean, manager); retVal->fData.fValue.f_bool = true; return retVal; } else { status = st_FOCA0002; return 0; } } break; case XSValue::dt_hexBinary: { XMLCh* tmpStrValue = XMLString::replicate(content, manager); ArrayJanitor janTmpName(tmpStrValue, manager); XMLString::trim(tmpStrValue); XMLByte* decodedData = HexBin::decodeToXMLByte(tmpStrValue, manager); if (!decodedData) { status = st_FOCA0002; return 0; } XSValue* retVal = new (manager) XSValue(dt_hexBinary, manager); retVal->fData.fValue.f_byteVal = decodedData; retVal->fMemAllocated = true; return retVal; break; } case XSValue::dt_base64Binary: { XMLSize_t len = 0; XMLByte* decodedData = Base64::decodeToXMLByte(content, &len, manager); if (!decodedData) { status = st_FOCA0002; return 0; } XSValue* retVal = new (manager) XSValue(dt_base64Binary, manager); retVal->fData.fValue.f_byteVal = decodedData; retVal->fMemAllocated = true; return retVal; break; } case XSValue::dt_anyURI: case XSValue::dt_QName: case XSValue::dt_NOTATION: case XSValue::dt_string: case XSValue::dt_normalizedString: case XSValue::dt_token: case XSValue::dt_language: case XSValue::dt_NMTOKEN: case XSValue::dt_NMTOKENS: case XSValue::dt_Name: case XSValue::dt_NCName: case XSValue::dt_ID: case XSValue::dt_IDREF: case XSValue::dt_ENTITY: case XSValue::dt_ENTITIES: case XSValue::dt_IDREFS: if (toValidate && !validateStrings(content, datatype, status, version, manager)) status = st_FOCA0002; else status = st_NoActVal; return 0; break; default: return 0; break; } return 0; } // --------------------------------------------------------------------------- // Utilities // --------------------------------------------------------------------------- bool XSValue::getActualNumericValue(const XMLCh* const content , Status& status , t_value& retVal , MemoryManager* const manager , DataType datatype) { char *nptr = XMLString::transcode(content, manager); ArrayJanitor jan(nptr, manager); char *endptr = 0; errno = 0; if (XSValue::numericSign[datatype]) { retVal.f_long = strtol(nptr, &endptr, (int)10); } else { if (XMLString::indexOf(content, chDash) != -1) { status = st_FOCA0002; //invalid lexcial value return false; } retVal.f_ulong = strtoul(nptr, &endptr, (int)10); } // need to check out-of-bounds before checking erange... switch (datatype) { case XSValue::dt_nonPositiveInteger: if (retVal.f_long > 0) { status = st_FOCA0002; return false; } break; case XSValue::dt_negativeInteger: if (retVal.f_long >= 0) { status = st_FOCA0002; return false; } break; case XSValue::dt_int: // strtol will set value to LONG_MIN/LONG_MAX if ERANGE error if ((retVal.f_long < INT_MIN) || (retVal.f_long > INT_MAX) || (errno == ERANGE)) { status = st_FOCA0002; return false; } break; case XSValue::dt_short: if ((retVal.f_long < SHRT_MIN) || (retVal.f_long > SHRT_MAX)) { status = st_FOCA0002; return false; } break; case XSValue::dt_byte: if ((retVal.f_long < SCHAR_MIN) || (retVal.f_long > SCHAR_MAX)) { status = st_FOCA0002; return false; } break; case XSValue::dt_unsignedInt: // strtoul will set value to LONG_INT if ERANGE error if ((retVal.f_ulong > UINT_MAX) || (errno == ERANGE)) { status = st_FOCA0002; return false; } break; case XSValue::dt_unsignedShort: if (retVal.f_ulong > USHRT_MAX) { status = st_FOCA0002; return false; } break; case XSValue::dt_unsignedByte: if (retVal.f_ulong > UCHAR_MAX) { status = st_FOCA0002; return false; } break; case XSValue::dt_positiveInteger: if (retVal.f_ulong == 0) { status = st_FOCA0002; return false; } break; default: break; } // end switch // check if overflow/underflow occurs if (errno == ERANGE) { status = st_FOCA0003; return false; } // check if all chars are valid char. If they are, endptr will // pointer to the null terminator, or all of the remaining // characters will be whitespace characters. while (*endptr != '\0') { const char ch = *endptr; if (ch == '\t' || ch == '\n' || ch == '\r' || ch == ' ') { ++endptr; } else { status = st_FOCA0002; return false; } } return true; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSComplexTypeDefinition.hpp000644 000765 000024 00000020512 13241160334 026507 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSComplexTypeDefinition.hpp 1801237 2017-07-07 21:55:11Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSCOMPLEXTYPEDEFINITION_HPP) #define XERCESC_INCLUDE_GUARD_XSCOMPLEXTYPEDEFINITION_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * This class represents a complexType definition * schema component. * This is *always* owned by the validator /parser object from which * it is obtained. * */ // forward declarations class XSAnnotation; class XSAttributeUse; class XSSimpleTypeDefinition; class XSParticle; class XSWildcard; class ComplexTypeInfo; class XMLPARSER_EXPORT XSComplexTypeDefinition : public XSTypeDefinition { public: // Content Model Types enum CONTENT_TYPE { /** * Represents an empty content type. A content type with the distinguished * value empty validates elements with no character or element * information item children. */ CONTENTTYPE_EMPTY = 0, /** * Represents a simple content type. A content type which is a simple * validates elements with character-only children. */ CONTENTTYPE_SIMPLE = 1, /** * Represents an element-only content type. An element-only content type * validates elements with children that conform to the supplied content * model. */ CONTENTTYPE_ELEMENT = 2, /** * Represents a mixed content type. */ CONTENTTYPE_MIXED = 3 }; // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param complexTypeInfo * @param xsWildcard * @param xsSimpleType * @param xsAttList * @param xsBaseType * @param xsParticle * @param headAnnot * @param xsModel * @param manager The configurable memory manager */ XSComplexTypeDefinition ( ComplexTypeInfo* const complexTypeInfo , XSWildcard* const xsWildcard , XSSimpleTypeDefinition* const xsSimpleType , XSAttributeUseList* const xsAttList , XSTypeDefinition* const xsBaseType , XSParticle* const xsParticle , XSAnnotation* const headAnnot , XSModel* const xsModel , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@}; /** @name Destructor */ //@{ ~XSComplexTypeDefinition(); //@} //--------------------- /** @name XSComplexTypeDefinition methods */ //@{ /** * [derivation method]: either DERIVATION_EXTENSION, * DERIVATION_RESTRICTION, or DERIVATION_NONE * (see XSObject). */ XSConstants::DERIVATION_TYPE getDerivationMethod() const; /** * [abstract]: a boolean. Complex types for which abstract is * true must not be used as the type definition for the validation of * element information items. */ bool getAbstract() const; /** * A set of attribute uses. */ XSAttributeUseList *getAttributeUses(); /** * Optional.An attribute wildcard. */ XSWildcard *getAttributeWildcard() const; /** * [content type]: one of empty (CONTENTTYPE_EMPTY), a simple * type definition (CONTENTTYPE_SIMPLE), mixed ( * CONTENTTYPE_MIXED), or element-only ( * CONTENTTYPE_ELEMENT). */ CONTENT_TYPE getContentType() const; /** * A simple type definition corresponding to simple content model, * otherwise null */ XSSimpleTypeDefinition *getSimpleType() const; /** * A particle for mixed or element-only content model, otherwise * null */ XSParticle *getParticle() const; /** * [prohibited substitutions]: a subset of {extension, restriction} * @param toTest Extension or restriction constants (see * XSObject). * @return True if toTest is a prohibited substitution, otherwise * false. */ bool isProhibitedSubstitution(XSConstants::DERIVATION_TYPE toTest); /** * [prohibited substitutions]: A subset of {extension, restriction} or * DERIVATION_NONE represented as a bit flag (see * XSObject). */ short getProhibitedSubstitutions() const; /** * A set of [annotations]. */ XSAnnotationList *getAnnotations(); /** * The name of type NCName of this declaration as defined in * XML Namespaces. */ const XMLCh* getName() const; /** * The [target namespace] of this object, or null if it is * unspecified. */ const XMLCh* getNamespace() const; /** * A namespace schema information item corresponding to the target * namespace of the component, if it's globally declared; or null * otherwise. */ XSNamespaceItem *getNamespaceItem(); /** * A boolean that specifies if the type definition is * anonymous. Convenience attribute. */ bool getAnonymous() const; /** * {base type definition}: either a simple type definition or a complex * type definition. */ XSTypeDefinition *getBaseType(); /** * Convenience method: check if this type is derived from the given * ancestorType. * @param ancestorType An ancestor type definition. * @return Return true if this type is derived from * ancestorType. */ bool derivedFromType(const XSTypeDefinition* const ancestorType); //@} //---------------------------------- /** methods needed by implementation */ //@{ //@} private: /** * Set the base type */ void setBaseType(XSTypeDefinition* const xsBaseType); friend class XSObjectFactory; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSComplexTypeDefinition(const XSComplexTypeDefinition&); XSComplexTypeDefinition & operator=(const XSComplexTypeDefinition &); protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- ComplexTypeInfo* fComplexTypeInfo; XSWildcard* fXSWildcard; XSAttributeUseList* fXSAttributeUseList; XSSimpleTypeDefinition* fXSSimpleTypeDefinition; XSAnnotationList* fXSAnnotationList; XSParticle* fParticle; short fProhibitedSubstitution; }; inline XSAttributeUseList* XSComplexTypeDefinition::getAttributeUses() { return fXSAttributeUseList; } inline XSWildcard* XSComplexTypeDefinition::getAttributeWildcard() const { return fXSWildcard; } inline XSSimpleTypeDefinition* XSComplexTypeDefinition::getSimpleType() const { return fXSSimpleTypeDefinition; } inline short XSComplexTypeDefinition::getProhibitedSubstitutions() const { return fProhibitedSubstitution; } inline XSParticle *XSComplexTypeDefinition::getParticle() const { return fParticle; } inline void XSComplexTypeDefinition::setBaseType(XSTypeDefinition* const xsBaseType) { fBaseType = xsBaseType; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSFacet.hpp000644 000765 000024 00000007540 13241160334 023255 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSFacet.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSFACET_HPP) #define XERCESC_INCLUDE_GUARD_XSFACET_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * This represents all Schema Facet components with the exception * of Enumeration and Pattern Facets, which are represented by the * XSMultiValueFacet interface. * This is *always* owned by the validator /parser object from which * it is obtained. */ // forward declarations class XSAnnotation; class XMLPARSER_EXPORT XSFacet : public XSObject { public: // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param facetKind * @param lexicalValue * @param isFixed * @param annot * @param xsModel * @param manager The configurable memory manager */ XSFacet ( XSSimpleTypeDefinition::FACET facetKind , const XMLCh* const lexicalValue , bool isFixed , XSAnnotation* const annot , XSModel* const xsModel , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@}; /** @name Destructor */ //@{ ~XSFacet(); //@} //--------------------- /** @name XSFacet methods */ //@{ /** * @return An indication as to the facet's type; see XSSimpleTypeDefinition::FACET */ XSSimpleTypeDefinition::FACET getFacetKind() const; /** * @return Returns a value of a constraining facet. */ const XMLCh *getLexicalFacetValue() const; /** * Check whether a facet value is fixed. */ bool isFixed() const; /** * @return an annotation */ XSAnnotation *getAnnotation() const; //@} //---------------------------------- /** methods needed by implementation */ //@{ //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSFacet(const XSFacet&); XSFacet & operator=(const XSFacet &); protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- XSSimpleTypeDefinition::FACET fFacetKind; bool fIsFixed; const XMLCh* fLexicalValue; XSAnnotation* fAnnotation; }; inline XSSimpleTypeDefinition::FACET XSFacet::getFacetKind() const { return fFacetKind; } inline const XMLCh* XSFacet::getLexicalFacetValue() const { return fLexicalValue; } inline bool XSFacet::isFixed() const { return fIsFixed; } inline XSAnnotation* XSFacet::getAnnotation() const { return fAnnotation; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSParticle.hpp000644 000765 000024 00000012531 13241160334 023772 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSParticle.hpp 883665 2009-11-24 11:41:38Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSPARTICLE_HPP) #define XERCESC_INCLUDE_GUARD_XSPARTICLE_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * This class describes all properties of a Schema Particle * component. * This is *always* owned by the validator /parser object from which * it is obtained. */ // forward declarations class XSElementDeclaration; class XSModelGroup; class XSWildcard; class XMLPARSER_EXPORT XSParticle : public XSObject { public: // possible terms of this particle enum TERM_TYPE { /* * an empty particle */ TERM_EMPTY = 0, /* * the particle has element content */ TERM_ELEMENT = XSConstants::ELEMENT_DECLARATION, /* * the particle's content is a model group */ TERM_MODELGROUP = XSConstants::MODEL_GROUP_DEFINITION, /* * the particle's content is a wildcard */ TERM_WILDCARD = XSConstants::WILDCARD }; // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param termType * @param xsModel * @param particleTerm * @param minOccurs * @param maxOccurs * @param unbounded * @param manager The configurable memory manager */ XSParticle ( TERM_TYPE termType , XSModel* const xsModel , XSObject* const particleTerm , XMLSize_t minOccurs , XMLSize_t maxOccurs , bool unbounded , MemoryManager* const manager ); //@}; /** @name Destructor */ //@{ ~XSParticle(); //@} //--------------------- /** @name XSParticle methods */ //@{ /** * [min occurs]: determines the minimum number of terms that can occur. */ XMLSize_t getMinOccurs() const; /** * [max occurs] determines the maximum number of terms that can occur. To * query for value of unbounded use maxOccursUnbounded. */ XMLSize_t getMaxOccurs() const; /** * [max occurs] whether the maxOccurs value is unbounded. */ bool getMaxOccursUnbounded() const; /** * Returns the type of the [term]: one of * TERM_EMPTY, TERM_ELEMENT, TERM_MODELGROUP, or TERM_WILDCARD. */ TERM_TYPE getTermType() const; /** * If this particle has an [element declaration] for its term, * this method returns that declaration; otherwise, it returns 0. * @returns The element declaration that is the [term] of this Particle * if and only if getTermType() == TERM_ELEMENT. */ XSElementDeclaration *getElementTerm(); /** * If this particle has a [model group] for its term, * this method returns that definition; otherwise, it returns 0. * @returns The model group that is the [term] of this Particle * if and only if getTermType() == TERM_MODELGROUP. */ XSModelGroup *getModelGroupTerm(); /** * If this particle has an [wildcard] for its term, * this method returns that declaration; otherwise, it returns 0. * @returns The wildcard declaration that is the [term] of this Particle * if and only if getTermType() == TERM_WILDCARD. */ XSWildcard *getWildcardTerm(); //@} //---------------------------------- /** methods needed by implementation */ //@{ //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSParticle(const XSParticle&); XSParticle & operator=(const XSParticle &); protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- TERM_TYPE fTermType; XMLSize_t fMinOccurs; XMLSize_t fMaxOccurs; bool fUnbounded; XSObject* fTerm; }; inline XMLSize_t XSParticle::getMinOccurs() const { return fMinOccurs; } inline XMLSize_t XSParticle::getMaxOccurs() const { return fMaxOccurs; } inline bool XSParticle::getMaxOccursUnbounded() const { return fUnbounded; } inline XSParticle::TERM_TYPE XSParticle::getTermType() const { return fTermType; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/PSVIItem.hpp000644 000765 000024 00000023551 13241160335 023361 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: PSVIItem.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_PSVIITEM_HPP) #define XERCESC_INCLUDE_GUARD_PSVIITEM_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Represent the PSVI contributions for one element or one attribute information item. * This is *always* owned by the validator /parser object from which * it is obtained. It is designed to be subclassed; subclasses will * specify under what conditions it may be relied upon to have meaningful contents. */ // forward declarations class XSTypeDefinition; class XSSimpleTypeDefinition; class XSValue; class XMLPARSER_EXPORT PSVIItem : public XMemory { public: enum VALIDITY_STATE { /** Validity value indicating that validation has either not been performed or that a strict assessment of validity could not be performed */ VALIDITY_NOTKNOWN = 0, /** Validity value indicating that validation has been strictly assessed and the element in question is invalid according to the rules of schema validation. */ VALIDITY_INVALID = 1, /** Validity value indicating that validation has been strictly assessed and the element in question is valid according to the rules of schema validation. */ VALIDITY_VALID = 2 }; enum ASSESSMENT_TYPE { /** Validation status indicating that schema validation has been performed and the element in question has specifically been skipped. */ VALIDATION_NONE = 0, /** Validation status indicating that schema validation has been performed on the element in question under the rules of lax validation. */ VALIDATION_PARTIAL = 1, /** Validation status indicating that full schema validation has been performed on the element. */ VALIDATION_FULL = 2 }; // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param manager The configurable memory manager */ PSVIItem(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); //@}; /** @name Destructor */ //@{ virtual ~PSVIItem(); //@} //--------------------- /** @name PSVIItem methods */ //@{ /** * [validation context] * * @return A string identifying the nearest ancestor element * information item with a [schema information] property * (or this element item itself if it has such a property) * (form to be determined) * @see XML Schema Part 1: Structures [validation context] */ const XMLCh *getValidationContext(); /** * Determine the validity of the node with respect * to the validation being attempted * * @return return the [validity] property. Possible values are: * VALIDITY_UNKNOWN, VALIDITY_INVALID, VALIDITY_VALID */ VALIDITY_STATE getValidity() const; /** * Determines the extent to which the item has been validated * * @return return the [validation attempted] property. The possible values are * VALIDATION_NONE, VALIDATION_ORDERED_PARTIAL and VALIDATION_FULL */ ASSESSMENT_TYPE getValidationAttempted() const; /** * A list of error codes generated from validation attempts. * Need to find all the possible sub-clause reports that need reporting * * @return list of error codes */ /*** const XMLCh ** getErrorCodes(); ****/ /** * [schema normalized value] * * @see XML Schema Part 1: Structures [schema normalized value] * @return the normalized value of this item after validation */ const XMLCh *getSchemaNormalizedValue(); /** * An item isomorphic to the type definition used to validate this element. * * @return a type declaration */ virtual XSTypeDefinition *getTypeDefinition() = 0; /** * If and only if that type definition is a simple type definition * with {variety} union, or a complex type definition whose {content type} * is a simple thype definition with {variety} union, then an item isomorphic * to that member of the union's {member type definitions} which actually * validated the element item's normalized value. * * @return a simple type declaration */ virtual XSSimpleTypeDefinition *getMemberTypeDefinition() = 0; /** * [schema default] * * @return The canonical lexical representation of the declaration's {value constraint} value. * @see XML Schema Part 1: Structures [schema default] */ const XMLCh *getSchemaDefault(); /** * [schema specified] * @see XML Schema Part 1: Structures [schema specified] * @return true - value was specified in schema, false - value comes from the infoset */ bool getIsSchemaSpecified() const; /** * Return the canonical representation of this value. * Note that, formally, this is not a PSVI property. * @return string representing the canonical representation, if this item * was validated by a simple type definition for which canonical * representations of values are defined. */ const XMLCh *getCanonicalRepresentation() const; //@} /** * * Get actual value in the form of XSValue, * caller needs to delete the object returned. * * @return an XSValue */ virtual XSValue *getActualValue() const; //---------------------------------- /** methods needed by implementation */ //@{ void setValidationAttempted(PSVIItem::ASSESSMENT_TYPE attemptType); void setValidity(PSVIItem::VALIDITY_STATE validity); /** reset the object * @param validationContext corresponds to schema validation context property * @param normalizedValue corresponds to schema normalized value property * @param validityState state of item's validity * @param assessmentType type of assessment carried out on item */ void reset( const XMLCh* const validationContext , const XMLCh* const normalizedValue , const VALIDITY_STATE validityState , const ASSESSMENT_TYPE assessmentType ); //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- PSVIItem(const PSVIItem&); PSVIItem & operator=(const PSVIItem &); protected: // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- // fMemoryManager: // used for any memory allocations // fValidationContext // corresponds to the schema [validation context] property // fNormalizedValue // The schema normalized value (when present) // fDefaultValue // default value specified in the schema, if any // fCanonicalValue // canonicalized version of normalizedValue // fValidityState // Whether this item is valid or not // fAssessmentType // The kind of assessment that produced the given validity outcome // fIsSpecified // Whether this item exists because a default was specified in the schema // fType // type responsible for validating this item // fMemberType // If fType is a union type, the member type that validated this item MemoryManager* const fMemoryManager; const XMLCh* fValidationContext; const XMLCh* fNormalizedValue; const XMLCh* fDefaultValue; XMLCh* fCanonicalValue; VALIDITY_STATE fValidityState; ASSESSMENT_TYPE fAssessmentType; bool fIsSpecified; XSTypeDefinition * fType; XSSimpleTypeDefinition* fMemberType; }; inline PSVIItem::~PSVIItem() {} inline const XMLCh *PSVIItem::getValidationContext() { return fValidationContext; } inline const XMLCh* PSVIItem::getSchemaNormalizedValue() { return fNormalizedValue; } inline const XMLCh* PSVIItem::getSchemaDefault() { return fDefaultValue; } inline const XMLCh* PSVIItem::getCanonicalRepresentation() const { return fCanonicalValue; } inline PSVIItem::VALIDITY_STATE PSVIItem::getValidity() const { return fValidityState; } inline bool PSVIItem::getIsSchemaSpecified() const { return fIsSpecified; } inline PSVIItem::ASSESSMENT_TYPE PSVIItem::getValidationAttempted() const { return fAssessmentType; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSObject.cpp000644 000765 000024 00000004037 13241160334 023432 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSObject.cpp 1804272 2017-08-06 20:25:24Z scantor $ */ #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSObject: Constructors and Destructor // --------------------------------------------------------------------------- XSObject::XSObject(XSConstants::COMPONENT_TYPE compType, XSModel* const xsModel, MemoryManager* const manager) : fComponentType(compType) , fXSModel(xsModel) , fMemoryManager(manager) , fId(0) { if (xsModel) { xsModel->addComponentToIdVector(this, compType-1); } } XSObject::~XSObject() { } // --------------------------------------------------------------------------- // XSObject: Virtual interface methods // --------------------------------------------------------------------------- const XMLCh *XSObject::getName() const { return 0; } const XMLCh *XSObject::getNamespace() const { return 0; } XSNamespaceItem *XSObject::getNamespaceItem() { return 0; } XMLSize_t XSObject::getId() const { return fId; } void XSObject::setId(XMLSize_t id) { fId = id; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSModel.cpp000644 000765 000024 00000070267 13241160334 023274 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSModel.cpp 674012 2008-07-04 11:18:21Z borisk $ */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSModel: Constructors and Destructor // --------------------------------------------------------------------------- XSModel::XSModel( XMLGrammarPool *grammarPool , MemoryManager* const manager) : fMemoryManager(manager) , fNamespaceStringList(0) , fXSNamespaceItemList(0) , fURIStringPool(0) , fXSAnnotationList(0) , fHashNamespace(0) , fObjFactory(0) , fDeleteNamespace(0) , fParent(0) , fDeleteParent(false) , fAddedS4SGrammar(false) { fURIStringPool = grammarPool->getURIStringPool(); fObjFactory = new (fMemoryManager) XSObjectFactory(manager); // Populate XSNamedMaps by going through the components for (XMLSize_t i=0; i ( 20, // size 29, // modulus fURIStringPool, false, // adoptElems fMemoryManager ); break; default: // ATTRIBUTE_USE // MODEL_GROUP // PARTICLE // IDENTITY_CONSTRAINT // WILDCARD // ANNOTATION // FACET // MULTIVALUE fComponentMap[i] = 0; break; } fIdVector[i] = new (fMemoryManager) RefVectorOf(30, false, fMemoryManager); } fNamespaceStringList = new (manager) RefArrayVectorOf (10, true, manager); fXSNamespaceItemList = new (manager) RefVectorOf (10, true, manager); fXSAnnotationList = new (manager) RefVectorOf (10, false, manager); fHashNamespace = new (manager) RefHashTableOf (11, false, manager); // Loop through all grammars in the grammar pool to create the XSNamespaceItem's // which will have access to Annotation Information which can be used later when // we create all the XS components. XSNamespaceItem* namespaceItem = 0; RefHashTableOfEnumerator grammarEnum = grammarPool->getGrammarEnumerator(); while (grammarEnum.hasMoreElements()) { SchemaGrammar& sGrammar = (SchemaGrammar&) grammarEnum.nextElement(); if (sGrammar.getGrammarType() != Grammar::SchemaGrammarType || XMLString::equals(sGrammar.getTargetNamespace(), SchemaSymbols::fgURI_SCHEMAFORSCHEMA)) continue; // NOTE: In the grammarpool, preprocessed grammars without targetnamespace // will use an empty string... XMLCh* NameSpace = XMLString::replicate(sGrammar.getTargetNamespace(), manager); fNamespaceStringList->addElement(NameSpace); namespaceItem = new (manager) XSNamespaceItem(this, &sGrammar, manager); fXSNamespaceItemList->addElement(namespaceItem); fHashNamespace->put(NameSpace, namespaceItem); } // Now loop through all of the NamespaceItem's // First, we add S4S namespace (irrespective of whether we have any grammars) namespaceItem = new (manager) XSNamespaceItem ( this, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, manager ); fNamespaceStringList->addElement ( XMLString::replicate(SchemaSymbols::fgURI_SCHEMAFORSCHEMA,manager) ); fXSNamespaceItemList->addElement(namespaceItem); fHashNamespace->put ( (void*) SchemaSymbols::fgURI_SCHEMAFORSCHEMA , namespaceItem ); DatatypeValidatorFactory dvFactory(manager); addS4SToXSModel ( namespaceItem , dvFactory.getBuiltInRegistry() ); // don't include S4S (thus the -1) XMLSize_t numberOfNamespaces = fXSNamespaceItemList->size() -1; for (XMLSize_t j = 0; j < numberOfNamespaces; j++) addGrammarToXSModel(fXSNamespaceItemList->elementAt(j)); } XSModel::XSModel( XSModel *baseModel , GrammarResolver *grammarResolver , MemoryManager* const manager) : fMemoryManager(manager) , fNamespaceStringList(0) , fXSNamespaceItemList(0) , fURIStringPool(0) , fXSAnnotationList(0) , fHashNamespace(0) , fObjFactory(0) , fDeleteNamespace(0) , fParent(baseModel) , fDeleteParent(true) , fAddedS4SGrammar(false) { fURIStringPool = grammarResolver->getStringPool(); fObjFactory = new (manager) XSObjectFactory(manager); XMLSize_t i; // Populate XSNamedMaps by going through the components for (i=0; i ( 20, // size 29, // modulus fURIStringPool, false, // adoptElems fMemoryManager ); break; default: // ATTRIBUTE_USE // MODEL_GROUP // PARTICLE // IDENTITY_CONSTRAINT // WILDCARD // ANNOTATION // FACET // MULTIVALUE fComponentMap[i] = 0; break; } fIdVector[i] = new (fMemoryManager) RefVectorOf(30, false, fMemoryManager); } fNamespaceStringList = new (manager) RefArrayVectorOf (10, true, manager); fXSNamespaceItemList = new (manager) RefVectorOf (10, false, manager); fDeleteNamespace = new (manager) RefVectorOf (10, true, manager); fXSAnnotationList = new (manager) RefVectorOf (10, false, manager); fHashNamespace = new (manager) RefHashTableOf (11, false, manager); if (fParent) { if (fParent->fAddedS4SGrammar) fAddedS4SGrammar = true; // Need to copy information from parent so it can be returned in this object... for (i=0; ifXSNamespaceItemList->size(); i++) { XSNamespaceItem* namespaceItem = fParent->fXSNamespaceItemList->elementAt(i); fXSNamespaceItemList->addElement(namespaceItem); fNamespaceStringList->addElement ( XMLString::replicate ( namespaceItem->getSchemaNamespace(), manager ) ); } for (i=0; ifComponentMap[i]->getLength(); j++) { XSObject* copyObj = fParent->fComponentMap[i]->item(j); fComponentMap[i]->addElement(copyObj, copyObj->getName(), copyObj->getNamespace()); } break; } for (XMLSize_t j=0; jfIdVector[i]->size(); j++) { fIdVector[i]->addElement(fParent->fIdVector[i]->elementAt(j)); } } for (i=0; ifXSAnnotationList->size(); i++) { fXSAnnotationList->addElement(fParent->fXSAnnotationList->elementAt(i)); } } // end of copying parent info // Now add information from the new grammars but first create the // XSNamespaceItem's so we can have access to the XSAnnotations... ValueVectorOf* grammarsToAdd = grammarResolver->getGrammarsToAddToXSModel(); XMLSize_t numberOfNamespaces = fXSNamespaceItemList->size(); XMLSize_t numberOfNamespacesToAdd = 0; for (i=0; i < grammarsToAdd->size(); i++) { SchemaGrammar* lGrammar = grammarsToAdd->elementAt(i); if (lGrammar->getGrammarType() != Grammar::SchemaGrammarType || XMLString::equals(lGrammar->getTargetNamespace(), SchemaSymbols::fgURI_SCHEMAFORSCHEMA)) continue; XMLCh* NameSpace = XMLString::replicate(lGrammar->getTargetNamespace(), manager); fNamespaceStringList->addElement(NameSpace); XSNamespaceItem* namespaceItem = new (manager) XSNamespaceItem(this, lGrammar, manager); fXSNamespaceItemList->addElement(namespaceItem); fHashNamespace->put(NameSpace, namespaceItem); fDeleteNamespace->addElement(namespaceItem); ++numberOfNamespacesToAdd; } // Add S4S namespace if needed if (!fAddedS4SGrammar) { DatatypeValidatorFactory dvFactory(manager); XSNamespaceItem* namespaceItem = new (manager) XSNamespaceItem ( this, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, manager ); fNamespaceStringList->addElement ( XMLString::replicate(SchemaSymbols::fgURI_SCHEMAFORSCHEMA,manager) ); fXSNamespaceItemList->addElement(namespaceItem); fHashNamespace->put ( (void*) SchemaSymbols::fgURI_SCHEMAFORSCHEMA , namespaceItem ); fDeleteNamespace->addElement(namespaceItem); addS4SToXSModel ( namespaceItem , dvFactory.getBuiltInRegistry() ); } // Now loop through all of the newly created NamespaceItem's for (i=numberOfNamespaces; i<(numberOfNamespaces+numberOfNamespacesToAdd); i++) { addGrammarToXSModel(fXSNamespaceItemList->elementAt(i)); } // end of namespaceItem loop } XSModel::~XSModel() { for (XMLSize_t i=0; ifDeleteParent) delete fParent; } // --------------------------------------------------------------------------- // XSModel: Helper methods // --------------------------------------------------------------------------- void XSModel::addComponentToIdVector(XSObject* const component, XMLSize_t componentIndex) { component->setId(fIdVector[componentIndex]->size()); fIdVector[componentIndex]->addElement(component); } void XSModel::addComponentToNamespace(XSNamespaceItem* const namespaceItem, XSObject* const component, XMLSize_t componentIndex, bool addToXSModel) { namespaceItem->fComponentMap[componentIndex]->addElement ( component, component->getName(), namespaceItem->getSchemaNamespace() ); namespaceItem->fHashMap[componentIndex]->put ( (void *) component->getName(), component ); if (addToXSModel) { fComponentMap[componentIndex]->addElement ( component, component->getName(), namespaceItem->getSchemaNamespace() ); } } void XSModel::addS4SToXSModel(XSNamespaceItem* const namespaceItem, RefHashTableOf* const builtInDV) { addComponentToNamespace ( namespaceItem , fObjFactory->addOrFind ( ComplexTypeInfo::getAnyType ( fURIStringPool->getId(XMLUni::fgZeroLenString) ) , this ) , XSConstants::TYPE_DEFINITION - 1 ); // Loop through built-in simple types // First add 'anySimpleType' which is the base for the other built-ins DatatypeValidator* dv = builtInDV->get(SchemaSymbols::fgDT_ANYSIMPLETYPE); addComponentToNamespace ( namespaceItem , fObjFactory->addOrFind(dv, this, true) , XSConstants::TYPE_DEFINITION - 1 ); // add remaining built-in RefHashTableOfEnumerator simpleEnum = RefHashTableOfEnumerator (builtInDV, false, fMemoryManager); while (simpleEnum.hasMoreElements()) { DatatypeValidator& curSimple = simpleEnum.nextElement(); if (&curSimple == dv) continue; addComponentToNamespace ( namespaceItem , fObjFactory->addOrFind(&curSimple, this) , XSConstants::TYPE_DEFINITION - 1 ); } // Set flag to indicate that we have added S4S grammar info fAddedS4SGrammar = true; } void XSModel::addGrammarToXSModel(XSNamespaceItem* namespaceItem) { // Loop through top-level attribute declarations in the grammar... RefHashTableOf* attDeclRegistry = namespaceItem->fGrammar->getAttributeDeclRegistry(); if(attDeclRegistry) { RefHashTableOfEnumerator attrEnum = RefHashTableOfEnumerator (attDeclRegistry, false, fMemoryManager); while (attrEnum.hasMoreElements()) { XSAttributeDeclaration* xsAttrDecl = fObjFactory->addOrFind ( (SchemaAttDef*) &(attrEnum.nextElement()), this ); addComponentToNamespace ( namespaceItem, xsAttrDecl, XSConstants::ATTRIBUTE_DECLARATION - 1 ); } // end of attribute loop } // Loop through top-level elements in the grammar... RefHash3KeysIdPoolEnumerator elemEnum = namespaceItem->fGrammar->getElemEnumerator(); while (elemEnum.hasMoreElements()) { SchemaElementDecl& curElem = elemEnum.nextElement(); if (curElem.getEnclosingScope() == Grammar::TOP_LEVEL_SCOPE) { XSElementDeclaration* xsElemDecl = fObjFactory->addOrFind ( &curElem, this ); addComponentToNamespace ( namespaceItem, xsElemDecl, XSConstants::ELEMENT_DECLARATION -1 ); } } // end of element loop // Now loop through top-level User Defined simple type definitions in the grammar... DVHashTable* dvHT = namespaceItem->fGrammar->getDatatypeRegistry()->getUserDefinedRegistry(); if (dvHT) { RefHashTableOfEnumerator simpleUserEnum = RefHashTableOfEnumerator (dvHT, false, fMemoryManager); while (simpleUserEnum.hasMoreElements()) { DatatypeValidator& curSimple = simpleUserEnum.nextElement(); if (!curSimple.getAnonymous()) { addComponentToNamespace ( namespaceItem , fObjFactory->addOrFind(&curSimple, this) , XSConstants::TYPE_DEFINITION - 1 ); } } // end of simple User loop } // Loop through top-level COMPLEX type definitions in the grammar... RefHashTableOf* complexTypeRegistry = namespaceItem->fGrammar->getComplexTypeRegistry(); if(complexTypeRegistry) { RefHashTableOfEnumerator complexEnum = RefHashTableOfEnumerator (complexTypeRegistry, false, fMemoryManager); while (complexEnum.hasMoreElements()) { ComplexTypeInfo& curComplex = complexEnum.nextElement(); if (!curComplex.getAnonymous()) { addComponentToNamespace ( namespaceItem , fObjFactory->addOrFind(&curComplex, this) , XSConstants::TYPE_DEFINITION - 1 ); } } // end of type definition loop } // Loop through top-level attribute group definitions in the grammar... RefHashTableOf* attGroupInfoRegistry = namespaceItem->fGrammar->getAttGroupInfoRegistry(); if(attGroupInfoRegistry) { RefHashTableOfEnumerator attrGroupEnum = RefHashTableOfEnumerator (attGroupInfoRegistry, false, fMemoryManager); while (attrGroupEnum.hasMoreElements()) { addComponentToNamespace ( namespaceItem , fObjFactory->createXSAttGroupDefinition ( &(attrGroupEnum.nextElement()), this ) , XSConstants::ATTRIBUTE_GROUP_DEFINITION - 1 ); } // end of attribute group loop } // Loop through top-level model group definitions in the grammar... RefHashTableOf* groupInfoRegistry = namespaceItem->fGrammar->getGroupInfoRegistry(); if(groupInfoRegistry) { RefHashTableOfEnumerator modelGroupEnum = RefHashTableOfEnumerator (groupInfoRegistry, false, fMemoryManager); while (modelGroupEnum.hasMoreElements()) { addComponentToNamespace ( namespaceItem , fObjFactory->createXSModelGroupDefinition ( &(modelGroupEnum.nextElement()), this ) , XSConstants::MODEL_GROUP_DEFINITION - 1 ); } // end of model group loop } // Loop through notations in the grammar... NameIdPoolEnumerator notationEnum = namespaceItem->fGrammar->getNotationEnumerator(); while (notationEnum.hasMoreElements()) { addComponentToNamespace ( namespaceItem , fObjFactory->addOrFind(&(notationEnum.nextElement()), this) , XSConstants::NOTATION_DECLARATION - 1 ); } // end of notation loop // Loop through annotations in the grammar... // As annotations are already created as XSAnnotations no need to create them // or store them in the XercesToXSMap. XSAnnotation* annot = namespaceItem->fGrammar->getAnnotation(); while (annot) { fXSAnnotationList->addElement(annot); namespaceItem->fXSAnnotationList->addElement(annot); addComponentToIdVector(annot, XSConstants::ANNOTATION -1); annot = annot->getNext(); } // end of annotation loop } // --------------------------------------------------------------------------- // XSModel: Access methods // --------------------------------------------------------------------------- /** * [schema components]: a list of top-level components, i.e. element * declarations, attribute declarations, etc. * @param objectType The type of the declaration, i.e. * ELEMENT_DECLARATION, * TYPE_DEFINITION and any other component type that * may be a property of a schema component. * @return A list of top-level definition of the specified type in * objectType or null. */ XSNamedMap *XSModel::getComponents(XSConstants::COMPONENT_TYPE objectType) { return fComponentMap[objectType -1]; } /** * Convenience method. Returns a list of top-level component declarations * that are defined within the specified namespace, i.e. element * declarations, attribute declarations, etc. * @param objectType The type of the declaration, i.e. * ELEMENT_DECLARATION. * @param compNamespace The namespace to which declaration belong or * null (for components with no target namespace). * @return A list of top-level definitions of the specified type in * objectType and defined in the specified * namespace or null. */ XSNamedMap *XSModel::getComponentsByNamespace(XSConstants::COMPONENT_TYPE objectType, const XMLCh *compNamespace) { XSNamespaceItem* namespaceItem; if (compNamespace) namespaceItem = getNamespaceItem(compNamespace); else namespaceItem = getNamespaceItem(XMLUni::fgZeroLenString); if (namespaceItem) return namespaceItem->getComponents(objectType); return 0; } /** * [annotations]: a set of annotations. */ XSAnnotationList *XSModel::getAnnotations() { return fXSAnnotationList; } /** * Convenience method. Returns a top-level element declaration. * @param name The name of the declaration. * @param compNamespace The namespace of the declaration, null if absent. * @return A top-level element declaration or null if such * declaration does not exist. */ XSElementDeclaration *XSModel::getElementDeclaration(const XMLCh *name , const XMLCh *compNamespace) { XSNamespaceItem* namespaceItem; if (compNamespace) namespaceItem = getNamespaceItem(compNamespace); else namespaceItem = getNamespaceItem(XMLUni::fgZeroLenString); if (namespaceItem) return namespaceItem->getElementDeclaration(name); return 0; } /** * Convenience method. Returns a top-level attribute declaration. * @param name The name of the declaration. * @param compNamespace The namespace of the declaration, null if absent. * @return A top-level attribute declaration or null if such * declaration does not exist. */ XSAttributeDeclaration *XSModel::getAttributeDeclaration(const XMLCh *name , const XMLCh *compNamespace) { XSNamespaceItem* namespaceItem; if (compNamespace) namespaceItem = getNamespaceItem(compNamespace); else namespaceItem = getNamespaceItem(XMLUni::fgZeroLenString); if (namespaceItem) return namespaceItem->getAttributeDeclaration(name); return 0; } /** * Convenience method. Returns a top-level simple or complex type * definition. * @param name The name of the definition. * @param compNamespace The namespace of the declaration, null if absent. * @return An XSTypeDefinition or null if such * definition does not exist. */ XSTypeDefinition *XSModel::getTypeDefinition(const XMLCh *name , const XMLCh *compNamespace) { XSNamespaceItem* namespaceItem; if (compNamespace) namespaceItem = getNamespaceItem(compNamespace); else namespaceItem = getNamespaceItem(XMLUni::fgZeroLenString); if (namespaceItem) return namespaceItem->getTypeDefinition(name); return 0; } /** * Convenience method. Returns a top-level attribute group definition. * @param name The name of the definition. * @param compNamespace The namespace of the declaration, null if absent. * @return A top-level attribute group definition or null if * such definition does not exist. */ XSAttributeGroupDefinition *XSModel::getAttributeGroup(const XMLCh *name , const XMLCh *compNamespace) { XSNamespaceItem* namespaceItem; if (compNamespace) namespaceItem = getNamespaceItem(compNamespace); else namespaceItem = getNamespaceItem(XMLUni::fgZeroLenString); if (namespaceItem) return namespaceItem->getAttributeGroup(name); return 0; } /** * Convenience method. Returns a top-level model group definition. * @param name The name of the definition. * @param compNamespace The namespace of the declaration, null if absent. * @return A top-level model group definition definition or * null if such definition does not exist. */ XSModelGroupDefinition *XSModel::getModelGroupDefinition(const XMLCh *name , const XMLCh *compNamespace) { XSNamespaceItem* namespaceItem; if (compNamespace) namespaceItem = getNamespaceItem(compNamespace); else namespaceItem = getNamespaceItem(XMLUni::fgZeroLenString); if (namespaceItem) return namespaceItem->getModelGroupDefinition(name); return 0; } /** * Convenience method. Returns a top-level notation declaration. * @param name The name of the declaration. * @param compNamespace The namespace of the declaration, null if absent. * @return A top-level notation declaration or null if such * declaration does not exist. */ XSNotationDeclaration *XSModel::getNotationDeclaration(const XMLCh *name , const XMLCh *compNamespace) { XSNamespaceItem* namespaceItem; if (compNamespace) namespaceItem = getNamespaceItem(compNamespace); else namespaceItem = getNamespaceItem(XMLUni::fgZeroLenString); if (namespaceItem) return namespaceItem->getNotationDeclaration(name); return 0; } /** * Optional. Return a component given a component type and a unique Id. * May not be supported for all component types. * @param compId unique Id of the component within its type * @param compType type of the component * @return the component of the given type with the given Id, or 0 * if no such component exists or this is unsupported for * this type of component. */ XSObject *XSModel::getXSObjectById(XMLSize_t compId , XSConstants::COMPONENT_TYPE compType) { if (compId < fIdVector[compType -1]->size()) return fIdVector[compType -1]->elementAt(compId); return 0; } XSNamespaceItem* XSModel::getNamespaceItem(const XMLCh* const key) { XSNamespaceItem* xsName = fHashNamespace->get(key); if (xsName) return xsName; if (fParent) return fParent->getNamespaceItem(key); return 0; } XSObject* XSModel::getXSObject(void* key) { XSObject* xsObj = fObjFactory->getObjectFromMap(key); if (!xsObj && fParent) xsObj = fParent->getXSObject(key); return xsObj; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/XSConstants.hpp000644 000765 000024 00000013166 13241160335 024211 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSConstants.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XSCONSTANTS_HPP) #define XERCESC_INCLUDE_GUARD_XSCONSTANTS_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * This contains constants needed in the schema component model. */ // forward definitions for typedefs class XSAnnotation; class XSAttributeUse; class XSFacet; class XSMultiValueFacet; class XSNamespaceItem; class XSParticle; class XSSimpleTypeDefinition; // these typedefs are intended to help hide dependence on utility // classes, as well as to define more intuitive names for commonly // used concepts. typedef RefVectorOf XSAnnotationList; typedef RefVectorOf XSAttributeUseList; typedef RefVectorOf XSFacetList; typedef RefVectorOf XSMultiValueFacetList; typedef RefVectorOf XSNamespaceItemList; typedef RefVectorOf XSParticleList; typedef RefVectorOf XSSimpleTypeDefinitionList; typedef RefArrayVectorOf StringList; class XMLPARSER_EXPORT XSConstants { public: // XML Schema Components enum COMPONENT_TYPE { /** * The object describes an attribute declaration. */ ATTRIBUTE_DECLARATION = 1, /** * The object describes an element declaration. */ ELEMENT_DECLARATION = 2, /** * The object describes a complex type or simple type definition. */ TYPE_DEFINITION = 3, /** * The object describes an attribute use definition. */ ATTRIBUTE_USE = 4, /** * The object describes an attribute group definition. */ ATTRIBUTE_GROUP_DEFINITION= 5, /** * The object describes a model group definition. */ MODEL_GROUP_DEFINITION = 6, /** * A model group. */ MODEL_GROUP = 7, /** * The object describes a particle. */ PARTICLE = 8, /** * The object describes a wildcard. */ WILDCARD = 9, /** * The object describes an identity constraint definition. */ IDENTITY_CONSTRAINT = 10, /** * The object describes a notation declaration. */ NOTATION_DECLARATION = 11, /** * The object describes an annotation. */ ANNOTATION = 12, /** * The object describes a constraining facet. */ FACET = 13, /** * The object describes enumeration/pattern facets. */ MULTIVALUE_FACET = 14 }; // Derivation constants enum DERIVATION_TYPE { /** * No constraint is available. */ DERIVATION_NONE = 0, /** * XSTypeDefinition final set or * XSElementDeclaration disallowed substitution group. */ DERIVATION_EXTENSION = 1, /** * XSTypeDefinition final set or * XSElementDeclaration disallowed substitution group. */ DERIVATION_RESTRICTION = 2, /** * XSTypeDefinition final set. */ DERIVATION_SUBSTITUTION = 4, /** * XSTypeDefinition final set. */ DERIVATION_UNION = 8, /** * XSTypeDefinition final set. */ DERIVATION_LIST = 16 }; // Scope enum SCOPE { /** * The scope of a declaration within named model groups or attribute * groups is absent. The scope of such declaration is * determined when it is used in the construction of complex type * definitions. */ SCOPE_ABSENT = 0, /** * A scope of global identifies top-level declarations. */ SCOPE_GLOBAL = 1, /** * Locally scoped declarations are available for use only * within the complex type. */ SCOPE_LOCAL = 2 }; // Value Constraint enum VALUE_CONSTRAINT { /** * Indicates that the component does not have any value constraint. */ VALUE_CONSTRAINT_NONE = 0, /** * Indicates that there is a default value constraint. */ VALUE_CONSTRAINT_DEFAULT = 1, /** * Indicates that there is a fixed value constraint for this attribute. */ VALUE_CONSTRAINT_FIXED = 2 }; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XSConstants(); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSAnnotation.cpp000644 000765 000024 00000011250 13241160334 024331 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSAnnotation.cpp 679296 2008-07-24 08:13:42Z borisk $ */ #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN XSAnnotation::XSAnnotation(const XMLCh* const content, MemoryManager * const manager) :XSObject(XSConstants::ANNOTATION, 0, manager) ,fContents(XMLString::replicate(content, manager)) ,fNext(0) ,fSystemId(0) ,fLine(0) ,fCol(0) { } XSAnnotation::XSAnnotation(MemoryManager * const manager) :XSObject(XSConstants::ANNOTATION, 0, manager) ,fContents(0) ,fNext(0) ,fSystemId(0) ,fLine(0) ,fCol(0) { } XSAnnotation::~XSAnnotation() { fMemoryManager->deallocate(fContents); if (fNext) delete fNext; fMemoryManager->deallocate(fSystemId); } // XSAnnotation methods void XSAnnotation::writeAnnotation(DOMNode* node, ANNOTATION_TARGET targetType) { XercesDOMParser *parser = new (fMemoryManager) XercesDOMParser(0, fMemoryManager); parser->setDoNamespaces(true); parser->setValidationScheme(XercesDOMParser::Val_Never); DOMDocument* futureOwner = (targetType == W3C_DOM_ELEMENT) ? ((DOMElement*)node)->getOwnerDocument() : (DOMDocument*)node; MemBufInputSource* memBufIS = new (fMemoryManager) MemBufInputSource ( (const XMLByte*)fContents , XMLString::stringLen(fContents)*sizeof(XMLCh) , "" , false , fMemoryManager ); memBufIS->setEncoding(XMLUni::fgXMLChEncodingString); memBufIS->setCopyBufToStream(false); try { parser->parse(*memBufIS); } catch (const XMLException&) { // REVISIT: should we really eat this? } DOMNode* newElem = futureOwner->importNode((parser->getDocument())->getDocumentElement(), true); node->insertBefore(newElem, node->getFirstChild()); delete parser; delete memBufIS; } void XSAnnotation::writeAnnotation(ContentHandler* handler) { SAX2XMLReader* parser = XMLReaderFactory::createXMLReader(fMemoryManager); parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true); parser->setFeature(XMLUni::fgSAX2CoreValidation, false); parser->setContentHandler(handler); MemBufInputSource* memBufIS = new (fMemoryManager) MemBufInputSource ( (const XMLByte*)fContents , XMLString::stringLen(fContents)*sizeof(XMLCh) , "" , false , fMemoryManager ); memBufIS->setEncoding(XMLUni::fgXMLChEncodingString); memBufIS->setCopyBufToStream(false); try { parser->parse(*memBufIS); } catch (const XMLException&) { } delete parser; delete memBufIS; } void XSAnnotation::setNext(XSAnnotation* const nextAnnotation) { if (fNext) fNext->setNext(nextAnnotation); else fNext = nextAnnotation; } XSAnnotation* XSAnnotation::getNext() { return fNext; } void XSAnnotation::setSystemId(const XMLCh* const systemId) { if (fSystemId) { fMemoryManager->deallocate(fSystemId); fSystemId = 0; } if (systemId) fSystemId = XMLString::replicate(systemId, fMemoryManager); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(XSAnnotation) void XSAnnotation::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng.writeString(fContents); serEng<>fNext; serEng.readString(fSystemId); serEng.readUInt64 (fLine); serEng.readUInt64 (fCol); } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/framework/psvi/PSVIAttributeList.hpp000644 000765 000024 00000014472 13241160334 025263 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: PSVIAttributeList.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_PSVIATTRIBUTE_LIST_HPP) #define XERCESC_INCLUDE_GUARD_PSVIATTRIBUTE_LIST_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN /** * A container for the PSVI contributions to attributes that occur * on a particular element. * This is always owned by the parser/validator from * which it is obtained. The parser/validator will specify * under what conditions it may be relied upon to have meaningful contents. */ class XMLPARSER_EXPORT PSVIAttributeStorage : public XMemory { public: PSVIAttributeStorage() : fPSVIAttribute(0) , fAttributeName(0) , fAttributeNamespace(0) { } ~PSVIAttributeStorage() { delete fPSVIAttribute; } PSVIAttribute* fPSVIAttribute; const XMLCh* fAttributeName; const XMLCh* fAttributeNamespace; }; class XMLPARSER_EXPORT PSVIAttributeList : public XMemory { public: // Constructors and Destructor // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * The default constructor * * @param manager The configurable memory manager */ PSVIAttributeList( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); //@}; /** @name Destructor */ //@{ ~PSVIAttributeList(); //@} //--------------------- /** @name PSVIAttributeList methods */ //@{ /* * Get the number of attributes whose PSVI contributions * are contained in this list. */ XMLSize_t getLength() const; /* * Get the PSVI contribution of attribute at position i * in this list. Indices start from 0. * @param index index from which the attribute PSVI contribution * is to come. * @return PSVIAttribute containing the attributes PSVI contributions; * null is returned if the index is out of range. */ PSVIAttribute *getAttributePSVIAtIndex(const XMLSize_t index); /* * Get local part of attribute name at position index in the list. * Indices start from 0. * @param index index from which the attribute name * is to come. * @return local part of the attribute's name; null is returned if the index * is out of range. */ const XMLCh *getAttributeNameAtIndex(const XMLSize_t index); /* * Get namespace of attribute at position index in the list. * Indices start from 0. * @param index index from which the attribute namespace * is to come. * @return namespace of the attribute; * null is returned if the index is out of range. */ const XMLCh *getAttributeNamespaceAtIndex(const XMLSize_t index); /* * Get the PSVI contribution of attribute with given * local name and namespace. * @param attrName local part of the attribute's name * @param attrNamespace namespace of the attribute * @return null if the attribute PSVI does not exist */ PSVIAttribute *getAttributePSVIByName(const XMLCh *attrName , const XMLCh * attrNamespace); //@} //---------------------------------- /** methods needed by implementation */ //@{ /** * returns a PSVI attribute of undetermined state and given name/namespace and * makes that object part of the internal list. Intended to be called * during validation of an element. * @param attrName name of this attribute * @param attrNS URI of the attribute * @return new, uninitialized, PSVIAttribute object */ PSVIAttribute *getPSVIAttributeToFill( const XMLCh * attrName , const XMLCh * attrNS); /** * reset the list */ void reset(); //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- PSVIAttributeList(const PSVIAttributeList&); PSVIAttributeList & operator=(const PSVIAttributeList &); // ----------------------------------------------------------------------- // data members // ----------------------------------------------------------------------- // fMemoryManager // handler to provide dynamically-need memory // fAttrList // list of PSVIAttributes contained by this object // fAttrPos // current number of initialized PSVIAttributes in fAttrList MemoryManager* fMemoryManager; RefVectorOf* fAttrList; XMLSize_t fAttrPos; }; inline PSVIAttributeList::~PSVIAttributeList() { delete fAttrList; } inline PSVIAttribute *PSVIAttributeList::getPSVIAttributeToFill( const XMLCh *attrName , const XMLCh * attrNS) { PSVIAttributeStorage* storage = 0; if(fAttrPos == fAttrList->size()) { storage = new (fMemoryManager) PSVIAttributeStorage(); storage->fPSVIAttribute = new (fMemoryManager) PSVIAttribute(fMemoryManager); fAttrList->addElement(storage); } else { storage = fAttrList->elementAt(fAttrPos); } storage->fAttributeName = attrName; storage->fAttributeNamespace = attrNS; fAttrPos++; return storage->fPSVIAttribute; } inline void PSVIAttributeList::reset() { fAttrPos = 0; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/framework/psvi/XSAttributeUse.cpp000644 000765 000024 00000004214 13241160335 024642 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XSAttributeUse.cpp 471747 2006-11-06 14:31:56Z amassari $ */ #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XSAttributeUse: Constructors and Destructor // --------------------------------------------------------------------------- XSAttributeUse::XSAttributeUse(XSAttributeDeclaration* const xsAttDecl, XSModel* const xsModel, MemoryManager* const manager) : XSObject(XSConstants::ATTRIBUTE_USE, xsModel, manager) , fRequired(false) , fConstraintType(XSConstants::VALUE_CONSTRAINT_NONE) , fConstraintValue(0) , fXSAttributeDeclaration(xsAttDecl) { } XSAttributeUse::~XSAttributeUse() { // don't delete fXSAttributeDeclaration - deleted by XSModel } // --------------------------------------------------------------------------- // XSAttributeUse: helper methods // --------------------------------------------------------------------------- void XSAttributeUse::set(const bool isRequired, XSConstants::VALUE_CONSTRAINT constraintType, const XMLCh* const constraintValue) { fRequired = isRequired; fConstraintType = constraintType; fConstraintValue = constraintValue; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/NLS/EN_US/000755 000765 000024 00000000000 13241160333 017627 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/NLS/XMLErrList.dtd000644 000765 000024 00000003007 13241160333 021360 0ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/NLS/EN_US/XMLErrList_EN_US.Xml000644 000765 000024 00000245440 13241160333 023260 0ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/util/XMLASCIITranscoder.cpp000644 000765 000024 00000013205 13241160336 023205 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLASCIITranscoder: Constructors and Destructor // --------------------------------------------------------------------------- XMLASCIITranscoder::XMLASCIITranscoder( const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager) : XMLTranscoder(encodingName, blockSize, manager) { } XMLASCIITranscoder::~XMLASCIITranscoder() { } // --------------------------------------------------------------------------- // XMLASCIITranscoder: Implementation of the transcoder API // --------------------------------------------------------------------------- XMLSize_t XMLASCIITranscoder::transcodeFrom( const XMLByte* const srcData , const XMLSize_t srcCount , XMLCh* const toFill , const XMLSize_t maxChars , XMLSize_t& bytesEaten , unsigned char* const charSizes) { // // Calculate the max chars we can do here. Its the lesser of the // max output chars and the source byte count. // const XMLSize_t countToDo = srcCount < maxChars ? srcCount : maxChars; // // Now loop through that many source chars and just cast each one // over to the XMLCh format. Check each source that its really a // valid ASCI char. // const XMLByte* srcPtr = srcData; XMLCh* outPtr = toFill; XMLSize_t countDone = 0; for (; countDone < countToDo; countDone++) { // Do the optimistic work up front if (*srcPtr < 0x80) { *outPtr++ = XMLCh(*srcPtr++); continue; } // // We got non source encoding char. If we got more than 32 chars, // the just break out. We'll come back here later to hit this again // and give an error much closer to the real source position. // if (countDone > 32) break; XMLCh tmpBuf[17]; XMLString::binToText((unsigned int)*srcPtr, tmpBuf, 16, 16, getMemoryManager()); ThrowXMLwithMemMgr2 ( TranscodingException , XMLExcepts::Trans_Unrepresentable , tmpBuf , getEncodingName() , getMemoryManager() ); } // Set the bytes we ate bytesEaten = countDone; // Set the char sizes to the fixed size memset(charSizes, 1, countDone); // Return the chars we transcoded return countDone; } XMLSize_t XMLASCIITranscoder::transcodeTo(const XMLCh* const srcData , const XMLSize_t srcCount , XMLByte* const toFill , const XMLSize_t maxBytes , XMLSize_t& charsEaten , const UnRepOpts options) { // // Calculate the max chars we can do here. Its the lesser of the // max output chars and the source byte count. // const XMLSize_t countToDo = srcCount < maxBytes ? srcCount : maxBytes; const XMLCh* srcPtr = srcData; XMLByte* outPtr = toFill; for (XMLSize_t index = 0; index < countToDo; index++) { // If its legal, do it and jump back to the top if (*srcPtr < 0x80) { *outPtr++ = XMLByte(*srcPtr++); continue; } // // Its not representable so use a replacement char. According to // the options, either throw or use the replacement. // if (options == UnRep_Throw) { XMLCh tmpBuf[17]; XMLString::binToText((unsigned int)*srcPtr, tmpBuf, 16, 16, getMemoryManager()); ThrowXMLwithMemMgr2 ( TranscodingException , XMLExcepts::Trans_Unrepresentable , tmpBuf , getEncodingName() , getMemoryManager() ); } // Use the replacement char *outPtr++ = 0x1A; srcPtr++; } // Set the chars we ate charsEaten = countToDo; // Return the byte we transcoded return countToDo; } bool XMLASCIITranscoder::canTranscodeTo(const unsigned int toCheck) { return (toCheck < 0x80); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/HeaderDummy.cpp000644 000765 000024 00000003146 13241160336 022156 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: HeaderDummy.cpp 471747 2006-11-06 14:31:56Z amassari $ */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/BaseRefVectorOf.c000644 000765 000024 00000023574 13241160336 022400 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // BaseRefVectorOf: Constructors and Destructor // --------------------------------------------------------------------------- template BaseRefVectorOf::BaseRefVectorOf( const XMLSize_t maxElems , const bool adoptElems , MemoryManager* const manager) : fAdoptedElems(adoptElems) , fCurCount(0) , fMaxCount(maxElems) , fElemList(0) , fMemoryManager(manager) { // Allocate and initialize the array fElemList = (TElem**) fMemoryManager->allocate(maxElems * sizeof(TElem*));//new TElem*[maxElems]; for (XMLSize_t index = 0; index < maxElems; index++) fElemList[index] = 0; } //implemented so code will link template BaseRefVectorOf::~BaseRefVectorOf() { } // --------------------------------------------------------------------------- // BaseRefVectorOf: Element management // --------------------------------------------------------------------------- template void BaseRefVectorOf::addElement(TElem* const toAdd) { ensureExtraCapacity(1); fElemList[fCurCount] = toAdd; fCurCount++; } template void BaseRefVectorOf::setElementAt(TElem* const toSet, const XMLSize_t setAt) { if (setAt >= fCurCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Vector_BadIndex, fMemoryManager); if (fAdoptedElems) delete fElemList[setAt]; fElemList[setAt] = toSet; } template void BaseRefVectorOf:: insertElementAt(TElem* const toInsert, const XMLSize_t insertAt) { if (insertAt == fCurCount) { addElement(toInsert); return; } if (insertAt > fCurCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Vector_BadIndex, fMemoryManager); ensureExtraCapacity(1); // Make room for the newbie for (XMLSize_t index = fCurCount; index > insertAt; index--) fElemList[index] = fElemList[index-1]; // And stick it in and bump the count fElemList[insertAt] = toInsert; fCurCount++; } template TElem* BaseRefVectorOf:: orphanElementAt(const XMLSize_t orphanAt) { if (orphanAt >= fCurCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Vector_BadIndex, fMemoryManager); // Get the element we are going to orphan TElem* retVal = fElemList[orphanAt]; // Optimize if its the last element if (orphanAt == fCurCount-1) { fElemList[orphanAt] = 0; fCurCount--; return retVal; } // Copy down every element above orphan point for (XMLSize_t index = orphanAt; index < fCurCount-1; index++) fElemList[index] = fElemList[index+1]; // Keep unused elements zero for sanity's sake fElemList[fCurCount-1] = 0; // And bump down count fCurCount--; return retVal; } template void BaseRefVectorOf::removeAllElements() { for (XMLSize_t index = 0; index < fCurCount; index++) { if (fAdoptedElems) delete fElemList[index]; // Keep unused elements zero for sanity's sake fElemList[index] = 0; } fCurCount = 0; } template void BaseRefVectorOf:: removeElementAt(const XMLSize_t removeAt) { if (removeAt >= fCurCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Vector_BadIndex, fMemoryManager); if (fAdoptedElems) delete fElemList[removeAt]; // Optimize if its the last element if (removeAt == fCurCount-1) { fElemList[removeAt] = 0; fCurCount--; return; } // Copy down every element above remove point for (XMLSize_t index = removeAt; index < fCurCount-1; index++) fElemList[index] = fElemList[index+1]; // Keep unused elements zero for sanity's sake fElemList[fCurCount-1] = 0; // And bump down count fCurCount--; } template void BaseRefVectorOf::removeLastElement() { if (!fCurCount) return; fCurCount--; if (fAdoptedElems) delete fElemList[fCurCount]; } template bool BaseRefVectorOf::containsElement(const TElem* const toCheck) { for (XMLSize_t i = 0; i < fCurCount; i++) { if (fElemList[i] == toCheck) { return true; } } return false; } // // cleanup(): // similar to destructor // called to cleanup the memory, in case destructor cannot be called // template void BaseRefVectorOf::cleanup() { if (fAdoptedElems) { for (XMLSize_t index = 0; index < fCurCount; index++) delete fElemList[index]; } fMemoryManager->deallocate(fElemList);//delete [] fElemList; } // // reinitialize(): // similar to constructor // called to re-construct the fElemList from scratch again // template void BaseRefVectorOf::reinitialize() { // reinitialize the array if (fElemList) cleanup(); fElemList = (TElem**) fMemoryManager->allocate(fMaxCount * sizeof(TElem*));//new TElem*[fMaxCount]; for (XMLSize_t index = 0; index < fMaxCount; index++) fElemList[index] = 0; } template MemoryManager* BaseRefVectorOf::getMemoryManager() const { return fMemoryManager; } // --------------------------------------------------------------------------- // BaseRefVectorOf: Getter methods // --------------------------------------------------------------------------- template XMLSize_t BaseRefVectorOf::curCapacity() const { return fMaxCount; } template const TElem* BaseRefVectorOf:: elementAt(const XMLSize_t getAt) const { if (getAt >= fCurCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Vector_BadIndex, fMemoryManager); return fElemList[getAt]; } template TElem* BaseRefVectorOf::elementAt(const XMLSize_t getAt) { if (getAt >= fCurCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Vector_BadIndex, fMemoryManager); return fElemList[getAt]; } template XMLSize_t BaseRefVectorOf::size() const { return fCurCount; } // --------------------------------------------------------------------------- // BaseRefVectorOf: Miscellaneous // --------------------------------------------------------------------------- template void BaseRefVectorOf:: ensureExtraCapacity(const XMLSize_t length) { XMLSize_t newMax = fCurCount + length; if (newMax <= fMaxCount) return; // Choose how much bigger based on the current size. // This will grow half as much again. if (newMax < fMaxCount + fMaxCount/2) newMax = fMaxCount + fMaxCount/2; // Allocate the new array and copy over the existing stuff TElem** newList = (TElem**) fMemoryManager->allocate ( newMax * sizeof(TElem*) );//new TElem*[newMax]; XMLSize_t index = 0; for (; index < fCurCount; index++) newList[index] = fElemList[index]; // Zero out the rest of them for (; index < newMax; index++) newList[index] = 0; // Clean up the old array and update our members fMemoryManager->deallocate(fElemList);//delete [] fElemList; fElemList = newList; fMaxCount = newMax; } // --------------------------------------------------------------------------- // AbstractBaseRefVectorEnumerator: Constructors and Destructor // --------------------------------------------------------------------------- template BaseRefVectorEnumerator:: BaseRefVectorEnumerator( BaseRefVectorOf* const toEnum , const bool adopt) : fAdopted(adopt) , fCurIndex(0) , fToEnum(toEnum) { } template BaseRefVectorEnumerator::~BaseRefVectorEnumerator() { if (fAdopted) delete fToEnum; } template BaseRefVectorEnumerator:: BaseRefVectorEnumerator(const BaseRefVectorEnumerator& toCopy) : XMLEnumerator(toCopy) , XMemory(toCopy) , fAdopted(toCopy.fAdopted) , fCurIndex(toCopy.fCurIndex) , fToEnum(toCopy.fToEnum) { } // --------------------------------------------------------------------------- // RefBaseRefVectorEnumerator: Enum interface // --------------------------------------------------------------------------- template bool BaseRefVectorEnumerator::hasMoreElements() const { if (fCurIndex >= fToEnum->size()) return false; return true; } template TElem& BaseRefVectorEnumerator::nextElement() { return *(fToEnum->elementAt(fCurIndex++)); } template void BaseRefVectorEnumerator::Reset() { fCurIndex = 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLStringTokenizer.hpp000644 000765 000024 00000015673 13241160336 023511 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLStringTokenizer.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLSTRINGTOKENIZER_HPP) #define XERCESC_INCLUDE_GUARD_XMLSTRINGTOKENIZER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * The string tokenizer class breaks a string into tokens. * * The XMLStringTokenizer methods do not distinguish among identifiers, * numbers, and quoted strings, nor do they recognize and skip comments * * A XMLStringTokenizer object internally maintains a current position within * the string to be tokenized. Some operations advance this current position * past the characters processed. */ class XMLUTIL_EXPORT XMLStringTokenizer :public XMemory { public: // ----------------------------------------------------------------------- // Public Constructors // ----------------------------------------------------------------------- /** @name Constructors */ //@{ /** * Constructs a string tokenizer for the specified string. The tokenizer * uses the default delimiter set, which is "\t\n\r\f": the space * character, the tab character, the newline character, the * carriage-return character, and the form-feed character. Delimiter * characters themselves will not be treated as tokens. * * @param srcStr The string to be parsed. * @param manager Pointer to the memory manager to be used to * allocate objects. * */ XMLStringTokenizer(const XMLCh* const srcStr, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Constructs a string tokenizer for the specified string. The characters * in the delim argument are the delimiters for separating tokens. * Delimiter characters themselves will not be treated as tokens. * * @param srcStr The string to be parsed. * @param delim The set of delimiters. * @param manager Pointer to the memory manager to be used to * allocate objects. */ XMLStringTokenizer(const XMLCh* const srcStr , const XMLCh* const delim , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); //@} // ----------------------------------------------------------------------- // Public Destructor // ----------------------------------------------------------------------- /** @name Destructor. */ //@{ ~XMLStringTokenizer(); //@} // ----------------------------------------------------------------------- // Management methods // ----------------------------------------------------------------------- /** @name Management Function */ //@{ /** * Tests if there are more tokens available from this tokenizer's string. * * Returns true if and only if there is at least one token in the string * after the current position; false otherwise. */ bool hasMoreTokens(); /** * Calculates the number of times that this tokenizer's nextToken method * can be called to return a valid token. The current position is not * advanced. * * Returns the number of tokens remaining in the string using the current * delimiter set. */ unsigned int countTokens(); /** * Returns the next token from this string tokenizer. * * Function allocated, function managed (fafm). The calling function * does not need to worry about deleting the returned pointer. */ XMLCh* nextToken(); //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLStringTokenizer(const XMLStringTokenizer&); XMLStringTokenizer& operator=(const XMLStringTokenizer&); // ----------------------------------------------------------------------- // CleanUp methods // ----------------------------------------------------------------------- void cleanUp(); // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- bool isDelimeter(const XMLCh ch); // ----------------------------------------------------------------------- // Private data members // // fOffset // The current position in the parsed string. // // fStringLen // The length of the string parsed (for convenience). // // fString // The string to be parsed // // fDelimeters // A set of delimiter characters // // fTokens // A vector of the token strings // ----------------------------------------------------------------------- XMLSize_t fOffset; XMLSize_t fStringLen; XMLCh* fString; const XMLCh* fDelimeters; RefArrayVectorOf* fTokens; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // XMLStringTokenizer: Helper methods // --------------------------------------------------------------------------- inline bool XMLStringTokenizer::isDelimeter(const XMLCh ch) { return XMLString::indexOf(fDelimeters, ch) == -1 ? false : true; } // --------------------------------------------------------------------------- // XMLStringTokenizer: Management methods // --------------------------------------------------------------------------- inline unsigned int XMLStringTokenizer::countTokens() { if (fStringLen == 0) return 0; unsigned int tokCount = 0; bool inToken = false; for (XMLSize_t i= fOffset; i< fStringLen; i++) { if (isDelimeter(fString[i])) { if (inToken) { inToken = false; } continue; } if (!inToken) { tokCount++; inToken = true; } } // end for return tokCount; } XERCES_CPP_NAMESPACE_END #endif /** * End of file XMLStringTokenizer.hpp */ xerces-c-3.2.2/src/xercesc/util/KeyRefPair.hpp000644 000765 000024 00000005313 13241160336 021756 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: KeyRefPair.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_KEYREFPAIR_HPP) #define XERCESC_INCLUDE_GUARD_KEYREFPAIR_HPP #include XERCES_CPP_NAMESPACE_BEGIN template class KeyRefPair : public XMemory { public : // ------------------------------------------------------------------- // Constructors and Destructor // ------------------------------------------------------------------- KeyRefPair(); KeyRefPair(TKey* key, TValue* value); KeyRefPair(const KeyRefPair* toCopy); KeyRefPair(const KeyRefPair& toCopy); ~KeyRefPair(); // ------------------------------------------------------------------- // Getters // ------------------------------------------------------------------- const TKey* getKey() const; TKey* getKey(); const TValue* getValue() const; TValue* getValue(); // ------------------------------------------------------------------- // Setters // ------------------------------------------------------------------- TKey* setKey(TKey* newKey); TValue* setValue(TValue* newValue); private : // unimplemented: KeyRefPair& operator=(const KeyRefPair&); // ------------------------------------------------------------------- // Private data members // // fKey // The object that represents the key of the pair // // fValue // The object that represents the value of the pair // ------------------------------------------------------------------- TKey* fKey; TValue* fValue; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/XMLMutexMgr.hpp000644 000765 000024 00000003077 13241160336 022113 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLMutexMgr.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLMUTEXMGR_HPP) #define XERCESC_INCLUDE_GUARD_XMLMUTEXMGR_HPP #include XERCES_CPP_NAMESPACE_BEGIN typedef void* XMLMutexHandle; // Abstract class for mutex implementation. // This is be used to allow multiple mutex handling implementations. class XMLMutexMgr : public XMemory { public: XMLMutexMgr() {} virtual ~XMLMutexMgr() {} // Mutex operations virtual XMLMutexHandle create(MemoryManager* const manager) = 0; virtual void destroy(XMLMutexHandle mtx, MemoryManager* const manager) = 0; virtual void lock(XMLMutexHandle mtx) = 0; virtual void unlock(XMLMutexHandle mtx) = 0; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLNumber.hpp000644 000765 000024 00000005410 13241160336 021564 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLNumber.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLNUMBER_HPP) #define XERCESC_INCLUDE_GUARD_XMLNUMBER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT XMLNumber : public XSerializable, public XMemory { public: enum { LESS_THAN = -1, EQUAL = 0, GREATER_THAN = 1, INDETERMINATE = 2 }; enum NumberType { Float, Double, BigDecimal, DateTime, UnKnown }; virtual ~XMLNumber(); /** * Return string representation of the decimal value. * A decimal point will be included as necessary. * Similar to toString above, but the internal buffer is * returned directly, user is not required to delete * the returned buffer */ virtual XMLCh* getRawData() const = 0; /** * Return the original and converted value of the original data. * (applicable to double/float) * * The internal buffer is returned directly, user is not required * to delete the returned buffer */ virtual const XMLCh* getFormattedString() const = 0; /** * Returns the sign of this number * * -1 negative * 0 zero * 1 positive * */ virtual int getSign() const = 0; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLNumber) static XMLNumber* loadNumber(XMLNumber::NumberType numType , XSerializeEngine& serEng); protected: XMLNumber(); XMLNumber(const XMLNumber&); private: // ----------------------------------------------------------------------- // Unimplemented operators // ----------------------------------------------------------------------- XMLNumber& operator=(const XMLNumber&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/RefVectorOf.hpp000644 000765 000024 00000004265 13241160336 022146 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: RefVectorOf.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_REFVECTOROF_HPP) #define XERCESC_INCLUDE_GUARD_REFVECTOROF_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Class with implementation for vectors of References - implements from the * Abstract class Vector */ template class RefVectorOf : public BaseRefVectorOf { public : // ----------------------------------------------------------------------- // Constructor // ----------------------------------------------------------------------- RefVectorOf(const XMLSize_t maxElems, const bool adoptElems = true, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); // ----------------------------------------------------------------------- // Destructor // ----------------------------------------------------------------------- ~RefVectorOf(); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- RefVectorOf(const RefVectorOf&); RefVectorOf& operator=(const RefVectorOf&); }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/XMLBigInteger.cpp000644 000765 000024 00000026021 13241160336 022347 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLBigInteger.cpp 555320 2007-07-11 16:05:13Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN XMLCh* XMLBigInteger::getCanonicalRepresentation(const XMLCh* const rawData , MemoryManager* const memMgr , bool /* isNonPositiveInteger */) { try { XMLCh* retBuf = (XMLCh*) memMgr->allocate( (XMLString::stringLen(rawData) + 2) * sizeof(XMLCh)); ArrayJanitor jan(retBuf, memMgr); int sign = 0; XMLBigInteger::parseBigInteger(rawData, retBuf, sign); if (sign == 0) { retBuf[0] = chDigit_0; retBuf[1] = chNull; } else if (sign == -1) { XMLCh* retBuffer = (XMLCh*) memMgr->allocate( (XMLString::stringLen(retBuf) + 2) * sizeof(XMLCh)); retBuffer[0] = chDash; XMLString::copyString(&(retBuffer[1]), retBuf); return retBuffer; } jan.release(); return retBuf; } catch (const NumberFormatException&) { return 0; } } /*** * * Leading and trailing whitespaces are allowed, and trimmed * * Only one and either of (+,-) after the leading whitespace, before * any other characters are allowed, and trimmed * * Leading zero, after leading whitespace, (+|-), before any other * characters are allowed, and trimmed * * '.' NOT allowed * return status: void * ret_buf: w/o leading and/or trailing whitespace * w/o '+' and '-' * w/o leading zero * * see XMLString::parseInt(); * XMLString::textToBin(); * * " +000203456" "203456" * " -000203456" "203456" * ***/ void XMLBigInteger::parseBigInteger(const XMLCh* const toConvert , XMLCh* const retBuffer , int& signValue , MemoryManager* const manager) { // If no string, then its a failure if ((!toConvert) || (!*toConvert)) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_emptyString, manager); // // Note: in Java's BigInteger, it seems any leading and/or trailing // whitespaces are not allowed. If this is the case, we may // need to skip the trimming below. // // Scan past any whitespace. If we hit the end, then return failure const XMLCh* startPtr = toConvert; while (XMLChar1_0::isWhitespace(*startPtr)) startPtr++; if (!*startPtr) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_WSString, manager); // Start at the end and work back through any whitespace const XMLCh* endPtr = toConvert + XMLString::stringLen(toConvert); while (XMLChar1_0::isWhitespace(*(endPtr - 1))) endPtr--; // // Work through what remains and convert each char to a digit. // anything other than ' // XMLCh* retPtr = retBuffer; signValue = 1; // // '+' or '-' is allowed only at the first position // if (*startPtr == chDash) { signValue = -1; startPtr++; if (startPtr == endPtr) { ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, manager); } } else if (*startPtr == chPlus) { // skip the '+' startPtr++; if (startPtr == endPtr) { ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, manager); } } // Scan past any leading zero. while (*startPtr == chDigit_0) startPtr++; if (startPtr >= endPtr) { signValue = 0; // containning zero, only zero, nothing but zero // it is a zero, indeed return; } while (startPtr < endPtr) { // If not valid decimal digit, then an error if ((*startPtr < chDigit_0) || (*startPtr > chDigit_9)) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, manager); // copy over *retPtr = *startPtr; retPtr++; startPtr++; } *retPtr = 0; //terminated return; } /** * Translates a string containing an optional minus sign followed by a * sequence of one or more digits into a BigInteger. * Any extraneous characters (including whitespace), * inclusive, will result in a NumberFormatException. */ XMLBigInteger::XMLBigInteger(const XMLCh* const strValue, MemoryManager* const manager) : fSign(0) , fMagnitude(0) , fRawData(0) , fMemoryManager(manager) { if (!strValue) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_emptyString, fMemoryManager); XMLCh* ret_value = (XMLCh*) fMemoryManager->allocate ( (XMLString::stringLen(strValue) + 1) * sizeof(XMLCh) );//new XMLCh[XMLString::stringLen(strValue)+1]; ArrayJanitor janName(ret_value, fMemoryManager); parseBigInteger(strValue, ret_value, fSign, fMemoryManager); if (fSign == 0) fMagnitude = XMLString::replicate(XMLUni::fgZeroLenString, fMemoryManager); else fMagnitude = XMLString::replicate(ret_value, fMemoryManager); fRawData = XMLString::replicate(strValue, fMemoryManager); } XMLBigInteger::~XMLBigInteger() { fMemoryManager->deallocate(fMagnitude);//delete[] fMagnitude; if (fRawData) fMemoryManager->deallocate(fRawData);//delete[] fRawData; } XMLBigInteger::XMLBigInteger(const XMLBigInteger& toCopy) : XMemory(toCopy) , fSign(toCopy.fSign) , fMagnitude(0) , fRawData(0) , fMemoryManager(toCopy.fMemoryManager) { fMagnitude = XMLString::replicate(toCopy.fMagnitude, fMemoryManager); fRawData = XMLString::replicate(toCopy.fRawData, fMemoryManager); } /** * Returns -1, 0 or 1 as lValue is less than, equal to, or greater * than rValue. */ int XMLBigInteger::compareValues(const XMLBigInteger* const lValue , const XMLBigInteger* const rValue , MemoryManager* const manager) { if ((!lValue) || (!rValue) ) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_null_ptr, manager); int lSign = lValue->getSign(); int rSign = rValue->getSign(); // // different sign // if (lSign != rSign) return(lSign > rSign ? 1 : -1); // // same sign // if (lSign == 0) // optimization return 0; XMLSize_t lStrLen = XMLString::stringLen(lValue->fMagnitude); XMLSize_t rStrLen = XMLString::stringLen(rValue->fMagnitude); // // different length // if (lStrLen > rStrLen) return ( lSign > 0 ? 1 : -1 ); else if (lStrLen < rStrLen) return ( lSign > 0 ? -1 : 1 ); // // same length // XMLString::compareString() return > 0, 0 and <0 // we need to convert it to 1, 0, and -1 // int retVal = XMLString::compareString(lValue->fMagnitude, rValue->fMagnitude); if ( retVal > 0 ) { return ( lSign > 0 ? 1 : -1 ); } else if ( retVal < 0 ) { return ( lSign > 0 ? -1 : 1 ); } else return 0; } int XMLBigInteger::compareValues(const XMLCh* const lString , const int& lSign , const XMLCh* const rString , const int& rSign , MemoryManager* const manager) { if ((!lString) || (!rString) ) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_null_ptr, manager); // // different sign // if (lSign != rSign) return(lSign > rSign ? 1 : -1); // // same sign // if (lSign == 0) // optimization return 0; XMLSize_t lStrLen = XMLString::stringLen(lString); XMLSize_t rStrLen = XMLString::stringLen(rString); // // different length // if (lStrLen > rStrLen) return ( lSign > 0 ? 1 : -1 ); else if (lStrLen < rStrLen) return ( lSign > 0 ? -1 : 1 ); // // same length // XMLString::compareString() return > 0, 0 and <0 // we need to convert it to 1, 0, and -1 // int retVal = XMLString::compareString(lString, rString); if ( retVal > 0 ) { return ( lSign > 0 ? 1 : -1 ); } else if ( retVal < 0 ) { return ( lSign > 0 ? -1 : 1 ); } else return 0; } /** * Shift the fMagnitude to the left */ void XMLBigInteger::multiply(const unsigned int byteToShift) { if (byteToShift <= 0) return; XMLSize_t strLen = XMLString::stringLen(fMagnitude); XMLCh* tmp = (XMLCh*) fMemoryManager->allocate ( (strLen + byteToShift + 1) * sizeof(XMLCh) );//new XMLCh[strLen+byteToShift+1]; XMLString::moveChars(tmp, fMagnitude, strLen); unsigned int i = 0; for ( ; i < byteToShift; i++) tmp[strLen+i] = chDigit_0; tmp[strLen+i] = chNull; fMemoryManager->deallocate(fMagnitude);//delete[] fMagnitude; fMagnitude = tmp; } /** * Shift the fMagnitude to the right * by doing this, we lose precision. */ void XMLBigInteger::divide(const unsigned int byteToShift) { if (byteToShift <= 0) return; XMLSize_t strLen = XMLString::stringLen(fMagnitude); XMLCh* tmp = (XMLCh*) fMemoryManager->allocate ( (strLen - byteToShift + 1) * sizeof(XMLCh) );//new XMLCh[strLen-byteToShift+1]; XMLString::moveChars(tmp, fMagnitude, strLen-byteToShift); tmp[strLen-byteToShift] = chNull; fMemoryManager->deallocate(fMagnitude);//delete[] fMagnitude; fMagnitude = tmp; } // // // int XMLBigInteger::intValue() const { unsigned int retVal; XMLString::textToBin(fMagnitude, retVal, fMemoryManager); return retVal * getSign(); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/BinMemInputStream.cpp000644 000765 000024 00000006565 13241160336 023325 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BinMemInputStream.cpp 1798767 2017-06-14 21:28:26Z rleigh $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // BinMemInputStream: Constructors and Destructor // --------------------------------------------------------------------------- BinMemInputStream::BinMemInputStream( const XMLByte* const initData , const XMLSize_t capacity , const BufOpts bufOpt , MemoryManager* const manager) : fBuffer(0) , fBufOpt(bufOpt) , fCapacity(capacity) , fCurIndex(0) , fMemoryManager(manager) { // According to the buffer option, do the right thing if (fBufOpt == BufOpt_Copy) { XMLByte* tmpBuf = (XMLByte*) fMemoryManager->allocate ( fCapacity * sizeof(XMLByte) );//new XMLByte[fCapacity]; memcpy(tmpBuf, initData, capacity); fBuffer = tmpBuf; } else { fBuffer = initData; } } BinMemInputStream::~BinMemInputStream() { // // If we adopted or copied the buffer, then clean it up. We have to // cast off the const'ness in that case in order to delete it. // if ((fBufOpt == BufOpt_Adopt) || (fBufOpt == BufOpt_Copy)) fMemoryManager->deallocate(const_cast(fBuffer));//delete [] (XMLByte*)fBuffer; } // --------------------------------------------------------------------------- // MemBinInputStream: Implementation of the input stream interface // --------------------------------------------------------------------------- XMLSize_t BinMemInputStream::readBytes( XMLByte* const toFill , const XMLSize_t maxToRead) { // // Figure out how much we can really read. Its the smaller of the // amount available and the amount asked for. // const XMLSize_t available = (fCapacity - fCurIndex); if (!available) return 0; const XMLSize_t actualToRead = available < maxToRead ? available : maxToRead; memcpy(toFill, &fBuffer[fCurIndex], actualToRead); fCurIndex += actualToRead; return actualToRead; } const XMLCh* BinMemInputStream::getContentType() const { return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLMsgLoader.cpp000644 000765 000024 00000005505 13241160336 022211 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLMsgLoader.cpp 482395 2006-12-04 22:44:40Z dbertoni $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN /*** * The PlatformUtils::initialize() would set fLocale * to either a user-provided string or 0 * ***/ char* XMLMsgLoader::fLocale = 0; char* XMLMsgLoader::fPath = 0; /*** * if localeToAdopt is 0, that is to release memory for * the user defined locale string * ***/ void XMLMsgLoader::setLocale(const char* const localeToAdopt) { /*** * Release the current setting's memory, if any ***/ if (fLocale) { XMLPlatformUtils::fgMemoryManager->deallocate(fLocale);//delete [] fLocale; fLocale = 0; } /*** * * REVISIT: later we may do locale format checking * * refer to phttp://oss.software.ibm.com/icu/userguide/locale.html * for details. */ if (localeToAdopt && (strlen(localeToAdopt) == 2 || (strlen(localeToAdopt) > 3 && localeToAdopt[2]=='_'))) { fLocale = XMLString::replicate(localeToAdopt, XMLPlatformUtils::fgMemoryManager); } } const char* XMLMsgLoader::getLocale() { return fLocale; } /*** * if nlsHomeToAdopt is 0, that is to release memory for * the user defined NLSHome string * ***/ void XMLMsgLoader::setNLSHome(const char* const nlsHomeToAdopt) { /*** * Release the current setting's memory, if any ***/ if (fPath) { XMLPlatformUtils::fgMemoryManager->deallocate(fPath);//delete [] fPath; fPath = 0; } if (nlsHomeToAdopt) { fPath = XMLString::replicate(nlsHomeToAdopt, XMLPlatformUtils::fgMemoryManager); } } const char* XMLMsgLoader::getNLSHome() { return fPath; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLUTF16Transcoder.cpp000644 000765 000024 00000015623 13241160336 023170 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLUTF16Transcoder: Constructors and Destructor // --------------------------------------------------------------------------- XMLUTF16Transcoder::XMLUTF16Transcoder( const XMLCh* const encodingName , const XMLSize_t blockSize , const bool swapped , MemoryManager* const manager) : XMLTranscoder(encodingName, blockSize, manager) , fSwapped(swapped) { } XMLUTF16Transcoder::~XMLUTF16Transcoder() { } // --------------------------------------------------------------------------- // XMLUTF16Transcoder: Implementation of the transcoder API // --------------------------------------------------------------------------- XMLSize_t XMLUTF16Transcoder::transcodeFrom( const XMLByte* const srcData , const XMLSize_t srcCount , XMLCh* const toFill , const XMLSize_t maxChars , XMLSize_t& bytesEaten , unsigned char* const charSizes) { // // Calculate the max chars we can do here. Its the lesser of the // max output chars and the number of chars in the source. // const XMLSize_t srcChars = srcCount / sizeof(UTF16Ch); const XMLSize_t countToDo = srcChars < maxChars ? srcChars : maxChars; // Look at the source data as UTF16 chars const UTF16Ch* asUTF16 = reinterpret_cast(srcData); // And get a mutable pointer to the output XMLCh* outPtr = toFill; // // If its swapped, we have to do a char by char swap and cast. Else // we have to check whether our XMLCh and UTF16Ch types are the same // size or not. If so, we can optimize by just doing a buffer copy. // if (fSwapped) { // // And then do the swapping loop for the count we precalculated. Note // that this also handles size conversion as well if XMLCh is not the // same size as UTF16Ch. // for (XMLSize_t index = 0; index < countToDo; index++) *outPtr++ = BitOps::swapBytes(*asUTF16++); } else { // // If the XMLCh type is the same size as a UTF16 value on this // platform, then we can do just a buffer copy straight to the target // buffer since our source chars are UTF-16 chars. If its not, then // we still have to do a loop and assign each one, in order to // implicitly convert. // if (sizeof(XMLCh) == sizeof(UTF16Ch)) { // Notice we convert char count to byte count here!!! memcpy(toFill, srcData, countToDo * sizeof(UTF16Ch)); } else { for (XMLSize_t index = 0; index < countToDo; index++) *outPtr++ = XMLCh(*asUTF16++); } } // Set the bytes eaten bytesEaten = countToDo * sizeof(UTF16Ch); // Set the character sizes to the fixed size memset(charSizes, sizeof(UTF16Ch), countToDo); // Return the chars we transcoded return countToDo; } XMLSize_t XMLUTF16Transcoder::transcodeTo(const XMLCh* const srcData , const XMLSize_t srcCount , XMLByte* const toFill , const XMLSize_t maxBytes , XMLSize_t& charsEaten , const UnRepOpts) { // // Calculate the max chars we can do here. Its the lesser of the // chars that we can fit into the output buffer, and the source // chars available. // const XMLSize_t maxOutChars = maxBytes / sizeof(UTF16Ch); const XMLSize_t countToDo = srcCount < maxOutChars ? srcCount : maxOutChars; // // Get a pointer tot he output buffer in the UTF-16 character format // that we need to work with. And get a mutable pointer to the source // character buffer. // UTF16Ch* outPtr = reinterpret_cast(toFill); const XMLCh* srcPtr = srcData; // // If the target format is swapped from our native format, then handle // it one way, else handle it another. // if (fSwapped) { // // And then do the swapping loop for the count we precalculated. Note // that this also handles size conversion as well if XMLCh is not the // same size as UTF16Ch. // for (XMLSize_t index = 0; index < countToDo; index++) { // To avoid flakey compilers, use a temp const UTF16Ch tmpCh = UTF16Ch(*srcPtr++); *outPtr++ = BitOps::swapBytes(tmpCh); } } else { // // If XMLCh and UTF16Ch are the same size, we can just do a fast // memory copy. Otherwise, we have to do a loop and downcast each // character into its new 16 bit storage. // if (sizeof(XMLCh) == sizeof(UTF16Ch)) { // Notice we convert char count to byte count here!!! memcpy(toFill, srcData, countToDo * sizeof(UTF16Ch)); } else { for (XMLSize_t index = 0; index < countToDo; index++) *outPtr++ = UTF16Ch(*srcPtr++); } } // Set the chars eaten to the calculated number we ate charsEaten = countToDo; //Return the bytes we ate. Note we convert to a byte count here! return countToDo * sizeof(UTF16Ch); } bool XMLUTF16Transcoder::canTranscodeTo(const unsigned int) { // We can handle anything return true; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLChTranscoder.hpp000644 000765 000024 00000006015 13241160336 022715 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLChTranscoder.hpp 635560 2008-03-10 14:10:09Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLCHTRANSCODER_HPP) #define XERCESC_INCLUDE_GUARD_XMLCHTRANSCODER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN // // This class provides an implementation of the XMLTranscoder interface // for a simple XMLCh transcoder. This is used for internal entities, which // are already in the native XMLCh format. // class XMLUTIL_EXPORT XMLChTranscoder : public XMLTranscoder { public : // ----------------------------------------------------------------------- // Public constructors and destructor // ----------------------------------------------------------------------- XMLChTranscoder ( const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~XMLChTranscoder(); // ----------------------------------------------------------------------- // Implementation of the XMLTranscoder interface // ----------------------------------------------------------------------- virtual XMLSize_t transcodeFrom ( const XMLByte* const srcData , const XMLSize_t srcCount , XMLCh* const toFill , const XMLSize_t maxChars , XMLSize_t& bytesEaten , unsigned char* const charSizes ); virtual XMLSize_t transcodeTo ( const XMLCh* const srcData , const XMLSize_t srcCount , XMLByte* const toFill , const XMLSize_t maxBytes , XMLSize_t& charsEaten , const UnRepOpts options ); virtual bool canTranscodeTo ( const unsigned int toCheck ); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLChTranscoder(const XMLChTranscoder&); XMLChTranscoder& operator=(const XMLChTranscoder&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/FlagJanitor.hpp000644 000765 000024 00000004572 13241160335 022162 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: FlagJanitor.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_FLAGJANITOR_HPP) #define XERCESC_INCLUDE_GUARD_FLAGJANITOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN template class FlagJanitor { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- FlagJanitor(T* const valPtr, const T newVal); ~FlagJanitor(); // ----------------------------------------------------------------------- // Value management methods // ----------------------------------------------------------------------- void release(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- FlagJanitor(); FlagJanitor(const FlagJanitor&); FlagJanitor& operator=(const FlagJanitor&); // ----------------------------------------------------------------------- // Private data members // // fOldVal // The old value that was in the flag when we were constructed. // // fValPtr // A pointer to the flag that we are to restore the value of // ----------------------------------------------------------------------- T fOldVal; T* fValPtr; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/XMLURL.hpp000644 000765 000024 00000021163 13241160336 021001 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLURL.hpp 536133 2007-05-08 09:05:14Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLURL_HPP) #define XERCESC_INCLUDE_GUARD_XMLURL_HPP #include XERCES_CPP_NAMESPACE_BEGIN class BinInputStream; // // This class supports file, http, and ftp style URLs. All others are // rejected // class XMLUTIL_EXPORT XMLURL : public XMemory { public: // ----------------------------------------------------------------------- // Class types // // And they must remain in this order because they are indexes into an // array internally! // ----------------------------------------------------------------------- enum Protocols { File , HTTP , FTP , HTTPS , Protocols_Count , Unknown }; // ----------------------------------------------------------------------- // Public static methods // ----------------------------------------------------------------------- static Protocols lookupByName(const XMLCh* const protoName); static bool parse(const XMLCh* const urlText, XMLURL& xmlURL); // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- XMLURL(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); XMLURL ( const XMLCh* const baseURL , const XMLCh* const relativeURL , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); XMLURL ( const XMLCh* const baseURL , const char* const relativeURL , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); XMLURL ( const XMLURL& baseURL , const XMLCh* const relativeURL ); XMLURL ( const XMLURL& baseURL , const char* const relativeURL ); XMLURL ( const XMLCh* const urlText , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); XMLURL ( const char* const urlText , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); XMLURL(const XMLURL& toCopy); virtual ~XMLURL(); // ----------------------------------------------------------------------- // Operators // ----------------------------------------------------------------------- XMLURL& operator=(const XMLURL& toAssign); bool operator==(const XMLURL& toCompare) const; bool operator!=(const XMLURL& toCompare) const; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- const XMLCh* getFragment() const; const XMLCh* getHost() const; const XMLCh* getPassword() const; const XMLCh* getPath() const; unsigned int getPortNum() const; Protocols getProtocol() const; const XMLCh* getProtocolName() const; const XMLCh* getQuery() const; const XMLCh* getURLText() const; const XMLCh* getUser() const; MemoryManager* getMemoryManager() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setURL(const XMLCh* const urlText); void setURL ( const XMLCh* const baseURL , const XMLCh* const relativeURL ); void setURL ( const XMLURL& baseURL , const XMLCh* const relativeURL ); // a version of setURL that doesn't throw malformed url exceptions bool setURL( const XMLCh* const baseURL , const XMLCh* const relativeURL , XMLURL& xmlURL); // ----------------------------------------------------------------------- // Miscellaneous methods // ----------------------------------------------------------------------- bool isRelative() const; bool hasInvalidChar() const; BinInputStream* makeNewStream() const; void makeRelativeTo(const XMLCh* const baseURLText); void makeRelativeTo(const XMLURL& baseURL); private: // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void buildFullText(); void cleanUp(); bool conglomerateWithBase(const XMLURL& baseURL, bool useExceptions=true); void parse ( const XMLCh* const urlText ); // ----------------------------------------------------------------------- // Data members // // fFragment // The fragment part of the URL, if any. If none, its a null. // // fHost // The host part of the URL that was parsed out. This one will often // be null (or "localhost", which also means the current machine.) // // fPassword // The password found, if any. If none then its a null. // // fPath // The path part of the URL that was parsed out, if any. If none, // then its a null. // // fPortNum // The port that was indicated in the URL. If no port was provided // explicitly, then its left zero. // // fProtocol // Indicates the type of the URL's source. The text of the prefix // can be gotten from this. // // fQuery // The query part of the URL, if any. If none, then its a null. // // fUser // The username found, if any. If none, then its a null. // // fURLText // This is a copy of the URL text, after it has been taken apart, // made relative if needed, canonicalized, and then put back // together. Its only created upon demand. // // fHasInvalidChar // This indicates if the URL Text contains invalid characters as per // RFC 2396 standard. // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; XMLCh* fFragment; XMLCh* fHost; XMLCh* fPassword; XMLCh* fPath; unsigned int fPortNum; Protocols fProtocol; XMLCh* fQuery; XMLCh* fUser; XMLCh* fURLText; bool fHasInvalidChar; }; // --------------------------------------------------------------------------- // XMLURL: Public operators // --------------------------------------------------------------------------- inline bool XMLURL::operator!=(const XMLURL& toCompare) const { return !operator==(toCompare); } // --------------------------------------------------------------------------- // XMLURL: Getter methods // --------------------------------------------------------------------------- inline const XMLCh* XMLURL::getFragment() const { return fFragment; } inline const XMLCh* XMLURL::getHost() const { return fHost; } inline const XMLCh* XMLURL::getPassword() const { return fPassword; } inline const XMLCh* XMLURL::getPath() const { return fPath; } inline XMLURL::Protocols XMLURL::getProtocol() const { return fProtocol; } inline const XMLCh* XMLURL::getQuery() const { return fQuery; } inline const XMLCh* XMLURL::getUser() const { return fUser; } inline const XMLCh* XMLURL::getURLText() const { // // Fault it in if not already. Since this is a const method and we // can't use mutable members due the compilers we have to support, // we have to cast off the constness. // if (!fURLText) ((XMLURL*)this)->buildFullText(); return fURLText; } inline MemoryManager* XMLURL::getMemoryManager() const { return fMemoryManager; } MakeXMLException(MalformedURLException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLDouble.hpp000644 000765 000024 00000006340 13241160336 021551 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLDouble.hpp 673155 2008-07-01 17:55:39Z dbertoni $ */ #if !defined(XERCESC_INCLUDE_GUARD_XML_DOUBLE_HPP) #define XERCESC_INCLUDE_GUARD_XML_DOUBLE_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT XMLDouble : public XMLAbstractDoubleFloat { public: /** * Constructs a newly allocated XMLDouble object that * represents the value represented by the string. * * @param strValue the String to be converted to an * XMLDouble. * @param manager Pointer to the memory manager to be used to * allocate objects. * @exception NumberFormatException if the String does not * contain a parsable XMLDouble. */ XMLDouble(const XMLCh* const strValue, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~XMLDouble(); /** * Compares this object to the specified object. * The result is true if and only if the argument is not * null and is an XMLDouble object that contains * the same int value as this object. * * @param lValue the object to compare with. * @param rValue the object to compare against. * @return true if the objects are the same; * false otherwise. */ inline static int compareValues(const XMLDouble* const lValue , const XMLDouble* const rValue); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLDouble) XMLDouble(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); protected: virtual void checkBoundary(char* const strValue); private: // // Unimplemented // // copy ctor // assignment ctor // XMLDouble(const XMLDouble& toCopy); XMLDouble& operator=(const XMLDouble& toAssign); }; inline int XMLDouble::compareValues(const XMLDouble* const lValue , const XMLDouble* const rValue) { return XMLAbstractDoubleFloat::compareValues((const XMLAbstractDoubleFloat*) lValue, (const XMLAbstractDoubleFloat*) rValue , ((XMLAbstractDoubleFloat*)lValue)->getMemoryManager()); } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/RefArrayVectorOf.hpp000644 000765 000024 00000005217 13241160336 023143 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: RefArrayVectorOf.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_REFARRAYVECTOROF_HPP) #define XERCESC_INCLUDE_GUARD_REFARRAYVECTOROF_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Class with implementation for vectors of pointers to arrays - implements from * the Abstract class Vector */ template class RefArrayVectorOf : public BaseRefVectorOf { public : // ----------------------------------------------------------------------- // Constructor // ----------------------------------------------------------------------- RefArrayVectorOf( const XMLSize_t maxElems , const bool adoptElems = true , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); // ----------------------------------------------------------------------- // Destructor // ----------------------------------------------------------------------- ~RefArrayVectorOf(); // ----------------------------------------------------------------------- // Element management // ----------------------------------------------------------------------- void setElementAt(TElem* const toSet, const XMLSize_t setAt); void removeAllElements(); void removeElementAt(const XMLSize_t removeAt); void removeLastElement(); void cleanup(); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- RefArrayVectorOf(const RefArrayVectorOf&); RefArrayVectorOf& operator=(const RefArrayVectorOf&); }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/XMLFloat.hpp000644 000765 000024 00000006224 13241160335 021404 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLFloat.hpp 673155 2008-07-01 17:55:39Z dbertoni $ */ #if !defined(XERCESC_INCLUDE_GUARD_XML_FLOAT_HPP) #define XERCESC_INCLUDE_GUARD_XML_FLOAT_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT XMLFloat : public XMLAbstractDoubleFloat { public: /** * Constructs a newly allocated XMLFloat object that * represents the value represented by the string. * * @param strValue the String to be converted to an * XMLFloat. * @param manager Pointer to the memory manager to be used to * allocate objects. * @exception NumberFormatException if the String does not * contain a parsable XMLFloat. */ XMLFloat(const XMLCh* const strValue, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~XMLFloat(); /** * Compares the two specified XMLFloat objects. * The result is true if and only if the argument is not * null and that contains the same int value. * * @param lValue the object to compare with. * @param rValue the object to compare against. * @return true if the objects are the same; * false otherwise. */ inline static int compareValues(const XMLFloat* const lValue , const XMLFloat* const rValue); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLFloat) XMLFloat(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); protected: virtual void checkBoundary(char* const strValue); private: // // Unimplemented // // copy ctor // assignment ctor // XMLFloat(const XMLFloat& toCopy); XMLFloat& operator=(const XMLFloat& toAssign); }; inline int XMLFloat::compareValues(const XMLFloat* const lValue , const XMLFloat* const rValue) { return XMLAbstractDoubleFloat::compareValues((const XMLAbstractDoubleFloat*) lValue, (const XMLAbstractDoubleFloat*) rValue , ((XMLAbstractDoubleFloat*)lValue)->getMemoryManager()); } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/ValueArrayOf.c000644 000765 000024 00000016613 13241160336 021755 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ValueArrayOf.c 932889 2010-04-11 13:10:10Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // ValueArrayOf: Constructors and Destructor // --------------------------------------------------------------------------- template ValueArrayOf::ValueArrayOf(const XMLSize_t size, MemoryManager* const manager) : fSize(size) , fArray(0) , fMemoryManager(manager) { fArray = (TElem*) fMemoryManager->allocate(fSize * sizeof(TElem)); //new TElem[fSize]; } template ValueArrayOf::ValueArrayOf( const TElem* values , const XMLSize_t size , MemoryManager* const manager) : fSize(size) , fArray(0) , fMemoryManager(manager) { fArray = (TElem*) fMemoryManager->allocate(fSize * sizeof(TElem)); //new TElem[fSize]; for (XMLSize_t index = 0; index < fSize; index++) fArray[index] = values[index]; } template ValueArrayOf::ValueArrayOf(const ValueArrayOf& source) : XMemory(source) , fSize(source.fSize) , fArray(0) , fMemoryManager(source.fMemoryManager) { fArray = (TElem*) fMemoryManager->allocate(fSize * sizeof(TElem)); //new TElem[fSize]; for (XMLSize_t index = 0; index < fSize; index++) fArray[index] = source.fArray[index]; } template ValueArrayOf::~ValueArrayOf() { fMemoryManager->deallocate(fArray); //delete [] fArray; } // --------------------------------------------------------------------------- // ValueArrayOf: Public operators // --------------------------------------------------------------------------- template TElem& ValueArrayOf:: operator[](const XMLSize_t index) { if (index >= fSize) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Array_BadIndex, fMemoryManager); return fArray[index]; } template const TElem& ValueArrayOf:: operator[](const XMLSize_t index) const { if (index >= fSize) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Array_BadIndex, fMemoryManager); return fArray[index]; } template ValueArrayOf& ValueArrayOf:: operator=(const ValueArrayOf& toAssign) { if (this == &toAssign) return *this; // Reallocate if not the same size if (toAssign.fSize != fSize) { fMemoryManager->deallocate(fArray); //delete [] fArray; fSize = toAssign.fSize; fArray = (TElem*) fMemoryManager->allocate(fSize * sizeof(TElem)); //new TElem[fSize]; } // Copy over the source elements for (XMLSize_t index = 0; index < fSize; index++) fArray[index] = toAssign.fArray[index]; return *this; } template bool ValueArrayOf:: operator==(const ValueArrayOf& toCompare) const { if (this == &toCompare) return true; if (fSize != toCompare.fSize) return false; for (XMLSize_t index = 0; index < fSize; index++) { if (fArray[index] != toCompare.fArray[index]) return false; } return true; } template bool ValueArrayOf:: operator!=(const ValueArrayOf& toCompare) const { return !operator==(toCompare); } // --------------------------------------------------------------------------- // ValueArrayOf: Copy operations // --------------------------------------------------------------------------- template XMLSize_t ValueArrayOf:: copyFrom(const ValueArrayOf& srcArray) { // // Copy over as many of the source elements as will fit into // this array. // const XMLSize_t count = fSize < srcArray.fSize ? fSize : srcArray.fSize; for (XMLSize_t index = 0; index < count; index++) fArray[index] = srcArray.fArray[index]; return count; } // --------------------------------------------------------------------------- // ValueArrayOf: Getter methods // --------------------------------------------------------------------------- template XMLSize_t ValueArrayOf:: length() const { return fSize; } template TElem* ValueArrayOf:: rawData() const { return fArray; } // --------------------------------------------------------------------------- // ValueArrayOf: Miscellaneous methods // --------------------------------------------------------------------------- template void ValueArrayOf:: resize(const XMLSize_t newSize) { if (newSize == fSize) return; if (newSize < fSize) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Array_BadNewSize, fMemoryManager); // Allocate the new array TElem* newArray = (TElem*) fMemoryManager->allocate ( newSize * sizeof(TElem) ); //new TElem[newSize]; // Copy the existing values XMLSize_t index = 0; for (; index < fSize; index++) newArray[index] = fArray[index]; for (; index < newSize; index++) newArray[index] = TElem(0); // Delete the old array and update our members fMemoryManager->deallocate(fArray); //delete [] fArray; fArray = newArray; fSize = newSize; } // --------------------------------------------------------------------------- // ValueArrayEnumerator: Constructors and Destructor // --------------------------------------------------------------------------- template ValueArrayEnumerator:: ValueArrayEnumerator(ValueArrayOf* const toEnum, const bool adopt) : fAdopted(adopt) , fCurIndex(0) , fToEnum(toEnum) { } template ValueArrayEnumerator::~ValueArrayEnumerator() { if (fAdopted) delete fToEnum; } // --------------------------------------------------------------------------- // ValueArrayEnumerator: Enum interface // --------------------------------------------------------------------------- template bool ValueArrayEnumerator::hasMoreElements() const { if (fCurIndex >= fToEnum->length()) return false; return true; } template TElem& ValueArrayEnumerator::nextElement() { return (*fToEnum)[fCurIndex++]; } template void ValueArrayEnumerator::Reset() { fCurIndex = 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLWin1252Transcoder.cpp000644 000765 000024 00000026026 13241160336 023431 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local const data // // gFromTable // This is the translation table for Windows 1252 to Unicode. This // table contains 255 entries. The entry for 1252 byte x is the // Unicode translation of that byte. // // gToTable // gToTableSz // This is the translation table for Unicode to Windows 1252. This one // contains a list of records, sorted by the Unicode code point. We do // a binary search to find the Unicode point, and that record's other // field is the 1252 code point to translate to. // --------------------------------------------------------------------------- static const XMLCh gFromTable[256] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007 , 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F , 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017 , 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F , 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027 , 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F , 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037 , 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F , 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047 , 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F , 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057 , 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F , 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067 , 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F , 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077 , 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F , 0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021 , 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x008D, 0x017D, 0x008F , 0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014 , 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x009D, 0x017E, 0x0178 , 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7 , 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF , 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7 , 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF , 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7 , 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF , 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7 , 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF , 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7 , 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF , 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7 , 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF }; static const XMLTransService::TransRec gToTable[] = { { 0x0000, 0x00 }, { 0x0001, 0x01 }, { 0x0002, 0x02 }, { 0x0003, 0x03 } , { 0x0004, 0x04 }, { 0x0005, 0x05 }, { 0x0006, 0x06 }, { 0x0007, 0x07 } , { 0x0008, 0x08 }, { 0x0009, 0x09 }, { 0x000A, 0x0A }, { 0x000B, 0x0B } , { 0x000C, 0x0C }, { 0x000D, 0x0D }, { 0x000E, 0x0E }, { 0x000F, 0x0F } , { 0x0010, 0x10 }, { 0x0011, 0x11 }, { 0x0012, 0x12 }, { 0x0013, 0x13 } , { 0x0014, 0x14 }, { 0x0015, 0x15 }, { 0x0016, 0x16 }, { 0x0017, 0x17 } , { 0x0018, 0x18 }, { 0x0019, 0x19 }, { 0x001A, 0x1A }, { 0x001B, 0x1B } , { 0x001C, 0x1C }, { 0x001D, 0x1D }, { 0x001E, 0x1E }, { 0x001F, 0x1F } , { 0x0020, 0x20 }, { 0x0021, 0x21 }, { 0x0022, 0x22 }, { 0x0023, 0x23 } , { 0x0024, 0x24 }, { 0x0025, 0x25 }, { 0x0026, 0x26 }, { 0x0027, 0x27 } , { 0x0028, 0x28 }, { 0x0029, 0x29 }, { 0x002A, 0x2A }, { 0x002B, 0x2B } , { 0x002C, 0x2C }, { 0x002D, 0x2D }, { 0x002E, 0x2E }, { 0x002F, 0x2F } , { 0x0030, 0x30 }, { 0x0031, 0x31 }, { 0x0032, 0x32 }, { 0x0033, 0x33 } , { 0x0034, 0x34 }, { 0x0035, 0x35 }, { 0x0036, 0x36 }, { 0x0037, 0x37 } , { 0x0038, 0x38 }, { 0x0039, 0x39 }, { 0x003A, 0x3A }, { 0x003B, 0x3B } , { 0x003C, 0x3C }, { 0x003D, 0x3D }, { 0x003E, 0x3E }, { 0x003F, 0x3F } , { 0x0040, 0x40 }, { 0x0041, 0x41 }, { 0x0042, 0x42 }, { 0x0043, 0x43 } , { 0x0044, 0x44 }, { 0x0045, 0x45 }, { 0x0046, 0x46 }, { 0x0047, 0x47 } , { 0x0048, 0x48 }, { 0x0049, 0x49 }, { 0x004A, 0x4A }, { 0x004B, 0x4B } , { 0x004C, 0x4C }, { 0x004D, 0x4D }, { 0x004E, 0x4E }, { 0x004F, 0x4F } , { 0x0050, 0x50 }, { 0x0051, 0x51 }, { 0x0052, 0x52 }, { 0x0053, 0x53 } , { 0x0054, 0x54 }, { 0x0055, 0x55 }, { 0x0056, 0x56 }, { 0x0057, 0x57 } , { 0x0058, 0x58 }, { 0x0059, 0x59 }, { 0x005A, 0x5A }, { 0x005B, 0x5B } , { 0x005C, 0x5C }, { 0x005D, 0x5D }, { 0x005E, 0x5E }, { 0x005F, 0x5F } , { 0x0060, 0x60 }, { 0x0061, 0x61 }, { 0x0062, 0x62 }, { 0x0063, 0x63 } , { 0x0064, 0x64 }, { 0x0065, 0x65 }, { 0x0066, 0x66 }, { 0x0067, 0x67 } , { 0x0068, 0x68 }, { 0x0069, 0x69 }, { 0x006A, 0x6A }, { 0x006B, 0x6B } , { 0x006C, 0x6C }, { 0x006D, 0x6D }, { 0x006E, 0x6E }, { 0x006F, 0x6F } , { 0x0070, 0x70 }, { 0x0071, 0x71 }, { 0x0072, 0x72 }, { 0x0073, 0x73 } , { 0x0074, 0x74 }, { 0x0075, 0x75 }, { 0x0076, 0x76 }, { 0x0077, 0x77 } , { 0x0078, 0x78 }, { 0x0079, 0x79 }, { 0x007A, 0x7A }, { 0x007B, 0x7B } , { 0x007C, 0x7C }, { 0x007D, 0x7D }, { 0x007E, 0x7E }, { 0x007F, 0x7F } , { 0x0081, 0x81 }, { 0x008D, 0x8D }, { 0x008F, 0x8F }, { 0x0090, 0x90 } , { 0x009D, 0x9D }, { 0x00A0, 0xA0 }, { 0x00A1, 0xA1 }, { 0x00A2, 0xA2 } , { 0x00A3, 0xA3 }, { 0x00A4, 0xA4 }, { 0x00A5, 0xA5 }, { 0x00A6, 0xA6 } , { 0x00A7, 0xA7 }, { 0x00A8, 0xA8 }, { 0x00A9, 0xA9 }, { 0x00AA, 0xAA } , { 0x00AB, 0xAB }, { 0x00AC, 0xAC }, { 0x00AD, 0xAD }, { 0x00AE, 0xAE } , { 0x00AF, 0xAF }, { 0x00B0, 0xB0 }, { 0x00B1, 0xB1 }, { 0x00B2, 0xB2 } , { 0x00B3, 0xB3 }, { 0x00B4, 0xB4 }, { 0x00B5, 0xB5 }, { 0x00B6, 0xB6 } , { 0x00B7, 0xB7 }, { 0x00B8, 0xB8 }, { 0x00B9, 0xB9 }, { 0x00BA, 0xBA } , { 0x00BB, 0xBB }, { 0x00BC, 0xBC }, { 0x00BD, 0xBD }, { 0x00BE, 0xBE } , { 0x00BF, 0xBF }, { 0x00C0, 0xC0 }, { 0x00C1, 0xC1 }, { 0x00C2, 0xC2 } , { 0x00C3, 0xC3 }, { 0x00C4, 0xC4 }, { 0x00C5, 0xC5 }, { 0x00C6, 0xC6 } , { 0x00C7, 0xC7 }, { 0x00C8, 0xC8 }, { 0x00C9, 0xC9 }, { 0x00CA, 0xCA } , { 0x00CB, 0xCB }, { 0x00CC, 0xCC }, { 0x00CD, 0xCD }, { 0x00CE, 0xCE } , { 0x00CF, 0xCF }, { 0x00D0, 0xD0 }, { 0x00D1, 0xD1 }, { 0x00D2, 0xD2 } , { 0x00D3, 0xD3 }, { 0x00D4, 0xD4 }, { 0x00D5, 0xD5 }, { 0x00D6, 0xD6 } , { 0x00D7, 0xD7 }, { 0x00D8, 0xD8 }, { 0x00D9, 0xD9 }, { 0x00DA, 0xDA } , { 0x00DB, 0xDB }, { 0x00DC, 0xDC }, { 0x00DD, 0xDD }, { 0x00DE, 0xDE } , { 0x00DF, 0xDF }, { 0x00E0, 0xE0 }, { 0x00E1, 0xE1 }, { 0x00E2, 0xE2 } , { 0x00E3, 0xE3 }, { 0x00E4, 0xE4 }, { 0x00E5, 0xE5 }, { 0x00E6, 0xE6 } , { 0x00E7, 0xE7 }, { 0x00E8, 0xE8 }, { 0x00E9, 0xE9 }, { 0x00EA, 0xEA } , { 0x00EB, 0xEB }, { 0x00EC, 0xEC }, { 0x00ED, 0xED }, { 0x00EE, 0xEE } , { 0x00EF, 0xEF }, { 0x00F0, 0xF0 }, { 0x00F1, 0xF1 }, { 0x00F2, 0xF2 } , { 0x00F3, 0xF3 }, { 0x00F4, 0xF4 }, { 0x00F5, 0xF5 }, { 0x00F6, 0xF6 } , { 0x00F7, 0xF7 }, { 0x00F8, 0xF8 }, { 0x00F9, 0xF9 }, { 0x00FA, 0xFA } , { 0x00FB, 0xFB }, { 0x00FC, 0xFC }, { 0x00FD, 0xFD }, { 0x00FE, 0xFE } , { 0x00FF, 0xFF }, { 0x0152, 0x8C }, { 0x0153, 0x9C }, { 0x0160, 0x8A } , { 0x0161, 0x9A }, { 0x0178, 0x9F }, { 0x017D, 0x8E }, { 0x017E, 0x9E } , { 0x0192, 0x83 }, { 0x02C6, 0x88 }, { 0x02DC, 0x98 }, { 0x2013, 0x96 } , { 0x2014, 0x97 }, { 0x2018, 0x91 }, { 0x2019, 0x92 }, { 0x201A, 0x82 } , { 0x201C, 0x93 }, { 0x201D, 0x94 }, { 0x201E, 0x84 }, { 0x2020, 0x86 } , { 0x2021, 0x87 }, { 0x2022, 0x95 }, { 0x2026, 0x85 }, { 0x2030, 0x89 } , { 0x2039, 0x8B }, { 0x203A, 0x9B }, { 0x20AC, 0x80 }, { 0x2122, 0x99 } , { 0xFF01, 0x21 }, { 0xFF02, 0x22 }, { 0xFF03, 0x23 }, { 0xFF04, 0x24 } , { 0xFF05, 0x25 }, { 0xFF06, 0x26 }, { 0xFF07, 0x27 }, { 0xFF08, 0x28 } , { 0xFF09, 0x29 }, { 0xFF0A, 0x2A }, { 0xFF0B, 0x2B }, { 0xFF0C, 0x2C } , { 0xFF0D, 0x2D }, { 0xFF0E, 0x2E }, { 0xFF0F, 0x2F }, { 0xFF10, 0x30 } , { 0xFF11, 0x31 }, { 0xFF12, 0x32 }, { 0xFF13, 0x33 }, { 0xFF14, 0x34 } , { 0xFF15, 0x35 }, { 0xFF16, 0x36 }, { 0xFF17, 0x37 }, { 0xFF18, 0x38 } , { 0xFF19, 0x39 }, { 0xFF1A, 0x3A }, { 0xFF1B, 0x3B }, { 0xFF1C, 0x3C } , { 0xFF1D, 0x3D }, { 0xFF1E, 0x3E }, { 0xFF1F, 0x3F }, { 0xFF20, 0x40 } , { 0xFF21, 0x41 }, { 0xFF22, 0x42 }, { 0xFF23, 0x43 }, { 0xFF24, 0x44 } , { 0xFF25, 0x45 }, { 0xFF26, 0x46 }, { 0xFF27, 0x47 }, { 0xFF28, 0x48 } , { 0xFF29, 0x49 }, { 0xFF2A, 0x4A }, { 0xFF2B, 0x4B }, { 0xFF2C, 0x4C } , { 0xFF2D, 0x4D }, { 0xFF2E, 0x4E }, { 0xFF2F, 0x4F }, { 0xFF30, 0x50 } , { 0xFF31, 0x51 }, { 0xFF32, 0x52 }, { 0xFF33, 0x53 }, { 0xFF34, 0x54 } , { 0xFF35, 0x55 }, { 0xFF36, 0x56 }, { 0xFF37, 0x57 }, { 0xFF38, 0x58 } , { 0xFF39, 0x59 }, { 0xFF3A, 0x5A }, { 0xFF3B, 0x5B }, { 0xFF3C, 0x5C } , { 0xFF3D, 0x5D }, { 0xFF3E, 0x5E }, { 0xFF3F, 0x5F }, { 0xFF40, 0x60 } , { 0xFF41, 0x61 }, { 0xFF42, 0x62 }, { 0xFF43, 0x63 }, { 0xFF44, 0x64 } , { 0xFF45, 0x65 }, { 0xFF46, 0x66 }, { 0xFF47, 0x67 }, { 0xFF48, 0x68 } , { 0xFF49, 0x69 }, { 0xFF4A, 0x6A }, { 0xFF4B, 0x6B }, { 0xFF4C, 0x6C } , { 0xFF4D, 0x6D }, { 0xFF4E, 0x6E }, { 0xFF4F, 0x6F }, { 0xFF50, 0x70 } , { 0xFF51, 0x71 }, { 0xFF52, 0x72 }, { 0xFF53, 0x73 }, { 0xFF54, 0x74 } , { 0xFF55, 0x75 }, { 0xFF56, 0x76 }, { 0xFF57, 0x77 }, { 0xFF58, 0x78 } , { 0xFF59, 0x79 }, { 0xFF5A, 0x7A }, { 0xFF5B, 0x7B }, { 0xFF5C, 0x7C } , { 0xFF5D, 0x7D }, { 0xFF5E, 0x7E } }; static const XMLSize_t gToTableSz = 350; // --------------------------------------------------------------------------- // XML1140Transcoder: Constructors and Destructor // --------------------------------------------------------------------------- XMLWin1252Transcoder::XMLWin1252Transcoder( const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager) : XML256TableTranscoder ( encodingName , blockSize , gFromTable , gToTable , gToTableSz , manager ) { } XMLWin1252Transcoder::~XMLWin1252Transcoder() { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/PanicHandler.hpp000644 000765 000024 00000006066 13241160336 022313 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: PanicHandler.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_PANICHANDLER_HPP) #define XERCESC_INCLUDE_GUARD_PANICHANDLER_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Receive notification of panic. * *

This is the interface, through which the Xercesc reports * a panic to the application. *

* *

Application may implement this interface, instantiate an * object of the derivative, and plug it to Xercesc in the * invocation to XMLPlatformUtils::Initialize(), if it prefers * to handling panic itself rather than Xercesc doing it. *

* */ class XMLUTIL_EXPORT PanicHandler { public: /** @name Public Types */ //@{ enum PanicReasons { Panic_NoTransService , Panic_NoDefTranscoder , Panic_CantFindLib , Panic_UnknownMsgDomain , Panic_CantLoadMsgDomain , Panic_SynchronizationErr , Panic_SystemInit , Panic_AllStaticInitErr , Panic_MutexErr , PanicReasons_Count }; //@} protected: /** @name hidden Constructors */ //@{ /** Default constructor */ PanicHandler(){}; public: /** Destructor */ virtual ~PanicHandler(){}; //@} /** @name The virtual panic handler interface */ //@{ /** * Receive notification of panic * * This method is called when an unrecoverable error has occurred in the Xerces library. * * This method must not return normally, otherwise, the results are undefined. * * Ways of handling this call could include throwing an exception or exiting the process. * * Once this method has been called, the results of calling any other Xerces API, * or using any existing Xerces objects are undefined. * * @param reason The reason of panic * */ virtual void panic(const PanicHandler::PanicReasons reason) = 0; //@} static const char* getPanicReasonString(const PanicHandler::PanicReasons reason); private: /* Unimplemented Constructors and operators */ /* Copy constructor */ PanicHandler(const PanicHandler&); /** Assignment operator */ PanicHandler& operator=(const PanicHandler&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLEBCDICTranscoder.cpp000644 000765 000024 00000026603 13241160335 023273 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local const data // // gFromTable // This is the translation table for IBM037 EBCDIC to Unicode. This // table contains 255 entries. The entry for EBCDIC byte x is the // Unicode translation of that byte. // // gToTable // gToTableSz // This is the translation table for Unicode to IBM037 EBCDIC. This one // contains a list of records, sorted by the Unicode code point. We do // a binary search to find the Unicode point, and that record's other // field is the IBM037 code point to translate to. // --------------------------------------------------------------------------- static const XMLCh gFromTable[256] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x009C, 0x0009, 0x0086, 0x007F , 0x0097, 0x008D, 0x008E, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F , 0x0010, 0x0011, 0x0012, 0x0013, 0x009D, 0x0085, 0x0008, 0x0087 , 0x0018, 0x0019, 0x0092, 0x008F, 0x001C, 0x001D, 0x001E, 0x001F , 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x000A, 0x0017, 0x001B , 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x0005, 0x0006, 0x0007 , 0x0090, 0x0091, 0x0016, 0x0093, 0x0094, 0x0095, 0x0096, 0x0004 , 0x0098, 0x0099, 0x009A, 0x009B, 0x0014, 0x0015, 0x009E, 0x001A , 0x0020, 0x00A0, 0x00E2, 0x00E4, 0x00E0, 0x00E1, 0x00E3, 0x00E5 , 0x00E7, 0x00F1, 0x00A2, 0x002E, 0x003C, 0x0028, 0x002B, 0x007C , 0x0026, 0x00E9, 0x00EA, 0x00EB, 0x00E8, 0x00ED, 0x00EE, 0x00EF , 0x00EC, 0x00DF, 0x0021, 0x0024, 0x002A, 0x0029, 0x003B, 0x00AC , 0x002D, 0x002F, 0x00C2, 0x00C4, 0x00C0, 0x00C1, 0x00C3, 0x00C5 , 0x00C7, 0x00D1, 0x00A6, 0x002C, 0x0025, 0x005F, 0x003E, 0x003F , 0x00F8, 0x00C9, 0x00CA, 0x00CB, 0x00C8, 0x00CD, 0x00CE, 0x00CF , 0x00CC, 0x0060, 0x003A, 0x0023, 0x0040, 0x0027, 0x003D, 0x0022 , 0x00D8, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067 , 0x0068, 0x0069, 0x00AB, 0x00BB, 0x00F0, 0x00FD, 0x00FE, 0x00B1 , 0x00B0, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070 , 0x0071, 0x0072, 0x00AA, 0x00BA, 0x00E6, 0x00B8, 0x00C6, 0x00A4 , 0x00B5, 0x007E, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078 , 0x0079, 0x007A, 0x00A1, 0x00BF, 0x00D0, 0x00DD, 0x00DE, 0x00AE , 0x005E, 0x00A3, 0x00A5, 0x00B7, 0x00A9, 0x00A7, 0x00B6, 0x00BC , 0x00BD, 0x00BE, 0x005B, 0x005D, 0x00AF, 0x00A8, 0x00B4, 0x00D7 , 0x007B, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047 , 0x0048, 0x0049, 0x00AD, 0x00F4, 0x00F6, 0x00F2, 0x00F3, 0x00F5 , 0x007D, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050 , 0x0051, 0x0052, 0x00B9, 0x00FB, 0x00FC, 0x00F9, 0x00FA, 0x00FF , 0x005C, 0x00F7, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058 , 0x0059, 0x005A, 0x00B2, 0x00D4, 0x00D6, 0x00D2, 0x00D3, 0x00D5 , 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037 , 0x0038, 0x0039, 0x00B3, 0x00DB, 0x00DC, 0x00D9, 0x00DA, 0x009F }; static const XMLTransService::TransRec gToTable[] = { { 0x0000, 0x00 }, { 0x0001, 0x01 }, { 0x0002, 0x02 }, { 0x0003, 0x03 } , { 0x0004, 0x37 }, { 0x0005, 0x2D }, { 0x0006, 0x2E }, { 0x0007, 0x2F } , { 0x0008, 0x16 }, { 0x0009, 0x05 }, { 0x000A, 0x25 }, { 0x000B, 0x0B } , { 0x000C, 0x0C }, { 0x000D, 0x0D }, { 0x000E, 0x0E }, { 0x000F, 0x0F } , { 0x0010, 0x10 }, { 0x0011, 0x11 }, { 0x0012, 0x12 }, { 0x0013, 0x13 } , { 0x0014, 0x3C }, { 0x0015, 0x3D }, { 0x0016, 0x32 }, { 0x0017, 0x26 } , { 0x0018, 0x18 }, { 0x0019, 0x19 }, { 0x001A, 0x3F }, { 0x001B, 0x27 } , { 0x001C, 0x1C }, { 0x001D, 0x1D }, { 0x001E, 0x1E }, { 0x001F, 0x1F } , { 0x0020, 0x40 }, { 0x0021, 0x5A }, { 0x0022, 0x7F }, { 0x0023, 0x7B } , { 0x0024, 0x5B }, { 0x0025, 0x6C }, { 0x0026, 0x50 }, { 0x0027, 0x7D } , { 0x0028, 0x4D }, { 0x0029, 0x5D }, { 0x002A, 0x5C }, { 0x002B, 0x4E } , { 0x002C, 0x6B }, { 0x002D, 0x60 }, { 0x002E, 0x4B }, { 0x002F, 0x61 } , { 0x0030, 0xF0 }, { 0x0031, 0xF1 }, { 0x0032, 0xF2 }, { 0x0033, 0xF3 } , { 0x0034, 0xF4 }, { 0x0035, 0xF5 }, { 0x0036, 0xF6 }, { 0x0037, 0xF7 } , { 0x0038, 0xF8 }, { 0x0039, 0xF9 }, { 0x003A, 0x7A }, { 0x003B, 0x5E } , { 0x003C, 0x4C }, { 0x003D, 0x7E }, { 0x003E, 0x6E }, { 0x003F, 0x6F } , { 0x0040, 0x7C }, { 0x0041, 0xC1 }, { 0x0042, 0xC2 }, { 0x0043, 0xC3 } , { 0x0044, 0xC4 }, { 0x0045, 0xC5 }, { 0x0046, 0xC6 }, { 0x0047, 0xC7 } , { 0x0048, 0xC8 }, { 0x0049, 0xC9 }, { 0x004A, 0xD1 }, { 0x004B, 0xD2 } , { 0x004C, 0xD3 }, { 0x004D, 0xD4 }, { 0x004E, 0xD5 }, { 0x004F, 0xD6 } , { 0x0050, 0xD7 }, { 0x0051, 0xD8 }, { 0x0052, 0xD9 }, { 0x0053, 0xE2 } , { 0x0054, 0xE3 }, { 0x0055, 0xE4 }, { 0x0056, 0xE5 }, { 0x0057, 0xE6 } , { 0x0058, 0xE7 }, { 0x0059, 0xE8 }, { 0x005A, 0xE9 }, { 0x005B, 0xBA } , { 0x005C, 0xE0 }, { 0x005D, 0xBB }, { 0x005E, 0xB0 }, { 0x005F, 0x6D } , { 0x0060, 0x79 }, { 0x0061, 0x81 }, { 0x0062, 0x82 }, { 0x0063, 0x83 } , { 0x0064, 0x84 }, { 0x0065, 0x85 }, { 0x0066, 0x86 }, { 0x0067, 0x87 } , { 0x0068, 0x88 }, { 0x0069, 0x89 }, { 0x006A, 0x91 }, { 0x006B, 0x92 } , { 0x006C, 0x93 }, { 0x006D, 0x94 }, { 0x006E, 0x95 }, { 0x006F, 0x96 } , { 0x0070, 0x97 }, { 0x0071, 0x98 }, { 0x0072, 0x99 }, { 0x0073, 0xA2 } , { 0x0074, 0xA3 }, { 0x0075, 0xA4 }, { 0x0076, 0xA5 }, { 0x0077, 0xA6 } , { 0x0078, 0xA7 }, { 0x0079, 0xA8 }, { 0x007A, 0xA9 }, { 0x007B, 0xC0 } , { 0x007C, 0x4F }, { 0x007D, 0xD0 }, { 0x007E, 0xA1 }, { 0x007F, 0x07 } , { 0x0080, 0x20 }, { 0x0081, 0x21 }, { 0x0082, 0x22 }, { 0x0083, 0x23 } , { 0x0084, 0x24 }, { 0x0085, 0x15 }, { 0x0086, 0x06 }, { 0x0087, 0x17 } , { 0x0088, 0x28 }, { 0x0089, 0x29 }, { 0x008A, 0x2A }, { 0x008B, 0x2B } , { 0x008C, 0x2C }, { 0x008D, 0x09 }, { 0x008E, 0x0A }, { 0x008F, 0x1B } , { 0x0090, 0x30 }, { 0x0091, 0x31 }, { 0x0092, 0x1A }, { 0x0093, 0x33 } , { 0x0094, 0x34 }, { 0x0095, 0x35 }, { 0x0096, 0x36 }, { 0x0097, 0x08 } , { 0x0098, 0x38 }, { 0x0099, 0x39 }, { 0x009A, 0x3A }, { 0x009B, 0x3B } , { 0x009C, 0x04 }, { 0x009D, 0x14 }, { 0x009E, 0x3E }, { 0x009F, 0xFF } , { 0x00A0, 0x41 }, { 0x00A1, 0xAA }, { 0x00A2, 0x4A }, { 0x00A3, 0xB1 } , { 0x00A4, 0x9F }, { 0x00A5, 0xB2 }, { 0x00A6, 0x6A }, { 0x00A7, 0xB5 } , { 0x00A8, 0xBD }, { 0x00A9, 0xB4 }, { 0x00AA, 0x9A }, { 0x00AB, 0x8A } , { 0x00AC, 0x5F }, { 0x00AD, 0xCA }, { 0x00AE, 0xAF }, { 0x00AF, 0xBC } , { 0x00B0, 0x90 }, { 0x00B1, 0x8F }, { 0x00B2, 0xEA }, { 0x00B3, 0xFA } , { 0x00B4, 0xBE }, { 0x00B5, 0xA0 }, { 0x00B6, 0xB6 }, { 0x00B7, 0xB3 } , { 0x00B8, 0x9D }, { 0x00B9, 0xDA }, { 0x00BA, 0x9B }, { 0x00BB, 0x8B } , { 0x00BC, 0xB7 }, { 0x00BD, 0xB8 }, { 0x00BE, 0xB9 }, { 0x00BF, 0xAB } , { 0x00C0, 0x64 }, { 0x00C1, 0x65 }, { 0x00C2, 0x62 }, { 0x00C3, 0x66 } , { 0x00C4, 0x63 }, { 0x00C5, 0x67 }, { 0x00C6, 0x9E }, { 0x00C7, 0x68 } , { 0x00C8, 0x74 }, { 0x00C9, 0x71 }, { 0x00CA, 0x72 }, { 0x00CB, 0x73 } , { 0x00CC, 0x78 }, { 0x00CD, 0x75 }, { 0x00CE, 0x76 }, { 0x00CF, 0x77 } , { 0x00D0, 0xAC }, { 0x00D1, 0x69 }, { 0x00D2, 0xED }, { 0x00D3, 0xEE } , { 0x00D4, 0xEB }, { 0x00D5, 0xEF }, { 0x00D6, 0xEC }, { 0x00D7, 0xBF } , { 0x00D8, 0x80 }, { 0x00D9, 0xFD }, { 0x00DA, 0xFE }, { 0x00DB, 0xFB } , { 0x00DC, 0xFC }, { 0x00DD, 0xAD }, { 0x00DE, 0xAE }, { 0x00DF, 0x59 } , { 0x00E0, 0x44 }, { 0x00E1, 0x45 }, { 0x00E2, 0x42 }, { 0x00E3, 0x46 } , { 0x00E4, 0x43 }, { 0x00E5, 0x47 }, { 0x00E6, 0x9C }, { 0x00E7, 0x48 } , { 0x00E8, 0x54 }, { 0x00E9, 0x51 }, { 0x00EA, 0x52 }, { 0x00EB, 0x53 } , { 0x00EC, 0x58 }, { 0x00ED, 0x55 }, { 0x00EE, 0x56 }, { 0x00EF, 0x57 } , { 0x00F0, 0x8C }, { 0x00F1, 0x49 }, { 0x00F2, 0xCD }, { 0x00F3, 0xCE } , { 0x00F4, 0xCB }, { 0x00F5, 0xCF }, { 0x00F6, 0xCC }, { 0x00F7, 0xE1 } , { 0x00F8, 0x70 }, { 0x00F9, 0xDD }, { 0x00FA, 0xDE }, { 0x00FB, 0xDB } , { 0x00FC, 0xDC }, { 0x00FD, 0x8D }, { 0x00FE, 0x8E }, { 0x00FF, 0xDF } , { 0x0110, 0xAC }, { 0x203E, 0xBC }, { 0xFF01, 0x5A }, { 0xFF02, 0x7F } , { 0xFF03, 0x7B }, { 0xFF04, 0x5B }, { 0xFF05, 0x6C }, { 0xFF06, 0x50 } , { 0xFF07, 0x7D }, { 0xFF08, 0x4D }, { 0xFF09, 0x5D }, { 0xFF0A, 0x5C } , { 0xFF0B, 0x4E }, { 0xFF0C, 0x6B }, { 0xFF0D, 0x60 }, { 0xFF0E, 0x4B } , { 0xFF0F, 0x61 }, { 0xFF10, 0xF0 }, { 0xFF11, 0xF1 }, { 0xFF12, 0xF2 } , { 0xFF13, 0xF3 }, { 0xFF14, 0xF4 }, { 0xFF15, 0xF5 }, { 0xFF16, 0xF6 } , { 0xFF17, 0xF7 }, { 0xFF18, 0xF8 }, { 0xFF19, 0xF9 }, { 0xFF1A, 0x7A } , { 0xFF1B, 0x5E }, { 0xFF1C, 0x4C }, { 0xFF1D, 0x7E }, { 0xFF1E, 0x6E } , { 0xFF1F, 0x6F }, { 0xFF20, 0x7C }, { 0xFF21, 0xC1 }, { 0xFF22, 0xC2 } , { 0xFF23, 0xC3 }, { 0xFF24, 0xC4 }, { 0xFF25, 0xC5 }, { 0xFF26, 0xC6 } , { 0xFF27, 0xC7 }, { 0xFF28, 0xC8 }, { 0xFF29, 0xC9 }, { 0xFF2A, 0xD1 } , { 0xFF2B, 0xD2 }, { 0xFF2C, 0xD3 }, { 0xFF2D, 0xD4 }, { 0xFF2E, 0xD5 } , { 0xFF2F, 0xD6 }, { 0xFF30, 0xD7 }, { 0xFF31, 0xD8 }, { 0xFF32, 0xD9 } , { 0xFF33, 0xE2 }, { 0xFF34, 0xE3 }, { 0xFF35, 0xE4 }, { 0xFF36, 0xE5 } , { 0xFF37, 0xE6 }, { 0xFF38, 0xE7 }, { 0xFF39, 0xE8 }, { 0xFF3A, 0xE9 } , { 0xFF3B, 0xBA }, { 0xFF3C, 0xE0 }, { 0xFF3D, 0xBB }, { 0xFF3E, 0xB0 } , { 0xFF3F, 0x6D }, { 0xFF40, 0x79 }, { 0xFF41, 0x81 }, { 0xFF42, 0x82 } , { 0xFF43, 0x83 }, { 0xFF44, 0x84 }, { 0xFF45, 0x85 }, { 0xFF46, 0x86 } , { 0xFF47, 0x87 }, { 0xFF48, 0x88 }, { 0xFF49, 0x89 }, { 0xFF4A, 0x91 } , { 0xFF4B, 0x92 }, { 0xFF4C, 0x93 }, { 0xFF4D, 0x94 }, { 0xFF4E, 0x95 } , { 0xFF4F, 0x96 }, { 0xFF50, 0x97 }, { 0xFF51, 0x98 }, { 0xFF52, 0x99 } , { 0xFF53, 0xA2 }, { 0xFF54, 0xA3 }, { 0xFF55, 0xA4 }, { 0xFF56, 0xA5 } , { 0xFF57, 0xA6 }, { 0xFF58, 0xA7 }, { 0xFF59, 0xA8 }, { 0xFF5A, 0xA9 } , { 0xFF5B, 0xC0 }, { 0xFF5C, 0x4F }, { 0xFF5D, 0xD0 }, { 0xFF5E, 0xA1 } }; static const XMLSize_t gToTableSz = sizeof(gToTable)/sizeof(gToTable[0]); // --------------------------------------------------------------------------- // XMLEBCDICTranscoder: Public, static methods // --------------------------------------------------------------------------- XMLCh XMLEBCDICTranscoder::xlatThisOne(const XMLByte toXlat) { return gFromTable[toXlat]; } // --------------------------------------------------------------------------- // XMLEBCDICTranscoder: Constructors and Destructor // --------------------------------------------------------------------------- XMLEBCDICTranscoder::XMLEBCDICTranscoder(const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager) : XML256TableTranscoder ( encodingName , blockSize , gFromTable , gToTable , gToTableSz , manager ) { } XMLEBCDICTranscoder::~XMLEBCDICTranscoder() { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/NullPointerException.hpp000644 000765 000024 00000002262 13241160336 024107 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: NullPointerException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_NULLPOINTEREXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_NULLPOINTEREXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(NullPointerException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/QName.cpp000644 000765 000024 00000030642 13241160336 020754 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: QName.cpp 1798768 2017-06-14 21:29:12Z rleigh $ */ #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // QName: Constructors and Destructor // --------------------------------------------------------------------------- QName::QName(MemoryManager* const manager) :fPrefixBufSz(0) ,fLocalPartBufSz(0) ,fRawNameBufSz(0) ,fURIId(0) ,fPrefix(0) ,fLocalPart(0) ,fRawName(0) ,fMemoryManager(manager) { } typedef JanitorMemFunCall CleanupType; QName::QName( const XMLCh* const prefix , const XMLCh* const localPart , const unsigned int uriId , MemoryManager* const manager) :fPrefixBufSz(0) ,fLocalPartBufSz(0) ,fRawNameBufSz(0) ,fURIId(0) ,fPrefix(0) ,fLocalPart(0) ,fRawName(0) ,fMemoryManager(manager) { CleanupType cleanup(this, &QName::cleanUp); try { // // Just call the local setters to set up everything. Too much // work is required to replicate that functionality here. // setName(prefix, localPart, uriId); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } QName::QName( const XMLCh* const rawName , const unsigned int uriId , MemoryManager* const manager) :fPrefixBufSz(0) ,fLocalPartBufSz(0) ,fRawNameBufSz(0) ,fURIId(0) ,fPrefix(0) ,fLocalPart(0) ,fRawName(0) ,fMemoryManager(manager) { CleanupType cleanup(this, &QName::cleanUp); try { // // Just call the local setters to set up everything. Too much // work is required to replicate that functionality here. // setName(rawName, uriId); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } QName::~QName() { cleanUp(); } // --------------------------------------------------------------------------- // QName: Copy Constructors // --------------------------------------------------------------------------- QName::QName(const QName& qname) :XSerializable(qname) ,XMemory(qname) ,fPrefixBufSz(0) ,fLocalPartBufSz(0) ,fRawNameBufSz(0) ,fURIId(0) ,fPrefix(0) ,fLocalPart(0) ,fRawName(0) ,fMemoryManager(qname.fMemoryManager) { XMLSize_t newLen; newLen = XMLString::stringLen(qname.getLocalPart()); fLocalPartBufSz = newLen + 8; fLocalPart = (XMLCh*) fMemoryManager->allocate ( (fLocalPartBufSz + 1) * sizeof(XMLCh) ); //new XMLCh[fLocalPartBufSz + 1]; XMLString::moveChars(fLocalPart, qname.getLocalPart(), newLen + 1); newLen = XMLString::stringLen(qname.getPrefix()); fPrefixBufSz = newLen + 8; fPrefix = (XMLCh*) fMemoryManager->allocate ( (fPrefixBufSz + 1) * sizeof(XMLCh) ); //new XMLCh[fPrefixBufSz + 1]; XMLString::moveChars(fPrefix, qname.getPrefix(), newLen + 1); fURIId = qname.getURI(); } // --------------------------------------------------------------------------- // QName: Getter methods // --------------------------------------------------------------------------- const XMLCh* QName::getRawName() const { // // If there is no buffer, or if there is but we've not faulted in the // value yet, then we have to do that now. // if (!fRawName || !*fRawName) { // // If we have a prefix, then do the prefix:name version. Else, its // just the name. // if (*fPrefix) { // // Calculate the worst case size buffer we will need. We use the // current high water marks of the prefix and name buffers, so it // might be a little wasteful of memory but we don't have to do // string len operations on the two strings. // const XMLSize_t neededLen = fPrefixBufSz + fLocalPartBufSz + 1; // // If no buffer, or the current one is too small, then allocate one // and get rid of any old one. // if (!fRawName || (neededLen > fRawNameBufSz)) { fMemoryManager->deallocate(fRawName); //delete [] fRawName; (const_cast(this))->fRawName = 0; // We have to cast off the const'ness to do this (const_cast(this))->fRawNameBufSz = neededLen; (const_cast(this))->fRawName = (XMLCh*) fMemoryManager->allocate ( (neededLen + 1) * sizeof(XMLCh) ); //new XMLCh[neededLen + 1]; // Make sure its initially empty *fRawName = 0; } const XMLSize_t prefixLen = XMLString::stringLen(fPrefix); XMLString::moveChars(fRawName, fPrefix, prefixLen); fRawName[prefixLen] = chColon; XMLString::copyString(&fRawName[prefixLen+1], fLocalPart); } else { return fLocalPart; } } return fRawName; } XMLCh* QName::getRawName() { // // If there is no buffer, or if there is but we've not faulted in the // value yet, then we have to do that now. // if (!fRawName || !*fRawName) { // // If we have a prefix, then do the prefix:name version. Else, its // just the name. // if (*fPrefix) { // // Calculate the worst case size buffer we will need. We use the // current high water marks of the prefix and name buffers, so it // might be a little wasteful of memory but we don't have to do // string len operations on the two strings. // const XMLSize_t neededLen = fPrefixBufSz + fLocalPartBufSz + 1; // // If no buffer, or the current one is too small, then allocate one // and get rid of any old one. // if (!fRawName || (neededLen > fRawNameBufSz)) { fMemoryManager->deallocate(fRawName); //delete [] fRawName; fRawName = 0; // We have to cast off the const'ness to do this (const_cast(this))->fRawNameBufSz = neededLen; (const_cast(this))->fRawName = (XMLCh*) fMemoryManager->allocate ( (neededLen + 1) * sizeof(XMLCh) ); //new XMLCh[neededLen + 1]; // Make sure its initially empty *fRawName = 0; } const XMLSize_t prefixLen = XMLString::stringLen(fPrefix); XMLString::moveChars(fRawName, fPrefix, prefixLen); fRawName[prefixLen] = chColon; XMLString::copyString(&fRawName[prefixLen+1], fLocalPart); } else { return fLocalPart; } } return fRawName; } // --------------------------------------------------------------------------- // QName: Setter methods // --------------------------------------------------------------------------- void QName::setName(const XMLCh* const prefix , const XMLCh* const localPart , const unsigned int uriId) { setPrefix(prefix); setLocalPart(localPart); // And clean up any QName and leave it undone until/if asked for again if (fRawName) *fRawName = 0; // And finally store the URI id parameter fURIId = uriId; } void QName::setName(const XMLCh* const rawName , const unsigned int uriId) { //set the rawName XMLSize_t newLen = XMLString::stringLen(rawName); //find out the prefix and localPart from the rawName const int colonInd = XMLString::indexOf(rawName, chColon); if (colonInd >= 0) { if (!fRawNameBufSz || (newLen > fRawNameBufSz)) { fMemoryManager->deallocate(fRawName); //delete [] fRawName; fRawName = 0; fRawNameBufSz = newLen + 8; fRawName = (XMLCh*) fMemoryManager->allocate ( (fRawNameBufSz + 1) * sizeof(XMLCh) ); //new XMLCh[fRawNameBufSz + 1]; } XMLString::moveChars(fRawName, rawName, newLen + 1); setNPrefix(rawName, colonInd); } else { // No colon, so we just have a name with no prefix setNPrefix(XMLUni::fgZeroLenString, 0); // And clean up any QName and leave it undone until/if asked for again if (fRawName) *fRawName = 0; } setNLocalPart(&rawName[colonInd+1], newLen-colonInd-1); // And finally store the URI id parameter fURIId = uriId; } void QName::setNPrefix(const XMLCh* prefix, const XMLSize_t newLen) { if (!fPrefixBufSz || (newLen > fPrefixBufSz)) { fMemoryManager->deallocate(fPrefix); //delete [] fPrefix; fPrefix = 0; fPrefixBufSz = newLen + 8; fPrefix = (XMLCh*) fMemoryManager->allocate ( (fPrefixBufSz + 1) * sizeof(XMLCh) ); //new XMLCh[fPrefixBufSz + 1]; } XMLString::moveChars(fPrefix, prefix, newLen); fPrefix[newLen] = chNull; } void QName::setNLocalPart(const XMLCh* localPart, const XMLSize_t newLen) { if (!fLocalPartBufSz || (newLen > fLocalPartBufSz)) { fMemoryManager->deallocate(fLocalPart); //delete [] fLocalPart; fLocalPart = 0; fLocalPartBufSz = newLen + 8; fLocalPart = (XMLCh*) fMemoryManager->allocate ( (fLocalPartBufSz + 1) * sizeof(XMLCh) ); //new XMLCh[fLocalPartBufSz + 1]; } XMLString::moveChars(fLocalPart, localPart, newLen); fLocalPart[newLen] = chNull; } void QName::setValues(const QName& qname) { setPrefix(qname.getPrefix()); setLocalPart(qname.getLocalPart()); setURI(qname.getURI()); } // ----------------------------------------------------------------------- // comparison // ----------------------------------------------------------------------- bool QName::operator==(const QName& qname) const { // if we are an unitialized QName, check that the other is unitialized too if (!fLocalPart && !fPrefix) return !qname.fLocalPart && !qname.fPrefix; if (fURIId == 0) // null URI return (XMLString::equals(getRawName(),qname.getRawName())); return ((fURIId == qname.getURI()) && (XMLString::equals(fLocalPart, qname.getLocalPart()))); } // --------------------------------------------------------------------------- // QName: Private, helper methods // --------------------------------------------------------------------------- void QName::cleanUp() { fMemoryManager->deallocate(fLocalPart); //delete [] fLocalPart; fMemoryManager->deallocate(fPrefix); //delete [] fPrefix; fMemoryManager->deallocate(fRawName); //delete [] fRawName; fLocalPart = fPrefix = fRawName = 0; } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(QName) void QName::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng.writeString(fPrefix, fPrefixBufSz, XSerializeEngine::toWriteBufferLen); serEng.writeString(fLocalPart, fLocalPartBufSz, XSerializeEngine::toWriteBufferLen); //do not serialize rawName serEng<>fURIId; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/UnsupportedEncodingException.hpp000644 000765 000024 00000002321 13241160335 025626 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: UnsupportedEncodingException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_UNSUPPORTEDENCODINGEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_UNSUPPORTEDENCODINGEXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(UnsupportedEncodingException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLUri.hpp000644 000765 000024 00000052462 13241160336 021104 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLUri.hpp 1798769 2017-06-14 21:30:14Z rleigh $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLURI_HPP) #define XERCESC_INCLUDE_GUARD_XMLURI_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN /* * This class is a direct port of Java's URI class, to distinguish * itself from the XMLURL, we use the name XMLUri instead of * XMLURI. * * TODO: how to relate XMLUri and XMLURL since URL is part of URI. * */ class XMLUTIL_EXPORT XMLUri : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** * Construct a new URI from a URI specification string. * * If the specification follows the "generic URI" syntax, (two slashes * following the first colon), the specification will be parsed * accordingly - setting the * scheme, * userinfo, * host, * port, * path, * querystring and * fragment * fields as necessary. * * If the specification does not follow the "generic URI" syntax, * the specification is parsed into a * scheme and * scheme-specific part (stored as the path) only. * * @param uriSpec the URI specification string (cannot be null or empty) * * @param manager Pointer to the memory manager to be used to * allocate objects. * * ctor# 2 * */ XMLUri(const XMLCh* const uriSpec, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Construct a new URI from a base URI and a URI specification string. * The URI specification string may be a relative URI. * * @param baseURI the base URI (cannot be null if uriSpec is null or * empty) * * @param uriSpec the URI specification string (cannot be null or * empty if base is null) * * @param manager Pointer to the memory manager to be used to * allocate objects. * * ctor# 7 relative ctor * */ XMLUri(const XMLUri* const baseURI , const XMLCh* const uriSpec , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Copy constructor */ XMLUri(const XMLUri& toCopy); XMLUri& operator=(const XMLUri& toAssign); virtual ~XMLUri(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** * Get the URI as a string specification. See RFC 2396 Section 5.2. * * @return the URI string specification */ const XMLCh* getUriText() const; /** * Get the scheme for this URI. * * @return the scheme for this URI */ const XMLCh* getScheme() const; /** * Get the userinfo for this URI. * * @return the userinfo for this URI (null if not specified). */ const XMLCh* getUserInfo() const; /** * Get the host for this URI. * * @return the host for this URI (null if not specified). */ const XMLCh* getHost() const; /** * Get the port for this URI. * * @return the port for this URI (-1 if not specified). */ int getPort() const; /** * Get the registry based authority for this URI. * * @return the registry based authority (null if not specified). */ const XMLCh* getRegBasedAuthority() const; /** * Get the path for this URI. Note that the value returned is the path * only and does not include the query string or fragment. * * @return the path for this URI. */ const XMLCh* getPath() const; /** * Get the query string for this URI. * * @return the query string for this URI. Null is returned if there * was no "?" in the URI spec, empty string if there was a * "?" but no query string following it. */ const XMLCh* getQueryString() const; /** * Get the fragment for this URI. * * @return the fragment for this URI. Null is returned if there * was no "#" in the URI spec, empty string if there was a * "#" but no fragment following it. */ const XMLCh* getFragment() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** * Set the scheme for this URI. The scheme is converted to lowercase * before it is set. * * @param newScheme the scheme for this URI (cannot be null) * */ void setScheme(const XMLCh* const newScheme); /** * Set the userinfo for this URI. If a non-null value is passed in and * the host value is null, then an exception is thrown. * * @param newUserInfo the userinfo for this URI * */ void setUserInfo(const XMLCh* const newUserInfo); /** * Set the host for this URI. If null is passed in, the userinfo * field is also set to null and the port is set to -1. * * Note: This method overwrites registry based authority if it * previously existed in this URI. * * @param newHost the host for this URI * */ void setHost(const XMLCh* const newHost); /** * Set the port for this URI. -1 is used to indicate that the port is * not specified, otherwise valid port numbers are between 0 and 65535. * If a valid port number is passed in and the host field is null, * an exception is thrown. * * @param newPort the port number for this URI * */ void setPort(int newPort); /** * Sets the registry based authority for this URI. * * Note: This method overwrites server based authority * if it previously existed in this URI. * * @param newRegAuth the registry based authority for this URI */ void setRegBasedAuthority(const XMLCh* const newRegAuth); /** * Set the path for this URI. * * If the supplied path is null, then the * query string and fragment are set to null as well. * * If the supplied path includes a query string and/or fragment, * these fields will be parsed and set as well. * * Note: * * For URIs following the "generic URI" syntax, the path * specified should start with a slash. * * For URIs that do not follow the generic URI syntax, this method * sets the scheme-specific part. * * @param newPath the path for this URI (may be null) * */ void setPath(const XMLCh* const newPath); /** * Set the query string for this URI. A non-null value is valid only * if this is an URI conforming to the generic URI syntax and * the path value is not null. * * @param newQueryString the query string for this URI * */ void setQueryString(const XMLCh* const newQueryString); /** * Set the fragment for this URI. A non-null value is valid only * if this is a URI conforming to the generic URI syntax and * the path value is not null. * * @param newFragment the fragment for this URI * */ void setFragment(const XMLCh* const newFragment); // ----------------------------------------------------------------------- // Miscellaneous methods // ----------------------------------------------------------------------- /** * Determine whether a given string contains only URI characters (also * called "uric" in RFC 2396). uric consist of all reserved * characters, unreserved characters and escaped characters. * * @return true if the string is comprised of uric, false otherwise */ static bool isURIString(const XMLCh* const uric); /** * Determine whether a given string is a valid URI */ static bool isValidURI( const XMLUri* const baseURI , const XMLCh* const uriStr , bool bAllowSpaces=false); /** * Determine whether a given string is a valid URI */ static bool isValidURI( bool haveBaseURI , const XMLCh* const uriStr , bool bAllowSpaces=false); static void normalizeURI(const XMLCh* const systemURI, XMLBuffer& normalizedURI); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLUri) XMLUri(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); private: static const XMLCh MARK_OR_RESERVED_CHARACTERS[]; static const XMLCh RESERVED_CHARACTERS[]; static const XMLCh MARK_CHARACTERS[]; static const XMLCh SCHEME_CHARACTERS[]; static const XMLCh USERINFO_CHARACTERS[]; static const XMLCh REG_NAME_CHARACTERS[]; static const XMLCh PATH_CHARACTERS[]; //helper method for getUriText void buildFullText(); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- /** * Determine whether a character is a reserved character: * * @return true if the string contains any reserved characters */ static bool isReservedCharacter(const XMLCh theChar); /** * Determine whether a character is a path character: * * @return true if the character is path character */ static bool isPathCharacter(const XMLCh theChar); /** * Determine whether a char is an unreserved character. * * @return true if the char is unreserved, false otherwise */ static bool isUnreservedCharacter(const XMLCh theChar); /** * Determine whether a char is an reserved or unreserved character. * * @return true if the char is reserved or unreserved, false otherwise */ static bool isReservedOrUnreservedCharacter(const XMLCh theChar); /** * Determine whether a scheme conforms to the rules for a scheme name. * A scheme is conformant if it starts with an alphanumeric, and * contains only alphanumerics, '+','-' and '.'. * * @return true if the scheme is conformant, false otherwise */ static bool isConformantSchemeName(const XMLCh* const scheme); /** * Determine whether a userInfo conforms to the rules for a userinfo. * * @return true if the scheme is conformant, false otherwise */ static void isConformantUserInfo(const XMLCh* const userInfo , MemoryManager* const manager); /** * Determines whether the components host, port, and user info * are valid as a server authority. * * @return true if the given host, port, and userinfo compose * a valid server authority */ static bool isValidServerBasedAuthority(const XMLCh* const host , const XMLSize_t hostLen , const int port , const XMLCh* const userinfo , const XMLSize_t userLen); /** * Determines whether the components host, port, and user info * are valid as a server authority. * * @return true if the given host, port, and userinfo compose * a valid server authority */ static bool isValidServerBasedAuthority(const XMLCh* const host , const int port , const XMLCh* const userinfo , MemoryManager* const manager); /** * Determines whether the given string is a registry based authority. * * @param authority the authority component of a URI * * @return true if the given string is a registry based authority */ static bool isValidRegistryBasedAuthority(const XMLCh* const authority , const XMLSize_t authLen); /** * Determines whether the given string is a registry based authority. * * @param authority the authority component of a URI * * @return true if the given string is a registry based authority */ static bool isValidRegistryBasedAuthority(const XMLCh* const authority); /** * Determine whether a string is syntactically capable of representing * a valid IPv4 address, IPv6 reference or the domain name of a network host. * * A valid IPv4 address consists of four decimal digit groups * separated by a '.'. * * See RFC 2732 Section 3, and RFC 2373 Section 2.2, for the * definition of IPv6 references. * * A hostname consists of domain labels (each of which must begin and * end with an alphanumeric but may contain '-') separated by a '.'. * See RFC 2396 Section 3.2.2. * * @return true if the string is a syntactically valid IPv4 address * or hostname */ static bool isWellFormedAddress(const XMLCh* const addr , MemoryManager* const manager); /** * Determines whether a string is an IPv4 address as defined by * RFC 2373, and under the further constraint that it must be a 32-bit * address. Though not expressed in the grammar, in order to satisfy * the 32-bit address constraint, each segment of the address cannot * be greater than 255 (8 bits of information). * * @return true if the string is a syntactically valid IPv4 address */ static bool isWellFormedIPv4Address(const XMLCh* const addr, const XMLSize_t length); /** * Determines whether a string is an IPv6 reference as defined * by RFC 2732, where IPv6address is defined in RFC 2373. The * IPv6 address is parsed according to Section 2.2 of RFC 2373, * with the additional constraint that the address be composed of * 128 bits of information. * * Note: The BNF expressed in RFC 2373 Appendix B does not * accurately describe section 2.2, and was in fact removed from * RFC 3513, the successor of RFC 2373. * * @return true if the string is a syntactically valid IPv6 reference */ static bool isWellFormedIPv6Reference(const XMLCh* const addr, const XMLSize_t length); /** * Helper function for isWellFormedIPv6Reference which scans the * hex sequences of an IPv6 address. It returns the index of the * next character to scan in the address, or -1 if the string * cannot match a valid IPv6 address. * * @param address the string to be scanned * @param index the beginning index (inclusive) * @param end the ending index (exclusive) * @param counter a counter for the number of 16-bit sections read * in the address * * @return the index of the next character to scan, or -1 if the * string cannot match a valid IPv6 address */ static int scanHexSequence (const XMLCh* const addr, XMLSize_t index, XMLSize_t end, int& counter); /** * Get the indicator as to whether this URI uses the "generic URI" * syntax. * * @return true if this URI uses the "generic URI" syntax, false * otherwise */ bool isGenericURI(); // ----------------------------------------------------------------------- // Miscellaneous methods // ----------------------------------------------------------------------- /** * Initialize all fields of this URI from another URI. * * @param toCopy the URI to copy (cannot be null) */ void initialize(const XMLUri& toCopy); /** * Initializes this URI from a base URI and a URI specification string. * See RFC 2396 Section 4 and Appendix B for specifications on parsing * the URI and Section 5 for specifications on resolving relative URIs * and relative paths. * * @param baseURI the base URI (may be null if uriSpec is an absolute * URI) * * @param uriSpec the URI spec string which may be an absolute or * relative URI (can only be null/empty if base * is not null) * */ void initialize(const XMLUri* const baseURI , const XMLCh* const uriSpec); /** * Initialize the scheme for this URI from a URI string spec. * * @param uriSpec the URI specification (cannot be null) * */ void initializeScheme(const XMLCh* const uriSpec); /** * Initialize the authority (userinfo, host and port) for this * URI from a URI string spec. * * @param uriSpec the URI specification (cannot be null) * */ void initializeAuthority(const XMLCh* const uriSpec); /** * Initialize the path for this URI from a URI string spec. * * @param uriSpec the URI specification (cannot be null) * */ void initializePath(const XMLCh* const uriSpec); /** * cleanup the data variables * */ void cleanUp(); static bool isConformantSchemeName(const XMLCh* const scheme, const XMLSize_t schemeLen); static bool processScheme(const XMLCh* const uriStr, XMLSize_t& index); static bool processAuthority(const XMLCh* const uriStr, const XMLSize_t authLen); static bool isWellFormedAddress(const XMLCh* const addr, const XMLSize_t addrLen); static bool processPath(const XMLCh* const pathStr, const XMLSize_t pathStrLen, const bool isSchemePresent, const bool bAllowSpaces=false); // ----------------------------------------------------------------------- // Data members // // for all the data member, we own it, // responsible for the creation and/or deletion for // the memory allocated. // // ----------------------------------------------------------------------- int fPort; XMLCh* fScheme; XMLCh* fUserInfo; XMLCh* fHost; XMLCh* fRegAuth; XMLCh* fPath; XMLCh* fQueryString; XMLCh* fFragment; XMLCh* fURIText; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // XMLUri: Getter methods // --------------------------------------------------------------------------- inline const XMLCh* XMLUri::getScheme() const { return fScheme; } inline const XMLCh* XMLUri::getUserInfo() const { return fUserInfo; } inline const XMLCh* XMLUri::getHost() const { return fHost; } inline int XMLUri::getPort() const { return fPort; } inline const XMLCh* XMLUri::getRegBasedAuthority() const { return fRegAuth; } inline const XMLCh* XMLUri::getPath() const { return fPath; } inline const XMLCh* XMLUri::getQueryString() const { return fQueryString; } inline const XMLCh* XMLUri::getFragment() const { return fFragment; } inline const XMLCh* XMLUri::getUriText() const { // // Fault it in if not already. Since this is a const method and we // can't use mutable members due the compilers we have to support, // we have to cast off the constness. // if (!fURIText) (const_cast(this))->buildFullText(); return fURIText; } // --------------------------------------------------------------------------- // XMLUri: Helper methods // --------------------------------------------------------------------------- inline bool XMLUri::isReservedOrUnreservedCharacter(const XMLCh theChar) { return (XMLString::isAlphaNum(theChar) || XMLString::indexOf(MARK_OR_RESERVED_CHARACTERS, theChar) != -1); } inline bool XMLUri::isReservedCharacter(const XMLCh theChar) { return (XMLString::indexOf(RESERVED_CHARACTERS, theChar) != -1); } inline bool XMLUri::isPathCharacter(const XMLCh theChar) { return (XMLString::indexOf(PATH_CHARACTERS, theChar) != -1); } inline bool XMLUri::isUnreservedCharacter(const XMLCh theChar) { return (XMLString::isAlphaNum(theChar) || XMLString::indexOf(MARK_CHARACTERS, theChar) != -1); } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLIBM1140Transcoder.cpp000644 000765 000024 00000026663 13241160336 023306 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local const data // // NOTE: These tables are generated from the ICU UCM files, using the // // gFromTable // This is the translation table for IBM1140 EBCDIC to Unicode. This // table contains 255 entries. The entry for EBCDIC byte x is the // Unicode translation of that byte. // // gToTable // gToTableSize // This is the translation table for Unicode to IBM1140 EBCDIC. This one // contains a list of records, sorted by the Unicode code point. We do // a binary search to find the Unicode point, and that record's other // field is the IBM1140 code point to translate to. // --------------------------------------------------------------------------- static const XMLCh gFromTable[256] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x009C, 0x0009, 0x0086, 0x007F , 0x0097, 0x008D, 0x008E, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F , 0x0010, 0x0011, 0x0012, 0x0013, 0x009D, 0x0085, 0x0008, 0x0087 , 0x0018, 0x0019, 0x0092, 0x008F, 0x001C, 0x001D, 0x001E, 0x001F , 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x000A, 0x0017, 0x001B , 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x0005, 0x0006, 0x0007 , 0x0090, 0x0091, 0x0016, 0x0093, 0x0094, 0x0095, 0x0096, 0x0004 , 0x0098, 0x0099, 0x009A, 0x009B, 0x0014, 0x0015, 0x009E, 0x001A , 0x0020, 0x00A0, 0x00E2, 0x00E4, 0x00E0, 0x00E1, 0x00E3, 0x00E5 , 0x00E7, 0x00F1, 0x00A2, 0x002E, 0x003C, 0x0028, 0x002B, 0x007C , 0x0026, 0x00E9, 0x00EA, 0x00EB, 0x00E8, 0x00ED, 0x00EE, 0x00EF , 0x00EC, 0x00DF, 0x0021, 0x0024, 0x002A, 0x0029, 0x003B, 0x00AC , 0x002D, 0x002F, 0x00C2, 0x00C4, 0x00C0, 0x00C1, 0x00C3, 0x00C5 , 0x00C7, 0x00D1, 0x00A6, 0x002C, 0x0025, 0x005F, 0x003E, 0x003F , 0x00F8, 0x00C9, 0x00CA, 0x00CB, 0x00C8, 0x00CD, 0x00CE, 0x00CF , 0x00CC, 0x0060, 0x003A, 0x0023, 0x0040, 0x0027, 0x003D, 0x0022 , 0x00D8, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067 , 0x0068, 0x0069, 0x00AB, 0x00BB, 0x00F0, 0x00FD, 0x00FE, 0x00B1 , 0x00B0, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070 , 0x0071, 0x0072, 0x00AA, 0x00BA, 0x00E6, 0x00B8, 0x00C6, 0x20AC , 0x00B5, 0x007E, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078 , 0x0079, 0x007A, 0x00A1, 0x00BF, 0x00D0, 0x00DD, 0x00DE, 0x00AE , 0x005E, 0x00A3, 0x00A5, 0x00B7, 0x00A9, 0x00A7, 0x00B6, 0x00BC , 0x00BD, 0x00BE, 0x005B, 0x005D, 0x00AF, 0x00A8, 0x00B4, 0x00D7 , 0x007B, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047 , 0x0048, 0x0049, 0x00AD, 0x00F4, 0x00F6, 0x00F2, 0x00F3, 0x00F5 , 0x007D, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050 , 0x0051, 0x0052, 0x00B9, 0x00FB, 0x00FC, 0x00F9, 0x00FA, 0x00FF , 0x005C, 0x00F7, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058 , 0x0059, 0x005A, 0x00B2, 0x00D4, 0x00D6, 0x00D2, 0x00D3, 0x00D5 , 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037 , 0x0038, 0x0039, 0x00B3, 0x00DB, 0x00DC, 0x00D9, 0x00DA, 0x009F }; static const XMLTransService::TransRec gToTable[] = { { 0x0000, 0x00 }, { 0x0001, 0x01 }, { 0x0002, 0x02 }, { 0x0003, 0x03 } , { 0x0004, 0x37 }, { 0x0005, 0x2D }, { 0x0006, 0x2E }, { 0x0007, 0x2F } , { 0x0008, 0x16 }, { 0x0009, 0x05 }, { 0x000A, 0x25 }, { 0x000B, 0x0B } , { 0x000C, 0x0C }, { 0x000D, 0x0D }, { 0x000E, 0x0E }, { 0x000F, 0x0F } , { 0x0010, 0x10 }, { 0x0011, 0x11 }, { 0x0012, 0x12 }, { 0x0013, 0x13 } , { 0x0014, 0x3C }, { 0x0015, 0x3D }, { 0x0016, 0x32 }, { 0x0017, 0x26 } , { 0x0018, 0x18 }, { 0x0019, 0x19 }, { 0x001A, 0x3F }, { 0x001B, 0x27 } , { 0x001C, 0x1C }, { 0x001D, 0x1D }, { 0x001E, 0x1E }, { 0x001F, 0x1F } , { 0x0020, 0x40 }, { 0x0021, 0x5A }, { 0x0022, 0x7F }, { 0x0023, 0x7B } , { 0x0024, 0x5B }, { 0x0025, 0x6C }, { 0x0026, 0x50 }, { 0x0027, 0x7D } , { 0x0028, 0x4D }, { 0x0029, 0x5D }, { 0x002A, 0x5C }, { 0x002B, 0x4E } , { 0x002C, 0x6B }, { 0x002D, 0x60 }, { 0x002E, 0x4B }, { 0x002F, 0x61 } , { 0x0030, 0xF0 }, { 0x0031, 0xF1 }, { 0x0032, 0xF2 }, { 0x0033, 0xF3 } , { 0x0034, 0xF4 }, { 0x0035, 0xF5 }, { 0x0036, 0xF6 }, { 0x0037, 0xF7 } , { 0x0038, 0xF8 }, { 0x0039, 0xF9 }, { 0x003A, 0x7A }, { 0x003B, 0x5E } , { 0x003C, 0x4C }, { 0x003D, 0x7E }, { 0x003E, 0x6E }, { 0x003F, 0x6F } , { 0x0040, 0x7C }, { 0x0041, 0xC1 }, { 0x0042, 0xC2 }, { 0x0043, 0xC3 } , { 0x0044, 0xC4 }, { 0x0045, 0xC5 }, { 0x0046, 0xC6 }, { 0x0047, 0xC7 } , { 0x0048, 0xC8 }, { 0x0049, 0xC9 }, { 0x004A, 0xD1 }, { 0x004B, 0xD2 } , { 0x004C, 0xD3 }, { 0x004D, 0xD4 }, { 0x004E, 0xD5 }, { 0x004F, 0xD6 } , { 0x0050, 0xD7 }, { 0x0051, 0xD8 }, { 0x0052, 0xD9 }, { 0x0053, 0xE2 } , { 0x0054, 0xE3 }, { 0x0055, 0xE4 }, { 0x0056, 0xE5 }, { 0x0057, 0xE6 } , { 0x0058, 0xE7 }, { 0x0059, 0xE8 }, { 0x005A, 0xE9 }, { 0x005B, 0xBA } , { 0x005C, 0xE0 }, { 0x005D, 0xBB }, { 0x005E, 0xB0 }, { 0x005F, 0x6D } , { 0x0060, 0x79 }, { 0x0061, 0x81 }, { 0x0062, 0x82 }, { 0x0063, 0x83 } , { 0x0064, 0x84 }, { 0x0065, 0x85 }, { 0x0066, 0x86 }, { 0x0067, 0x87 } , { 0x0068, 0x88 }, { 0x0069, 0x89 }, { 0x006A, 0x91 }, { 0x006B, 0x92 } , { 0x006C, 0x93 }, { 0x006D, 0x94 }, { 0x006E, 0x95 }, { 0x006F, 0x96 } , { 0x0070, 0x97 }, { 0x0071, 0x98 }, { 0x0072, 0x99 }, { 0x0073, 0xA2 } , { 0x0074, 0xA3 }, { 0x0075, 0xA4 }, { 0x0076, 0xA5 }, { 0x0077, 0xA6 } , { 0x0078, 0xA7 }, { 0x0079, 0xA8 }, { 0x007A, 0xA9 }, { 0x007B, 0xC0 } , { 0x007C, 0x4F }, { 0x007D, 0xD0 }, { 0x007E, 0xA1 }, { 0x007F, 0x07 } , { 0x0080, 0x20 }, { 0x0081, 0x21 }, { 0x0082, 0x22 }, { 0x0083, 0x23 } , { 0x0084, 0x24 }, { 0x0085, 0x15 }, { 0x0086, 0x06 }, { 0x0087, 0x17 } , { 0x0088, 0x28 }, { 0x0089, 0x29 }, { 0x008A, 0x2A }, { 0x008B, 0x2B } , { 0x008C, 0x2C }, { 0x008D, 0x09 }, { 0x008E, 0x0A }, { 0x008F, 0x1B } , { 0x0090, 0x30 }, { 0x0091, 0x31 }, { 0x0092, 0x1A }, { 0x0093, 0x33 } , { 0x0094, 0x34 }, { 0x0095, 0x35 }, { 0x0096, 0x36 }, { 0x0097, 0x08 } , { 0x0098, 0x38 }, { 0x0099, 0x39 }, { 0x009A, 0x3A }, { 0x009B, 0x3B } , { 0x009C, 0x04 }, { 0x009D, 0x14 }, { 0x009E, 0x3E }, { 0x009F, 0xFF } , { 0x00A0, 0x41 }, { 0x00A1, 0xAA }, { 0x00A2, 0x4A }, { 0x00A3, 0xB1 } , { 0x00A5, 0xB2 }, { 0x00A6, 0x6A }, { 0x00A7, 0xB5 }, { 0x00A8, 0xBD } , { 0x00A9, 0xB4 }, { 0x00AA, 0x9A }, { 0x00AB, 0x8A }, { 0x00AC, 0x5F } , { 0x00AD, 0xCA }, { 0x00AE, 0xAF }, { 0x00AF, 0xBC }, { 0x00B0, 0x90 } , { 0x00B1, 0x8F }, { 0x00B2, 0xEA }, { 0x00B3, 0xFA }, { 0x00B4, 0xBE } , { 0x00B5, 0xA0 }, { 0x00B6, 0xB6 }, { 0x00B7, 0xB3 }, { 0x00B8, 0x9D } , { 0x00B9, 0xDA }, { 0x00BA, 0x9B }, { 0x00BB, 0x8B }, { 0x00BC, 0xB7 } , { 0x00BD, 0xB8 }, { 0x00BE, 0xB9 }, { 0x00BF, 0xAB }, { 0x00C0, 0x64 } , { 0x00C1, 0x65 }, { 0x00C2, 0x62 }, { 0x00C3, 0x66 }, { 0x00C4, 0x63 } , { 0x00C5, 0x67 }, { 0x00C6, 0x9E }, { 0x00C7, 0x68 }, { 0x00C8, 0x74 } , { 0x00C9, 0x71 }, { 0x00CA, 0x72 }, { 0x00CB, 0x73 }, { 0x00CC, 0x78 } , { 0x00CD, 0x75 }, { 0x00CE, 0x76 }, { 0x00CF, 0x77 }, { 0x00D0, 0xAC } , { 0x00D1, 0x69 }, { 0x00D2, 0xED }, { 0x00D3, 0xEE }, { 0x00D4, 0xEB } , { 0x00D5, 0xEF }, { 0x00D6, 0xEC }, { 0x00D7, 0xBF }, { 0x00D8, 0x80 } , { 0x00D9, 0xFD }, { 0x00DA, 0xFE }, { 0x00DB, 0xFB }, { 0x00DC, 0xFC } , { 0x00DD, 0xAD }, { 0x00DE, 0xAE }, { 0x00DF, 0x59 }, { 0x00E0, 0x44 } , { 0x00E1, 0x45 }, { 0x00E2, 0x42 }, { 0x00E3, 0x46 }, { 0x00E4, 0x43 } , { 0x00E5, 0x47 }, { 0x00E6, 0x9C }, { 0x00E7, 0x48 }, { 0x00E8, 0x54 } , { 0x00E9, 0x51 }, { 0x00EA, 0x52 }, { 0x00EB, 0x53 }, { 0x00EC, 0x58 } , { 0x00ED, 0x55 }, { 0x00EE, 0x56 }, { 0x00EF, 0x57 }, { 0x00F0, 0x8C } , { 0x00F1, 0x49 }, { 0x00F2, 0xCD }, { 0x00F3, 0xCE }, { 0x00F4, 0xCB } , { 0x00F5, 0xCF }, { 0x00F6, 0xCC }, { 0x00F7, 0xE1 }, { 0x00F8, 0x70 } , { 0x00F9, 0xDD }, { 0x00FA, 0xDE }, { 0x00FB, 0xDB }, { 0x00FC, 0xDC } , { 0x00FD, 0x8D }, { 0x00FE, 0x8E }, { 0x00FF, 0xDF }, { 0x203E, 0xBC } , { 0x20AC, 0x9F }, { 0xFF01, 0x5A }, { 0xFF02, 0x7F }, { 0xFF03, 0x7B } , { 0xFF04, 0x5B }, { 0xFF05, 0x6C }, { 0xFF06, 0x50 }, { 0xFF07, 0x7D } , { 0xFF08, 0x4D }, { 0xFF09, 0x5D }, { 0xFF0A, 0x5C }, { 0xFF0B, 0x4E } , { 0xFF0C, 0x6B }, { 0xFF0D, 0x60 }, { 0xFF0E, 0x4B }, { 0xFF0F, 0x61 } , { 0xFF10, 0xF0 }, { 0xFF11, 0xF1 }, { 0xFF12, 0xF2 }, { 0xFF13, 0xF3 } , { 0xFF14, 0xF4 }, { 0xFF15, 0xF5 }, { 0xFF16, 0xF6 }, { 0xFF17, 0xF7 } , { 0xFF18, 0xF8 }, { 0xFF19, 0xF9 }, { 0xFF1A, 0x7A }, { 0xFF1B, 0x5E } , { 0xFF1C, 0x4C }, { 0xFF1D, 0x7E }, { 0xFF1E, 0x6E }, { 0xFF1F, 0x6F } , { 0xFF20, 0x7C }, { 0xFF21, 0xC1 }, { 0xFF22, 0xC2 }, { 0xFF23, 0xC3 } , { 0xFF24, 0xC4 }, { 0xFF25, 0xC5 }, { 0xFF26, 0xC6 }, { 0xFF27, 0xC7 } , { 0xFF28, 0xC8 }, { 0xFF29, 0xC9 }, { 0xFF2A, 0xD1 }, { 0xFF2B, 0xD2 } , { 0xFF2C, 0xD3 }, { 0xFF2D, 0xD4 }, { 0xFF2E, 0xD5 }, { 0xFF2F, 0xD6 } , { 0xFF30, 0xD7 }, { 0xFF31, 0xD8 }, { 0xFF32, 0xD9 }, { 0xFF33, 0xE2 } , { 0xFF34, 0xE3 }, { 0xFF35, 0xE4 }, { 0xFF36, 0xE5 }, { 0xFF37, 0xE6 } , { 0xFF38, 0xE7 }, { 0xFF39, 0xE8 }, { 0xFF3A, 0xE9 }, { 0xFF3B, 0xBA } , { 0xFF3C, 0xE0 }, { 0xFF3D, 0xBB }, { 0xFF3E, 0xB0 }, { 0xFF3F, 0x6D } , { 0xFF40, 0x79 }, { 0xFF41, 0x81 }, { 0xFF42, 0x82 }, { 0xFF43, 0x83 } , { 0xFF44, 0x84 }, { 0xFF45, 0x85 }, { 0xFF46, 0x86 }, { 0xFF47, 0x87 } , { 0xFF48, 0x88 }, { 0xFF49, 0x89 }, { 0xFF4A, 0x91 }, { 0xFF4B, 0x92 } , { 0xFF4C, 0x93 }, { 0xFF4D, 0x94 }, { 0xFF4E, 0x95 }, { 0xFF4F, 0x96 } , { 0xFF50, 0x97 }, { 0xFF51, 0x98 }, { 0xFF52, 0x99 }, { 0xFF53, 0xA2 } , { 0xFF54, 0xA3 }, { 0xFF55, 0xA4 }, { 0xFF56, 0xA5 }, { 0xFF57, 0xA6 } , { 0xFF58, 0xA7 }, { 0xFF59, 0xA8 }, { 0xFF5A, 0xA9 }, { 0xFF5B, 0xC0 } , { 0xFF5C, 0x4F }, { 0xFF5D, 0xD0 }, { 0xFF5E, 0xA1 } }; static const XMLSize_t gToTableSz = 351; // --------------------------------------------------------------------------- // XMLIBM1140Transcoder: Public, static methods // --------------------------------------------------------------------------- XMLCh XMLIBM1140Transcoder::xlatThisOne(const XMLByte toXlat) { return gFromTable[toXlat]; } // --------------------------------------------------------------------------- // XMLIBM1140Transcoder: Constructors and Destructor // --------------------------------------------------------------------------- XMLIBM1140Transcoder::XMLIBM1140Transcoder( const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager) : XML256TableTranscoder ( encodingName , blockSize , gFromTable , gToTable , gToTableSz , manager ) { } XMLIBM1140Transcoder::~XMLIBM1140Transcoder() { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/RefArrayVectorOf.c000644 000765 000024 00000010065 13241160335 022572 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include "RefArrayVectorOf.hpp" #endif XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // RefArrayVectorOf: Constructor and Destructor // --------------------------------------------------------------------------- template RefArrayVectorOf::RefArrayVectorOf( const XMLSize_t maxElems , const bool adoptElems , MemoryManager* const manager) : BaseRefVectorOf(maxElems, adoptElems, manager) { } template RefArrayVectorOf::~RefArrayVectorOf() { if (this->fAdoptedElems) { for (XMLSize_t index = 0; index < this->fCurCount; index++) this->fMemoryManager->deallocate(this->fElemList[index]);//delete[] fElemList[index]; } this->fMemoryManager->deallocate(this->fElemList);//delete [] fElemList; } template void RefArrayVectorOf::setElementAt(TElem* const toSet, const XMLSize_t setAt) { if (setAt >= this->fCurCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Vector_BadIndex, this->fMemoryManager); if (this->fAdoptedElems) this->fMemoryManager->deallocate(this->fElemList[setAt]); this->fElemList[setAt] = toSet; } template void RefArrayVectorOf::removeAllElements() { for (XMLSize_t index = 0; index < this->fCurCount; index++) { if (this->fAdoptedElems) this->fMemoryManager->deallocate(this->fElemList[index]); // Keep unused elements zero for sanity's sake this->fElemList[index] = 0; } this->fCurCount = 0; } template void RefArrayVectorOf:: removeElementAt(const XMLSize_t removeAt) { if (removeAt >= this->fCurCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Vector_BadIndex, this->fMemoryManager); if (this->fAdoptedElems) this->fMemoryManager->deallocate(this->fElemList[removeAt]); // Optimize if its the last element if (removeAt == this->fCurCount-1) { this->fElemList[removeAt] = 0; this->fCurCount--; return; } // Copy down every element above remove point for (XMLSize_t index = removeAt; index < this->fCurCount-1; index++) this->fElemList[index] = this->fElemList[index+1]; // Keep unused elements zero for sanity's sake this->fElemList[this->fCurCount-1] = 0; // And bump down count this->fCurCount--; } template void RefArrayVectorOf::removeLastElement() { if (!this->fCurCount) return; this->fCurCount--; if (this->fAdoptedElems) this->fMemoryManager->deallocate(this->fElemList[this->fCurCount]); } template void RefArrayVectorOf::cleanup() { if (this->fAdoptedElems) { for (XMLSize_t index = 0; index < this->fCurCount; index++) this->fMemoryManager->deallocate(this->fElemList[index]); } this->fMemoryManager->deallocate(this->fElemList);//delete [] fElemList; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLUCS4Transcoder.cpp000644 000765 000024 00000017776 13241160336 023114 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLUCS4Transcoder: Constructors and Destructor // --------------------------------------------------------------------------- XMLUCS4Transcoder::XMLUCS4Transcoder(const XMLCh* const encodingName , const XMLSize_t blockSize , const bool swapped , MemoryManager* const manager) : XMLTranscoder(encodingName, blockSize, manager) , fSwapped(swapped) { } XMLUCS4Transcoder::~XMLUCS4Transcoder() { } // --------------------------------------------------------------------------- // XMLUCS4Transcoder: Implementation of the transcoder API // --------------------------------------------------------------------------- XMLSize_t XMLUCS4Transcoder::transcodeFrom(const XMLByte* const srcData , const XMLSize_t srcCount , XMLCh* const toFill , const XMLSize_t maxChars , XMLSize_t& bytesEaten , unsigned char* const charSizes) { // // Get pointers to the start and end of the source buffer in terms of // UCS-4 characters. // const UCS4Ch* srcPtr = reinterpret_cast(srcData); const UCS4Ch* srcEnd = srcPtr + (srcCount / sizeof(UCS4Ch)); // // Get pointers to the start and end of the target buffer, which is // in terms of the XMLCh chars we output. // XMLCh* outPtr = toFill; XMLCh* outEnd = toFill + maxChars; // // And get a pointer into the char sizes buffer. We will run this // up as we put chars into the output buffer. // unsigned char* sizePtr = charSizes; // // Now process chars until we either use up all our source or all of // our output space. // while ((outPtr < outEnd) && (srcPtr < srcEnd)) { // // Get the next UCS char out of the buffer. Don't bump the ptr // yet since we might not have enough storage for it in the target // (if its causes a surrogate pair to be created. // UCS4Ch nextVal = *srcPtr; // If it needs to be swapped, then do it if (fSwapped) nextVal = BitOps::swapBytes(nextVal); // Handle a surrogate pair if needed if (nextVal & 0xFFFF0000) { // // If we don't have room for both of the chars, then we // bail out now. // if (outPtr + 1 == outEnd) break; const XMLInt32 LEAD_OFFSET = 0xD800 - (0x10000 >> 10); const XMLCh ch1 = XMLCh(LEAD_OFFSET + (nextVal >> 10)); const XMLCh ch2 = XMLCh(0xDC00 + (nextVal & 0x3FF)); // // We have room so store them both. But note that the // second one took up no source bytes! // *sizePtr++ = sizeof(UCS4Ch); *outPtr++ = ch1; *sizePtr++ = 0; *outPtr++ = ch2; } else { // // No surrogate, so just store it and bump the count of chars // read. Update the char sizes buffer for this char's entry. // *sizePtr++ = sizeof(UCS4Ch); *outPtr++ = XMLCh(nextVal); } // Indicate that we ate another UCS char's worth of bytes srcPtr++; } // Set the bytes eaten parameter bytesEaten = ((const XMLByte*)srcPtr) - srcData; // And return the chars written into the output buffer return outPtr - toFill; } XMLSize_t XMLUCS4Transcoder::transcodeTo( const XMLCh* const srcData , const XMLSize_t srcCount , XMLByte* const toFill , const XMLSize_t maxBytes , XMLSize_t& charsEaten , const UnRepOpts) { // // Get pointers to the start and end of the source buffer, which // is in terms of XMLCh chars. // const XMLCh* srcPtr = srcData; const XMLCh* srcEnd = srcData + srcCount; // // Get pointers to the start and end of the target buffer, in terms // of UCS-4 chars. // UCS4Ch* outPtr = reinterpret_cast(toFill); UCS4Ch* outEnd = outPtr + (maxBytes / sizeof(UCS4Ch)); // // Now loop until we either run out of source characters or we // fill up our output buffer. // XMLCh trailCh; while ((outPtr < outEnd) && (srcPtr < srcEnd)) { // // Get out an XMLCh char from the source. Don't bump up the // pointer yet, since it might be a leading for which we don't // have the trailing. // const XMLCh curCh = *srcPtr; // // If its a leading char of a surrogate pair handle it one way, // else just cast it over into the target. // if ((curCh >= 0xD800) && (curCh <= 0xDBFF)) { // // Ok, we have to have another source char available or we // just give up without eating the leading char. // if (srcPtr + 1 == srcEnd) break; // // We have the trailing char, so eat the first char and the // trailing char from the source. // srcPtr++; trailCh = *srcPtr++; // // Then make sure its a legal trailing char. If not, throw // an exception. // if ( !( (trailCh >= 0xDC00) && (trailCh <= 0xDFFF) ) ) ThrowXMLwithMemMgr(TranscodingException, XMLExcepts::Trans_BadTrailingSurrogate, getMemoryManager()); // And now combine the two into a single output char const XMLInt32 SURROGATE_OFFSET = 0x10000 - (0xD800 << 10) - 0xDC00; *outPtr++ = (curCh << 10) + trailCh + SURROGATE_OFFSET; } else { // // Its just a char, so we can take it as is. If we need to // swap it, then swap it. Because of flakey compilers, use // a temp first. // const UCS4Ch tmpCh = UCS4Ch(curCh); if (fSwapped) *outPtr++ = BitOps::swapBytes(tmpCh); else *outPtr++ = tmpCh; // Bump the source pointer srcPtr++; } } // Set the chars we ate from the source charsEaten = srcPtr - srcData; // Return the bytes we wrote to the output return ((XMLByte*)outPtr) - toFill; } bool XMLUCS4Transcoder::canTranscodeTo(const unsigned int) { // We can handle anything return true; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/BaseRefVectorOf.hpp000644 000765 000024 00000013374 13241160336 022742 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BaseRefVectorOf.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_ABSTRACTVECTOROF_HPP) #define XERCESC_INCLUDE_GUARD_ABSTRACTVECTOROF_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN /** * Abstract base class for the xerces internal representation of Vector. * * The destructor is abstract, forcing each of RefVectorOf and * RefArrayVectorOf to implement their own appropriate one. * */ template class BaseRefVectorOf : public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- BaseRefVectorOf ( const XMLSize_t maxElems , const bool adoptElems = true , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~BaseRefVectorOf(); // ----------------------------------------------------------------------- // Element management // ----------------------------------------------------------------------- void addElement(TElem* const toAdd); virtual void setElementAt(TElem* const toSet, const XMLSize_t setAt); void insertElementAt(TElem* const toInsert, const XMLSize_t insertAt); TElem* orphanElementAt(const XMLSize_t orphanAt); virtual void removeAllElements(); virtual void removeElementAt(const XMLSize_t removeAt); virtual void removeLastElement(); bool containsElement(const TElem* const toCheck); virtual void cleanup(); void reinitialize(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- XMLSize_t curCapacity() const; const TElem* elementAt(const XMLSize_t getAt) const; TElem* elementAt(const XMLSize_t getAt); XMLSize_t size() const; MemoryManager* getMemoryManager() const; // ----------------------------------------------------------------------- // Miscellaneous // ----------------------------------------------------------------------- void ensureExtraCapacity(const XMLSize_t length); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- BaseRefVectorOf(const BaseRefVectorOf& copy); BaseRefVectorOf& operator=(const BaseRefVectorOf& copy); protected: // ----------------------------------------------------------------------- // Data members // ----------------------------------------------------------------------- bool fAdoptedElems; XMLSize_t fCurCount; XMLSize_t fMaxCount; TElem** fElemList; MemoryManager* fMemoryManager; }; // // An enumerator for a vector. It derives from the basic enumerator // class, so that value vectors can be generically enumerated. // template class BaseRefVectorEnumerator : public XMLEnumerator, public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- BaseRefVectorEnumerator ( BaseRefVectorOf* const toEnum , const bool adopt = false ); virtual ~BaseRefVectorEnumerator(); BaseRefVectorEnumerator(const BaseRefVectorEnumerator& copy); // ----------------------------------------------------------------------- // Enum interface // ----------------------------------------------------------------------- bool hasMoreElements() const; TElem& nextElement(); void Reset(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- BaseRefVectorEnumerator& operator=(const BaseRefVectorEnumerator& copy); // ----------------------------------------------------------------------- // Data Members // // fAdopted // Indicates whether we have adopted the passed vector. If so then // we delete the vector when we are destroyed. // // fCurIndex // This is the current index into the vector. // // fToEnum // The reference vector being enumerated. // ----------------------------------------------------------------------- bool fAdopted; XMLSize_t fCurIndex; BaseRefVectorOf* fToEnum; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/XMLNetAccessor.hpp000644 000765 000024 00000010422 13241160336 022544 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLNetAccessor.hpp 673960 2008-07-04 08:50:12Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLNETACCESSOR_HPP) #define XERCESC_INCLUDE_GUARD_XMLNETACCESSOR_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class BinInputStream; // This class holds advanced informations about the HTTP connection class XMLUTIL_EXPORT XMLNetHTTPInfo { public: XMLNetHTTPInfo(); typedef enum { GET, PUT, POST } HTTPMethod; // ----------------------------------------------------------------------- // Data members // // fHTTPMethod // The type of the HTTP request // // fHeaders // The extra headers that will be sent as part of the request; the format is // Header1: Value\r\nHeader2: Value\r\n // // fHeadersLen // The length of the string pointed by fHeaders, in bytes // // fPayload // The extra data that will be sent after the headers; in the case of a PUT // operation, this is the content of the resource being posted. It can be binary data // // fPayloadLen // The length of the binary buffer pointed by fPayload, in bytes // HTTPMethod fHTTPMethod; const char* fHeaders; XMLSize_t fHeadersLen; const char* fPayload; XMLSize_t fPayloadLen; }; inline XMLNetHTTPInfo::XMLNetHTTPInfo() :fHTTPMethod(XMLNetHTTPInfo::GET), fHeaders(0), fHeadersLen(0), fPayload(0), fPayloadLen(0) { } // // This class is an abstract interface via which the URL class accesses // net access services. When any source URL is not in effect a local file // path, then the URL class is used to look at it. Then the URL class can // be asked to make a binary input stream via which the referenced resource // can be read in. // // The URL class will use an object derived from this class to create a // binary stream for the URL to return. The object it uses is provided by // the platform utils, and is actually provided by the per-platform init // code so each platform can decide what actual implementation it wants to // use. // class XMLUTIL_EXPORT XMLNetAccessor : public XMemory { public : // ----------------------------------------------------------------------- // Virtual destructor // ----------------------------------------------------------------------- virtual ~XMLNetAccessor() { } // ----------------------------------------------------------------------- // The virtual net accessor interface // ----------------------------------------------------------------------- virtual const XMLCh* getId() const = 0; virtual BinInputStream* makeNew ( const XMLURL& urlSrc, const XMLNetHTTPInfo* httpInfo=0 ) = 0; protected : // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- XMLNetAccessor() { } private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLNetAccessor(const XMLNetAccessor&); XMLNetAccessor& operator=(const XMLNetAccessor&); }; MakeXMLException(NetAccessorException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/Xerces_autoconf_config.hpp.in000644 000765 000024 00000012416 13272177434 025053 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Xerces_autoconf_config.hpp.in 1826420 2018-03-10 21:01:56Z rleigh $ */ // // There are two primary xerces configuration header files: // // Xerces_autoconf_config.hpp // // For configuration of items that must be accessable // through public headers. This file has limited information // and carefully works to avoid collision of macro names, etc. // // This file is included by XercesDefs.h. In the event // of a non-configured platform, a similar header specific // to the platform will be included instead. // // config.h // // Generalized autoconf header file, with much more // information, used to supply configuration information // for use in implementation files. // // For autoconf based builds, this header is configured from by the configure // script from the .in template file of the same name. #ifndef XERCES_AUTOCONFIG_CONFIG_HPP #define XERCES_AUTOCONFIG_CONFIG_HPP // --------------------------------------------------------------------------- // These defines are set by configure as appropriate for the platform. // --------------------------------------------------------------------------- #undef XERCES_AUTOCONF #undef XERCES_HAVE_CSTDINT #undef XERCES_HAVE_STDINT_H #undef XERCES_HAVE_SYS_TYPES_H #undef XERCES_HAVE_INTTYPES_H #undef XERCES_HAVE_INTRIN_H #undef XERCES_HAVE_EMMINTRIN_H #undef XERCES_INCLUDE_WCHAR_H #undef XERCES_S16BIT_INT #undef XERCES_S32BIT_INT #undef XERCES_S64BIT_INT #undef XERCES_U16BIT_INT #undef XERCES_U32BIT_INT #undef XERCES_U64BIT_INT #undef XERCES_XMLCH_T #undef XERCES_SIZE_T #undef XERCES_SSIZE_T #undef XERCES_HAS_CPP_NAMESPACE #undef XERCES_STD_NAMESPACE #undef XERCES_NEW_IOSTREAMS #undef XERCES_NO_NATIVE_BOOL #undef XERCES_LSTRSUPPORT #undef XERCES_HAVE_CPUID_INTRINSIC #undef XERCES_HAVE_SSE2_INTRINSIC #undef XERCES_HAVE_GETCPUID #undef XERCES_PLATFORM_EXPORT #undef XERCES_PLATFORM_IMPORT #undef XERCES_TEMPLATE_EXTERN #undef XERCES_NO_MATCHING_DELETE_OPERATOR // --------------------------------------------------------------------------- // Include standard headers, if available, that we may rely on below. // --------------------------------------------------------------------------- #if defined(__cplusplus) && XERCES_HAVE_CSTDINT # include #elif XERCES_HAVE_STDINT_H # if defined(__cplusplus) # define __STDC_LIMIT_MACROS # endif # include #endif #if XERCES_HAVE_INTTYPES_H # include #endif #if XERCES_HAVE_SYS_TYPES_H # include #endif #if XERCES_INCLUDE_WCHAR_H # include #endif // --------------------------------------------------------------------------- // XMLSize_t is the unsigned integral type. // --------------------------------------------------------------------------- typedef XERCES_SIZE_T XMLSize_t; typedef XERCES_SSIZE_T XMLSSize_t; #undef XERCES_SIZE_MAX #undef XERCES_SSIZE_MAX // --------------------------------------------------------------------------- // Define our version of the XML character // --------------------------------------------------------------------------- typedef XERCES_XMLCH_T XMLCh; // --------------------------------------------------------------------------- // Define unsigned 16, 32, and 64 bit integers // --------------------------------------------------------------------------- typedef XERCES_U16BIT_INT XMLUInt16; typedef XERCES_U32BIT_INT XMLUInt32; typedef XERCES_U64BIT_INT XMLUInt64; // --------------------------------------------------------------------------- // Define signed 16, 32, and 64 bit integers // --------------------------------------------------------------------------- typedef XERCES_S16BIT_INT XMLInt16; typedef XERCES_S32BIT_INT XMLInt32; typedef XERCES_S64BIT_INT XMLInt64; // --------------------------------------------------------------------------- // XMLFilePos is the type used to represent a file position. // --------------------------------------------------------------------------- typedef XMLUInt64 XMLFilePos; // --------------------------------------------------------------------------- // XMLFileLoc is the type used to represent a file location (line/column). // --------------------------------------------------------------------------- typedef XMLUInt64 XMLFileLoc; // --------------------------------------------------------------------------- // Force on the Xerces debug token if it is on in the build environment // --------------------------------------------------------------------------- #if defined(_DEBUG) #define XERCES_DEBUG #endif #endif xerces-c-3.2.2/src/xercesc/util/SecurityManager.hpp000644 000765 000024 00000007004 13241160336 023056 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SecurityManager.hpp 673960 2008-07-04 08:50:12Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_SECURITYMANAGER_HPP) #define XERCESC_INCLUDE_GUARD_SECURITYMANAGER_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Allow application to force the parser to behave in a security-conscious * way. * *

There are cases in which an XML- or XmL-schema- * conformant processor can be presented with documents the * processing of which can involve the consumption of * prohibitive amounts of system resources. Applications can * attach instances of this class to parsers that they've * created, via the * http://apache.org/xml/properties/security-manager property. *

* *

Defaults will be provided for all known security holes. * Setter methods will be provided on this class to ensure that * an application can customize each limit as it chooses. * Components that are vulnerable to any given hole need to be * written to act appropriately when an instance of this class * has been set on the calling parser. *

*/ class XMLUTIL_EXPORT SecurityManager { public: enum { ENTITY_EXPANSION_LIMIT = 50000}; /** @name default Constructors */ //@{ /** Default constructor */ SecurityManager() : fEntityExpansionLimit((XMLSize_t)ENTITY_EXPANSION_LIMIT) { } /** Destructor */ virtual ~SecurityManager(){}; //@} /** @name The Security Manager */ //@{ /** * An application should call this method when it wishes to specify a particular * limit to the number of entity expansions the parser will permit in a * particular document. The default behaviour should allow the parser * to validate nearly all XML non-malicious XML documents; if an * application knows that it is operating in a domain where entities are * uncommon, for instance, it may wish to provide a limit lower than the * parser's default. * * @param newLimit the new entity expansion limit * */ virtual void setEntityExpansionLimit(XMLSize_t newLimit) { fEntityExpansionLimit = newLimit; } /** * Permits the application or a parser component to query the current * limit for entity expansions. * * @return the current setting of the entity expansion limit * */ virtual XMLSize_t getEntityExpansionLimit() const { return fEntityExpansionLimit; } //@} protected: XMLSize_t fEntityExpansionLimit; private: /* Unimplemented Constructors and operators */ /* Copy constructor */ SecurityManager(const SecurityManager&); /** Assignment operator */ SecurityManager& operator=(const SecurityManager&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLBigDecimal.hpp000644 000765 000024 00000013517 13241160335 022322 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLBigDecimal.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XML_BIGDECIMAL_HPP) #define XERCESC_INCLUDE_GUARD_XML_BIGDECIMAL_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT XMLBigDecimal : public XMLNumber { public: /** * Constructs a newly allocated XMLBigDecimal object that * represents the value represented by the string. * * @param strValue the String to be converted to an * XMLBigDecimal. * @param manager Pointer to the memory manager to be used to * allocate objects. * @exception NumberFormatException if the String does not * contain a parsable XMLBigDecimal. */ XMLBigDecimal ( const XMLCh* const strValue , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~XMLBigDecimal(); static int compareValues(const XMLBigDecimal* const lValue , const XMLBigDecimal* const rValue , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); static XMLCh* getCanonicalRepresentation ( const XMLCh* const rawData , MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager ); static void parseDecimal ( const XMLCh* const toParse , XMLCh* const retBuffer , int& sign , int& totalDigits , int& fractDigits , MemoryManager* const manager ); static void parseDecimal ( const XMLCh* const toParse , MemoryManager* const manager ); virtual XMLCh* getRawData() const; virtual const XMLCh* getFormattedString() const; virtual int getSign() const; const XMLCh* getValue() const; unsigned int getScale() const; unsigned int getTotalDigit() const; inline XMLCh* getIntVal() const; /** * Compares this object to the specified object. * * @param other the object to compare with. * @return -1 value is less than other's * 0 value equals to other's * +1 value is greater than other's */ int toCompare(const XMLBigDecimal& other) const; /* * Sets the value to be converted * * @param strValue the value to convert */ void setDecimalValue(const XMLCh* const strValue); MemoryManager* getMemoryManager() const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLBigDecimal) XMLBigDecimal(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); private: void cleanUp(); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLBigDecimal(const XMLBigDecimal& other); XMLBigDecimal& operator=(const XMLBigDecimal& other); // ----------------------------------------------------------------------- // Private data members // // fSign // sign // // fTotalDigits // the total number of digits // // fScale // the number of digits to the right of the decimal point // // fIntVal // The value of this BigDecimal, w/o // leading whitespace, leading zero // decimal point // trailing zero, trailing whitespace // // fRawData // to preserve the original string used to construct this object, // needed for pattern matching. // // ----------------------------------------------------------------------- int fSign; unsigned int fTotalDigits; unsigned int fScale; XMLSize_t fRawDataLen; XMLCh* fRawData; XMLCh* fIntVal; MemoryManager* fMemoryManager; }; inline int XMLBigDecimal::getSign() const { return fSign; } inline const XMLCh* XMLBigDecimal::getValue() const { return fIntVal; } inline unsigned int XMLBigDecimal::getScale() const { return fScale; } inline unsigned int XMLBigDecimal::getTotalDigit() const { return fTotalDigits; } inline XMLCh* XMLBigDecimal::getRawData() const { return fRawData; } inline const XMLCh* XMLBigDecimal::getFormattedString() const { return fRawData; } inline MemoryManager* XMLBigDecimal::getMemoryManager() const { return fMemoryManager; } inline XMLCh* XMLBigDecimal::getIntVal() const { return fIntVal; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/OutOfMemoryException.hpp000644 000765 000024 00000006003 13241160335 024055 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: OutOfMemoryException.hpp 673960 2008-07-04 08:50:12Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_OUT_OF_MEMORY_EXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_OUT_OF_MEMORY_EXCEPTION_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN static const XMLCh gDefOutOfMemoryErrMsg[] = { chLatin_O, chLatin_u, chLatin_t, chLatin_O , chLatin_f, chLatin_M, chLatin_e, chLatin_m , chLatin_o, chLatin_r, chLatin_y, chNull }; class XMLUTIL_EXPORT OutOfMemoryException : public XMemory { public: OutOfMemoryException(); ~OutOfMemoryException(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- XMLExcepts::Codes getCode() const; const XMLCh* getMessage() const; const XMLCh* getType() const; const char* getSrcFile() const; XMLFileLoc getSrcLine() const; OutOfMemoryException(const OutOfMemoryException& toCopy); OutOfMemoryException& operator=(const OutOfMemoryException& toAssign); }; // constructors/destructors... inline OutOfMemoryException::OutOfMemoryException() {} inline OutOfMemoryException::~OutOfMemoryException() {} inline OutOfMemoryException::OutOfMemoryException(const OutOfMemoryException& other) : XMemory(other) {} inline OutOfMemoryException& OutOfMemoryException::operator=(const OutOfMemoryException&) { return *this; } // --------------------------------------------------------------------------- // OutOfMemoryException: Getter methods // --------------------------------------------------------------------------- inline XMLExcepts::Codes OutOfMemoryException::getCode() const { return XMLExcepts::Out_Of_Memory; } inline const XMLCh* OutOfMemoryException::getMessage() const { return gDefOutOfMemoryErrMsg; } inline const XMLCh* OutOfMemoryException::getType() const { return gDefOutOfMemoryErrMsg; } inline const char* OutOfMemoryException::getSrcFile() const { return ""; } inline XMLFileLoc OutOfMemoryException::getSrcLine() const { return 0; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLResourceIdentifier.hpp000644 000765 000024 00000015300 13241160336 024125 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLResourceIdentifier.hpp 1701582 2015-09-07 09:21:15Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLRESOURCEIDENTIFIER_HPP) #define XERCESC_INCLUDE_GUARD_XMLRESOURCEIDENTIFIER_HPP XERCES_CPP_NAMESPACE_BEGIN class Locator; /** *

This class is used along with XMLEntityResolver to resolve entities. * Instead of passing publicId and systemId on the resolveEntity call, * as is done with the SAX entity resolver, an object of type XMLResourceIdentifier * is passed. By calling the getResourceIdentifierType() method the user can * determine which data members are available for inspection:

* * * * * * * * * * * * * * * * * * * * * * * * * * *
ResourceIdentifierTypeAvailable Data Members
SchemaGrammarschemaLocation, nameSpace & baseURI (current document)
SchemaImportschemaLocation, nameSpace & baseURI (current document)
SchemaIncludeschemaLocation & baseURI (current document)
SchemaRedefineschemaLocation & baseURI (current document)
ExternalEntitysystemId, publicId & baseURI (some items may be NULL)
* *

The following resolver would provide the application * with a special character stream for the entity with the system * identifier "http://www.myhost.com/today":

* * * \#include
* \#include
*
* class MyResolver : public XMLEntityResolver {
*  public:
*   InputSource* resolveEntity (XMLResourceIdentifier* xmlri);
*   ...
*  };
*
*  MyResolver::resolveEntity(XMLResourceIdentifier* xmlri) {
*   switch(xmlri->getResourceIdentifierType()) {
*    case XMLResourceIdentifier::SystemId:
*     if (XMLString::compareString(xmlri->getSystemId(), "http://www.myhost.com/today")) {
*      MyReader* reader = new MyReader();
*      return new InputSource(reader);
*     } else {
*      return null;
*     }
*     break;
*    default:
*     return null;
*   }
*  }
* * @see SAXParser#setXMLEntityResolver * @see InputSource#InputSource */ class XMLUTIL_EXPORT XMLResourceIdentifier { public: /** @name Public Constants */ //@{ enum ResourceIdentifierType { SchemaGrammar = 0, SchemaImport, SchemaInclude, SchemaRedefine , ExternalEntity, UnKnown = 255 }; //@} /** @name Constructors and Destructor */ //@{ /** Constructor */ XMLResourceIdentifier(const ResourceIdentifierType resourceIdentitiferType , const XMLCh* const systemId , const XMLCh* const nameSpace = 0 , const XMLCh* const publicId = 0 , const XMLCh* const baseURI = 0 , const Locator* locator = 0); /** Destructor */ ~XMLResourceIdentifier() { } //@} // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- /** @name Public Methods */ //@{ ResourceIdentifierType getResourceIdentifierType() const; const XMLCh* getPublicId() const; const XMLCh* getSystemId() const; const XMLCh* getSchemaLocation() const; const XMLCh* getBaseURI() const; const XMLCh* getNameSpace() const; const Locator* getLocator() const; //@} private : const ResourceIdentifierType fResourceIdentifierType; const XMLCh* fPublicId; const XMLCh* fSystemId; const XMLCh* fBaseURI; const XMLCh* fNameSpace; const Locator* fLocator; /* Unimplemented constructors and operators */ /* Copy constructor */ XMLResourceIdentifier(const XMLResourceIdentifier&); /* Assignment operator */ XMLResourceIdentifier& operator=(const XMLResourceIdentifier&); }; inline XMLResourceIdentifier::ResourceIdentifierType XMLResourceIdentifier::getResourceIdentifierType() const { return fResourceIdentifierType; } inline const XMLCh* XMLResourceIdentifier::getPublicId() const { return fPublicId; } inline const XMLCh* XMLResourceIdentifier::getSystemId() const { return fSystemId; } inline const XMLCh* XMLResourceIdentifier::getSchemaLocation() const { return fSystemId; } inline const XMLCh* XMLResourceIdentifier::getBaseURI() const { return fBaseURI; } inline const XMLCh* XMLResourceIdentifier::getNameSpace() const { return fNameSpace; } inline const Locator* XMLResourceIdentifier::getLocator() const { return fLocator; } inline XMLResourceIdentifier::XMLResourceIdentifier(const ResourceIdentifierType resourceIdentifierType , const XMLCh* const systemId , const XMLCh* const nameSpace , const XMLCh* const publicId , const XMLCh* const baseURI , const Locator* locator ) : fResourceIdentifierType(resourceIdentifierType) , fPublicId(publicId) , fSystemId(systemId) , fBaseURI(baseURI) , fNameSpace(nameSpace) , fLocator(locator) { } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/RefHash2KeysTableOf.hpp000644 000765 000024 00000023570 13241160336 023455 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: RefHash2KeysTableOf.hpp 883368 2009-11-23 15:28:19Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_REFHASH2KEYSTABLEOF_HPP) #define XERCESC_INCLUDE_GUARD_REFHASH2KEYSTABLEOF_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // This hash table is similar to RefHashTableOf with an additional integer as key2 // Forward declare the enumerator so it can be our friend. // template class RefHash2KeysTableOfEnumerator; // // This should really be a nested class, but some of the compilers we // have to support cannot deal with that! // template struct RefHash2KeysTableBucketElem { RefHash2KeysTableBucketElem(void* key1, int key2, TVal* const value, RefHash2KeysTableBucketElem* next) : fData(value), fNext(next), fKey1(key1), fKey2(key2) { } ~RefHash2KeysTableBucketElem() {}; TVal* fData; RefHash2KeysTableBucketElem* fNext; void* fKey1; int fKey2; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- RefHash2KeysTableBucketElem(const RefHash2KeysTableBucketElem&); RefHash2KeysTableBucketElem& operator=(const RefHash2KeysTableBucketElem&); }; template class RefHash2KeysTableOf : public XMemory { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- RefHash2KeysTableOf( const XMLSize_t modulus, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); RefHash2KeysTableOf( const XMLSize_t modulus, const THasher& hasher, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); RefHash2KeysTableOf( const XMLSize_t modulus, const bool adoptElems, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); RefHash2KeysTableOf( const XMLSize_t modulus, const bool adoptElems, const THasher& hasher, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~RefHash2KeysTableOf(); // ----------------------------------------------------------------------- // Element management // ----------------------------------------------------------------------- bool isEmpty() const; bool containsKey(const void* const key1, const int key2) const; void removeKey(const void* const key1, const int key2); void removeKey(const void* const key1); void removeAll(); void transferElement(const void* const key1, void* key2); // ----------------------------------------------------------------------- // Getters // ----------------------------------------------------------------------- TVal* get(const void* const key1, const int key2); const TVal* get(const void* const key1, const int key2) const; MemoryManager* getMemoryManager() const; XMLSize_t getHashModulus() const; // ----------------------------------------------------------------------- // Putters // ----------------------------------------------------------------------- void put(void* key1, int key2, TVal* const valueToAdopt); private : // ----------------------------------------------------------------------- // Declare our friends // ----------------------------------------------------------------------- friend class RefHash2KeysTableOfEnumerator; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- RefHash2KeysTableOf(const RefHash2KeysTableOf&); RefHash2KeysTableOf& operator=(const RefHash2KeysTableOf&); // ----------------------------------------------------------------------- // Private methods // ----------------------------------------------------------------------- RefHash2KeysTableBucketElem* findBucketElem(const void* const key1, const int key2, XMLSize_t& hashVal); const RefHash2KeysTableBucketElem* findBucketElem(const void* const key1, const int key2, XMLSize_t& hashVal) const; void initialize(const XMLSize_t modulus); void rehash(); // ----------------------------------------------------------------------- // Data members // // fAdoptedElems // Indicates whether the values added are adopted or just referenced. // If adopted, then they are deleted when they are removed from the // hash table. // // fBucketList // This is the array that contains the heads of all of the list // buckets, one for each possible hash value. // // fHashModulus // The modulus used for this hash table, to hash the keys. This is // also the number of elements in the bucket list. // // fCount // The number of elements currently in the map // // fHash // The hasher for the key1 data type. // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; bool fAdoptedElems; RefHash2KeysTableBucketElem** fBucketList; XMLSize_t fHashModulus; XMLSize_t fCount; THasher fHasher; }; // // An enumerator for a value array. It derives from the basic enumerator // class, so that value vectors can be generically enumerated. // template class RefHash2KeysTableOfEnumerator : public XMLEnumerator, public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- RefHash2KeysTableOfEnumerator(RefHash2KeysTableOf* const toEnum , const bool adopt = false , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); virtual ~RefHash2KeysTableOfEnumerator(); // ----------------------------------------------------------------------- // Enum interface // ----------------------------------------------------------------------- bool hasMoreElements() const; TVal& nextElement(); void Reset(); // ----------------------------------------------------------------------- // New interface // ----------------------------------------------------------------------- void nextElementKey(void*&, int&); void setPrimaryKey(const void* key); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- RefHash2KeysTableOfEnumerator(const RefHash2KeysTableOfEnumerator&); RefHash2KeysTableOfEnumerator& operator=(const RefHash2KeysTableOfEnumerator&); // ----------------------------------------------------------------------- // Private methods // ----------------------------------------------------------------------- void findNext(); // ----------------------------------------------------------------------- // Data Members // // fAdopted // Indicates whether we have adopted the passed vector. If so then // we delete the vector when we are destroyed. // // fCurElem // This is the current bucket bucket element that we are on. // // fCurHash // The is the current hash buck that we are working on. Once we hit // the end of the bucket that fCurElem is in, then we have to start // working this one up to the next non-empty bucket. // // fToEnum // The value array being enumerated. // // fLockPrimaryKey // Indicates that we are requested to iterate over the secondary keys // associated with the given primary key // // ----------------------------------------------------------------------- bool fAdopted; RefHash2KeysTableBucketElem* fCurElem; XMLSize_t fCurHash; RefHash2KeysTableOf* fToEnum; MemoryManager* const fMemoryManager; const void* fLockPrimaryKey; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/HexBin.cpp000644 000765 000024 00000012417 13241160336 021130 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // constants // --------------------------------------------------------------------------- static const int BASELENGTH = 255; // --------------------------------------------------------------------------- // class data member // --------------------------------------------------------------------------- const XMLByte HexBin::hexNumberTable[BASELENGTH] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; int HexBin::getDataLength(const XMLCh* const hexData) { if (!isArrayByteHex(hexData)) return -1; return (int)XMLString::stringLen(hexData)/2; } bool HexBin::isArrayByteHex(const XMLCh* const hexData) { if (( hexData == 0 ) || ( *hexData == 0 )) // zero length return true; XMLSize_t strLen = XMLString::stringLen(hexData); if ( strLen%2 != 0 ) return false; for ( XMLSize_t i = 0; i < strLen; i++ ) if( !isHex(hexData[i]) ) return false; return true; } XMLCh* HexBin::getCanonicalRepresentation(const XMLCh* const hexData , MemoryManager* const manager) { if (getDataLength(hexData) == -1) return 0; XMLCh* retStr = XMLString::replicate(hexData, manager); XMLString::upperCaseASCII(retStr); return retStr; } XMLByte* HexBin::decodeToXMLByte(const XMLCh* const hexData , MemoryManager* const manager) { if (( hexData == 0 ) || ( *hexData == 0 )) // zero length return 0; XMLSize_t strLen = XMLString::stringLen(hexData); if ( strLen%2 != 0 ) return 0; //prepare the return string int decodeLength = (int)strLen/2; XMLByte *retVal = (XMLByte*) manager->allocate( (decodeLength + 1) * sizeof(XMLByte)); ArrayJanitor janFill(retVal, manager); XMLByte temp1, temp2; for( int i = 0; i= BASELENGTH ) return false; return (hexNumberTable[octet] != (XMLByte) -1); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/EmptyStackException.hpp000644 000765 000024 00000002255 13241160336 023722 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: EmptyStackException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_EMPTYSTACKEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_EMPTYSTACKEXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(EmptyStackException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLUniDefs.hpp000644 000765 000024 00000014275 13241160336 021702 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLUniDefs.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLUNIDEFS_HPP) #define XERCESC_INCLUDE_GUARD_XMLUNIDEFS_HPP #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constants for the Unicode characters of interest to us in an XML parser // We don't put these inside the class because then they could not be const // inline values, which would have significant performance ramifications. // // We cannot use a namespace because of the requirement to support old // compilers. // --------------------------------------------------------------------------- const XMLCh chNull = 0x00; const XMLCh chHTab = 0x09; const XMLCh chLF = 0x0A; const XMLCh chVTab = 0x0B; const XMLCh chFF = 0x0C; const XMLCh chCR = 0x0D; const XMLCh chAmpersand = 0x26; const XMLCh chAsterisk = 0x2A; const XMLCh chAt = 0x40; const XMLCh chBackSlash = 0x5C; const XMLCh chBang = 0x21; const XMLCh chCaret = 0x5E; const XMLCh chCloseAngle = 0x3E; const XMLCh chCloseCurly = 0x7D; const XMLCh chCloseParen = 0x29; const XMLCh chCloseSquare = 0x5D; const XMLCh chColon = 0x3A; const XMLCh chComma = 0x2C; const XMLCh chDash = 0x2D; const XMLCh chDollarSign = 0x24; const XMLCh chDoubleQuote = 0x22; const XMLCh chEqual = 0x3D; const XMLCh chForwardSlash = 0x2F; const XMLCh chGrave = 0x60; const XMLCh chNEL = 0x85; const XMLCh chOpenAngle = 0x3C; const XMLCh chOpenCurly = 0x7B; const XMLCh chOpenParen = 0x28; const XMLCh chOpenSquare = 0x5B; const XMLCh chPercent = 0x25; const XMLCh chPeriod = 0x2E; const XMLCh chPipe = 0x7C; const XMLCh chPlus = 0x2B; const XMLCh chPound = 0x23; const XMLCh chQuestion = 0x3F; const XMLCh chSingleQuote = 0x27; const XMLCh chSpace = 0x20; const XMLCh chSemiColon = 0x3B; const XMLCh chTilde = 0x7E; const XMLCh chUnderscore = 0x5F; const XMLCh chSwappedUnicodeMarker = XMLCh(0xFFFE); const XMLCh chUnicodeMarker = XMLCh(0xFEFF); const XMLCh chDigit_0 = 0x30; const XMLCh chDigit_1 = 0x31; const XMLCh chDigit_2 = 0x32; const XMLCh chDigit_3 = 0x33; const XMLCh chDigit_4 = 0x34; const XMLCh chDigit_5 = 0x35; const XMLCh chDigit_6 = 0x36; const XMLCh chDigit_7 = 0x37; const XMLCh chDigit_8 = 0x38; const XMLCh chDigit_9 = 0x39; const XMLCh chLatin_A = 0x41; const XMLCh chLatin_B = 0x42; const XMLCh chLatin_C = 0x43; const XMLCh chLatin_D = 0x44; const XMLCh chLatin_E = 0x45; const XMLCh chLatin_F = 0x46; const XMLCh chLatin_G = 0x47; const XMLCh chLatin_H = 0x48; const XMLCh chLatin_I = 0x49; const XMLCh chLatin_J = 0x4A; const XMLCh chLatin_K = 0x4B; const XMLCh chLatin_L = 0x4C; const XMLCh chLatin_M = 0x4D; const XMLCh chLatin_N = 0x4E; const XMLCh chLatin_O = 0x4F; const XMLCh chLatin_P = 0x50; const XMLCh chLatin_Q = 0x51; const XMLCh chLatin_R = 0x52; const XMLCh chLatin_S = 0x53; const XMLCh chLatin_T = 0x54; const XMLCh chLatin_U = 0x55; const XMLCh chLatin_V = 0x56; const XMLCh chLatin_W = 0x57; const XMLCh chLatin_X = 0x58; const XMLCh chLatin_Y = 0x59; const XMLCh chLatin_Z = 0x5A; const XMLCh chLatin_a = 0x61; const XMLCh chLatin_b = 0x62; const XMLCh chLatin_c = 0x63; const XMLCh chLatin_d = 0x64; const XMLCh chLatin_e = 0x65; const XMLCh chLatin_f = 0x66; const XMLCh chLatin_g = 0x67; const XMLCh chLatin_h = 0x68; const XMLCh chLatin_i = 0x69; const XMLCh chLatin_j = 0x6A; const XMLCh chLatin_k = 0x6B; const XMLCh chLatin_l = 0x6C; const XMLCh chLatin_m = 0x6D; const XMLCh chLatin_n = 0x6E; const XMLCh chLatin_o = 0x6F; const XMLCh chLatin_p = 0x70; const XMLCh chLatin_q = 0x71; const XMLCh chLatin_r = 0x72; const XMLCh chLatin_s = 0x73; const XMLCh chLatin_t = 0x74; const XMLCh chLatin_u = 0x75; const XMLCh chLatin_v = 0x76; const XMLCh chLatin_w = 0x77; const XMLCh chLatin_x = 0x78; const XMLCh chLatin_y = 0x79; const XMLCh chLatin_z = 0x7A; const XMLCh chYenSign = 0xA5; const XMLCh chWonSign = 0x20A9; const XMLCh chLineSeparator = 0x2028; const XMLCh chParagraphSeparator = 0x2029; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/Base64.cpp000644 000765 000024 00000053230 13241160335 020774 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // constants // --------------------------------------------------------------------------- static const int BASELENGTH = 255; static const int FOURBYTE = 4; // --------------------------------------------------------------------------- // class data member // --------------------------------------------------------------------------- // the base64 alphabet according to definition in RFC 2045 const XMLByte Base64::base64Alphabet[] = { chLatin_A, chLatin_B, chLatin_C, chLatin_D, chLatin_E, chLatin_F, chLatin_G, chLatin_H, chLatin_I, chLatin_J, chLatin_K, chLatin_L, chLatin_M, chLatin_N, chLatin_O, chLatin_P, chLatin_Q, chLatin_R, chLatin_S, chLatin_T, chLatin_U, chLatin_V, chLatin_W, chLatin_X, chLatin_Y, chLatin_Z, chLatin_a, chLatin_b, chLatin_c, chLatin_d, chLatin_e, chLatin_f, chLatin_g, chLatin_h, chLatin_i, chLatin_j, chLatin_k, chLatin_l, chLatin_m, chLatin_n, chLatin_o, chLatin_p, chLatin_q, chLatin_r, chLatin_s, chLatin_t, chLatin_u, chLatin_v, chLatin_w, chLatin_x, chLatin_y, chLatin_z, chDigit_0, chDigit_1, chDigit_2, chDigit_3, chDigit_4, chDigit_5, chDigit_6, chDigit_7, chDigit_8, chDigit_9, chPlus, chForwardSlash, chNull }; // This is an inverse table for base64 decoding. So, if // base64Alphabet[17] = 'R', then base64Inverse['R'] = 17. // // For characters not in base64Alphabet then // base64Inverse[ch] = 0xFF. const XMLByte Base64::base64Inverse[BASELENGTH] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3E, 0xFF, 0xFF, 0xFF, 0x3F, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; const XMLByte Base64::base64Padding = chEqual; /*** * * Memory Management Issue: * * . For memory allocated for result returned to caller (external memory), * the plugged memory manager is used if it is provided, otherwise global * new used to retain the pre-memory-manager behaviour. * * . For memory allocated for temperary buffer (internal memory), * XMLPlatformUtils::fgMemoryManager is used. * */ static void* getExternalMemory( MemoryManager* const allocator , XMLSize_t const sizeToAllocate) { return allocator ? allocator->allocate(sizeToAllocate) : ::operator new(sizeToAllocate); } /*** * internal memory is deallocated by janitorArray */ static void returnExternalMemory( MemoryManager* const allocator , void* buffer) { allocator ? allocator->deallocate(buffer) : ::operator delete(buffer); } /** * E2-9 * * Canonical-base64Binary ::= (B64line* B64lastline)? * * B64line ::= B64x15 B64x15 B64x15 B64x15 B64x15 B64 #xA * 76 Base64 characters followed by newline * * B64x15 ::= B64 B64 B64 B64 B64 * B64 B64 B64 B64 B64 * B64 B64 B64 B64 B64 * * B64lastline ::= B64x4? B64x4? B64x4? B64x4? * B64x4? B64x4? B64x4? B64x4? * B64x4? B64x4? B64x4? B64x4? * B64x4? B64x4? B64x4? B64x4? * B64x4? B64x4? * (B64x4 | (B64 B64 B16 '=') | (B64 B04 '==')) * #xA * * B64x4 ::= B64 B64 B64 B64 * B04 ::= [AQgw] * B16 ::= [AEIMQUYcgkosw048] */ // number of quadruplets per one line ( must be >1 and <19 ) const unsigned int Base64::quadsPerLine = 15; XMLByte* Base64::encode(const XMLByte* const inputData , const XMLSize_t inputLength , XMLSize_t* outputLength , MemoryManager* const memMgr) { if (!inputData || !outputLength) { return 0; } else if (XERCES_SIZE_MAX - inputLength < 2) { return 0; } XMLSize_t quadrupletCount = (inputLength + 2 ) / 3; if (quadrupletCount == 0) { return 0; } // number of rows in encoded stream ( including the last one ) XMLSize_t lineCount = ( quadrupletCount + quadsPerLine-1 ) / quadsPerLine; // // convert the triplet(s) to quadruplet(s) // XMLByte b1, b2, b3, b4; // base64 binary codes ( 0..63 ) XMLSize_t inputIndex = 0; XMLSize_t outputIndex = 0; XMLByte *encodedData = (XMLByte*) getExternalMemory(memMgr, (quadrupletCount*FOURBYTE+lineCount+1) * sizeof(XMLByte)); // // Process all quadruplet(s) except the last // XMLSize_t quad = 1; for (; quad <= quadrupletCount-1; quad++ ) { // read triplet from the input stream split1stOctet( inputData[ inputIndex++ ], b1, b2 ); split2ndOctet( inputData[ inputIndex++ ], b2, b3 ); split3rdOctet( inputData[ inputIndex++ ], b3, b4 ); // write quadruplet to the output stream encodedData[ outputIndex++ ] = base64Alphabet[ b1 ]; encodedData[ outputIndex++ ] = base64Alphabet[ b2 ]; encodedData[ outputIndex++ ] = base64Alphabet[ b3 ]; encodedData[ outputIndex++ ] = base64Alphabet[ b4 ]; if (( quad % quadsPerLine ) == 0 ) encodedData[ outputIndex++ ] = chLF; } // // process the last Quadruplet // // first octet is present always, process it split1stOctet( inputData[ inputIndex++ ], b1, b2 ); encodedData[ outputIndex++ ] = base64Alphabet[ b1 ]; if( inputIndex < inputLength ) { // second octet is present, process it split2ndOctet( inputData[ inputIndex++ ], b2, b3 ); encodedData[ outputIndex++ ] = base64Alphabet[ b2 ]; if( inputIndex < inputLength ) { // third octet present, process it // no PAD e.g. 3cQl split3rdOctet( inputData[ inputIndex++ ], b3, b4 ); encodedData[ outputIndex++ ] = base64Alphabet[ b3 ]; encodedData[ outputIndex++ ] = base64Alphabet[ b4 ]; } else { // third octet not present // one PAD e.g. 3cQ= encodedData[ outputIndex++ ] = base64Alphabet[ b3 ]; encodedData[ outputIndex++ ] = base64Padding; } } else { // second octet not present // two PADs e.g. 3c== encodedData[ outputIndex++ ] = base64Alphabet[ b2 ]; encodedData[ outputIndex++ ] = base64Padding; encodedData[ outputIndex++ ] = base64Padding; } // write out end of the last line encodedData[ outputIndex++ ] = chLF; // write out end of string encodedData[ outputIndex ] = 0; *outputLength = outputIndex; return encodedData; } // // delete the buffer allocated by decode() if // decoding is successfully done. // // In previous version, we use XMLString::strLen(decodedData) // to get the length, this will fail for test case containing // consequtive "A", such "AAFF", or "ab56AA56". Instead of // returning 3/6, we have 0 and 3, indicating that "AA", after // decoded, is interpreted as by the strLen(). // // Since decode() has track of length of the decoded data, we // will get this length from decode(), instead of strLen(). // int Base64::getDataLength(const XMLCh* const inputData , MemoryManager* const manager , Conformance conform ) { XMLSize_t retLen = 0; XMLByte* decodedData = decodeToXMLByte(inputData, &retLen, manager, conform); if ( !decodedData ) return -1; else { returnExternalMemory(manager, decodedData); return (int)retLen; } } XMLByte* Base64::decode(const XMLByte* const inputData , XMLSize_t* decodedLength , MemoryManager* const memMgr , Conformance conform ) { XMLByte* canRepInByte = 0; XMLByte* retStr = decode( inputData , decodedLength , canRepInByte , memMgr , conform); /*** * Release the canRepData */ if (retStr) returnExternalMemory(memMgr, canRepInByte); return retStr; } XMLByte* Base64::decodeToXMLByte(const XMLCh* const inputData , XMLSize_t* decodedLen , MemoryManager* const memMgr , Conformance conform ) { if (!inputData || !*inputData) return 0; /*** * Move input data to a XMLByte buffer */ XMLSize_t srcLen = XMLString::stringLen(inputData); XMLByte *dataInByte = (XMLByte*) getExternalMemory(memMgr, (srcLen+1) * sizeof(XMLByte)); ArrayJanitor janFill(dataInByte, memMgr ? memMgr : XMLPlatformUtils::fgMemoryManager); for (XMLSize_t i = 0; i < srcLen; i++) dataInByte[i] = (XMLByte)inputData[i]; dataInByte[srcLen] = 0; /*** * Forward to the actual decoding method to do the decoding */ *decodedLen = 0; return decode(dataInByte, decodedLen, memMgr, conform); } /*** * E2-54 * * Canonical-base64Binary ::= (B64 B64 B64 B64)*((B64 B64 B16 '=')|(B64 B04 '=='))? * B04 ::= [AQgw] * B16 ::= [AEIMQUYcgkosw048] * B64 ::= [A-Za-z0-9+/] * ***/ XMLCh* Base64::getCanonicalRepresentation(const XMLCh* const inputData , MemoryManager* const memMgr , Conformance conform) { if (!inputData || !*inputData) return 0; /*** * Move input data to a XMLByte buffer */ XMLSize_t srcLen = XMLString::stringLen(inputData); XMLByte *dataInByte = (XMLByte*) getExternalMemory(memMgr, (srcLen+1) * sizeof(XMLByte)); ArrayJanitor janFill(dataInByte, memMgr ? memMgr : XMLPlatformUtils::fgMemoryManager); for (XMLSize_t i = 0; i < srcLen; i++) dataInByte[i] = (XMLByte)inputData[i]; dataInByte[srcLen] = 0; /*** * Forward to the actual decoding method to do the decoding */ XMLSize_t decodedLength = 0; XMLByte* canRepInByte = 0; XMLByte* retStr = decode( dataInByte , &decodedLength , canRepInByte , memMgr , conform); if (!retStr) return 0; /*** * Move canonical representation to a XMLCh buffer to return */ XMLSize_t canRepLen = XMLString::stringLen((char*)canRepInByte); XMLCh *canRepData = (XMLCh*) getExternalMemory(memMgr, (canRepLen + 1) * sizeof(XMLCh)); for (XMLSize_t j = 0; j < canRepLen; j++) canRepData[j] = (XMLCh)canRepInByte[j]; canRepData[canRepLen] = 0; /*** * Release the memory allocated in the actual decoding method */ returnExternalMemory(memMgr, retStr); returnExternalMemory(memMgr, canRepInByte); return canRepData; } // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- // // return 0(null) if invalid data found. // return the buffer containning decoded data otherwise // the caller is responsible for the de-allocation of the // buffer returned. // // temporary data, rawInputData, is ALWAYS released by this function. // /*** * E2-9 * * Base64Binary ::= S? B64quartet* B64final? * * B64quartet ::= B64 S? B64 S? B64 S? B64 S? * * B64final ::= B64 S? B04 S? '=' S? '=' S? * | B64 S? B64 S? B16 S? '=' S? * * B04 ::= [AQgw] * B16 ::= [AEIMQUYcgkosw048] * B64 ::= [A-Za-z0-9+/] * * * E2-54 * * Base64Binary ::= ((B64S B64S B64S B64S)* * ((B64S B64S B64S B64) | * (B64S B64S B16S '=') | * (B64S B04S '=' #x20? '=')))? * * B64S ::= B64 #x20? * B16S ::= B16 #x20? * B04S ::= B04 #x20? * * * Note that this grammar requires the number of non-whitespace characters * in the lexical form to be a multiple of four, and for equals signs to * appear only at the end of the lexical form; strings which do not meet these * constraints are not legal lexical forms of base64Binary because they * cannot successfully be decoded by base64 decoders. * * Note: * The above definition of the lexical space is more restrictive than that given * in [RFC 2045] as regards whitespace -- this is not an issue in practice. Any * string compatible with the RFC can occur in an element or attribute validated * by this type, because the whiteSpace facet of this type is fixed to collapse, * which means that all leading and trailing whitespace will be stripped, and all * internal whitespace collapsed to single space characters, before the above grammar * is enforced. * */ XMLByte* Base64::decode ( const XMLByte* const inputData , XMLSize_t* decodedLength , XMLByte*& canRepData , MemoryManager* const memMgr , Conformance conform ) { if ((!inputData) || (!*inputData)) return 0; // // remove all XML whitespaces from the base64Data // XMLSize_t inputLength = XMLString::stringLen( (const char*)inputData ); XMLByte* rawInputData = (XMLByte*) getExternalMemory(memMgr, (inputLength+1) * sizeof(XMLByte)); ArrayJanitor jan(rawInputData, memMgr ? memMgr : XMLPlatformUtils::fgMemoryManager); XMLSize_t inputIndex = 0; XMLSize_t rawInputLength = 0; bool inWhiteSpace = false; switch (conform) { case Conf_RFC2045: while ( inputIndex < inputLength ) { if (!XMLChar1_0::isWhitespace(inputData[inputIndex])) { rawInputData[ rawInputLength++ ] = inputData[ inputIndex ]; } // RFC2045 does not explicitly forbid more than ONE whitespace // before, in between, or after base64 octects. // Besides, S? allows more than ONE whitespace as specified in the production // [3] S ::= (#x20 | #x9 | #xD | #xA)+ // therefore we do not detect multiple ws inputIndex++; } break; case Conf_Schema: // no leading #x20 if (chSpace == inputData[inputIndex]) return 0; while ( inputIndex < inputLength ) { if (chSpace != inputData[inputIndex]) { rawInputData[ rawInputLength++ ] = inputData[ inputIndex ]; inWhiteSpace = false; } else { if (inWhiteSpace) return 0; // more than 1 #x20 encountered else inWhiteSpace = true; } inputIndex++; } // no trailing #x20 if (inWhiteSpace) return 0; break; default: break; } //now rawInputData contains canonical representation //if the data is valid Base64 rawInputData[ rawInputLength ] = 0; // the length of raw data should be divisible by four if (( rawInputLength % FOURBYTE ) != 0 ) return 0; XMLSize_t quadrupletCount = rawInputLength / FOURBYTE; if ( quadrupletCount == 0 ) return 0; // // convert the quadruplet(s) to triplet(s) // XMLByte d1, d2, d3, d4; // base64 characters XMLByte b1, b2, b3, b4; // base64 binary codes ( 0..64 ) XMLSize_t rawInputIndex = 0; XMLSize_t outputIndex = 0; XMLByte *decodedData = (XMLByte*) getExternalMemory(memMgr, (quadrupletCount*3+1) * sizeof(XMLByte)); // // Process all quadruplet(s) except the last // XMLSize_t quad = 1; for (; quad <= quadrupletCount-1; quad++ ) { // read quadruplet from the input stream if (!isData( (d1 = rawInputData[ rawInputIndex++ ]) ) || !isData( (d2 = rawInputData[ rawInputIndex++ ]) ) || !isData( (d3 = rawInputData[ rawInputIndex++ ]) ) || !isData( (d4 = rawInputData[ rawInputIndex++ ]) )) { // if found "no data" just return NULL returnExternalMemory(memMgr, decodedData); return 0; } b1 = base64Inverse[ d1 ]; b2 = base64Inverse[ d2 ]; b3 = base64Inverse[ d3 ]; b4 = base64Inverse[ d4 ]; // write triplet to the output stream decodedData[ outputIndex++ ] = set1stOctet(b1, b2); decodedData[ outputIndex++ ] = set2ndOctet(b2, b3); decodedData[ outputIndex++ ] = set3rdOctet(b3, b4); } // // process the last Quadruplet // // first two octets are present always, process them if (!isData( (d1 = rawInputData[ rawInputIndex++ ]) ) || !isData( (d2 = rawInputData[ rawInputIndex++ ]) )) { // if found "no data" just return NULL returnExternalMemory(memMgr, decodedData); return 0; } b1 = base64Inverse[ d1 ]; b2 = base64Inverse[ d2 ]; // try to process last two octets d3 = rawInputData[ rawInputIndex++ ]; d4 = rawInputData[ rawInputIndex++ ]; if (!isData( d3 ) || !isData( d4 )) { // check if last two are PAD characters if (isPad( d3 ) && isPad( d4 )) { // two PAD e.g. 3c== if ((b2 & 0xf) != 0) // last 4 bits should be zero { returnExternalMemory(memMgr, decodedData); return 0; } decodedData[ outputIndex++ ] = set1stOctet(b1, b2); } else if (!isPad( d3 ) && isPad( d4 )) { // one PAD e.g. 3cQ= b3 = base64Inverse[ d3 ]; if (( b3 & 0x3 ) != 0 ) // last 2 bits should be zero { returnExternalMemory(memMgr, decodedData); return 0; } decodedData[ outputIndex++ ] = set1stOctet( b1, b2 ); decodedData[ outputIndex++ ] = set2ndOctet( b2, b3 ); } else { // an error like "3c[Pad]r", "3cdX", "3cXd", "3cXX" where X is non data returnExternalMemory(memMgr, decodedData); return 0; } } else { // no PAD e.g 3cQl b3 = base64Inverse[ d3 ]; b4 = base64Inverse[ d4 ]; decodedData[ outputIndex++ ] = set1stOctet( b1, b2 ); decodedData[ outputIndex++ ] = set2ndOctet( b2, b3 ); decodedData[ outputIndex++ ] = set3rdOctet( b3, b4 ); } // write out the end of string decodedData[ outputIndex ] = 0; *decodedLength = outputIndex; //allow the caller to have access to the canonical representation jan.release(); canRepData = rawInputData; return decodedData; } bool Base64::isData(const XMLByte& octet) { return (base64Inverse[octet]!=(XMLByte)-1); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XML256TableTranscoder.hpp000644 000765 000024 00000013175 13241160335 023653 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XML256TableTranscoder.hpp 635560 2008-03-10 14:10:09Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XML256TABLETRANSCODER_HPP) #define XERCESC_INCLUDE_GUARD_XML256TABLETRANSCODER_HPP #include XERCES_CPP_NAMESPACE_BEGIN // // This class implements the functionality of a common type of transcoder // for an 8 bit, single byte encoding based on a set of 'to' and 'from' // translation tables. Actual derived classes are trivial and just have to // provide us with pointers to their tables and we do all the work. // class XMLUTIL_EXPORT XML256TableTranscoder : public XMLTranscoder { public : // ----------------------------------------------------------------------- // Public constructors and destructor // ----------------------------------------------------------------------- virtual ~XML256TableTranscoder(); // ----------------------------------------------------------------------- // The virtual transcoding interface // ----------------------------------------------------------------------- virtual XMLSize_t transcodeFrom ( const XMLByte* const srcData , const XMLSize_t srcCount , XMLCh* const toFill , const XMLSize_t maxChars , XMLSize_t& bytesEaten , unsigned char* const charSizes ); virtual XMLSize_t transcodeTo ( const XMLCh* const srcData , const XMLSize_t srcCount , XMLByte* const toFill , const XMLSize_t maxBytes , XMLSize_t& charsEaten , const UnRepOpts options ); virtual bool canTranscodeTo ( const unsigned int toCheck ); protected : // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- XML256TableTranscoder ( const XMLCh* const encodingName , const XMLSize_t blockSize , const XMLCh* const fromTable , const XMLTransService::TransRec* const toTable , const XMLSize_t toTableSize , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); // ----------------------------------------------------------------------- // Protected helper methods // ----------------------------------------------------------------------- XMLByte xlatOneTo ( const XMLCh toXlat ) const; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XML256TableTranscoder(); XML256TableTranscoder(const XML256TableTranscoder&); XML256TableTranscoder& operator=(const XML256TableTranscoder&); // ----------------------------------------------------------------------- // Private data members // // fFromTable // This is the 'from' table that we were given during construction. // It is a 256 entry table of XMLCh chars. Each entry is the // Unicode code point for the external encoding point of that value. // So fFromTable[N] is the Unicode translation of code point N of // the source encoding. // // We don't own this table, we just refer to it. It is assumed that // the table is static, for performance reasons. // // fToSize // The 'to' table is variable sized. This indicates how many records // are in it. // // fToTable // This is a variable sized table of TransRec structures. It must // be sorted by the intCh field, i.e. the XMLCh field. It is searched // binarily to find the record for a particular Unicode char. Then // that record's extch field is the translation record. // // We don't own this table, we just refer to it. It is assumed that // the table is static, for performance reasons. // // NOTE: There may be dups of the extCh field, since there might be // multiple Unicode code points which map to the same external code // point. Normally this won't happen, since the parser assumes that // internalization is normalized, but we have to be prepared to do // the right thing if some client code gives us non-normalized data // itself. // ----------------------------------------------------------------------- const XMLCh* fFromTable; XMLSize_t fToSize; const XMLTransService::TransRec* fToTable; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/BitSet.hpp000644 000765 000024 00000007367 13241160336 021162 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BitSet.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_BITSET_HPP) #define XERCESC_INCLUDE_GUARD_BITSET_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT BitSet : public XMemory { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- BitSet( const XMLSize_t size , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); BitSet(const BitSet& toCopy); ~BitSet(); // ----------------------------------------------------------------------- // Equality methods // ----------------------------------------------------------------------- bool equals(const BitSet& other) const; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- bool allAreCleared() const; bool allAreSet() const; XMLSize_t size() const; bool get(const XMLSize_t index) const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void clear(const XMLSize_t index); void clearAll(); void set(const XMLSize_t index); // ----------------------------------------------------------------------- // Bitwise logical operations // ----------------------------------------------------------------------- void andWith(const BitSet& other); void orWith(const BitSet& other); void xorWith(const BitSet& other); // ----------------------------------------------------------------------- // Miscellaneous // ----------------------------------------------------------------------- XMLSize_t hash(const XMLSize_t hashModulus) const; private : // ----------------------------------------------------------------------- // Unimplemented constructors // ----------------------------------------------------------------------- BitSet(); BitSet& operator=(const BitSet&); // ----------------------------------------------------------------------- // Private methods // ----------------------------------------------------------------------- void ensureCapacity(const XMLSize_t bits); // ----------------------------------------------------------------------- // Data members // // fBits // The array of unsigned longs used to store the bits. // // fUnitLen // The length of the storage array, in storage units not bits. // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; unsigned long* fBits; XMLSize_t fUnitLen; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/Janitor.hpp000644 000765 000024 00000012621 13272177434 021376 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Janitor.hpp 1826420 2018-03-10 21:01:56Z rleigh $ */ #if !defined(XERCESC_INCLUDE_GUARD_JANITOR_HPP) #define XERCESC_INCLUDE_GUARD_JANITOR_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN template class Janitor : public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- Janitor(T* const toDelete); ~Janitor(); // ----------------------------------------------------------------------- // Public, non-virtual methods // ----------------------------------------------------------------------- void orphan(); // small amount of auto_ptr compatibility T& operator*() const; T* operator->() const; T* get() const; T* release(); void reset(T* p = 0); bool isDataNull(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- Janitor(); Janitor(const Janitor&); Janitor& operator=(const Janitor&); // ----------------------------------------------------------------------- // Private data members // // fData // This is the pointer to the object or structure that must be // destroyed when this object is destroyed. // ----------------------------------------------------------------------- T* fData; }; template class ArrayJanitor : public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- ArrayJanitor(T* const toDelete); ArrayJanitor(T* const toDelete, MemoryManager* const manager); ~ArrayJanitor(); // ----------------------------------------------------------------------- // Public, non-virtual methods // ----------------------------------------------------------------------- void orphan(); // small amount of auto_ptr compatibility T& operator[](XMLSize_t index) const; T* get() const; T* release(); void reset(T* p = 0); void reset(T* p, MemoryManager* const manager); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ArrayJanitor(); ArrayJanitor(const ArrayJanitor& copy); ArrayJanitor& operator=(const ArrayJanitor& copy); // ----------------------------------------------------------------------- // Private data members // // fData // This is the pointer to the object or structure that must be // destroyed when this object is destroyed. // ----------------------------------------------------------------------- T* fData; MemoryManager* fMemoryManager; }; template class JanitorMemFunCall { public : typedef void (T::*MFPT) (); // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- JanitorMemFunCall( T* object, MFPT toCall); ~JanitorMemFunCall(); // small amount of auto_ptr compatibility T& operator*() const; T* operator->() const; T* get() const; T* release(); void reset(T* p = 0); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- JanitorMemFunCall(); JanitorMemFunCall(const JanitorMemFunCall&); JanitorMemFunCall& operator=(const JanitorMemFunCall&); // ----------------------------------------------------------------------- // Private data members // // fObject // This is the pointer to the object for which we will call the // member function when this object is destroyed. // ----------------------------------------------------------------------- T* fObject; MFPT fToCall; }; XERCES_TEMPLATE_EXTERN template class XMLUTIL_EXPORT ArrayJanitor; XERCES_TEMPLATE_EXTERN template class XMLUTIL_EXPORT ArrayJanitor; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/IllegalArgumentException.hpp000644 000765 000024 00000002301 13241160336 024702 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IllegalArgumentException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_ILLEGALARGUMENTEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_ILLEGALARGUMENTEXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(IllegalArgumentException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XML88591Transcoder.hpp000644 000765 000024 00000006345 13241160336 023067 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XML88591Transcoder.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XML88591TRANSCODER_HPP) #define XERCESC_INCLUDE_GUARD_XML88591TRANSCODER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN // // This class provides an implementation of the XMLTranscoder interface // for a simple 8859-1 transcoder. The parser does some encodings // intrinsically without depending upon external transcoding services. // To make everything more orthogonal, we implement these internal // transcoders using the same transcoder abstraction as the pluggable // transcoding services do. // class XMLUTIL_EXPORT XML88591Transcoder : public XMLTranscoder { public : // ----------------------------------------------------------------------- // Public constructors and destructor // ----------------------------------------------------------------------- XML88591Transcoder ( const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~XML88591Transcoder(); // ----------------------------------------------------------------------- // Implementation of the XMLTranscoder interface // ----------------------------------------------------------------------- virtual XMLSize_t transcodeFrom ( const XMLByte* const srcData , const XMLSize_t srcCount , XMLCh* const toFill , const XMLSize_t maxChars , XMLSize_t& bytesEaten , unsigned char* const charSizes ); virtual XMLSize_t transcodeTo ( const XMLCh* const srcData , const XMLSize_t srcCount , XMLByte* const toFill , const XMLSize_t maxBytes , XMLSize_t& charsEaten , const UnRepOpts options ); virtual bool canTranscodeTo ( const unsigned int toCheck ); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XML88591Transcoder(const XML88591Transcoder&); XML88591Transcoder& operator=(const XML88591Transcoder&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/ArrayIndexOutOfBoundsException.hpp000644 000765 000024 00000002262 13241160336 026032 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ArrayIndexOutOfBoundsException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_ARRAYINDEXOUTOFBOUNDSEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_ARRAYINDEXOUTOFBOUNDSEXCEPTION_HPP #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(ArrayIndexOutOfBoundsException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/Hash2KeysSetOf.hpp000644 000765 000024 00000020312 13241160335 022512 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Hash2KeysSetOf.hpp 883368 2009-11-23 15:28:19Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_HASH2KEYSSETOF_HPP) #define XERCESC_INCLUDE_GUARD_HASH2KEYSSETOF_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // This hash table is similar to Hash2KeysSetOf with an additional integer as key2 // Forward declare the enumerator so it can be our friend. // template class Hash2KeysSetOfEnumerator; // // This should really be a nested class, but some of the compilers we // have to support cannot deal with that! // struct Hash2KeysSetBucketElem { Hash2KeysSetBucketElem* fNext; const void* fKey1; int fKey2; }; template class Hash2KeysSetOf : public XMemory { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- Hash2KeysSetOf( const XMLSize_t modulus, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); Hash2KeysSetOf( const XMLSize_t modulus, const THasher& hasher, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~Hash2KeysSetOf(); // ----------------------------------------------------------------------- // Element management // ----------------------------------------------------------------------- bool isEmpty() const; bool containsKey(const void* const key1, const int key2) const; void removeKey(const void* const key1, const int key2); void removeKey(const void* const key1); void removeAll(); // ----------------------------------------------------------------------- // Getters // ----------------------------------------------------------------------- MemoryManager* getMemoryManager() const; XMLSize_t getHashModulus() const; // ----------------------------------------------------------------------- // Putters // ----------------------------------------------------------------------- void put(const void* key1, int key2); bool putIfNotPresent(const void* key1, int key2); private : // ----------------------------------------------------------------------- // Declare our friends // ----------------------------------------------------------------------- friend class Hash2KeysSetOfEnumerator; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- Hash2KeysSetOf(const Hash2KeysSetOf&); Hash2KeysSetOf& operator=(const Hash2KeysSetOf&); // ----------------------------------------------------------------------- // Private methods // ----------------------------------------------------------------------- Hash2KeysSetBucketElem* findBucketElem(const void* const key1, const int key2, XMLSize_t& hashVal); const Hash2KeysSetBucketElem* findBucketElem(const void* const key1, const int key2, XMLSize_t& hashVal) const; void initialize(const XMLSize_t modulus); void rehash(); // ----------------------------------------------------------------------- // Data members // // fBucketList // This is the array that contains the heads of all of the list // buckets, one for each possible hash value. // // fHashModulus // The modulus used for this hash table, to hash the keys. This is // also the number of elements in the bucket list. // // fCount // The number of elements currently in the map // // fHash // The hasher for the key1 data type. // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; Hash2KeysSetBucketElem** fBucketList; XMLSize_t fHashModulus; XMLSize_t fCount; Hash2KeysSetBucketElem* fAvailable; THasher fHasher; }; // // An enumerator for a value array. It derives from the basic enumerator // class, so that value vectors can be generically enumerated. // template class Hash2KeysSetOfEnumerator : public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- Hash2KeysSetOfEnumerator(Hash2KeysSetOf* const toEnum , const bool adopt = false , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); virtual ~Hash2KeysSetOfEnumerator(); // ----------------------------------------------------------------------- // Enum interface // ----------------------------------------------------------------------- bool hasMoreElements() const; void Reset(); // ----------------------------------------------------------------------- // New interface // ----------------------------------------------------------------------- void nextElementKey(const void*&, int&); void setPrimaryKey(const void* key); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- Hash2KeysSetOfEnumerator(const Hash2KeysSetOfEnumerator&); Hash2KeysSetOfEnumerator& operator=(const Hash2KeysSetOfEnumerator&); // ----------------------------------------------------------------------- // Private methods // ----------------------------------------------------------------------- void findNext(); // ----------------------------------------------------------------------- // Data Members // // fAdopted // Indicates whether we have adopted the passed vector. If so then // we delete the vector when we are destroyed. // // fCurElem // This is the current bucket bucket element that we are on. // // fCurHash // The is the current hash buck that we are working on. Once we hit // the end of the bucket that fCurElem is in, then we have to start // working this one up to the next non-empty bucket. // // fToEnum // The value array being enumerated. // // fLockPrimaryKey // Indicates that we are requested to iterate over the secondary keys // associated with the given primary key // // ----------------------------------------------------------------------- bool fAdopted; Hash2KeysSetBucketElem* fCurElem; XMLSize_t fCurHash; Hash2KeysSetOf* fToEnum; MemoryManager* const fMemoryManager; const void* fLockPrimaryKey; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/LogicalPath.c000644 000765 000024 00000020314 13241160336 021575 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: LogicalPath.c 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_WEAVEPATH_CPP) #define XERCESC_INCLUDE_GUARD_WEAVEPATH_CPP /*** * * Previously, each PlatformUtils.cpp has its onw copy of the * method weavePaths(), and almost of them implemented the same logic, * with few platform specific difference, and unfortunately that * implementation was wrong. * * The only platform specific issue is slash character. * On all platforms other than Windows, chForwardSlash and chBackSlash * are considered slash, while on Windows, two additional characters, * chYenSign and chWonSign are slash as well. * * The idea is to maintain a SINGLE copy of this method rather than * each PlatformUtils.cpp has its own copy, we introduce a new * method, XMLPlatformUtils::isAnySlash(), to replace the direct checking * code ( if ( c == chForwardSlash || c == chBackSlash). * * With this approach, we might have a performance hit since isAnySlash() * is so frequently used in this implementation, so we intend to make it * inline. Then we face a complier issue. * * There are two compilation units involved, one is PlatformUtils.cpp and * the other PlatformUtils.cpp. When PlatformUtils.cp get compiled, * the weavePath(), remove**Slash() have dependency upon isAnySlash() which * is in PlatformUtils.cpp (and what is worse, it is inlined), so we have * undefined/unresolved symbol: isAnySlash() on AIX/xlc_r, Solaris/cc and * Linux/gcc, while MSVC and HP/aCC are fine with this. * * That means we can not place these new methods in PlatformUtils.cpp with * inlined XMLPlatformUtils::isAnySlash() in PlatformUtils.cpp. * * The solution to this is PlatformUtils.cpp will include this file so that * we have only one copy of these methods while get compiled in PlatformUtils * inlined isAnySlash(). * ***/ XMLCh* XMLPlatformUtils::weavePaths(const XMLCh* const basePath , const XMLCh* const relativePath , MemoryManager* const manager) { // Create a buffer as large as both parts and empty it XMLCh* tmpBuf = (XMLCh*) manager->allocate ( (XMLString::stringLen(basePath) + XMLString::stringLen(relativePath) + 2) * sizeof(XMLCh) );//new XMLCh[XMLString::stringLen(basePath) + XMLString::stringLen(relativePath) + 2]; *tmpBuf = 0; // // If we have no base path, then just take the relative path as is. // if ((!basePath) || (!*basePath)) { XMLString::copyString(tmpBuf, relativePath); return tmpBuf; } // // Remove anything after the last slash // const XMLCh* basePtr = basePath + (XMLString::stringLen(basePath) - 1); while ((basePtr >= basePath) && ((isAnySlash(*basePtr) == false))) { basePtr--; } // There is no relevant base path, so just take the relative part if (basePtr < basePath) { XMLString::copyString(tmpBuf, relativePath); return tmpBuf; } // // 1. concatenate the base and relative // 2. remove all occurrences of "/./" // 3. remove all occurrences of segment/../ where segment is not ../ // XMLString::subString(tmpBuf, basePath, 0, (basePtr - basePath + 1), manager); tmpBuf[basePtr - basePath + 1] = 0; XMLString::catString(tmpBuf, relativePath); removeDotSlash(tmpBuf, manager); removeDotDotSlash(tmpBuf, manager); return tmpBuf; } // // Remove all occurrences of './' when it is part of '/./' // // Since it could be '.\' or other combination on windows ( eg, '.'+chYanSign) // we can't make use of patterMatch(). // // void XMLPlatformUtils::removeDotSlash(XMLCh* const path , MemoryManager* const manager) { if ((!path) || (!*path)) return; XMLCh* srcPtr = XMLString::replicate(path, manager); int srcLen = XMLString::stringLen(srcPtr); ArrayJanitor janName(srcPtr, manager); XMLCh* tarPtr = path; while (*srcPtr) { if ( 3 <= srcLen ) { if ( (isAnySlash(*srcPtr)) && (chPeriod == *(srcPtr+1)) && (isAnySlash(*(srcPtr+2))) ) { // "\.\x" seen // skip the first two, and start from the 3rd, // since "\x" could be another "\." srcPtr+=2; srcLen-=2; } else { *tarPtr++ = *srcPtr++; // eat the current char srcLen--; } } else if ( 1 == srcLen ) { *tarPtr++ = *srcPtr++; } else if ( 2 == srcLen) { *tarPtr++ = *srcPtr++; *tarPtr++ = *srcPtr++; } } *tarPtr = 0; return; } // // Remove all occurrences of '/segment/../' when segment is not '..' // // Cases with extra /../ is left to the underlying file system. // void XMLPlatformUtils::removeDotDotSlash(XMLCh* const path , MemoryManager* const manager) { int pathLen = XMLString::stringLen(path); XMLCh* tmp1 = (XMLCh*) manager->allocate ( (pathLen+1) * sizeof(XMLCh) );//new XMLCh [pathLen+1]; ArrayJanitor tmp1Name(tmp1, manager); XMLCh* tmp2 = (XMLCh*) manager->allocate ( (pathLen+1) * sizeof(XMLCh) );//new XMLCh [pathLen+1]; ArrayJanitor tmp2Name(tmp2, manager); // remove all "/../" where "" is a complete // path segment not equal to ".." int index = -1; int segIndex = -1; int offset = 1; while ((index = searchSlashDotDotSlash(&(path[offset]))) != -1) { // Undo offset index += offset; // Find start of within substring ending at found point. XMLString::subString(tmp1, path, 0, index-1, manager); segIndex = index - 1; while ((segIndex >= 0) && (!isAnySlash(tmp1[segIndex]))) { segIndex--; } // Ensure exists and != ".." if (segIndex >= 0 && (path[segIndex+1] != chPeriod || path[segIndex+2] != chPeriod || segIndex + 3 != index)) { XMLString::subString(tmp1, path, 0, segIndex, manager); XMLString::subString(tmp2, path, index+3, XMLString::stringLen(path), manager); path[0] = 0; XMLString::catString(path, tmp1); XMLString::catString(path, tmp2); offset = (segIndex == 0 ? 1 : segIndex); } else { offset += 4; } }// while } int XMLPlatformUtils::searchSlashDotDotSlash(XMLCh* const srcPath) { if ((!srcPath) || (!*srcPath)) return -1; XMLCh* srcPtr = srcPath; int srcLen = XMLString::stringLen(srcPath); int retVal = -1; while (*srcPtr) { if ( 4 <= srcLen ) { if ( (isAnySlash(*srcPtr)) && (chPeriod == *(srcPtr+1)) && (chPeriod == *(srcPtr+2)) && (isAnySlash(*(srcPtr+3))) ) { retVal = (srcPtr - srcPath); break; } else { srcPtr++; srcLen--; } } else { break; } } // while return retVal; } #endif xerces-c-3.2.2/src/xercesc/util/XMLUTF8Transcoder.hpp000644 000765 000024 00000010140 13241160336 023103 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLUTF8Transcoder.hpp 1383364 2012-09-11 11:48:30Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLUTF8TRANSCODER_HPP) #define XERCESC_INCLUDE_GUARD_XMLUTF8TRANSCODER_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN // // This class provides an implementation of the XMLTranscoder interface // for a simple UTF8 transcoder. The parser does some encodings // intrinsically without depending upon external transcoding services. // To make everything more orthogonal, we implement these internal // transcoders using the same transcoder abstraction as the pluggable // transcoding services do. // class XMLUTIL_EXPORT XMLUTF8Transcoder : public XMLTranscoder { public : // ----------------------------------------------------------------------- // Public constructors and destructor // ----------------------------------------------------------------------- XMLUTF8Transcoder ( const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~XMLUTF8Transcoder(); // ----------------------------------------------------------------------- // Implementation of the XMLTranscoder interface // ----------------------------------------------------------------------- virtual XMLSize_t transcodeFrom ( const XMLByte* const srcData , const XMLSize_t srcCount , XMLCh* const toFill , const XMLSize_t maxChars , XMLSize_t& bytesEaten , unsigned char* const charSizes ); virtual XMLSize_t transcodeTo ( const XMLCh* const srcData , const XMLSize_t srcCount , XMLByte* const toFill , const XMLSize_t maxBytes , XMLSize_t& charsEaten , const UnRepOpts options ); virtual bool canTranscodeTo ( const unsigned int toCheck ); private : inline void checkTrailingBytes( const XMLByte toCheck , const unsigned int trailingBytes , const unsigned int position ) const; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLUTF8Transcoder(const XMLUTF8Transcoder&); XMLUTF8Transcoder& operator=(const XMLUTF8Transcoder&); }; inline void XMLUTF8Transcoder::checkTrailingBytes(const XMLByte toCheck , const unsigned int trailingBytes , const unsigned int position) const { if((toCheck & 0xC0) != 0x80) { char len[2] = {(char)(trailingBytes+0x31), 0}; char pos[2] = {(char)(position+0x31), 0}; char byte[2] = {(char)toCheck,0}; ThrowXMLwithMemMgr3(UTFDataFormatException, XMLExcepts::UTF8_FormatError, pos, byte, len, getMemoryManager()); } } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLException.hpp000644 000765 000024 00000023342 13241160336 022276 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLException.hpp 673960 2008-07-04 08:50:12Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_XMLEXCEPTION_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // This is the base class from which all the XML parser exceptions are // derived. The virtual interface is very simple and most of the functionality // is in this class. // // Because all derivatives are EXACTLY the same except for the static // string that is used to hold the name of the class, a macro is provided // below via which they are all created. // --------------------------------------------------------------------------- class XMLUTIL_EXPORT XMLException : public XMemory { public: // ----------------------------------------------------------------------- // Virtual Destructor // ----------------------------------------------------------------------- virtual ~XMLException(); // ----------------------------------------------------------------------- // The XML exception virtual interface // ----------------------------------------------------------------------- virtual const XMLCh* getType() const = 0; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- XMLExcepts::Codes getCode() const; const XMLCh* getMessage() const; const char* getSrcFile() const; XMLFileLoc getSrcLine() const; XMLErrorReporter::ErrTypes getErrorType() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- void setPosition(const char* const file, const XMLFileLoc line); // ----------------------------------------------------------------------- // Hidden constructors and operators // // NOTE: Technically, these should be protected, since this is a // base class that is never used directly. However, VC++ 6.0 will // fail to catch via a reference to base class if the ctors are // not public!! This seems to have been caused by the install // of IE 5.0. // ----------------------------------------------------------------------- XMLException(); XMLException(const char* const srcFile, const XMLFileLoc srcLine, MemoryManager* const memoryManager = 0); XMLException(const XMLException& toCopy); XMLException& operator=(const XMLException& toAssign); protected : // ----------------------------------------------------------------------- // Protected methods // ----------------------------------------------------------------------- void loadExceptText ( const XMLExcepts::Codes toLoad ); void loadExceptText ( const XMLExcepts::Codes toLoad , const XMLCh* const text1 , const XMLCh* const text2 = 0 , const XMLCh* const text3 = 0 , const XMLCh* const text4 = 0 ); void loadExceptText ( const XMLExcepts::Codes toLoad , const char* const text1 , const char* const text2 = 0 , const char* const text3 = 0 , const char* const text4 = 0 ); private : // ----------------------------------------------------------------------- // Data members // // fCode // The error code that this exception represents. // // fSrcFile // fSrcLine // These are the file and line information from the source where the // exception was thrown from. // // fMsg // The loaded message text for this exception. // ----------------------------------------------------------------------- XMLExcepts::Codes fCode; char* fSrcFile; XMLFileLoc fSrcLine; XMLCh* fMsg; protected: MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // XMLException: Getter methods // --------------------------------------------------------------------------- inline XMLExcepts::Codes XMLException::getCode() const { return fCode; } inline const XMLCh* XMLException::getMessage() const { return fMsg; } inline const char* XMLException::getSrcFile() const { if (!fSrcFile) return ""; return fSrcFile; } inline XMLFileLoc XMLException::getSrcLine() const { return fSrcLine; } inline XMLErrorReporter::ErrTypes XMLException::getErrorType() const { if ((fCode >= XMLExcepts::W_LowBounds) && (fCode <= XMLExcepts::W_HighBounds)) return XMLErrorReporter::ErrType_Warning; else if ((fCode >= XMLExcepts::F_LowBounds) && (fCode <= XMLExcepts::F_HighBounds)) return XMLErrorReporter::ErrType_Fatal; else if ((fCode >= XMLExcepts::E_LowBounds) && (fCode <= XMLExcepts::E_HighBounds)) return XMLErrorReporter::ErrType_Error; return XMLErrorReporter::ErrTypes_Unknown; } // --------------------------------------------------------------------------- // This macro is used to create derived classes. They are all identical // except the name of the exception, so it crazy to type them in over and // over. // --------------------------------------------------------------------------- #define MakeXMLException(theType, expKeyword) \ class expKeyword theType : public XMLException \ { \ public: \ \ theType(const char* const srcFile \ , const XMLFileLoc srcLine \ , const XMLExcepts::Codes toThrow \ , MemoryManager* memoryManager = 0) : \ XMLException(srcFile, srcLine, memoryManager) \ { \ loadExceptText(toThrow); \ } \ \ theType(const theType& toCopy) : \ \ XMLException(toCopy) \ { \ } \ \ theType(const char* const srcFile \ , const XMLFileLoc srcLine \ , const XMLExcepts::Codes toThrow \ , const XMLCh* const text1 \ , const XMLCh* const text2 = 0 \ , const XMLCh* const text3 = 0 \ , const XMLCh* const text4 = 0 \ , MemoryManager* memoryManager = 0) : \ XMLException(srcFile, srcLine, memoryManager) \ { \ loadExceptText(toThrow, text1, text2, text3, text4); \ } \ \ theType(const char* const srcFile \ , const XMLFileLoc srcLine \ , const XMLExcepts::Codes toThrow \ , const char* const text1 \ , const char* const text2 = 0 \ , const char* const text3 = 0 \ , const char* const text4 = 0 \ , MemoryManager* memoryManager = 0) : \ XMLException(srcFile, srcLine, memoryManager) \ { \ loadExceptText(toThrow, text1, text2, text3, text4); \ } \ \ virtual ~theType() {} \ \ theType& operator=(const theType& toAssign) \ { \ XMLException::operator=(toAssign); \ return *this; \ } \ \ virtual XMLException* duplicate() const \ { \ return new (fMemoryManager) theType(*this); \ } \ \ virtual const XMLCh* getType() const \ { \ return XMLUni::fg##theType##_Name; \ } \ \ private : \ theType(); \ }; // --------------------------------------------------------------------------- // This macros is used to actually throw an exception. It is used in order // to make sure that source code line/col info is stored correctly, and to // give flexibility for other stuff in the future. // --------------------------------------------------------------------------- #define ThrowXML(type,code) throw type(__FILE__, __LINE__, code) #define ThrowXML1(type,code,p1) throw type(__FILE__, __LINE__, code, p1) #define ThrowXML2(type,code,p1,p2) throw type(__FILE__, __LINE__, code, p1, p2) #define ThrowXML3(type,code,p1,p2,p3) throw type(__FILE__, __LINE__, code, p1, p2, p3) #define ThrowXML4(type,code,p1,p2,p3,p4) throw type(__FILE__, __LINE__, code, p1, p2, p3, p4) #define ThrowXMLwithMemMgr(type,code,memMgr) throw type(__FILE__, __LINE__, code, memMgr) #define ThrowXMLwithMemMgr1(type,code,p1,memMgr) throw type(__FILE__, __LINE__, code, p1, 0, 0, 0, memMgr) #define ThrowXMLwithMemMgr2(type,code,p1,p2,memMgr) throw type(__FILE__, __LINE__, code, p1, p2, 0, 0, memMgr) #define ThrowXMLwithMemMgr3(type,code,p1,p2,p3,memMgr) throw type(__FILE__, __LINE__, code, p1, p2, p3, 0, memMgr) #define ThrowXMLwithMemMgr4(type,code,p1,p2,p3,p4,memMgr) throw type(__FILE__, __LINE__, code, p1, p2, p3, p4, memMgr) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/KeyValuePair.c000644 000765 000024 00000005641 13241160336 021755 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: KeyValuePair.c 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Include // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // KeyValuePair: Constructors and Destructor // --------------------------------------------------------------------------- template KeyValuePair::KeyValuePair() { } template KeyValuePair:: KeyValuePair(const TKey& key, const TValue& value) : fKey(key) , fValue(value) { } template KeyValuePair:: KeyValuePair(const KeyValuePair& toCopy) : fKey(toCopy.fKey) , fValue(toCopy.fValue) { } template KeyValuePair::~KeyValuePair() { } // --------------------------------------------------------------------------- // KeyValuePair: Getters // --------------------------------------------------------------------------- template const TKey& KeyValuePair::getKey() const { return fKey; } template TKey& KeyValuePair::getKey() { return fKey; } template const TValue& KeyValuePair::getValue() const { return fValue; } template TValue& KeyValuePair::getValue() { return fValue; } // --------------------------------------------------------------------------- // KeyValuePair: Setters // --------------------------------------------------------------------------- template TKey& KeyValuePair::setKey(const TKey& newKey) { fKey = newKey; return fKey; } template TValue& KeyValuePair::setValue(const TValue& newValue) { fValue = newValue; return fValue; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/RuntimeException.hpp000644 000765 000024 00000002242 13241160336 023255 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: RuntimeException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_RUNTIMEEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_RUNTIMEEXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(RuntimeException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/Hashers.hpp000644 000765 000024 00000004673 13241160335 021361 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Hashers.hpp 679382 2008-07-24 12:09:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_HASHERS_HPP) #define XERCESC_INCLUDE_GUARD_HASHERS_HPP #include XERCES_CPP_NAMESPACE_BEGIN // // Common hashers. Only widely-used hashers should be placed here. // /** * Hasher for keys that are const XMLCh*. */ struct StringHasher { /** * Returns a hash value based on the key * * @param key the key to be hashed * @param mod the modulus the hasher should use */ XMLSize_t getHashVal(const void* key, XMLSize_t mod) const { return XMLString::hash ((const XMLCh*)key, mod); } /** * Compares two keys and determines if they are semantically equal * * @param key1 the first key to be compared * @param key2 the second key to be compared * * @return true if they are equal */ bool equals(const void *const key1, const void *const key2) const { return XMLString::equals ((const XMLCh*)key1, (const XMLCh*)key2); } }; /** * Hasher for keys that are pointers. */ struct PtrHasher { /** * Returns a hash value based on the key * * @param key the key to be hashed * @param mod the modulus the hasher should use */ XMLSize_t getHashVal(const void* key, XMLSize_t mod) const { return ((XMLSize_t)key) % mod; } /** * Compares two keys and determines if they are semantically equal * * @param key1 the first key to be compared * @param key2 the second key to be compared * * @return true if they are equal */ bool equals(const void *const key1, const void *const key2) const { return key1 == key2; } }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/CountedPointer.hpp000644 000765 000024 00000004447 13241160336 022726 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: CountedPointer.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_COUNTEDPOINTERTO_HPP) #define XERCESC_INCLUDE_GUARD_COUNTEDPOINTERTO_HPP #include XERCES_CPP_NAMESPACE_BEGIN template class CountedPointerTo : public XMemory { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- CountedPointerTo(const CountedPointerTo& toCopy); CountedPointerTo(T* p = 0); ~CountedPointerTo(); // ----------------------------------------------------------------------- // Operators // ----------------------------------------------------------------------- CountedPointerTo& operator=(const CountedPointerTo& other); operator T*(); const T* operator->() const; T* operator->(); const T& operator*() const; T& operator*(); private: // ----------------------------------------------------------------------- // Data members // // fPtr // The pointer that we are counting. The T type must implement the // addRef() and removeRef() APIs but it doesn't have to derive from // any particular type. // ----------------------------------------------------------------------- T* fPtr; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/ValueHashTableOf.c000644 000765 000024 00000035546 13241160336 022540 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ValueHashTableOf.c 679340 2008-07-24 10:28:29Z borisk $ */ // --------------------------------------------------------------------------- // Include // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // ValueHashTableOf: Constructors and Destructor // --------------------------------------------------------------------------- template ValueHashTableOf::ValueHashTableOf( const XMLSize_t modulus , const THasher& hasher , MemoryManager* const manager) : fMemoryManager(manager) , fBucketList(0) , fHashModulus(modulus) , fInitialModulus(modulus) , fCount(0) , fHasher(hasher) { initialize(modulus); } template ValueHashTableOf::ValueHashTableOf( const XMLSize_t modulus , MemoryManager* const manager) : fMemoryManager(manager) , fBucketList(0) , fHashModulus(modulus) , fInitialModulus(modulus) , fCount(0) , fHasher() { initialize(modulus); } template void ValueHashTableOf::initialize(const XMLSize_t modulus) { if (modulus == 0) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::HshTbl_ZeroModulus, fMemoryManager); // Allocate the bucket list and zero them fBucketList = (ValueHashTableBucketElem**) fMemoryManager->allocate ( fHashModulus * sizeof(ValueHashTableBucketElem*) ); //new ValueHashTableBucketElem*[fHashModulus]; memset(fBucketList, 0, sizeof(fBucketList[0]) * fHashModulus); } template ValueHashTableOf::~ValueHashTableOf() { removeAll(); // Then delete the bucket list & hasher fMemoryManager->deallocate(fBucketList); //delete [] fBucketList; } // --------------------------------------------------------------------------- // ValueHashTableOf: Element management // --------------------------------------------------------------------------- template bool ValueHashTableOf::isEmpty() const { return fCount==0; } template bool ValueHashTableOf:: containsKey(const void* const key) const { XMLSize_t hashVal; const ValueHashTableBucketElem* findIt = findBucketElem(key, hashVal); return (findIt != 0); } template void ValueHashTableOf:: removeKey(const void* const key) { XMLSize_t hashVal; removeBucketElem(key, hashVal); } template void ValueHashTableOf::removeAll() { if(isEmpty()) return; // Clean up the buckets first for (XMLSize_t buckInd = 0; buckInd < fHashModulus; buckInd++) { // Get the bucket list head for this entry ValueHashTableBucketElem* curElem = fBucketList[buckInd]; ValueHashTableBucketElem* nextElem; while (curElem) { // Save the next element before we hose this one nextElem = curElem->fNext; // delete the current element and move forward // destructor is empty... // curElem->~ValueHashTableBucketElem(); fMemoryManager->deallocate(curElem); curElem = nextElem; } // Clean out this entry fBucketList[buckInd] = 0; } fCount = 0; } // --------------------------------------------------------------------------- // ValueHashTableOf: Getters // --------------------------------------------------------------------------- template TVal& ValueHashTableOf::get(const void* const key, MemoryManager* const manager) { XMLSize_t hashVal; ValueHashTableBucketElem* findIt = findBucketElem(key, hashVal); if (!findIt) ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::HshTbl_NoSuchKeyExists, manager); return findIt->fData; } template const TVal& ValueHashTableOf:: get(const void* const key) const { XMLSize_t hashVal; const ValueHashTableBucketElem* findIt = findBucketElem(key, hashVal); if (!findIt) ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::HshTbl_NoSuchKeyExists, fMemoryManager); return findIt->fData; } // --------------------------------------------------------------------------- // ValueHashTableOf: Putters // --------------------------------------------------------------------------- template void ValueHashTableOf::put(void* key, const TVal& valueToAdopt) { // Apply 0.75 load factor to find threshold. XMLSize_t threshold = fHashModulus * 3 / 4; // If we've grown too big, expand the table and rehash. if (fCount >= threshold) rehash(); // First see if the key exists already XMLSize_t hashVal; ValueHashTableBucketElem* newBucket = findBucketElem(key, hashVal); // // If so,then update its value. If not, then we need to add it to // the right bucket // if (newBucket) { newBucket->fData = valueToAdopt; newBucket->fKey = key; } else { newBucket = new (fMemoryManager->allocate(sizeof(ValueHashTableBucketElem))) ValueHashTableBucketElem(key, valueToAdopt, fBucketList[hashVal]); fBucketList[hashVal] = newBucket; fCount++; } } // --------------------------------------------------------------------------- // ValueHashTableOf: Private methods // --------------------------------------------------------------------------- template void ValueHashTableOf::rehash() { const XMLSize_t newMod = (fHashModulus * 2) + 1; ValueHashTableBucketElem** newBucketList = (ValueHashTableBucketElem**) fMemoryManager->allocate ( newMod * sizeof(ValueHashTableBucketElem*) );//new RefHashTableBucketElem*[newMod]; // Make sure the new bucket list is destroyed if an // exception is thrown. ArrayJanitor*> guard(newBucketList, fMemoryManager); memset(newBucketList, 0, newMod * sizeof(newBucketList[0])); // Rehash all existing entries. for (XMLSize_t index = 0; index < fHashModulus; index++) { // Get the bucket list head for this entry ValueHashTableBucketElem* curElem = fBucketList[index]; while (curElem) { // Save the next element before we detach this one ValueHashTableBucketElem* const nextElem = curElem->fNext; const XMLSize_t hashVal = fHasher.getHashVal(curElem->fKey, newMod); assert(hashVal < newMod); ValueHashTableBucketElem* const newHeadElem = newBucketList[hashVal]; // Insert at the start of this bucket's list. curElem->fNext = newHeadElem; newBucketList[hashVal] = curElem; curElem = nextElem; } } ValueHashTableBucketElem** const oldBucketList = fBucketList; // Everything is OK at this point, so update the // member variables. fBucketList = guard.release(); fHashModulus = newMod; // Delete the old bucket list. fMemoryManager->deallocate(oldBucketList);//delete[] oldBucketList; } template inline ValueHashTableBucketElem* ValueHashTableOf:: findBucketElem(const void* const key, XMLSize_t& hashVal) { // Hash the key hashVal = fHasher.getHashVal(key, fHashModulus); assert(hashVal < fHashModulus); // Search that bucket for the key ValueHashTableBucketElem* curElem = fBucketList[hashVal]; while (curElem) { if (fHasher.equals(key, curElem->fKey)) return curElem; curElem = curElem->fNext; } return 0; } template inline const ValueHashTableBucketElem* ValueHashTableOf:: findBucketElem(const void* const key, XMLSize_t& hashVal) const { // Hash the key hashVal = fHasher.getHashVal(key, fHashModulus); assert(hashVal < fHashModulus); // Search that bucket for the key const ValueHashTableBucketElem* curElem = fBucketList[hashVal]; while (curElem) { if (fHasher.equals(key, curElem->fKey)) return curElem; curElem = curElem->fNext; } return 0; } template void ValueHashTableOf:: removeBucketElem(const void* const key, XMLSize_t& hashVal) { // Hash the key hashVal = fHasher.getHashVal(key, fHashModulus); assert(hashVal < fHashModulus); // // Search the given bucket for this key. Keep up with the previous // element so we can patch around it. // ValueHashTableBucketElem* curElem = fBucketList[hashVal]; ValueHashTableBucketElem* lastElem = 0; while (curElem) { if (fHasher.equals(key, curElem->fKey)) { if (!lastElem) { // It was the first in the bucket fBucketList[hashVal] = curElem->fNext; } else { // Patch around the current element lastElem->fNext = curElem->fNext; } // Delete the current element // delete curElem; // destructor is empty... // curElem->~ValueHashTableBucketElem(); fMemoryManager->deallocate(curElem); fCount--; return; } // Move both pointers upwards lastElem = curElem; curElem = curElem->fNext; } // We never found that key ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::HshTbl_NoSuchKeyExists, fMemoryManager); } // --------------------------------------------------------------------------- // ValueHashTableOfEnumerator: Constructors and Destructor // --------------------------------------------------------------------------- template ValueHashTableOfEnumerator:: ValueHashTableOfEnumerator(ValueHashTableOf* const toEnum , const bool adopt , MemoryManager* const manager) : fAdopted(adopt), fCurElem(0), fCurHash((XMLSize_t)-1), fToEnum(toEnum), fMemoryManager(manager) { if (!toEnum) ThrowXMLwithMemMgr(NullPointerException, XMLExcepts::CPtr_PointerIsZero, manager); // // Find the next available bucket element in the hash table. If it // comes back zero, that just means the table is empty. // // Note that the -1 in the current hash tells it to start from the // beginning. // findNext(); } template ValueHashTableOfEnumerator::~ValueHashTableOfEnumerator() { if (fAdopted) delete fToEnum; } // --------------------------------------------------------------------------- // ValueHashTableOfEnumerator: Enum interface // --------------------------------------------------------------------------- template bool ValueHashTableOfEnumerator::hasMoreElements() const { // // If our current has is at the max and there are no more elements // in the current bucket, then no more elements. // if (!fCurElem && (fCurHash == fToEnum->fHashModulus)) return false; return true; } template TVal& ValueHashTableOfEnumerator::nextElement() { // Make sure we have an element to return if (!hasMoreElements()) ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::Enum_NoMoreElements, fMemoryManager); // // Save the current element, then move up to the next one for the // next time around. // ValueHashTableBucketElem* saveElem = fCurElem; findNext(); return saveElem->fData; } template void* ValueHashTableOfEnumerator::nextElementKey() { // Make sure we have an element to return if (!hasMoreElements()) ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::Enum_NoMoreElements, fMemoryManager); // // Save the current element, then move up to the next one for the // next time around. // ValueHashTableBucketElem* saveElem = fCurElem; findNext(); return saveElem->fKey; } template void ValueHashTableOfEnumerator::Reset() { fCurHash = (XMLSize_t)-1; fCurElem = 0; findNext(); } // --------------------------------------------------------------------------- // ValueHashTableOfEnumerator: Private helper methods // --------------------------------------------------------------------------- template void ValueHashTableOfEnumerator::findNext() { // // If there is a current element, move to its next element. If this // hits the end of the bucket, the next block will handle the rest. // if (fCurElem) fCurElem = fCurElem->fNext; // // If the current element is null, then we have to move up to the // next hash value. If that is the hash modulus, then we cannot // go further. // if (!fCurElem) { if (++fCurHash == fToEnum->fHashModulus) return; // Else find the next non-empty bucket while (fToEnum->fBucketList[fCurHash]==0) { // Bump to the next hash value. If we max out return if (++fCurHash == fToEnum->fHashModulus) return; } fCurElem = fToEnum->fBucketList[fCurHash]; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLUni.cpp000644 000765 000024 00000214514 13241160336 021071 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLUni.cpp 1816391 2017-11-26 19:37:56Z scantor $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLUni: Static data // --------------------------------------------------------------------------- const XMLCh XMLUni::fgAnyString[] = { chLatin_A, chLatin_N, chLatin_Y, chNull }; const XMLCh XMLUni::fgAttListString[] = { chLatin_A, chLatin_T, chLatin_T, chLatin_L, chLatin_I, chLatin_S, chLatin_T, chNull }; const XMLCh XMLUni::fgCommentString[] = { chOpenAngle, chBang, chDash, chDash, chNull }; const XMLCh XMLUni::fgCDATAString[] = { chLatin_C, chLatin_D, chLatin_A, chLatin_T, chLatin_A, chNull }; const XMLCh XMLUni::fgDefaultString[] = { chPound, chLatin_D, chLatin_E, chLatin_F, chLatin_A, chLatin_U, chLatin_L, chLatin_T, chNull }; const XMLCh XMLUni::fgDocTypeString[] = { chOpenAngle, chBang, chLatin_D, chLatin_O, chLatin_C, chLatin_T, chLatin_Y, chLatin_P, chLatin_E, chNull }; const XMLCh XMLUni::fgEBCDICEncodingString[] = { // Just plain 'EBCDIC' chLatin_E, chLatin_B, chLatin_C, chLatin_D, chLatin_I, chLatin_C, chNull }; const XMLCh XMLUni::fgElemString[] = { chLatin_E, chLatin_L, chLatin_E, chLatin_M, chLatin_E, chLatin_N, chLatin_T, chNull }; const XMLCh XMLUni::fgEmptyString[] = { chLatin_E, chLatin_M, chLatin_P, chLatin_T, chLatin_Y, chNull }; const XMLCh XMLUni::fgEncodingString[] = { chLatin_e, chLatin_n, chLatin_c, chLatin_o, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chNull }; const XMLCh XMLUni::fgEntitString[] = { chLatin_E, chLatin_N, chLatin_T, chLatin_I, chLatin_T, chNull }; const XMLCh XMLUni::fgEntityString[] = { chLatin_E, chLatin_N, chLatin_T, chLatin_I, chLatin_T, chLatin_Y, chNull }; const XMLCh XMLUni::fgEntitiesString[] = { chLatin_E, chLatin_N, chLatin_T, chLatin_I, chLatin_T, chLatin_I, chLatin_E, chLatin_S, chNull }; const XMLCh XMLUni::fgEnumerationString[] = { chLatin_E, chLatin_N, chLatin_U, chLatin_M, chLatin_E, chLatin_R, chLatin_A, chLatin_T, chLatin_I, chLatin_O, chLatin_N, chNull }; const XMLCh XMLUni::fgExceptDomain[] = { chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash , chForwardSlash, chLatin_a, chLatin_p, chLatin_a, chLatin_c , chLatin_h, chLatin_e, chPeriod, chLatin_o, chLatin_r, chLatin_g , chForwardSlash, chLatin_x, chLatin_m, chLatin_l, chForwardSlash , chLatin_m, chLatin_e, chLatin_s, chLatin_s, chLatin_a, chLatin_g , chLatin_e, chLatin_s, chForwardSlash, chLatin_X, chLatin_M, chLatin_L , chDigit_4, chLatin_C, chLatin_E, chLatin_r, chLatin_r, chLatin_o , chLatin_r, chLatin_s, chNull }; const XMLCh XMLUni::fgFixedString[] = { chPound, chLatin_F, chLatin_I, chLatin_X, chLatin_E, chLatin_D, chNull }; const XMLCh XMLUni::fgIBM037EncodingString[] = { chLatin_E, chLatin_B, chLatin_C, chLatin_D, chLatin_I, chLatin_C, chDash, chLatin_C, chLatin_P, chDash, chLatin_U, chLatin_S, chNull }; const XMLCh XMLUni::fgIBM037EncodingString2[] = { chLatin_I, chLatin_B, chLatin_M, chDigit_0, chDigit_3, chDigit_7, chNull }; //hhe const XMLCh XMLUni::fgIBM1047EncodingString[] = { chLatin_I, chLatin_B, chLatin_M, chDigit_1, chDigit_0, chDigit_4, chDigit_7, chNull }; const XMLCh XMLUni::fgIBM1047EncodingString2[] = { chLatin_I, chLatin_B, chLatin_M, chDash, chDigit_1, chDigit_0, chDigit_4, chDigit_7, chNull }; const XMLCh XMLUni::fgIBM1140EncodingString[] = { chLatin_I, chLatin_B, chLatin_M, chDigit_1, chDigit_1, chDigit_4, chDigit_0, chNull }; const XMLCh XMLUni::fgIBM1140EncodingString2[] = { chLatin_I, chLatin_B, chLatin_M, chDigit_0, chDigit_1, chDigit_1, chDigit_4, chDigit_0, chNull }; const XMLCh XMLUni::fgIBM1140EncodingString3[] = { chLatin_C, chLatin_C, chLatin_S, chLatin_I, chLatin_D, chDigit_0, chDigit_1, chDigit_1, chDigit_4, chDigit_0, chNull }; const XMLCh XMLUni::fgIBM1140EncodingString4[] = { chLatin_C, chLatin_P, chDigit_0, chDigit_1, chDigit_1, chDigit_4, chDigit_0, chNull }; const XMLCh XMLUni::fgIESString[] = { chLatin_I, chLatin_E, chLatin_S, chNull }; const XMLCh XMLUni::fgIDString[] = { chLatin_I, chLatin_D, chNull }; const XMLCh XMLUni::fgIDRefString[] = { chLatin_I, chLatin_D, chLatin_R, chLatin_E, chLatin_F, chNull }; const XMLCh XMLUni::fgIDRefsString[] = { chLatin_I, chLatin_D, chLatin_R, chLatin_E, chLatin_F, chLatin_S, chNull }; const XMLCh XMLUni::fgImpliedString[] = { chPound, chLatin_I, chLatin_M, chLatin_P, chLatin_L, chLatin_I, chLatin_E, chLatin_D, chNull }; const XMLCh XMLUni::fgIgnoreString[] = { chLatin_I, chLatin_G, chLatin_N, chLatin_O, chLatin_R, chLatin_E, chNull }; const XMLCh XMLUni::fgIncludeString[] = { chLatin_I, chLatin_N, chLatin_C, chLatin_L, chLatin_U, chLatin_D, chLatin_E, chNull }; const XMLCh XMLUni::fgISO88591EncodingString[] = { chLatin_I, chLatin_S, chLatin_O, chDigit_8, chDigit_8, chDigit_5, chDigit_9, chDash, chDigit_1, chNull }; const XMLCh XMLUni::fgISO88591EncodingString2[] = { chLatin_I, chLatin_S, chLatin_O, chDash, chDigit_8, chDigit_8, chDigit_5, chDigit_9, chDash, chDigit_1, chNull }; const XMLCh XMLUni::fgISO88591EncodingString3[] = { chLatin_I, chLatin_S, chLatin_O, chUnderscore, chDigit_8, chDigit_8, chDigit_5, chDigit_9, chDash, chDigit_1, chNull }; const XMLCh XMLUni::fgISO88591EncodingString4[] = { chLatin_I, chLatin_B, chLatin_M, chDash, chDigit_8, chDigit_1, chDigit_9, chNull }; const XMLCh XMLUni::fgISO88591EncodingString5[] = { chLatin_I, chLatin_B, chLatin_M, chDigit_8, chDigit_1, chDigit_9, chNull }; const XMLCh XMLUni::fgISO88591EncodingString6[] = { chLatin_L, chLatin_A, chLatin_T, chLatin_I, chLatin_N, chDigit_1, chNull }; const XMLCh XMLUni::fgISO88591EncodingString7[] = { chLatin_L, chLatin_A, chLatin_T, chLatin_I, chLatin_N, chDash, chDigit_1, chNull }; const XMLCh XMLUni::fgISO88591EncodingString8[] = { chLatin_L, chLatin_A, chLatin_T, chLatin_I, chLatin_N, chUnderscore, chDigit_1, chNull }; const XMLCh XMLUni::fgISO88591EncodingString9[] = { chLatin_C, chLatin_P, chDigit_8, chDigit_1, chDigit_9, chNull }; const XMLCh XMLUni::fgISO88591EncodingString10[] = { chLatin_C, chLatin_S, chLatin_I, chLatin_S, chLatin_O, chLatin_L, chLatin_A, chLatin_T, chLatin_I, chLatin_N, chDigit_1, chNull }; const XMLCh XMLUni::fgISO88591EncodingString11[] = { chLatin_I, chLatin_S, chLatin_O, chDash, chLatin_I, chLatin_R, chDash, chDigit_1, chDigit_0, chDigit_0, chNull }; const XMLCh XMLUni::fgISO88591EncodingString12[] = { chLatin_L, chDigit_1, chNull }; const XMLCh XMLUni::fgLocalHostString[] = { chLatin_l, chLatin_o, chLatin_c, chLatin_a, chLatin_l, chLatin_h, chLatin_o, chLatin_s, chLatin_t, chNull }; const XMLCh XMLUni::fgNoString[] = { chLatin_n, chLatin_o, chNull }; const XMLCh XMLUni::fgNotationString[] = { chLatin_N, chLatin_O, chLatin_T, chLatin_A, chLatin_T, chLatin_I, chLatin_O, chLatin_N, chNull }; const XMLCh XMLUni::fgNDATAString[] = { chLatin_N, chLatin_D, chLatin_A, chLatin_T, chLatin_A, chNull }; const XMLCh XMLUni::fgNmTokenString[] = { chLatin_N, chLatin_M, chLatin_T, chLatin_O, chLatin_K, chLatin_E, chLatin_N, chNull }; const XMLCh XMLUni::fgNmTokensString[] = { chLatin_N, chLatin_M, chLatin_T, chLatin_O, chLatin_K, chLatin_E, chLatin_N, chLatin_S, chNull }; const XMLCh XMLUni::fgPCDATAString[] = { chPound, chLatin_P, chLatin_C, chLatin_D, chLatin_A, chLatin_T, chLatin_A, chNull }; const XMLCh XMLUni::fgPIString[] = { chOpenAngle, chQuestion, chNull }; const XMLCh XMLUni::fgPubIDString[] = { chLatin_P, chLatin_U, chLatin_B, chLatin_L, chLatin_I, chLatin_C, chNull }; const XMLCh XMLUni::fgRefString[] = { chLatin_R, chLatin_E, chLatin_F, chNull }; const XMLCh XMLUni::fgRequiredString[] = { chPound, chLatin_R, chLatin_E, chLatin_Q, chLatin_U, chLatin_I, chLatin_R, chLatin_E, chLatin_D, chNull }; const XMLCh XMLUni::fgStandaloneString[] = { chLatin_s, chLatin_t, chLatin_a, chLatin_n, chLatin_d, chLatin_a, chLatin_l, chLatin_o, chLatin_n, chLatin_e, chNull }; const XMLCh XMLUni::fgVersion1[] = { chDigit_1, chPeriod, chNull }; const XMLCh XMLUni::fgVersion1_0[] = { chDigit_1, chPeriod, chDigit_0, chNull }; const XMLCh XMLUni::fgVersion1_1[] = { chDigit_1, chPeriod, chDigit_1, chNull }; const XMLCh XMLUni::fgSysIDString[] = { chLatin_S, chLatin_Y, chLatin_S, chLatin_T, chLatin_E, chLatin_M, chNull }; const XMLCh XMLUni::fgUnknownURIName[] = { chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash , chForwardSlash, chLatin_a, chLatin_p, chLatin_a, chLatin_c , chLatin_h, chLatin_e, chPeriod, chLatin_o, chLatin_r, chLatin_g , chForwardSlash, chLatin_x, chLatin_m, chLatin_l, chForwardSlash , chLatin_U, chLatin_n, chLatin_k, chLatin_n, chLatin_o, chLatin_w, chLatin_n , chLatin_N, chLatin_S, chNull }; const XMLCh XMLUni::fgUCS4EncodingString[] = { chLatin_U, chLatin_C, chLatin_S, chDigit_4, chNull }; const XMLCh XMLUni::fgUCS4EncodingString2[] = { chLatin_U, chLatin_C, chLatin_S, chDash, chDigit_4, chNull }; const XMLCh XMLUni::fgUCS4EncodingString3[] = { chLatin_U, chLatin_C, chLatin_S, chUnderscore, chDigit_4, chNull }; const XMLCh XMLUni::fgUCS4EncodingString4[] = { chLatin_U, chLatin_T, chLatin_F, chDash, chDigit_3, chDigit_2, chNull }; const XMLCh XMLUni::fgUCS4EncodingString5[] = { chLatin_I, chLatin_S, chLatin_O, chDash, chDigit_1, chDigit_0, chDigit_6, chDigit_4, chDigit_6, chDash, chLatin_U, chLatin_C, chLatin_S, chDash, chDigit_4, chNull }; const XMLCh XMLUni::fgUCS4BEncodingString[] = { chLatin_U, chLatin_C, chLatin_S, chDash, chDigit_4, chSpace, chOpenParen, chLatin_B, chLatin_E, chCloseParen, chNull }; const XMLCh XMLUni::fgUCS4BEncodingString2[] = { chLatin_U, chLatin_C, chLatin_S, chDash, chDigit_4, chLatin_B, chLatin_E, chNull }; const XMLCh XMLUni::fgUCS4LEncodingString[] = { chLatin_U, chLatin_C, chLatin_S, chDash, chDigit_4, chSpace, chOpenParen, chLatin_L, chLatin_E, chCloseParen, chNull }; const XMLCh XMLUni::fgUCS4LEncodingString2[] = { chLatin_U, chLatin_C, chLatin_S, chDash, chDigit_4, chLatin_L, chLatin_E, chNull }; const XMLCh XMLUni::fgUSASCIIEncodingString[] = { chLatin_U, chLatin_S, chDash, chLatin_A, chLatin_S, chLatin_C, chLatin_I, chLatin_I, chNull }; const XMLCh XMLUni::fgUSASCIIEncodingString2[] = { chLatin_U, chLatin_S, chLatin_A, chLatin_S, chLatin_C, chLatin_I, chLatin_I, chNull }; const XMLCh XMLUni::fgUSASCIIEncodingString3[] = { chLatin_A, chLatin_S, chLatin_C, chLatin_I, chLatin_I, chNull }; const XMLCh XMLUni::fgUSASCIIEncodingString4[] = { chLatin_U, chLatin_S, chUnderscore, chLatin_A, chLatin_S, chLatin_C, chLatin_I, chLatin_I, chNull }; const XMLCh XMLUni::fgUTF8EncodingString[] = { chLatin_U, chLatin_T, chLatin_F, chDash, chDigit_8, chNull }; const XMLCh XMLUni::fgUTF8EncodingString2[] = { chLatin_U, chLatin_T, chLatin_F, chDigit_8, chNull }; const XMLCh XMLUni::fgUTF16EncodingString[] = { chLatin_U, chLatin_T, chLatin_F, chDash, chDigit_1, chDigit_6, chNull }; const XMLCh XMLUni::fgUTF16EncodingString2[] = { chLatin_U, chLatin_C, chLatin_S, chDigit_2, chNull }; const XMLCh XMLUni::fgUTF16EncodingString3[] = { chLatin_I, chLatin_B, chLatin_M, chDigit_1, chDigit_2, chDigit_0, chDigit_0, chNull }; const XMLCh XMLUni::fgUTF16EncodingString4[] = { chLatin_I, chLatin_B, chLatin_M, chDash, chDigit_1, chDigit_2, chDigit_0, chDigit_0, chNull }; const XMLCh XMLUni::fgUTF16EncodingString5[] = { chLatin_U, chLatin_T, chLatin_F, chDigit_1, chDigit_6, chNull }; const XMLCh XMLUni::fgUTF16EncodingString6[] = { chLatin_U, chLatin_C, chLatin_S, chDash, chDigit_2, chNull }; const XMLCh XMLUni::fgUTF16EncodingString7[] = { chLatin_I, chLatin_S, chLatin_O, chDash, chDigit_1, chDigit_0, chDigit_6, chDigit_4 , chDigit_6, chDash, chLatin_U, chLatin_C, chLatin_S, chDash, chDigit_2, chNull }; const XMLCh XMLUni::fgUTF16BEncodingString[] = { chLatin_U, chLatin_T, chLatin_F, chDash, chDigit_1, chDigit_6, chSpace, chOpenParen, chLatin_B, chLatin_E, chCloseParen, chNull }; const XMLCh XMLUni::fgUTF16BEncodingString2[] = { chLatin_U, chLatin_T, chLatin_F, chDash, chDigit_1, chDigit_6, chLatin_B, chLatin_E, chNull }; const XMLCh XMLUni::fgUTF16LEncodingString[] = { chLatin_U, chLatin_T, chLatin_F, chDash, chDigit_1, chDigit_6, chSpace, chOpenParen, chLatin_L, chLatin_E, chCloseParen, chNull }; const XMLCh XMLUni::fgUTF16LEncodingString2[] = { chLatin_U, chLatin_T, chLatin_F, chDash, chDigit_1, chDigit_6, chLatin_L, chLatin_E, chNull }; const XMLCh XMLUni::fgVersionString[] = { chLatin_v, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh XMLUni::fgValidityDomain[] = { chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash , chForwardSlash, chLatin_a, chLatin_p, chLatin_a, chLatin_c, chLatin_h , chLatin_e, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash , chLatin_x, chLatin_m, chLatin_l, chForwardSlash, chLatin_m, chLatin_e , chLatin_s, chLatin_s, chLatin_a, chLatin_g, chLatin_e, chLatin_s , chForwardSlash, chLatin_X, chLatin_M, chLatin_L, chLatin_V, chLatin_a , chLatin_l, chLatin_i, chLatin_d, chLatin_i, chLatin_t, chLatin_y, chNull }; const XMLCh XMLUni::fgWin1252EncodingString[] = { chLatin_W, chLatin_I, chLatin_N, chLatin_D, chLatin_O, chLatin_W , chLatin_S, chDash, chDigit_1, chDigit_2, chDigit_5, chDigit_2, chNull }; const XMLCh XMLUni::fgXMLChEncodingString[] = { chLatin_X, chLatin_E, chLatin_R, chLatin_C, chLatin_E, chLatin_S , chDash, chLatin_X, chLatin_M, chLatin_L, chLatin_C, chLatin_H, chNull }; const XMLCh XMLUni::fgXMLString[] = { chLatin_x, chLatin_m, chLatin_l, chNull }; //xml{S} const XMLCh XMLUni::fgXMLStringSpace[] = { chLatin_x, chLatin_m, chLatin_l, chSpace, chNull }; const XMLCh XMLUni::fgXMLStringHTab[] = { chLatin_x, chLatin_m, chLatin_l, chHTab, chNull }; const XMLCh XMLUni::fgXMLStringCR[] = { chLatin_x, chLatin_m, chLatin_l, chCR, chNull }; const XMLCh XMLUni::fgXMLStringLF[] = { chLatin_x, chLatin_m, chLatin_l, chLF, chNull }; //XML{S} const XMLCh XMLUni::fgXMLStringSpaceU[] = { chLatin_X, chLatin_M, chLatin_L, chSpace, chNull }; const XMLCh XMLUni::fgXMLStringHTabU[] = { chLatin_X, chLatin_M, chLatin_L, chHTab, chNull }; const XMLCh XMLUni::fgXMLStringCRU[] = { chLatin_X, chLatin_M, chLatin_L, chCR, chNull }; const XMLCh XMLUni::fgXMLStringLFU[] = { chLatin_X, chLatin_M, chLatin_L, chLF, chNull }; // #endif #if !HAVE_STRICMP # include #endif #if !HAVE_STRNICMP # include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local static data // // gConverter // This is initialized when the user calls the platform init method, // which calls our init method. This is the converter used for default // conversion to/from the local code page. // --------------------------------------------------------------------------- static XMLLCPTranscoder* gTranscoder = 0; static XMLCh gNullStr[] = { chOpenCurly, chLatin_n, chLatin_u, chLatin_l, chLatin_l, chCloseCurly, chNull }; MemoryManager* XMLString::fgMemoryManager = 0; // --------------------------------------------------------------------------- // XMLString: Public static methods // --------------------------------------------------------------------------- void XMLString::sizeToText( const XMLSize_t toFormat , char* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager) { static const char digitList[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' , 'A', 'B', 'C', 'D', 'E', 'F' }; if (!maxChars) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Str_ZeroSizedTargetBuf, manager); // Handle special case if (!toFormat) { toFill[0] = '0'; toFill[1] = 0; return; } // This is used to fill the temp buffer XMLSize_t tmpIndex = 0; // A copy of the conversion value that we can modify XMLSize_t tmpVal = toFormat; // // Convert into a temp buffer that we know is large enough. This avoids // having to check for overflow in the inner loops, and we have to flip // the resulting XMLString anyway. // char tmpBuf[128]; // // For each radix, do the optimal thing. For bin and hex, we can special // case them and do shift and mask oriented stuff. For oct and decimal // there isn't much to do but bull through it with divides. // if (radix == 2) { while (tmpVal) { if (tmpVal & 0x1UL) tmpBuf[tmpIndex++] = '1'; else tmpBuf[tmpIndex++] = '0'; tmpVal >>= 1; } } else if (radix == 16) { while (tmpVal) { const XMLSize_t charInd = (tmpVal & 0xFUL); tmpBuf[tmpIndex++] = digitList[charInd]; tmpVal >>= 4; } } else if ((radix == 8) || (radix == 10)) { while (tmpVal) { const XMLSize_t charInd = (tmpVal % radix); tmpBuf[tmpIndex++] = digitList[charInd]; tmpVal /= radix; } } else { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Str_UnknownRadix, manager); } // See if have enough room in the caller's buffer if (tmpIndex > maxChars) { ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Str_TargetBufTooSmall, manager); } // Reverse the tmp buffer into the caller's buffer XMLSize_t outIndex = 0; for (; tmpIndex > 0; tmpIndex--) toFill[outIndex++] = tmpBuf[tmpIndex-1]; // And cap off the caller's buffer toFill[outIndex] = char(0); } void XMLString::binToText( const unsigned long toFormat , char* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager) { static const char digitList[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' , 'A', 'B', 'C', 'D', 'E', 'F' }; if (!maxChars) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Str_ZeroSizedTargetBuf, manager); // Handle special case if (!toFormat) { toFill[0] = '0'; toFill[1] = 0; return; } // This is used to fill the temp buffer XMLSize_t tmpIndex = 0; // A copy of the conversion value that we can modify unsigned long tmpVal = toFormat; // // Convert into a temp buffer that we know is large enough. This avoids // having to check for overflow in the inner loops, and we have to flip // the resulting XMLString anyway. // char tmpBuf[128]; // // For each radix, do the optimal thing. For bin and hex, we can special // case them and do shift and mask oriented stuff. For oct and decimal // there isn't much to do but bull through it with divides. // if (radix == 2) { while (tmpVal) { if (tmpVal & 0x1UL) tmpBuf[tmpIndex++] = '1'; else tmpBuf[tmpIndex++] = '0'; tmpVal >>= 1; } } else if (radix == 16) { while (tmpVal) { const unsigned long charInd = (tmpVal & 0xFUL); tmpBuf[tmpIndex++] = digitList[charInd]; tmpVal >>= 4; } } else if ((radix == 8) || (radix == 10)) { while (tmpVal) { const unsigned long charInd = (tmpVal % radix); tmpBuf[tmpIndex++] = digitList[charInd]; tmpVal /= radix; } } else { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Str_UnknownRadix, manager); } // See if have enough room in the caller's buffer if (tmpIndex > maxChars) { ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Str_TargetBufTooSmall, manager); } // Reverse the tmp buffer into the caller's buffer XMLSize_t outIndex = 0; for (; tmpIndex > 0; tmpIndex--) toFill[outIndex++] = tmpBuf[tmpIndex-1]; // And cap off the caller's buffer toFill[outIndex] = char(0); } void XMLString::binToText( const unsigned int toFormat , char* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager) { // Just call the unsigned long version binToText((unsigned long)toFormat, toFill, maxChars, radix, manager); } void XMLString::binToText( const long toFormat , char* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager) { // // If its negative, then put a negative sign into the output and flip // the sign of the local temp value. // XMLSize_t startInd = 0; unsigned long actualVal; if (toFormat < 0) { toFill[0] = '-'; startInd++; // Signed integers can represent one extra negative value // compared to the positive values. If we simply do (v * -1) // we will overflow on that extra value. // long v = toFormat; v++; actualVal = (unsigned long)(v * -1); actualVal++; } else { actualVal = (unsigned long)(toFormat); } // And now call the unsigned long version binToText(actualVal, &toFill[startInd], maxChars, radix, manager); } void XMLString::binToText( const int toFormat , char* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager) { // Just call the long version binToText((long)toFormat, toFill, maxChars, radix, manager); } void XMLString::catString(char* const target, const char* const src) { strcat(target, src); } int XMLString::compareIString(const char* const str1, const char* const str2) { return stricmp(str1, str2); } int XMLString::compareNString( const char* const str1 , const char* const str2 , const XMLSize_t count) { // Watch for pathological secenario if (!count) return 0; return strncmp(str1, str2, count); } int XMLString::compareNIString( const char* const str1 , const char* const str2 , const XMLSize_t count) { if (!count) return 0; return strnicmp(str1, str2, count); } int XMLString::compareString( const char* const str1 , const char* const str2) { return strcmp(str1, str2); } void XMLString::copyString( char* const target , const char* const src) { strcpy(target, src); } void XMLString::cut( XMLCh* const toCutFrom , const XMLSize_t count) { #if defined(XML_DEBUG) if (count > stringLen(toCutFrom)) { // This is bad of course } #endif // If count is zero, then nothing to do if (!count) return; XMLCh* targetPtr = toCutFrom; XMLCh* srcPtr = toCutFrom + count; while (*srcPtr) *targetPtr++ = *srcPtr++; // Cap it off at the new end *targetPtr = 0; } XMLSize_t XMLString::hash( const char* const tohash , const XMLSize_t hashModulus) { XMLSize_t hashVal = 0; if (tohash) { const char* curCh = tohash; while (*curCh) { XMLSize_t top = hashVal >> 24; hashVal += (hashVal * 37) + top + (XMLSize_t)(*curCh); curCh++; } } // Divide by modulus return hashVal % hashModulus; } int XMLString::indexOf(const char* const toSearch, const char ch) { const XMLSize_t len = strlen(toSearch); for (XMLSize_t i = 0; i < len; i++) { if (toSearch[i] == ch) return (int)i; } return -1; } int XMLString::indexOf( const char* const toSearch , const char ch , const XMLSize_t fromIndex , MemoryManager* const manager) { const XMLSize_t len = strlen(toSearch); // Make sure the start index is within the XMLString bounds if (fromIndex > len-1) { ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Str_StartIndexPastEnd, manager); } for (XMLSize_t i = fromIndex; i < len; i++) { if (toSearch[i] == ch) return (int)i; } return -1; } int XMLString::lastIndexOf(const char* const toSearch, const char ch) { const int len = (int)strlen(toSearch); if (len < 0) { return -1; } for (int i = len-1; i >= 0; i--) { if (toSearch[i] == ch) return i; } return -1; } int XMLString::lastIndexOf( const char* const toSearch , const char ch , const XMLSize_t fromIndex , MemoryManager* const manager) { const XMLSize_t len = strlen(toSearch); // Make sure the start index is within the XMLString bounds if (fromIndex > len-1) { ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Str_StartIndexPastEnd, manager); } for (int i = (int)fromIndex; i >= 0; i--) { if (toSearch[i] == ch) return i; } return -1; } XMLSize_t XMLString::replaceTokens( XMLCh* const errText , const XMLSize_t maxChars , const XMLCh* const text1 , const XMLCh* const text2 , const XMLCh* const text3 , const XMLCh* const text4 , MemoryManager* const manager) { // // We have to build the string back into the source string, so allocate // a temp string and copy the orignal text to it. We'll then treat the // incoming buffer as a target buffer. Put a janitor on it to make sure // it gets cleaned up. // XMLCh* orgText = replicate(errText, manager); ArrayJanitor janText(orgText, manager); XMLCh* pszSrc = orgText; XMLSize_t curOutInd = 0; while (*pszSrc && (curOutInd < maxChars)) { // // Loop until we see a { character. Until we do, just copy chars // from src to target, being sure not to overrun the output buffer. // while ((*pszSrc != chOpenCurly) && (curOutInd < maxChars)) { if (!*pszSrc) break; errText[curOutInd++] = *pszSrc++; } // If we did not find a curly, then we are done if (*pszSrc != chOpenCurly) break; // // Probe this one to see if it matches our pattern of {x}. If not // then copy over those chars and go back to the first loop. // if ((*(pszSrc+1) >= chDigit_0) && (*(pszSrc+1) <= chDigit_3) && (*(pszSrc+2) == chCloseCurly)) { // // Its one of our guys, so move the source pointer up past the // token we are replacing. First though get out the token number // character. // XMLCh tokCh = *(pszSrc+1); pszSrc += 3; // Now copy over the replacement text const XMLCh* repText = 0; if (tokCh == chDigit_0) repText = text1; else if (tokCh == chDigit_1) repText = text2; else if (tokCh == chDigit_2) repText = text3; else if (tokCh == chDigit_3) repText = text4; // If this one is null, copy over a null string if (!repText) repText = gNullStr; while (*repText && (curOutInd < maxChars)) errText[curOutInd++] = *repText++; } else { // Escape the curly brace character and continue errText[curOutInd++] = *pszSrc++; } } // Copy over a null terminator errText[curOutInd] = 0; // And return the count of chars we output return curOutInd; } char* XMLString::replicate( const char* const toRep , MemoryManager* const manager) { // If a null string, return a null string if (!toRep) return 0; // // Get the len of the source and allocate a new buffer. Make sure to // account for the nul terminator. // const XMLSize_t srcLen = strlen(toRep); char* ret = (char*) manager->allocate((srcLen+1) * sizeof(char)); //new char[srcLen+1]; // Copy over the text, adjusting for the size of a char memcpy(ret, toRep, (srcLen+1) * sizeof(char)); return ret; } bool XMLString::startsWith(const char* const toTest, const char* const prefix) { return (strncmp(toTest, prefix, strlen(prefix)) == 0); } bool XMLString::startsWithI(const char* const toTest , const char* const prefix) { return (strnicmp(toTest, prefix, strlen(prefix)) == 0); } XMLSize_t XMLString::stringLen(const char* const src) { return strlen(src); } char* XMLString::transcode(const XMLCh* const toTranscode, MemoryManager* const manager) { return gTranscoder->transcode(toTranscode, manager); } bool XMLString::transcode( const XMLCh* const toTranscode , char* const toFill , const XMLSize_t maxChars , MemoryManager* const manager) { return gTranscoder->transcode(toTranscode, toFill, maxChars, manager); } XMLCh* XMLString::transcode(const char* const toTranscode, MemoryManager* const manager) { return gTranscoder->transcode(toTranscode, manager); } bool XMLString::transcode( const char* const toTranscode , XMLCh* const toFill , const XMLSize_t maxChars , MemoryManager* const manager) { return gTranscoder->transcode(toTranscode, toFill, maxChars, manager); } void XMLString::trim(char* const toTrim) { const XMLSize_t len = strlen(toTrim); XMLSize_t skip, scrape; for (skip = 0; skip < len; skip++) { if (! isspace(toTrim[skip])) break; } for (scrape = len; scrape > skip; scrape--) { if (! isspace(toTrim[scrape - 1] )) break; } // Cap off at the scrap point if (scrape != len) toTrim[scrape] = 0; if (skip) { // Copy the chars down XMLSize_t index = 0; while (toTrim[skip]) toTrim[index++] = toTrim[skip++]; toTrim[index] = 0; } } void XMLString::subString(char* const targetStr, const char* const srcStr , const XMLSize_t startIndex, const XMLSize_t endIndex , MemoryManager* const manager) { if (targetStr == 0) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Str_ZeroSizedTargetBuf, manager); const XMLSize_t srcLen = strlen(srcStr); // Make sure the start index is within the XMLString bounds if (startIndex > endIndex || endIndex > srcLen) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Str_StartIndexPastEnd, manager); const XMLSize_t copySize = endIndex - startIndex; for (XMLSize_t i= startIndex; i < endIndex; i++) { targetStr[i-startIndex] = srcStr[i]; } targetStr[copySize] = 0; } bool XMLString::isValidNOTATION(const XMLCh* const name , MemoryManager* const manager ) { // // NOTATATION: : // where URI is optional // ':' and localPart must be present // XMLSize_t nameLen = XMLString::stringLen(name); int colPos = XMLString::lastIndexOf(name, chColon); if ((colPos == 0) || // no ':' (colPos == ((int)nameLen) - 1) ) // ':' return false; // Examine localpart if (!XMLChar1_0::isValidNCName(&name[colPos+1], nameLen - colPos -1)) { return false; } else if (colPos == -1) { return true; } else { // Examine URI XMLCh* const temp = (XMLCh*) manager->allocate((colPos + 1) * sizeof(XMLCh)); const ArrayJanitor jan(temp, manager); copyNString(temp, name, colPos); temp[colPos] = 0; try { XMLUri newURI(temp, manager); // no relative uri support here } catch (const MalformedURLException&) { return false; } return true; } } /** * isValidEncName * * [80] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')* * */ bool XMLString::isValidEncName(const XMLCh* const name) { if (name == 0 || *name == 0) return false; const XMLCh* tempName = name; XMLCh firstChar = *tempName++; if (!isAlpha(firstChar)) return false; while(*tempName) { if (( !isAlpha(*tempName)) && ( !isDigit(*tempName)) && ( *tempName != chPeriod) && ( *tempName != chUnderscore) && ( *tempName != chDash) ) return false; tempName++; } return true; } bool XMLString::isAlpha(XMLCh const theChar) { if ((( theChar >= chLatin_a ) && ( theChar <= chLatin_z )) || (( theChar >= chLatin_A ) && ( theChar <= chLatin_Z )) ) return true; return false; } bool XMLString::isDigit(XMLCh const theChar) { if (( theChar >= chDigit_0 ) && ( theChar <= chDigit_9 )) return true; return false; } bool XMLString::isAlphaNum(XMLCh const theChar) { return (isAlpha(theChar) || isDigit(theChar)); } bool XMLString::isHex(XMLCh const theChar) { return (isDigit(theChar) || (theChar >= chLatin_a && theChar <= chLatin_f) || (theChar >= chLatin_A && theChar <= chLatin_F)); } // --------------------------------------------------------------------------- // Wide char versions of most of the string methods // --------------------------------------------------------------------------- void XMLString::sizeToText( const XMLSize_t toFormat , XMLCh* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager) { static const XMLCh digitList[16] = { chDigit_0, chDigit_1, chDigit_2, chDigit_3, chDigit_4, chDigit_5 , chDigit_6, chDigit_7, chDigit_8, chDigit_9, chLatin_A, chLatin_B , chLatin_C, chLatin_D, chLatin_E, chLatin_F }; if (!maxChars) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Str_ZeroSizedTargetBuf, manager); // Handle special case if (!toFormat) { toFill[0] = chDigit_0; toFill[1] = chNull; return; } // This is used to fill the temp buffer XMLSize_t tmpIndex = 0; // A copy of the conversion value that we can modify XMLSize_t tmpVal = toFormat; // // Convert into a temp buffer that we know is large enough. This avoids // having to check for overflow in the inner loops, and we have to flip // the resulting sring anyway. // XMLCh tmpBuf[128]; // // For each radix, do the optimal thing. For bin and hex, we can special // case them and do shift and mask oriented stuff. For oct and decimal // there isn't much to do but bull through it with divides. // if (radix == 2) { while (tmpVal) { if (tmpVal & 0x1UL) tmpBuf[tmpIndex++] = chDigit_1; else tmpBuf[tmpIndex++] = chDigit_0; tmpVal >>= 1; } } else if (radix == 16) { while (tmpVal) { const XMLSize_t charInd = (tmpVal & 0xFUL); tmpBuf[tmpIndex++] = digitList[charInd]; tmpVal >>= 4; } } else if ((radix == 8) || (radix == 10)) { while (tmpVal) { const XMLSize_t charInd = (tmpVal % radix); tmpBuf[tmpIndex++] = digitList[charInd]; tmpVal /= radix; } } else { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Str_UnknownRadix, manager); } // See if have enough room in the caller's buffer if (tmpIndex > maxChars) { ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Str_TargetBufTooSmall, manager); } // Reverse the tmp buffer into the caller's buffer XMLSize_t outIndex = 0; for (; tmpIndex > 0; tmpIndex--) toFill[outIndex++] = tmpBuf[tmpIndex-1]; // And cap off the caller's buffer toFill[outIndex] = chNull; } void XMLString::binToText( const unsigned long toFormat , XMLCh* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager) { static const XMLCh digitList[16] = { chDigit_0, chDigit_1, chDigit_2, chDigit_3, chDigit_4, chDigit_5 , chDigit_6, chDigit_7, chDigit_8, chDigit_9, chLatin_A, chLatin_B , chLatin_C, chLatin_D, chLatin_E, chLatin_F }; if (!maxChars) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Str_ZeroSizedTargetBuf, manager); // Handle special case if (!toFormat) { toFill[0] = chDigit_0; toFill[1] = chNull; return; } // This is used to fill the temp buffer XMLSize_t tmpIndex = 0; // A copy of the conversion value that we can modify unsigned long tmpVal = toFormat; // // Convert into a temp buffer that we know is large enough. This avoids // having to check for overflow in the inner loops, and we have to flip // the resulting sring anyway. // XMLCh tmpBuf[128]; // // For each radix, do the optimal thing. For bin and hex, we can special // case them and do shift and mask oriented stuff. For oct and decimal // there isn't much to do but bull through it with divides. // if (radix == 2) { while (tmpVal) { if (tmpVal & 0x1UL) tmpBuf[tmpIndex++] = chDigit_1; else tmpBuf[tmpIndex++] = chDigit_0; tmpVal >>= 1; } } else if (radix == 16) { while (tmpVal) { const unsigned long charInd = (tmpVal & 0xFUL); tmpBuf[tmpIndex++] = digitList[charInd]; tmpVal >>= 4; } } else if ((radix == 8) || (radix == 10)) { while (tmpVal) { const unsigned long charInd = (tmpVal % radix); tmpBuf[tmpIndex++] = digitList[charInd]; tmpVal /= radix; } } else { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Str_UnknownRadix, manager); } // See if have enough room in the caller's buffer if (tmpIndex > maxChars) { ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Str_TargetBufTooSmall, manager); } // Reverse the tmp buffer into the caller's buffer XMLSize_t outIndex = 0; for (; tmpIndex > 0; tmpIndex--) toFill[outIndex++] = tmpBuf[tmpIndex-1]; // And cap off the caller's buffer toFill[outIndex] = chNull; } void XMLString::binToText( const unsigned int toFormat , XMLCh* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager) { // Just call the unsigned long version binToText((unsigned long)toFormat, toFill, maxChars, radix, manager); } void XMLString::binToText( const long toFormat , XMLCh* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager) { // // If its negative, then put a negative sign into the output and flip // the sign of the local temp value. // XMLSize_t startInd = 0; unsigned long actualVal; if (toFormat < 0) { toFill[0] = chDash; startInd++; // Signed integers can represent one extra negative value // compared to the positive values. If we simply do (v * -1) // we will overflow on that extra value. // long v = toFormat; v++; actualVal = (unsigned long)(v * -1); actualVal++; } else { actualVal = (unsigned long)(toFormat); } // And now call the unsigned long version binToText(actualVal, &toFill[startInd], maxChars, radix, manager); } void XMLString::binToText( const int toFormat , XMLCh* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager) { // Just call the long version binToText((long)toFormat, toFill, maxChars, radix, manager); } void XMLString::catString(XMLCh* const target, const XMLCh* const src) { // Get the starting point for the cat on the target XMLString XMLSize_t index = stringLen(target); // While the source is not zero, add them to target and bump const XMLCh* pszTmp = src; while (*pszTmp) target[index++] = *pszTmp++; // Cap off the target where we ended target[index] = chNull; } int XMLString::compareIString( const XMLCh* const str1 , const XMLCh* const str2) { // Refer this one to the transcoding service return XMLPlatformUtils::fgTransService->compareIString(str1, str2); } int XMLString::compareIStringASCII( const XMLCh* const str1 , const XMLCh* const str2) { const XMLCh* psz1 = str1; const XMLCh* psz2 = str2; if (psz1 == 0 || psz2 == 0) { if (psz1 == 0) { return 0 - (int)XMLString::stringLen(psz2); } else if (psz2 == 0) { return (int)XMLString::stringLen(psz1); } } XMLCh ch1; XMLCh ch2; for (;;) { if (*psz1 >= chLatin_A && *psz1 <= chLatin_Z) ch1 = *psz1 - chLatin_A + chLatin_a; else ch1 = *psz1; if (*psz2 >= chLatin_A && *psz2 <= chLatin_Z) ch2 = *psz2 - chLatin_A + chLatin_a; else ch2 = *psz2; // If an inequality, then return difference if (ch1 != ch2) return int(ch1) - int(ch2); // If either ended, then both ended, so equal if (!ch1) break; // Move upwards to next chars psz1++; psz2++; } return 0; } int XMLString::compareNString( const XMLCh* const str1 , const XMLCh* const str2 , const XMLSize_t maxChars) { const XMLCh* psz1 = str1; const XMLCh* psz2 = str2; XMLSize_t curCount = 0; while (curCount < maxChars) { // If an inequality, then return difference if (*psz1 != *psz2) return int(*psz1) - int(*psz2); // If either ended, then both ended, so equal if (!*psz1) break; // Move upwards to next chars psz1++; psz2++; // // Bump the count of chars done. // curCount++; } // If we inspected all the maxChars, then we are equal. return 0; } int XMLString::compareNIString( const XMLCh* const str1 , const XMLCh* const str2 , const XMLSize_t maxChars) { // Refer this oneto the transcoding service return XMLPlatformUtils::fgTransService->compareNIString(str1, str2, maxChars); } int XMLString::compareString( const XMLCh* const str1 , const XMLCh* const str2) { const XMLCh* psz1 = str1; const XMLCh* psz2 = str2; if (psz1 == 0 || psz2 == 0) { if (psz1 == 0) { return 0 - (int)XMLString::stringLen(psz2); } else if (psz2 == 0) { return (int)XMLString::stringLen(psz1); } } for (;;) { // If an inequality, then return the difference if (*psz1 != *psz2) return int(*psz1) - int(*psz2); // If either has ended, then they both ended, so equal if (!*psz1) break; // Move upwards for the next round psz1++; psz2++; } return 0; } bool XMLString::regionMatches(const XMLCh* const str1 , const int offset1 , const XMLCh* const str2 , const int offset2 , const XMLSize_t charCount) { if (!validateRegion(str1, offset1,str2, offset2, charCount)) return false; if (compareNString(str1+offset1, str2+offset2, charCount) != 0) return false; return true; } bool XMLString::regionIMatches(const XMLCh* const str1 , const int offset1 , const XMLCh* const str2 , const int offset2 , const XMLSize_t charCount) { if (!validateRegion(str1, offset1,str2, offset2, charCount)) return false; if (compareNIString(str1+offset1, str2+offset2, charCount) != 0) return false; return true; } void XMLString::copyString(XMLCh* const target, const XMLCh* const src) { if (!src) { *target = 0; return; } XMLCh* pszOut = target; const XMLCh* pszIn = src; while (*pszIn) *pszOut++ = *pszIn++; // Cap off the target where we ended *pszOut = 0; } bool XMLString::copyNString( XMLCh* const target , const XMLCh* const src , const XMLSize_t maxChars) { // Return whether we copied it all or hit the max XMLSize_t len = stringLen(src); if(len > maxChars) { XMLString::moveChars(target, src, maxChars); target[maxChars] = 0; return false; } XMLString::moveChars(target, src, len+1); return true; } const XMLCh* XMLString::findAny(const XMLCh* const toSearch , const XMLCh* const searchList) { const XMLCh* srcPtr = toSearch; while (*srcPtr) { const XMLCh* listPtr = searchList; const XMLCh curCh = *srcPtr; while (*listPtr) { if (curCh == *listPtr++) return srcPtr; } srcPtr++; } return 0; } XMLCh* XMLString::findAny( XMLCh* const toSearch , const XMLCh* const searchList) { XMLCh* srcPtr = toSearch; while (*srcPtr) { const XMLCh* listPtr = searchList; const XMLCh curCh = *srcPtr; while (*listPtr) { if (curCh == *listPtr++) return srcPtr; } srcPtr++; } return 0; } int XMLString::patternMatch( const XMLCh* const toSearch , const XMLCh* const pattern) { if (!toSearch || !*toSearch ) return -1; const XMLSize_t patnLen = XMLString::stringLen(pattern); if ( !patnLen ) return -1; const XMLCh* srcPtr = toSearch; const XMLCh* patnStart = toSearch; XMLSize_t patnIndex = 0; while (*srcPtr) { if ( !(*srcPtr++ == pattern[patnIndex])) { patnIndex = 0; srcPtr = ++patnStart; } else { if (++patnIndex == patnLen) // full pattern match found return (int)(srcPtr - patnLen - toSearch); } } return -1; } int XMLString::indexOf(const XMLCh* const toSearch, const XMLCh ch) { if (!toSearch || !*toSearch) return -1; const XMLCh* srcPtr = toSearch; while (*srcPtr) if (ch == *srcPtr++) return (int)(srcPtr - toSearch - 1); return -1; } int XMLString::indexOf( const XMLCh* const toSearch , const XMLCh ch , const XMLSize_t fromIndex , MemoryManager* const manager) { const XMLSize_t len = stringLen(toSearch); // Make sure the start index is within the XMLString bounds if (fromIndex >= len) { ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Str_StartIndexPastEnd, manager); } const XMLCh* srcPtr = toSearch+fromIndex; while (*srcPtr) if (ch == *srcPtr++) return (int)(srcPtr - toSearch - 1); return -1; } int XMLString::lastIndexOf(const XMLCh ch, const XMLCh* const toSearch, const XMLSize_t toSearchLen) { const XMLCh* srcPtr = toSearch+toSearchLen; while (srcPtr >= toSearch) if (ch == *srcPtr--) return (int)(srcPtr + 1 - toSearch); return -1; } int XMLString::lastIndexOf( const XMLCh* const toSearch , const XMLCh ch , const XMLSize_t fromIndex , MemoryManager* const manager) { const XMLSize_t len = stringLen(toSearch); if (fromIndex >= len) { ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Str_StartIndexPastEnd, manager); } const XMLCh* srcPtr = toSearch+fromIndex; while (srcPtr >= toSearch) if (ch == *srcPtr--) return (int)(srcPtr + 1 - toSearch); return -1; } XMLCh* XMLString::makeUName(const XMLCh* const pszURI, const XMLCh* const pszName) { // // If there is a URI, then format out the full name in the {uri}name // form. Otherwise, just set it to the same thing as the base name. // XMLCh* pszRet = 0; const XMLSize_t uriLen = stringLen(pszURI); if (uriLen) { pszRet = new XMLCh[uriLen + stringLen(pszName) + 3]; XMLCh szTmp[2]; szTmp[1] = 0; szTmp[0] = chOpenCurly; copyString(pszRet, szTmp); catString(pszRet, pszURI); szTmp[0] = chCloseCurly; catString(pszRet, szTmp); catString(pszRet, pszName); } else { pszRet = replicate(pszName); } return pszRet; } bool XMLString::textToBin(const XMLCh* const toConvert, unsigned int& toFill , MemoryManager* const manager) { toFill = 0; // If no string, then its a failure if ((!toConvert) || (!*toConvert)) return false; XMLCh* trimmedStr = XMLString::replicate(toConvert, manager); ArrayJanitor jan1(trimmedStr, manager); XMLString::trim(trimmedStr); XMLSize_t trimmedStrLen = XMLString::stringLen(trimmedStr); if ( !trimmedStrLen ) return false; // we don't allow '-' sign if (XMLString::indexOf(trimmedStr, chDash, 0, manager) != -1) return false; //the errno set by previous run is NOT automatically cleared errno = 0; char *nptr = XMLString::transcode(trimmedStr, manager); ArrayJanitor jan2(nptr, manager); char *endptr; // // REVISIT: conversion of (unsigned long) to (unsigned int) // may truncate value on IA64 toFill = (unsigned int) strtoul(nptr, &endptr, 10); // check if all chars are valid char // check if overflow/underflow occurs if ( ( (endptr - nptr) != (int) trimmedStrLen) || (errno == ERANGE) ) return false; return true; } int XMLString::parseInt(const XMLCh* const toConvert , MemoryManager* const manager) { // If no string, or empty string, then it is a failure if ((!toConvert) || (!*toConvert)) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_null_ptr, manager); XMLCh* trimmedStr = XMLString::replicate(toConvert, manager); ArrayJanitor jan1(trimmedStr, manager); XMLString::trim(trimmedStr); XMLSize_t trimmedStrLen = XMLString::stringLen(trimmedStr); if ( !trimmedStrLen ) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_null_ptr, manager); //the errno set by previous run is NOT automatically cleared errno = 0; char *nptr = XMLString::transcode(trimmedStr, manager); ArrayJanitor jan2(nptr, manager); char *endptr; long retVal = strtol(nptr, &endptr, 10); // check if all chars are valid char if ( (endptr - nptr) != (int) trimmedStrLen) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, manager); // check if overflow/underflow occurs if (errno == ERANGE) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::Str_ConvertOverflow, manager); // // REVISIT: conversion of (long) to (int) // may truncate value on IA64 return (int) retVal; } void XMLString::trim(XMLCh* const toTrim) { const XMLSize_t len = stringLen(toTrim); XMLSize_t skip, scrape; for (skip = 0; skip < len; skip++) { if (!XMLChar1_0::isWhitespace(toTrim[skip])) break; } for (scrape = len; scrape > skip; scrape--) { if (!XMLChar1_0::isWhitespace(toTrim[scrape - 1])) break; } // Cap off at the scrap point if (scrape != len) toTrim[scrape] = 0; if (skip) { // Copy the chars down XMLSize_t index = 0; while (toTrim[skip]) toTrim[index++] = toTrim[skip++]; toTrim[index] = 0; } } void XMLString::upperCase(XMLCh* const toUpperCase) { // Refer this one to the transcoding service XMLPlatformUtils::fgTransService->upperCase(toUpperCase); } void XMLString::upperCaseASCII(XMLCh* const toUpperCase) { XMLCh* psz1 = toUpperCase; if (!psz1) return; while (*psz1) { if (*psz1 >= chLatin_a && *psz1 <= chLatin_z) *psz1 = *psz1 - chLatin_a + chLatin_A; psz1++; } } void XMLString::lowerCase(XMLCh* const toLowerCase) { // Refer this one to the transcoding service XMLPlatformUtils::fgTransService->lowerCase(toLowerCase); } void XMLString::lowerCaseASCII(XMLCh* const toLowerCase) { XMLCh* psz1 = toLowerCase; if (!psz1) return; while (*psz1) { if (*psz1 >= chLatin_A && *psz1 <= chLatin_Z) *psz1 = *psz1 - chLatin_A + chLatin_a; psz1++; } } void XMLString::subString(XMLCh* const targetStr, const XMLCh* const srcStr , const XMLSize_t startIndex, const XMLSize_t endIndex , MemoryManager* const manager) { subString(targetStr, srcStr, startIndex, endIndex, stringLen(srcStr), manager); } void XMLString::subString(XMLCh* const targetStr, const XMLCh* const srcStr , const XMLSize_t startIndex, const XMLSize_t endIndex , const XMLSize_t srcStrLength , MemoryManager* const manager) { //if (startIndex < 0 || endIndex < 0) // ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Str_NegativeIndex); if (targetStr == 0) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Str_ZeroSizedTargetBuf, manager); // Make sure the start index is within the XMLString bounds if (startIndex > endIndex || endIndex > srcStrLength) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Str_StartIndexPastEnd, manager); const XMLSize_t copySize = endIndex - startIndex; for (XMLSize_t i= startIndex; i < endIndex; i++) { targetStr[i-startIndex] = srcStr[i]; } targetStr[copySize] = 0; } BaseRefVectorOf* XMLString::tokenizeString(const XMLCh* const tokenizeSrc , XMLCh delimiter , MemoryManager* const manager) { XMLCh* orgText = replicate(tokenizeSrc, manager); ArrayJanitor janText(orgText, manager); XMLCh* tokenizeStr = orgText; RefArrayVectorOf* tokenStack = new (manager) RefArrayVectorOf(16, true, manager); XMLSize_t len = stringLen(tokenizeStr); XMLSize_t skip; XMLSize_t index = 0; while (index != len) { // find the first non-space character for (skip = index; skip < len; skip++) { if (tokenizeStr[skip]!=delimiter) break; } index = skip; // find the delimiter (space character) for (; skip < len; skip++) { if (tokenizeStr[skip]==delimiter) break; } // we reached the end of the string if (skip == index) break; // these tokens are adopted in the RefVector and will be deleted // when the vector is deleted by the caller XMLCh* token = (XMLCh*) manager->allocate ( (skip+1-index) * sizeof(XMLCh) );//new XMLCh[skip+1-index]; XMLString::subString(token, tokenizeStr, index, skip, len, manager); tokenStack->addElement(token); index = skip; } return tokenStack; } BaseRefVectorOf* XMLString::tokenizeString(const XMLCh* const tokenizeSrc , MemoryManager* const manager) { XMLCh* orgText = replicate(tokenizeSrc, manager); ArrayJanitor janText(orgText, manager); XMLCh* tokenizeStr = orgText; RefArrayVectorOf* tokenStack = new (manager) RefArrayVectorOf(16, true, manager); XMLSize_t len = stringLen(tokenizeStr); XMLSize_t skip; XMLSize_t index = 0; while (index != len) { // find the first non-space character for (skip = index; skip < len; skip++) { if (!XMLChar1_0::isWhitespace(tokenizeStr[skip])) break; } index = skip; // find the delimiter (space character) for (; skip < len; skip++) { if (XMLChar1_0::isWhitespace(tokenizeStr[skip])) break; } // we reached the end of the string if (skip == index) break; // these tokens are adopted in the RefVector and will be deleted // when the vector is deleted by the caller XMLCh* token = (XMLCh*) manager->allocate ( (skip+1-index) * sizeof(XMLCh) );//new XMLCh[skip+1-index]; XMLString::subString(token, tokenizeStr, index, skip, len, manager); tokenStack->addElement(token); index = skip; } return tokenStack; } // // This method is called when we get a notation or enumeration type attribute // to validate. We have to confirm that the passed value to find is one of // the values in the passed list. The list is a space separated string of // values to match against. // bool XMLString::isInList(const XMLCh* const toFind, const XMLCh* const enumList) { // // We loop through the values in the list via this outer loop. We end // when we hit the end of the enum list or get a match. // const XMLCh* listPtr = enumList; const XMLSize_t findLen = XMLString::stringLen(toFind); while (*listPtr) { XMLSize_t testInd; for (testInd = 0; testInd < findLen; testInd++) { // // If they don't match, then reset and try again. Note that // hitting the end of the current item will cause a mismatch // because there can be no spaces in the toFind string. // if (listPtr[testInd] != toFind[testInd]) break; } // // If we went the distance, see if we matched. If we did, the current // list character has to be null or space. // if (testInd == findLen) { if ((listPtr[testInd] == chSpace) || !listPtr[testInd]) return true; } // Run the list pointer up to the next substring while ((*listPtr != chSpace) && *listPtr) listPtr++; // If we hit the end, then we failed if (!*listPtr) return false; // Else move past the space and try again listPtr++; } // We never found it return false; } // // a string is whitespace:replaced, is having no // #xD Carriage Return // #xA Line Feed // #x9 TAB // bool XMLString::isWSReplaced(const XMLCh* const toCheck) { // If no string, then its a OK if (( !toCheck ) || ( !*toCheck )) return true; const XMLCh* startPtr = toCheck; while ( *startPtr ) { if ( ( *startPtr == chCR) || ( *startPtr == chLF) || ( *startPtr == chHTab)) return false; startPtr++; } return true; } // // to replace characters listed below to #x20 // #xD Carriage Return // #xA Line Feed // #x9 TAB // void XMLString::replaceWS(XMLCh* toConvert, MemoryManager* const) { // If no string, then its a OK if (( !toConvert ) || ( !*toConvert )) return; XMLCh* cursorPtr = toConvert; while ( *cursorPtr ) { if ( ( *cursorPtr == chCR) || ( *cursorPtr == chLF) || ( *cursorPtr == chHTab)) *cursorPtr = chSpace; cursorPtr++; } } // // a string is whitespace:collapsed, is whitespace::replaced // and no // leading space (#x20) // trailing space // no contiguous sequences of spaces // bool XMLString::isWSCollapsed(const XMLCh* const toCheck) { if (( !toCheck ) || ( !*toCheck )) return true; // shall be whitespace::replaced first if ( !isWSReplaced(toCheck) ) return false; // no leading or trailing space if ((*toCheck == chSpace) || (toCheck[XMLString::stringLen(toCheck)-1] == chSpace)) return false; const XMLCh* startPtr = toCheck; XMLCh theChar; bool inSpace = false; while ( (theChar = *startPtr) != 0 ) { if ( theChar == chSpace) { if (inSpace) return false; else inSpace = true; } else inSpace = false; startPtr++; } return true; } // // no leading and/or trailing spaces // no continuous sequences of spaces // void XMLString::collapseWS(XMLCh* toConvert , MemoryManager* const manager) { // If no string, then its a failure if (( !toConvert ) || ( !*toConvert )) return; // replace whitespace first if(!isWSReplaced(toConvert)) replaceWS(toConvert, manager); // remove leading spaces XMLCh* startPtr = toConvert; while ( *startPtr == chSpace ) startPtr++; if (!*startPtr) { *toConvert = chNull; return; } // remove trailing spaces XMLCh* endPtr = toConvert + stringLen(toConvert); while (*(endPtr - 1) == chSpace) endPtr--; *endPtr = chNull; // move data to beginning only if there were spaces in front if(startPtr != toConvert) XMLString::moveChars(toConvert, startPtr, endPtr - startPtr + 1); if(!isWSCollapsed(toConvert)) { // // Work through what remains and chop continuous spaces // XMLCh* retPtr = toConvert; startPtr = toConvert; bool inSpace = false; while (*startPtr) { if ( *startPtr == chSpace) { // copy a single space, then ignore subsequent if (!inSpace) { inSpace = true; *retPtr++ = chSpace; } } else { inSpace = false; *retPtr++ = *startPtr; } startPtr++; } *retPtr = chNull; } } // // remove whitespace // void XMLString::removeWS(XMLCh* toConvert, MemoryManager* const) { // If no string, then its a failure if (( !toConvert ) || ( !*toConvert )) return; XMLCh* retPtr = toConvert; XMLCh* startPtr = toConvert; while (*startPtr) { if ( ( *startPtr != chCR) && ( *startPtr != chLF) && ( *startPtr != chHTab) && ( *startPtr != chSpace) ) { *retPtr++ = *startPtr; } startPtr++; } *retPtr = chNull; } void XMLString::removeChar(const XMLCh* const srcString , const XMLCh& toRemove , XMLBuffer& dstBuffer) { if(!srcString) return; const XMLCh* pszSrc = srcString; XMLCh c; dstBuffer.reset(); while ((c=*pszSrc++)!=0) { if (c != toRemove) dstBuffer.append(c); } } /** * Fixes a platform dependent absolute path filename to standard URI form. * 1. Windows: fix 'x:' to 'file:///x:' and convert any backslash to forward slash * 2. UNIX: fix '/blah/blahblah' to 'file:///blah/blahblah' */ void XMLString::fixURI(const XMLCh* const str, XMLCh* const target) { if (!str || !*str) return; int colonIdx = XMLString::indexOf(str, chColon); // If starts with a '/' we assume // this is an absolute (UNIX) file path and prefix it with file:// if (colonIdx == -1 && XMLString::indexOf(str, chForwardSlash) == 0) { unsigned index = 0; target[index++] = chLatin_f; target[index++] = chLatin_i; target[index++] = chLatin_l; target[index++] = chLatin_e; target[index++] = chColon; target[index++] = chForwardSlash; target[index++] = chForwardSlash; // copy the string const XMLCh* inPtr = str; while (*inPtr) target[index++] = *inPtr++; target[index] = chNull; } else if (colonIdx == 1 && XMLString::isAlpha(*str)) { // If starts with a driver letter 'x:' we assume // this is an absolute (Windows) file path and prefix it with file:/// unsigned index = 0; target[index++] = chLatin_f; target[index++] = chLatin_i; target[index++] = chLatin_l; target[index++] = chLatin_e; target[index++] = chColon; target[index++] = chForwardSlash; target[index++] = chForwardSlash; target[index++] = chForwardSlash; // copy the string and fix any backward slash const XMLCh* inPtr = str; while (*inPtr) { if (*inPtr == chYenSign || *inPtr == chWonSign || *inPtr == chBackSlash) target[index++] = chForwardSlash; else target[index++] = *inPtr; inPtr++; } // cap it with null target[index] = chNull; } else { // not specific case, so just copy the string over copyString(target, str); } } void XMLString::release(char** buf, MemoryManager* const manager) { manager->deallocate(*buf); *buf = 0; } void XMLString::release(XMLCh** buf, MemoryManager* const manager) { manager->deallocate(*buf); *buf = 0; } // --------------------------------------------------------------------------- // XMLString: Private static methods // --------------------------------------------------------------------------- void XMLString::initString(XMLLCPTranscoder* const defToUse, MemoryManager* const manager) { // Store away the default transcoder that we are to use gTranscoder = defToUse; // Store memory manager fgMemoryManager = manager; } void XMLString::termString() { // Just clean up our local code page transcoder delete gTranscoder; gTranscoder = 0; // reset memory manager fgMemoryManager = 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/TranscodingException.hpp000644 000765 000024 00000002261 13241160335 024105 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: TranscodingException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_TRANSCODINGEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_TRANSCODINGEXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(TranscodingException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XercesVersion.hpp.in000644 000765 000024 00000021600 13242664414 023165 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XercesVersion.hpp 1824295 2018-02-15 11:17:15Z rleigh $ */ #if !defined(XERCESC_INCLUDE_GUARD_XERCESVERSION_HPP) #define XERCESC_INCLUDE_GUARD_XERCESVERSION_HPP // --------------------------------------------------------------------------- // 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 /** * User Documentation for Xerces Version Values: * * * * Xerces Notes: * * Xerces Committers Documentation: * * Xerces committers normally only need to modify one or two of the * following macros: * * XERCES_VERSION_MAJOR * XERCES_VERSION_MINOR * XERCES_VERSION_REVISION * * The integer values of these macros define the Xerces version number. All * other constants and preprocessor macros are automatically generated from * these three definitions. * * The macro XERCES_GRAMMAR_SERIALIZATION_LEVEL has been added so that during * development if users are using the latest code they can use the grammar * serialization/deserialization features. Whenever a change is made to the * serialization code this macro should be incremented. * * Xerces User Documentation: * * The following sections in the user documentation have examples based upon * the following three version input values: * * #define XERCES_VERSION_MAJOR 19 * #define XERCES_VERSION_MINOR 3 * #define XERCES_VERSION_REVISION 74 * * The minor and revision (patch level) numbers have two digits of resolution * which means that '3' becomes '03' in this example. This policy guarantees * that when using preprocessor macros, version 19.3.74 will be greater than * version 1.94.74 since the first will expand to 190374 and the second to * 19474. * * Preprocessor Macros: * * _XERCES_VERSION defines the primary preprocessor macro that users will * introduce into their code to perform conditional compilation where the * version of Xerces is detected in order to enable or disable version * specific capabilities. The value of _XERCES_VERSION for the above example * will be 190374. To use it a user would perform an operation such as the * following: * * #if _XERCES_VERSION >= 190374 * // code specific to new version of Xerces... * #else * // old code here... * #endif * * XERCES_FULLVERSIONSTR is a preprocessor macro that expands to a string * constant whose value, for the above example, will be "19_3_74". * * XERCES_FULLVERSIONDOT is a preprocessor macro that expands to a string * constant whose value, for the above example, will be "19.3.74". * * XERCES_VERSIONSTR is a preprocessor macro that expands to a string * constant whose value, for the above example, will be "19_3". This * particular macro is very dangerous if it were to be used for comparing * version numbers since ordering will not be guaranteed. * * Xerces_DLLVersionStr is a preprocessor macro that expands to a string * constant whose value, for the above example, will be "19_3_74". This * macro is provided for backwards compatibility to pre-1.7 versions of * Xerces. * * String Constants: * * gXercesVersionStr is a global string constant whose value corresponds to * the value "19_3" for the above example. * * gXercesFullVersionStr is a global string constant whose value corresponds * to the value "19_3_74" for the above example. * * Numeric Constants: * * gXercesMajVersion is a global integer constant whose value corresponds to * the major version number. For the above example its value will be 19. * * gXercesMinVersion is a global integer constant whose value corresponds to * the minor version number. For the above example its value will be 3. * * gXercesRevision is a global integer constant whose value corresponds to * the revision (patch) version number. For the above example its value will * be 74. * */ // --------------------------------------------------------------------------- // 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 /** * MODIFY THESE NUMERIC VALUES TO COINCIDE WITH XERCES VERSION * AND DO NOT MODIFY ANYTHING ELSE IN THIS VERSION HEADER FILE */ #undef XERCES_VERSION_MAJOR #undef XERCES_VERSION_MINOR #undef XERCES_VERSION_REVISION /*** * * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 4 SchemaAttDef, SchemaElementDecl serialize fPSVIScope * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 5 XercesStep serializes the axis as an int * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 6 added fIsExternal to XMLEntityDecl * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 7 size of line/column fields has changed * ***/ #undef XERCES_GRAMMAR_SERIALIZATION_LEVEL /** DO NOT MODIFY BELOW THIS LINE */ /** * MAGIC THAT AUTOMATICALLY GENERATES THE FOLLOWING: * * Xerces_DLLVersionStr, gXercesVersionStr, gXercesFullVersionStr, * gXercesMajVersion, gXercesMinVersion, gXercesRevision */ // --------------------------------------------------------------------------- // 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 // two argument concatenation routines #define CAT2_SEP_UNDERSCORE(a, b) #a "_" #b #define CAT2_SEP_PERIOD(a, b) #a "." #b #define CAT2_SEP_NIL(a, b) #a #b #define CAT2_RAW_NUMERIC(a, b) a ## b // two argument macro invokers #define INVK_CAT2_SEP_UNDERSCORE(a,b) CAT2_SEP_UNDERSCORE(a,b) #define INVK_CAT2_SEP_PERIOD(a,b) CAT2_SEP_PERIOD(a,b) #define INVK_CAT2_STR_SEP_NIL(a,b) CAT2_SEP_NIL(a,b) #define INVK_CAT2_RAW_NUMERIC(a,b) CAT2_RAW_NUMERIC(a,b) // --------------------------------------------------------------------------- // 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 // three argument concatenation routines #define CAT3_SEP_UNDERSCORE(a, b, c) #a "_" #b "_" #c #define CAT3_SEP_PERIOD(a, b, c) #a "." #b "." #c #define CAT3_SEP_NIL(a, b, c) #a #b #c #define CAT3_RAW_NUMERIC(a, b, c) a ## b ## c #define CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a, b, c) a ## _ ## b ## _ ## c // three argument macro invokers #define INVK_CAT3_SEP_UNDERSCORE(a,b,c) CAT3_SEP_UNDERSCORE(a,b,c) #define INVK_CAT3_SEP_PERIOD(a,b,c) CAT3_SEP_PERIOD(a,b,c) #define INVK_CAT3_SEP_NIL(a,b,c) CAT3_SEP_NIL(a,b,c) #define INVK_CAT3_RAW_NUMERIC(a,b,c) CAT3_RAW_NUMERIC(a,b,c) #define INVK_CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a,b,c) CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a,b,c) // --------------------------------------------------------------------------- // 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 #define MULTIPLY(factor,value) factor * value #define CALC_EXPANDED_FORM(a,b,c) ( MULTIPLY(10000,a) + MULTIPLY(100,b) + MULTIPLY(1,c) ) // --------------------------------------------------------------------------- // X E R C E S V E R S I O N I N F O R M A T I O N // Xerces version strings; these particular macros cannot be used for // conditional compilation as they are not numeric constants #define XERCES_FULLVERSIONSTR INVK_CAT3_SEP_UNDERSCORE(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION) #define XERCES_FULLVERSIONDOT INVK_CAT3_SEP_PERIOD(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION) #define XERCES_FULLVERSIONNUM INVK_CAT3_SEP_NIL(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION) #define XERCES_VERSIONSTR INVK_CAT2_SEP_UNDERSCORE(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR) // Xerces C++ Namespace string, concatenated with full version string #define XERCES_PRODUCT xercesc #define XERCES_CPP_NAMESPACE INVK_CAT3_RAW_NUMERIC_SEP_UNDERSCORE(XERCES_PRODUCT,XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR) // original from Xerces header #define Xerces_DLLVersionStr XERCES_FULLVERSIONSTR const char* const gXercesVersionStr = XERCES_VERSIONSTR; const char* const gXercesFullVersionStr = XERCES_FULLVERSIONSTR; const unsigned int gXercesMajVersion = XERCES_VERSION_MAJOR; const unsigned int gXercesMinVersion = XERCES_VERSION_MINOR; const unsigned int gXercesRevision = XERCES_VERSION_REVISION; // Xerces version numeric constants that can be used for conditional // compilation purposes. #define _XERCES_VERSION CALC_EXPANDED_FORM (XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION) #endif // XERCESVERSION_HPP xerces-c-3.2.2/src/xercesc/util/FlagJanitor.c000644 000765 000024 00000003743 13241160336 021615 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: FlagJanitor.c 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Constructors and Destructor // --------------------------------------------------------------------------- template FlagJanitor::FlagJanitor(T* const valPtr, const T newVal) : fValPtr(valPtr) { // Store the pointer, save the org value, and store the new value if (fValPtr) { fOldVal = *fValPtr; *fValPtr = newVal; } } template FlagJanitor::~FlagJanitor() { // Restore the old value if (fValPtr) *fValPtr = fOldVal; } // --------------------------------------------------------------------------- // Value management methods // --------------------------------------------------------------------------- template void FlagJanitor::release() { fValPtr = 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/CountedPointer.c000644 000765 000024 00000005471 13241160336 022357 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: CountedPointer.c 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // CountedPointerTo: Constructors and Destructor // --------------------------------------------------------------------------- template CountedPointerTo:: CountedPointerTo(const CountedPointerTo& toCopy) : fPtr(toCopy.fPtr) { if (fPtr) fPtr->addRef(); } template CountedPointerTo::CountedPointerTo(T* p) : fPtr(p) { if (fPtr) fPtr->addRef(); } template CountedPointerTo::~CountedPointerTo() { if (fPtr) fPtr->removeRef(); } // --------------------------------------------------------------------------- // CountedPointerTo: Operators // --------------------------------------------------------------------------- template CountedPointerTo& CountedPointerTo::operator=(const CountedPointerTo& other) { if (this == &other) return *this; if (other.fPtr) other.fPtr->addRef(); if (fPtr) fPtr->removeRef(); fPtr = other.fPtr; return *this; } template CountedPointerTo::operator T*() { return fPtr; } template const T* CountedPointerTo::operator->() const { return fPtr; } template T* CountedPointerTo::operator->() { return fPtr; } template const T& CountedPointerTo::operator*() const { if (!fPtr) ThrowXMLwithMemMgr(NullPointerException, XMLExcepts::CPtr_PointerIsZero, 0); return *fPtr; } template T& CountedPointerTo::operator*() { if (!fPtr) ThrowXMLwithMemMgr(NullPointerException, XMLExcepts::CPtr_PointerIsZero, 0); return *fPtr; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/PSVIUni.cpp000644 000765 000024 00000114151 13241160335 021205 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include "PSVIUni.hpp" XERCES_CPP_NAMESPACE_USE const XMLCh PSVIUni::fgPsvColon[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chNull }; const XMLCh PSVIUni::fgAllDeclarationsProcessed[] = { chLatin_a, chLatin_l, chLatin_l, chLatin_D, chLatin_e, chLatin_c, chLatin_l, chLatin_a, chLatin_r, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_s, chLatin_P, chLatin_r, chLatin_o, chLatin_c, chLatin_e, chLatin_s, chLatin_s, chLatin_e, chLatin_d, chNull }; const XMLCh PSVIUni::fgAttribute[] = { chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chNull }; const XMLCh PSVIUni::fgAttributes[] = { chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chLatin_s, chNull }; const XMLCh PSVIUni::fgAttributeType[] = { chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chNull }; const XMLCh PSVIUni::fgBaseURI[] = { chLatin_b, chLatin_a, chLatin_s, chLatin_e, chLatin_U, chLatin_R, chLatin_I, chNull }; const XMLCh PSVIUni::fgCanonicalRepresentation[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_c, chLatin_a, chLatin_n, chLatin_o, chLatin_n, chLatin_i, chLatin_c, chLatin_a, chLatin_l, chLatin_R, chLatin_e, chLatin_p, chNull }; const XMLCh PSVIUni::fgCharacter[] = { chLatin_c, chLatin_h, chLatin_a, chLatin_r, chLatin_a, chLatin_c, chLatin_t, chLatin_e, chLatin_r, chNull }; const XMLCh PSVIUni::fgCharacterEncodingScheme[] = { chLatin_c, chLatin_h, chLatin_a, chLatin_r, chLatin_a, chLatin_c, chLatin_t, chLatin_e, chLatin_r, chLatin_E, chLatin_n, chLatin_c, chLatin_o, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chLatin_S, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_e, chNull }; const XMLCh PSVIUni::fgChildren[] = { chLatin_c, chLatin_h, chLatin_i, chLatin_l, chLatin_d, chLatin_r, chLatin_e, chLatin_n, chNull }; const XMLCh PSVIUni::fgComment[] = { chLatin_c, chLatin_o, chLatin_m, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chNull }; const XMLCh PSVIUni::fgContent[] = { chLatin_c, chLatin_o, chLatin_n, chLatin_t, chLatin_e, chLatin_n, chLatin_t, chNull }; const XMLCh PSVIUni::fgDocument[] = { chLatin_d, chLatin_o, chLatin_c, chLatin_u, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chNull }; const XMLCh PSVIUni::fgDocTypeDeclaration[] = { chLatin_d, chLatin_o, chLatin_c, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chLatin_D, chLatin_e, chLatin_c, chLatin_l, chLatin_a, chLatin_r, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgDocumentElement[] = { chLatin_d, chLatin_o, chLatin_c, chLatin_u, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chLatin_E, chLatin_l, chLatin_e, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chNull }; const XMLCh PSVIUni::fgElement[] = { chLatin_e, chLatin_l, chLatin_e, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chNull }; const XMLCh PSVIUni::fgInScopeNamespaces[] = { chLatin_i, chLatin_n, chLatin_S, chLatin_c, chLatin_o, chLatin_p, chLatin_e, chLatin_N, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chLatin_s, chNull }; const XMLCh PSVIUni::fgLocalName[] = { chLatin_l, chLatin_o, chLatin_c, chLatin_a, chLatin_l, chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull }; const XMLCh PSVIUni::fgNamespace[] = { chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chNull }; const XMLCh PSVIUni::fgNamespaceAttributes[] = { chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chLatin_A, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chLatin_s, chNull }; const XMLCh PSVIUni::fgNamespaceName[] = { chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull }; const XMLCh PSVIUni::fgNormalizedValue[] = { chLatin_n, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_l, chLatin_i, chLatin_z, chLatin_e, chLatin_d, chLatin_V, chLatin_a, chLatin_l, chLatin_u, chLatin_e, chNull }; const XMLCh PSVIUni::fgNotations[] = { chLatin_n, chLatin_o, chLatin_t, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_s, chNull }; const XMLCh PSVIUni::fgPrefix[] = { chLatin_p, chLatin_r, chLatin_e, chLatin_f, chLatin_i, chLatin_x, chNull }; const XMLCh PSVIUni::fgProcessingInstruction[] = { chLatin_p, chLatin_r, chLatin_o, chLatin_c, chLatin_e, chLatin_s, chLatin_s, chLatin_i, chLatin_n, chLatin_g, chLatin_I, chLatin_n, chLatin_s, chLatin_t, chLatin_r, chLatin_u, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgReferences[] = { chLatin_r, chLatin_e, chLatin_f, chLatin_e, chLatin_r, chLatin_e, chLatin_n, chLatin_c, chLatin_e, chLatin_s, chNull }; const XMLCh PSVIUni::fgSpecified[] = { chLatin_s, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chNull }; const XMLCh PSVIUni::fgStandalone[] = { chLatin_s, chLatin_t, chLatin_a, chLatin_n, chLatin_d, chLatin_a, chLatin_l, chLatin_o, chLatin_n, chLatin_e, chNull }; const XMLCh PSVIUni::fgTarget[] = { chLatin_t, chLatin_a, chLatin_r, chLatin_g, chLatin_e, chLatin_t, chNull }; const XMLCh PSVIUni::fgText[] = { chLatin_t, chLatin_e, chLatin_x, chLatin_t, chNull }; const XMLCh PSVIUni::fgTextContent[] = { chLatin_t, chLatin_e, chLatin_x, chLatin_t, chLatin_C, chLatin_o, chLatin_n, chLatin_t, chLatin_e, chLatin_n, chLatin_t, chNull }; const XMLCh PSVIUni::fgUnparsedEntities[] = { chLatin_u, chLatin_n, chLatin_p, chLatin_a, chLatin_r, chLatin_s, chLatin_e, chLatin_d, chLatin_E, chLatin_n, chLatin_t, chLatin_i, chLatin_t, chLatin_i, chLatin_e, chLatin_s, chNull }; const XMLCh PSVIUni::fgVersion[] = { chLatin_v, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgAbstract[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_a, chLatin_b, chLatin_s, chLatin_t, chLatin_r, chLatin_a, chLatin_c, chLatin_t, chNull }; const XMLCh PSVIUni::fgAnnotation[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_a, chLatin_n, chLatin_n, chLatin_o, chLatin_t, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgAnnotations[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_a, chLatin_n, chLatin_n, chLatin_o, chLatin_t, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_s, chNull }; const XMLCh PSVIUni::fgApplicationInformation[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_a, chLatin_p, chLatin_p, chLatin_l, chLatin_i, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_I, chLatin_n, chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgAttributeDeclaration[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chLatin_D, chLatin_e, chLatin_c, chLatin_l, chLatin_a, chLatin_r, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgAttributeGroupDefinition[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chLatin_G, chLatin_r, chLatin_o, chLatin_u, chLatin_p, chLatin_D, chLatin_e, chLatin_f, chLatin_i, chLatin_n, chLatin_i, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgAttributeUse[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chLatin_U, chLatin_s, chLatin_e, chNull }; const XMLCh PSVIUni::fgAttributeUses[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chLatin_U, chLatin_s, chLatin_e, chLatin_s, chNull }; const XMLCh PSVIUni::fgAttributeWildcard[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chLatin_W, chLatin_i, chLatin_l, chLatin_d, chLatin_c, chLatin_a, chLatin_r, chLatin_d, chNull }; const XMLCh PSVIUni::fgBaseTypeDefinition[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_b, chLatin_a, chLatin_s, chLatin_e, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chLatin_D, chLatin_e, chLatin_f, chLatin_i, chLatin_n, chLatin_i, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgComplexTypeDefinition[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_c, chLatin_o, chLatin_m, chLatin_p, chLatin_l, chLatin_e, chLatin_x, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chLatin_D, chLatin_e, chLatin_f, chLatin_i, chLatin_n, chLatin_i, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgCompositor[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_c, chLatin_o, chLatin_m, chLatin_p, chLatin_o, chLatin_s, chLatin_i, chLatin_t, chLatin_o, chLatin_r, chNull }; const XMLCh PSVIUni::fgContentType[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_c, chLatin_o, chLatin_n, chLatin_t, chLatin_e, chLatin_n, chLatin_t, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chNull }; const XMLCh PSVIUni::fgDeclaration[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_d, chLatin_e, chLatin_c, chLatin_l, chLatin_a, chLatin_r, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgDerivationMethod[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_d, chLatin_e, chLatin_r, chLatin_i, chLatin_v, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_M, chLatin_e, chLatin_t, chLatin_h, chLatin_o, chLatin_d, chNull }; const XMLCh PSVIUni::fgDisallowedSubstitutions[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_d, chLatin_i, chLatin_s, chLatin_a, chLatin_l, chLatin_l, chLatin_o, chLatin_w, chLatin_e, chLatin_d, chLatin_S, chLatin_u, chLatin_b, chLatin_s, chLatin_t, chLatin_i, chLatin_t, chLatin_u, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_s, chNull }; const XMLCh PSVIUni::fgDocumentLocation[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_d, chLatin_o, chLatin_c, chLatin_u, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chLatin_L, chLatin_o, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgPsvDocument[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_d, chLatin_o, chLatin_c, chLatin_u, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chNull }; const XMLCh PSVIUni::fgElementDeclaration[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_e, chLatin_l, chLatin_e, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chLatin_D, chLatin_e, chLatin_c, chLatin_l, chLatin_a, chLatin_r, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgFacetFixed[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_f, chLatin_i, chLatin_x, chLatin_e, chLatin_d, chNull }; const XMLCh PSVIUni::fgFacets[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_f, chLatin_a, chLatin_c, chLatin_e, chLatin_t, chLatin_s, chNull }; const XMLCh PSVIUni::fgFields[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_f, chLatin_i, chLatin_e, chLatin_l, chLatin_d, chLatin_s, chNull }; const XMLCh PSVIUni::fgFinal[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_f, chLatin_i, chLatin_n, chLatin_a, chLatin_l, chNull }; const XMLCh PSVIUni::fgFundamentalFacets[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_f, chLatin_u, chLatin_n, chLatin_d, chLatin_a, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chLatin_a, chLatin_l, chLatin_F, chLatin_a, chLatin_c, chLatin_e, chLatin_t, chLatin_s, chNull }; const XMLCh PSVIUni::fgIdentityConstraintCategory[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_i, chLatin_d, chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_t, chLatin_y, chLatin_C, chLatin_o, chLatin_n, chLatin_s, chLatin_t, chLatin_r, chLatin_a, chLatin_i, chLatin_n, chLatin_t, chLatin_C, chLatin_a, chLatin_t, chLatin_e, chLatin_g, chLatin_o, chLatin_r, chLatin_y, chNull }; const XMLCh PSVIUni::fgIdentityConstraintDefinition[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_i, chLatin_d, chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_t, chLatin_y, chLatin_C, chLatin_o, chLatin_n, chLatin_s, chLatin_t, chLatin_r, chLatin_a, chLatin_i, chLatin_n, chLatin_t, chLatin_D, chLatin_e, chLatin_f, chLatin_i, chLatin_n, chLatin_i, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgIdentityConstraintDefinitions[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_i, chLatin_d, chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_t, chLatin_y, chLatin_C, chLatin_o, chLatin_n, chLatin_s, chLatin_t, chLatin_r, chLatin_a, chLatin_i, chLatin_n, chLatin_t, chLatin_D, chLatin_e, chLatin_f, chLatin_i, chLatin_n, chLatin_i, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_s, chNull }; const XMLCh PSVIUni::fgIdentityConstraintTable[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_i, chLatin_d, chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_t, chLatin_y, chLatin_C, chLatin_o, chLatin_n, chLatin_s, chLatin_t, chLatin_r, chLatin_a, chLatin_i, chLatin_n, chLatin_t, chLatin_T, chLatin_a, chLatin_b, chLatin_l, chLatin_e, chNull }; const XMLCh PSVIUni::fgIdIdrefTable[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_i, chLatin_d, chLatin_I, chLatin_d, chLatin_r, chLatin_e, chLatin_f, chLatin_T, chLatin_a, chLatin_b, chLatin_l, chLatin_e, chNull }; const XMLCh PSVIUni::fgItemTypeDefinition[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_i, chLatin_t, chLatin_e, chLatin_m, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chLatin_D, chLatin_e, chLatin_f, chLatin_i, chLatin_n, chLatin_i, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgMaxOccurs[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_m, chLatin_a, chLatin_x, chLatin_O, chLatin_c, chLatin_c, chLatin_u, chLatin_r, chLatin_s, chNull }; const XMLCh PSVIUni::fgMemberTypeDefinition[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_m, chLatin_e, chLatin_m, chLatin_b, chLatin_e, chLatin_r, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chLatin_D, chLatin_e, chLatin_f, chLatin_i, chLatin_n, chLatin_i, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgMemberTypeDefinitions[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_m, chLatin_e, chLatin_m, chLatin_b, chLatin_e, chLatin_r, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chLatin_D, chLatin_e, chLatin_f, chLatin_i, chLatin_n, chLatin_i, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_s, chNull }; const XMLCh PSVIUni::fgMinOccurs[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_m, chLatin_i, chLatin_n, chLatin_O, chLatin_c, chLatin_c, chLatin_u, chLatin_r, chLatin_s, chNull }; const XMLCh PSVIUni::fgModelGroup[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_m, chLatin_o, chLatin_d, chLatin_e, chLatin_l, chLatin_G, chLatin_r, chLatin_o, chLatin_u, chLatin_p, chNull }; const XMLCh PSVIUni::fgModelGroupDefinition[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_m, chLatin_o, chLatin_d, chLatin_e, chLatin_l, chLatin_G, chLatin_r, chLatin_o, chLatin_u, chLatin_p, chLatin_D, chLatin_e, chLatin_f, chLatin_i, chLatin_n, chLatin_i, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgName[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chNull }; const XMLCh PSVIUni::fgNamespaceConstraint[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chLatin_C, chLatin_o, chLatin_n, chLatin_s, chLatin_t, chLatin_r, chLatin_a, chLatin_i, chLatin_n, chLatin_t, chNull }; const XMLCh PSVIUni::fgNamespaces[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chLatin_s, chNull }; const XMLCh PSVIUni::fgNamespaceSchemaInformation[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chLatin_S, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_I, chLatin_n, chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgNil[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_n, chLatin_i, chLatin_l, chNull }; const XMLCh PSVIUni::fgNillable[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_n, chLatin_i, chLatin_l, chLatin_l, chLatin_a, chLatin_b, chLatin_l, chLatin_e, chNull }; const XMLCh PSVIUni::fgNotation[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_n, chLatin_o, chLatin_t, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgNotationDeclaration[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_n, chLatin_o, chLatin_t, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_D, chLatin_e, chLatin_c, chLatin_l, chLatin_a, chLatin_r, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgParticle[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_p, chLatin_a, chLatin_r, chLatin_t, chLatin_i, chLatin_c, chLatin_l, chLatin_e, chNull }; const XMLCh PSVIUni::fgParticles[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_p, chLatin_a, chLatin_r, chLatin_t, chLatin_i, chLatin_c, chLatin_l, chLatin_e, chLatin_s, chNull }; const XMLCh PSVIUni::fgPrimitiveTypeDefinition[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_p, chLatin_r, chLatin_i, chLatin_m, chLatin_i, chLatin_t, chLatin_i, chLatin_v, chLatin_e, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chLatin_D, chLatin_e, chLatin_f, chLatin_i, chLatin_n, chLatin_i, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgProcessContents[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_p, chLatin_r, chLatin_o, chLatin_c, chLatin_e, chLatin_s, chLatin_s, chLatin_C, chLatin_o, chLatin_n, chLatin_t, chLatin_e, chLatin_n, chLatin_t, chLatin_s, chNull }; const XMLCh PSVIUni::fgProhibitedSubstitutions[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_p, chLatin_r, chLatin_o, chLatin_h, chLatin_i, chLatin_b, chLatin_i, chLatin_t, chLatin_e, chLatin_d, chLatin_S, chLatin_u, chLatin_b, chLatin_s, chLatin_t, chLatin_i, chLatin_t, chLatin_u, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_s, chNull }; const XMLCh PSVIUni::fgPublicIdentifier[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_p, chLatin_u, chLatin_b, chLatin_l, chLatin_i, chLatin_c, chLatin_I, chLatin_d, chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_r, chNull }; const XMLCh PSVIUni::fgReferencedKey[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_r, chLatin_e, chLatin_f, chLatin_e, chLatin_r, chLatin_e, chLatin_n, chLatin_c, chLatin_e, chLatin_d, chLatin_K, chLatin_e, chLatin_y, chNull }; const XMLCh PSVIUni::fgRequired[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_r, chLatin_e, chLatin_q, chLatin_u, chLatin_i, chLatin_r, chLatin_e, chLatin_d, chNull }; const XMLCh PSVIUni::fgSchemaAnnotations[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_A, chLatin_n, chLatin_n, chLatin_o, chLatin_t, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_s, chNull }; const XMLCh PSVIUni::fgSchemaComponents[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_C, chLatin_o, chLatin_m, chLatin_p, chLatin_o, chLatin_n, chLatin_e, chLatin_n, chLatin_t, chLatin_s, chNull }; const XMLCh PSVIUni::fgSchemaDefault[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_D, chLatin_e, chLatin_f, chLatin_a, chLatin_u, chLatin_l, chLatin_t, chNull }; const XMLCh PSVIUni::fgSchemaDocument[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_D, chLatin_o, chLatin_c, chLatin_u, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chNull }; const XMLCh PSVIUni::fgSchemaDocuments[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_D, chLatin_o, chLatin_c, chLatin_u, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chLatin_s, chNull }; const XMLCh PSVIUni::fgSchemaErrorCode[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_E, chLatin_r, chLatin_r, chLatin_o, chLatin_r, chLatin_C, chLatin_o, chLatin_d, chLatin_e, chNull }; const XMLCh PSVIUni::fgSchemaInformation[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_I, chLatin_n, chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgSchemaNamespace[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_N, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chNull }; const XMLCh PSVIUni::fgSchemaNormalizedValue[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_N, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_l, chLatin_i, chLatin_z, chLatin_e, chLatin_d, chLatin_V, chLatin_a, chLatin_l, chLatin_u, chLatin_e, chNull }; const XMLCh PSVIUni::fgSchemaSpecified[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_S, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chNull }; const XMLCh PSVIUni::fgScope[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_s, chLatin_c, chLatin_o, chLatin_p, chLatin_e, chNull }; const XMLCh PSVIUni::fgSelector[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_s, chLatin_e, chLatin_l, chLatin_e, chLatin_c, chLatin_t, chLatin_o, chLatin_r, chNull }; const XMLCh PSVIUni::fgSimpleTypeDefinition[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_s, chLatin_i, chLatin_m, chLatin_p, chLatin_l, chLatin_e, chLatin_T, chLatin_y, chLatin_p, chLatin_e, chLatin_D, chLatin_e, chLatin_f, chLatin_i, chLatin_n, chLatin_i, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgSubstitutionGroupAffiliation[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_s, chLatin_u, chLatin_b, chLatin_s, chLatin_t, chLatin_i, chLatin_t, chLatin_u, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_G, chLatin_r, chLatin_o, chLatin_u, chLatin_p, chLatin_A, chLatin_f, chLatin_f, chLatin_i, chLatin_l, chLatin_i, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgSubstitutionGroupExclusions[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_s, chLatin_u, chLatin_b, chLatin_s, chLatin_t, chLatin_i, chLatin_t, chLatin_u, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_G, chLatin_r, chLatin_o, chLatin_u, chLatin_p, chLatin_E, chLatin_x, chLatin_c, chLatin_l, chLatin_u, chLatin_s, chLatin_i, chLatin_o, chLatin_n, chLatin_s, chNull }; const XMLCh PSVIUni::fgSystemIdentifier[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_s, chLatin_y, chLatin_s, chLatin_t, chLatin_e, chLatin_m, chLatin_I, chLatin_d, chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_r, chNull }; const XMLCh PSVIUni::fgTargetNamespace[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_t, chLatin_a, chLatin_r, chLatin_g, chLatin_e, chLatin_t, chLatin_N, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chNull }; const XMLCh PSVIUni::fgTerm[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_t, chLatin_e, chLatin_r, chLatin_m, chNull }; const XMLCh PSVIUni::fgTypeDefinition[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_t, chLatin_y, chLatin_p, chLatin_e, chLatin_D, chLatin_e, chLatin_f, chLatin_i, chLatin_n, chLatin_i, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgUserInformation[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_u, chLatin_s, chLatin_e, chLatin_r, chLatin_I, chLatin_n, chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgValidationAttempted[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_v, chLatin_a, chLatin_l, chLatin_i, chLatin_d, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_A, chLatin_t, chLatin_t, chLatin_e, chLatin_m, chLatin_p, chLatin_t, chLatin_e, chLatin_d, chNull }; const XMLCh PSVIUni::fgValidationContext[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_v, chLatin_a, chLatin_l, chLatin_i, chLatin_d, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_C, chLatin_o, chLatin_n, chLatin_t, chLatin_e, chLatin_x, chLatin_t, chNull }; const XMLCh PSVIUni::fgValidity[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_v, chLatin_a, chLatin_l, chLatin_i, chLatin_d, chLatin_i, chLatin_t, chLatin_y, chNull }; const XMLCh PSVIUni::fgValue[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_v, chLatin_a, chLatin_l, chLatin_u, chLatin_e, chNull }; const XMLCh PSVIUni::fgValueConstraint[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_v, chLatin_a, chLatin_l, chLatin_u, chLatin_e, chLatin_C, chLatin_o, chLatin_n, chLatin_s, chLatin_t, chLatin_r, chLatin_a, chLatin_i, chLatin_n, chLatin_t, chNull }; const XMLCh PSVIUni::fgVariety[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_v, chLatin_a, chLatin_r, chLatin_i, chLatin_e, chLatin_t, chLatin_y, chNull }; const XMLCh PSVIUni::fgWildcard[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_w, chLatin_i, chLatin_l, chLatin_d, chLatin_c, chLatin_a, chLatin_r, chLatin_d, chNull }; const XMLCh PSVIUni::fgXpath[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_x, chLatin_p, chLatin_a, chLatin_t, chLatin_h, chNull }; const XMLCh PSVIUni::fgAll[] = { chLatin_a, chLatin_l, chLatin_l, chNull }; const XMLCh PSVIUni::fgAny[] = { chLatin_a, chLatin_n, chLatin_y, chNull }; const XMLCh PSVIUni::fgAppinfo[] = { chLatin_a, chLatin_p, chLatin_p, chLatin_i, chLatin_n, chLatin_f, chLatin_o, chNull }; const XMLCh PSVIUni::fgAtomic[] = { chLatin_a, chLatin_t, chLatin_o, chLatin_m, chLatin_i, chLatin_c, chNull }; const XMLCh PSVIUni::fgChoice[] = { chLatin_c, chLatin_h, chLatin_o, chLatin_i, chLatin_c, chLatin_e, chNull }; const XMLCh PSVIUni::fgDefault[] = { chLatin_d, chLatin_e, chLatin_f, chLatin_a, chLatin_u, chLatin_l, chLatin_t, chNull }; const XMLCh PSVIUni::fgDocumentation[] = { chLatin_d, chLatin_o, chLatin_c, chLatin_u, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgElementOnly[] = { chLatin_e, chLatin_l, chLatin_e, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chLatin_O, chLatin_n, chLatin_l, chLatin_y, chNull }; const XMLCh PSVIUni::fgEmpty[] = { chLatin_e, chLatin_m, chLatin_p, chLatin_t, chLatin_y, chNull }; const XMLCh PSVIUni::fgExtension[] = { chLatin_e, chLatin_x, chLatin_t, chLatin_e, chLatin_n, chLatin_s, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgFalse[] = { chLatin_f, chLatin_a, chLatin_l, chLatin_s, chLatin_e, chNull }; const XMLCh PSVIUni::fgFull[] = { chLatin_f, chLatin_u, chLatin_l, chLatin_l, chNull }; const XMLCh PSVIUni::fgGlobal[] = { chLatin_g, chLatin_l, chLatin_o, chLatin_b, chLatin_a, chLatin_l, chNull }; const XMLCh PSVIUni::fgInfoset[] = { chLatin_i, chLatin_n, chLatin_f, chLatin_o, chLatin_s, chLatin_e, chLatin_t, chNull }; const XMLCh PSVIUni::fgInvalid[] = { chLatin_i, chLatin_n, chLatin_v, chLatin_a, chLatin_l, chLatin_i, chLatin_d, chNull }; const XMLCh PSVIUni::fgKey[] = { chLatin_k, chLatin_e, chLatin_y, chNull }; const XMLCh PSVIUni::fgKeyref[] = { chLatin_k, chLatin_e, chLatin_y, chLatin_r, chLatin_e, chLatin_f, chNull }; const XMLCh PSVIUni::fgLax[] = { chLatin_l, chLatin_a, chLatin_x, chNull }; const XMLCh PSVIUni::fgList[] = { chLatin_l, chLatin_i, chLatin_s, chLatin_t, chNull }; const XMLCh PSVIUni::fgLocal[] = { chLatin_l, chLatin_o, chLatin_c, chLatin_a, chLatin_l, chNull }; const XMLCh PSVIUni::fgMixed[] = { chLatin_m, chLatin_i, chLatin_x, chLatin_e, chLatin_d, chNull }; const XMLCh PSVIUni::fgNone[] = { chLatin_n, chLatin_o, chLatin_n, chLatin_e, chNull }; const XMLCh PSVIUni::fgNotKnown[] = { chLatin_n, chLatin_o, chLatin_t, chLatin_K, chLatin_n, chLatin_o, chLatin_w, chLatin_n, chNull }; const XMLCh PSVIUni::fgNsNamespace[] = { chLatin_n, chLatin_s, chLatin_N, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chNull }; const XMLCh PSVIUni::fgOnePointZero[] = { chDigit_1, chPeriod, chDigit_0, chNull }; const XMLCh PSVIUni::fgPartial[] = { chLatin_p, chLatin_a, chLatin_r, chLatin_t, chLatin_i, chLatin_a, chLatin_l, chNull }; const XMLCh PSVIUni::fgRestrict[] = { chLatin_r, chLatin_e, chLatin_s, chLatin_t, chLatin_r, chLatin_i, chLatin_c, chLatin_t, chNull }; const XMLCh PSVIUni::fgRestriction[] = { chLatin_r, chLatin_e, chLatin_s, chLatin_t, chLatin_r, chLatin_i, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgSchema[] = { chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chNull }; const XMLCh PSVIUni::fgSequence[] = { chLatin_s, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_n, chLatin_c, chLatin_e, chNull }; const XMLCh PSVIUni::fgSimple[] = { chLatin_s, chLatin_i, chLatin_m, chLatin_p, chLatin_l, chLatin_e, chNull }; const XMLCh PSVIUni::fgSkip[] = { chLatin_s, chLatin_k, chLatin_i, chLatin_p, chNull }; const XMLCh PSVIUni::fgStrict[] = { chLatin_s, chLatin_t, chLatin_r, chLatin_i, chLatin_c, chLatin_t, chNull }; const XMLCh PSVIUni::fgSubstitution[] = { chLatin_s, chLatin_u, chLatin_b, chLatin_s, chLatin_t, chLatin_i, chLatin_t, chLatin_u, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgTotal[] = { chLatin_t, chLatin_o, chLatin_t, chLatin_a, chLatin_l, chNull }; const XMLCh PSVIUni::fgTrue[] = { chLatin_t, chLatin_r, chLatin_u, chLatin_e, chNull }; const XMLCh PSVIUni::fgUnbounded[] = { chLatin_u, chLatin_n, chLatin_b, chLatin_o, chLatin_u, chLatin_n, chLatin_d, chLatin_e, chLatin_d, chNull }; const XMLCh PSVIUni::fgUnion[] = { chLatin_u, chLatin_n, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgUnique[] = { chLatin_u, chLatin_n, chLatin_i, chLatin_q, chLatin_u, chLatin_e, chNull }; const XMLCh PSVIUni::fgUnknown[] = { chLatin_u, chLatin_n, chLatin_k, chLatin_n, chLatin_o, chLatin_w, chLatin_n, chNull }; const XMLCh PSVIUni::fgValid[] = { chLatin_v, chLatin_a, chLatin_l, chLatin_i, chLatin_d, chNull }; const XMLCh PSVIUni::fgVCFixed[] = { chLatin_f, chLatin_i, chLatin_x, chLatin_e, chLatin_d, chNull }; const XMLCh PSVIUni::fgXMLChNull[] = { chNull }; const XMLCh PSVIUni::fgAg[] = { chLatin_a, chLatin_g, chNull }; const XMLCh PSVIUni::fgAnnot[] = { chLatin_a, chLatin_n, chLatin_n, chLatin_o, chLatin_t, chNull }; const XMLCh PSVIUni::fgAttr[] = { chLatin_a, chLatin_t, chLatin_t, chLatin_r, chNull }; const XMLCh PSVIUni::fgAu[] = { chLatin_a, chLatin_u, chNull }; const XMLCh PSVIUni::fgElt[] = { chLatin_e, chLatin_l, chLatin_t, chNull }; const XMLCh PSVIUni::fgIdc[] = { chLatin_i, chLatin_d, chLatin_c, chNull }; const XMLCh PSVIUni::fgMg[] = { chLatin_m, chLatin_g, chNull }; const XMLCh PSVIUni::fgNot[] = { chLatin_n, chLatin_o, chLatin_t, chNull }; const XMLCh PSVIUni::fgType[] = { chLatin_t, chLatin_y, chLatin_p, chLatin_e, chNull }; const XMLCh PSVIUni::fgBounded[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_b, chLatin_o, chLatin_u, chLatin_n, chLatin_d, chLatin_e, chLatin_d, chNull }; const XMLCh PSVIUni::fgCardinality[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_c, chLatin_a, chLatin_r, chLatin_d, chLatin_i, chLatin_n, chLatin_a, chLatin_l, chLatin_i, chLatin_t, chLatin_y, chNull }; const XMLCh PSVIUni::fgEnumeration[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_e, chLatin_n, chLatin_u, chLatin_m, chLatin_e, chLatin_r, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgFractionDigits[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_f, chLatin_r, chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_D, chLatin_i, chLatin_g, chLatin_i, chLatin_t, chLatin_s, chNull }; const XMLCh PSVIUni::fgLength[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_l, chLatin_e, chLatin_n, chLatin_g, chLatin_t, chLatin_h, chNull }; const XMLCh PSVIUni::fgMaxExclusive[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_m, chLatin_a, chLatin_x, chLatin_E, chLatin_x, chLatin_c, chLatin_l, chLatin_u, chLatin_s, chLatin_i, chLatin_v, chLatin_e, chNull }; const XMLCh PSVIUni::fgMaxInclusive[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_m, chLatin_a, chLatin_x, chLatin_I, chLatin_n, chLatin_c, chLatin_l, chLatin_u, chLatin_s, chLatin_i, chLatin_v, chLatin_e, chNull }; const XMLCh PSVIUni::fgMaxLength[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_m, chLatin_a, chLatin_x, chLatin_L, chLatin_e, chLatin_n, chLatin_g, chLatin_t, chLatin_h, chNull }; const XMLCh PSVIUni::fgMinExclusive[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_m, chLatin_i, chLatin_n, chLatin_E, chLatin_x, chLatin_c, chLatin_l, chLatin_u, chLatin_s, chLatin_i, chLatin_v, chLatin_e, chNull }; const XMLCh PSVIUni::fgMinInclusive[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_m, chLatin_i, chLatin_n, chLatin_I, chLatin_n, chLatin_c, chLatin_l, chLatin_u, chLatin_s, chLatin_i, chLatin_v, chLatin_e, chNull }; const XMLCh PSVIUni::fgMinLength[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_m, chLatin_i, chLatin_n, chLatin_L, chLatin_e, chLatin_n, chLatin_g, chLatin_t, chLatin_h, chNull }; const XMLCh PSVIUni::fgNumeric[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_n, chLatin_u, chLatin_m, chLatin_e, chLatin_r, chLatin_i, chLatin_c, chNull }; const XMLCh PSVIUni::fgOrdered[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_o, chLatin_r, chLatin_d, chLatin_e, chLatin_r, chLatin_e, chLatin_d, chNull }; const XMLCh PSVIUni::fgPattern[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_p, chLatin_a, chLatin_t, chLatin_t, chLatin_e, chLatin_r, chLatin_n, chNull }; const XMLCh PSVIUni::fgTotalDigits[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_t, chLatin_o, chLatin_t, chLatin_a, chLatin_l, chLatin_D, chLatin_i, chLatin_g, chLatin_i, chLatin_t, chLatin_s, chNull }; const XMLCh PSVIUni::fgWhiteSpace[] = { chLatin_p, chLatin_s, chLatin_v, chColon, chLatin_w, chLatin_h, chLatin_i, chLatin_t, chLatin_e, chLatin_S, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chNull }; const XMLCh PSVIUni::fgNamespaceInfoset[] = { //http://www.w3.org/2001/05/XMLInfoset chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash, chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_w, chDigit_3, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash, chDigit_2, chDigit_0, chDigit_0, chDigit_1, chForwardSlash, chDigit_0, chDigit_5, chForwardSlash, chLatin_X, chLatin_M, chLatin_L, chLatin_I, chLatin_n, chLatin_f, chLatin_o, chLatin_s, chLatin_e, chLatin_t, chNull }; const XMLCh PSVIUni::fgXsi[] = { //xsi chLatin_x, chLatin_s, chLatin_i, chNull }; const XMLCh PSVIUni::fgNamespaceInstance[] = { //http://www.w3.org/2001/XMLSchema-instance chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash, chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_w, chDigit_3, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash, chDigit_2, chDigit_0, chDigit_0, chDigit_1, chForwardSlash, chLatin_X, chLatin_M, chLatin_L, chLatin_S, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chDash, chLatin_i, chLatin_n, chLatin_s, chLatin_t, chLatin_a, chLatin_n, chLatin_c, chLatin_e, chNull }; const XMLCh PSVIUni::fgPsv[] = { //psv chLatin_p, chLatin_s, chLatin_v, chNull }; const XMLCh PSVIUni::fgNamespacePsvi[] = { //http://apache.org/xml/2001/PSVInfosetExtension chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash, chLatin_a, chLatin_p, chLatin_a, chLatin_c, chLatin_h, chLatin_e, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash, chLatin_x, chLatin_m, chLatin_l, chForwardSlash, chDigit_2, chDigit_0, chDigit_0, chDigit_1, chForwardSlash, chLatin_P, chLatin_S, chLatin_V, chLatin_I, chLatin_n, chLatin_f, chLatin_o, chLatin_s, chLatin_e, chLatin_t, chLatin_E, chLatin_x, chLatin_t, chLatin_e, chLatin_n, chLatin_s, chLatin_i, chLatin_o, chLatin_n, chNull }; const XMLCh PSVIUni::fgXml[] = { chLatin_x, chLatin_m, chLatin_l, chNull }; const XMLCh PSVIUni::fgNamespaceXmlSchema[] = { //http://www.w3.org/2001/XMLSchema chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash, chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_w, chDigit_3, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash, chDigit_2, chDigit_0, chDigit_0, chDigit_1, chForwardSlash, chLatin_X, chLatin_M, chLatin_L, chLatin_S, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chNull }; xerces-c-3.2.2/src/xercesc/util/BitOps.hpp000644 000765 000024 00000004257 13241160335 021162 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BitOps.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_BITOPS_HPP) #define XERCESC_INCLUDE_GUARD_BITOPS_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT BitOps { public: // ----------------------------------------------------------------------- // Public static methods // ----------------------------------------------------------------------- static inline XMLCh swapBytes(const XMLUInt16 toSwap) { //The mask is required to overcome a compiler error on solaris return XMLCh(((toSwap >> 8) | (toSwap << 8)) & 0xFFFF); } static inline unsigned int swapBytes(const XMLUInt32 toSwap) { return ( (toSwap >> 24) | (toSwap << 24) | ((toSwap & 0xFF00) << 8) | ((toSwap & 0xFF0000) >> 8) ); } protected : // ----------------------------------------------------------------------- // Unimplemented constructors and operators. (These ought to be private, // but that produces spurious compiler warnings // on some platforms.) // ----------------------------------------------------------------------- BitOps(); BitOps(const BitOps&); BitOps& operator=(const BitOps&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/RefHash3KeysIdPool.hpp000644 000765 000024 00000025074 13241160336 023331 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: RefHash3KeysIdPool.hpp 883368 2009-11-23 15:28:19Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_REFHASH3KEYSIDPOOL_HPP) #define XERCESC_INCLUDE_GUARD_REFHASH3KEYSIDPOOL_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // This hash table is a combination of RefHash2KeyTableOf (with an additional integer as key3) // and NameIdPool with an id as index // Forward declare the enumerator so it can be our friend. // template class RefHash3KeysIdPoolEnumerator; // // This should really be a nested class, but some of the compilers we // have to support cannot deal with that! // template struct RefHash3KeysTableBucketElem { RefHash3KeysTableBucketElem( void* key1 , int key2 , int key3 , TVal* const value , RefHash3KeysTableBucketElem* next) : fData(value) , fNext(next) , fKey1(key1) , fKey2(key2) , fKey3(key3) { } RefHash3KeysTableBucketElem() {}; ~RefHash3KeysTableBucketElem() {}; TVal* fData; RefHash3KeysTableBucketElem* fNext; void* fKey1; int fKey2; int fKey3; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- RefHash3KeysTableBucketElem(const RefHash3KeysTableBucketElem&); RefHash3KeysTableBucketElem& operator=(const RefHash3KeysTableBucketElem&); }; template class RefHash3KeysIdPool : public XMemory { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- RefHash3KeysIdPool( const XMLSize_t modulus, const XMLSize_t initSize = 128, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); RefHash3KeysIdPool( const XMLSize_t modulus, const THasher& hasher, const XMLSize_t initSize = 128, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); RefHash3KeysIdPool( const XMLSize_t modulus, const bool adoptElems, const XMLSize_t initSize = 128, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); RefHash3KeysIdPool( const XMLSize_t modulus, const bool adoptElems, const THasher& hasher, const XMLSize_t initSize = 128, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~RefHash3KeysIdPool(); // ----------------------------------------------------------------------- // Element management // ----------------------------------------------------------------------- bool isEmpty() const; bool containsKey(const void* const key1, const int key2, const int key3) const; void removeAll(); // ----------------------------------------------------------------------- // Getters // ----------------------------------------------------------------------- TVal* getByKey(const void* const key1, const int key2, const int key3); const TVal* getByKey(const void* const key1, const int key2, const int key3) const; TVal* getById(const unsigned int elemId); const TVal* getById(const unsigned int elemId) const; MemoryManager* getMemoryManager() const; XMLSize_t getHashModulus() const; // ----------------------------------------------------------------------- // Putters // ----------------------------------------------------------------------- XMLSize_t put(void* key1, int key2, int key3, TVal* const valueToAdopt); private : // ----------------------------------------------------------------------- // Declare our friends // ----------------------------------------------------------------------- friend class RefHash3KeysIdPoolEnumerator; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- RefHash3KeysIdPool(const RefHash3KeysIdPool&); RefHash3KeysIdPool& operator=(const RefHash3KeysIdPool&); // ----------------------------------------------------------------------- // Private methods // ----------------------------------------------------------------------- RefHash3KeysTableBucketElem* findBucketElem(const void* const key1, const int key2, const int key3, XMLSize_t& hashVal); const RefHash3KeysTableBucketElem* findBucketElem(const void* const key1, const int key2, const int key3, XMLSize_t& hashVal) const; void initialize(const XMLSize_t modulus); // ----------------------------------------------------------------------- // Data members // // fAdoptedElems // Indicates whether the values added are adopted or just referenced. // If adopted, then they are deleted when they are removed from the // hash table. // // fBucketList // This is the array that contains the heads of all of the list // buckets, one for each possible hash value. // // fHashModulus // The modulus used for this hash table, to hash the keys. This is // also the number of elements in the bucket list. // // fHash // The hasher for the key1 data type. // // fIdPtrs // fIdPtrsCount // This is the array of pointers to the bucket elements in order of // their assigned ids. So taking id N and referencing this array // gives you the element with that id. The count field indicates // the current size of this list. When fIdCounter+1 reaches this // value the list must be expanded. // // fIdCounter // This is used to give out unique ids to added elements. It starts // at zero (which means empty), and is bumped up for each newly added // element. So the first element is 1, the next is 2, etc... This // means that this value is set to the top index of the fIdPtrs array. // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; bool fAdoptedElems; RefHash3KeysTableBucketElem** fBucketList; XMLSize_t fHashModulus; TVal** fIdPtrs; XMLSize_t fIdPtrsCount; XMLSize_t fIdCounter; THasher fHasher; }; // // An enumerator for a value array. It derives from the basic enumerator // class, so that value vectors can be generically enumerated. // template class RefHash3KeysIdPoolEnumerator : public XMLEnumerator, public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- RefHash3KeysIdPoolEnumerator(RefHash3KeysIdPool* const toEnum , const bool adopt = false , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); virtual ~RefHash3KeysIdPoolEnumerator(); RefHash3KeysIdPoolEnumerator(const RefHash3KeysIdPoolEnumerator&); // ----------------------------------------------------------------------- // Enum interface // ----------------------------------------------------------------------- bool hasMoreElements() const; TVal& nextElement(); void Reset(); XMLSize_t size() const; // ----------------------------------------------------------------------- // New interface // ----------------------------------------------------------------------- void resetKey(); void nextElementKey(void*&, int&, int&); bool hasMoreKeys() const; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- RefHash3KeysIdPoolEnumerator& operator=(const RefHash3KeysIdPoolEnumerator&); // ----------------------------------------------------------------------- // Private methods // ----------------------------------------------------------------------- void findNext(); // ----------------------------------------------------------------------- // Data Members // fAdoptedElems // Indicates whether the values added are adopted or just referenced. // If adopted, then they are deleted when they are removed from the // hash table // // fCurIndex // This is the current index into the pool's id mapping array. This // is now we enumerate it. // // fToEnum // The name id pool that is being enumerated. // ----------------------------------------------------------------------- bool fAdoptedElems; XMLSize_t fCurIndex; RefHash3KeysIdPool* fToEnum; RefHash3KeysTableBucketElem* fCurElem; XMLSize_t fCurHash; MemoryManager* const fMemoryManager; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/TransService.hpp000644 000765 000024 00000061562 13272177434 022410 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: TransService.hpp 1826420 2018-03-10 21:01:56Z rleigh $ */ #if !defined(XERCESC_INCLUDE_GUARD_TRANSSERVICE_HPP) #define XERCESC_INCLUDE_GUARD_TRANSSERVICE_HPP #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // Forward references //class XMLPlatformUtils; class XMLLCPTranscoder; class XMLTranscoder; class ENameMap; // // This class is an abstract base class which are used to abstract the // transcoding services that Xerces uses. The parser's actual transcoding // needs are small so it is desirable to allow different implementations // to be provided. // // The transcoding service has to provide a couple of required string // and character operations, but its most important service is the creation // of transcoder objects. There are two types of transcoders, which are // discussed below in the XMLTranscoder class' description. // class XMLUTIL_EXPORT XMLTransService : public XMemory { public : // ----------------------------------------------------------------------- // Class specific types // ----------------------------------------------------------------------- enum Codes { Ok , UnsupportedEncoding , InternalFailure , SupportFilesNotFound }; struct TransRec { XMLCh intCh; XMLByte extCh; }; // ----------------------------------------------------------------------- // Public constructors and destructor // ----------------------------------------------------------------------- virtual ~XMLTransService(); // ----------------------------------------------------------------------- // Non-virtual API // ----------------------------------------------------------------------- XMLTranscoder* makeNewTranscoderFor ( const XMLCh* const encodingName , XMLTransService::Codes& resValue , const XMLSize_t blockSize , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); XMLTranscoder* makeNewTranscoderFor ( const char* const encodingName , XMLTransService::Codes& resValue , const XMLSize_t blockSize , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); XMLTranscoder* makeNewTranscoderFor ( XMLRecognizer::Encodings encodingEnum , XMLTransService::Codes& resValue , const XMLSize_t blockSize , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); // ----------------------------------------------------------------------- // The virtual transcoding service API // ----------------------------------------------------------------------- virtual int compareIString ( const XMLCh* const comp1 , const XMLCh* const comp2 ) = 0; virtual int compareNIString ( const XMLCh* const comp1 , const XMLCh* const comp2 , const XMLSize_t maxChars ) = 0; virtual const XMLCh* getId() const = 0; // ----------------------------------------------------------------------- // Create a new transcoder for the local code page. // // @param manager The memory manager to use. // ----------------------------------------------------------------------- virtual XMLLCPTranscoder* makeNewLCPTranscoder(MemoryManager* manager) = 0; virtual bool supportsSrcOfs() const = 0; virtual void upperCase(XMLCh* const toUpperCase) = 0; virtual void lowerCase(XMLCh* const toLowerCase) = 0; // ----------------------------------------------------------------------- // Allow users to add their own encodings to the intrinsic mapping // table // Usage: // XMLTransService::addEncoding ( // gMyEncodingNameString // , new ENameMapFor(gMyEncodingNameString) // ); // ----------------------------------------------------------------------- static void addEncoding(const XMLCh* const encoding, ENameMap* const ownMapping); protected : // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- XMLTransService(); // ----------------------------------------------------------------------- // Protected virtual methods. // ----------------------------------------------------------------------- #ifdef OS390 friend class Uniconv390TransService; #endif virtual XMLTranscoder* makeNewXMLTranscoder ( const XMLCh* const encodingName , XMLTransService::Codes& resValue , const XMLSize_t blockSize , MemoryManager* const manager ) = 0; // ----------------------------------------------------------------------- // Protected init method for platform utils to call // ----------------------------------------------------------------------- friend class XMLPlatformUtils; virtual void initTransService(); // ----------------------------------------------------------------------- // protected static members // gMappings // This is a hash table of ENameMap objects. It is created and filled // in when the platform init calls our initTransService() method. // // gMappingsRecognizer // This is an array of ENameMap objects, predefined for those // already recognized by XMLRecognizer::Encodings. // static RefHashTableOf* gMappings; static RefVectorOf* gMappingsRecognizer; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLTransService(const XMLTransService&); XMLTransService& operator=(const XMLTransService&); // ----------------------------------------------------------------------- // Hidden method to enable/disable strict IANA encoding check // Caller: XMLPlatformUtils // ----------------------------------------------------------------------- void strictIANAEncoding(const bool newState); bool isStrictIANAEncoding(); friend class XMLInitializer; }; /** * XMLTranscoder is for transcoding non-local code * page encodings, i.e. named encodings. These are used internally * by the scanner to internalize raw XML into the internal Unicode * format, and by writer classes to convert that internal Unicode * format (which comes out of the parser) back out to a format that * the receiving client code wants to use. */ class XMLUTIL_EXPORT XMLTranscoder : public XMemory { public : /** * This enum is used by the transcodeTo() method * to indicate how to react to unrepresentable characters. The * transcodeFrom() method always works the * same. It will consider any invalid data to be an error and * throw. */ enum UnRepOpts { UnRep_Throw /**< Throw an exception */ , UnRep_RepChar /**< Use the replacement char */ }; /** @name Destructor. */ //@{ /** * Destructor for XMLTranscoder * */ virtual ~XMLTranscoder(); //@} /** @name The virtual transcoding interface */ //@{ /** Converts from the encoding of the service to the internal XMLCh* encoding * * @param srcData the source buffer to be transcoded * @param srcCount number of bytes in the source buffer * @param toFill the destination buffer * @param maxChars the max number of characters in the destination buffer * @param bytesEaten after transcoding, this will hold the number of bytes * that were processed from the source buffer * @param charSizes an array which must be at least as big as maxChars * into which will be inserted values that indicate how many * bytes from the input went into each XMLCh that was created * into toFill. Since many encodings use variable numbers of * byte per character, this provides a means to find out what * bytes in the input went into making a particular output * UTF-16 character. * @return Returns the number of chars put into the target buffer */ virtual XMLSize_t transcodeFrom ( const XMLByte* const srcData , const XMLSize_t srcCount , XMLCh* const toFill , const XMLSize_t maxChars , XMLSize_t& bytesEaten , unsigned char* const charSizes ) = 0; /** Converts from the internal XMLCh* encoding to the encoding of the service * * @param srcData the source buffer to be transcoded * @param srcCount number of characters in the source buffer * @param toFill the destination buffer * @param maxBytes the max number of bytes in the destination buffer * @param charsEaten after transcoding, this will hold the number of chars * that were processed from the source buffer * @param options options to pass to the transcoder that explain how to * respond to an unrepresentable character * @return Returns the number of chars put into the target buffer */ virtual XMLSize_t transcodeTo ( const XMLCh* const srcData , const XMLSize_t srcCount , XMLByte* const toFill , const XMLSize_t maxBytes , XMLSize_t& charsEaten , const UnRepOpts options ) = 0; /** Query whether the transcoder can handle a given character * * @param toCheck the character code point to check */ virtual bool canTranscodeTo ( const unsigned int toCheck ) = 0; //@} /** @name Getter methods */ //@{ /** Get the internal block size * * @return The block size indicated in the constructor. */ XMLSize_t getBlockSize() const; /** Get the encoding name * * @return the name of the encoding that this * XMLTranscoder object is for */ const XMLCh* getEncodingName() const; //@} /** @name Getter methods*/ //@{ /** Get the plugged-in memory manager * * This method returns the plugged-in memory manager user for dynamic * memory allocation/deallocation. * * @return the plugged-in memory manager */ MemoryManager* getMemoryManager() const; //@} protected : // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- XMLTranscoder ( const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); // ----------------------------------------------------------------------- // Protected helper methods // ----------------------------------------------------------------------- private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLTranscoder(const XMLTranscoder&); XMLTranscoder& operator=(const XMLTranscoder&); // ----------------------------------------------------------------------- // Private data members // // fBlockSize // This is the block size indicated in the constructor. // // fEncodingName // This is the name of the encoding this encoder is for. All basic // XML transcoder's are for named encodings. // ----------------------------------------------------------------------- XMLSize_t fBlockSize; XMLCh* fEncodingName; MemoryManager* fMemoryManager; }; // // This class is a specialized transcoder that only transcodes between // the internal XMLCh format and the local code page. It is specialized // for the very common job of translating data from the client app's // native code page to the internal format and vice versa. // class XMLUTIL_EXPORT XMLLCPTranscoder : public XMemory { public : // ----------------------------------------------------------------------- // Public constructors and destructor // ----------------------------------------------------------------------- virtual ~XMLLCPTranscoder(); // ----------------------------------------------------------------------- // The virtual transcoder API // // NOTE: All these APIs don't include null terminator characters in // their parameters. So calcRequiredSize() returns the number // of actual chars, not including the null. maxBytes and maxChars // parameters refer to actual chars, not including the null so // its assumed that the buffer is physically one char or byte // larger. // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- // The 'normal' way to transcode a XMLCh-string from/to local string // representation // // NOTE: Both methods return a string allocated via the MemoryManager. // It is the responsibility of the calling environment to // release this string after use. // ----------------------------------------------------------------------- virtual char* transcode(const XMLCh* const toTranscode, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0; virtual XMLCh* transcode(const char* const toTranscode, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0; // ----------------------------------------------------------------------- // DEPRECATED old transcode interface // ----------------------------------------------------------------------- virtual XMLSize_t calcRequiredSize(const char* const srcText , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0; virtual XMLSize_t calcRequiredSize(const XMLCh* const srcText , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0; virtual bool transcode ( const char* const toTranscode , XMLCh* const toFill , const XMLSize_t maxChars , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) = 0; virtual bool transcode ( const XMLCh* const toTranscode , char* const toFill , const XMLSize_t maxBytes , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) = 0; protected : // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- XMLLCPTranscoder(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLLCPTranscoder(const XMLLCPTranscoder&); XMLLCPTranscoder& operator=(const XMLLCPTranscoder&); }; // // This class can be used to transcode to a target encoding. It manages the // memory allocated for the transcode in an exception safe manner, automatically // deleting it when the class goes out of scope. // class XMLUTIL_EXPORT TranscodeToStr { public: // ----------------------------------------------------------------------- // Public constructors and destructor // ----------------------------------------------------------------------- /** Converts from the internal XMLCh* encoding to the specified encoding * * @param in the null terminated source buffer to be transcoded * @param encoding the name of the encoding to transcode to * @param manager the memory manager to use */ TranscodeToStr(const XMLCh *in, const char *encoding, MemoryManager *manager = XMLPlatformUtils::fgMemoryManager); /** Converts from the internal XMLCh* encoding to the specified encoding * * @param in the source buffer to be transcoded * @param length the length of the source buffer * @param encoding the name of the encoding to transcode to * @param manager the memory manager to use */ TranscodeToStr(const XMLCh *in, XMLSize_t length, const char *encoding, MemoryManager *manager = XMLPlatformUtils::fgMemoryManager); /** Converts from the internal XMLCh* encoding to the specified encoding * * @param in the null terminated source buffer to be transcoded * @param trans the transcoder to use * @param manager the memory manager to use */ TranscodeToStr(const XMLCh *in, XMLTranscoder* trans, MemoryManager *manager = XMLPlatformUtils::fgMemoryManager); /** Converts from the internal XMLCh* encoding to the specified encoding * * @param in the source buffer to be transcoded * @param length the length of the source buffer * @param trans the transcoder to use * @param manager the memory manager to use */ TranscodeToStr(const XMLCh *in, XMLSize_t length, XMLTranscoder* trans, MemoryManager *manager = XMLPlatformUtils::fgMemoryManager); ~TranscodeToStr(); /** @name Getter methods */ //@{ /** Returns the transcoded, null terminated string * @return the transcoded string */ const XMLByte *str() const; /** Returns the transcoded, null terminated string - adopting * the memory allocated to it from the TranscodeToStr object * @return the transcoded string */ XMLByte *adopt(); /** Returns the length of the transcoded string in bytes. The length * does not include the null terminator. * @return the length of the transcoded string in bytes */ XMLSize_t length () const; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- TranscodeToStr(const TranscodeToStr &); TranscodeToStr &operator=(const TranscodeToStr &); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void transcode(const XMLCh *in, XMLSize_t len, XMLTranscoder* trans); // ----------------------------------------------------------------------- // Private data members // // fString // The transcoded string // // fBytesWritten // The length of the transcoded string in bytes // ----------------------------------------------------------------------- ArrayJanitor fString; XMLSize_t fBytesWritten; MemoryManager *fMemoryManager; }; // // This class can be used to transcode from a source encoding. It manages the // memory allocated for the transcode in an exception safe manner, automatically // deleting it when the class goes out of scope. // class XMLUTIL_EXPORT TranscodeFromStr { public: // ----------------------------------------------------------------------- // Public constructors and destructor // ----------------------------------------------------------------------- /** Converts from the specified encoding to the internal XMLCh* encoding * * @param data the source buffer to be transcoded * @param length the length of the source buffer * @param encoding the name of the encoding to transcode to * @param manager the memory manager to use */ TranscodeFromStr(const XMLByte *data, XMLSize_t length, const char *encoding, MemoryManager *manager = XMLPlatformUtils::fgMemoryManager); /** Converts from the specified encoding to the internal XMLCh* encoding * * @param data the source buffer to be transcoded * @param length the length of the source buffer * @param trans the transcoder to use * @param manager the memory manager to use */ TranscodeFromStr(const XMLByte *data, XMLSize_t length, XMLTranscoder *trans, MemoryManager *manager = XMLPlatformUtils::fgMemoryManager); ~TranscodeFromStr(); /** @name Getter methods */ //@{ /** Returns the transcoded, null terminated string * @return the transcoded string */ const XMLCh *str() const; /** Returns the transcoded, null terminated string - adopting * the memory allocated to it from the TranscodeFromStr object * @return the transcoded string */ XMLCh *adopt(); /** Returns the length of the transcoded string in characters. The length * does not include the null terminator. * @return the length of the transcoded string in characters */ XMLSize_t length() const; //@} private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- TranscodeFromStr(const TranscodeFromStr &); TranscodeFromStr &operator=(const TranscodeFromStr &); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void transcode(const XMLByte *in, XMLSize_t length, XMLTranscoder *trans); // ----------------------------------------------------------------------- // Private data members // // fString // The transcoded string // // fCharsWritten // The length of the transcoded string in characters // ----------------------------------------------------------------------- ArrayJanitor fString; XMLSize_t fCharsWritten; MemoryManager *fMemoryManager; }; // --------------------------------------------------------------------------- // XMLTranscoder: Getter methods // --------------------------------------------------------------------------- inline MemoryManager* XMLTranscoder::getMemoryManager() const { return fMemoryManager; } // --------------------------------------------------------------------------- // XMLTranscoder: Protected helper methods // --------------------------------------------------------------------------- inline XMLSize_t XMLTranscoder::getBlockSize() const { return fBlockSize; } inline const XMLCh* XMLTranscoder::getEncodingName() const { return fEncodingName; } // --------------------------------------------------------------------------- // TranscodeToStr: Getter methods // --------------------------------------------------------------------------- inline const XMLByte *TranscodeToStr::str() const { return fString.get(); } inline XMLByte *TranscodeToStr::adopt() { fBytesWritten = 0; return fString.release(); } inline XMLSize_t TranscodeToStr::length () const { return fBytesWritten; } // --------------------------------------------------------------------------- // TranscodeFromStr: Getter methods // --------------------------------------------------------------------------- inline const XMLCh *TranscodeFromStr::str() const { return fString.get(); } inline XMLCh *TranscodeFromStr::adopt() { fCharsWritten = 0; return fString.release(); } inline XMLSize_t TranscodeFromStr::length() const { return fCharsWritten; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/RefHash3KeysIdPool.c000644 000765 000024 00000044340 13241160336 022761 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: RefHash3KeysIdPool.c 883368 2009-11-23 15:28:19Z amassari $ */ // --------------------------------------------------------------------------- // Include // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // RefHash3KeysIdPool: Constructors and Destructor // --------------------------------------------------------------------------- template RefHash3KeysIdPool::RefHash3KeysIdPool( const XMLSize_t modulus, const XMLSize_t initSize, MemoryManager* const manager) : fMemoryManager(manager) , fAdoptedElems(true) , fBucketList(0) , fHashModulus(modulus) , fIdPtrs(0) , fIdPtrsCount(initSize) , fIdCounter(0) { initialize(modulus); // Allocate the initial id pointers array. We don't have to zero them // out since the fIdCounter value tells us which ones are valid. The // zeroth element is never used (and represents an invalid pool id.) // if (!fIdPtrsCount) fIdPtrsCount = 256; fIdPtrs = (TVal**) fMemoryManager->allocate(fIdPtrsCount * sizeof(TVal*)); //new TVal*[fIdPtrsCount]; fIdPtrs[0] = 0; } template RefHash3KeysIdPool::RefHash3KeysIdPool( const XMLSize_t modulus, const THasher& hasher, const XMLSize_t initSize, MemoryManager* const manager) : fMemoryManager(manager) , fAdoptedElems(true) , fBucketList(0) , fHashModulus(modulus) , fIdPtrs(0) , fIdPtrsCount(initSize) , fIdCounter(0) , fHasher(hasher) { initialize(modulus); // Allocate the initial id pointers array. We don't have to zero them // out since the fIdCounter value tells us which ones are valid. The // zeroth element is never used (and represents an invalid pool id.) // if (!fIdPtrsCount) fIdPtrsCount = 256; fIdPtrs = (TVal**) fMemoryManager->allocate(fIdPtrsCount * sizeof(TVal*)); //new TVal*[fIdPtrsCount]; fIdPtrs[0] = 0; } template RefHash3KeysIdPool::RefHash3KeysIdPool( const XMLSize_t modulus, const bool adoptElems, const XMLSize_t initSize, MemoryManager* const manager) : fMemoryManager(manager) , fAdoptedElems(adoptElems) , fBucketList(0) , fHashModulus(modulus) , fIdPtrs(0) , fIdPtrsCount(initSize) , fIdCounter(0) { initialize(modulus); // Allocate the initial id pointers array. We don't have to zero them // out since the fIdCounter value tells us which ones are valid. The // zeroth element is never used (and represents an invalid pool id.) // if (!fIdPtrsCount) fIdPtrsCount = 256; fIdPtrs = (TVal**) fMemoryManager->allocate(fIdPtrsCount * sizeof(TVal*)); //new TVal*[fIdPtrsCount]; fIdPtrs[0] = 0; } template RefHash3KeysIdPool::RefHash3KeysIdPool( const XMLSize_t modulus, const bool adoptElems, const THasher& hasher, const XMLSize_t initSize, MemoryManager* const manager) : fMemoryManager(manager) , fAdoptedElems(adoptElems) , fBucketList(0) , fHashModulus(modulus) , fIdPtrs(0) , fIdPtrsCount(initSize) , fIdCounter(0) , fHasher(hasher) { initialize(modulus); // Allocate the initial id pointers array. We don't have to zero them // out since the fIdCounter value tells us which ones are valid. The // zeroth element is never used (and represents an invalid pool id.) // if (!fIdPtrsCount) fIdPtrsCount = 256; fIdPtrs = (TVal**) fMemoryManager->allocate(fIdPtrsCount * sizeof(TVal*)); //new TVal*[fIdPtrsCount]; fIdPtrs[0] = 0; } template void RefHash3KeysIdPool::initialize(const XMLSize_t modulus) { if (modulus == 0) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::HshTbl_ZeroModulus, fMemoryManager); // Allocate the bucket list and zero them fBucketList = (RefHash3KeysTableBucketElem**) fMemoryManager->allocate ( fHashModulus * sizeof(RefHash3KeysTableBucketElem*) ); //new RefHash3KeysTableBucketElem*[fHashModulus]; memset(fBucketList, 0, sizeof(fBucketList[0]) * fHashModulus); } template RefHash3KeysIdPool::~RefHash3KeysIdPool() { removeAll(); // Then delete the bucket list & hasher & id pointers list fMemoryManager->deallocate(fIdPtrs); //delete [] fIdPtrs; fIdPtrs = 0; fMemoryManager->deallocate(fBucketList); //delete [] fBucketList; fBucketList = 0; } // --------------------------------------------------------------------------- // RefHash3KeysIdPool: Element management // --------------------------------------------------------------------------- template bool RefHash3KeysIdPool::isEmpty() const { // Just check the bucket list for non-empty elements for (XMLSize_t buckInd = 0; buckInd < fHashModulus; buckInd++) { if (fBucketList[buckInd] != 0) return false; } return true; } template bool RefHash3KeysIdPool:: containsKey(const void* const key1, const int key2, const int key3) const { XMLSize_t hashVal; const RefHash3KeysTableBucketElem* findIt = findBucketElem(key1, key2, key3, hashVal); return (findIt != 0); } template void RefHash3KeysIdPool::removeAll() { if (fIdCounter == 0) return; // Clean up the buckets first for (XMLSize_t buckInd = 0; buckInd < fHashModulus; buckInd++) { // Get the bucket list head for this entry RefHash3KeysTableBucketElem* curElem = fBucketList[buckInd]; RefHash3KeysTableBucketElem* nextElem; while (curElem) { // Save the next element before we hose this one nextElem = curElem->fNext; // If we adopted the data, then delete it too // (Note: the userdata hash table instance has data type of void *. // This will generate compiler warnings here on some platforms, but they // can be ignored since fAdoptedElements is false. if (fAdoptedElems) delete curElem->fData; // Then delete the current element and move forward // delete curElem; // destructor is empty... // curElem->~RefHash3KeysTableBucketElem(); fMemoryManager->deallocate(curElem); curElem = nextElem; } // Clean out this entry fBucketList[buckInd] = 0; } // Reset the id counter fIdCounter = 0; } // --------------------------------------------------------------------------- // RefHash3KeysIdPool: Getters // --------------------------------------------------------------------------- template TVal* RefHash3KeysIdPool::getByKey(const void* const key1, const int key2, const int key3) { XMLSize_t hashVal; RefHash3KeysTableBucketElem* findIt = findBucketElem(key1, key2, key3, hashVal); if (!findIt) return 0; return findIt->fData; } template const TVal* RefHash3KeysIdPool::getByKey(const void* const key1, const int key2, const int key3) const { XMLSize_t hashVal; const RefHash3KeysTableBucketElem* findIt = findBucketElem(key1, key2, key3, hashVal); if (!findIt) return 0; return findIt->fData; } template TVal* RefHash3KeysIdPool::getById(const unsigned int elemId) { // If its either zero or beyond our current id, its an error if (!elemId || (elemId > fIdCounter)) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Pool_InvalidId, fMemoryManager); return fIdPtrs[elemId]; } template const TVal* RefHash3KeysIdPool::getById(const unsigned int elemId) const { // If its either zero or beyond our current id, its an error if (!elemId || (elemId > fIdCounter)) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Pool_InvalidId, fMemoryManager); return fIdPtrs[elemId]; } template MemoryManager* RefHash3KeysIdPool::getMemoryManager() const { return fMemoryManager; } template XMLSize_t RefHash3KeysIdPool::getHashModulus() const { return fHashModulus; } // --------------------------------------------------------------------------- // RefHash3KeysIdPool: Putters // --------------------------------------------------------------------------- template XMLSize_t RefHash3KeysIdPool::put(void* key1, int key2, int key3, TVal* const valueToAdopt) { // First see if the key exists already XMLSize_t hashVal; XMLSize_t retId; RefHash3KeysTableBucketElem* newBucket = findBucketElem(key1, key2, key3, hashVal); // // If so,then update its value. If not, then we need to add it to // the right bucket // if (newBucket) { retId = newBucket->fData->getId(); if (fAdoptedElems) delete newBucket->fData; newBucket->fData = valueToAdopt; newBucket->fKey1 = key1; newBucket->fKey2 = key2; newBucket->fKey3 = key3; } else { // Revisit: the gcc compiler 2.95.x is generating an // internal compiler error message. So we use the default // memory manager for now. #if defined (XML_GCC_VERSION) && (XML_GCC_VERSION < 29600) newBucket = new RefHash3KeysTableBucketElem(key1, key2, key3, valueToAdopt, fBucketList[hashVal]); #else newBucket = new (fMemoryManager->allocate(sizeof(RefHash3KeysTableBucketElem))) RefHash3KeysTableBucketElem(key1, key2, key3, valueToAdopt, fBucketList[hashVal]); #endif fBucketList[hashVal] = newBucket; // // Give this new one the next available id and add to the pointer list. // Expand the list if that is now required. // if (fIdCounter + 1 == fIdPtrsCount) { // Create a new count 1.5 times larger and allocate a new array XMLSize_t newCount = (XMLSize_t)(fIdPtrsCount * 1.5); TVal** newArray = (TVal**) fMemoryManager->allocate ( newCount * sizeof(TVal*) ); //new TVal*[newCount]; // Copy over the old contents to the new array memcpy(newArray, fIdPtrs, fIdPtrsCount * sizeof(TVal*)); // Ok, toss the old array and store the new data fMemoryManager->deallocate(fIdPtrs); //delete [] fIdPtrs; fIdPtrs = newArray; fIdPtrsCount = newCount; } retId = ++fIdCounter; } fIdPtrs[retId] = valueToAdopt; // Set the id on the passed element valueToAdopt->setId(retId); // Return the id that we gave to this element return retId; } // --------------------------------------------------------------------------- // RefHash3KeysIdPool: Private methods // --------------------------------------------------------------------------- template inline RefHash3KeysTableBucketElem* RefHash3KeysIdPool:: findBucketElem(const void* const key1, const int key2, const int key3, XMLSize_t& hashVal) { // Hash the key hashVal = fHasher.getHashVal(key1, fHashModulus); assert(hashVal < fHashModulus); // Search that bucket for the key RefHash3KeysTableBucketElem* curElem = fBucketList[hashVal]; while (curElem) { if((key2==curElem->fKey2) && (key3==curElem->fKey3) && (fHasher.equals(key1, curElem->fKey1))) return curElem; curElem = curElem->fNext; } return 0; } template inline const RefHash3KeysTableBucketElem* RefHash3KeysIdPool:: findBucketElem(const void* const key1, const int key2, const int key3, XMLSize_t& hashVal) const { // Hash the key hashVal = fHasher.getHashVal(key1, fHashModulus); assert(hashVal < fHashModulus); // Search that bucket for the key const RefHash3KeysTableBucketElem* curElem = fBucketList[hashVal]; while (curElem) { if((key2==curElem->fKey2) && (key3==curElem->fKey3) && (fHasher.equals(key1, curElem->fKey1))) return curElem; curElem = curElem->fNext; } return 0; } // --------------------------------------------------------------------------- // RefHash3KeysIdPoolEnumerator: Constructors and Destructor // --------------------------------------------------------------------------- template RefHash3KeysIdPoolEnumerator:: RefHash3KeysIdPoolEnumerator(RefHash3KeysIdPool* const toEnum , const bool adopt , MemoryManager* const manager) : fAdoptedElems(adopt), fCurIndex(0), fToEnum(toEnum), fMemoryManager(manager) { if (!toEnum) ThrowXMLwithMemMgr(NullPointerException, XMLExcepts::CPtr_PointerIsZero, fMemoryManager); Reset(); resetKey(); } template RefHash3KeysIdPoolEnumerator::~RefHash3KeysIdPoolEnumerator() { if (fAdoptedElems) delete fToEnum; } template RefHash3KeysIdPoolEnumerator:: RefHash3KeysIdPoolEnumerator(const RefHash3KeysIdPoolEnumerator& toCopy) : XMLEnumerator(toCopy) , XMemory(toCopy) , fAdoptedElems(toCopy.fAdoptedElems) , fCurIndex(toCopy.fCurIndex) , fToEnum(toCopy.fToEnum) , fCurElem(toCopy.fCurElem) , fCurHash(toCopy.fCurHash) , fMemoryManager(toCopy.fMemoryManager) { } // --------------------------------------------------------------------------- // RefHash3KeysIdPoolEnumerator: Enum interface // --------------------------------------------------------------------------- template bool RefHash3KeysIdPoolEnumerator::hasMoreElements() const { // If our index is zero or past the end, then we are done if (!fCurIndex || (fCurIndex > fToEnum->fIdCounter)) return false; return true; } template TVal& RefHash3KeysIdPoolEnumerator::nextElement() { // If our index is zero or past the end, then we are done if (!fCurIndex || (fCurIndex > fToEnum->fIdCounter)) ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::Enum_NoMoreElements, fMemoryManager); // Return the current element and bump the index return *fToEnum->fIdPtrs[fCurIndex++]; } template void RefHash3KeysIdPoolEnumerator::Reset() { // // Find the next available bucket element in the pool. We use the id // array since its very easy to enumerator through by just maintaining // an index. If the id counter is zero, then its empty and we leave the // current index to zero. // fCurIndex = fToEnum->fIdCounter ? 1:0; } template XMLSize_t RefHash3KeysIdPoolEnumerator::size() const { return fToEnum->fIdCounter; } template void RefHash3KeysIdPoolEnumerator::resetKey() { fCurHash = (XMLSize_t)-1; fCurElem = 0; findNext(); } template bool RefHash3KeysIdPoolEnumerator::hasMoreKeys() const { // // If our current has is at the max and there are no more elements // in the current bucket, then no more elements. // if (!fCurElem && (fCurHash == fToEnum->fHashModulus)) return false; return true; } template void RefHash3KeysIdPoolEnumerator::nextElementKey(void*& retKey1, int& retKey2, int& retKey3) { // Make sure we have an element to return if (!hasMoreKeys()) ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::Enum_NoMoreElements, fMemoryManager); // // Save the current element, then move up to the next one for the // next time around. // RefHash3KeysTableBucketElem* saveElem = fCurElem; findNext(); retKey1 = saveElem->fKey1; retKey2 = saveElem->fKey2; retKey3 = saveElem->fKey3; return; } template void RefHash3KeysIdPoolEnumerator::findNext() { // // If there is a current element, move to its next element. If this // hits the end of the bucket, the next block will handle the rest. // if (fCurElem) fCurElem = fCurElem->fNext; // // If the current element is null, then we have to move up to the // next hash value. If that is the hash modulus, then we cannot // go further. // if (!fCurElem) { fCurHash++; if (fCurHash == fToEnum->fHashModulus) return; // Else find the next non-empty bucket while (fToEnum->fBucketList[fCurHash]==0) { // Bump to the next hash value. If we max out return fCurHash++; if (fCurHash == fToEnum->fHashModulus) return; } fCurElem = fToEnum->fBucketList[fCurHash]; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/EncodingValidator.cpp000644 000765 000024 00000006055 13241160335 023347 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: EncodingValidator.cpp 1798771 2017-06-14 21:31:52Z rleigh $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN EncodingValidator* EncodingValidator::fInstance = 0; void XMLInitializer::initializeEncodingValidator() { EncodingValidator::fInstance = new EncodingValidator(); } void XMLInitializer::terminateEncodingValidator() { delete EncodingValidator::fInstance; EncodingValidator::fInstance = 0; } // --------------------------------------------------------------------------- // EncodingValidator: Constructors and Destructor // --------------------------------------------------------------------------- EncodingValidator::EncodingValidator() : fEncodingRegistry(0) { initializeRegistry(); } EncodingValidator::~EncodingValidator() { delete fEncodingRegistry; fEncodingRegistry = 0; } // --------------------------------------------------------------------------- // EncodingValidator: Validation methods // --------------------------------------------------------------------------- bool EncodingValidator::isValidEncoding(const XMLCh* const encName) { if (fEncodingRegistry->containsKey(encName)) return true; return false; } // --------------------------------------------------------------------------- // EncodingValidator: Initialization methods // --------------------------------------------------------------------------- void EncodingValidator::initializeRegistry() { fEncodingRegistry = new ValueHashTableOf(109); for (unsigned int i=0; i < gEncodingArraySize; i++) { fEncodingRegistry->put(const_cast(reinterpret_cast(gEncodingArray[i])), true); } } // --------------------------------------------------------------------------- // EncodingValidator: Instance methods // --------------------------------------------------------------------------- EncodingValidator* EncodingValidator::instance() { return fInstance; } XERCES_CPP_NAMESPACE_END /** * End of file EncodingValidator.cpp */ xerces-c-3.2.2/src/xercesc/util/XMLAbstractDoubleFloat.cpp000644 000765 000024 00000047110 13241160336 024216 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLAbstractDoubleFloat.cpp 673155 2008-07-01 17:55:39Z dbertoni $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // local data member // --------------------------------------------------------------------------- static const int BUF_LEN = 64; static XMLCh expSign[] = {chLatin_e, chLatin_E, chNull}; // --------------------------------------------------------------------------- // ctor/dtor // --------------------------------------------------------------------------- XMLAbstractDoubleFloat::XMLAbstractDoubleFloat(MemoryManager* const manager) : fValue(0) , fType(Normal) , fDataConverted(false) , fDataOverflowed(false) , fSign(0) , fRawData(0) , fFormattedString(0) , fMemoryManager(manager) { } XMLAbstractDoubleFloat::~XMLAbstractDoubleFloat() { fMemoryManager->deallocate(fRawData);//delete [] fRawData; fMemoryManager->deallocate(fFormattedString);//delete [] fFormattedString; } void XMLAbstractDoubleFloat::init(const XMLCh* const strValue) { if ((!strValue) || (!*strValue)) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_emptyString, fMemoryManager); fRawData = XMLString::replicate(strValue, fMemoryManager); // preserve the raw data form XMLCh* tmpStrValue = XMLString::replicate(strValue, fMemoryManager); ArrayJanitor janTmpName(tmpStrValue, fMemoryManager); XMLString::trim(tmpStrValue); if (!*tmpStrValue) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_emptyString, fMemoryManager); normalizeZero(tmpStrValue); if (XMLString::equals(tmpStrValue, XMLUni::fgNegINFString) ) { fType = NegINF; fSign = -1; } else if (XMLString::equals(tmpStrValue, XMLUni::fgPosINFString) ) { fType = PosINF; fSign = 1; } else if (XMLString::equals(tmpStrValue, XMLUni::fgNaNString) ) { fType = NaN; fSign = 1; } else // // Normal case // { // Use a stack-based buffer when possible. Since all // valid doubles or floats will only contain ASCII // digits, a decimal point, or the exponent character, // they will all be single byte characters, and this will // work. static const XMLSize_t maxStackSize = 100; XMLSize_t lenTempStrValue = 0; // Need to check that the string only contains valid schema characters // since the call to strtod may allow other values. For example, AIX // allows "infinity" and "+INF" XMLCh curChar; while ((curChar = tmpStrValue[lenTempStrValue])!=0) { if (!((curChar >= chDigit_0 && curChar <= chDigit_9) || curChar == chPeriod || curChar == chDash || curChar == chPlus || curChar == chLatin_E || curChar == chLatin_e)) { ThrowXMLwithMemMgr( NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, getMemoryManager()); } lenTempStrValue++; } if (lenTempStrValue < maxStackSize) { char buffer[maxStackSize + 1]; XMLString::transcode( tmpStrValue, buffer, sizeof(buffer) - 1, getMemoryManager()); // Do this for safety, because we've // no guarantee we didn't overrun the // capacity of the buffer when transcoding // a bogus value. buffer[maxStackSize] = '\0'; // If they aren't the same length, then some // non-ASCII multibyte character was present. // This will only happen in the case where the // string has a bogus character, and it's long // enough to overrun this buffer, but we need // to check, even if it's unlikely to happen. if (XMLString::stringLen(buffer) != lenTempStrValue) { ThrowXMLwithMemMgr( NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, getMemoryManager()); } checkBoundary(buffer); } else { char *nptr = XMLString::transcode(tmpStrValue, getMemoryManager()); const ArrayJanitor janStr(nptr, fMemoryManager); checkBoundary(nptr); } } } XMLCh* XMLAbstractDoubleFloat::getRawData() const { return fRawData; } const XMLCh* XMLAbstractDoubleFloat::getFormattedString() const { if (!fDataConverted) { return fRawData; } else { if (!fFormattedString) { XMLAbstractDoubleFloat *temp = (XMLAbstractDoubleFloat *) this; temp->formatString(); } return fFormattedString; } } void XMLAbstractDoubleFloat::formatString() { XMLSize_t rawDataLen = XMLString::stringLen(fRawData); fFormattedString = (XMLCh*) fMemoryManager->allocate ( (rawDataLen + 8) * sizeof(XMLCh) );//new XMLCh [ rawDataLen + 8]; for (XMLSize_t i = 0; i < rawDataLen + 8; i++) fFormattedString[i] = chNull; XMLString::copyString(fFormattedString, fRawData); fFormattedString[rawDataLen] = chSpace; fFormattedString[rawDataLen + 1] = chOpenParen; switch (fType) { case NegINF: XMLString::catString(fFormattedString, XMLUni::fgNegINFString); break; case PosINF: XMLString::catString(fFormattedString, XMLUni::fgPosINFString); break; case NaN: XMLString::catString(fFormattedString, XMLUni::fgNaNString); break; default: // its zero XMLString::catString(fFormattedString, XMLUni::fgPosZeroString); break; } fFormattedString[XMLString::stringLen(fFormattedString)] = chCloseParen; } int XMLAbstractDoubleFloat::getSign() const { return fSign; } // // // int XMLAbstractDoubleFloat::compareValues(const XMLAbstractDoubleFloat* const lValue , const XMLAbstractDoubleFloat* const rValue , MemoryManager* const manager) { // // case#1: lValue normal // rValue normal // if ((!lValue->isSpecialValue()) && (!rValue->isSpecialValue()) ) { if (lValue->fValue == rValue->fValue) return EQUAL; else return (lValue->fValue > rValue->fValue) ? GREATER_THAN : LESS_THAN; } // // case#2: lValue special // rValue special // // Schema Errata E2-40 // // Positive Infinity is greater than all other non-NAN value. // Nan equals itself but is not comparable with (neither greater than nor less than) // any other value in the value space // Negative Infinity is less than all other non-NAN values. // else if ((lValue->isSpecialValue()) && (rValue->isSpecialValue()) ) { if (lValue->fType == rValue->fType) return EQUAL; else { if ((lValue->fType == NaN) || (rValue->fType == NaN) ) { return INDETERMINATE; } else { return (lValue->fType > rValue->fType) ? GREATER_THAN : LESS_THAN; } } } // // case#3: lValue special // rValue normal // else if ((lValue->isSpecialValue()) && (!rValue->isSpecialValue()) ) { return compareSpecial(lValue, manager); } // // case#4: lValue normal // rValue special // else { return (-1) * compareSpecial(rValue, manager); } } int XMLAbstractDoubleFloat::compareSpecial(const XMLAbstractDoubleFloat* const specialValue , MemoryManager* const manager) { switch (specialValue->fType) { case NegINF: return LESS_THAN; case PosINF: return GREATER_THAN; case NaN: // NaN is not comparable to any other value return INDETERMINATE; default: XMLCh value1[BUF_LEN+1]; XMLString::binToText(specialValue->fType, value1, 16, 10, manager); ThrowXMLwithMemMgr1(NumberFormatException , XMLExcepts::XMLNUM_DBL_FLT_InvalidType , value1, manager); //internal error return 0; } } // // Assumption: no leading space // // 1. The valid char set is "+-.0" // 2. There shall be only one sign at the first position, if there is one. // 3. There shall be only one dot '.', if there is one. // // Return: // // for input comforming to [+]? [0]* '.'? [0]*, // normalize the input to positive zero string // for input comforming to '-' [0]* '.'? [0]*, // normalize the input to negative zero string // otherwise, do nothing // void XMLAbstractDoubleFloat::normalizeZero(XMLCh* const inData) { // do a quick check if (!inData || !*inData || (XMLString::equals(inData, XMLUni::fgNegZeroString) ) || (XMLString::equals(inData, XMLUni::fgPosZeroString) ) ) return; XMLCh* srcStr = inData; bool minusSeen = false; bool dotSeen = false; // process sign if any if (*srcStr == chDash) { minusSeen = true; srcStr++; if (!*srcStr) { ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, getMemoryManager()); } } else if (*srcStr == chPlus) { srcStr++; if (!*srcStr) { ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, getMemoryManager()); } } else if (*srcStr == chPeriod) { dotSeen = true; srcStr++; if (!*srcStr) { ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, getMemoryManager()); } } // scan the string bool isValidStr = true; XMLCh theChar; while ((theChar=*srcStr++)!=0 && isValidStr) { if ( theChar != chPeriod && theChar != chDigit_0 ) isValidStr = false; // invalid char else if (theChar == chPeriod) // process dot dotSeen ? isValidStr = false : dotSeen = true; } // need not to worry about the memory problem // since either fgNegZeroString or fgPosZeroString // is the canonical form (meaning the shortest in length) // of their category respectively. if (isValidStr) { if (minusSeen) XMLString::copyString(inData, XMLUni::fgNegZeroString); else XMLString::copyString(inData, XMLUni::fgPosZeroString); } else { // we got to set the sign first, since this string may // eventaully turn out to be beyond the minimum representable // number and reduced to -0 or +0. fSign = minusSeen ? -1 : 1; } return; } void XMLAbstractDoubleFloat::normalizeDecimalPoint(char* const toNormal) { // find the locale-specific decimal point delimiter lconv* lc = localeconv(); char delimiter = *lc->decimal_point; // replace '.' with the locale-specific decimal point delimiter if ( delimiter != '.' ) { char* period = strchr( toNormal, '.' ); if ( period ) { *period = delimiter; } } } void XMLAbstractDoubleFloat::convert(char* const strValue) { normalizeDecimalPoint(strValue); char *endptr = 0; errno = 0; fValue = strtod(strValue, &endptr); // check if all chars are valid char. If they are, endptr will // pointer to the null terminator. if (*endptr != '\0') { ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, getMemoryManager()); } // check if overflow/underflow occurs if (errno == ERANGE) { fDataConverted = true; if ( fValue < 0 ) { if (fValue > (-1)*DBL_MIN) { fValue = 0; } else { fType = NegINF; fDataOverflowed = true; } } else if ( fValue > 0) { if (fValue < DBL_MIN ) { fValue = 0; } else { fType = PosINF; fDataOverflowed = true; } } } } /*** * E2-40 * * 3.2.4 float * 3.2.5 double * * . the exponent must be indicated by "E". * if the exponent is zero, it must be indicated by "E0". * * . For the mantissa, * the preceding optional "+" sign is prohibited and * the decimal point is required. * * . For the exponent, * the preceding optional "+" sign is prohibited. * Leading zeroes are prohibited. * * . Leading and trailing zeroes are prohibited subject to the following: * number representations must be normalized such that * . there is a single digit, which is non-zero, to the left of the decimal point and * . at least a single digit to the right of the decimal point. * . unless the value being represented is zero. * The canonical representation for zero is 0.0E0 * ***/ XMLCh* XMLAbstractDoubleFloat::getCanonicalRepresentation(const XMLCh* const rawData , MemoryManager* const memMgr) { // before anything, let's look for special tokens since that // breaks the calls to parse below. if(XMLString::equals(rawData, XMLUni::fgNegINFString) || XMLString::equals(rawData, XMLUni::fgPosINFString) || XMLString::equals(rawData, XMLUni::fgNaNString) ) { return XMLString::replicate(rawData, memMgr); } try { XMLSize_t strLen = XMLString::stringLen(rawData); XMLCh* manStr = (XMLCh*) memMgr->allocate((strLen + 1) * sizeof(XMLCh)); ArrayJanitor janManStr(manStr, memMgr); XMLCh* manBuf = (XMLCh*) memMgr->allocate((strLen + 1) * sizeof(XMLCh)); ArrayJanitor janManBuf(manBuf, memMgr); XMLCh* expStr = (XMLCh*) memMgr->allocate((strLen + 1) * sizeof(XMLCh)); ArrayJanitor janExpStr(expStr, memMgr); XMLCh* retBuffer = (XMLCh*) memMgr->allocate((strLen + 8) * sizeof(XMLCh)); ArrayJanitor janRetBuffer(retBuffer, memMgr); retBuffer[0] = 0; int sign, totalDigits, fractDigits, expValue = 0; const XMLCh* ePosition = XMLString::findAny(rawData, expSign); /*** * parse mantissa and exp separately ***/ if (!ePosition) { XMLBigDecimal::parseDecimal(rawData, manBuf, sign, totalDigits, fractDigits, memMgr); expValue = 0; } else { XMLSize_t manLen = ePosition - rawData; XMLString::copyNString(manStr, rawData, manLen); *(manStr + manLen) = chNull; XMLBigDecimal::parseDecimal(manStr, manBuf, sign, totalDigits, fractDigits, memMgr); XMLSize_t expLen = strLen - manLen - 1; ePosition++; XMLString::copyNString(expStr, ePosition, expLen); *(expStr + expLen) = chNull; expValue = XMLString::parseInt(expStr); } if ( (sign == 0) || (totalDigits == 0) ) { retBuffer[0] = chDigit_0; retBuffer[1] = chPeriod; retBuffer[2] = chDigit_0; retBuffer[3] = chLatin_E; retBuffer[4] = chDigit_0; retBuffer[5] = chNull; } else { XMLCh* retPtr = retBuffer; if (sign == -1) { *retPtr++ = chDash; } *retPtr++ = manBuf[0]; *retPtr++ = chPeriod; //XMLBigDecimal::parseDecimal() will eliminate trailing zeros // iff there is a decimal points // eg. 56.7800e0 -> manBuf = 5678, totalDigits = 4, fractDigits = 2 // we print it as 5.678e1 // // but it wont remove trailing zeros if there is no decimal point. // eg. 567800e0 -> manBuf = 567800, totalDigits = 6, fractDigits = 0 // we print it 5.67800e5 // // for the latter, we need to print it as 5.678e5 instead // XMLCh* endPtr = manBuf + totalDigits; if (fractDigits == 0) { while(*(endPtr - 1) == chDigit_0) endPtr--; } XMLSize_t remainLen = endPtr - &(manBuf[1]); if (remainLen) { XMLString::copyNString(retPtr, &(manBuf[1]), remainLen); retPtr += remainLen; } else { *retPtr++ = chDigit_0; } /*** * * . adjust expValue * * new_fractDigits = totalDigits - 1 * new_expValue = old_expValue + (new_fractDigits - fractDigits) * ***/ expValue += (totalDigits - 1) - fractDigits ; XMLString::binToText(expValue, expStr, strLen, 10, memMgr); *retPtr++ = chLatin_E; *retPtr = chNull; XMLString::catString(&(retBuffer[0]), expStr); } janRetBuffer.release(); return retBuffer; } catch (const NumberFormatException&) { return 0; } } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_NOCREATE(XMLAbstractDoubleFloat) void XMLAbstractDoubleFloat::serialize(XSerializeEngine& serEng) { //REVISIT: may not need to call base since it does nothing XMLNumber::serialize(serEng); if (serEng.isStoring()) { serEng << fValue; serEng << fType; serEng << fDataConverted; serEng << fDataOverflowed; serEng << fSign; serEng.writeString(fRawData); // Do not serialize fFormattedString } else { serEng >> fValue; int type = 0; serEng >> type; fType = (LiteralType) type; serEng >> fDataConverted; serEng >> fDataOverflowed; serEng >> fSign; serEng.readString(fRawData); // Set it to 0 force it to re-format if needed fFormattedString = 0; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMemory.hpp000644 000765 000024 00000010464 13241160336 021360 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMemory.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMEMORY_HPP) #define XERCESC_INCLUDE_GUARD_XMEMORY_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class MemoryManager; /** * This class makes it possible to override the C++ memory management by * adding new/delete operators to this base class. * * This class is used in conjunction with the pluggable memory manager. It * allows applications to control Xerces memory management. */ class XMLUTIL_EXPORT XMemory { public : // ----------------------------------------------------------------------- // The C++ memory management // ----------------------------------------------------------------------- /** @name The C++ memory management */ //@{ /** * This method overrides operator new * * @param size The requested memory size */ void* operator new(size_t size); #if defined(XERCES_MFC_SUPPORT) /** * This method overrides the MFC debug version of the operator new * * @param size The requested memory size * @param file The file where the allocation was requested * @param line The line where the allocation was requested */ void* operator new(size_t size, const char* file, int line); /** * This method provides a matching delete for the MFC debug new * * @param p The pointer to the allocated memory * @param file The file where the allocation was requested * @param line The line where the allocation was requested */ void operator delete(void* p, const char* file, int line); #endif /** * This method defines a custom operator new, that will use the provided * memory manager to perform the allocation * * @param size The requested memory size * @param memMgr An application's memory manager */ void* operator new(size_t size, MemoryManager* memMgr); /** * This method overrides placement operator new * * @param size The requested memory size * @param ptr The memory location where the object should be allocated */ void* operator new(size_t size, void* ptr); /** * This method overrides operator delete * * @param p The pointer to the allocated memory */ void operator delete(void* p); //The Borland compiler is complaining about duplicate overloading of delete #if !defined(XERCES_NO_MATCHING_DELETE_OPERATOR) /** * This method provides a matching delete for the custom operator new * * @param p The pointer to the allocated memory * @param memMgr An application's memory manager */ void operator delete(void* p, MemoryManager* memMgr); /** * This method provides a matching delete for the placement new * * @param p The pointer to the allocated memory * @param ptr The memory location where the object had to be allocated */ void operator delete(void* p, void* ptr); #endif //@} protected : // ----------------------------------------------------------------------- // Hidden Constructors // ----------------------------------------------------------------------- /** @name Constructor */ //@{ /** * Protected default constructor */ XMemory() { } //@} #if defined(XERCES_NEED_XMEMORY_VIRTUAL_DESTRUCTOR) virtual ~XMemory() { } #endif }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/ValueVectorOf.c000644 000765 000024 00000021453 13241160336 022137 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ValueVectorOf.c 676911 2008-07-15 13:27:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // ValueVectorOf: Constructors and Destructor // --------------------------------------------------------------------------- template ValueVectorOf::ValueVectorOf(const XMLSize_t maxElems, MemoryManager* const manager, const bool toCallDestructor) : fCallDestructor(toCallDestructor) , fCurCount(0) , fMaxCount(maxElems) , fElemList(0) , fMemoryManager(manager) { fElemList = (TElem*) fMemoryManager->allocate ( fMaxCount * sizeof(TElem) ); //new TElem[fMaxCount]; memset(fElemList, 0, fMaxCount * sizeof(TElem)); } template ValueVectorOf::ValueVectorOf(const ValueVectorOf& toCopy) : XMemory(toCopy) , fCallDestructor(toCopy.fCallDestructor) , fCurCount(toCopy.fCurCount) , fMaxCount(toCopy.fMaxCount) , fElemList(0) , fMemoryManager(toCopy.fMemoryManager) { fElemList = (TElem*) fMemoryManager->allocate ( fMaxCount * sizeof(TElem) ); //new TElem[fMaxCount]; memset(fElemList, 0, fMaxCount * sizeof(TElem)); for (XMLSize_t index = 0; index < fCurCount; index++) fElemList[index] = toCopy.fElemList[index]; } template ValueVectorOf::~ValueVectorOf() { if (fCallDestructor) { for (XMLSize_t index=fMaxCount; index > 0; index--) fElemList[index-1].~TElem(); } fMemoryManager->deallocate(fElemList); //delete [] fElemList; } // --------------------------------------------------------------------------- // ValueVectorOf: Operators // --------------------------------------------------------------------------- template ValueVectorOf& ValueVectorOf::operator=(const ValueVectorOf& toAssign) { if (this == &toAssign) return *this; // Reallocate if required if (fMaxCount < toAssign.fCurCount) { fMemoryManager->deallocate(fElemList); //delete [] fElemList; fElemList = (TElem*) fMemoryManager->allocate ( toAssign.fMaxCount * sizeof(TElem) ); //new TElem[toAssign.fMaxCount]; fMaxCount = toAssign.fMaxCount; } fCurCount = toAssign.fCurCount; for (XMLSize_t index = 0; index < fCurCount; index++) fElemList[index] = toAssign.fElemList[index]; return *this; } // --------------------------------------------------------------------------- // ValueVectorOf: Element management // --------------------------------------------------------------------------- template void ValueVectorOf::addElement(const TElem& toAdd) { ensureExtraCapacity(1); fElemList[fCurCount++] = toAdd; } template void ValueVectorOf:: setElementAt(const TElem& toSet, const XMLSize_t setAt) { if (setAt >= fCurCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Vector_BadIndex, fMemoryManager); fElemList[setAt] = toSet; } template void ValueVectorOf:: insertElementAt(const TElem& toInsert, const XMLSize_t insertAt) { if (insertAt == fCurCount) { addElement(toInsert); return; } if (insertAt > fCurCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Vector_BadIndex, fMemoryManager); // Make room for the newbie ensureExtraCapacity(1); for (XMLSize_t index = fCurCount; index > insertAt; index--) fElemList[index] = fElemList[index-1]; // And stick it in and bump the count fElemList[insertAt] = toInsert; fCurCount++; } template void ValueVectorOf:: removeElementAt(const XMLSize_t removeAt) { if (removeAt >= fCurCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Vector_BadIndex, fMemoryManager); // Copy down every element above remove point for (XMLSize_t index = removeAt; index < fCurCount-1; index++) fElemList[index] = fElemList[index+1]; // And bump down count fCurCount--; } template void ValueVectorOf::removeAllElements() { fCurCount = 0; } template bool ValueVectorOf::containsElement(const TElem& toCheck, const XMLSize_t startIndex) { for (XMLSize_t i = startIndex; i < fCurCount; i++) { if (fElemList[i] == toCheck) { return true; } } return false; } // --------------------------------------------------------------------------- // ValueVectorOf: Getter methods // --------------------------------------------------------------------------- template const TElem& ValueVectorOf:: elementAt(const XMLSize_t getAt) const { if (getAt >= fCurCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Vector_BadIndex, fMemoryManager); return fElemList[getAt]; } template TElem& ValueVectorOf:: elementAt(const XMLSize_t getAt) { if (getAt >= fCurCount) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Vector_BadIndex, fMemoryManager); return fElemList[getAt]; } template XMLSize_t ValueVectorOf::curCapacity() const { return fMaxCount; } template XMLSize_t ValueVectorOf::size() const { return fCurCount; } template MemoryManager* ValueVectorOf::getMemoryManager() const { return fMemoryManager; } // --------------------------------------------------------------------------- // ValueVectorOf: Miscellaneous // --------------------------------------------------------------------------- template void ValueVectorOf:: ensureExtraCapacity(const XMLSize_t length) { XMLSize_t newMax = fCurCount + length; if (newMax > fMaxCount) { // Avoid too many reallocations by expanding by a percentage XMLSize_t minNewMax = (XMLSize_t)((double)fCurCount * 1.25); if (newMax < minNewMax) newMax = minNewMax; TElem* newList = (TElem*) fMemoryManager->allocate ( newMax * sizeof(TElem) ); //new TElem[newMax]; for (XMLSize_t index = 0; index < fCurCount; index++) newList[index] = fElemList[index]; fMemoryManager->deallocate(fElemList); //delete [] fElemList; fElemList = newList; fMaxCount = newMax; } } template const TElem* ValueVectorOf::rawData() const { return fElemList; } // --------------------------------------------------------------------------- // ValueVectorEnumerator: Constructors and Destructor // --------------------------------------------------------------------------- template ValueVectorEnumerator:: ValueVectorEnumerator( ValueVectorOf* const toEnum , const bool adopt) : fAdopted(adopt) , fCurIndex(0) , fToEnum(toEnum) { } template ValueVectorEnumerator::~ValueVectorEnumerator() { if (fAdopted) delete fToEnum; } // --------------------------------------------------------------------------- // ValueVectorEnumerator: Enum interface // --------------------------------------------------------------------------- template bool ValueVectorEnumerator::hasMoreElements() const { if (fCurIndex >= fToEnum->size()) return false; return true; } template TElem& ValueVectorEnumerator::nextElement() { return fToEnum->elementAt(fCurIndex++); } template void ValueVectorEnumerator::Reset() { fCurIndex = 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/TransENameMap.c000644 000765 000024 00000005471 13241160335 022047 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // ENameMapFor: Constructors and Destructor // --------------------------------------------------------------------------- template ENameMapFor::ENameMapFor(const XMLCh* const encodingName) : ENameMap(encodingName) { } template ENameMapFor::~ENameMapFor() { } // --------------------------------------------------------------------------- // ENameMapFor: Implementation of virtual factory method // --------------------------------------------------------------------------- template XMLTranscoder* ENameMapFor::makeNew(const XMLSize_t blockSize, MemoryManager* const manager) const { return new (manager) TType(getKey(), blockSize, manager); } // --------------------------------------------------------------------------- // ENameMapFor: Constructors and Destructor // --------------------------------------------------------------------------- template EEndianNameMapFor::EEndianNameMapFor(const XMLCh* const encodingName, const bool swapped) : ENameMap(encodingName) , fSwapped(swapped) { } template EEndianNameMapFor::~EEndianNameMapFor() { } // --------------------------------------------------------------------------- // ENameMapFor: Implementation of virtual factory method // --------------------------------------------------------------------------- template XMLTranscoder* EEndianNameMapFor::makeNew(const XMLSize_t blockSize, MemoryManager* const manager) const { return new (manager) TType(getKey(), blockSize, fSwapped, manager); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/IOException.hpp000644 000765 000024 00000002215 13241160336 022141 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: IOException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_IOEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_IOEXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(IOException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLDateTime.cpp000644 000765 000024 00000156322 13241160336 022034 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLDateTime.cpp 1804297 2017-08-07 08:56:02Z rleigh $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #if HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // // constants used to process raw data (fBuffer) // // [-]{CCYY-MM-DD}'T'{HH:MM:SS.MS}['Z'] // [{+|-}hh:mm'] // static const XMLCh DURATION_STARTER = chLatin_P; // 'P' static const XMLCh DURATION_Y = chLatin_Y; // 'Y' static const XMLCh DURATION_M = chLatin_M; // 'M' static const XMLCh DURATION_D = chLatin_D; // 'D' static const XMLCh DURATION_H = chLatin_H; // 'H' static const XMLCh DURATION_S = chLatin_S; // 'S' static const XMLCh DATE_SEPARATOR = chDash; // '-' static const XMLCh TIME_SEPARATOR = chColon; // ':' static const XMLCh TIMEZONE_SEPARATOR = chColon; // ':' static const XMLCh DATETIME_SEPARATOR = chLatin_T; // 'T' static const XMLCh MILISECOND_SEPARATOR = chPeriod; // '.' static const XMLCh UTC_STD_CHAR = chLatin_Z; // 'Z' static const XMLCh UTC_POS_CHAR = chPlus; // '+' static const XMLCh UTC_NEG_CHAR = chDash; // '-' static const XMLCh UTC_SET[] = {UTC_STD_CHAR //"Z+-" , UTC_POS_CHAR , UTC_NEG_CHAR , chNull}; static const XMLSize_t YMD_MIN_SIZE = 10; // CCYY-MM-DD static const XMLSize_t YMONTH_MIN_SIZE = 7; // CCYY_MM static const XMLSize_t TIME_MIN_SIZE = 8; // hh:mm:ss static const XMLSize_t TIMEZONE_SIZE = 5; // hh:mm static const XMLSize_t DAY_SIZE = 5; // ---DD //static const XMLSize_t MONTH_SIZE = 6; // --MM-- static const XMLSize_t MONTHDAY_SIZE = 7; // --MM-DD static const int NOT_FOUND = -1; //define constants to be used in assigning default values for //all date/time excluding duration static const int YEAR_DEFAULT = 2000; static const int MONTH_DEFAULT = 01; static const int DAY_DEFAULT = 15; // order-relation on duration is a partial order. The dates below are used to // for comparison of 2 durations, based on the fact that // duration x and y is x<=y iff s+x<=s+y // see 3.2.6 duration W3C schema datatype specs // // the dates are in format: {CCYY,MM,DD, H, S, M, MS, timezone} static const int DATETIMES[][XMLDateTime::TOTAL_SIZE] = { {1696, 9, 1, 0, 0, 0, 0, XMLDateTime::UTC_STD}, {1697, 2, 1, 0, 0, 0, 0, XMLDateTime::UTC_STD}, {1903, 3, 1, 0, 0, 0, 0, XMLDateTime::UTC_STD}, {1903, 7, 1, 0, 0, 0, 0, XMLDateTime::UTC_STD} }; // --------------------------------------------------------------------------- // local methods // --------------------------------------------------------------------------- static inline int fQuotient(int a, int b) { div_t div_result = div(a, b); return div_result.quot; } static inline int fQuotient(int temp, int low, int high) { return fQuotient(temp - low, high - low); } static inline int mod(int a, int b, int quotient) { return (a - quotient*b) ; } static inline int modulo (int temp, int low, int high) { //modulo(a - low, high - low) + low int a = temp - low; int b = high - low; return (mod (a, b, fQuotient(a, b)) + low) ; } static inline bool isLeapYear(int year) { return((year%4 == 0) && ((year%100 != 0) || (year%400 == 0))); } static int maxDayInMonthFor(int year, int month) { if ( month == 4 || month == 6 || month == 9 || month == 11 ) { return 30; } else if ( month==2 ) { if ( isLeapYear(year) ) return 29; else return 28; } else { return 31; } } // --------------------------------------------------------------------------- // static methods : for duration // --------------------------------------------------------------------------- /** * Compares 2 given durations. (refer to W3C Schema Datatypes "3.2.6 duration") * * 3.2.6.2 Order relation on duration * * In general, the order-relation on duration is a partial order since there is no * determinate relationship between certain durations such as one month (P1M) and 30 days (P30D). * The order-relation of two duration values x and y is x < y iff s+x < s+y for each qualified * dateTime s in the list below. * * These values for s cause the greatest deviations in the addition of dateTimes and durations * **/ int XMLDateTime::compare(const XMLDateTime* const pDate1 , const XMLDateTime* const pDate2 , bool strict) { //REVISIT: this is unoptimazed vs of comparing 2 durations // Algorithm is described in 3.2.6.2 W3C Schema Datatype specs // int resultA, resultB = INDETERMINATE; //try and see if the objects are equal if ( (resultA = compareOrder(pDate1, pDate2)) == EQUAL) return EQUAL; //long comparison algorithm is required XMLDateTime tempA(XMLPlatformUtils::fgMemoryManager), *pTempA = &tempA; XMLDateTime tempB(XMLPlatformUtils::fgMemoryManager), *pTempB = &tempB; addDuration(pTempA, pDate1, 0); addDuration(pTempB, pDate2, 0); resultA = compareOrder(pTempA, pTempB); if ( resultA == INDETERMINATE ) return INDETERMINATE; addDuration(pTempA, pDate1, 1); addDuration(pTempB, pDate2, 1); resultB = compareOrder(pTempA, pTempB); resultA = compareResult(resultA, resultB, strict); if ( resultA == INDETERMINATE ) return INDETERMINATE; addDuration(pTempA, pDate1, 2); addDuration(pTempB, pDate2, 2); resultB = compareOrder(pTempA, pTempB); resultA = compareResult(resultA, resultB, strict); if ( resultA == INDETERMINATE ) return INDETERMINATE; addDuration(pTempA, pDate1, 3); addDuration(pTempB, pDate2, 3); resultB = compareOrder(pTempA, pTempB); resultA = compareResult(resultA, resultB, strict); return resultA; } // // Form a new XMLDateTime with duration and baseDate array // Note: C++ Java // fNewDate duration // fDuration date // void XMLDateTime::addDuration(XMLDateTime* fNewDate , const XMLDateTime* const fDuration , int index) { //REVISIT: some code could be shared between normalize() and this method, // however is it worth moving it? The structures are different... // fNewDate->reset(); //add months (may be modified additionaly below) int temp = DATETIMES[index][Month] + fDuration->fValue[Month]; fNewDate->fValue[Month] = modulo(temp, 1, 13); int carry = fQuotient(temp, 1, 13); if (fNewDate->fValue[Month] <= 0) { fNewDate->fValue[Month]+= 12; carry--; } //add years (may be modified additionaly below) fNewDate->fValue[CentYear] = DATETIMES[index][CentYear] + fDuration->fValue[CentYear] + carry; //add seconds temp = DATETIMES[index][Second] + fDuration->fValue[Second]; carry = fQuotient (temp, 60); fNewDate->fValue[Second] = mod(temp, 60, carry); if (fNewDate->fValue[Second] < 0) { fNewDate->fValue[Second]+= 60; carry--; } //add minutes temp = DATETIMES[index][Minute] + fDuration->fValue[Minute] + carry; carry = fQuotient(temp, 60); fNewDate->fValue[Minute] = mod(temp, 60, carry); if (fNewDate->fValue[Minute] < 0) { fNewDate->fValue[Minute]+= 60; carry--; } //add hours temp = DATETIMES[index][Hour] + fDuration->fValue[Hour] + carry; carry = fQuotient(temp, 24); fNewDate->fValue[Hour] = mod(temp, 24, carry); if (fNewDate->fValue[Hour] < 0) { fNewDate->fValue[Hour]+= 24; carry--; } fNewDate->fValue[Day] = DATETIMES[index][Day] + fDuration->fValue[Day] + carry; while ( true ) { temp = maxDayInMonthFor(fNewDate->fValue[CentYear], fNewDate->fValue[Month]); if ( fNewDate->fValue[Day] < 1 ) { //original fNewDate was negative fNewDate->fValue[Day] += maxDayInMonthFor(fNewDate->fValue[CentYear], fNewDate->fValue[Month]-1); carry = -1; } else if ( fNewDate->fValue[Day] > temp ) { fNewDate->fValue[Day] -= temp; carry = 1; } else { break; } temp = fNewDate->fValue[Month] + carry; fNewDate->fValue[Month] = modulo(temp, 1, 13); if (fNewDate->fValue[Month] <= 0) { fNewDate->fValue[Month]+= 12; fNewDate->fValue[CentYear]--; } fNewDate->fValue[CentYear] += fQuotient(temp, 1, 13); } //fNewDate->fValue[utc] = UTC_STD_CHAR; fNewDate->fValue[utc] = UTC_STD; } int XMLDateTime::compareResult(int resultA , int resultB , bool strict) { if ( resultB == INDETERMINATE ) { return INDETERMINATE; } else if ( (resultA != resultB) && strict ) { return INDETERMINATE; } else if ( (resultA != resultB) && !strict ) { if ( (resultA != EQUAL) && (resultB != EQUAL) ) { return INDETERMINATE; } else { return (resultA != EQUAL)? resultA : resultB; } } return resultA; } // --------------------------------------------------------------------------- // static methods : for others // --------------------------------------------------------------------------- int XMLDateTime::compare(const XMLDateTime* const pDate1 , const XMLDateTime* const pDate2) { if (pDate1->fValue[utc] == pDate2->fValue[utc]) { return XMLDateTime::compareOrder(pDate1, pDate2); } int c1, c2; if ( pDate1->isNormalized()) { c1 = compareResult(pDate1, pDate2, false, UTC_POS); c2 = compareResult(pDate1, pDate2, false, UTC_NEG); return getRetVal(c1, c2); } else if ( pDate2->isNormalized()) { c1 = compareResult(pDate1, pDate2, true, UTC_POS); c2 = compareResult(pDate1, pDate2, true, UTC_NEG); return getRetVal(c1, c2); } return INDETERMINATE; } int XMLDateTime::compareResult(const XMLDateTime* const pDate1 , const XMLDateTime* const pDate2 , bool set2Left , int utc_type) { XMLDateTime tmpDate = (set2Left ? *pDate1 : *pDate2); tmpDate.fTimeZone[hh] = 14; tmpDate.fTimeZone[mm] = 0; tmpDate.fValue[utc] = utc_type; tmpDate.normalize(); return (set2Left? XMLDateTime::compareOrder(&tmpDate, pDate2) : XMLDateTime::compareOrder(pDate1, &tmpDate)); } int XMLDateTime::compareOrder(const XMLDateTime* const lValue , const XMLDateTime* const rValue) //, MemoryManager* const memMgr) { // // If any of the them is not normalized() yet, // we need to do something here. // XMLDateTime lTemp = *lValue; XMLDateTime rTemp = *rValue; lTemp.normalize(); rTemp.normalize(); for ( int i = 0 ; i < TOTAL_SIZE; i++ ) { if ( lTemp.fValue[i] < rTemp.fValue[i] ) { return LESS_THAN; } else if ( lTemp.fValue[i] > rTemp.fValue[i] ) { return GREATER_THAN; } } if ( lTemp.fHasTime) { if ( lTemp.fMilliSecond < rTemp.fMilliSecond ) { return LESS_THAN; } else if ( lTemp.fMilliSecond > rTemp.fMilliSecond ) { return GREATER_THAN; } } return EQUAL; } // --------------------------------------------------------------------------- // ctor and dtor // --------------------------------------------------------------------------- XMLDateTime::~XMLDateTime() { if (fBuffer) fMemoryManager->deallocate(fBuffer);//delete[] fBuffer; } XMLDateTime::XMLDateTime(MemoryManager* const manager) : fStart(0) , fEnd(0) , fBufferMaxLen(0) , fMilliSecond(0) , fHasTime(false) , fBuffer(0) , fMemoryManager(manager) { reset(); } XMLDateTime::XMLDateTime(const XMLCh* const aString, MemoryManager* const manager) : fStart(0) , fEnd(0) , fBufferMaxLen(0) , fMilliSecond(0) , fHasTime(false) , fBuffer(0) , fMemoryManager(manager) { setBuffer(aString); } XMLDateTime::XMLDateTime(time_t epoch, bool duration, MemoryManager* const manager) : fStart(0) , fEnd(0) , fBufferMaxLen(0) , fMilliSecond(0) , fHasTime(false) , fBuffer(0) , fMemoryManager(manager) { if (duration) { bool neg = false; if (epoch < 0) { neg = true; epoch = -epoch; } unsigned long days = epoch / 86400; epoch %= 86400; unsigned long hours = epoch / 3600; epoch %= 3600; unsigned long minutes = epoch / 60; epoch %= 60; unsigned long seconds = epoch; // These should just be replaced with an ostringstream but there's no STL usage anywhere else. // Modern compilers have snprintf. Anything older should accomodate unsigned longs of // 20 characters each, and this accomodates over 50. char timebuf[256]; #ifdef HAVE_SNPRINTF snprintf(timebuf, 256, "%sP%luDT%luH%luM%luS", neg ? "-" : "", days, hours, minutes, seconds); #else sprintf(timebuf, "%sP%luDT%luH%luM%luS", neg ? "-" : "", days, hours, minutes, seconds); #endif XMLCh* timeptr = XMLString::transcode(timebuf); setBuffer(timeptr); XMLString::release(&timeptr); } else { #ifndef HAVE_GMTIME_R struct tm* ptime=gmtime(&epoch); #else struct tm res; struct tm* ptime=gmtime_r(&epoch,&res); #endif char timebuf[32]; strftime(timebuf,32,"%Y-%m-%dT%H:%M:%SZ",ptime); XMLCh* timeptr = XMLString::transcode(timebuf); setBuffer(timeptr); XMLString::release(&timeptr); } } // ----------------------------------------------------------------------- // Copy ctor and Assignment operators // ----------------------------------------------------------------------- XMLDateTime::XMLDateTime(const XMLDateTime &toCopy) : XMLNumber(toCopy) , fBufferMaxLen(0) , fBuffer(0) , fMemoryManager(toCopy.fMemoryManager) { copy(toCopy); } XMLDateTime& XMLDateTime::operator=(const XMLDateTime& rhs) { if (this == &rhs) return *this; copy(rhs); return *this; } // ----------------------------------------------------------------------- // Implementation of Abstract Interface // ----------------------------------------------------------------------- // // We may simply return the handle to fBuffer // XMLCh* XMLDateTime::getRawData() const { return fBuffer; } const XMLCh* XMLDateTime::getFormattedString() const { return getRawData(); } int XMLDateTime::getSign() const { return 0; } time_t XMLDateTime::getEpoch(bool duration) const { if (duration) { time_t epoch = getSecond() + (60 * getMinute()) + (3600 * getHour()) + (86400 * getDay()); if (getMonth()) epoch += (((365 * 4) + 1)/48 * 86400); if (getYear()) epoch += 365.25 * 86400; return getSign()!=UTC_NEG ? epoch : -epoch; } else { struct tm t; t.tm_sec=getSecond(); t.tm_min=getMinute(); t.tm_hour=getHour(); t.tm_mday=getDay(); t.tm_mon=getMonth()-1; t.tm_year=getYear()-1900; t.tm_isdst=0; #if defined(HAVE_TIMEGM) return timegm(&t); #elif defined(WIN32) // Windows return mktime(&t) - _timezone; #else // Hopefully most others...? return mktime(&t) - timezone; #endif } } // --------------------------------------------------------------------------- // Parsers // --------------------------------------------------------------------------- // // [-]{CCYY-MM-DD}'T'{HH:MM:SS.MS}[TimeZone] // void XMLDateTime::parseDateTime() { if (!initParser()) ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_dt_invalid , fBuffer ? fBuffer : XMLUni::fgZeroLenString , fMemoryManager); getDate(); //fStart is supposed to point to 'T' if (fBuffer[fStart++] != DATETIME_SEPARATOR) ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_dt_missingT , fBuffer , fMemoryManager); getTime(); validateDateTime(); normalize(); fHasTime = true; } // // [-]{CCYY-MM-DD}[TimeZone] // void XMLDateTime::parseDate() { if (!initParser()) ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_date_invalid , fBuffer ? fBuffer : XMLUni::fgZeroLenString , fMemoryManager); getDate(); parseTimeZone(); validateDateTime(); normalize(); } void XMLDateTime::parseTime() { if (!initParser()) ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_time_invalid , fBuffer ? fBuffer : XMLUni::fgZeroLenString , fMemoryManager); // time initialize to default values fValue[CentYear]= YEAR_DEFAULT; fValue[Month] = MONTH_DEFAULT; fValue[Day] = DAY_DEFAULT; getTime(); validateDateTime(); normalize(); fHasTime = true; } // // {---DD}[TimeZone] // 01234 // void XMLDateTime::parseDay() { if (!initParser()) ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_gDay_invalid , fBuffer ? fBuffer : XMLUni::fgZeroLenString , fMemoryManager); if (fBuffer[0] != DATE_SEPARATOR || fBuffer[1] != DATE_SEPARATOR || fBuffer[2] != DATE_SEPARATOR ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_gDay_invalid , fBuffer , fMemoryManager); } //initialize values fValue[CentYear] = YEAR_DEFAULT; fValue[Month] = MONTH_DEFAULT; fValue[Day] = parseInt(fStart+3, fStart+5); if ( DAY_SIZE < fEnd ) { int pos = XMLString::indexOf(UTC_SET, fBuffer[DAY_SIZE]); if (pos == -1 ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_gDay_invalid , fBuffer , fMemoryManager); } else { fValue[utc] = pos+1; getTimeZone(DAY_SIZE); } } validateDateTime(); normalize(); } // // {--MM--}[TimeZone] // {--MM}[TimeZone] // 012345 // void XMLDateTime::parseMonth() { if (!initParser()) ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_gMth_invalid , fBuffer ? fBuffer : XMLUni::fgZeroLenString , fMemoryManager); if (fBuffer[0] != DATE_SEPARATOR || fBuffer[1] != DATE_SEPARATOR ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_gMth_invalid , fBuffer , fMemoryManager); } //set constants fValue[CentYear] = YEAR_DEFAULT; fValue[Day] = DAY_DEFAULT; fValue[Month] = parseInt(2, 4); // REVISIT: allow both --MM and --MM-- now. // need to remove the following lines to disallow --MM-- // when the errata is officially in the rec. fStart = 4; if ( fEnd >= fStart+2 && fBuffer[fStart] == DATE_SEPARATOR && fBuffer[fStart+1] == DATE_SEPARATOR ) { fStart += 2; } // // parse TimeZone if any // if ( fStart < fEnd ) { int pos = XMLString::indexOf(UTC_SET, fBuffer[fStart]); if ( pos == NOT_FOUND ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_gMth_invalid , fBuffer , fMemoryManager); } else { fValue[utc] = pos+1; getTimeZone(fStart); } } validateDateTime(); normalize(); } // //[-]{CCYY}[TimeZone] // 0 1234 // void XMLDateTime::parseYear() { if (!initParser()) ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_year_invalid , fBuffer ? fBuffer : XMLUni::fgZeroLenString , fMemoryManager); // skip the first '-' and search for timezone // int sign = findUTCSign((fBuffer[0] == chDash) ? 1 : 0); if (sign == NOT_FOUND) { fValue[CentYear] = parseIntYear(fEnd); } else { fValue[CentYear] = parseIntYear(sign); getTimeZone(sign); } //initialize values fValue[Month] = MONTH_DEFAULT; fValue[Day] = DAY_DEFAULT; //java is 1 validateDateTime(); normalize(); } // //{--MM-DD}[TimeZone] // 0123456 // void XMLDateTime::parseMonthDay() { if (!initParser()) ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_gMthDay_invalid , fBuffer ? fBuffer : XMLUni::fgZeroLenString , fMemoryManager); if (fBuffer[0] != DATE_SEPARATOR || fBuffer[1] != DATE_SEPARATOR || fBuffer[4] != DATE_SEPARATOR ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_gMthDay_invalid , fBuffer , fMemoryManager); } //initialize fValue[CentYear] = YEAR_DEFAULT; fValue[Month] = parseInt(2, 4); fValue[Day] = parseInt(5, 7); if ( MONTHDAY_SIZE < fEnd ) { int pos = XMLString::indexOf(UTC_SET, fBuffer[MONTHDAY_SIZE]); if ( pos == NOT_FOUND ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_gMthDay_invalid , fBuffer , fMemoryManager); } else { fValue[utc] = pos+1; getTimeZone(MONTHDAY_SIZE); } } validateDateTime(); normalize(); } void XMLDateTime::parseYearMonth() { if (!initParser()) ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_ym_invalid , fBuffer ? fBuffer : XMLUni::fgZeroLenString , fMemoryManager); // get date getYearMonth(); fValue[Day] = DAY_DEFAULT; parseTimeZone(); validateDateTime(); normalize(); } // //PnYn MnDTnH nMnS: -P1Y2M3DT10H30M // // [-]{'P'{[n'Y'][n'M'][n'D']['T'][n'H'][n'M'][n'S']}} // // Note: the n above shall be >= 0 // if no time element found, 'T' shall be absent // void XMLDateTime::parseDuration() { if (!initParser()) ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_dur_invalid , fBuffer ? fBuffer : XMLUni::fgZeroLenString , fMemoryManager); // must start with '-' or 'P' // XMLCh c = fBuffer[fStart++]; if ( (c != DURATION_STARTER) && (c != chDash) ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_dur_Start_dashP , fBuffer , fMemoryManager); } // 'P' must ALWAYS be present in either case if ( (c == chDash) && (fBuffer[fStart++]!= DURATION_STARTER )) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_dur_noP , fBuffer , fMemoryManager); } // java code //date[utc]=(c=='-')?'-':0; //fValue[utc] = UTC_STD; fValue[utc] = (fBuffer[0] == chDash? UTC_NEG : UTC_STD); int negate = ( fBuffer[0] == chDash ? -1 : 1); // // No negative value is allowed after 'P' // // eg P-1234, invalid // if (indexOf(fStart, fEnd, chDash) != NOT_FOUND) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_dur_DashNotFirst , fBuffer , fMemoryManager); } //at least one number and designator must be seen after P bool designator = false; int endDate = indexOf(fStart, fEnd, DATETIME_SEPARATOR); if ( endDate == NOT_FOUND ) { endDate = (int)fEnd; // 'T' absent } //find 'Y' int end = indexOf(fStart, endDate, DURATION_Y); if ( end != NOT_FOUND ) { //scan year fValue[CentYear] = negate * parseInt(fStart, end); fStart = end+1; designator = true; } end = indexOf(fStart, endDate, DURATION_M); if ( end != NOT_FOUND ) { //scan month fValue[Month] = negate * parseInt(fStart, end); fStart = end+1; designator = true; } end = indexOf(fStart, endDate, DURATION_D); if ( end != NOT_FOUND ) { //scan day fValue[Day] = negate * parseInt(fStart,end); fStart = end+1; designator = true; } if ( (fEnd == XMLSize_t (endDate)) && // 'T' absent (fStart != fEnd) ) // something after Day { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_dur_inv_b4T , fBuffer , fMemoryManager); } if ( fEnd != XMLSize_t (endDate) ) // 'T' present { //scan hours, minutes, seconds // // skip 'T' first end = indexOf(++fStart, fEnd, DURATION_H); if ( end != NOT_FOUND ) { //scan hours fValue[Hour] = negate * parseInt(fStart, end); fStart = end+1; designator = true; } end = indexOf(fStart, fEnd, DURATION_M); if ( end != NOT_FOUND ) { //scan min fValue[Minute] = negate * parseInt(fStart, end); fStart = end+1; designator = true; } end = indexOf(fStart, fEnd, DURATION_S); if ( end != NOT_FOUND ) { //scan seconds int mlsec = indexOf (fStart, end, MILISECOND_SEPARATOR); /*** * Schema Errata: E2-23 * at least one digit must follow the decimal point if it appears. * That is, the value of the seconds component must conform * to the following pattern: [0-9]+(.[0-9]+)? */ if ( mlsec != NOT_FOUND ) { /*** * make usure there is something after the '.' and before the end. */ if ( mlsec+1 == end ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_dur_inv_seconds , fBuffer , fMemoryManager); } fValue[Second] = negate * parseInt(fStart, mlsec); fMilliSecond = negate * parseMiliSecond(mlsec+1, end); } else { fValue[Second] = negate * parseInt(fStart,end); } fStart = end+1; designator = true; } // no additional data should appear after last item // P1Y1M1DT is illigal value as well if ( (fStart != fEnd) || fBuffer[--fStart] == DATETIME_SEPARATOR ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_dur_NoTimeAfterT , fBuffer , fMemoryManager); } } if ( !designator ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_dur_NoElementAtAll , fBuffer , fMemoryManager); } } // --------------------------------------------------------------------------- // Scanners // --------------------------------------------------------------------------- // // [-]{CCYY-MM-DD} // // Note: CCYY could be more than 4 digits // Assuming fStart point to the beginning of the Date Section // fStart updated to point to the position right AFTER the second 'D' // Since the lenght of CCYY might be variable, we can't check format upfront // void XMLDateTime::getDate() { // Ensure enough chars in buffer if ( (fStart+YMD_MIN_SIZE) > fEnd) ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_date_incomplete , fBuffer , fMemoryManager); getYearMonth(); // Scan YearMonth and // fStart point to the next '-' if (fBuffer[fStart++] != DATE_SEPARATOR) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_date_invalid , fBuffer , fMemoryManager); //("CCYY-MM must be followed by '-' sign"); } fValue[Day] = parseInt(fStart, fStart+2); fStart += 2 ; //fStart points right after the Day return; } // // hh:mm:ss[.msssss]['Z'] // hh:mm:ss[.msssss][['+'|'-']hh:mm] // 012345678 // // Note: Assuming fStart point to the beginning of the Time Section // fStart updated to point to the position right AFTER the second 's' // or ms if any // void XMLDateTime::getTime() { // Ensure enough chars in buffer if ( (fStart+TIME_MIN_SIZE) > fEnd) ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_time_incomplete , fBuffer , fMemoryManager); //"Imcomplete Time Format" // check (fixed) format first if ((fBuffer[fStart + 2] != TIME_SEPARATOR) || (fBuffer[fStart + 5] != TIME_SEPARATOR) ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_time_invalid , fBuffer , fMemoryManager); //("Error in parsing time" ); } // // get hours, minute and second // fValue[Hour] = parseInt(fStart + 0, fStart + 2); fValue[Minute] = parseInt(fStart + 3, fStart + 5); fValue[Second] = parseInt(fStart + 6, fStart + 8); fStart += 8; // to see if any ms and/or utc part after that if (fStart >= fEnd) return; //find UTC sign if any int sign = findUTCSign(fStart); //parse miliseconds int milisec = (fBuffer[fStart] == MILISECOND_SEPARATOR)? (int)fStart : NOT_FOUND; if ( milisec != NOT_FOUND ) { fStart++; // skip the '.' // make sure we have some thing between the '.' and fEnd if (fStart >= fEnd) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_ms_noDigit , fBuffer , fMemoryManager); //("ms shall be present once '.' is present" ); } if ( sign == NOT_FOUND ) { fMilliSecond = parseMiliSecond(fStart, fEnd); //get ms between '.' and fEnd fStart = fEnd; } else { fMilliSecond = parseMiliSecond(fStart, sign); //get ms between UTC sign and fEnd } } else if(sign == 0 || XMLSize_t (sign) != fStart) { // seconds has more than 2 digits ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_min_invalid , fBuffer , fMemoryManager); } //parse UTC time zone (hh:mm) if ( sign > 0 ) { getTimeZone(sign); } } // // [-]{CCYY-MM} // // Note: CCYY could be more than 4 digits // fStart updated to point AFTER the second 'M' (probably meet the fEnd) // void XMLDateTime::getYearMonth() { // Ensure enough chars in buffer if ( (fStart+YMONTH_MIN_SIZE) > fEnd) ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_ym_incomplete , fBuffer , fMemoryManager); //"Imcomplete YearMonth Format"; // skip the first leading '-' XMLSize_t start = ( fBuffer[0] == chDash ) ? fStart + 1 : fStart; // // search for year separator '-' // int yearSeparator = indexOf(start, fEnd, DATE_SEPARATOR); if ( yearSeparator == NOT_FOUND) ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_ym_invalid , fBuffer , fMemoryManager); //("Year separator is missing or misplaced"); fValue[CentYear] = parseIntYear(yearSeparator); fStart = yearSeparator + 1; //skip the '-' and point to the first M // //gonna check we have enough byte for month // if ((fStart + 2) > fEnd ) ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_ym_noMonth , fBuffer , fMemoryManager); //"no month in buffer" fValue[Month] = parseInt(fStart, yearSeparator + 3); fStart += 2; //fStart points right after the MONTH return; } void XMLDateTime::parseTimeZone() { //fStart points right after the date if ( fStart < fEnd ) { int pos = XMLString::indexOf(UTC_SET, fBuffer[fStart]); if (pos == NOT_FOUND) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_tz_noUTCsign , fBuffer , fMemoryManager); } else { fValue[utc] = pos+1; getTimeZone(fStart); } } return; } // // 'Z' // ['+'|'-']hh:mm // // Note: Assuming fStart points to the beginning of TimeZone section // fStart updated to meet fEnd // void XMLDateTime::getTimeZone(const XMLSize_t sign) { if ( fBuffer[sign] == UTC_STD_CHAR ) { if ((sign + 1) != fEnd ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_tz_stuffAfterZ , fBuffer , fMemoryManager); //"Error in parsing time zone"); } return; } // // otherwise, it has to be this format // '[+|-]'hh:mm // 1 23456 7 // sign fEnd // if ( ( ( sign + TIMEZONE_SIZE + 1) != fEnd ) || ( fBuffer[sign + 3] != TIMEZONE_SEPARATOR ) ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_tz_invalid , fBuffer , fMemoryManager); //("Error in parsing time zone"); } fTimeZone[hh] = parseInt(sign+1, sign+3); fTimeZone[mm] = parseInt(sign+4, fEnd); return; } // --------------------------------------------------------------------------- // Validator and normalizer // --------------------------------------------------------------------------- /** * If timezone present - normalize dateTime [E Adding durations to dateTimes] * * @param date CCYY-MM-DDThh:mm:ss+03 * @return CCYY-MM-DDThh:mm:ssZ */ void XMLDateTime::normalize() { if ((fValue[utc] == UTC_UNKNOWN) || (fValue[utc] == UTC_STD) ) return; int negate = (fValue[utc] == UTC_POS)? -1: 1; int temp; int carry; // we normalize a duration so could have 200M... //update months (may be modified additionaly below) temp = fValue[Month]; fValue[Month] = modulo(temp, 1, 13); carry = fQuotient(temp, 1, 13); if (fValue[Month] <= 0) { fValue[Month]+= 12; carry--; } //add years (may be modified additionaly below) fValue[CentYear] += carry; // add mins temp = fValue[Minute] + negate * fTimeZone[mm]; carry = fQuotient(temp, 60); fValue[Minute] = mod(temp, 60, carry); if (fValue[Minute] < 0) { fValue[Minute] += 60; carry--; } //add hours temp = fValue[Hour] + negate * fTimeZone[hh] + carry; carry = fQuotient(temp, 24); fValue[Hour] = mod(temp, 24, carry); if (fValue[Hour] < 0) { fValue[Hour] += 24; carry--; } fValue[Day] += carry; while (1) { temp = maxDayInMonthFor(fValue[CentYear], fValue[Month]); if (fValue[Day] < 1) { fValue[Day] += maxDayInMonthFor(fValue[CentYear], fValue[Month] - 1); carry = -1; } else if ( fValue[Day] > temp ) { fValue[Day] -= temp; carry = 1; } else { break; } temp = fValue[Month] + carry; fValue[Month] = modulo(temp, 1, 13); if (fValue[Month] <=0) { fValue[Month]+= 12; fValue[CentYear]--; } fValue[CentYear] += fQuotient(temp, 1, 13); } // set to normalized fValue[utc] = UTC_STD; return; } void XMLDateTime::validateDateTime() const { //REVISIT: should we throw an exception for not valid dates // or reporting an error message should be sufficient? if ( fValue[CentYear] == 0 ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_year_zero , fBuffer , fMemoryManager); //"The year \"0000\" is an illegal year value"); } if ( fValue[Month] < 1 || fValue[Month] > 12 ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_mth_invalid , fBuffer , fMemoryManager); //"The month must have values 1 to 12"); } //validate days if ( fValue[Day] > maxDayInMonthFor( fValue[CentYear], fValue[Month]) || fValue[Day] == 0 ) { XMLCh szMaxDay[3]; XMLString::binToText(maxDayInMonthFor( fValue[CentYear], fValue[Month]), szMaxDay, 3, 10, fMemoryManager); ThrowXMLwithMemMgr2(SchemaDateTimeException , XMLExcepts::DateTime_day_invalid , fBuffer , szMaxDay , fMemoryManager); //"The day must have values 1 to 31"); } //validate hours if ((fValue[Hour] < 0) || (fValue[Hour] > 24) || ((fValue[Hour] == 24) && ((fValue[Minute] !=0) || (fValue[Second] !=0) || (fMilliSecond !=0)))) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_hour_invalid , fBuffer , fMemoryManager); //("Hour must have values 0-23"); } //validate minutes if ( fValue[Minute] < 0 || fValue[Minute] > 59 ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_min_invalid , fBuffer , fMemoryManager); //"Minute must have values 0-59"); } //validate seconds if ( fValue[Second] < 0 || fValue[Second] > 60 ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_second_invalid , fBuffer , fMemoryManager); //"Second must have values 0-60"); } //validate time-zone hours if ( (abs(fTimeZone[hh]) > 14) || ((abs(fTimeZone[hh]) == 14) && (fTimeZone[mm] != 0)) ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_tz_hh_invalid , fBuffer , fMemoryManager); //"Time zone should have range -14..+14"); } //validate time-zone minutes if ( abs(fTimeZone[mm]) > 59 ) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_min_invalid , fBuffer , fMemoryManager); //("Minute must have values 0-59"); } return; } // ----------------------------------------------------------------------- // locator and converter // ----------------------------------------------------------------------- int XMLDateTime::indexOf(const XMLSize_t start, const XMLSize_t end, const XMLCh ch) const { for ( XMLSize_t i = start; i < end; i++ ) if ( fBuffer[i] == ch ) return (int)i; return NOT_FOUND; } int XMLDateTime::findUTCSign (const XMLSize_t start) { int pos; for ( XMLSize_t index = start; index < fEnd; index++ ) { pos = XMLString::indexOf(UTC_SET, fBuffer[index]); if ( pos != NOT_FOUND) { fValue[utc] = pos+1; // refer to utcType, there is 1 diff return (int)index; } } return NOT_FOUND; } // // Note: // start: starting point in fBuffer // end: ending point in fBuffer (exclusive) // fStart NOT updated // int XMLDateTime::parseInt(const XMLSize_t start, const XMLSize_t end) const { unsigned int retVal = 0; for (XMLSize_t i=start; i < end; i++) { if (fBuffer[i] < chDigit_0 || fBuffer[i] > chDigit_9) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, fMemoryManager); retVal = (retVal * 10) + (unsigned int) (fBuffer[i] - chDigit_0); } return (int) retVal; } // // Note: // start: pointing to the first digit after the '.' // end: pointing to one position after the last digit // fStart NOT updated // double XMLDateTime::parseMiliSecond(const XMLSize_t start, const XMLSize_t end) const { double div = 10; double retval = 0; for (XMLSize_t i=start; i < end; i++) { if (fBuffer[i] < chDigit_0 || fBuffer[i] > chDigit_9) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, fMemoryManager); retval += (fBuffer[i] == chDigit_0) ? 0 : ((double) (fBuffer[i] - chDigit_0)/div); div *= 10; } // we don't check underflow occurs since // nothing we can do about it. return retval; } // // [-]CCYY // // Note: start from fStart // end (exclusive) // fStart NOT updated // int XMLDateTime::parseIntYear(const XMLSize_t end) const { // skip the first leading '-' XMLSize_t start = ( fBuffer[0] == chDash ) ? fStart + 1 : fStart; XMLSize_t length = end - start; if (length < 4) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_year_tooShort , fBuffer , fMemoryManager); //"Year must have 'CCYY' format"); } else if (length > 4 && fBuffer[start] == chDigit_0) { ThrowXMLwithMemMgr1(SchemaDateTimeException , XMLExcepts::DateTime_year_leadingZero , fBuffer , fMemoryManager); //"Leading zeros are required if the year value would otherwise have fewer than four digits; // otherwise they are forbidden"); } bool negative = (fBuffer[0] == chDash); int yearVal = parseInt((negative ? 1 : 0), end); return ( negative ? (-1) * yearVal : yearVal ); } /*** * E2-41 * * 3.2.7.2 Canonical representation * * Except for trailing fractional zero digits in the seconds representation, * '24:00:00' time representations, and timezone (for timezoned values), * the mapping from literals to values is one-to-one. Where there is more * than one possible representation, the canonical representation is as follows: * redundant trailing zero digits in fractional-second literals are prohibited. * An hour representation of '24' is prohibited. Timezoned values are canonically * represented by appending 'Z' to the nontimezoned representation. (All * timezoned dateTime values are UTC.) * * .'24:00:00' -> '00:00:00' * .milisecond: trailing zeros removed * .'Z' * ***/ XMLCh* XMLDateTime::getDateTimeCanonicalRepresentation(MemoryManager* const memMgr) const { XMLCh *miliStartPtr, *miliEndPtr; searchMiliSeconds(miliStartPtr, miliEndPtr); XMLSize_t miliSecondsLen = miliEndPtr - miliStartPtr; int utcSize = (fValue[utc] == UTC_UNKNOWN) ? 0 : 1; MemoryManager* toUse = memMgr? memMgr : fMemoryManager; XMLCh* retBuf = (XMLCh*) toUse->allocate( (21 + miliSecondsLen + utcSize + 1) * sizeof(XMLCh)); XMLCh* retPtr = retBuf; // (-?) cc+yy-mm-dd'T'hh:mm:ss'Z' ('.'s+)? // 2+ 8 1 8 1 // int additionalLen = fillYearString(retPtr, fValue[CentYear]); if(additionalLen != 0) { // very bad luck; have to resize the buffer... XMLCh *tmpBuf = (XMLCh*) toUse->allocate( (additionalLen+21+miliSecondsLen +2) * sizeof(XMLCh)); XMLString::moveChars(tmpBuf, retBuf, 4+additionalLen); retPtr = tmpBuf+(retPtr-retBuf); toUse->deallocate(retBuf); retBuf = tmpBuf; } *retPtr++ = DATE_SEPARATOR; fillString(retPtr, fValue[Month], 2); *retPtr++ = DATE_SEPARATOR; fillString(retPtr, fValue[Day], 2); *retPtr++ = DATETIME_SEPARATOR; fillString(retPtr, fValue[Hour], 2); if (fValue[Hour] == 24) { *(retPtr - 2) = chDigit_0; *(retPtr - 1) = chDigit_0; } *retPtr++ = TIME_SEPARATOR; fillString(retPtr, fValue[Minute], 2); *retPtr++ = TIME_SEPARATOR; fillString(retPtr, fValue[Second], 2); if (miliSecondsLen) { *retPtr++ = chPeriod; XMLString::copyNString(retPtr, miliStartPtr, miliSecondsLen); retPtr += miliSecondsLen; } if (utcSize) *retPtr++ = UTC_STD_CHAR; *retPtr = chNull; return retBuf; } /*** * E2-41 * * 3.2.9.2 Canonical representation * * Given a member of the date value space, the date * portion of the canonical representation (the entire * representation for nontimezoned values, and all but * the timezone representation for timezoned values) * is always the date portion of the dateTime canonical * representation of the interval midpoint (the * dateTime representation, truncated on the right * to eliminate 'T' and all following characters). * For timezoned values, append the canonical * representation of the recoverable timezone. * ***/ XMLCh* XMLDateTime::getDateCanonicalRepresentation(MemoryManager* const memMgr) const { /* * Case Date Actual Value Canonical Value * 1 yyyy-mm-dd yyyy-mm-dd yyyy-mm-dd * 2 yyyy-mm-ddZ yyyy-mm-ddT00:00Z yyyy-mm-ddZ * 3 yyyy-mm-dd+00:00 yyyy-mm-ddT00:00Z yyyy-mm-ddZ * 4 yyyy-mm-dd+00:01 YYYY-MM-DCT23:59Z yyyy-mm-dd+00:01 * 5 yyyy-mm-dd+12:00 YYYY-MM-DCT12:00Z yyyy-mm-dd+12:00 * 6 yyyy-mm-dd+12:01 YYYY-MM-DCT11:59Z YYYY-MM-DC-11:59 * 7 yyyy-mm-dd+14:00 YYYY-MM-DCT10:00Z YYYY-MM-DC-10:00 * 8 yyyy-mm-dd-00:00 yyyy-mm-ddT00:00Z yyyy-mm-ddZ * 9 yyyy-mm-dd-00:01 yyyy-mm-ddT00:01Z yyyy-mm-dd-00:01 * 11 yyyy-mm-dd-11:59 yyyy-mm-ddT11:59Z YYYY-MM-DD-11:59 * 10 yyyy-mm-dd-12:00 yyyy-mm-ddT12:00Z YYYY-MM-DD+12:00 * 12 yyyy-mm-dd-14:00 yyyy-mm-ddT14:00Z YYYY-MM-DD+10:00 */ int utcSize = (fValue[utc] == UTC_UNKNOWN) ? 0 : 1; // YYYY-MM-DD + chNull // 1234567890 + 1 int memLength = 10 + 1 + utcSize; if (fTimeZone[hh] != 0 || fTimeZone[mm] != 0) { // YYYY-MM-DD+HH:MM (utcSize will be 1 so drop that) // 1234567890123456 memLength += 5; // 6 - 1 for utcSize } MemoryManager* toUse = memMgr? memMgr : fMemoryManager; XMLCh* retBuf = (XMLCh*) toUse->allocate( (memLength) * sizeof(XMLCh)); XMLCh* retPtr = retBuf; if (fValue[Hour] < 12) { int additionalLen = fillYearString(retPtr, fValue[CentYear]); if (additionalLen != 0) { // very bad luck; have to resize the buffer... XMLCh *tmpBuf = (XMLCh*) toUse->allocate( (additionalLen + memLength ) * sizeof(XMLCh)); XMLString::moveChars(tmpBuf, retBuf, 4+additionalLen); retPtr = tmpBuf+(retPtr-retBuf); toUse->deallocate(retBuf); retBuf = tmpBuf; } *retPtr++ = DATE_SEPARATOR; fillString(retPtr, fValue[Month], 2); *retPtr++ = DATE_SEPARATOR; fillString(retPtr, fValue[Day], 2); if (utcSize) { if (fTimeZone[hh] != 0 || fTimeZone[mm] != 0) { *retPtr++ = UTC_NEG_CHAR; fillString(retPtr, fValue[Hour], 2); *retPtr++ = TIME_SEPARATOR; fillString(retPtr, fValue[Minute], 2); } else { *retPtr++ = UTC_STD_CHAR; } } *retPtr = chNull; } else { /* * Need to reconvert things to get a recoverable time zone between * +12:00 and -11:59 */ int carry; int minute; int hour; int day; int month; int year; if (fValue[Minute] == 0) { minute = 0; carry = 0; } else { minute = 60 - fValue[Minute]; carry = 1; } hour = 24 - fValue[Hour] - carry; day = fValue[Day] + 1; month = fValue[Month]; year = fValue[CentYear]; while (1) { int temp = maxDayInMonthFor(year, month); if (day < 1) { day += maxDayInMonthFor(year, month - 1); carry = -1; } else if (day > temp) { day -= temp; carry = 1; } else { break; } temp = month + carry; month = modulo(temp, 1, 13); if (month <= 0) { month+= 12; year--; } year += fQuotient(temp, 1, 13); } int additionalLen = fillYearString(retPtr, year); if (additionalLen != 0) { // very bad luck; have to resize the buffer... XMLCh *tmpBuf = (XMLCh*) toUse->allocate( (additionalLen + memLength ) * sizeof(XMLCh)); XMLString::moveChars(tmpBuf, retBuf, 4+additionalLen); retPtr = tmpBuf+(retPtr-retBuf); toUse->deallocate(retBuf); retBuf = tmpBuf; } *retPtr++ = DATE_SEPARATOR; fillString(retPtr, month, 2); *retPtr++ = DATE_SEPARATOR; fillString(retPtr, day, 2); *retPtr++ = UTC_POS_CHAR; fillString(retPtr, hour, 2); *retPtr++ = TIME_SEPARATOR; fillString(retPtr, minute, 2); *retPtr = chNull; } return retBuf; } /*** * 3.2.8 time * * . either the time zone must be omitted or, * if present, the time zone must be Coordinated Universal Time (UTC) indicated by a "Z". * * . Additionally, the canonical representation for midnight is 00:00:00. * ***/ XMLCh* XMLDateTime::getTimeCanonicalRepresentation(MemoryManager* const memMgr) const { XMLCh *miliStartPtr, *miliEndPtr; searchMiliSeconds(miliStartPtr, miliEndPtr); XMLSize_t miliSecondsLen = miliEndPtr - miliStartPtr; int utcSize = (fValue[utc] == UTC_UNKNOWN) ? 0 : 1; MemoryManager* toUse = memMgr? memMgr : fMemoryManager; XMLCh* retBuf = (XMLCh*) toUse->allocate( (10 + miliSecondsLen + utcSize + 1) * sizeof(XMLCh)); XMLCh* retPtr = retBuf; // 'hh:mm:ss'Z' ('.'s+)? // 8 1 // fillString(retPtr, fValue[Hour], 2); if (fValue[Hour] == 24) { *(retPtr - 2) = chDigit_0; *(retPtr - 1) = chDigit_0; } *retPtr++ = TIME_SEPARATOR; fillString(retPtr, fValue[Minute], 2); *retPtr++ = TIME_SEPARATOR; fillString(retPtr, fValue[Second], 2); if (miliSecondsLen) { *retPtr++ = chPeriod; XMLString::copyNString(retPtr, miliStartPtr, miliSecondsLen); retPtr += miliSecondsLen; } if (utcSize) *retPtr++ = UTC_STD_CHAR; *retPtr = chNull; return retBuf; } void XMLDateTime::fillString(XMLCh*& ptr, int value, XMLSize_t expLen) const { XMLCh strBuffer[16]; assert(expLen < 16); XMLString::binToText(value, strBuffer, expLen, 10, fMemoryManager); XMLSize_t actualLen = XMLString::stringLen(strBuffer); XMLSize_t i; //append leading zeros for (i = 0; i < expLen - actualLen; i++) { *ptr++ = chDigit_0; } for (i = 0; i < actualLen; i++) { *ptr++ = strBuffer[i]; } } int XMLDateTime::fillYearString(XMLCh*& ptr, int value) const { XMLCh strBuffer[16]; // let's hope we get no years of 15 digits... XMLString::binToText(value, strBuffer, 15, 10, fMemoryManager); XMLSize_t actualLen = XMLString::stringLen(strBuffer); // don't forget that years can be negative... XMLSize_t negativeYear = 0; if(strBuffer[0] == chDash) { *ptr++ = strBuffer[0]; negativeYear = 1; } XMLSize_t i; //append leading zeros if(actualLen+negativeYear < 4) for (i = 0; i < 4 - actualLen+negativeYear; i++) *ptr++ = chDigit_0; for (i = negativeYear; i < actualLen; i++) *ptr++ = strBuffer[i]; if(actualLen > 4) return (int)actualLen-4; return 0; } /*** * * .check if the rawData has the mili second component * .capture the substring * ***/ void XMLDateTime::searchMiliSeconds(XMLCh*& miliStartPtr, XMLCh*& miliEndPtr) const { miliStartPtr = miliEndPtr = 0; int milisec = XMLString::indexOf(fBuffer, MILISECOND_SEPARATOR); if (milisec == -1) return; miliStartPtr = fBuffer + milisec + 1; miliEndPtr = miliStartPtr; while (*miliEndPtr) { if ((*miliEndPtr < chDigit_0) || (*miliEndPtr > chDigit_9)) break; miliEndPtr++; } //remove trailing zeros while( *(miliEndPtr - 1) == chDigit_0) miliEndPtr--; return; } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(XMLDateTime) void XMLDateTime::serialize(XSerializeEngine& serEng) { //REVISIT: may not need to call base since it does nothing XMLNumber::serialize(serEng); int i = 0; if (serEng.isStoring()) { for (i = 0; i < TOTAL_SIZE; i++) { serEng<>fValue[i]; } for (i = 0; i < TIMEZONE_ARRAYSIZE; i++) { serEng>>fTimeZone[i]; } serEng>>(unsigned long&)fStart; serEng>>(unsigned long&)fEnd; XMLSize_t dataLen = 0; serEng.readString(fBuffer, fBufferMaxLen, dataLen ,XSerializeEngine::toReadBufferLen); } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLEnumerator.hpp000644 000765 000024 00000003715 13241160336 022463 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLEnumerator.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLENUMERATOR_HPP) #define XERCESC_INCLUDE_GUARD_XMLENUMERATOR_HPP #include XERCES_CPP_NAMESPACE_BEGIN template class XMLEnumerator { public : // ----------------------------------------------------------------------- // Destructor // ----------------------------------------------------------------------- virtual ~XMLEnumerator() {}; // ----------------------------------------------------------------------- // XMLEnumerator interface // ----------------------------------------------------------------------- virtual bool hasMoreElements() const = 0; virtual TElem& nextElement() = 0; virtual void Reset() = 0; XMLEnumerator() {} XMLEnumerator(const XMLEnumerator&) {} private: // ----------------------------------------------------------------------- // Unimplemented operators // ----------------------------------------------------------------------- XMLEnumerator& operator=(const XMLEnumerator&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/SynchronizedStringPool.cpp000644 000765 000024 00000010143 13241160336 024445 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SynchronizedStringPool.cpp 903137 2010-01-26 09:26:28Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLSynchronizedStringPool: Constructors and Destructor // --------------------------------------------------------------------------- XMLSynchronizedStringPool::XMLSynchronizedStringPool(const XMLStringPool *constPool , const unsigned int modulus , MemoryManager* const manager) : XMLStringPool(modulus, manager) , fConstPool(constPool) , fMutex(manager) { } XMLSynchronizedStringPool::~XMLSynchronizedStringPool() { } // --------------------------------------------------------------------------- // XMLSynchronizedStringPool: Pool management methods // --------------------------------------------------------------------------- unsigned int XMLSynchronizedStringPool::addOrFind(const XMLCh* const newString) { unsigned int id = fConstPool->getId(newString); if(id) return id; // might have to add it to our own table. // synchronize this bit unsigned int constCount = fConstPool->getStringCount(); XMLMutexLock lockInit(&fMutex); id = XMLStringPool::addOrFind(newString); return id+constCount; } bool XMLSynchronizedStringPool::exists(const XMLCh* const newString) const { if(fConstPool->exists(newString)) return true; XMLMutexLock lockInit(&const_cast(this)->fMutex); return XMLStringPool::exists(newString); } bool XMLSynchronizedStringPool::exists(const unsigned int id) const { if (!id) return false; // First see if this id belongs to the const pool. // unsigned int constCount = fConstPool->getStringCount(); if (id <= constCount) return true; // The rest needs to be synchronized. // XMLMutexLock lockInit(&const_cast(this)->fMutex); return id < fCurId + constCount; } void XMLSynchronizedStringPool::flushAll() { // don't touch const pool! XMLStringPool::flushAll(); } unsigned int XMLSynchronizedStringPool::getId(const XMLCh* const toFind) const { unsigned int retVal = fConstPool->getId(toFind); if(retVal) return retVal; // make sure we return a truly unique id unsigned int constCount = fConstPool->getStringCount(); XMLMutexLock lockInit(&const_cast(this)->fMutex); return XMLStringPool::getId(toFind)+constCount; } const XMLCh* XMLSynchronizedStringPool::getValueForId(const unsigned int id) const { if (id <= fConstPool->getStringCount()) return fConstPool->getValueForId(id); unsigned int constCount = fConstPool->getStringCount(); XMLMutexLock lockInit(&const_cast(this)->fMutex); return XMLStringPool::getValueForId(id-constCount); } unsigned int XMLSynchronizedStringPool::getStringCount() const { unsigned int constCount = fConstPool->getStringCount(); XMLMutexLock lockInit(&const_cast(this)->fMutex); return fCurId+constCount-1; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/StringPool.cpp000644 000765 000024 00000015260 13241160335 022051 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: StringPool.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLStringPool: Constructors and Destructor // --------------------------------------------------------------------------- XMLStringPool::XMLStringPool(const unsigned int modulus, MemoryManager* const manager) : fMemoryManager(manager) , fIdMap(0) , fHashTable(0) , fMapCapacity(64) , fCurId(1) { // Create the hash table, passing it the modulus fHashTable = new (fMemoryManager) RefHashTableOf(modulus, false, fMemoryManager); // Do an initial allocation of the id map and zero it all out fIdMap = (PoolElem**) fMemoryManager->allocate ( fMapCapacity * sizeof(PoolElem*) ); //new PoolElem*[fMapCapacity]; memset(fIdMap, 0, sizeof(PoolElem*) * fMapCapacity); } XMLStringPool::~XMLStringPool() { // delete all buckelements, since the hashtable doesn't adopt the elements anymore for (unsigned int index = 1; index < fCurId; index++) { //fIdMap[index]->~PoolElem(); // we have no destructor fMemoryManager->deallocate((void*) fIdMap[index]->fString); // deallocate memory fMemoryManager->deallocate(fIdMap[index]); // deallocate memory } delete fHashTable; fMemoryManager->deallocate(fIdMap); //delete [] fIdMap; } // --------------------------------------------------------------------------- // XMLStringPool: Pool management methods // --------------------------------------------------------------------------- void XMLStringPool::flushAll() { // delete all buckelements, since the hashtable doesn't adopt the elements anymore for (unsigned int index = 1; index < fCurId; index++) { //fIdMap[index]->~PoolElem(); // we have no destructor fMemoryManager->deallocate((void*) fIdMap[index]->fString); // deallocate memory fMemoryManager->deallocate(fIdMap[index]); // deallocate memory } fCurId = 1; fHashTable->removeAll(); } // --------------------------------------------------------------------------- // XMLStringPool: Private helper methods // --------------------------------------------------------------------------- unsigned int XMLStringPool::addNewEntry(const XMLCh* const newString) { // See if we need to expand the id map if (fCurId == fMapCapacity) { // Calculate the new capacity, create a temp new map, and zero it const unsigned int newCap = (unsigned int)(fMapCapacity * 1.5); PoolElem** newMap = (PoolElem**) fMemoryManager->allocate ( newCap * sizeof(PoolElem*) ); //new PoolElem*[newCap]; memset(newMap, 0, sizeof(PoolElem*) * newCap); // // Copy over the old elements from the old map. They are just pointers // so we can do it all at once. // memcpy(newMap, fIdMap, sizeof(PoolElem*) * fMapCapacity); // Clean up the old map and store the new info fMemoryManager->deallocate(fIdMap); //delete [] fIdMap; fIdMap = newMap; fMapCapacity = newCap; } // // Ok, now create a new element and add it to the hash table. Then store // this new element in the id map at the current id index, then bump the // id index. // PoolElem* newElem = (PoolElem*) fMemoryManager->allocate(sizeof(PoolElem)); newElem->fId = fCurId; newElem->fString = XMLString::replicate(newString, fMemoryManager); fHashTable->put((void*)newElem->fString, newElem); fIdMap[fCurId] = newElem; // Bump the current id and return the id of the new elem we just added fCurId++; return newElem->fId; } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(XMLStringPool) void XMLStringPool::serialize(XSerializeEngine& serEng) { /*** * Since we are pretty sure that fIdMap and fHashTable is * not shared by any other object, therefore there is no owned/referenced * issue. Thus we can serialize the raw data only, rather than serializing * both fIdMap and fHashTable. * * And we can rebuild the fIdMap and fHashTable out of the raw data during * deserialization. * ***/ if (serEng.isStoring()) { serEng<>mapSize; assert(1 == fCurId); //make sure empty for (unsigned int index = 1; index < mapSize; index++) { XMLCh* stringData; serEng.readString(stringData); addNewEntry(stringData); //we got to deallocate this string //since stringpool will duplicate this string in the PoolElem and own that copy fMemoryManager->deallocate(stringData); } } } XMLStringPool::XMLStringPool(MemoryManager* const manager) : fMemoryManager(manager) , fIdMap(0) , fHashTable(0) , fMapCapacity(64) , fCurId(1) { // Create the hash table, passing it the modulus fHashTable = new (fMemoryManager) RefHashTableOf(109, false, fMemoryManager); // Do an initial allocation of the id map and zero it all out fIdMap = (PoolElem**) fMemoryManager->allocate ( fMapCapacity * sizeof(PoolElem*) ); //new PoolElem*[fMapCapacity]; memset(fIdMap, 0, sizeof(PoolElem*) * fMapCapacity); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/SchemaDateTimeException.hpp000644 000765 000024 00000002226 13241160336 024451 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SchemaDateTimeException.hpp 471747 2006-11-06 14:31:56Z amassari $ */ #if !defined(SCHEMA_DATETIME_EXCEPTION_HPP) #define SCHEMA_DATETIME_EXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(SchemaDateTimeException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/Mutexes.hpp000644 000765 000024 00000007304 13241160336 021411 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Mutexes.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_MUTEXES_HPP) #define XERCESC_INCLUDE_GUARD_MUTEXES_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT XMLMutex : public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- XMLMutex(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~XMLMutex(); // ----------------------------------------------------------------------- // Lock control methods // ----------------------------------------------------------------------- void lock(); void unlock(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLMutex(const XMLMutex&); XMLMutex& operator=(const XMLMutex&); // ----------------------------------------------------------------------- // Private data members // // fHandle // The raw mutex handle. Its just a void pointer so we do not // pass judgement on its value at all. We just pass it into the // platform utilities methods which knows what's really in it. // fManager // The MemoryManager that this XMLMutex was initialized with. // ----------------------------------------------------------------------- void* fHandle; MemoryManager* fManager; // ----------------------------------------------------------------------- // Sun PlatformUtils needs access to fHandle to initialize the // atomicOpsMutex at startup. // ----------------------------------------------------------------------- friend class XMLPlatformUtils; }; class XMLUTIL_EXPORT XMLMutexLock : public XMemory { // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- public: XMLMutexLock(XMLMutex* const toLock); ~XMLMutexLock(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLMutexLock(); XMLMutexLock(const XMLMutexLock&); XMLMutexLock& operator=(const XMLMutexLock&); // ----------------------------------------------------------------------- // Private data members // // fToLock // The mutex object that we are locking // ----------------------------------------------------------------------- XMLMutex* fToLock; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/PlatformUtils.cpp000644 000765 000024 00000076435 13272177434 022605 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: PlatformUtils.cpp 1826421 2018-03-10 21:07:56Z rleigh $ * */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #if HAVE_CONFIG_H # include #endif #if HAVE_LIMITS_H # include #endif #if HAVE_SYS_TIME_H # include #endif #if !HAVE_GETTIMEOFDAY && HAVE_SYS_TIMEB_H # include #endif #if HAVE_CPUID_H && !XERCES_HAVE_INTRIN_H # include #endif #include #include #include #include #include #include #include #include #include #include #include #if XERCES_HAVE_INTRIN_H # include #endif #include #if XERCES_USE_FILEMGR_POSIX # include #endif #if XERCES_USE_FILEMGR_WINDOWS # include #endif #include #if XERCES_USE_MUTEXMGR_NOTHREAD # include #endif #if XERCES_USE_MUTEXMGR_STD # include #endif #if XERCES_USE_MUTEXMGR_POSIX # include #endif #if XERCES_USE_MUTEXMGR_WINDOWS # include #endif #include #if XERCES_USE_NETACCESSOR_CURL # include #endif #if XERCES_USE_NETACCESSOR_SOCKET # include #endif #if XERCES_USE_NETACCESSOR_CFURL # include #endif #if XERCES_USE_NETACCESSOR_WINSOCK # include #endif #include #if XERCES_USE_MSGLOADER_ICU # include #endif #if XERCES_USE_MSGLOADER_ICONV # include #endif #if XERCES_USE_MSGLOADER_INMEMORY # include #endif #include #if XERCES_USE_TRANSCODER_ICU # include #endif #if XERCES_USE_TRANSCODER_GNUICONV # include #endif #if XERCES_USE_TRANSCODER_ICONV # include #endif #if XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER # include #endif #if XERCES_USE_TRANSCODER_WINDOWS # include #endif XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local data members // // gSyncMutex // This is a mutex that will be used to synchronize access to some of // the static data of the platform utilities class and here locally. // --------------------------------------------------------------------------- static XMLMutex* gSyncMutex = 0; static long gInitFlag = 0; // --------------------------------------------------------------------------- // XMLPlatformUtils: Static Data Members // --------------------------------------------------------------------------- XMLNetAccessor* XMLPlatformUtils::fgNetAccessor = 0; XMLTransService* XMLPlatformUtils::fgTransService = 0; #ifdef OS390 XMLTransService* XMLPlatformUtils::fgTransService2 = 0; #endif PanicHandler* XMLPlatformUtils::fgUserPanicHandler = 0; PanicHandler* XMLPlatformUtils::fgDefaultPanicHandler = 0; MemoryManager* XMLPlatformUtils::fgMemoryManager = 0; bool XMLPlatformUtils::fgMemMgrAdopted = true; XMLFileMgr* XMLPlatformUtils::fgFileMgr = 0; XMLMutexMgr* XMLPlatformUtils::fgMutexMgr = 0; XMLMutex* XMLPlatformUtils::fgAtomicMutex = 0; bool XMLPlatformUtils::fgXMLChBigEndian = true; bool XMLPlatformUtils::fgSSE2ok = false; // --------------------------------------------------------------------------- // XMLPlatformUtils: Init/term methods // --------------------------------------------------------------------------- void XMLPlatformUtils::Initialize(const char* const locale , const char* const nlsHome , PanicHandler* const panicHandler , MemoryManager* const memoryManager) { // // Effects of overflow: // . resouce re-allocations // . consequently resource leaks // . potentially terminate() may never get executed // // We got to prevent overflow from happening. // no error or exception // if (gInitFlag == LONG_MAX) return; // // Make sure we haven't already been initialized. Note that this is not // thread safe and is not intended for that. Its more for those COM // like processes that cannot keep up with whether they have initialized // us yet or not. // gInitFlag++; if (gInitFlag > 1) return; // Set pluggable memory manager if (!fgMemoryManager) { if (memoryManager) { fgMemoryManager = memoryManager; fgMemMgrAdopted = false; } else { fgMemoryManager = new MemoryManagerImpl(); } } /*** * Panic Handler: * ***/ if (!panicHandler) { fgDefaultPanicHandler = new DefaultPanicHandler(); } else { fgUserPanicHandler = panicHandler; } // Determine our endianness (with regard to a XMLCh 16-bit word) union { XMLCh ch; unsigned char ar[sizeof(XMLCh)]; } endianTest; endianTest.ch = 1; fgXMLChBigEndian = (endianTest.ar[sizeof(XMLCh)-1] == 1); // Determine if we can use SSE2 functions #if defined(XERCES_HAVE_CPUID_INTRINSIC) int CPUInfo[4]={0}; __cpuid(CPUInfo, 1); if(CPUInfo[3] & (1UL << 26)) fgSSE2ok = true; else fgSSE2ok = false; #elif defined(XERCES_HAVE_GETCPUID) unsigned int eax, ebx, ecx, edx; if(!__get_cpuid (1, &eax, &ebx, &ecx, &edx) || (edx & (1UL << 26))==0) fgSSE2ok = false; else fgSSE2ok = true; #elif defined(XERCES_HAVE_SSE2_INTRINSIC) // if we cannot find out at runtime, assume the define has it right fgSSE2ok = true; #else fgSSE2ok = false; #endif // Initialize the platform-specific mutex and file mgrs fgMutexMgr = makeMutexMgr(fgMemoryManager); fgFileMgr = makeFileMgr(fgMemoryManager); // Create the local sync mutex gSyncMutex = new XMLMutex(fgMemoryManager); // Create the global "atomic operations" mutex. fgAtomicMutex = new XMLMutex(fgMemoryManager); // // Ask the per-platform code to make the desired transcoding service for // us to use. This call cannot throw any exceptions or do anything that // cause any transcoding to happen. It should create the service and // return it or zero if it cannot. // // This one also cannot use any utility services. It can only create a // transcoding service object and return it. // // If we cannot make one, then we call panic to end the process. // XMLInitializer::initializeTransService(); // TransService static data. fgTransService = makeTransService(); if (!fgTransService) panic(PanicHandler::Panic_NoTransService); // Initialize the transcoder service fgTransService->initTransService(); // // Try to create a default local code page transcoder. This is the one // that will be used internally by the XMLString class. If we cannot // create one, then call the panic method. // XMLLCPTranscoder* defXCode = XMLPlatformUtils::fgTransService->makeNewLCPTranscoder(fgMemoryManager); if (!defXCode) panic(PanicHandler::Panic_NoDefTranscoder); XMLString::initString(defXCode, fgMemoryManager); // // Now lets ask the per-platform code to give us an instance of the type // of network access implementation he wants to use. This can return // a zero pointer if this platform doesn't want to support this. // fgNetAccessor = makeNetAccessor(); /*** * Message Loader: * * Locale setting * nlsHome setting ***/ XMLMsgLoader::setLocale(locale); XMLMsgLoader::setNLSHome(nlsHome); // Initialize static data. // XMLInitializer::initializeStaticData(); } void XMLPlatformUtils::Initialize(XMLSize_t initialDOMHeapAllocSize , XMLSize_t maxDOMHeapAllocSize , XMLSize_t maxDOMSubAllocationSize , const char* const locale , const char* const nlsHome , PanicHandler* const panicHandler , MemoryManager* const memoryManager) { Initialize (locale, nlsHome, panicHandler, memoryManager); // Don't change the parameters unless it is the first time. // if (gInitFlag == 1) XMLInitializer::initializeDOMHeap(initialDOMHeapAllocSize, maxDOMHeapAllocSize, maxDOMSubAllocationSize); } void XMLPlatformUtils::Terminate() { // // To prevent it from running underflow. // otherwise we come to delete non-existing resources. // // no error or exception // if (gInitFlag == 0) return; gInitFlag--; if (gInitFlag > 0) return; // Terminate static data. // XMLInitializer::terminateStaticData(); // Delete any net accessor that got installed delete fgNetAccessor; fgNetAccessor = 0; // // Call some other internal modules to give them a chance to clean up. // Do the string class last in case something tries to use it during // cleanup. // XMLString::termString(); // Clean up the the transcoding service delete fgTransService; fgTransService = 0; XMLInitializer::terminateTransService(); // TransService static data. // Clean up mutexes delete gSyncMutex; gSyncMutex = 0; delete fgAtomicMutex; fgAtomicMutex = 0; // Clean up our mgrs delete fgFileMgr; fgFileMgr = 0; delete fgMutexMgr; fgMutexMgr = 0; /*** * de-allocate resource * * refer to discussion in the Initialize() ***/ XMLMsgLoader::setLocale(0); XMLMsgLoader::setNLSHome(0); delete fgDefaultPanicHandler; fgDefaultPanicHandler = 0; fgUserPanicHandler = 0; // de-allocate default memory manager if (fgMemMgrAdopted) delete fgMemoryManager; else fgMemMgrAdopted = true; // set memory manager to 0 fgMemoryManager = 0; // And say we are no longer initialized gInitFlag = 0; } // --------------------------------------------------------------------------- // XMLPlatformUtils: The panic method // --------------------------------------------------------------------------- void XMLPlatformUtils::panic(const PanicHandler::PanicReasons reason) { fgUserPanicHandler? fgUserPanicHandler->panic(reason) : fgDefaultPanicHandler->panic(reason); } // --------------------------------------------------------------------------- // XMLPlatformUtils: Private Static Methods // --------------------------------------------------------------------------- XMLNetAccessor* XMLPlatformUtils::makeNetAccessor() { XMLNetAccessor* na = 0; #if defined (XERCES_USE_NETACCESSOR_CURL) na = new CurlNetAccessor(); #elif defined (XERCES_USE_NETACCESSOR_SOCKET) na = new SocketNetAccessor(); #elif defined (XERCES_USE_NETACCESSOR_CFURL) na = new MacOSURLAccessCF(); #elif defined (XERCES_USE_NETACCESSOR_WINSOCK) na = new WinSockNetAccessor(); #endif return na; } // // This method is called by the platform independent part of this class // when client code asks to have one of the supported message sets loaded. // XMLMsgLoader* XMLPlatformUtils::loadAMsgSet(const XMLCh* const msgDomain) { XMLMsgLoader* ms=0; try { #if defined (XERCES_USE_MSGLOADER_ICU) ms = new ICUMsgLoader(msgDomain); #elif defined (XERCES_USE_MSGLOADER_ICONV) ms = new MsgCatalogLoader(msgDomain); #elif defined (XERCES_USE_MSGLOADER_INMEMORY) ms = new InMemMsgLoader(msgDomain); #else #error No MsgLoader configured for platform! You must configure it. #endif } catch(const OutOfMemoryException&) { throw; } catch(...) { panic(PanicHandler::Panic_CantLoadMsgDomain); } return ms; } // // This method is called very early in the bootstrapping process. This guy // must create a transcoding service and return it. It cannot use any string // methods, any transcoding services, throw any exceptions, etc... It just // makes a transcoding service and returns it, or returns zero on failure. // XMLTransService* XMLPlatformUtils::makeTransService() { XMLTransService* tc = 0; #if defined (XERCES_USE_TRANSCODER_ICU) tc = new ICUTransService(fgMemoryManager); #elif defined (XERCES_USE_TRANSCODER_GNUICONV) tc = new IconvGNUTransService(fgMemoryManager); #elif defined (XERCES_USE_TRANSCODER_ICONV) tc = new IconvTransService(fgMemoryManager); #elif defined (XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER) tc = new MacOSUnicodeConverter(fgMemoryManager); #elif defined (XERCES_USE_TRANSCODER_WINDOWS) tc = new Win32TransService(fgMemoryManager); #else #error No Transcoder configured for platform! You must configure it. #endif return tc; } // --------------------------------------------------------------------------- // XMLPlatformUtils: File Methods // --------------------------------------------------------------------------- XMLFileMgr* XMLPlatformUtils::makeFileMgr(MemoryManager* const memmgr) { XMLFileMgr* mgr = NULL; #if XERCES_USE_FILEMGR_POSIX mgr = new (memmgr) PosixFileMgr; #elif XERCES_USE_FILEMGR_WINDOWS mgr = new (memmgr) WindowsFileMgr; #else #error No File Manager configured for platform! You must configure it. #endif return mgr; } FileHandle XMLPlatformUtils::openFile(const char* const fileName , MemoryManager* const memmgr) { if (!fgFileMgr) ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::CPtr_PointerIsZero, memmgr); return fgFileMgr->fileOpen(fileName, false, memmgr); } FileHandle XMLPlatformUtils::openFile(const XMLCh* const fileName, MemoryManager* const memmgr) { if (!fgFileMgr) ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::CPtr_PointerIsZero, memmgr); return fgFileMgr->fileOpen(fileName, false, memmgr); } FileHandle XMLPlatformUtils::openFileToWrite(const char* const fileName , MemoryManager* const memmgr) { if (!fgFileMgr) ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::CPtr_PointerIsZero, memmgr); return fgFileMgr->fileOpen(fileName, true, memmgr); } FileHandle XMLPlatformUtils::openFileToWrite(const XMLCh* const fileName , MemoryManager* const memmgr) { if (!fgFileMgr) ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::CPtr_PointerIsZero, memmgr); return fgFileMgr->fileOpen(fileName, true, memmgr); } FileHandle XMLPlatformUtils::openStdInHandle(MemoryManager* const memmgr) { if (!fgFileMgr) ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::CPtr_PointerIsZero, memmgr); return fgFileMgr->openStdIn(memmgr); } void XMLPlatformUtils::closeFile(FileHandle theFile , MemoryManager* const memmgr) { if (!fgFileMgr) ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::CPtr_PointerIsZero, memmgr); fgFileMgr->fileClose(theFile, memmgr); } void XMLPlatformUtils::resetFile(FileHandle theFile , MemoryManager* const memmgr) { if (!fgFileMgr) ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::CPtr_PointerIsZero, memmgr); fgFileMgr->fileReset(theFile, memmgr); } XMLFilePos XMLPlatformUtils::curFilePos(FileHandle theFile , MemoryManager* const memmgr) { if (!fgFileMgr) ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::CPtr_PointerIsZero, memmgr); return fgFileMgr->curPos(theFile, memmgr); } XMLFilePos XMLPlatformUtils::fileSize(FileHandle theFile , MemoryManager* const memmgr) { if (!fgFileMgr) ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::CPtr_PointerIsZero, memmgr); return fgFileMgr->fileSize(theFile, memmgr); } XMLSize_t XMLPlatformUtils::readFileBuffer( FileHandle theFile , const XMLSize_t toRead , XMLByte* const toFill , MemoryManager* const memmgr) { if (!fgFileMgr) ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::CPtr_PointerIsZero, memmgr); return fgFileMgr->fileRead(theFile, toRead, toFill, memmgr); } void XMLPlatformUtils::writeBufferToFile( const FileHandle theFile , XMLSize_t toWrite , const XMLByte* const toFlush , MemoryManager* const memmgr) { if (!fgFileMgr) ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::CPtr_PointerIsZero, memmgr); fgFileMgr->fileWrite(theFile, toWrite, toFlush, memmgr); } // --------------------------------------------------------------------------- // XMLPlatformUtils: File system methods // --------------------------------------------------------------------------- XMLCh* XMLPlatformUtils::getFullPath(const XMLCh* const srcPath, MemoryManager* const memmgr) { if (!fgFileMgr) ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::CPtr_PointerIsZero, memmgr); return fgFileMgr->getFullPath(srcPath, memmgr); } XMLCh* XMLPlatformUtils::getCurrentDirectory(MemoryManager* const memmgr) { if (!fgFileMgr) ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::CPtr_PointerIsZero, memmgr); return fgFileMgr->getCurrentDirectory(memmgr); } bool XMLPlatformUtils::isRelative(const XMLCh* const toCheck , MemoryManager* const memmgr) { if (!fgFileMgr) ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::CPtr_PointerIsZero, memmgr); return fgFileMgr->isRelative(toCheck, memmgr); } inline bool XMLPlatformUtils::isAnySlash(XMLCh c) { // As far as we know, all supported Xerces // platforms use at least a forward slash // as a path delimiter. So we always check for // that. // // If XERCES_PATH_DELIMITER_BACKSLASH evaluates to true, // we also consider that as a slash. // // XERCES_PATH_DELIMITER_BACKSLASH may be set in config.h // by configure, or elsewhere by platform-specific // code. return ( false || chForwardSlash == c #if XERCES_PATH_DELIMITER_BACKSLASH || chBackSlash == c #endif ); } // --------------------------------------------------------------------------- // XMLPlatformUtils: Timing Methods // --------------------------------------------------------------------------- unsigned long XMLPlatformUtils::getCurrentMillis() { unsigned long ms = 0; // *** TODO: additional platform support? #if HAVE_GETTIMEOFDAY struct timeval aTime; gettimeofday(&aTime, NULL); ms = (unsigned long) (aTime.tv_sec * 1000 + aTime.tv_usec / 1000); #elif HAVE_FTIME timeb aTime; ftime(&aTime); ms = (unsigned long)(aTime.time*1000 + aTime.millitm); #else // Make this a warning instead? #error No timing support is configured for this platform. You must configure it. #endif return ms; } // ----------------------------------------------------------------------- // Mutex methods // ----------------------------------------------------------------------- XMLMutexMgr* XMLPlatformUtils::makeMutexMgr(MemoryManager* const memmgr) { XMLMutexMgr* mgr = NULL; #if XERCES_USE_MUTEXMGR_NOTHREAD mgr = new (memmgr) NoThreadMutexMgr; #elif XERCES_USE_MUTEXMGR_STD mgr = new (memmgr) StdMutexMgr; #elif XERCES_USE_MUTEXMGR_POSIX mgr = new (memmgr) PosixMutexMgr; #elif XERCES_USE_MUTEXMGR_WINDOWS mgr = new (memmgr) WindowsMutexMgr; #else #error No Mutex Manager configured for platform! You must configure it. #endif return mgr; } XMLMutexHandle XMLPlatformUtils::makeMutex(MemoryManager* const memmgr) { if (!fgMutexMgr) XMLPlatformUtils::panic(PanicHandler::Panic_MutexErr); return fgMutexMgr->create(memmgr); } void XMLPlatformUtils::closeMutex(XMLMutexHandle const mtx, MemoryManager* const memmgr) { if (!fgMutexMgr) XMLPlatformUtils::panic(PanicHandler::Panic_MutexErr); fgMutexMgr->destroy(mtx, memmgr); } void XMLPlatformUtils::lockMutex(XMLMutexHandle const mtx) { if (!fgMutexMgr) XMLPlatformUtils::panic(PanicHandler::Panic_MutexErr); fgMutexMgr->lock(mtx); } void XMLPlatformUtils::unlockMutex(XMLMutexHandle const mtx) { if (!fgMutexMgr) XMLPlatformUtils::panic(PanicHandler::Panic_MutexErr); fgMutexMgr->unlock(mtx); } // --------------------------------------------------------------------------- // XMLPlatformUtils: Msg support methods // --------------------------------------------------------------------------- XMLMsgLoader* XMLPlatformUtils::loadMsgSet(const XMLCh* const msgDomain) { // // Ask the platform support to load up the correct type of message // loader for the indicated message set. We don't check here whether it // works or not. That's their decision. // return loadAMsgSet(msgDomain); } // --------------------------------------------------------------------------- // XMLPlatformUtils: NEL Character Handling // --------------------------------------------------------------------------- void XMLPlatformUtils::recognizeNEL(bool state, MemoryManager* const manager) { //Make sure initialize has been called if (gInitFlag == 0) { return; } if (state) { if (!XMLChar1_0::isNELRecognized()) { XMLChar1_0::enableNELWS(); } } else { if (XMLChar1_0::isNELRecognized()) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::NEL_RepeatedCalls, manager); } } } bool XMLPlatformUtils::isNELRecognized() { return XMLChar1_0::isNELRecognized(); } // --------------------------------------------------------------------------- // XMLPlatformUtils: IANA Encoding checking setting // --------------------------------------------------------------------------- void XMLPlatformUtils::strictIANAEncoding(const bool state) { //Make sure initialize has been called if (gInitFlag == 0) { return; } fgTransService->strictIANAEncoding(state); } bool XMLPlatformUtils::isStrictIANAEncoding() { if (gInitFlag) return fgTransService->isStrictIANAEncoding(); return false; } /*** * * Previously, each PlatformUtils.cpp has its onw copy of the * method weavePaths(), and almost of them implemented the same logic, * with few platform specific difference, and unfortunately that * implementation was wrong. * * The only platform specific issue is slash character. * On all platforms other than Windows, chForwardSlash and chBackSlash * are considered slash, while on Windows, two additional characters, * chYenSign and chWonSign are slash as well. * * The idea is to maintain a SINGLE copy of this method rather than * each PlatformUtils.cpp has its own copy, we introduce a new * method, XMLPlatformUtils::isAnySlash(), to replace the direct checking * code ( if ( c == chForwardSlash || c == chBackSlash). * * With this approach, we might have a performance hit since isAnySlash() * is so frequently used in this implementation, so we intend to make it * inline. Then we face a complier issue. * * There are two compilation units involved, one is PlatformUtils.cpp and * the other PlatformUtils.cpp. When PlatformUtils.cp get compiled, * the weavePath(), remove**Slash() have dependency upon isAnySlash() which * is in PlatformUtils.cpp (and what is worse, it is inlined), so we have * undefined/unresolved symbol: isAnySlash() on AIX/xlc_r, Solaris/cc and * Linux/gcc, while MSVC and HP/aCC are fine with this. * * That means we can not place these new methods in PlatformUtils.cpp with * inlined XMLPlatformUtils::isAnySlash() in PlatformUtils.cpp. * * The solution to this is PlatformUtils.cpp will include this file so that * we have only one copy of these methods while get compiled in PlatformUtils * inlined isAnySlash(). * ***/ XMLCh* XMLPlatformUtils::weavePaths(const XMLCh* const basePath , const XMLCh* const relativePath , MemoryManager* const manager) { // Create a buffer as large as both parts and empty it XMLCh* tmpBuf = (XMLCh*) manager->allocate ( (XMLString::stringLen(basePath) + XMLString::stringLen(relativePath) + 2) * sizeof(XMLCh) );//new XMLCh[XMLString::stringLen(basePath) + XMLString::stringLen(relativePath) + 2]; *tmpBuf = 0; // // If we have no base path, then just take the relative path as is. // if ((!basePath) || (!*basePath)) { XMLString::copyString(tmpBuf, relativePath); return tmpBuf; } // // Remove anything after the last slash // const XMLCh* basePtr = basePath + (XMLString::stringLen(basePath) - 1); while ((basePtr >= basePath) && ((isAnySlash(*basePtr) == false))) { basePtr--; } // There is no relevant base path, so just take the relative part if (basePtr < basePath) { XMLString::copyString(tmpBuf, relativePath); return tmpBuf; } // // 1. concatenate the base and relative // 2. remove all occurences of "/./" // 3. remove all occurences of segment/../ where segment is not ../ // XMLString::subString(tmpBuf, basePath, 0, (basePtr - basePath + 1), manager); tmpBuf[basePtr - basePath + 1] = 0; if (relativePath) { XMLString::catString(tmpBuf, relativePath); } removeDotSlash(tmpBuf, manager); removeDotDotSlash(tmpBuf, manager); return tmpBuf; } // // Remove all occurences of './' when it is part of '/./' // // Since it could be '.\' or other combination on windows ( eg, '.'+chYanSign) // we can't make use of patterMatch(). // // void XMLPlatformUtils::removeDotSlash(XMLCh* const path , MemoryManager* const manager) { if ((!path) || (!*path)) return; XMLCh* srcPtr = XMLString::replicate(path, manager); XMLSize_t srcLen = XMLString::stringLen(srcPtr); ArrayJanitor janName(srcPtr, manager); XMLCh* tarPtr = path; while (*srcPtr) { if ( 3 <= srcLen ) { if ( (isAnySlash(*srcPtr)) && (chPeriod == *(srcPtr+1)) && (isAnySlash(*(srcPtr+2))) ) { // "\.\x" seen // skip the first two, and start from the 3rd, // since "\x" could be another "\." srcPtr+=2; srcLen-=2; } else { *tarPtr++ = *srcPtr++; // eat the current char srcLen--; } } else if ( 1 == srcLen ) { *tarPtr++ = *srcPtr++; } else if ( 2 == srcLen) { *tarPtr++ = *srcPtr++; *tarPtr++ = *srcPtr++; } } *tarPtr = 0; return; } // // Remove all occurences of '/segment/../' when segment is not '..' // // Cases with extra /../ is left to the underlying file system. // void XMLPlatformUtils::removeDotDotSlash(XMLCh* const path , MemoryManager* const manager) { XMLSize_t pathLen = XMLString::stringLen(path); XMLCh* tmp1 = (XMLCh*) manager->allocate ( (pathLen+1) * sizeof(XMLCh) );//new XMLCh [pathLen+1]; ArrayJanitor tmp1Name(tmp1, manager); XMLCh* tmp2 = (XMLCh*) manager->allocate ( (pathLen+1) * sizeof(XMLCh) );//new XMLCh [pathLen+1]; ArrayJanitor tmp2Name(tmp2, manager); // remove all "/../" where "" is a complete // path segment not equal to ".." int index = -1; int segIndex = -1; int offset = 1; while ((index = searchSlashDotDotSlash(&(path[offset]))) != -1) { // Undo offset index += offset; // Find start of within substring ending at found point. XMLString::subString(tmp1, path, 0, index-1, manager); segIndex = index - 1; while ((segIndex >= 0) && (!isAnySlash(tmp1[segIndex]))) { segIndex--; } // Ensure exists and != ".." if (segIndex >= 0 && (path[segIndex+1] != chPeriod || path[segIndex+2] != chPeriod || segIndex + 3 != index)) { XMLString::subString(tmp1, path, 0, segIndex, manager); XMLString::subString(tmp2, path, index+3, XMLString::stringLen(path), manager); path[0] = 0; XMLString::catString(path, tmp1); XMLString::catString(path, tmp2); offset = (segIndex == 0 ? 1 : segIndex); } else { offset += 4; } }// while } int XMLPlatformUtils::searchSlashDotDotSlash(XMLCh* const srcPath) { if ((!srcPath) || (!*srcPath)) return -1; XMLCh* srcPtr = srcPath; XMLSize_t srcLen = XMLString::stringLen(srcPath); int retVal = -1; while (*srcPtr) { if ( 4 <= srcLen ) { if ( (isAnySlash(*srcPtr)) && (chPeriod == *(srcPtr+1)) && (chPeriod == *(srcPtr+2)) && (isAnySlash(*(srcPtr+3))) ) { retVal = (int)(srcPtr - srcPath); break; } else { srcPtr++; srcLen--; } } else { break; } } // while return retVal; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/BinFileInputStream.hpp000644 000765 000024 00000007101 13241160336 023456 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BinFileInputStream.hpp 670359 2008-06-22 13:43:45Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_BINFILEINPUTSTREAM_HPP) #define XERCESC_INCLUDE_GUARD_BINFILEINPUTSTREAM_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT BinFileInputStream : public BinInputStream { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- BinFileInputStream ( const XMLCh* const fileName , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); BinFileInputStream ( const char* const fileName , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); BinFileInputStream ( const FileHandle toUse , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~BinFileInputStream(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- bool getIsOpen() const; XMLFilePos getSize() const; void reset(); // ----------------------------------------------------------------------- // Implementation of the input stream interface // ----------------------------------------------------------------------- virtual XMLFilePos curPos() const; virtual XMLSize_t readBytes ( XMLByte* const toFill , const XMLSize_t maxToRead ); virtual const XMLCh* getContentType() const; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- BinFileInputStream(const BinFileInputStream&); BinFileInputStream& operator=(const BinFileInputStream&); // ----------------------------------------------------------------------- // Private data members // // fSource // The source file that we represent. The FileHandle type is defined // per platform. // ----------------------------------------------------------------------- FileHandle fSource; MemoryManager* const fMemoryManager; }; // --------------------------------------------------------------------------- // BinFileInputStream: Getter methods // --------------------------------------------------------------------------- inline bool BinFileInputStream::getIsOpen() const { return (fSource != (FileHandle) XERCES_Invalid_File_Handle); } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/BinInputStream.cpp000644 000765 000024 00000003544 13241160336 022660 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BinInputStream.cpp 1137953 2011-06-21 10:52:28Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // BinInputStream: Virtual destructor! // --------------------------------------------------------------------------- BinInputStream::~BinInputStream() { } // --------------------------------------------------------------------------- // BinInputStream: Hidden Constructors // --------------------------------------------------------------------------- BinInputStream::BinInputStream() { } // --------------------------------------------------------------------------- // BinInputStream: Default implementations // --------------------------------------------------------------------------- const XMLCh* BinInputStream::getEncoding() const { return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLIBM1047Transcoder.cpp000644 000765 000024 00000026577 13241160335 023317 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local const data // // gFromTable // This is the translation table for IBM1047 to Unicode. This // table contains 255 entries. The entry for 1047 byte x is the // Unicode translation of that byte. // // gToTable // gToTableSz // This is the translation table for Unicode to IBM1047. This one // contains a list of records, sorted by the Unicode code point. We do // a binary search to find the Unicode point, and that record's other // field is the IBM1047 code point to translate to. // --------------------------------------------------------------------------- static const XMLCh gFromTable[256] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x009C, 0x0009, 0x0086, 0x007F , 0x0097, 0x008D, 0x008E, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F , 0x0010, 0x0011, 0x0012, 0x0013, 0x009D, 0x000A, 0x0008, 0x0087 , 0x0018, 0x0019, 0x0092, 0x008F, 0x001C, 0x001D, 0x001E, 0x001F , 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x000A, 0x0017, 0x001B , 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x0005, 0x0006, 0x0007 , 0x0090, 0x0091, 0x0016, 0x0093, 0x0094, 0x0095, 0x0096, 0x0004 , 0x0098, 0x0099, 0x009A, 0x009B, 0x0014, 0x0015, 0x009E, 0x001A , 0x0020, 0x00A0, 0x00E2, 0x00E4, 0x00E0, 0x00E1, 0x00E3, 0x00E5 , 0x00E7, 0x00F1, 0x00A2, 0x002E, 0x003C, 0x0028, 0x002B, 0x007C , 0x0026, 0x00E9, 0x00EA, 0x00EB, 0x00E8, 0x00ED, 0x00EE, 0x00EF , 0x00EC, 0x00DF, 0x0021, 0x0024, 0x002A, 0x0029, 0x003B, 0x005E , 0x002D, 0x002F, 0x00C2, 0x00C4, 0x00C0, 0x00C1, 0x00C3, 0x00C5 , 0x00C7, 0x00D1, 0x00A6, 0x002C, 0x0025, 0x005F, 0x003E, 0x003F , 0x00F8, 0x00C9, 0x00CA, 0x00CB, 0x00C8, 0x00CD, 0x00CE, 0x00CF , 0x00CC, 0x0060, 0x003A, 0x0023, 0x0040, 0x0027, 0x003D, 0x0022 , 0x00D8, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067 , 0x0068, 0x0069, 0x00AB, 0x00BB, 0x00F0, 0x00FD, 0x00FE, 0x00B1 , 0x00B0, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070 , 0x0071, 0x0072, 0x00AA, 0x00BA, 0x00E6, 0x00B8, 0x00C6, 0x00A4 , 0x00B5, 0x007E, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078 , 0x0079, 0x007A, 0x00A1, 0x00BF, 0x00D0, 0x005B, 0x00DE, 0x00AE , 0x00AC, 0x00A3, 0x00A5, 0x00B7, 0x00A9, 0x00A7, 0x00B6, 0x00BC , 0x00BD, 0x00BE, 0x00DD, 0x00A8, 0x00AF, 0x005D, 0x00B4, 0x00D7 , 0x007B, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047 , 0x0048, 0x0049, 0x00AD, 0x00F4, 0x00F6, 0x00F2, 0x00F3, 0x00F5 , 0x007D, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050 , 0x0051, 0x0052, 0x00B9, 0x00FB, 0x00FC, 0x00F9, 0x00FA, 0x00FF , 0x005C, 0x00F7, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058 , 0x0059, 0x005A, 0x00B2, 0x00D4, 0x00D6, 0x00D2, 0x00D3, 0x00D5 , 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037 , 0x0038, 0x0039, 0x00B3, 0x00DB, 0x00DC, 0x00D9, 0x00DA, 0x009F }; static const XMLTransService::TransRec gToTable[] = { { 0x0000, 0x00 }, { 0x0001, 0x01 }, { 0x0002, 0x02 }, { 0x0003, 0x03 } , { 0x0004, 0x37 }, { 0x0005, 0x2D }, { 0x0006, 0x2E }, { 0x0007, 0x2F } , { 0x0008, 0x16 }, { 0x0009, 0x05 }, { 0x000A, 0x25 }, { 0x000B, 0x0B } , { 0x000C, 0x0C }, { 0x000D, 0x0D }, { 0x000E, 0x0E }, { 0x000F, 0x0F } , { 0x0010, 0x10 }, { 0x0011, 0x11 }, { 0x0012, 0x12 }, { 0x0013, 0x13 } , { 0x0014, 0x3C }, { 0x0015, 0x3D }, { 0x0016, 0x32 }, { 0x0017, 0x26 } , { 0x0018, 0x18 }, { 0x0019, 0x19 }, { 0x001A, 0x3F }, { 0x001B, 0x27 } , { 0x001C, 0x1C }, { 0x001D, 0x1D }, { 0x001E, 0x1E }, { 0x001F, 0x1F } , { 0x0020, 0x40 }, { 0x0021, 0x5A }, { 0x0022, 0x7F }, { 0x0023, 0x7B } , { 0x0024, 0x5B }, { 0x0025, 0x6C }, { 0x0026, 0x50 }, { 0x0027, 0x7D } , { 0x0028, 0x4D }, { 0x0029, 0x5D }, { 0x002A, 0x5C }, { 0x002B, 0x4E } , { 0x002C, 0x6B }, { 0x002D, 0x60 }, { 0x002E, 0x4B }, { 0x002F, 0x61 } , { 0x0030, 0xF0 }, { 0x0031, 0xF1 }, { 0x0032, 0xF2 }, { 0x0033, 0xF3 } , { 0x0034, 0xF4 }, { 0x0035, 0xF5 }, { 0x0036, 0xF6 }, { 0x0037, 0xF7 } , { 0x0038, 0xF8 }, { 0x0039, 0xF9 }, { 0x003A, 0x7A }, { 0x003B, 0x5E } , { 0x003C, 0x4C }, { 0x003D, 0x7E }, { 0x003E, 0x6E }, { 0x003F, 0x6F } , { 0x0040, 0x7C }, { 0x0041, 0xC1 }, { 0x0042, 0xC2 }, { 0x0043, 0xC3 } , { 0x0044, 0xC4 }, { 0x0045, 0xC5 }, { 0x0046, 0xC6 }, { 0x0047, 0xC7 } , { 0x0048, 0xC8 }, { 0x0049, 0xC9 }, { 0x004A, 0xD1 }, { 0x004B, 0xD2 } , { 0x004C, 0xD3 }, { 0x004D, 0xD4 }, { 0x004E, 0xD5 }, { 0x004F, 0xD6 } , { 0x0050, 0xD7 }, { 0x0051, 0xD8 }, { 0x0052, 0xD9 }, { 0x0053, 0xE2 } , { 0x0054, 0xE3 }, { 0x0055, 0xE4 }, { 0x0056, 0xE5 }, { 0x0057, 0xE6 } , { 0x0058, 0xE7 }, { 0x0059, 0xE8 }, { 0x005A, 0xE9 }, { 0x005B, 0xAD } , { 0x005C, 0xE0 }, { 0x005D, 0xBD }, { 0x005E, 0x5F }, { 0x005F, 0x6D } , { 0x0060, 0x79 }, { 0x0061, 0x81 }, { 0x0062, 0x82 }, { 0x0063, 0x83 } , { 0x0064, 0x84 }, { 0x0065, 0x85 }, { 0x0066, 0x86 }, { 0x0067, 0x87 } , { 0x0068, 0x88 }, { 0x0069, 0x89 }, { 0x006A, 0x91 }, { 0x006B, 0x92 } , { 0x006C, 0x93 }, { 0x006D, 0x94 }, { 0x006E, 0x95 }, { 0x006F, 0x96 } , { 0x0070, 0x97 }, { 0x0071, 0x98 }, { 0x0072, 0x99 }, { 0x0073, 0xA2 } , { 0x0074, 0xA3 }, { 0x0075, 0xA4 }, { 0x0076, 0xA5 }, { 0x0077, 0xA6 } , { 0x0078, 0xA7 }, { 0x0079, 0xA8 }, { 0x007A, 0xA9 }, { 0x007B, 0xC0 } , { 0x007C, 0x4F }, { 0x007D, 0xD0 }, { 0x007E, 0xA1 }, { 0x007F, 0x07 } , { 0x0080, 0x20 }, { 0x0081, 0x21 }, { 0x0082, 0x22 }, { 0x0083, 0x23 } , { 0x0084, 0x24 }, { 0x0085, 0x15 }, { 0x0086, 0x06 }, { 0x0087, 0x17 } , { 0x0088, 0x28 }, { 0x0089, 0x29 }, { 0x008A, 0x2A }, { 0x008B, 0x2B } , { 0x008C, 0x2C }, { 0x008D, 0x09 }, { 0x008E, 0x0A }, { 0x008F, 0x1B } , { 0x0090, 0x30 }, { 0x0091, 0x31 }, { 0x0092, 0x1A }, { 0x0093, 0x33 } , { 0x0094, 0x34 }, { 0x0095, 0x35 }, { 0x0096, 0x36 }, { 0x0097, 0x08 } , { 0x0098, 0x38 }, { 0x0099, 0x39 }, { 0x009A, 0x3A }, { 0x009B, 0x3B } , { 0x009C, 0x04 }, { 0x009D, 0x14 }, { 0x009E, 0x3E }, { 0x009F, 0xFF } , { 0x00A0, 0x41 }, { 0x00A1, 0xAA }, { 0x00A2, 0x4A }, { 0x00A3, 0xB1 } , { 0x00A4, 0x9F }, { 0x00A5, 0xB2 }, { 0x00A6, 0x6A }, { 0x00A7, 0xB5 } , { 0x00A8, 0xBB }, { 0x00A9, 0xB4 }, { 0x00AA, 0x9A }, { 0x00AB, 0x8A } , { 0x00AC, 0xB0 }, { 0x00AD, 0xCA }, { 0x00AE, 0xAF }, { 0x00AF, 0xBC } , { 0x00B0, 0x90 }, { 0x00B1, 0x8F }, { 0x00B2, 0xEA }, { 0x00B3, 0xFA } , { 0x00B4, 0xBE }, { 0x00B5, 0xA0 }, { 0x00B6, 0xB6 }, { 0x00B7, 0xB3 } , { 0x00B8, 0x9D }, { 0x00B9, 0xDA }, { 0x00BA, 0x9B }, { 0x00BB, 0x8B } , { 0x00BC, 0xB7 }, { 0x00BD, 0xB8 }, { 0x00BE, 0xB9 }, { 0x00BF, 0xAB } , { 0x00C0, 0x64 }, { 0x00C1, 0x65 }, { 0x00C2, 0x62 }, { 0x00C3, 0x66 } , { 0x00C4, 0x63 }, { 0x00C5, 0x67 }, { 0x00C6, 0x9E }, { 0x00C7, 0x68 } , { 0x00C8, 0x74 }, { 0x00C9, 0x71 }, { 0x00CA, 0x72 }, { 0x00CB, 0x73 } , { 0x00CC, 0x78 }, { 0x00CD, 0x75 }, { 0x00CE, 0x76 }, { 0x00CF, 0x77 } , { 0x00D0, 0xAC }, { 0x00D1, 0x69 }, { 0x00D2, 0xED }, { 0x00D3, 0xEE } , { 0x00D4, 0xEB }, { 0x00D5, 0xEF }, { 0x00D6, 0xEC }, { 0x00D7, 0xBF } , { 0x00D8, 0x80 }, { 0x00D9, 0xFD }, { 0x00DA, 0xFE }, { 0x00DB, 0xFB } , { 0x00DC, 0xFC }, { 0x00DD, 0xBA }, { 0x00DE, 0xAE }, { 0x00DF, 0x59 } , { 0x00E0, 0x44 }, { 0x00E1, 0x45 }, { 0x00E2, 0x42 }, { 0x00E3, 0x46 } , { 0x00E4, 0x43 }, { 0x00E5, 0x47 }, { 0x00E6, 0x9C }, { 0x00E7, 0x48 } , { 0x00E8, 0x54 }, { 0x00E9, 0x51 }, { 0x00EA, 0x52 }, { 0x00EB, 0x53 } , { 0x00EC, 0x58 }, { 0x00ED, 0x55 }, { 0x00EE, 0x56 }, { 0x00EF, 0x57 } , { 0x00F0, 0x8C }, { 0x00F1, 0x49 }, { 0x00F2, 0xCD }, { 0x00F3, 0xCE } , { 0x00F4, 0xCB }, { 0x00F5, 0xCF }, { 0x00F6, 0xCC }, { 0x00F7, 0xE1 } , { 0x00F8, 0x70 }, { 0x00F9, 0xDD }, { 0x00FA, 0xDE }, { 0x00FB, 0xDB } , { 0x00FC, 0xDC }, { 0x00FD, 0x8D }, { 0x00FE, 0x8E }, { 0x00FF, 0xDF } , { 0x0110, 0xAC }, { 0x203E, 0xBC }, { 0xFF01, 0x5A }, { 0xFF02, 0x7F } , { 0xFF03, 0x7B }, { 0xFF04, 0x5B }, { 0xFF05, 0x6C }, { 0xFF06, 0x50 } , { 0xFF07, 0x7D }, { 0xFF08, 0x4D }, { 0xFF09, 0x5D }, { 0xFF0A, 0x5C } , { 0xFF0B, 0x4E }, { 0xFF0C, 0x6B }, { 0xFF0D, 0x60 }, { 0xFF0E, 0x4B } , { 0xFF0F, 0x61 }, { 0xFF10, 0xF0 }, { 0xFF11, 0xF1 }, { 0xFF12, 0xF2 } , { 0xFF13, 0xF3 }, { 0xFF14, 0xF4 }, { 0xFF15, 0xF5 }, { 0xFF16, 0xF6 } , { 0xFF17, 0xF7 }, { 0xFF18, 0xF8 }, { 0xFF19, 0xF9 }, { 0xFF1A, 0x7A } , { 0xFF1B, 0x5E }, { 0xFF1C, 0x4C }, { 0xFF1D, 0x7E }, { 0xFF1E, 0x6E } , { 0xFF1F, 0x6F }, { 0xFF20, 0x7C }, { 0xFF21, 0xC1 }, { 0xFF22, 0xC2 } , { 0xFF23, 0xC3 }, { 0xFF24, 0xC4 }, { 0xFF25, 0xC5 }, { 0xFF26, 0xC6 } , { 0xFF27, 0xC7 }, { 0xFF28, 0xC8 }, { 0xFF29, 0xC9 }, { 0xFF2A, 0xD1 } , { 0xFF2B, 0xD2 }, { 0xFF2C, 0xD3 }, { 0xFF2D, 0xD4 }, { 0xFF2E, 0xD5 } , { 0xFF2F, 0xD6 }, { 0xFF30, 0xD7 }, { 0xFF31, 0xD8 }, { 0xFF32, 0xD9 } , { 0xFF33, 0xE2 }, { 0xFF34, 0xE3 }, { 0xFF35, 0xE4 }, { 0xFF36, 0xE5 } , { 0xFF37, 0xE6 }, { 0xFF38, 0xE7 }, { 0xFF39, 0xE8 }, { 0xFF3A, 0xE9 } , { 0xFF3B, 0xAD }, { 0xFF3C, 0xE0 }, { 0xFF3D, 0xBD }, { 0xFF3E, 0x5F } , { 0xFF3F, 0x6D }, { 0xFF40, 0x79 }, { 0xFF41, 0x81 }, { 0xFF42, 0x82 } , { 0xFF43, 0x83 }, { 0xFF44, 0x84 }, { 0xFF45, 0x85 }, { 0xFF46, 0x86 } , { 0xFF47, 0x87 }, { 0xFF48, 0x88 }, { 0xFF49, 0x89 }, { 0xFF4A, 0x91 } , { 0xFF4B, 0x92 }, { 0xFF4C, 0x93 }, { 0xFF4D, 0x94 }, { 0xFF4E, 0x95 } , { 0xFF4F, 0x96 }, { 0xFF50, 0x97 }, { 0xFF51, 0x98 }, { 0xFF52, 0x99 } , { 0xFF53, 0xA2 }, { 0xFF54, 0xA3 }, { 0xFF55, 0xA4 }, { 0xFF56, 0xA5 } , { 0xFF57, 0xA6 }, { 0xFF58, 0xA7 }, { 0xFF59, 0xA8 }, { 0xFF5A, 0xA9 } , { 0xFF5B, 0xC0 }, { 0xFF5C, 0x4F }, { 0xFF5D, 0xD0 }, { 0xFF5E, 0xA1 } }; static const XMLSize_t gToTableSz = sizeof(gToTable)/sizeof(gToTable[0]); // --------------------------------------------------------------------------- // XMLIBM1047Transcoder: Public, static methods // --------------------------------------------------------------------------- XMLCh XMLIBM1047Transcoder::xlatThisOne(const XMLByte toXlat) { return gFromTable[toXlat]; } // --------------------------------------------------------------------------- // XMLIBM1047Transcoder: Constructors and Destructor // --------------------------------------------------------------------------- XMLIBM1047Transcoder::XMLIBM1047Transcoder(const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager) : XML256TableTranscoder ( encodingName , blockSize , gFromTable , gToTable , gToTableSz , manager ) { } XMLIBM1047Transcoder::~XMLIBM1047Transcoder() { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/DefaultPanicHandler.cpp000644 000765 000024 00000002525 13241160335 023606 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DefaultPanicHandler.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN void DefaultPanicHandler::panic(const PanicHandler::PanicReasons reason) { fprintf(stderr, "%s\n", PanicHandler::getPanicReasonString(reason)); exit(-1); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLChar.cpp000644 000765 000024 00003205512 13241160336 021214 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLChar.cpp 1517488 2013-08-26 10:33:26Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLChar1_0: static data initialization // --------------------------------------------------------------------------- bool XMLChar1_0::enableNEL = false; // --------------------------------------------------------------------------- // XMLChar1_0: Public, static methods // --------------------------------------------------------------------------- // Checks whether all of the chars in the passed buffer are whitespace or // not. Breaks out on the first non-whitespace. // bool XMLChar1_0::isAllSpaces(const XMLCh* const toCheck , const XMLSize_t count) { if (count == 0) return false; const XMLCh* curCh = toCheck; const XMLCh* endPtr = toCheck + count; while (curCh < endPtr) { if (!(fgCharCharsTable1_0[*curCh++] & gWhitespaceCharMask)) return false; } return true; } // // Checks whether at least one of the chars in the passed buffer are whitespace or // not. // bool XMLChar1_0::containsWhiteSpace(const XMLCh* const toCheck , const XMLSize_t count) { if (count == 0) return false; const XMLCh* curCh = toCheck; const XMLCh* endPtr = toCheck + count; while (curCh < endPtr) { if (fgCharCharsTable1_0[*curCh++] & gWhitespaceCharMask) return true; } return false; } bool XMLChar1_0::isValidNCName(const XMLCh* const toCheck , const XMLSize_t count) { if (count == 0) return false; const XMLCh* curCh = toCheck; const XMLCh* endPtr = toCheck + count; if (*curCh== chColon || !(fgCharCharsTable1_0[*curCh++] & gFirstNameCharMask)) return false; while (curCh < endPtr) { if (!(fgCharCharsTable1_0[*curCh++] & gNCNameCharMask)) return false; } return true; } bool XMLChar1_0::isValidNmtoken(const XMLCh* const toCheck , const XMLSize_t count) { if (count == 0) return false; const XMLCh* curCh = toCheck; const XMLCh* endPtr = toCheck + count; while (curCh < endPtr) { if (!(fgCharCharsTable1_0[*curCh++] & gNameCharMask)) return false; } return true; } bool XMLChar1_0::isValidName(const XMLCh* const toCheck , const XMLSize_t count) { if (count == 0) return false; const XMLCh* curCh = toCheck; const XMLCh* endPtr = toCheck + count; if (!(fgCharCharsTable1_0[*curCh++] & gFirstNameCharMask)) return false; while (curCh < endPtr) { if (!(fgCharCharsTable1_0[*curCh++] & gNameCharMask)) return false; } return true; } bool XMLChar1_0::isValidName(const XMLCh* const toCheck) { const XMLCh* curCh = toCheck; if ((fgCharCharsTable1_0[*curCh++] & gFirstNameCharMask)) { while ((fgCharCharsTable1_0[*curCh] & gNameCharMask)) { curCh++; } if (*curCh == 0) { return true; } } return false; } /** * isValidQName * * [6] QName ::= (Prefix ':')? LocalPart * [7] Prefix ::= NCName * [8] LocalPart ::= NCName * */ bool XMLChar1_0::isValidQName(const XMLCh* const toCheck , const XMLSize_t count) { if (count == 0) return false; XMLSize_t colonPos=0; // don't use XMLString::indexOf, we must stop after 'count' chars while(colonPos= 0xD800) && (nextCh <= 0xDB7F)) { nextCh = *curCh++; if ((nextCh < 0xDC00) || (nextCh > 0xDFFF)) return false; } else if (nextCh== chColon || !(fgCharCharsTable1_1[nextCh] & gFirstNameCharMask)) return false; bool gotLeadingSurrogate = false; while (curCh < endPtr) { nextCh = *curCh++; // Deal with surrogate pairs if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { // It's a leading surrogate. If we already got one, then // issue an error, else set leading flag to make sure that // we look for a trailing next time. if (nextCh > 0xDB7F || gotLeadingSurrogate) { return false; } else gotLeadingSurrogate = true; } else { // If it's a trailing surrogate, make sure that we are // prepared for that. Else, it's just a regular char so make // sure that we were not expected a trailing surrogate. if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) { // It's trailing, so make sure we were expecting it if (!gotLeadingSurrogate) return false; } else { // It's just a char, so make sure we were not expecting a // trailing surrogate. if (gotLeadingSurrogate) { return false; } // It's got to at least be a valid XML character else if (!(fgCharCharsTable1_1[nextCh] & gNCNameCharMask)) { return false; } } gotLeadingSurrogate = false; } } return true; } bool XMLChar1_1::isValidNmtoken(const XMLCh* const toCheck , const XMLSize_t count) { if (count == 0) return false; const XMLCh* curCh = toCheck; const XMLCh* endPtr = toCheck + count; XMLCh nextCh; bool gotLeadingSurrogate = false; while (curCh < endPtr) { nextCh = *curCh++; // Deal with surrogate pairs if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { // It's a leading surrogate. If we already got one, then // issue an error, else set leading flag to make sure that // we look for a trailing next time. if (nextCh > 0xDB7F || gotLeadingSurrogate) { return false; } else gotLeadingSurrogate = true; } else { // If it's a trailing surrogate, make sure that we are // prepared for that. Else, it's just a regular char so make // sure that we were not expected a trailing surrogate. if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) { // It's trailing, so make sure we were expecting it if (!gotLeadingSurrogate) return false; } else { // It's just a char, so make sure we were not expecting a // trailing surrogate. if (gotLeadingSurrogate) { return false; } // It's got to at least be a valid XML character else if (!(fgCharCharsTable1_1[nextCh] & gNameCharMask)) { return false; } } gotLeadingSurrogate = false; } } return true; } bool XMLChar1_1::isValidName(const XMLCh* const toCheck , const XMLSize_t count) { if (count == 0) return false; const XMLCh* curCh = toCheck; const XMLCh* endPtr = toCheck + count; XMLCh nextCh = *curCh++; if ((nextCh >= 0xD800) && (nextCh <= 0xDB7F)) { nextCh = *curCh++; if ((nextCh < 0xDC00) || (nextCh > 0xDFFF)) return false; } else if (!(fgCharCharsTable1_1[nextCh] & gFirstNameCharMask)) return false; bool gotLeadingSurrogate = false; while (curCh < endPtr) { nextCh = *curCh++; // Deal with surrogate pairs if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { // It's a leading surrogate. If we already got one, then // issue an error, else set leading flag to make sure that // we look for a trailing next time. if (nextCh > 0xDB7F || gotLeadingSurrogate) { return false; } else gotLeadingSurrogate = true; } else { // If it's a trailing surrogate, make sure that we are // prepared for that. Else, it's just a regular char so make // sure that we were not expected a trailing surrogate. if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) { // It's trailing, so make sure we were expecting it if (!gotLeadingSurrogate) return false; } else { // It's just a char, so make sure we were not expecting a // trailing surrogate. if (gotLeadingSurrogate) { return false; } // It's got to at least be a valid XML character else if (!(fgCharCharsTable1_1[nextCh] & gNameCharMask)) { return false; } } gotLeadingSurrogate = false; } } return true; } bool XMLChar1_1::isValidName(const XMLCh* const toCheck) { const XMLCh* curCh = toCheck; XMLCh nextCh = *curCh++; if ((nextCh >= 0xD800) && (nextCh <= 0xDB7F)) { nextCh = *curCh++; if ((nextCh < 0xDC00) || (nextCh > 0xDFFF)) { return false; } } else if (!(fgCharCharsTable1_1[nextCh] & gFirstNameCharMask)) { return false; } bool gotLeadingSurrogate = false; while (*curCh != 0) { nextCh = *curCh++; // Deal with surrogate pairs if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF)) { // It's a leading surrogate. If we already got one, then // issue an error, else set leading flag to make sure that // we look for a trailing next time. if (nextCh > 0xDB7F || gotLeadingSurrogate) { return false; } else { gotLeadingSurrogate = true; } } else { // If it's a trailing surrogate, make sure that we are // prepared for that. Else, it's just a regular char so make // sure that we were not expected a trailing surrogate. if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF)) { // It's trailing, so make sure we were expecting it if (!gotLeadingSurrogate) return false; } else { // It's just a char, so make sure we were not expecting a // trailing surrogate. if (gotLeadingSurrogate) { return false; } // It's got to at least be a valid XML character else if (!(fgCharCharsTable1_1[nextCh] & gNameCharMask)) { return false; } } gotLeadingSurrogate = false; } } return true; } /** * isValidQName * * [6] QName ::= (Prefix ':')? LocalPart * [7] Prefix ::= NCName * [8] LocalPart ::= NCName * */ bool XMLChar1_1::isValidQName(const XMLCh* const toCheck , const XMLSize_t count) { if (count == 0) return false; XMLSize_t length = count; int colonPos = XMLString::indexOf(toCheck, chColon); if ((colonPos == 0) || // ":abcd" (colonPos == ((int)length)-1)) // "abcd:" return false; // // prefix // if (colonPos != -1) { if (isValidNCName(toCheck, colonPos) == false) return false; } // // LocalPart // return isValidNCName(toCheck+colonPos+1, length-colonPos-1); } // // This one is not called terribly often, so it's done manually in order // give up more bits in the character characteristics table for more often // used characteristics. // bool XMLChar1_1::isPublicIdChar(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) { const XMLCh* curTable = gPublicIdChars; // Check the ranges while (*curTable) { // // If the test char is less than the low range, then it's never // going to match any other range, so break out. But we have to // run up to the range terminator first. // if (toCheck < *curTable++) { while (*curTable++) { // Purposefully empty, we are just running up the pointer } break; } // If it's less than or equal to the top of the range, then a match if (toCheck <= *curTable++) return true; } // And now test against singles while (*curTable) { if (toCheck == *curTable++) return true; } return false; } return false; } XMLByte XMLChar1_1::fgCharCharsTable1_1[0x10000] = { 0x10, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0xF8, 0xF0, 0x20, 0x20, 0xF0, 0x20, 0x20 , 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 , 0xD8, 0x48, 0x58, 0x48, 0x48, 0x48, 0x40, 0x58, 0x48, 0x48, 0x48, 0x48, 0x48, 0x4D, 0x4D, 0x58 , 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4E, 0x48, 0x50, 0x48, 0x58, 0x48 , 0x48, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x48, 0x48, 0x40, 0x48, 0x4F , 0x48, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x48, 0x48, 0x48, 0x48, 0x20 , 0x20, 0x20, 0x20, 0x20, 0x20, 0xF0, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 , 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x4D, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x48, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x48, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D , 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D , 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D , 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D , 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D , 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D , 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x48, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x4F, 0x4F, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0xD0, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x4D , 0x4D, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F , 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x4F, 0x00, 0x00 }; // --------------------------------------------------------------------------- // Conditional methods for building the table // --------------------------------------------------------------------------- // // This code will set up the character flags table. It's defined out since // this table is now written out and hard coded (at the bottom of this // file) into the code itself. This code is retained in case there is // any need to recreate it later. // #if defined(NEED_TO_GEN_TABLE) #include static XMLCh gTmpCharTable[0xFFFF]; static void initOneTable(const XMLCh* const theTable , const XMLByte theMask) { const XMLCh* pchCur = theTable; // Do the ranges first while (*pchCur) { XMLCh chIndex; const XMLCh chLow = *pchCur++; const XMLCh chHigh = *pchCur++; for (chIndex = chLow; chIndex <= chHigh; chIndex++) gTmpCharTable[chIndex] |= theMask; } // Skip the range terminator pchCur++; // And then the singles until we hit its terminator while (*pchCur) gTmpCharTable[*pchCur++] |= theMask; } static void initCharFlagTable() { memset(gTmpCharTable, 0, sizeof(gTmpCharTable)); // Do the init for each table. Do the non-special case ones first initOneTable(gXMLChars, gXMLCharMask); initOneTable(gWhitespaceChars, gWhitespaceCharMask); // // Then do the Name table // initOneTable(gNameChars, gNameCharMask); // // Then do the NCName table as Name minus colon // initOneTable(gNameChars, gNCNameCharMask); gTmpCharTable[chColon] &= ~gNCNameCharMask; // // Then do the first name char // initOneTable(gFirstNameChars, gFirstNameCharMask); // // And now do the very special case ones. These are bits that are // designed to sense special case characters in the most important // processing loops of the parser. They allow us to do a quick // check for a special case and get to the common case with minimal // overhead when it's not. Since the special case chars are a tiny // fraction of the chars, this is a good optimization. // // We do the special chars for the start tag processing, which // needs to look for things that indicate the end of the tag, quote // chars, etc... // gTmpCharTable[chNull] |= gSpecialStartTagCharMask; gTmpCharTable[chForwardSlash] |= gSpecialStartTagCharMask; gTmpCharTable[chCloseAngle] |= gSpecialStartTagCharMask; gTmpCharTable[chOpenAngle] |= gSpecialStartTagCharMask; gTmpCharTable[chSingleQuote] |= gSpecialStartTagCharMask; gTmpCharTable[chDoubleQuote] |= gSpecialStartTagCharMask; initOneTable(gWhitespaceChars, gSpecialStartTagCharMask); // // And finally do the plain content characters. // These are all content characters that require NO special // handling. Exclude CR, LF, <, & and ], all of which either // are markup or require some sort of special case handling. // initOneTable(gXMLChars, gPlainContentCharMask); gTmpCharTable[chCR] &= ~gPlainContentCharMask; gTmpCharTable[chLF] &= ~gPlainContentCharMask; gTmpCharTable[chOpenAngle] &= ~gPlainContentCharMask; gTmpCharTable[chAmpersand] &= ~gPlainContentCharMask; gTmpCharTable[chCloseSquare] &= ~gPlainContentCharMask; // // Write it out to a temp file to be read back into this source later. // FILE* outFl = fopen("table.out", "wt+"); fprintf(outFl, "XMLByte XMLChar1_0::fgCharCharsTable1_0[0x10000] =\n{"); for (unsigned int index = 0; index <= 0xFFFF; index += 16) { fprintf(outFl , " , 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X\n" , (unsigned int)gTmpCharTable[index] , (unsigned int)gTmpCharTable[index+1] , (unsigned int)gTmpCharTable[index+2] , (unsigned int)gTmpCharTable[index+3] , (unsigned int)gTmpCharTable[index+4] , (unsigned int)gTmpCharTable[index+5] , (unsigned int)gTmpCharTable[index+6] , (unsigned int)gTmpCharTable[index+7] , (unsigned int)gTmpCharTable[index+8] , (unsigned int)gTmpCharTable[index+9] , (unsigned int)gTmpCharTable[index+10] , (unsigned int)gTmpCharTable[index+11] , (unsigned int)gTmpCharTable[index+12] , (unsigned int)gTmpCharTable[index+13] , (unsigned int)gTmpCharTable[index+14] , (unsigned int)gTmpCharTable[index+15]); } fprintf(outFl, "};\n"); fclose(outFl); } static void initCharFlagTable1_1() { memset(gTmpCharTable, 0, sizeof(gTmpCharTable)); // Do the init for each table. Do the non-special case ones first initOneTable(gXMLChars1_1, gXMLCharMask); initOneTable(gWhitespaceChars1_1, gWhitespaceCharMask); // // Then do the Name table // initOneTable(gNameChars, gNameCharMask); // // Then do the NCName table as Name minus colon // initOneTable(gNameChars, gNCNameCharMask); gTmpCharTable[chColon] &= ~gNCNameCharMask; // // Then do the first name char // initOneTable(gFirstNameChars, gFirstNameCharMask); // // Control characters is treated differently in XML 1.1 // initOneTable(gControl_Chars1_1, gControlCharMask); // // And now do the very special case ones. These are bits that are // designed to sense special case characters in the most important // processing loops of the parser. They allow us to do a quick // check for a special case and get to the common case with minimal // overhead when it's not. Since the special case chars are a tiny // fraction of the chars, this is a good optimization. // // We do the special chars for the start tag processing, which // needs to look for things that indicate the end of the tag, quote // chars, etc... // gTmpCharTable[chNull] |= gSpecialStartTagCharMask; gTmpCharTable[chForwardSlash] |= gSpecialStartTagCharMask; gTmpCharTable[chCloseAngle] |= gSpecialStartTagCharMask; gTmpCharTable[chOpenAngle] |= gSpecialStartTagCharMask; gTmpCharTable[chSingleQuote] |= gSpecialStartTagCharMask; gTmpCharTable[chDoubleQuote] |= gSpecialStartTagCharMask; initOneTable(gWhitespaceChars1_1, gSpecialStartTagCharMask); // // And finally do the plain content characters. // These are all content characters that require NO special // handling. Exclude CR, LF, <, & and ], all of which either // are markup or require some sort of special case handling. // initOneTable(gXMLChars1_1, gPlainContentCharMask); gTmpCharTable[chCR] &= ~gPlainContentCharMask; gTmpCharTable[chLF] &= ~gPlainContentCharMask; gTmpCharTable[chOpenAngle] &= ~gPlainContentCharMask; gTmpCharTable[chAmpersand] &= ~gPlainContentCharMask; gTmpCharTable[chCloseSquare] &= ~gPlainContentCharMask; gTmpCharTable[chLineSeparator] &= ~gPlainContentCharMask; gTmpCharTable[chNEL] &= ~gPlainContentCharMask; // // Write it out to a temp file to be read back into this source later. // FILE* outFl = fopen("table1_1.out", "wt+"); fprintf(outFl, "XMLByte XMLChar1_1::fgCharCharsTable1_1[0x10000] =\n{"); for (unsigned int index = 0; index <= 0xFFFF; index += 16) { fprintf(outFl , " , 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X\n" , (unsigned int)gTmpCharTable[index] , (unsigned int)gTmpCharTable[index+1] , (unsigned int)gTmpCharTable[index+2] , (unsigned int)gTmpCharTable[index+3] , (unsigned int)gTmpCharTable[index+4] , (unsigned int)gTmpCharTable[index+5] , (unsigned int)gTmpCharTable[index+6] , (unsigned int)gTmpCharTable[index+7] , (unsigned int)gTmpCharTable[index+8] , (unsigned int)gTmpCharTable[index+9] , (unsigned int)gTmpCharTable[index+10] , (unsigned int)gTmpCharTable[index+11] , (unsigned int)gTmpCharTable[index+12] , (unsigned int)gTmpCharTable[index+13] , (unsigned int)gTmpCharTable[index+14] , (unsigned int)gTmpCharTable[index+15]); } fprintf(outFl, "};\n"); fclose(outFl); } class CharFlagKicker { public : CharFlagKicker() { initCharFlagTable(); initCharFlagTable1_1(); } private: // ----------------------------------------------------------------------- // Unimplemented methods. // ----------------------------------------------------------------------- CharFlagKicker(const CharFlagKicker&); CharFlagKicker& operator=(const CharFlagKicker&); }; static CharFlagKicker gKicker; #endif XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/NumberFormatException.hpp000644 000765 000024 00000002265 13241160336 024240 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: NumberFormatException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_NUMBERFORMATEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_NUMBERFORMATEXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(NumberFormatException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/KeyValuePair.hpp000644 000765 000024 00000005267 13241160336 022326 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: KeyValuePair.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_KEYVALUEPAIR_HPP) #define XERCESC_INCLUDE_GUARD_KEYVALUEPAIR_HPP #include XERCES_CPP_NAMESPACE_BEGIN template class KeyValuePair : public XMemory { public : // ------------------------------------------------------------------- // Constructors and Destructor // ------------------------------------------------------------------- KeyValuePair(); KeyValuePair(const TKey& key, const TValue& value); KeyValuePair(const KeyValuePair& toCopy); ~KeyValuePair(); // ------------------------------------------------------------------- // Getters // ------------------------------------------------------------------- const TKey& getKey() const; TKey& getKey(); const TValue& getValue() const; TValue& getValue(); // ------------------------------------------------------------------- // Setters // ------------------------------------------------------------------- TKey& setKey(const TKey& newKey); TValue& setValue(const TValue& newValue); private : // unimplemented: KeyValuePair& operator=(const KeyValuePair&); // ------------------------------------------------------------------- // Private data members // // fKey // The object that represents the key of the pair // // fValue // The object that represents the value of the pair // ------------------------------------------------------------------- TKey fKey; TValue fValue; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/KVStringPair.hpp000644 000765 000024 00000015434 13241160336 022305 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: KVStringPair.hpp 554580 2007-07-09 09:09:51Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_KVSTRINGPAIR_HPP) #define XERCESC_INCLUDE_GUARD_KVSTRINGPAIR_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN // // This class provides a commonly used data structure, which is that of // a pair of strings which represent a 'key=value' type mapping. It works // only in terms of XMLCh type raw strings. // class XMLUTIL_EXPORT KVStringPair : public XSerializable, public XMemory { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- KVStringPair(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); KVStringPair ( const XMLCh* const key , const XMLCh* const value , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); KVStringPair ( const XMLCh* const key , const XMLCh* const value , const XMLSize_t valueLength , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); KVStringPair ( const XMLCh* const key , const XMLSize_t keyLength , const XMLCh* const value , const XMLSize_t valueLength , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); KVStringPair(const KVStringPair& toCopy); ~KVStringPair(); // ----------------------------------------------------------------------- // Getters // // We support the // ----------------------------------------------------------------------- const XMLCh* getKey() const; XMLCh* getKey(); const XMLCh* getValue() const; XMLCh* getValue(); // ----------------------------------------------------------------------- // Setters // ----------------------------------------------------------------------- void setKey(const XMLCh* const newKey); void setValue(const XMLCh* const newValue); void setKey ( const XMLCh* const newKey , const XMLSize_t newKeyLength ); void setValue ( const XMLCh* const newValue , const XMLSize_t newValueLength ); void set ( const XMLCh* const newKey , const XMLCh* const newValue ); void set ( const XMLCh* const newKey , const XMLSize_t newKeyLength , const XMLCh* const newValue , const XMLSize_t newValueLength ); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(KVStringPair) private : // unimplemented: KVStringPair& operator=(const KVStringPair&); // ----------------------------------------------------------------------- // Private data members // // fKey // The string that represents the key field of this object. // // fKeyAllocSize // The amount of memory allocated for fKey. // // fValue // The string that represents the value of this pair object. // // fValueAllocSize // The amount of memory allocated for fValue. // // ----------------------------------------------------------------------- XMLSize_t fKeyAllocSize; XMLSize_t fValueAllocSize; XMLCh* fKey; XMLCh* fValue; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // KVStringPair: Getters // --------------------------------------------------------------------------- inline const XMLCh* KVStringPair::getKey() const { return fKey; } inline XMLCh* KVStringPair::getKey() { return fKey; } inline const XMLCh* KVStringPair::getValue() const { return fValue; } inline XMLCh* KVStringPair::getValue() { return fValue; } // --------------------------------------------------------------------------- // KVStringPair: Setters // --------------------------------------------------------------------------- inline void KVStringPair::setKey(const XMLCh* const newKey) { setKey(newKey, XMLString::stringLen(newKey)); } inline void KVStringPair::setValue(const XMLCh* const newValue) { setValue(newValue, XMLString::stringLen(newValue)); } inline void KVStringPair::setKey( const XMLCh* const newKey , const XMLSize_t newKeyLength) { if (newKeyLength >= fKeyAllocSize) { fMemoryManager->deallocate(fKey); //delete [] fKey; fKey = 0; fKeyAllocSize = newKeyLength + 1; fKey = (XMLCh*) fMemoryManager->allocate(fKeyAllocSize * sizeof(XMLCh)); //new XMLCh[fKeyAllocSize]; } memcpy(fKey, newKey, (newKeyLength+1) * sizeof(XMLCh)); // len+1 because of the 0 at the end } inline void KVStringPair::setValue( const XMLCh* const newValue , const XMLSize_t newValueLength) { if (newValueLength >= fValueAllocSize) { fMemoryManager->deallocate(fValue); //delete [] fValue; fValue = 0; fValueAllocSize = newValueLength + 1; fValue = (XMLCh*) fMemoryManager->allocate(fValueAllocSize * sizeof(XMLCh)); //new XMLCh[fValueAllocSize]; } memcpy(fValue, newValue, (newValueLength+1) * sizeof(XMLCh)); // len+1 because of the 0 at the end } inline void KVStringPair::set( const XMLCh* const newKey , const XMLCh* const newValue) { setKey(newKey, XMLString::stringLen(newKey)); setValue(newValue, XMLString::stringLen(newValue)); } inline void KVStringPair::set( const XMLCh* const newKey , const XMLSize_t newKeyLength , const XMLCh* const newValue , const XMLSize_t newValueLength) { setKey(newKey, newKeyLength); setValue(newValue, newValueLength); } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/RefArrayOf.c000644 000765 000024 00000017561 13241160336 021420 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: RefArrayOf.c 932889 2010-04-11 13:10:10Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // RefArrayOf: Constructors and Destructor // --------------------------------------------------------------------------- template RefArrayOf::RefArrayOf(const XMLSize_t size, MemoryManager* const manager) : fSize(size) , fArray(0) , fMemoryManager(manager) { fArray = (TElem**) fMemoryManager->allocate(fSize * sizeof(TElem*));//new TElem*[fSize]; for (XMLSize_t index = 0; index < fSize; index++) fArray[index] = 0; } template RefArrayOf::RefArrayOf(TElem* values[], const XMLSize_t size, MemoryManager* const manager) : fSize(size) , fArray(0) , fMemoryManager(manager) { fArray = (TElem**) fMemoryManager->allocate(fSize * sizeof(TElem*));//new TElem*[fSize]; for (XMLSize_t index = 0; index < fSize; index++) fArray[index] = values[index]; } template RefArrayOf:: RefArrayOf(const RefArrayOf& source) : fSize(source.fSize) , fArray(0) , fMemoryManager(source.fMemoryManager) { fArray = (TElem**) fMemoryManager->allocate(fSize * sizeof(TElem*));//new TElem*[fSize]; for (XMLSize_t index = 0; index < fSize; index++) fArray[index] = source.fArray[index]; } template RefArrayOf::~RefArrayOf() { fMemoryManager->deallocate(fArray);//delete [] fArray; } // --------------------------------------------------------------------------- // RefArrayOf: Public operators // --------------------------------------------------------------------------- template TElem*& RefArrayOf:: operator[](const XMLSize_t index) { if (index >= fSize) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Array_BadIndex, fMemoryManager); return fArray[index]; } template const TElem* RefArrayOf:: operator[](const XMLSize_t index) const { if (index >= fSize) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Array_BadIndex, fMemoryManager); return fArray[index]; } template RefArrayOf& RefArrayOf:: operator=(const RefArrayOf& toAssign) { if (this == &toAssign) return *this; // Reallocate if not the same size if (toAssign.fSize != fSize) { fMemoryManager->deallocate(fArray);//delete [] fArray; fSize = toAssign.fSize; fArray = (TElem**) fMemoryManager->allocate(fSize * sizeof(TElem*));//new TElem*[fSize]; } // Copy over the source elements for (XMLSize_t index = 0; index < fSize; index++) fArray[index] = toAssign.fArray[index]; return *this; } template bool RefArrayOf:: operator==(const RefArrayOf& toCompare) const { if (this == &toCompare) return true; if (fSize != toCompare.fSize) return false; for (XMLSize_t index = 0; index < fSize; index++) { if (fArray[index] != toCompare.fArray[index]) return false; } return true; } template bool RefArrayOf:: operator!=(const RefArrayOf& toCompare) const { return !operator==(toCompare); } // --------------------------------------------------------------------------- // RefArrayOf: Copy operations // --------------------------------------------------------------------------- template XMLSize_t RefArrayOf:: copyFrom(const RefArrayOf& srcArray) { // // Copy over as many of the source elements as will fit into // this array. // const XMLSize_t count = fSize < srcArray.fSize ? fSize : srcArray.fSize; for (XMLSize_t index = 0; index < fSize; index++) fArray[index] = srcArray.fArray[index]; return count; } // --------------------------------------------------------------------------- // RefArrayOf: Getter methods // --------------------------------------------------------------------------- template XMLSize_t RefArrayOf::length() const { return fSize; } template TElem** RefArrayOf::rawData() const { return fArray; } // --------------------------------------------------------------------------- // RefArrayOf: Element management methods // --------------------------------------------------------------------------- template void RefArrayOf::deleteAt(const XMLSize_t index) { if (index >= fSize) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Array_BadIndex, fMemoryManager); delete fArray[index]; fArray[index] = 0; } template void RefArrayOf::deleteAllElements() { for (XMLSize_t index = 0; index < fSize; index++) { delete fArray[index]; fArray[index] = 0; } } template void RefArrayOf::resize(const XMLSize_t newSize) { if (newSize == fSize) return; if (newSize < fSize) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Array_BadNewSize, fMemoryManager); // Allocate the new array TElem** newArray = (TElem**) fMemoryManager->allocate ( newSize * sizeof(TElem*) );//new TElem*[newSize]; // Copy the existing values XMLSize_t index = 0; for (; index < fSize; index++) newArray[index] = fArray[index]; for (; index < newSize; index++) newArray[index] = 0; // Delete the old array and update our members fMemoryManager->deallocate(fArray);//delete [] fArray; fArray = newArray; fSize = newSize; } // --------------------------------------------------------------------------- // RefArrayEnumerator: Constructors and Destructor // --------------------------------------------------------------------------- template RefArrayEnumerator:: RefArrayEnumerator( RefArrayOf* const toEnum , const bool adopt) : fAdopted(adopt) , fCurIndex(0) , fToEnum(toEnum) { } template RefArrayEnumerator::~RefArrayEnumerator() { if (fAdopted) delete fToEnum; } // --------------------------------------------------------------------------- // RefArrayEnumerator: Enum interface // --------------------------------------------------------------------------- template bool RefArrayEnumerator::hasMoreElements() const { if (fCurIndex >= fToEnum->length()) return false; return true; } template TElem& RefArrayEnumerator::nextElement() { return *(*fToEnum)[fCurIndex++]; } template void RefArrayEnumerator::Reset() { fCurIndex = 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLInitializer.hpp000644 000765 000024 00000010566 13241160336 022627 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLInitializer.hpp 1329252 2012-04-23 14:24:41Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLINITIALIZER_HPP) #define XERCESC_INCLUDE_GUARD_XMLINITIALIZER_HPP #include XERCES_CPP_NAMESPACE_BEGIN /** * Utilities that must be implemented in a class-specific way. * * This class contains methods that must be implemented by different * classes that have static data (class or local) that they need * to initialize when XMLPlatformUtils::Initialize is invoked. */ class XMLUTIL_EXPORT XMLInitializer { protected : /** @name Initialization methods */ //@{ /** Perform per-class allocationa and initialization of static data * * These functions should be called from XMLPlatformUtils::Initialize. */ static void initializeTransService(); static void initializeStaticData(); /** Perform per-class release of static data * * These functions should be called from XMLPlatformUtils::Terminate. */ static void terminateStaticData(); static void terminateTransService(); //@} friend class XMLPlatformUtils; private : XMLInitializer(); XMLInitializer(const XMLInitializer& toCopy); XMLInitializer& operator=(const XMLInitializer&); private: // Note: The name of each function should be in the form // initialize. // // Note: In some cases order of initialization is important. // // // Initialize // // Core // static void initializeEncodingValidator(); static void initializeXMLException(); static void initializeXMLScanner(); static void initializeXMLValidator(); // Regex // static void initializeRangeTokenMap(); static void initializeRegularExpression(); // DTD // static void initializeDTDGrammar(); // Schema // static void initializeXSDErrorReporter(); static void initializeDatatypeValidatorFactory(); static void initializeGeneralAttributeCheck(); static void initializeXSValue(); static void initializeComplexTypeInfo(); // DOM // static void initializeDOMImplementationRegistry(); static void initializeDOMImplementationImpl(); static void initializeDOMDocumentTypeImpl(); static void initializeDOMNodeListImpl(); static void initializeDOMNormalizer(); // XInclude // static void initializeXInclude(); // // Terminate // // Core // static void terminateEncodingValidator(); static void terminateXMLException(); static void terminateXMLScanner(); static void terminateXMLValidator(); // Regex // static void terminateRangeTokenMap(); static void terminateRegularExpression(); // DTD // static void terminateDTDGrammar(); // Schema // static void terminateXSDErrorReporter(); static void terminateDatatypeValidatorFactory(); static void terminateGeneralAttributeCheck(); static void terminateXSValue(); static void terminateComplexTypeInfo(); // DOM // static void terminateDOMImplementationRegistry(); static void terminateDOMImplementationImpl(); static void terminateDOMDocumentTypeImpl(); static void terminateDOMNodeListImpl(); static void terminateDOMNormalizer(); // XInclude // static void terminateXInclude(); // // Extra initialization. // static void initializeDOMHeap (XMLSize_t initialHeapAllocSize, XMLSize_t maxHeapAllocSize, XMLSize_t maxSubAllocationSize); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XML88591Transcoder.cpp000644 000765 000024 00000012006 13241160336 023051 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XML88591Transcoder: Constructors and Destructor // --------------------------------------------------------------------------- XML88591Transcoder::XML88591Transcoder( const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager) : XMLTranscoder(encodingName, blockSize, manager) { } XML88591Transcoder::~XML88591Transcoder() { } // --------------------------------------------------------------------------- // XML88591Transcoder: Implementation of the transcoder API // --------------------------------------------------------------------------- XMLSize_t XML88591Transcoder::transcodeFrom( const XMLByte* const srcData , const XMLSize_t srcCount , XMLCh* const toFill , const XMLSize_t maxChars , XMLSize_t& bytesEaten , unsigned char* const charSizes) { // // Calculate the max chars we can do here. Its the lesser of the // max output chars and the number of bytes in the source. // const XMLSize_t countToDo = srcCount < maxChars ? srcCount : maxChars; // // Loop through the bytes to do and convert over each byte. Its just // a cast to the wide char type. // const XMLByte* srcPtr = srcData; XMLCh* destPtr = toFill; const XMLByte* srcEnd = srcPtr + countToDo; while (srcPtr < srcEnd) *destPtr++ = XMLCh(*srcPtr++); // Set the bytes eaten, and set the char size array to the fixed size bytesEaten = countToDo; memset(charSizes, 1, countToDo); // Return the chars we transcoded return countToDo; } XMLSize_t XML88591Transcoder::transcodeTo(const XMLCh* const srcData , const XMLSize_t srcCount , XMLByte* const toFill , const XMLSize_t maxBytes , XMLSize_t& charsEaten , const UnRepOpts options) { // // Calculate the max chars we can do here. Its the lesser of the // max output bytes and the number of chars in the source. // const XMLSize_t countToDo = srcCount < maxBytes ? srcCount : maxBytes; // // Loop through the bytes to do and convert over each byte. Its just // a downcast of the wide char, checking for unrepresentable chars. // const XMLCh* srcPtr = srcData; const XMLCh* srcEnd = srcPtr + countToDo; XMLByte* destPtr = toFill; while (srcPtr < srcEnd) { // If its legal, take it and jump back to top if (*srcPtr < 256) { *destPtr++ = XMLByte(*srcPtr++); continue; } // // Its not representable so use a replacement char. According to // the options, either throw or use the replacement. // if (options == UnRep_Throw) { XMLCh tmpBuf[17]; XMLString::binToText((unsigned int)*srcPtr, tmpBuf, 16, 16, getMemoryManager()); ThrowXMLwithMemMgr2 ( TranscodingException , XMLExcepts::Trans_Unrepresentable , tmpBuf , getEncodingName() , getMemoryManager() ); } *destPtr++ = 0x1A; srcPtr++; } // Set the chars eaten charsEaten = countToDo; // Return the bytes we transcoded return countToDo; } bool XML88591Transcoder::canTranscodeTo(const unsigned int toCheck) { return (toCheck < 256); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/Xerces_autoconf_config.hpp.cmake.in000644 000765 000024 00000013412 13272177434 026127 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Xerces_autoconf_config.hpp.in 834826 2009-11-11 10:03:53Z borisk $ */ // // There are two primary xerces configuration header files: // // Xerces_autoconf_config.hpp // // For configuration of items that must be accessable // through public headers. This file has limited information // and carefully works to avoid collision of macro names, etc. // // This file is included by XercesDefs.h. In the event // of a non-configured platform, a similar header specific // to the platform will be included instead. // // config.h // // Generalized cmake-generated header file, with much more // information, used to supply configuration information // for use in implementation files. // // For CMake-based builds, this header is configured by cmake from the // .cmake.in template file of the same name. #ifndef XERCES_AUTOCONFIG_CONFIG_HPP #define XERCES_AUTOCONFIG_CONFIG_HPP // --------------------------------------------------------------------------- // These defines are set by cmake as appropriate for the platform. // --------------------------------------------------------------------------- #define XERCES_AUTOCONF 1 #cmakedefine XERCES_HAVE_SYS_TYPES_H 1 #cmakedefine XERCES_HAVE_CSTDINT 1 #cmakedefine XERCES_HAVE_STDINT_H 1 #cmakedefine XERCES_HAVE_INTTYPES_H 1 #cmakedefine XERCES_HAVE_INTRIN_H 1 #cmakedefine XERCES_HAVE_EMMINTRIN_H 1 #cmakedefine XERCES_INCLUDE_WCHAR_H 1 #define XERCES_S16BIT_INT @XERCES_S16BIT_INT@ #define XERCES_S32BIT_INT @XERCES_S32BIT_INT@ #define XERCES_S64BIT_INT @XERCES_S64BIT_INT@ #define XERCES_U16BIT_INT @XERCES_U16BIT_INT@ #define XERCES_U32BIT_INT @XERCES_U32BIT_INT@ #define XERCES_U64BIT_INT @XERCES_U64BIT_INT@ #define XERCES_XMLCH_T @XERCES_XMLCH_T@ #define XERCES_SIZE_T @XERCES_SIZE_T@ #define XERCES_SSIZE_T @XERCES_SSIZE_T@ #cmakedefine XERCES_HAS_CPP_NAMESPACE 1 #cmakedefine XERCES_STD_NAMESPACE 1 #cmakedefine XERCES_NEW_IOSTREAMS 1 #cmakedefine XERCES_NO_NATIVE_BOOL 1 #cmakedefine XERCES_LSTRSUPPORT 1 #cmakedefine XERCES_MFC_SUPPORT 1 #cmakedefine XERCES_HAVE_CPUID_INTRINSIC 1 #cmakedefine XERCES_HAVE_SSE2_INTRINSIC 1 #cmakedefine XERCES_HAVE_GETCPUID 1 #cmakedefine XERCES_NO_MATCHING_DELETE_OPERATOR 1 #cmakedefine XERCES_DLL_EXPORT 1 #cmakedefine XERCES_STATIC_LIBRARY 1 #define XERCES_PLATFORM_EXPORT @XERCES_PLATFORM_EXPORT@ #define XERCES_PLATFORM_IMPORT @XERCES_PLATFORM_IMPORT@ #define XERCES_TEMPLATE_EXTERN @XERCES_TEMPLATE_EXTERN@ #ifdef XERCES_DLL_EXPORT # define DLL_EXPORT #endif // --------------------------------------------------------------------------- // Include standard headers, if available, that we may rely on below. // --------------------------------------------------------------------------- #if defined(__cplusplus) && defined(HAVE_CSTDINT) # include #endif #if XERCES_HAVE_STDINT_H # include #endif #if XERCES_HAVE_INTTYPES_H # include #endif #if XERCES_HAVE_SYS_TYPES_H # include #endif #if XERCES_INCLUDE_WCHAR_H # include #endif // --------------------------------------------------------------------------- // XMLSize_t is the unsigned integral type. // --------------------------------------------------------------------------- typedef XERCES_SIZE_T XMLSize_t; typedef XERCES_SSIZE_T XMLSSize_t; #define XERCES_SIZE_MAX @XERCES_SIZE_MAX@ #define XERCES_SSIZE_MAX @XERCES_SSIZE_MAX@ // --------------------------------------------------------------------------- // Define our version of the XML character // --------------------------------------------------------------------------- typedef XERCES_XMLCH_T XMLCh; // --------------------------------------------------------------------------- // Define unsigned 16, 32, and 64 bit integers // --------------------------------------------------------------------------- typedef XERCES_U16BIT_INT XMLUInt16; typedef XERCES_U32BIT_INT XMLUInt32; typedef XERCES_U64BIT_INT XMLUInt64; // --------------------------------------------------------------------------- // Define signed 16, 32, and 64 bit integers // --------------------------------------------------------------------------- typedef XERCES_S16BIT_INT XMLInt16; typedef XERCES_S32BIT_INT XMLInt32; typedef XERCES_S64BIT_INT XMLInt64; // --------------------------------------------------------------------------- // XMLFilePos is the type used to represent a file position. // --------------------------------------------------------------------------- typedef XMLUInt64 XMLFilePos; // --------------------------------------------------------------------------- // XMLFileLoc is the type used to represent a file location (line/column). // --------------------------------------------------------------------------- typedef XMLUInt64 XMLFileLoc; // --------------------------------------------------------------------------- // Force on the Xerces debug token if it is on in the build environment // --------------------------------------------------------------------------- #if defined(_DEBUG) #define XERCES_DEBUG #endif #endif xerces-c-3.2.2/src/xercesc/util/RefStackOf.c000644 000765 000024 00000011624 13241160335 021400 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: RefStackOf.c 676911 2008-07-15 13:27:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // RefStackOf: Constructors and Destructor // --------------------------------------------------------------------------- template RefStackOf::RefStackOf(const XMLSize_t initElems, const bool adoptElems, MemoryManager* const manager) : fVector(initElems, adoptElems, manager) { } template RefStackOf::~RefStackOf() { } // --------------------------------------------------------------------------- // RefStackOf: Element management methods // --------------------------------------------------------------------------- template const TElem* RefStackOf:: elementAt(const XMLSize_t index) const { if (index >= fVector.size()) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Stack_BadIndex, fVector.getMemoryManager()); return fVector.elementAt(index); } template TElem* RefStackOf::popAt(const XMLSize_t index) { if (index >= fVector.size()) ThrowXMLwithMemMgr(ArrayIndexOutOfBoundsException, XMLExcepts::Stack_BadIndex, fVector.getMemoryManager()); // Orphan off the element from the slot in the vector return fVector.orphanElementAt(index); } template void RefStackOf::push(TElem* const toPush) { fVector.addElement(toPush); } template const TElem* RefStackOf::peek() const { const XMLSize_t curSize = fVector.size(); if (curSize == 0) ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::Stack_EmptyStack, fVector.getMemoryManager()); return fVector.elementAt(curSize-1); } template TElem* RefStackOf::pop() { const XMLSize_t curSize = fVector.size(); if (curSize == 0) ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::Stack_EmptyStack, fVector.getMemoryManager()); // Orphan off the element from the last slot in the vector return fVector.orphanElementAt(curSize-1); } template void RefStackOf::removeAllElements() { fVector.removeAllElements(); } // --------------------------------------------------------------------------- // RefStackOf: Getter methods // --------------------------------------------------------------------------- template bool RefStackOf::empty() { return (fVector.size() == 0); } template XMLSize_t RefStackOf::curCapacity() { return fVector.curCapacity(); } template XMLSize_t RefStackOf::size() { return fVector.size(); } // --------------------------------------------------------------------------- // RefStackEnumerator: Constructors and Destructor // --------------------------------------------------------------------------- template RefStackEnumerator:: RefStackEnumerator( RefStackOf* const toEnum , const bool adopt) : fAdopted(adopt) , fCurIndex(0) , fToEnum(toEnum) , fVector(&toEnum->fVector) { } template RefStackEnumerator::~RefStackEnumerator() { if (fAdopted) delete fToEnum; } // --------------------------------------------------------------------------- // RefStackEnumerator: Enum interface // --------------------------------------------------------------------------- template bool RefStackEnumerator::hasMoreElements() const { if (fCurIndex >= fVector->size()) return false; return true; } template TElem& RefStackEnumerator::nextElement() { return *fVector->elementAt(fCurIndex++); } template void RefStackEnumerator::Reset() { fCurIndex = 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/KeyRefPair.c000644 000765 000024 00000006017 13241160336 021413 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: KeyRefPair.c 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Include // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // KeyRefPair: Constructors and Destructor // --------------------------------------------------------------------------- template KeyRefPair::KeyRefPair() { } template KeyRefPair:: KeyRefPair(TKey* key, TValue* value) : fKey(key) , fValue(value) { } template KeyRefPair:: KeyRefPair(const KeyRefPair* toCopy) : fKey(toCopy->fKey) , fValue(toCopy->fValue) { } template KeyRefPair:: KeyRefPair(const KeyRefPair& toCopy) : fKey(toCopy.fKey) , fValue(toCopy.fValue) { } template KeyRefPair::~KeyRefPair() { } // --------------------------------------------------------------------------- // KeyRefPair: Getters // --------------------------------------------------------------------------- template const TKey* KeyRefPair::getKey() const { return fKey; } template TKey* KeyRefPair::getKey() { return fKey; } template const TValue* KeyRefPair::getValue() const { return fValue; } template TValue* KeyRefPair::getValue() { return fValue; } // --------------------------------------------------------------------------- // KeyRefPair: Setters // --------------------------------------------------------------------------- template TKey* KeyRefPair::setKey(TKey* newKey) { fKey = newKey; return fKey; } template TValue* KeyRefPair::setValue(TValue* newValue) { fValue = newValue; return fValue; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLUTF8Transcoder.cpp000644 000765 000024 00000052277 13241160336 023117 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * $Id: XMLUTF8Transcoder.cpp 1383364 2012-09-11 11:48:30Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local static data // // gUTFBytes // A list of counts of trailing bytes for each initial byte in the input. // // gUTFByteIndicator // For a UTF8 sequence of n bytes, n>=2, the first byte of the // sequence must contain n 1's followed by precisely 1 0 with the // rest of the byte containing arbitrary bits. This array stores // the required bit pattern for validity checking. // gUTFByteIndicatorTest // When bitwise and'd with the observed value, if the observed // value is correct then a result matching gUTFByteIndicator will // be produced. // // gUTFOffsets // A list of values to offset each result char type, according to how // many source bytes when into making it. // // gFirstByteMark // A list of values to mask onto the first byte of an encoded sequence, // indexed by the number of bytes used to create the sequence. // --------------------------------------------------------------------------- static const XMLByte gUTFBytes[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 , 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 , 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5 }; static const XMLByte gUTFByteIndicator[6] = { 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; static const XMLByte gUTFByteIndicatorTest[6] = { 0x80, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE }; static const XMLUInt32 gUTFOffsets[6] = { 0, 0x3080, 0xE2080, 0x3C82080, 0xFA082080, 0x82082080 }; static const XMLByte gFirstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; // --------------------------------------------------------------------------- // XMLUTF8Transcoder: Constructors and Destructor // --------------------------------------------------------------------------- XMLUTF8Transcoder::XMLUTF8Transcoder(const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager) :XMLTranscoder(encodingName, blockSize, manager) { } XMLUTF8Transcoder::~XMLUTF8Transcoder() { } // --------------------------------------------------------------------------- // XMLUTF8Transcoder: Implementation of the transcoder API // --------------------------------------------------------------------------- XMLSize_t XMLUTF8Transcoder::transcodeFrom(const XMLByte* const srcData , const XMLSize_t srcCount , XMLCh* const toFill , const XMLSize_t maxChars , XMLSize_t& bytesEaten , unsigned char* const charSizes) { // Watch for pathological scenario. Shouldn't happen, but... if (!srcCount || !maxChars) return 0; // // Get pointers to our start and end points of the input and output // buffers. // const XMLByte* srcPtr = srcData; const XMLByte* srcEnd = srcPtr + srcCount; XMLCh* outPtr = toFill; XMLCh* outEnd = outPtr + maxChars; unsigned char* sizePtr = charSizes; // // We now loop until we either run out of input data, or room to store // output chars. // while ((srcPtr < srcEnd) && (outPtr < outEnd)) { // Special-case ASCII, which is a leading byte value of <= 127 if (*srcPtr <= 127) { // Handle ASCII in groups instead of single character at a time. const XMLByte* srcPtr_save = srcPtr; const XMLSize_t chunkSize = (srcEnd-srcPtr)<(outEnd-outPtr)?(srcEnd-srcPtr):(outEnd-outPtr); for(XMLSize_t i=0;i= here because we are implicitly // counting the 1 byte we get no matter what. // // If we break out here, then there is nothing to undo since we // haven't updated any pointers yet. // if (srcPtr + trailingBytes >= srcEnd) break; // Looks ok, so lets build up the value // or at least let's try to do so--remembering that // we cannot assume the encoding to be valid: // first, test first byte if((gUTFByteIndicatorTest[trailingBytes] & *srcPtr) != gUTFByteIndicator[trailingBytes]) { char pos[2] = {(char)0x31, 0}; char len[2] = {(char)(trailingBytes+0x31), 0}; char byte[2] = {(char)*srcPtr,0}; ThrowXMLwithMemMgr3(UTFDataFormatException, XMLExcepts::UTF8_FormatError, pos, byte, len, getMemoryManager()); } /*** * http://www.unicode.org/reports/tr27/ * * Table 3.1B. lists all of the byte sequences that are legal in UTF-8. * A range of byte values such as A0..BF indicates that any byte from A0 to BF (inclusive) * is legal in that position. * Any byte value outside of the ranges listed is illegal. * For example, * the byte sequence is illegal since C0 is not legal in the 1st Byte column. * The byte sequence is illegal since in the row * where E0 is legal as a first byte, * 9F is not legal as a second byte. * The byte sequence is legal, since every byte in that sequence matches * a byte range in a row of the table (the last row). * * * Table 3.1B. Legal UTF-8 Byte Sequences * Code Points 1st Byte 2nd Byte 3rd Byte 4th Byte * ========================================================================= * U+0000..U+007F 00..7F * ------------------------------------------------------------------------- * U+0080..U+07FF C2..DF 80..BF * * ------------------------------------------------------------------------- * U+0800..U+0FFF E0 A0..BF 80..BF * -- * * U+1000..U+FFFF E1..EF 80..BF 80..BF * * -------------------------------------------------------------------------- * U+10000..U+3FFFF F0 90..BF 80..BF 80..BF * -- * U+40000..U+FFFFF F1..F3 80..BF 80..BF 80..BF * U+100000..U+10FFFF F4 80..8F 80..BF 80..BF * -- * ========================================================================== * * Cases where a trailing byte range is not 80..BF are underlined in the table to * draw attention to them. These occur only in the second byte of a sequence. * ***/ XMLUInt32 tmpVal = 0; switch(trailingBytes) { case 1 : // UTF-8: [110y yyyy] [10xx xxxx] // Unicode: [0000 0yyy] [yyxx xxxx] // // 0xC0, 0xC1 has been filtered out checkTrailingBytes(*(srcPtr+1), 1, 1); tmpVal = *srcPtr++; tmpVal <<= 6; tmpVal += *srcPtr++; break; case 2 : // UTF-8: [1110 zzzz] [10yy yyyy] [10xx xxxx] // Unicode: [zzzz yyyy] [yyxx xxxx] // if (( *srcPtr == 0xE0) && ( *(srcPtr+1) < 0xA0)) { char byte0[2] = {(char)*srcPtr ,0}; char byte1[2] = {(char)*(srcPtr+1),0}; ThrowXMLwithMemMgr2(UTFDataFormatException , XMLExcepts::UTF8_Invalid_3BytesSeq , byte0 , byte1 , getMemoryManager()); } checkTrailingBytes(*(srcPtr+1), 2, 1); checkTrailingBytes(*(srcPtr+2), 2, 2); // // D36 (a) UTF-8 is the Unicode Transformation Format that serializes // a Unicode code point as a sequence of one to four bytes, // as specified in Table 3.1, UTF-8 Bit Distribution. // (b) An illegal UTF-8 code unit sequence is any byte sequence that // does not match the patterns listed in Table 3.1B, Legal UTF-8 // Byte Sequences. // (c) An irregular UTF-8 code unit sequence is a six-byte sequence // where the first three bytes correspond to a high surrogate, // and the next three bytes correspond to a low surrogate. // As a consequence of C12, these irregular UTF-8 sequences shall // not be generated by a conformant process. // //irregular three bytes sequence // that is zzzzyy matches leading surrogate tag 110110 or // trailing surrogate tag 110111 // *srcPtr=1110 1101 // *(srcPtr+1)=1010 yyyy or // *(srcPtr+1)=1011 yyyy // // 0xED 1110 1101 // 0xA0 1010 0000 if ((*srcPtr == 0xED) && (*(srcPtr+1) >= 0xA0)) { char byte0[2] = {(char)*srcPtr, 0}; char byte1[2] = {(char)*(srcPtr+1),0}; ThrowXMLwithMemMgr2(UTFDataFormatException , XMLExcepts::UTF8_Irregular_3BytesSeq , byte0 , byte1 , getMemoryManager()); } tmpVal = *srcPtr++; tmpVal <<= 6; tmpVal += *srcPtr++; tmpVal <<= 6; tmpVal += *srcPtr++; break; case 3 : // UTF-8: [1111 0uuu] [10uu zzzz] [10yy yyyy] [10xx xxxx]* // Unicode: [1101 10ww] [wwzz zzyy] (high surrogate) // [1101 11yy] [yyxx xxxx] (low surrogate) // * uuuuu = wwww + 1 // if (((*srcPtr == 0xF0) && (*(srcPtr+1) < 0x90)) || ((*srcPtr == 0xF4) && (*(srcPtr+1) > 0x8F)) ) { char byte0[2] = {(char)*srcPtr ,0}; char byte1[2] = {(char)*(srcPtr+1),0}; ThrowXMLwithMemMgr2(UTFDataFormatException , XMLExcepts::UTF8_Invalid_4BytesSeq , byte0 , byte1 , getMemoryManager()); } checkTrailingBytes(*(srcPtr+1), 3, 1); checkTrailingBytes(*(srcPtr+2), 3, 2); checkTrailingBytes(*(srcPtr+3), 3, 3); tmpVal = *srcPtr++; tmpVal <<= 6; tmpVal += *srcPtr++; tmpVal <<= 6; tmpVal += *srcPtr++; tmpVal <<= 6; tmpVal += *srcPtr++; break; default: // trailingBytes > 3 /*** * The definition of UTF-8 in Annex D of ISO/IEC 10646-1:2000 also allows * for the use of five- and six-byte sequences to encode characters that * are outside the range of the Unicode character set; those five- and * six-byte sequences are illegal for the use of UTF-8 as a transformation * of Unicode characters. ISO/IEC 10646 does not allow mapping of unpaired * surrogates, nor U+FFFE and U+FFFF (but it does allow other noncharacters). ***/ char len[2] = {(char)(trailingBytes+0x31), 0}; char byte[2] = {(char)*srcPtr,0}; ThrowXMLwithMemMgr2(UTFDataFormatException , XMLExcepts::UTF8_Exceeds_BytesLimit , byte , len , getMemoryManager()); break; } // since trailingBytes comes from an array, this logic is redundant // default : // ThrowXMLwithMemMgr(TranscodingException, XMLExcepts::Trans_BadSrcSeq); //} tmpVal -= gUTFOffsets[trailingBytes]; // // If it will fit into a single char, then put it in. Otherwise // encode it as a surrogate pair. If its not valid, use the // replacement char. // if (!(tmpVal & 0xFFFF0000)) { *sizePtr++ = trailingBytes + 1; *outPtr++ = XMLCh(tmpVal); } else if (tmpVal > 0x10FFFF) { // // If we've gotten more than 32 chars so far, then just break // out for now and lets process those. When we come back in // here again, we'll get no chars and throw an exception. This // way, the error will have a line and col number closer to // the real problem area. // if ((outPtr - toFill) > 32) break; ThrowXMLwithMemMgr(TranscodingException, XMLExcepts::Trans_BadSrcSeq, getMemoryManager()); } else { // // If we have enough room to store the leading and trailing // chars, then lets do it. Else, pretend this one never // happened, and leave it for the next time. Since we don't // update the bytes read until the bottom of the loop, by // breaking out here its like it never happened. // if (outPtr + 1 >= outEnd) break; // Store the leading surrogate char tmpVal -= 0x10000; *sizePtr++ = trailingBytes + 1; *outPtr++ = XMLCh((tmpVal >> 10) + 0xD800); // // And then the trailing char. This one accounts for no // bytes eaten from the source, so set the char size for this // one to be zero. // *sizePtr++ = 0; *outPtr++ = XMLCh((tmpVal & 0x3FF) + 0xDC00); } } // Update the bytes eaten bytesEaten = srcPtr - srcData; // Return the characters read return outPtr - toFill; } XMLSize_t XMLUTF8Transcoder::transcodeTo( const XMLCh* const srcData , const XMLSize_t srcCount , XMLByte* const toFill , const XMLSize_t maxBytes , XMLSize_t& charsEaten , const UnRepOpts options) { // Watch for pathological scenario. Shouldn't happen, but... if (!srcCount || !maxBytes) return 0; // // Get pointers to our start and end points of the input and output // buffers. // const XMLCh* srcPtr = srcData; const XMLCh* srcEnd = srcPtr + srcCount; XMLByte* outPtr = toFill; XMLByte* outEnd = toFill + maxBytes; while (srcPtr < srcEnd) { // // Tentatively get the next char out. We have to get it into a // 32 bit value, because it could be a surrogate pair. // XMLUInt32 curVal = *srcPtr; // // If its a leading surrogate, then lets see if we have the trailing // available. If not, then give up now and leave it for next time. // unsigned int srcUsed = 1; if ((curVal >= 0xD800) && (curVal <= 0xDBFF)) { if (srcPtr + 1 >= srcEnd) break; // Create the composite surrogate pair curVal = ((curVal - 0xD800) << 10) + ((*(srcPtr + 1) - 0xDC00) + 0x10000); // And indicate that we ate another one srcUsed++; } // Figure out how many bytes we need unsigned int encodedBytes; if (curVal < 0x80) encodedBytes = 1; else if (curVal < 0x800) encodedBytes = 2; else if (curVal < 0x10000) encodedBytes = 3; else if (curVal < 0x110000) encodedBytes = 4; else { // If the options say to throw, then throw if (options == UnRep_Throw) { XMLCh tmpBuf[17]; XMLString::binToText(curVal, tmpBuf, 16, 16, getMemoryManager()); ThrowXMLwithMemMgr2 ( TranscodingException , XMLExcepts::Trans_Unrepresentable , tmpBuf , getEncodingName() , getMemoryManager() ); } // Else, use the replacement character *outPtr++ = chSpace; srcPtr += srcUsed; continue; } // // If we cannot fully get this char into the output buffer, // then leave it for the next time. // if (outPtr + encodedBytes > outEnd) break; // We can do it, so update the source index srcPtr += srcUsed; // // And spit out the bytes. We spit them out in reverse order // here, so bump up the output pointer and work down as we go. // outPtr += encodedBytes; switch(encodedBytes) { case 6 : *--outPtr = XMLByte((curVal | 0x80UL) & 0xBFUL); curVal >>= 6; case 5 : *--outPtr = XMLByte((curVal | 0x80UL) & 0xBFUL); curVal >>= 6; case 4 : *--outPtr = XMLByte((curVal | 0x80UL) & 0xBFUL); curVal >>= 6; case 3 : *--outPtr = XMLByte((curVal | 0x80UL) & 0xBFUL); curVal >>= 6; case 2 : *--outPtr = XMLByte((curVal | 0x80UL) & 0xBFUL); curVal >>= 6; case 1 : *--outPtr = XMLByte ( curVal | gFirstByteMark[encodedBytes] ); } // Add the encoded bytes back in again to indicate we've eaten them outPtr += encodedBytes; } // Fill in the chars we ate charsEaten = (srcPtr - srcData); // And return the bytes we filled in return (outPtr - toFill); } bool XMLUTF8Transcoder::canTranscodeTo(const unsigned int toCheck) { // We can represent anything in the Unicode (with surrogates) range return (toCheck <= 0x10FFFF); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/InvalidCastException.hpp000644 000765 000024 00000002261 13241160336 024034 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: InvalidCastException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_INVALIDCASTEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_INVALIDCASTEXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(InvalidCastException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/UTFDataFormatException.hpp000644 000765 000024 00000002272 13241160336 024236 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: UTFDataFormatException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_UTFDATAFORMATEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_UTFDATAFORMATEXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(UTFDataFormatException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/NoSuchElementException.hpp000644 000765 000024 00000002271 13241160336 024345 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: NoSuchElementException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_NOSUCHELEMENTEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_NOSUCHELEMENTEXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(NoSuchElementException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLException.cpp000644 000765 000024 00000015724 13241160336 022276 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLException.cpp 673960 2008-07-04 08:50:12Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN static XMLMsgLoader* sMsgLoader = 0; void XMLInitializer::initializeXMLException() { sMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgExceptDomain); if (!sMsgLoader) XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain); } void XMLInitializer::terminateXMLException() { delete sMsgLoader; sMsgLoader = 0; } // // static XMLMsgLoader& gGetMsgLoader() { return *sMsgLoader; } // --------------------------------------------------------------------------- // XMLException: Virtual destructor // --------------------------------------------------------------------------- XMLException::~XMLException() { fMemoryManager->deallocate(fMsg); fMemoryManager->deallocate(fSrcFile); } // --------------------------------------------------------------------------- // XMLException: Setter methods // --------------------------------------------------------------------------- void XMLException::setPosition(const char* const file, const XMLFileLoc line) { fSrcLine = line; fMemoryManager->deallocate(fSrcFile); fSrcFile = XMLString::replicate(file, fMemoryManager); } // --------------------------------------------------------------------------- // XMLException: Hidden constructors and operators // --------------------------------------------------------------------------- XMLException::XMLException() : fCode(XMLExcepts::NoError) , fSrcFile(0) , fSrcLine(0) , fMsg(0) , fMemoryManager( XMLPlatformUtils::fgMemoryManager->getExceptionMemoryManager()) { } XMLException::XMLException( const char* const srcFile , const XMLFileLoc srcLine , MemoryManager* const memoryManager) : fCode(XMLExcepts::NoError) , fSrcFile(0) , fSrcLine(srcLine) , fMsg(0) , fMemoryManager(0) { if (!memoryManager) fMemoryManager = XMLPlatformUtils::fgMemoryManager->getExceptionMemoryManager(); else fMemoryManager = memoryManager->getExceptionMemoryManager(); fSrcFile = XMLString::replicate(srcFile, fMemoryManager); } XMLException::XMLException(const XMLException& toCopy) : XMemory(toCopy) , fCode(toCopy.fCode) , fSrcFile(0) , fSrcLine(toCopy.fSrcLine) , fMsg(XMLString::replicate(toCopy.fMsg, toCopy.fMemoryManager)) , fMemoryManager(toCopy.fMemoryManager) { if (toCopy.fSrcFile) { fSrcFile = XMLString::replicate ( toCopy.fSrcFile , fMemoryManager ); } } XMLException& XMLException::operator=(const XMLException& toAssign) { if (this != &toAssign) { //use the original memory manager to deallocate fMemoryManager->deallocate(fSrcFile); fSrcFile = 0; fMemoryManager->deallocate(fMsg); fMsg = 0; fMemoryManager = toAssign.fMemoryManager; fSrcLine = toAssign.fSrcLine; fCode = toAssign.fCode; if (toAssign.fMsg) { fMsg = XMLString::replicate ( toAssign.fMsg , fMemoryManager ); } if (toAssign.fSrcFile) { fSrcFile = XMLString::replicate ( toAssign.fSrcFile , fMemoryManager ); } } return *this; } // --------------------------------------------------------------------------- // XMLException: Protected methods // --------------------------------------------------------------------------- void XMLException::loadExceptText(const XMLExcepts::Codes toLoad) { // Store the error code fCode = toLoad; // Load up the text into a local buffer const XMLSize_t msgSize = 2047; XMLCh errText[msgSize + 1]; // load the text if (!gGetMsgLoader().loadMsg(toLoad, errText, msgSize)) { fMsg = XMLString::replicate ( XMLUni::fgDefErrMsg , fMemoryManager ); return; } // We got the text so replicate it into the message member fMsg = XMLString::replicate(errText, fMemoryManager); } void XMLException::loadExceptText(const XMLExcepts::Codes toLoad , const XMLCh* const text1 , const XMLCh* const text2 , const XMLCh* const text3 , const XMLCh* const text4) { // Store the error code fCode = toLoad; // Load up the text into a local buffer const XMLSize_t msgSize = 4095; XMLCh errText[msgSize + 1]; // load the text if (!gGetMsgLoader().loadMsg(toLoad, errText, msgSize, text1, text2, text3, text4, fMemoryManager)) { fMsg = XMLString::replicate ( XMLUni::fgDefErrMsg , fMemoryManager ); return; } // We got the text so replicate it into the message member fMsg = XMLString::replicate(errText, fMemoryManager); } void XMLException::loadExceptText(const XMLExcepts::Codes toLoad , const char* const text1 , const char* const text2 , const char* const text3 , const char* const text4) { // Store the error code fCode = toLoad; // Load up the text into a local buffer const XMLSize_t msgSize = 4095; XMLCh errText[msgSize + 1]; // load the text if (!gGetMsgLoader().loadMsg(toLoad, errText, msgSize, text1, text2, text3, text4, fMemoryManager)) { fMsg = XMLString::replicate ( XMLUni::fgDefErrMsg , fMemoryManager ); return; } // We got the text so replicate it into the message member fMsg = XMLString::replicate(errText, fMemoryManager); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/MutexManagers/000755 000765 000024 00000000000 13345765734 022044 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/util/Transcoders/000755 000765 000024 00000000000 13345765730 021547 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/util/FileManagers/000755 000765 000024 00000000000 13345765734 021621 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/util/RefHash2KeysTableOf.c000644 000765 000024 00000052222 13241160335 023103 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: RefHash2KeysTableOf.c 679340 2008-07-24 10:28:29Z borisk $ */ // --------------------------------------------------------------------------- // Include // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // RefHash2KeysTableOf: Constructors and Destructor // --------------------------------------------------------------------------- template RefHash2KeysTableOf::RefHash2KeysTableOf( const XMLSize_t modulus, MemoryManager* const manager) : fMemoryManager(manager) , fAdoptedElems(true) , fBucketList(0) , fHashModulus(modulus) , fCount(0) { initialize(modulus); } template RefHash2KeysTableOf::RefHash2KeysTableOf( const XMLSize_t modulus, const THasher& hasher, MemoryManager* const manager) : fMemoryManager(manager) , fAdoptedElems(true) , fBucketList(0) , fHashModulus(modulus) , fCount(0) , fHasher (hasher) { initialize(modulus); } template RefHash2KeysTableOf::RefHash2KeysTableOf( const XMLSize_t modulus, const bool adoptElems, MemoryManager* const manager) : fMemoryManager(manager) , fAdoptedElems(adoptElems) , fBucketList(0) , fHashModulus(modulus) , fCount(0) { initialize(modulus); } template RefHash2KeysTableOf::RefHash2KeysTableOf( const XMLSize_t modulus, const bool adoptElems, const THasher& hasher, MemoryManager* const manager) : fMemoryManager(manager) , fAdoptedElems(adoptElems) , fBucketList(0) , fHashModulus(modulus) , fCount(0) , fHasher (hasher) { initialize(modulus); } template void RefHash2KeysTableOf::initialize(const XMLSize_t modulus) { if (modulus == 0) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::HshTbl_ZeroModulus, fMemoryManager); // Allocate the bucket list and zero them fBucketList = (RefHash2KeysTableBucketElem**) fMemoryManager->allocate ( fHashModulus * sizeof(RefHash2KeysTableBucketElem*) ); //new RefHash2KeysTableBucketElem*[fHashModulus]; memset(fBucketList, 0, sizeof(fBucketList[0]) * fHashModulus); } template RefHash2KeysTableOf::~RefHash2KeysTableOf() { removeAll(); // Then delete the bucket list & hasher fMemoryManager->deallocate(fBucketList); //delete [] fBucketList; fBucketList = 0; } // --------------------------------------------------------------------------- // RefHash2KeysTableOf: Element management // --------------------------------------------------------------------------- template bool RefHash2KeysTableOf::isEmpty() const { return (fCount==0); } template bool RefHash2KeysTableOf:: containsKey(const void* const key1, const int key2) const { XMLSize_t hashVal; const RefHash2KeysTableBucketElem* findIt = findBucketElem(key1, key2, hashVal); return (findIt != 0); } template void RefHash2KeysTableOf:: removeKey(const void* const key1, const int key2) { // Hash the key XMLSize_t hashVal = fHasher.getHashVal(key1, fHashModulus); assert(hashVal < fHashModulus); // // Search the given bucket for this key. Keep up with the previous // element so we can patch around it. // RefHash2KeysTableBucketElem* curElem = fBucketList[hashVal]; RefHash2KeysTableBucketElem* lastElem = 0; while (curElem) { if((key2==curElem->fKey2) && (fHasher.equals(key1, curElem->fKey1))) { if (!lastElem) { // It was the first in the bucket fBucketList[hashVal] = curElem->fNext; } else { // Patch around the current element lastElem->fNext = curElem->fNext; } // If we adopted the elements, then delete the data if (fAdoptedElems) delete curElem->fData; // Delete the current element // delete curElem; // destructor is empty... // curElem->~RefHash2KeysTableBucketElem(); fMemoryManager->deallocate(curElem); fCount--; return; } // Move both pointers upwards lastElem = curElem; curElem = curElem->fNext; } // We never found that key ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::HshTbl_NoSuchKeyExists, fMemoryManager); } template void RefHash2KeysTableOf:: removeKey(const void* const key1) { // Hash the key XMLSize_t hashVal = fHasher.getHashVal(key1, fHashModulus); assert(hashVal < fHashModulus); // // Search the given bucket for this key. Keep up with the previous // element so we can patch around it. // RefHash2KeysTableBucketElem* curElem = fBucketList[hashVal]; RefHash2KeysTableBucketElem* lastElem = 0; while (curElem) { if(fHasher.equals(key1, curElem->fKey1)) { if (!lastElem) { // It was the first in the bucket fBucketList[hashVal] = curElem->fNext; } else { // Patch around the current element lastElem->fNext = curElem->fNext; } // If we adopted the elements, then delete the data if (fAdoptedElems) delete curElem->fData; RefHash2KeysTableBucketElem* toBeDeleted=curElem; curElem = curElem->fNext; // Delete the current element // delete curElem; // destructor is empty... // curElem->~RefHash2KeysTableBucketElem(); fMemoryManager->deallocate(toBeDeleted); fCount--; } else { // Move both pointers upwards lastElem = curElem; curElem = curElem->fNext; } } } template void RefHash2KeysTableOf::removeAll() { if(isEmpty()) return; // Clean up the buckets first for (XMLSize_t buckInd = 0; buckInd < fHashModulus; buckInd++) { // Get the bucket list head for this entry RefHash2KeysTableBucketElem* curElem = fBucketList[buckInd]; RefHash2KeysTableBucketElem* nextElem; while (curElem) { // Save the next element before we hose this one nextElem = curElem->fNext; // If we adopted the data, then delete it too // (Note: the userdata hash table instance has data type of void *. // This will generate compiler warnings here on some platforms, but they // can be ignored since fAdoptedElements is false. if (fAdoptedElems) delete curElem->fData; // Then delete the current element and move forward // destructor is empty... // curElem->~RefHash2KeysTableBucketElem(); fMemoryManager->deallocate(curElem); curElem = nextElem; } // Clean out this entry fBucketList[buckInd] = 0; } fCount=0; } // this function transfer the data from key1 to key2 template void RefHash2KeysTableOf::transferElement(const void* const key1, void* key2) { // Hash the key XMLSize_t hashVal = fHasher.getHashVal(key1, fHashModulus); assert(hashVal < fHashModulus); // // Search the given bucket for this key. Keep up with the previous // element so we can patch around it. // RefHash2KeysTableBucketElem* curElem = fBucketList[hashVal]; RefHash2KeysTableBucketElem* lastElem = 0; while (curElem) { // if this element has the same primary key, remove it and add it using the new primary key if(fHasher.equals(key1, curElem->fKey1)) { if (!lastElem) { // It was the first in the bucket fBucketList[hashVal] = curElem->fNext; } else { // Patch around the current element lastElem->fNext = curElem->fNext; } // this code comes from put(), but it doesn't update fCount XMLSize_t hashVal2; RefHash2KeysTableBucketElem* newBucket = findBucketElem(key2, curElem->fKey2, hashVal2); if (newBucket) { if (fAdoptedElems) delete newBucket->fData; newBucket->fData = curElem->fData; newBucket->fKey1 = key2; newBucket->fKey2 = curElem->fKey2; } else { newBucket = new (fMemoryManager->allocate(sizeof(RefHash2KeysTableBucketElem))) RefHash2KeysTableBucketElem(key2, curElem->fKey2, curElem->fData, fBucketList[hashVal2]); fBucketList[hashVal2] = newBucket; } RefHash2KeysTableBucketElem* elemToDelete = curElem; // Update just curElem; lastElem must stay the same curElem = curElem->fNext; // Delete the current element // delete elemToDelete; // destructor is empty... // curElem->~RefHash2KeysTableBucketElem(); fMemoryManager->deallocate(elemToDelete); } else { // Move both pointers upwards lastElem = curElem; curElem = curElem->fNext; } } } // --------------------------------------------------------------------------- // RefHash2KeysTableOf: Getters // --------------------------------------------------------------------------- template TVal* RefHash2KeysTableOf::get(const void* const key1, const int key2) { XMLSize_t hashVal; RefHash2KeysTableBucketElem* findIt = findBucketElem(key1, key2, hashVal); if (!findIt) return 0; return findIt->fData; } template const TVal* RefHash2KeysTableOf:: get(const void* const key1, const int key2) const { XMLSize_t hashVal; const RefHash2KeysTableBucketElem* findIt = findBucketElem(key1, key2, hashVal); if (!findIt) return 0; return findIt->fData; } template MemoryManager* RefHash2KeysTableOf::getMemoryManager() const { return fMemoryManager; } template XMLSize_t RefHash2KeysTableOf::getHashModulus() const { return fHashModulus; } // --------------------------------------------------------------------------- // RefHash2KeysTableOf: Putters // --------------------------------------------------------------------------- template void RefHash2KeysTableOf::put(void* key1, int key2, TVal* const valueToAdopt) { // Apply 4 load factor to find threshold. XMLSize_t threshold = fHashModulus * 4; // If we've grown too big, expand the table and rehash. if (fCount >= threshold) rehash(); // First see if the key exists already XMLSize_t hashVal; RefHash2KeysTableBucketElem* newBucket = findBucketElem(key1, key2, hashVal); // // If so,then update its value. If not, then we need to add it to // the right bucket // if (newBucket) { if (fAdoptedElems) delete newBucket->fData; newBucket->fData = valueToAdopt; newBucket->fKey1 = key1; newBucket->fKey2 = key2; } else { newBucket = new (fMemoryManager->allocate(sizeof(RefHash2KeysTableBucketElem))) RefHash2KeysTableBucketElem(key1, key2, valueToAdopt, fBucketList[hashVal]); fBucketList[hashVal] = newBucket; fCount++; } } // --------------------------------------------------------------------------- // RefHash2KeysTableOf: Private methods // --------------------------------------------------------------------------- template inline RefHash2KeysTableBucketElem* RefHash2KeysTableOf:: findBucketElem(const void* const key1, const int key2, XMLSize_t& hashVal) { // Hash the key hashVal = fHasher.getHashVal(key1, fHashModulus); assert(hashVal < fHashModulus); // Search that bucket for the key RefHash2KeysTableBucketElem* curElem = fBucketList[hashVal]; while (curElem) { if((key2==curElem->fKey2) && (fHasher.equals(key1, curElem->fKey1))) return curElem; curElem = curElem->fNext; } return 0; } template inline const RefHash2KeysTableBucketElem* RefHash2KeysTableOf:: findBucketElem(const void* const key1, const int key2, XMLSize_t& hashVal) const { // Hash the key hashVal = fHasher.getHashVal(key1, fHashModulus); assert(hashVal < fHashModulus); // Search that bucket for the key const RefHash2KeysTableBucketElem* curElem = fBucketList[hashVal]; while (curElem) { if((key2==curElem->fKey2) && (fHasher.equals(key1, curElem->fKey1))) return curElem; curElem = curElem->fNext; } return 0; } template void RefHash2KeysTableOf:: rehash() { const XMLSize_t newMod = (fHashModulus * 8)+1; RefHash2KeysTableBucketElem** newBucketList = (RefHash2KeysTableBucketElem**) fMemoryManager->allocate ( newMod * sizeof(RefHash2KeysTableBucketElem*) );//new RefHash2KeysTableBucketElem*[fHashModulus]; // Make sure the new bucket list is destroyed if an // exception is thrown. ArrayJanitor*> guard(newBucketList, fMemoryManager); memset(newBucketList, 0, newMod * sizeof(newBucketList[0])); // Rehash all existing entries. for (XMLSize_t index = 0; index < fHashModulus; index++) { // Get the bucket list head for this entry RefHash2KeysTableBucketElem* curElem = fBucketList[index]; while (curElem) { // Save the next element before we detach this one RefHash2KeysTableBucketElem* nextElem = curElem->fNext; const XMLSize_t hashVal = fHasher.getHashVal(curElem->fKey1, newMod); assert(hashVal < newMod); RefHash2KeysTableBucketElem* newHeadElem = newBucketList[hashVal]; // Insert at the start of this bucket's list. curElem->fNext = newHeadElem; newBucketList[hashVal] = curElem; curElem = nextElem; } } RefHash2KeysTableBucketElem** const oldBucketList = fBucketList; // Everything is OK at this point, so update the // member variables. fBucketList = guard.release(); fHashModulus = newMod; // Delete the old bucket list. fMemoryManager->deallocate(oldBucketList);//delete[] oldBucketList; } // --------------------------------------------------------------------------- // RefHash2KeysTableOfEnumerator: Constructors and Destructor // --------------------------------------------------------------------------- template RefHash2KeysTableOfEnumerator:: RefHash2KeysTableOfEnumerator(RefHash2KeysTableOf* const toEnum , const bool adopt , MemoryManager* const manager) : fAdopted(adopt), fCurElem(0), fCurHash((XMLSize_t)-1), fToEnum(toEnum) , fMemoryManager(manager) , fLockPrimaryKey(0) { if (!toEnum) ThrowXMLwithMemMgr(NullPointerException, XMLExcepts::CPtr_PointerIsZero, fMemoryManager); // // Find the next available bucket element in the hash table. If it // comes back zero, that just means the table is empty. // // Note that the -1 in the current hash tells it to start // from the beginning. // findNext(); } template RefHash2KeysTableOfEnumerator::~RefHash2KeysTableOfEnumerator() { if (fAdopted) delete fToEnum; } // --------------------------------------------------------------------------- // RefHash2KeysTableOfEnumerator: Enum interface // --------------------------------------------------------------------------- template bool RefHash2KeysTableOfEnumerator::hasMoreElements() const { // // If our current has is at the max and there are no more elements // in the current bucket, then no more elements. // if (!fCurElem && (fCurHash == fToEnum->fHashModulus)) return false; return true; } template TVal& RefHash2KeysTableOfEnumerator::nextElement() { // Make sure we have an element to return if (!hasMoreElements()) ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::Enum_NoMoreElements, fMemoryManager); // // Save the current element, then move up to the next one for the // next time around. // RefHash2KeysTableBucketElem* saveElem = fCurElem; findNext(); return *saveElem->fData; } template void RefHash2KeysTableOfEnumerator::nextElementKey(void*& retKey1, int& retKey2) { // Make sure we have an element to return if (!hasMoreElements()) ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::Enum_NoMoreElements, fMemoryManager); // // Save the current element, then move up to the next one for the // next time around. // RefHash2KeysTableBucketElem* saveElem = fCurElem; findNext(); retKey1 = saveElem->fKey1; retKey2 = saveElem->fKey2; return; } template void RefHash2KeysTableOfEnumerator::Reset() { if(fLockPrimaryKey) fCurHash=fToEnum->fHasher.getHashVal(fLockPrimaryKey, fToEnum->fHashModulus); else fCurHash = (XMLSize_t)-1; fCurElem = 0; findNext(); } template void RefHash2KeysTableOfEnumerator::setPrimaryKey(const void* key) { fLockPrimaryKey=key; Reset(); } // --------------------------------------------------------------------------- // RefHash2KeysTableOfEnumerator: Private helper methods // --------------------------------------------------------------------------- template void RefHash2KeysTableOfEnumerator::findNext() { // Code to execute if we have to return only values with the primary key if(fLockPrimaryKey) { if(!fCurElem) fCurElem = fToEnum->fBucketList[fCurHash]; else fCurElem = fCurElem->fNext; while (fCurElem && (!fToEnum->fHasher.equals(fLockPrimaryKey, fCurElem->fKey1))) fCurElem = fCurElem->fNext; // if we didn't found it, make so hasMoreElements() returns false if(!fCurElem) fCurHash = fToEnum->fHashModulus; return; } // // If there is a current element, move to its next element. If this // hits the end of the bucket, the next block will handle the rest. // if (fCurElem) fCurElem = fCurElem->fNext; // // If the current element is null, then we have to move up to the // next hash value. If that is the hash modulus, then we cannot // go further. // if (!fCurElem) { fCurHash++; if (fCurHash == fToEnum->fHashModulus) return; // Else find the next non-empty bucket while (fToEnum->fBucketList[fCurHash]==0) { // Bump to the next hash value. If we max out return fCurHash++; if (fCurHash == fToEnum->fHashModulus) return; } fCurElem = fToEnum->fBucketList[fCurHash]; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/RefHashTableOf.c000644 000765 000024 00000046772 13241160336 022203 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: RefHashTableOf.c 678409 2008-07-21 13:08:10Z borisk $ */ // --------------------------------------------------------------------------- // Include // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // RefHashTableOf: Constructors and Destructor // --------------------------------------------------------------------------- template RefHashTableOf::RefHashTableOf( const XMLSize_t modulus, MemoryManager* const manager) : fMemoryManager(manager) , fAdoptedElems(true) , fBucketList(0) , fHashModulus(modulus) , fInitialModulus(modulus) , fCount(0) { initialize(modulus); } template RefHashTableOf::RefHashTableOf( const XMLSize_t modulus, const THasher& hasher, MemoryManager* const manager) : fMemoryManager(manager) , fAdoptedElems(true) , fBucketList(0) , fHashModulus(modulus) , fInitialModulus(modulus) , fCount(0) , fHasher (hasher) { initialize(modulus); } template RefHashTableOf::RefHashTableOf( const XMLSize_t modulus, const bool adoptElems, MemoryManager* const manager) : fMemoryManager(manager) , fAdoptedElems(adoptElems) , fBucketList(0) , fHashModulus(modulus) , fInitialModulus(modulus) , fCount(0) { initialize(modulus); } template RefHashTableOf::RefHashTableOf( const XMLSize_t modulus, const bool adoptElems, const THasher& hasher, MemoryManager* const manager) : fMemoryManager(manager) , fAdoptedElems(adoptElems) , fBucketList(0) , fHashModulus(modulus) , fInitialModulus(modulus) , fCount(0) , fHasher (hasher) { initialize(modulus); } template void RefHashTableOf::initialize(const XMLSize_t modulus) { if (modulus == 0) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::HshTbl_ZeroModulus, fMemoryManager); // Allocate the bucket list and zero them fBucketList = (RefHashTableBucketElem**) fMemoryManager->allocate ( fHashModulus * sizeof(RefHashTableBucketElem*) ); for (XMLSize_t index = 0; index < fHashModulus; index++) fBucketList[index] = 0; } template RefHashTableOf::~RefHashTableOf() { cleanup(); } // --------------------------------------------------------------------------- // RefHashTableOf: Element management // --------------------------------------------------------------------------- template inline bool RefHashTableOf::isEmpty() const { return fCount==0; } template inline bool RefHashTableOf::containsKey(const void* const key) const { XMLSize_t hashVal; const RefHashTableBucketElem* findIt = findBucketElem(key, hashVal); return (findIt != 0); } template void RefHashTableOf:: removeKey(const void* const key) { // Hash the key XMLSize_t hashVal = fHasher.getHashVal(key, fHashModulus); // // Search the given bucket for this key. Keep up with the previous // element so we can patch around it. // RefHashTableBucketElem* curElem = fBucketList[hashVal]; RefHashTableBucketElem* lastElem = 0; while (curElem) { if (fHasher.equals(key, curElem->fKey)) { if (!lastElem) { // It was the first in the bucket fBucketList[hashVal] = curElem->fNext; } else { // Patch around the current element lastElem->fNext = curElem->fNext; } // If we adopted the data, then delete it too // (Note: the userdata hash table instance has data type of void *. // This will generate compiler warnings here on some platforms, but they // can be ignored since fAdoptedElements is false. if (fAdoptedElems) delete curElem->fData; // Then delete the current element and move forward // delete curElem; // destructor doesn't do anything... fMemoryManager->deallocate(curElem); fCount--; return; } // Move both pointers upwards lastElem = curElem; curElem = curElem->fNext; } // We never found that key ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::HshTbl_NoSuchKeyExists, fMemoryManager); } template void RefHashTableOf::removeAll() { if(isEmpty()) return; // Clean up the buckets first for (XMLSize_t buckInd = 0; buckInd < fHashModulus; buckInd++) { // Get the bucket list head for this entry RefHashTableBucketElem* curElem = fBucketList[buckInd]; RefHashTableBucketElem* nextElem; while (curElem) { // Save the next element before we hose this one nextElem = curElem->fNext; // If we adopted the data, then delete it too // (Note: the userdata hash table instance has data type of void *. // This will generate compiler warnings here on some platforms, but they // can be ignored since fAdoptedElements is false. if (fAdoptedElems) delete curElem->fData; // Then delete the current element and move forward // delete curElem; // destructor doesn't do anything... // curElem->~RefHashTableBucketElem(); fMemoryManager->deallocate(curElem); curElem = nextElem; } // Clean out this entry fBucketList[buckInd] = 0; } fCount = 0; } // This method returns the data associated with a key. The key entry is deleted. The caller // now owns the returned data (case of hashtable adopting the data). // This function is called by transferElement so that the undeleted data can be transferred // to a new key which will own that data. template TVal* RefHashTableOf:: orphanKey(const void* const key) { // Hash the key TVal* retVal = 0; XMLSize_t hashVal = fHasher.getHashVal(key, fHashModulus); // // Search the given bucket for this key. Keep up with the previous // element so we can patch around it. // RefHashTableBucketElem* curElem = fBucketList[hashVal]; RefHashTableBucketElem* lastElem = 0; while (curElem) { if (fHasher.equals(key, curElem->fKey)) { if (!lastElem) { // It was the first in the bucket fBucketList[hashVal] = curElem->fNext; } else { // Patch around the current element lastElem->fNext = curElem->fNext; } retVal = curElem->fData; // Delete the current element // delete curElem; // destructor doesn't do anything... // curElem->~RefHashTableBucketElem(); fMemoryManager->deallocate(curElem); break; } // Move both pointers upwards lastElem = curElem; curElem = curElem->fNext; } // We never found that key if (!retVal) ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::HshTbl_NoSuchKeyExists, fMemoryManager); return retVal; } // // cleanup(): // similar to destructor // called to cleanup the memory, in case destructor cannot be called // template void RefHashTableOf::cleanup() { removeAll(); // Then delete the bucket list & hasher fMemoryManager->deallocate(fBucketList); fBucketList = 0; } // // reinitialize(): // similar to constructor // called to re-construct the fElemList from scratch again // template void RefHashTableOf::reinitialize(const THasher& hasher) { if (fBucketList) cleanup(); fHasher = hasher; fHashModulus = fInitialModulus; initialize(fHashModulus); } // this function transfer the data from key1 to key2 // this is equivalent to calling // 1. get(key1) to retrieve the data, // 2. removeKey(key1), // 3. and then put(key2, data) // except that the data is not deleted in "removeKey" even it is adopted so that it // can be transferred to key2. // whatever key2 has originally will be purged (if adopted) template inline void RefHashTableOf::transferElement(const void* const key1, void* key2) { put(key2, orphanKey(key1)); } // --------------------------------------------------------------------------- // RefHashTableOf: Getters // --------------------------------------------------------------------------- template inline TVal* RefHashTableOf::get(const void* const key) { XMLSize_t hashVal; RefHashTableBucketElem* findIt = findBucketElem(key, hashVal); return findIt ? findIt->fData : 0; } template inline const TVal* RefHashTableOf:: get(const void* const key) const { XMLSize_t hashVal; const RefHashTableBucketElem* findIt = findBucketElem(key, hashVal); return findIt ? findIt->fData : 0; } template inline MemoryManager* RefHashTableOf::getMemoryManager() const { return fMemoryManager; } template inline XMLSize_t RefHashTableOf::getHashModulus() const { return fHashModulus; } template inline XMLSize_t RefHashTableOf::getCount() const { return fCount; } // --------------------------------------------------------------------------- // RefHashTableOf: Getters // --------------------------------------------------------------------------- template inline void RefHashTableOf::setAdoptElements(const bool aValue) { fAdoptedElems = aValue; } // --------------------------------------------------------------------------- // RefHashTableOf: Putters // --------------------------------------------------------------------------- template void RefHashTableOf::put(void* key, TVal* const valueToAdopt) { // Apply 0.75 load factor to find threshold. XMLSize_t threshold = fHashModulus * 3 / 4; // If we've grown too big, expand the table and rehash. if (fCount >= threshold) rehash(); // First see if the key exists already XMLSize_t hashVal; RefHashTableBucketElem* newBucket = findBucketElem(key, hashVal); // // If so,then update its value. If not, then we need to add it to // the right bucket // if (newBucket) { if (fAdoptedElems) delete newBucket->fData; newBucket->fData = valueToAdopt; newBucket->fKey = key; } else { newBucket = new (fMemoryManager->allocate(sizeof(RefHashTableBucketElem))) RefHashTableBucketElem(key, valueToAdopt, fBucketList[hashVal]); fBucketList[hashVal] = newBucket; fCount++; } } // --------------------------------------------------------------------------- // RefHashTableOf: Private methods // --------------------------------------------------------------------------- template void RefHashTableOf::rehash() { const XMLSize_t newMod = (fHashModulus * 2) + 1; RefHashTableBucketElem** newBucketList = (RefHashTableBucketElem**) fMemoryManager->allocate ( newMod * sizeof(RefHashTableBucketElem*) ); // Make sure the new bucket list is destroyed if an // exception is thrown. ArrayJanitor*> guard(newBucketList, fMemoryManager); memset(newBucketList, 0, newMod * sizeof(newBucketList[0])); // Rehash all existing entries. for (XMLSize_t index = 0; index < fHashModulus; index++) { // Get the bucket list head for this entry RefHashTableBucketElem* curElem = fBucketList[index]; while (curElem) { // Save the next element before we detach this one RefHashTableBucketElem* const nextElem = curElem->fNext; const XMLSize_t hashVal = fHasher.getHashVal(curElem->fKey, newMod); RefHashTableBucketElem* const newHeadElem = newBucketList[hashVal]; // Insert at the start of this bucket's list. curElem->fNext = newHeadElem; newBucketList[hashVal] = curElem; curElem = nextElem; } } RefHashTableBucketElem** const oldBucketList = fBucketList; // Everything is OK at this point, so update the // member variables. fBucketList = guard.release(); fHashModulus = newMod; // Delete the old bucket list. fMemoryManager->deallocate(oldBucketList);//delete[] oldBucketList; } template inline RefHashTableBucketElem* RefHashTableOf:: findBucketElem(const void* const key, XMLSize_t& hashVal) { // Hash the key hashVal = fHasher.getHashVal(key, fHashModulus); // Search that bucket for the key RefHashTableBucketElem* curElem = fBucketList[hashVal]; while (curElem) { if (fHasher.equals(key, curElem->fKey)) return curElem; curElem = curElem->fNext; } return 0; } template inline const RefHashTableBucketElem* RefHashTableOf:: findBucketElem(const void* const key, XMLSize_t& hashVal) const { // Hash the key hashVal = fHasher.getHashVal(key, fHashModulus); // Search that bucket for the key const RefHashTableBucketElem* curElem = fBucketList[hashVal]; while (curElem) { if (fHasher.equals(key, curElem->fKey)) return curElem; curElem = curElem->fNext; } return 0; } // --------------------------------------------------------------------------- // RefHashTableOfEnumerator: Constructors and Destructor // --------------------------------------------------------------------------- template RefHashTableOfEnumerator:: RefHashTableOfEnumerator(RefHashTableOf* const toEnum , const bool adopt , MemoryManager* const manager) : fAdopted(adopt), fCurElem(0), fCurHash((XMLSize_t)-1), fToEnum(toEnum) , fMemoryManager(manager) { if (!toEnum) ThrowXMLwithMemMgr(NullPointerException, XMLExcepts::CPtr_PointerIsZero, fMemoryManager); // // Find the next available bucket element in the hash table. If it // comes back zero, that just means the table is empty. // // Note that the -1 in the current hash tells it to start // from the beginning. // findNext(); } template RefHashTableOfEnumerator::~RefHashTableOfEnumerator() { if (fAdopted) delete fToEnum; } template RefHashTableOfEnumerator:: RefHashTableOfEnumerator(const RefHashTableOfEnumerator& toCopy) : XMLEnumerator(toCopy) , XMemory(toCopy) , fAdopted(toCopy.fAdopted) , fCurElem(toCopy.fCurElem) , fCurHash(toCopy.fCurHash) , fToEnum(toCopy.fToEnum) , fMemoryManager(toCopy.fMemoryManager) { } // --------------------------------------------------------------------------- // RefHashTableOfEnumerator: Enum interface // --------------------------------------------------------------------------- template bool RefHashTableOfEnumerator::hasMoreElements() const { // // If our current has is at the max and there are no more elements // in the current bucket, then no more elements. // if (!fCurElem && (fCurHash == fToEnum->fHashModulus)) return false; return true; } template TVal& RefHashTableOfEnumerator::nextElement() { // Make sure we have an element to return if (!hasMoreElements()) ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::Enum_NoMoreElements, fMemoryManager); // // Save the current element, then move up to the next one for the // next time around. // RefHashTableBucketElem* saveElem = fCurElem; findNext(); return *saveElem->fData; } template void* RefHashTableOfEnumerator::nextElementKey() { // Make sure we have an element to return if (!hasMoreElements()) ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::Enum_NoMoreElements, fMemoryManager); // // Save the current element, then move up to the next one for the // next time around. // RefHashTableBucketElem* saveElem = fCurElem; findNext(); return saveElem->fKey; } template void RefHashTableOfEnumerator::Reset() { fCurHash = (XMLSize_t)-1; fCurElem = 0; findNext(); } // --------------------------------------------------------------------------- // RefHashTableOfEnumerator: Private helper methods // --------------------------------------------------------------------------- template void RefHashTableOfEnumerator::findNext() { // // If there is a current element, move to its next element. If this // hits the end of the bucket, the next block will handle the rest. // if (fCurElem) fCurElem = fCurElem->fNext; // // If the current element is null, then we have to move up to the // next hash value. If that is the hash modulus, then we cannot // go further. // if (!fCurElem) { fCurHash++; if (fCurHash == fToEnum->fHashModulus) return; // Else find the next non-empty bucket while (fToEnum->fBucketList[fCurHash]==0) { // Bump to the next hash value. If we max out return fCurHash++; if (fCurHash == fToEnum->fHashModulus) return; } fCurElem = fToEnum->fBucketList[fCurHash]; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/version.rc.cmake.in000644 000765 000024 00000002665 13272177434 022765 0ustar00scantorstaff000000 000000 #include VS_VERSION_INFO VERSIONINFO FILEVERSION @xerces-c_VERSION_MAJOR@,@xerces-c_VERSION_MINOR@,@xerces-c_VERSION_PATCH@,0 PRODUCTVERSION @xerces-c_VERSION_MAJOR@,@xerces-c_VERSION_MINOR@,@xerces-c_VERSION_PATCH@,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS VS_FF_DEBUG #else FILEFLAGS 0x0L #endif FILEOS VOS_NT_WINDOWS32 FILETYPE VFT_DLL FILESUBTYPE VFT2_UNKNOWN BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "Comments", "Dynamic linked library for Xerces-C++\0" VALUE "CompanyName", "Apache Software Foundation\0" VALUE "FileDescription", "Shared Library for Xerces-C++ Version @xerces-c_VERSION@\0" VALUE "FileVersion", "@xerces-c_VERSION_MAJOR@, @xerces-c_VERSION_MINOR@, @xerces-c_VERSION_PATCH@\0" VALUE "InternalName", XERCES_DLL_NAME VALUE "LegalCopyright", "Copyright © 1999-2018 Apache Software Foundation; subject to licensing terms\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", XERCES_DLL_NAME VALUE "PrivateBuild", "\0" VALUE "ProductName", "Xerces-C++ Version @xerces-c_VERSION@\0" VALUE "ProductVersion", "@xerces-c_VERSION_MAJOR@, @xerces-c_VERSION_MINOR@, @xerces-c_VERSION_PATCH@\0" VALUE "SpecialBuild", "\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 0x04e4 END END xerces-c-3.2.2/src/xercesc/util/RefHashTableOf.hpp000644 000765 000024 00000022704 13241160336 022535 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: RefHashTableOf.hpp 679340 2008-07-24 10:28:29Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_REFHASHTABLEOF_HPP) #define XERCESC_INCLUDE_GUARD_REFHASHTABLEOF_HPP #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // Forward declare the enumerator so it can be our friend. // template class RefHashTableOfEnumerator; // // This should really be a nested class, but some of the compilers we // have to support cannot deal with that! // template struct RefHashTableBucketElem { RefHashTableBucketElem(void* key, TVal* const value, RefHashTableBucketElem* next) : fData(value), fNext(next), fKey(key) { } RefHashTableBucketElem(){}; ~RefHashTableBucketElem(){}; TVal* fData; RefHashTableBucketElem* fNext; void* fKey; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- RefHashTableBucketElem(const RefHashTableBucketElem&); RefHashTableBucketElem& operator=(const RefHashTableBucketElem&); }; template class RefHashTableOf : public XMemory { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- RefHashTableOf( const XMLSize_t modulus, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); RefHashTableOf( const XMLSize_t modulus, const THasher& hasher, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); RefHashTableOf( const XMLSize_t modulus, const bool adoptElems, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); RefHashTableOf( const XMLSize_t modulus, const bool adoptElems, const THasher& hasher, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~RefHashTableOf(); // ----------------------------------------------------------------------- // Element management // ----------------------------------------------------------------------- bool isEmpty() const; bool containsKey(const void* const key) const; void removeKey(const void* const key); void removeAll(); void cleanup(); void reinitialize(const THasher& hasher); void transferElement(const void* const key1, void* key2); TVal* orphanKey(const void* const key); // ----------------------------------------------------------------------- // Getters // ----------------------------------------------------------------------- TVal* get(const void* const key); const TVal* get(const void* const key) const; MemoryManager* getMemoryManager() const; XMLSize_t getHashModulus() const; XMLSize_t getCount() const; // ----------------------------------------------------------------------- // Setters // ----------------------------------------------------------------------- void setAdoptElements(const bool aValue); // ----------------------------------------------------------------------- // Putters // ----------------------------------------------------------------------- void put(void* key, TVal* const valueToAdopt); private : // ----------------------------------------------------------------------- // Declare our friends // ----------------------------------------------------------------------- friend class RefHashTableOfEnumerator; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- RefHashTableOf(const RefHashTableOf&); RefHashTableOf& operator=(const RefHashTableOf&); // ----------------------------------------------------------------------- // Private methods // ----------------------------------------------------------------------- RefHashTableBucketElem* findBucketElem(const void* const key, XMLSize_t& hashVal); const RefHashTableBucketElem* findBucketElem(const void* const key, XMLSize_t& hashVal) const; void initialize(const XMLSize_t modulus); void rehash(); // ----------------------------------------------------------------------- // Data members // // fAdoptedElems // Indicates whether the values added are adopted or just referenced. // If adopted, then they are deleted when they are removed from the // hash table. // // fBucketList // This is the array that contains the heads of all of the list // buckets, one for each possible hash value. // // fHashModulus // The modulus used for this hash table, to hash the keys. This is // also the number of elements in the bucket list. // // fHash // The hasher for the key data type. // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; bool fAdoptedElems; RefHashTableBucketElem** fBucketList; XMLSize_t fHashModulus; XMLSize_t fInitialModulus; XMLSize_t fCount; THasher fHasher; }; // // An enumerator for a value array. It derives from the basic enumerator // class, so that value vectors can be generically enumerated. // template class RefHashTableOfEnumerator : public XMLEnumerator, public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- RefHashTableOfEnumerator(RefHashTableOf* const toEnum , const bool adopt = false , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); virtual ~RefHashTableOfEnumerator(); RefHashTableOfEnumerator(const RefHashTableOfEnumerator&); // ----------------------------------------------------------------------- // Enum interface // ----------------------------------------------------------------------- bool hasMoreElements() const; TVal& nextElement(); void Reset(); // ----------------------------------------------------------------------- // New interface specific for key used in RefHashable // ----------------------------------------------------------------------- void* nextElementKey(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- RefHashTableOfEnumerator& operator=(const RefHashTableOfEnumerator&); // ----------------------------------------------------------------------- // Private methods // ----------------------------------------------------------------------- void findNext(); // ----------------------------------------------------------------------- // Data Members // // fAdopted // Indicates whether we have adopted the passed vector. If so then // we delete the vector when we are destroyed. // // fCurElem // This is the current bucket bucket element that we are on. // // fCurHash // The current hash buck that we are working on. Once we hit the // end of the bucket that fCurElem is in, then we have to start // working this one up to the next non-empty bucket. // // fToEnum // The value array being enumerated. // ----------------------------------------------------------------------- bool fAdopted; RefHashTableBucketElem* fCurElem; XMLSize_t fCurHash; RefHashTableOf* fToEnum; MemoryManager* const fMemoryManager; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/Hash2KeysSetOf.c000644 000765 000024 00000042076 13241160336 022161 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Hash2KeysSetOf.c 883368 2009-11-23 15:28:19Z amassari $ */ // --------------------------------------------------------------------------- // Include // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Hash2KeysSetOf: Constructors and Destructor // --------------------------------------------------------------------------- template Hash2KeysSetOf::Hash2KeysSetOf( const XMLSize_t modulus, MemoryManager* const manager) : fMemoryManager(manager) , fBucketList(0) , fHashModulus(modulus) , fCount(0) , fAvailable(0) { initialize(modulus); } template Hash2KeysSetOf::Hash2KeysSetOf( const XMLSize_t modulus, const THasher& hasher, MemoryManager* const manager) : fMemoryManager(manager) , fBucketList(0) , fHashModulus(modulus) , fCount(0) , fAvailable(0) , fHasher (hasher) { initialize(modulus); } template void Hash2KeysSetOf::initialize(const XMLSize_t modulus) { if (modulus == 0) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::HshTbl_ZeroModulus, fMemoryManager); // Allocate the bucket list and zero them fBucketList = (Hash2KeysSetBucketElem**) fMemoryManager->allocate ( fHashModulus * sizeof(Hash2KeysSetBucketElem*) ); //new Hash2KeysSetBucketElem*[fHashModulus]; memset(fBucketList, 0, sizeof(fBucketList[0]) * fHashModulus); } template Hash2KeysSetOf::~Hash2KeysSetOf() { Hash2KeysSetBucketElem* nextElem; if(!isEmpty()) { // Clean up the buckets first for (XMLSize_t buckInd = 0; buckInd < fHashModulus; buckInd++) { // Get the bucket list head for this entry Hash2KeysSetBucketElem* curElem = fBucketList[buckInd]; while (curElem) { // Save the next element before we hose this one nextElem = curElem->fNext; fMemoryManager->deallocate(curElem); curElem = nextElem; } // Clean out this entry fBucketList[buckInd] = 0; } } // Then delete the list of available blocks Hash2KeysSetBucketElem* curElem = fAvailable; while (curElem) { // Save the next element before we hose this one nextElem = curElem->fNext; fMemoryManager->deallocate(curElem); curElem = nextElem; } fAvailable = 0; // Then delete the bucket list & hasher fMemoryManager->deallocate(fBucketList); //delete [] fBucketList; fBucketList = 0; } // --------------------------------------------------------------------------- // Hash2KeysSetOf: Element management // --------------------------------------------------------------------------- template bool Hash2KeysSetOf::isEmpty() const { return (fCount==0); } template bool Hash2KeysSetOf::containsKey(const void* const key1, const int key2) const { XMLSize_t hashVal; const Hash2KeysSetBucketElem* findIt = findBucketElem(key1, key2, hashVal); return (findIt != 0); } template void Hash2KeysSetOf::removeKey(const void* const key1, const int key2) { // Hash the key XMLSize_t hashVal = fHasher.getHashVal(key1, fHashModulus); assert(hashVal < fHashModulus); // // Search the given bucket for this key. Keep up with the previous // element so we can patch around it. // Hash2KeysSetBucketElem* curElem = fBucketList[hashVal]; Hash2KeysSetBucketElem* lastElem = 0; while (curElem) { if((key2==curElem->fKey2) && (fHasher.equals(key1, curElem->fKey1))) { if (!lastElem) { // It was the first in the bucket fBucketList[hashVal] = curElem->fNext; } else { // Patch around the current element lastElem->fNext = curElem->fNext; } // Move the current element to the list of available blocks curElem->fNext=fAvailable; fAvailable=curElem; fCount--; return; } // Move both pointers upwards lastElem = curElem; curElem = curElem->fNext; } // We never found that key ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::HshTbl_NoSuchKeyExists, fMemoryManager); } template void Hash2KeysSetOf:: removeKey(const void* const key1) { // Hash the key XMLSize_t hashVal = fHasher.getHashVal(key1, fHashModulus); assert(hashVal < fHashModulus); // // Search the given bucket for this key. Keep up with the previous // element so we can patch around it. // Hash2KeysSetBucketElem* curElem = fBucketList[hashVal]; Hash2KeysSetBucketElem* lastElem = 0; while (curElem) { if(fHasher.equals(key1, curElem->fKey1)) { if (!lastElem) { // It was the first in the bucket fBucketList[hashVal] = curElem->fNext; } else { // Patch around the current element lastElem->fNext = curElem->fNext; } Hash2KeysSetBucketElem* toBeDeleted=curElem; curElem = curElem->fNext; // Move the current element to the list of available blocks toBeDeleted->fNext=fAvailable; fAvailable=toBeDeleted; fCount--; } else { // Move both pointers upwards lastElem = curElem; curElem = curElem->fNext; } } } template void Hash2KeysSetOf::removeAll() { if(isEmpty()) return; for (XMLSize_t buckInd = 0; buckInd < fHashModulus; buckInd++) { if(fBucketList[buckInd]!=0) { // Advance to the end of the chain, and connect it to the list of // available blocks Hash2KeysSetBucketElem* curElem = fBucketList[buckInd]; while (curElem->fNext) curElem = curElem->fNext; curElem->fNext=fAvailable; fAvailable=fBucketList[buckInd]; fBucketList[buckInd] = 0; } } fCount=0; } // --------------------------------------------------------------------------- // Hash2KeysSetOf: Getters // --------------------------------------------------------------------------- template MemoryManager* Hash2KeysSetOf::getMemoryManager() const { return fMemoryManager; } template XMLSize_t Hash2KeysSetOf::getHashModulus() const { return fHashModulus; } // --------------------------------------------------------------------------- // Hash2KeysSetOf: Putters // --------------------------------------------------------------------------- template void Hash2KeysSetOf::put(const void* key1, int key2) { // Apply 4 load factor to find threshold. XMLSize_t threshold = fHashModulus * 4; // If we've grown too big, expand the table and rehash. if (fCount >= threshold) rehash(); // First see if the key exists already XMLSize_t hashVal; Hash2KeysSetBucketElem* newBucket = findBucketElem(key1, key2, hashVal); // // If so,then update its value. If not, then we need to add it to // the right bucket // if (newBucket) { newBucket->fKey1 = key1; newBucket->fKey2 = key2; } else { if(fAvailable==0) newBucket = (Hash2KeysSetBucketElem*)fMemoryManager->allocate(sizeof(Hash2KeysSetBucketElem)); else { newBucket = fAvailable; fAvailable = fAvailable->fNext; } newBucket->fKey1 = key1; newBucket->fKey2 = key2; newBucket->fNext = fBucketList[hashVal]; fBucketList[hashVal] = newBucket; fCount++; } } template bool Hash2KeysSetOf::putIfNotPresent(const void* key1, int key2) { // First see if the key exists already XMLSize_t hashVal; Hash2KeysSetBucketElem* newBucket = findBucketElem(key1, key2, hashVal); // // If so,then update its value. If not, then we need to add it to // the right bucket // if (newBucket) return false; // Apply 4 load factor to find threshold. XMLSize_t threshold = fHashModulus * 4; // If we've grown too big, expand the table and rehash. if (fCount >= threshold) rehash(); if(fAvailable==0) newBucket = (Hash2KeysSetBucketElem*)fMemoryManager->allocate(sizeof(Hash2KeysSetBucketElem)); else { newBucket = fAvailable; fAvailable = fAvailable->fNext; } newBucket->fKey1 = key1; newBucket->fKey2 = key2; newBucket->fNext = fBucketList[hashVal]; fBucketList[hashVal] = newBucket; fCount++; return true; } // --------------------------------------------------------------------------- // Hash2KeysSetOf: Private methods // --------------------------------------------------------------------------- template inline Hash2KeysSetBucketElem* Hash2KeysSetOf:: findBucketElem(const void* const key1, const int key2, XMLSize_t& hashVal) { // Hash the key hashVal = fHasher.getHashVal(key1, fHashModulus); assert(hashVal < fHashModulus); // Search that bucket for the key Hash2KeysSetBucketElem* curElem = fBucketList[hashVal]; while (curElem) { if((key2==curElem->fKey2) && (fHasher.equals(key1, curElem->fKey1))) return curElem; curElem = curElem->fNext; } return 0; } template inline const Hash2KeysSetBucketElem* Hash2KeysSetOf:: findBucketElem(const void* const key1, const int key2, XMLSize_t& hashVal) const { // Hash the key hashVal = fHasher.getHashVal(key1, fHashModulus); assert(hashVal < fHashModulus); // Search that bucket for the key const Hash2KeysSetBucketElem* curElem = fBucketList[hashVal]; while (curElem) { if((key2==curElem->fKey2) && (fHasher.equals(key1, curElem->fKey1))) return curElem; curElem = curElem->fNext; } return 0; } template void Hash2KeysSetOf:: rehash() { const XMLSize_t newMod = (fHashModulus * 8)+1; Hash2KeysSetBucketElem** newBucketList = (Hash2KeysSetBucketElem**) fMemoryManager->allocate ( newMod * sizeof(Hash2KeysSetBucketElem*) );//new Hash2KeysSetBucketElem*[fHashModulus]; // Make sure the new bucket list is destroyed if an // exception is thrown. ArrayJanitor guard(newBucketList, fMemoryManager); memset(newBucketList, 0, newMod * sizeof(newBucketList[0])); // Rehash all existing entries. for (XMLSize_t index = 0; index < fHashModulus; index++) { // Get the bucket list head for this entry Hash2KeysSetBucketElem* curElem = fBucketList[index]; while (curElem) { // Save the next element before we detach this one Hash2KeysSetBucketElem* nextElem = curElem->fNext; const XMLSize_t hashVal = fHasher.getHashVal(curElem->fKey1, newMod); assert(hashVal < newMod); Hash2KeysSetBucketElem* newHeadElem = newBucketList[hashVal]; // Insert at the start of this bucket's list. curElem->fNext = newHeadElem; newBucketList[hashVal] = curElem; curElem = nextElem; } } Hash2KeysSetBucketElem** const oldBucketList = fBucketList; // Everything is OK at this point, so update the // member variables. fBucketList = guard.release(); fHashModulus = newMod; // Delete the old bucket list. fMemoryManager->deallocate(oldBucketList);//delete[] oldBucketList; } // --------------------------------------------------------------------------- // Hash2KeysSetOfEnumerator: Constructors and Destructor // --------------------------------------------------------------------------- template Hash2KeysSetOfEnumerator:: Hash2KeysSetOfEnumerator(Hash2KeysSetOf* const toEnum , const bool adopt , MemoryManager* const manager) : fAdopted(adopt), fCurElem(0), fCurHash((XMLSize_t)-1), fToEnum(toEnum) , fMemoryManager(manager) , fLockPrimaryKey(0) { if (!toEnum) ThrowXMLwithMemMgr(NullPointerException, XMLExcepts::CPtr_PointerIsZero, fMemoryManager); // // Find the next available bucket element in the hash table. If it // comes back zero, that just means the table is empty. // // Note that the -1 in the current hash tells it to start // from the beginning. // findNext(); } template Hash2KeysSetOfEnumerator::~Hash2KeysSetOfEnumerator() { if (fAdopted) delete fToEnum; } // --------------------------------------------------------------------------- // Hash2KeysSetOfEnumerator: Enum interface // --------------------------------------------------------------------------- template bool Hash2KeysSetOfEnumerator::hasMoreElements() const { // // If our current has is at the max and there are no more elements // in the current bucket, then no more elements. // if (!fCurElem && (fCurHash == fToEnum->fHashModulus)) return false; return true; } template void Hash2KeysSetOfEnumerator::nextElementKey(const void*& retKey1, int& retKey2) { // Make sure we have an element to return if (!hasMoreElements()) ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::Enum_NoMoreElements, fMemoryManager); // // Save the current element, then move up to the next one for the // next time around. // Hash2KeysSetBucketElem* saveElem = fCurElem; findNext(); retKey1 = saveElem->fKey1; retKey2 = saveElem->fKey2; return; } template void Hash2KeysSetOfEnumerator::Reset() { if(fLockPrimaryKey) fCurHash=fToEnum->fHasher.getHashVal(fLockPrimaryKey, fToEnum->fHashModulus); else fCurHash = (XMLSize_t)-1; fCurElem = 0; findNext(); } template void Hash2KeysSetOfEnumerator::setPrimaryKey(const void* key) { fLockPrimaryKey=key; Reset(); } // --------------------------------------------------------------------------- // Hash2KeysSetOfEnumerator: Private helper methods // --------------------------------------------------------------------------- template void Hash2KeysSetOfEnumerator::findNext() { // Code to execute if we have to return only values with the primary key if(fLockPrimaryKey) { if(!fCurElem) fCurElem = fToEnum->fBucketList[fCurHash]; else fCurElem = fCurElem->fNext; while (fCurElem && (!fToEnum->fHasher.equals(fLockPrimaryKey, fCurElem->fKey1))) fCurElem = fCurElem->fNext; // if we didn't found it, make so hasMoreElements() returns false if(!fCurElem) fCurHash = fToEnum->fHashModulus; return; } // // If there is a current element, move to its next element. If this // hits the end of the bucket, the next block will handle the rest. // if (fCurElem) fCurElem = fCurElem->fNext; // // If the current element is null, then we have to move up to the // next hash value. If that is the hash modulus, then we cannot // go further. // if (!fCurElem) { fCurHash++; if (fCurHash == fToEnum->fHashModulus) return; // Else find the next non-empty bucket while (fToEnum->fBucketList[fCurHash]==0) { // Bump to the next hash value. If we max out return fCurHash++; if (fCurHash == fToEnum->fHashModulus) return; } fCurElem = fToEnum->fBucketList[fCurHash]; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLString.hpp000644 000765 000024 00000170003 13241160336 021603 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLString.hpp 1677601 2015-05-04 14:20:36Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLSTRING_HPP) #define XERCESC_INCLUDE_GUARD_XMLSTRING_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLLCPTranscoder; /** * Class for representing native character strings and handling common string * operations * * This class is Unicode compliant. This class is designed primarily * for internal use, but due to popular demand, it is being made * publicly available. Users of this class must understand that this * is not an officially supported class. All public methods of this * class are static functions. * */ class XMLUTIL_EXPORT XMLString { public: /* Static methods for native character mode string manipulation */ /** @name String concatenation functions */ //@{ /** Concatenates two strings. * * catString appends src to target and * terminates the resulting string with a null character. The initial character * of src overwrites the terminating character of target * . * * No overflow checking is performed when strings are copied or appended. * The behavior of catString is undefined if source and * destination strings overlap. * * @param target Null-terminated destination string * @param src Null-terminated source string */ static void catString ( char* const target , const char* const src ); /** Concatenates two strings. * * catString appends src to target and * terminates the resulting string with a null character. The initial character of * src overwrites the terminating character of target. * No overflow checking is performed when strings are copied or appended. * The behavior of catString is undefined if source and destination * strings overlap. * * @param target Null-terminated destination string * @param src Null-terminated source string */ static void catString ( XMLCh* const target , const XMLCh* const src ); //@} /** @name String comparison functions */ //@{ /** Lexicographically compares lowercase versions of str1 and * str2 and returns a value indicating their relationship. * @param str1 Null-terminated string to compare * @param str2 Null-terminated string to compare * * @return The return value indicates the relation of str1 to * str2 as follows * Less than 0 means str1 is less than str2 * Equal to 0 means str1 is identical to str2 * Greater than 0 means str1 is more than str2 */ static int compareIString ( const char* const str1 , const char* const str2 ); /** Lexicographically compares lowercase versions of str1 and * str2 and returns a value indicating their relationship. * @param str1 Null-terminated string to compare * @param str2 Null-terminated string to compare * @return The return value indicates the relation of str1 to * str2 as follows * Less than 0 means str1 is less than str2 * Equal to 0 means str1 is identical to str2 * Greater than 0 means str1 is more than str2 */ static int compareIString ( const XMLCh* const str1 , const XMLCh* const str2 ); /** Lexicographically compares lowercase versions of str1 and * str2 and returns a value indicating their relationship. * The routine only lowercases A to Z. * @param str1 Null-terminated ASCII string to compare * @param str2 Null-terminated ASCII string to compare * @return The return value indicates the relation of str1 to * str2 as follows * Less than 0 means str1 is less than str2 * Equal to 0 means str1 is identical to str2 * Greater than 0 means str1 is more than str2 */ static int compareIStringASCII ( const XMLCh* const str1 , const XMLCh* const str2 ); /** Lexicographically compares, at most, the first count characters in * str1 and str2 and returns a value indicating the * relationship between the substrings. * @param str1 Null-terminated string to compare * @param str2 Null-terminated string to compare * @param count The number of characters to compare * * @return The return value indicates the relation of str1 to * str2 as follows * Less than 0 means str1 is less than str2 * Equal to 0 means str1 is identical to str2 * Greater than 0 means str1 is more than str2 */ static int compareNString ( const char* const str1 , const char* const str2 , const XMLSize_t count ); /** Lexicographically compares, at most, the first count characters in * str1 and str2 and returns a value indicating * the relationship between the substrings. * @param str1 Null-terminated string to compare * @param str2 Null-terminated string to compare * @param count The number of characters to compare * * @return The return value indicates the relation of str1 to * str2 as follows * Less than 0 means str1 is less than str2 * Equal to 0 means str1 is identical to str2 * Greater than 0 means str1 is more than str2 */ static int compareNString ( const XMLCh* const str1 , const XMLCh* const str2 , const XMLSize_t count ); /** Lexicographically compares, at most, the first count characters in * str1 and str2 without regard to case and * returns a value indicating the relationship between the substrings. * * @param str1 Null-terminated string to compare * @param str2 Null-terminated string to compare * @param count The number of characters to compare * @return The return value indicates the relation of str1 to * str2 as follows * Less than 0 means str1 is less than str2 * Equal to 0 means str1 is identical to str2 * Greater than 0 means str1 is more than str2 */ static int compareNIString ( const char* const str1 , const char* const str2 , const XMLSize_t count ); /** Lexicographically compares, at most, the first count characters in * str1 and str2 without regard to case and * returns a value indicating the relationship between the substrings. * * @param str1 Null-terminated string to compare * @param str2 Null-terminated string to compare * @param count The number of characters to compare * * @return The return value indicates the relation of str1 to * str2 as follows * Less than 0 means str1 is less than str2 * Equal to 0 means str1 is identical to str2 * Greater than 0 means str1 is more than str2 */ static int compareNIString ( const XMLCh* const str1 , const XMLCh* const str2 , const XMLSize_t count ); /** Lexicographically compares str1 and str2 and * returns a value indicating their relationship. * * @param str1 Null-terminated string to compare * @param str2 Null-terminated string to compare * * @return The return value indicates the relation of str1 to * str2 as follows * Less than 0 means str1 is less than str2 * Equal to 0 means str1 is identical to str2 * Greater than 0 means str1 is more than str2 */ static int compareString ( const char* const str1 , const char* const str2 ); /** Lexicographically compares str1 and str2 and * returns a value indicating their relationship. * * @param str1 Null-terminated string to compare * @param str2 Null-terminated string to compare * @return The return value indicates the relation of str1 to * str2 as follows * Less than 0 means str1 is less than str2 * Equal to 0 means str1 is identical to str2 * Greater than 0 means str1 is more than str2 */ static int compareString ( const XMLCh* const str1 , const XMLCh* const str2 ); /** compares str1 and str2 * * @param str1 Null-terminated string to compare * @param str2 Null-terminated string to compare * @return true if two strings are equal, false if not * If one string is null, while the other is zero-length string, * it is considered as equal. */ static bool equals ( const XMLCh* str1 , const XMLCh* str2 ); /** compares str1 and str2 * * @param str1 string to compare * @param str2 string to compare * @param n number of characters to compare * @return true if two strings are equal, false if not * If one string is null, while the other is zero-length string, * it is considered as equal. */ static bool equalsN ( const XMLCh* str1 , const XMLCh* str2 , XMLSize_t n ); static bool equals ( const char* str1 , const char* str2 ); /** compares str1 and str2 * * @param str1 string to compare * @param str2 string to compare * @param n number of characters to compare * @return true if two strings are equal, false if not * If one string is null, while the other is zero-length string, * it is considered as equal. */ static bool equalsN ( const char* str1 , const char* str2 , XMLSize_t n ); /** Lexicographically compares str1 and str2 * regions and returns true if they are equal, otherwise false. * * A substring of str1 is compared to a substring of * str2. The result is true if these substrings represent * identical character sequences. The substring of str1 * to be compared begins at offset1 and has length charCount. The * substring of str2 to be compared begins at offset2 and * has length charCount. The result is false if and only if at least * one of the following is true: * offset1 is negative. * offset2 is negative. * offset1+charCount is greater than the length of str1. * offset2+charCount is greater than the length of str2. * There is some nonnegative integer k less than charCount such that: * str1.charAt(offset1+k) != str2.charAt(offset2+k) * * @param str1 Null-terminated string to compare * @param offset1 Starting offset of str1 * @param str2 Null-terminated string to compare * @param offset2 Starting offset of str2 * @param charCount The number of characters to compare * @return true if the specified subregion of str1 exactly * matches the specified subregion of str2>; false * otherwise. */ static bool regionMatches ( const XMLCh* const str1 , const int offset1 , const XMLCh* const str2 , const int offset2 , const XMLSize_t charCount ); /** Lexicographically compares str1 and str2 * regions without regard to case and returns true if they are equal, * otherwise false. * * A substring of str1 is compared to a substring of * str2. The result is true if these substrings represent * identical character sequences. The substring of str1 * to be compared begins at offset1 and has length charCount. The * substring of str2 to be compared begins at offset2 and * has length charCount. The result is false if and only if at least * one of the following is true: * offset1 is negative. * offset2 is negative. * offset1+charCount is greater than the length of str1. * offset2+charCount is greater than the length of str2. * There is some nonnegative integer k less than charCount such that: * str1.charAt(offset1+k) != str2.charAt(offset2+k) * * @param str1 Null-terminated string to compare * @param offset1 Starting offset of str1 * @param str2 Null-terminated string to compare * @param offset2 Starting offset of str2 * @param charCount The number of characters to compare * @return true if the specified subregion of str1 exactly * matches the specified subregion of str2>; false * otherwise. */ static bool regionIMatches ( const XMLCh* const str1 , const int offset1 , const XMLCh* const str2 , const int offset2 , const XMLSize_t charCount ); //@} /** @name String copy functions */ //@{ /** Copies src, including the terminating null character, to the * location specified by target. * * No overflow checking is performed when strings are copied or appended. * The behavior of strcpy is undefined if the source and destination strings * overlap. * * @param target Destination string * @param src Null-terminated source string */ static void copyString ( char* const target , const char* const src ); /** Copies src, including the terminating null character, to * the location specified by target. * * No overflow checking is performed when strings are copied or appended. * The behavior of copyString is undefined if the source and * destination strings overlap. * * @param target Destination string * @param src Null-terminated source string */ static void copyString ( XMLCh* const target , const XMLCh* const src ); /** Copies src, upto a fixed number of characters, to the * location specified by target. * * No overflow checking is performed when strings are copied or appended. * The behavior of copyNString is undefined if the source and * destination strings overlap. * * @param target Destination string. The size of the buffer should * atleast be 'maxChars + 1'. * @param src Null-terminated source string * @param maxChars The maximum number of characters to copy */ static bool copyNString ( XMLCh* const target , const XMLCh* const src , const XMLSize_t maxChars ); //@} /** @name Hash functions */ //@{ /** Hashes a string given a modulus * * @param toHash The string to hash * @param hashModulus The divisor to be used for hashing * @return Returns the hash value */ static XMLSize_t hash ( const char* const toHash , const XMLSize_t hashModulus ); /** Hashes a string given a modulus * * @param toHash The string to hash * @param hashModulus The divisor to be used for hashing * @return Returns the hash value */ static XMLSize_t hash ( const XMLCh* const toHash , const XMLSize_t hashModulus ); /** Hashes a string given a modulus taking a maximum number of characters * as the limit * * @param toHash The string to hash * @param numChars The maximum number of characters to consider for hashing * @param hashModulus The divisor to be used for hashing * @return Returns the hash value */ static XMLSize_t hashN ( const XMLCh* const toHash , const XMLSize_t numChars , const XMLSize_t hashModulus ); //@} /** @name Search functions */ //@{ /** * Provides the index of the first occurrence of a character within a string * * @param toSearch The string to search * @param ch The character to search within the string * @return If found, returns the index of the character within the string, * else returns -1. */ static int indexOf(const char* const toSearch, const char ch); /** * Provides the index of the first occurrence of a character within a string * * @param toSearch The string to search * @param ch The character to search within the string * @return If found, returns the index of the character within the string, * else returns -1. */ static int indexOf(const XMLCh* const toSearch, const XMLCh ch); /** * Provides the index of the first occurrence of a character within a string * starting from a given index * * @param toSearch The string to search * @param chToFind The character to search within the string * @param fromIndex The index to start searching from * @param manager The MemoryManager to use to allocate objects * @return If found, returns the index of the character within the string, * else returns -1. */ static int indexOf ( const char* const toSearch , const char chToFind , const XMLSize_t fromIndex , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Provides the index of the first occurrence of a character within a string * starting from a given index * * @param toSearch The string to search * @param chToFind The character to search within the string * @param fromIndex The index to start searching from * @param manager The MemoryManager to use to allocate objects * @return If found, returns the index of the character within the string, * else returns -1. */ static int indexOf ( const XMLCh* const toSearch , const XMLCh chToFind , const XMLSize_t fromIndex , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Provides the index of the last occurrence of a character within a string * * @param toSearch The string to search * @param ch The character to search within the string * @return If found, returns the index of the character within the string, * else returns -1. */ static int lastIndexOf(const char* const toSearch, const char ch); /** * Provides the index of the last occurrence of a character within a string * * @param toSearch The string to search * @param ch The character to search within the string * @return If found, returns the index of the character within the string, * else returns -1. */ static int lastIndexOf(const XMLCh* const toSearch, const XMLCh ch); /** * Provides the index of the last occurrence of a character within a string * * @param ch The character to search within the string * @param toSearch The string to search * @param toSearchLen The length of the string to search * @return If found, returns the index of the character within the string, * else returns -1. */ static int lastIndexOf ( const XMLCh ch , const XMLCh* const toSearch , const XMLSize_t toSearchLen ); /** * Provides the index of the last occurrence of a character within a string * starting backward from a given index * * @param toSearch The string to search * @param chToFind The character to search within the string * @param fromIndex The index to start backward search from * @param manager The MemoryManager to use to allocate objects * @return If found, returns the index of the character within the string, * else returns -1. */ static int lastIndexOf ( const char* const toSearch , const char chToFind , const XMLSize_t fromIndex , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Provides the index of the last occurrence of a character within a string * starting backward from a given index * * @param toSearch The string to search * @param ch The character to search within the string * @param fromIndex The index to start backward search from * @param manager The MemoryManager to use to allocate objects * @return If found, returns the index of the character within the string, * else returns -1. */ static int lastIndexOf ( const XMLCh* const toSearch , const XMLCh ch , const XMLSize_t fromIndex , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** @name Fixed size string movement */ //@{ /** Moves X number of chars * @param targetStr The string to copy the chars to * @param srcStr The string to copy the chars from * @param count The number of chars to move */ static void moveChars ( XMLCh* const targetStr , const XMLCh* const srcStr , const XMLSize_t count ); //@} /** @name Substring function */ //@{ /** Create a substring of a given string. The substring begins at the * specified beginIndex and extends to the character at index * endIndex - 1. * @param targetStr The string to copy the chars to * @param srcStr The string to copy the chars from * @param startIndex beginning index, inclusive. * @param endIndex the ending index, exclusive. * @param manager The MemoryManager to use to allocate objects */ static void subString ( char* const targetStr , const char* const srcStr , const XMLSize_t startIndex , const XMLSize_t endIndex , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Create a substring of a given string. The substring begins at the * specified beginIndex and extends to the character at index * endIndex - 1. * @param targetStr The string to copy the chars to * @param srcStr The string to copy the chars from * @param startIndex beginning index, inclusive. * @param endIndex the ending index, exclusive. * @param manager The MemoryManager to use to allocate objects */ static void subString ( XMLCh* const targetStr , const XMLCh* const srcStr , const XMLSize_t startIndex , const XMLSize_t endIndex , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Create a substring of a given string. The substring begins at the * specified beginIndex and extends to the character at index * endIndex - 1. * @param targetStr The string to copy the chars to * @param srcStr The string to copy the chars from * @param startIndex beginning index, inclusive. * @param endIndex the ending index, exclusive. * @param srcStrLength the length of srcStr * @param manager The MemoryManager to use to allocate objects */ static void subString ( XMLCh* const targetStr , const XMLCh* const srcStr , const XMLSize_t startIndex , const XMLSize_t endIndex , const XMLSize_t srcStrLength , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** @name Replication function */ //@{ /** Replicates a string * NOTE: The returned buffer is allocated with the MemoryManager. It is the * responsibility of the caller to delete it when not longer needed. * You can call XMLString::release to release this returned buffer. * * @param toRep The string to replicate * @param manager The MemoryManager to use to allocate the string * @return Returns a pointer to the replicated string * @see XMLString::release(char**, MemoryManager*) */ static char* replicate(const char* const toRep, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Replicates a string * NOTE: The returned buffer is allocated with the MemoryManager. It is the * responsibility of the caller to delete it when not longer needed. * You can call XMLString::release to release this returned buffer. * * @param toRep The string to replicate * @param manager The MemoryManager to use to allocate the string * @return Returns a pointer to the replicated string * @see XMLString::release(XMLCh**, MemoryManager*) */ static XMLCh* replicate(const XMLCh* const toRep, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); //@} /** @name String query function */ //@{ /** Tells if the sub-string appears within a string at the beginning * @param toTest The string to test * @param prefix The sub-string that needs to be checked * @return Returns true if the sub-string was found at the beginning of * toTest, else false */ static bool startsWith ( const char* const toTest , const char* const prefix ); /** Tells if the sub-string appears within a string at the beginning * @param toTest The string to test * @param prefix The sub-string that needs to be checked * @return Returns true if the sub-string was found at the beginning of * toTest, else false */ static bool startsWith ( const XMLCh* const toTest , const XMLCh* const prefix ); /** Tells if the sub-string appears within a string at the beginning * without regard to case * * @param toTest The string to test * @param prefix The sub-string that needs to be checked * @return Returns true if the sub-string was found at the beginning of * toTest, else false */ static bool startsWithI ( const char* const toTest , const char* const prefix ); /** Tells if the sub-string appears within a string at the beginning * without regard to case * * @param toTest The string to test * @param prefix The sub-string that needs to be checked * * @return Returns true if the sub-string was found at the beginning * of toTest, else false */ static bool startsWithI ( const XMLCh* const toTest , const XMLCh* const prefix ); /** Tells if the sub-string appears within a string at the end. * @param toTest The string to test * @param suffix The sub-string that needs to be checked * @return Returns true if the sub-string was found at the end of * toTest, else false */ static bool endsWith ( const XMLCh* const toTest , const XMLCh* const suffix ); /** Tells if a string has any occurrence of any character of another * string within itself * @param toSearch The string to be searched * @param searchList The string from which characters to be searched for are drawn * @return Returns the pointer to the location where the first occurrence of any * character from searchList is found, * else returns 0 */ static const XMLCh* findAny ( const XMLCh* const toSearch , const XMLCh* const searchList ); /** Tells if a string has any occurrence of any character of another * string within itself * @param toSearch The string to be searched * @param searchList The string from which characters to be searched for are drawn * @return Returns the pointer to the location where the first occurrence of any * character from searchList is found, * else returns 0 */ static XMLCh* findAny ( XMLCh* const toSearch , const XMLCh* const searchList ); /** Tells if a string has pattern within itself * @param toSearch The string to be searched * @param pattern The pattern to be located within the string * @return Returns index to the location where the pattern was * found, else returns -1 */ static int patternMatch ( const XMLCh* const toSearch , const XMLCh* const pattern ); /** Get the length of the string * @param src The string whose length is to be determined * @return Returns the length of the string */ static XMLSize_t stringLen(const char* const src); /** Get the length of the string * @param src The string whose length is to be determined * @return Returns the length of the string */ static XMLSize_t stringLen(const XMLCh* const src); /** * * Checks whether an name is a valid NOTATION according to XML 1.0 * @param name The string to check its NOTATION validity * @param manager The memory manager * @return Returns true if name is NOTATION valid, otherwise false */ static bool isValidNOTATION(const XMLCh* const name , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Checks whether an name is a valid EncName. * @param name The string to check its EncName validity * @return Returns true if name is EncName valid, otherwise false */ static bool isValidEncName(const XMLCh* const name); /** * Checks whether a character is within [a-zA-Z]. * @param theChar the character to check * @return Returns true if within the range, otherwise false */ static bool isAlpha(XMLCh const theChar); /** * Checks whether a character is within [0-9]. * @param theChar the character to check * @return Returns true if within the range, otherwise false */ static bool isDigit(XMLCh const theChar); /** * Checks whether a character is within [0-9a-zA-Z]. * @param theChar the character to check * @return Returns true if within the range, otherwise false */ static bool isAlphaNum(XMLCh const theChar); /** * Checks whether a character is within [0-9a-fA-F]. * @param theChar the character to check * @return Returns true if within the range, otherwise false */ static bool isHex(XMLCh const theChar); /** Find is the string appears in the enum list * @param toFind the string to be found * @param enumList the list * return true if found */ static bool isInList(const XMLCh* const toFind, const XMLCh* const enumList); //@} /** @name Conversion functions */ //@{ /** Converts size to a text string based a given radix * * @param toFormat The size to convert * @param toFill The buffer that will hold the output on return. The * size of this buffer should at least be 'maxChars + 1'. * @param maxChars The maximum number of output characters that can be * accepted. If the result will not fit, it is an error. * @param radix The radix of the input data, based on which the conversion * @param manager The MemoryManager to use to allocate objects * will be done */ static void sizeToText ( const XMLSize_t toFormat , char* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Converts size to a text string based a given radix * * @param toFormat The size to convert * @param toFill The buffer that will hold the output on return. The * size of this buffer should at least be 'maxChars + 1'. * @param maxChars The maximum number of output characters that can be * accepted. If the result will not fit, it is an error. * @param radix The radix of the input data, based on which the conversion * @param manager The MemoryManager to use to allocate objects * will be done */ static void sizeToText ( const XMLSize_t toFormat , XMLCh* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Converts binary data to a text string based a given radix * * @param toFormat The number to convert * @param toFill The buffer that will hold the output on return. The * size of this buffer should at least be 'maxChars + 1'. * @param maxChars The maximum number of output characters that can be * accepted. If the result will not fit, it is an error. * @param radix The radix of the input data, based on which the conversion * @param manager The MemoryManager to use to allocate objects * will be done */ static void binToText ( const unsigned int toFormat , char* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Converts binary data to a text string based a given radix * * @param toFormat The number to convert * @param toFill The buffer that will hold the output on return. The * size of this buffer should at least be 'maxChars + 1'. * @param maxChars The maximum number of output characters that can be * accepted. If the result will not fit, it is an error. * @param radix The radix of the input data, based on which the conversion * @param manager The MemoryManager to use to allocate objects * will be done */ static void binToText ( const unsigned int toFormat , XMLCh* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Converts binary data to a text string based a given radix * * @param toFormat The number to convert * @param toFill The buffer that will hold the output on return. The * size of this buffer should at least be 'maxChars + 1'. * @param maxChars The maximum number of output characters that can be * accepted. If the result will not fit, it is an error. * @param radix The radix of the input data, based on which the conversion * @param manager The MemoryManager to use to allocate objects * will be done */ static void binToText ( const unsigned long toFormat , char* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Converts binary data to a text string based a given radix * * @param toFormat The number to convert * @param toFill The buffer that will hold the output on return. The * size of this buffer should at least be 'maxChars + 1'. * @param maxChars The maximum number of output characters that can be * accepted. If the result will not fit, it is an error. * @param radix The radix of the input data, based on which the conversion * @param manager The MemoryManager to use to allocate objects * will be done */ static void binToText ( const unsigned long toFormat , XMLCh* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Converts binary data to a text string based a given radix * * @param toFormat The number to convert * @param toFill The buffer that will hold the output on return. The * size of this buffer should at least be 'maxChars + 1'. * @param maxChars The maximum number of output characters that can be * accepted. If the result will not fit, it is an error. * @param radix The radix of the input data, based on which the conversion * @param manager The MemoryManager to use to allocate objects * will be done */ static void binToText ( const int toFormat , char* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Converts binary data to a text string based a given radix * * @param toFormat The number to convert * @param toFill The buffer that will hold the output on return. The * size of this buffer should at least be 'maxChars + 1'. * @param maxChars The maximum number of output characters that can be * accepted. If the result will not fit, it is an error. * @param radix The radix of the input data, based on which the conversion * @param manager The MemoryManager to use to allocate objects * will be done */ static void binToText ( const int toFormat , XMLCh* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Converts binary data to a text string based a given radix * * @param toFormat The number to convert * @param toFill The buffer that will hold the output on return. The * size of this buffer should at least be 'maxChars + 1'. * @param maxChars The maximum number of output characters that can be * accepted. If the result will not fit, it is an error. * @param radix The radix of the input data, based on which the conversion * @param manager The MemoryManager to use to allocate objects * will be done */ static void binToText ( const long toFormat , char* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Converts binary data to a text string based a given radix * * @param toFormat The number to convert * @param toFill The buffer that will hold the output on return. The * size of this buffer should at least be 'maxChars + 1'. * @param maxChars The maximum number of output characters that can be * accepted. If the result will not fit, it is an error. * @param radix The radix of the input data, based on which the conversion * @param manager The MemoryManager to use to allocate objects * will be done */ static void binToText ( const long toFormat , XMLCh* const toFill , const XMLSize_t maxChars , const unsigned int radix , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Converts a string of decimal chars to a binary value * * Note that leading and trailing whitespace is legal and will be ignored * but the remainder must be all decimal digits. * * @param toConvert The string of digits to convert * @param toFill The unsigned int value to fill with the converted * value. * @param manager The MemoryManager to use to allocate objects */ static bool textToBin ( const XMLCh* const toConvert , unsigned int& toFill , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Converts a string of decimal chars to a binary value * * Note that leading and trailing whitespace is legal and will be ignored, * * Only one and either of (+,-) after the leading whitespace, before * any other characters are allowed. * * but the remainder must be all decimal digits. * * @param toConvert The string of digits to convert * @param manager The MemoryManager to use to allocate objects */ static int parseInt ( const XMLCh* const toConvert , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Cut leading chars from a string * * @param toCutFrom The string to cut chars from * @param count The count of leading chars to cut */ static void cut ( XMLCh* const toCutFrom , const XMLSize_t count ); /** Transcodes a string to native code-page * * NOTE: The returned buffer is dynamically allocated and is the * responsibility of the caller to delete it when not longer needed. * You can call XMLString::release to release this returned buffer. * * @param toTranscode The string to be transcoded * @param manager The MemoryManager to use to allocate objects * @return Returns the transcoded string * @see XMLString::release(XMLCh**, MemoryManager*) */ static char* transcode ( const XMLCh* const toTranscode , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Transcodes a string to native code-page (DEPRECATED) * * Be aware that when transcoding to an external encoding, that each * Unicode char can create multiple output bytes. So you cannot assume * a one to one correspondence of input chars to output bytes. * * @param toTranscode The string tobe transcoded * @param toFill The buffer that is filled with the transcoded value. * The size of this buffer should atleast be 'maxChars + 1'. * @param maxChars The maximum number of bytes that the output * buffer can hold (not including the null, which is why * toFill should be at least maxChars+1.). * @param manager The MemoryManager to use to allocate objects * @return Returns true if successful, false if there was an error */ static bool transcode ( const XMLCh* const toTranscode , char* const toFill , const XMLSize_t maxChars , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Transcodes a string to native code-page * * NOTE: The returned buffer is dynamically allocated and is the * responsibility of the caller to delete it when not longer needed. * You can call XMLString::release to release this returned buffer. * * @param toTranscode The string to be transcoded * @param manager The MemoryManager to use to allocate objects * @return Returns the transcoded string * @see XMLString::release(char**, MemoryManager*) */ static XMLCh* transcode ( const char* const toTranscode , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Transcodes a string to native code-page (DEPRECATED) * @param toTranscode The string tobe transcoded * @param toFill The buffer that is filled with the transcoded value. * The size of this buffer should atleast be 'maxChars + 1'. * @param maxChars The maximum number of characters that the output * buffer can hold (not including the null, which is why * toFill should be at least maxChars+1.). * @param manager The MemoryManager to use to allocate objects * @return Returns true if successful, false if there was an error */ static bool transcode ( const char* const toTranscode , XMLCh* const toFill , const XMLSize_t maxChars , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Trims off extra space characters from the start and end of the string, * moving the non-space string content back to the start. * @param toTrim The string to be trimmed. On return this contains the * trimmed string */ static void trim(char* const toTrim); /** Trims off extra space characters from the start and end of the string, * moving the non-space string content back to the start. * @param toTrim The string to be trimmed. On return this contains * the trimmed string */ static void trim(XMLCh* const toTrim); /** Break a string into tokens with space as delimiter, and * stored in a string vector. The caller owns the string vector * that is returned, and is responsible for deleting it. * @param tokenizeSrc String to be tokenized * @param manager The MemoryManager to use to allocate objects * @return a vector of all the tokenized string */ static BaseRefVectorOf* tokenizeString(const XMLCh* const tokenizeSrc , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Break a string into tokens with the given character as delimiter, and * stored in a string vector. The caller owns the string vector * that is returned, and is responsible for deleting it. * @param tokenizeSrc String to be tokenized * @param delimiter Delimiter character * @param manager The MemoryManager to use to allocate objects * @return a vector of all the tokenized string */ static BaseRefVectorOf* tokenizeString(const XMLCh* const tokenizeSrc , XMLCh delimiter , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); //@} /** @name Formatting functions */ //@{ /** Creates a UName from a URI and base name. It is in the form * {url}name, and is commonly used internally to represent fully * qualified names when namespaces are enabled. * * @param pszURI The URI part of the name * @param pszName The base part of the name * @return Returns the complete formatted UName */ static XMLCh* makeUName ( const XMLCh* const pszURI , const XMLCh* const pszName ); /** * Internal function to perform token replacement for strings. * * @param errText The text (NULL terminated) where the replacement * is to be done. The size of this buffer should be * 'maxChars + 1' to account for the final NULL. * @param maxChars The size of the output buffer, i.e. the maximum * number of characters that it will hold. If the result is * larger, it will be truncated. * @param text1 Replacement text-one * @param text2 Replacement text-two * @param text3 Replacement text-three * @param text4 Replacement text-four * @param manager The MemoryManager to use to allocate objects * @return Returns the count of characters that are outputted */ static XMLSize_t replaceTokens ( XMLCh* const errText , const XMLSize_t maxChars , const XMLCh* const text1 , const XMLCh* const text2 , const XMLCh* const text3 , const XMLCh* const text4 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Converts a string to uppercase * @param toUpperCase The string which needs to be converted to uppercase. * On return, this buffer also holds the converted uppercase string */ static void upperCase(XMLCh* const toUpperCase); /** Converts a string to uppercase * The routine only uppercases A to Z (other characters not changed). * @param toUpperCase The string which needs to be converted to uppercase. * On return, this buffer also holds the converted uppercase string */ static void upperCaseASCII(XMLCh* const toUpperCase); /** Converts a string to lowercase * @param toLowerCase The string which needs to be converted to lowercase. * On return, this buffer also holds the converted lowercase string */ static void lowerCase(XMLCh* const toLowerCase); /** Converts a string to lowercase * The routine only lowercases a to z (other characters not changed). * @param toLowerCase The string which needs to be converted to lowercase. * On return, this buffer also holds the converted lowercase string */ static void lowerCaseASCII(XMLCh* const toLowerCase); /** Check if string is WhiteSpace:replace * @param toCheck The string which needs to be checked. */ static bool isWSReplaced(const XMLCh* const toCheck); /** Check if string is WhiteSpace:collapse * @param toCheck The string which needs to be checked. */ static bool isWSCollapsed(const XMLCh* const toCheck); /** Replace whitespace * @param toConvert The string which needs to be whitespace replaced. * On return , this buffer also holds the converted string * @param manager The MemoryManager to use to allocate objects */ static void replaceWS(XMLCh* toConvert , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Collapse whitespace * @param toConvert The string which needs to be whitespace collapsed. * On return , this buffer also holds the converted string * @param manager The MemoryManager to use to allocate objects */ static void collapseWS(XMLCh* toConvert , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Remove whitespace * @param toConvert The string which needs to be whitespace removed. * On return , this buffer also holds the converted string * @param manager The MemoryManager to use to allocate objects */ static void removeWS(XMLCh* toConvert , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Remove character * @param srcString The string * @param toRemove The character needs to be removed from the string * @param dstBuffer The buffer containing the result */ static void removeChar(const XMLCh* const srcString , const XMLCh& toRemove , XMLBuffer& dstBuffer); /** * Fixes a platform dependent absolute path filename to standard URI form. * 1. Windows: fix 'x:' to 'file:///x:' and convert any backslash to forward slash * 2. UNIX: fix '/blah/blahblah' to 'file:///blah/blahblah' * @param str The string that has the absolute path filename * @param target The target string pre-allocated to store the fixed uri */ static void fixURI(const XMLCh* const str, XMLCh* const target); //@} /** @name String Memory Management functions */ //@{ /** * Release the parameter string that was allocated by XMLString::transcode and XMLString::replicate. * The implementation will call MemoryManager::deallocate and then turn the string to a null pointer. * * @param buf The string to be deleted and become a null pointer. * @param manager The MemoryManager used to allocate the string */ static void release ( char** buf , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Release the parameter string that was allocated by XMLString::transcode and XMLString::replicate. * The implementation will call MemoryManager::deallocate and then turn the string to a null pointer. * * @param buf The string to be deleted and become a null pointer. * @param manager The MemoryManager used to allocate the string */ static void release ( XMLCh** buf , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} private : /** @name Constructors and Destructor */ //@{ /** Unimplemented default constructor */ XMLString(); /** Unimplemented destructor */ ~XMLString(); //@} /** @name Initialization */ //@{ /** Init/Term methods called from XMLPlatformUtils class */ static void initString(XMLLCPTranscoder* const defToUse, MemoryManager* const manager); static void termString(); //@} /** * Called by regionMatches/regionIMatches to validate that we * have a valid input */ static bool validateRegion(const XMLCh* const str1, const int offset1, const XMLCh* const str2, const int offset2, const XMLSize_t charCount); static MemoryManager* fgMemoryManager; friend class XMLPlatformUtils; }; // --------------------------------------------------------------------------- // Inline some methods that are either just passthroughs to other string // methods, or which are key for performance. // --------------------------------------------------------------------------- inline void XMLString::moveChars( XMLCh* const targetStr , const XMLCh* const srcStr , const XMLSize_t count) { memmove(targetStr, srcStr, count * sizeof(XMLCh)); } inline XMLSize_t XMLString::stringLen(const XMLCh* const src) { if (src == 0) return 0; const XMLCh* pszTmp = src; while (*pszTmp++) ; return (pszTmp - src - 1); } inline XMLCh* XMLString::replicate(const XMLCh* const toRep, MemoryManager* const manager) { // If a null string, return a null string! XMLCh* ret = 0; if (toRep) { const XMLSize_t len = stringLen(toRep); ret = (XMLCh*) manager->allocate((len+1) * sizeof(XMLCh)); //new XMLCh[len + 1]; memcpy(ret, toRep, (len + 1) * sizeof(XMLCh)); } return ret; } inline bool XMLString::startsWith( const XMLCh* const toTest , const XMLCh* const prefix) { return (compareNString(toTest, prefix, stringLen(prefix)) == 0); } inline bool XMLString::startsWithI( const XMLCh* const toTest , const XMLCh* const prefix) { return (compareNIString(toTest, prefix, stringLen(prefix)) == 0); } inline bool XMLString::endsWith(const XMLCh* const toTest, const XMLCh* const suffix) { XMLSize_t suffixLen = XMLString::stringLen(suffix); return regionMatches(toTest, (int)(XMLString::stringLen(toTest) - suffixLen), suffix, 0, suffixLen); } inline bool XMLString::validateRegion(const XMLCh* const str1, const int offset1, const XMLCh* const str2, const int offset2, const XMLSize_t charCount) { if (offset1 < 0 || offset2 < 0 || (offset1 + charCount) > XMLString::stringLen(str1) || (offset2 + charCount) > XMLString::stringLen(str2) ) return false; return true; } inline bool XMLString::equals( const XMLCh* str1 , const XMLCh* str2) { if (str1 == str2) return true; if (str1 == 0 || str2 == 0) return ((!str1 || !*str1) && (!str2 || !*str2)); while (*str1) if(*str1++ != *str2++) // they are different (or str2 is shorter and we hit the NULL) return false; // either both ended (and *str2 is 0 too), or str2 is longer return (*str2==0); } inline bool XMLString::equalsN(const XMLCh* str1, const XMLCh* str2, XMLSize_t n) { if (str1 == str2 || n == 0) return true; if (str1 == 0 || str2 == 0) return ((!str1 || !*str1) && (!str2 || !*str2)); for (; n != 0 && *str1 && *str2; --n, ++str1, ++str2) if(*str1 != *str2) break; return n == 0 || *str1 == *str2; // either equal or both ended premat. } inline bool XMLString::equals( const char* str1 , const char* str2) { if (str1 == str2) return true; if (str1 == 0 || str2 == 0) return ((!str1 || !*str1) && (!str2 || !*str2)); while (*str1) if(*str1++ != *str2++) // they are different (or str2 is shorter and we hit the NULL) return false; // either both ended (and *str2 is 0 too), or str2 is longer return (*str2==0); } inline bool XMLString::equalsN(const char* str1, const char* str2, XMLSize_t n) { if (str1 == str2 || n == 0) return true; if (str1 == 0 || str2 == 0) return ((!str1 || !*str1) && (!str2 || !*str2)); for (; n != 0 && *str1 && *str2; --n, ++str1, ++str2) if(*str1 != *str2) break; return n == 0 || *str1 == *str2; // either equal or both ended premat. } inline int XMLString::lastIndexOf(const XMLCh* const toSearch, const XMLCh ch) { return XMLString::lastIndexOf(ch, toSearch, stringLen(toSearch)); } inline XMLSize_t XMLString::hash(const XMLCh* const tohash , const XMLSize_t hashModulus) { if (tohash == 0 || *tohash == 0) return 0; const XMLCh* curCh = tohash; XMLSize_t hashVal = (XMLSize_t)(*curCh++); while (*curCh) hashVal = (hashVal * 38) + (hashVal >> 24) + (XMLSize_t)(*curCh++); // Divide by modulus return hashVal % hashModulus; } inline XMLSize_t XMLString::hashN(const XMLCh* const tohash , const XMLSize_t n , const XMLSize_t hashModulus) { if (tohash == 0 || n == 0) return 0; const XMLCh* curCh = tohash; XMLSize_t hashVal = (XMLSize_t)(*curCh++); for(XMLSize_t i=0;i> 24) + (XMLSize_t)(*curCh++); // Divide by modulus return hashVal % hashModulus; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/NetAccessors/000755 000765 000024 00000000000 13345765734 021660 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/util/XMLUni.hpp000644 000765 000024 00000034477 13241160336 021106 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLUni.hpp 1798755 2017-06-14 20:54:41Z rleigh $ */ // --------------------------------------------------------------------------- // This file contains the grunt work constants for Unicode characters and // common Unicode constant strings. These cannot be created normally because // we have to compile on systems that cannot do the L"" style prefix. So // they must be created as constant values for Unicode code points and the // strings built up as arrays of those constants. // --------------------------------------------------------------------------- #if !defined(XERCESC_INCLUDE_GUARD_XMLUNI_HPP) #define XERCESC_INCLUDE_GUARD_XMLUNI_HPP #include XERCES_CPP_NAMESPACE_BEGIN // Ignore warning about private constructor #ifdef __GNUC__ # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wctor-dtor-privacy" #endif class XMLUTIL_EXPORT XMLUni { public : // ----------------------------------------------------------------------- // These are constant strings that are common in XML data. Because // of the limitation of the compilers we have to work with, these are // done as arrays of XMLCh characters, not as constant strings. // ----------------------------------------------------------------------- static const XMLCh fgAnyString[]; static const XMLCh fgAttListString[]; static const XMLCh fgCommentString[]; static const XMLCh fgCDATAString[]; static const XMLCh fgDefaultString[]; static const XMLCh fgDocTypeString[]; static const XMLCh fgEBCDICEncodingString[]; static const XMLCh fgElemString[]; static const XMLCh fgEmptyString[]; static const XMLCh fgEncodingString[]; static const XMLCh fgEntitString[]; static const XMLCh fgEntityString[]; static const XMLCh fgEntitiesString[]; static const XMLCh fgEnumerationString[]; static const XMLCh fgExceptDomain[]; static const XMLCh fgFixedString[]; static const XMLCh fgIBM037EncodingString[]; static const XMLCh fgIBM037EncodingString2[]; static const XMLCh fgIBM1047EncodingString[]; static const XMLCh fgIBM1047EncodingString2[]; static const XMLCh fgIBM1140EncodingString[]; static const XMLCh fgIBM1140EncodingString2[]; static const XMLCh fgIBM1140EncodingString3[]; static const XMLCh fgIBM1140EncodingString4[]; static const XMLCh fgIESString[]; static const XMLCh fgIDString[]; static const XMLCh fgIDRefString[]; static const XMLCh fgIDRefsString[]; static const XMLCh fgImpliedString[]; static const XMLCh fgIgnoreString[]; static const XMLCh fgIncludeString[]; static const XMLCh fgISO88591EncodingString[]; static const XMLCh fgISO88591EncodingString2[]; static const XMLCh fgISO88591EncodingString3[]; static const XMLCh fgISO88591EncodingString4[]; static const XMLCh fgISO88591EncodingString5[]; static const XMLCh fgISO88591EncodingString6[]; static const XMLCh fgISO88591EncodingString7[]; static const XMLCh fgISO88591EncodingString8[]; static const XMLCh fgISO88591EncodingString9[]; static const XMLCh fgISO88591EncodingString10[]; static const XMLCh fgISO88591EncodingString11[]; static const XMLCh fgISO88591EncodingString12[]; static const XMLCh fgLocalHostString[]; static const XMLCh fgNoString[]; static const XMLCh fgNotationString[]; static const XMLCh fgNDATAString[]; static const XMLCh fgNmTokenString[]; static const XMLCh fgNmTokensString[]; static const XMLCh fgPCDATAString[]; static const XMLCh fgPIString[]; static const XMLCh fgPubIDString[]; static const XMLCh fgRefString[]; static const XMLCh fgRequiredString[]; static const XMLCh fgStandaloneString[]; static const XMLCh fgVersion1[]; static const XMLCh fgVersion1_0[]; static const XMLCh fgVersion1_1[]; static const XMLCh fgSysIDString[]; static const XMLCh fgUnknownURIName[]; static const XMLCh fgUCS4EncodingString[]; static const XMLCh fgUCS4EncodingString2[]; static const XMLCh fgUCS4EncodingString3[]; static const XMLCh fgUCS4EncodingString4[]; static const XMLCh fgUCS4EncodingString5[]; static const XMLCh fgUCS4BEncodingString[]; static const XMLCh fgUCS4BEncodingString2[]; static const XMLCh fgUCS4LEncodingString[]; static const XMLCh fgUCS4LEncodingString2[]; static const XMLCh fgUSASCIIEncodingString[]; static const XMLCh fgUSASCIIEncodingString2[]; static const XMLCh fgUSASCIIEncodingString3[]; static const XMLCh fgUSASCIIEncodingString4[]; static const XMLCh fgUTF8EncodingString[]; static const XMLCh fgUTF8EncodingString2[]; static const XMLCh fgUTF16EncodingString[]; static const XMLCh fgUTF16EncodingString2[]; static const XMLCh fgUTF16EncodingString3[]; static const XMLCh fgUTF16EncodingString4[]; static const XMLCh fgUTF16EncodingString5[]; static const XMLCh fgUTF16EncodingString6[]; static const XMLCh fgUTF16EncodingString7[]; static const XMLCh fgUTF16BEncodingString[]; static const XMLCh fgUTF16BEncodingString2[]; static const XMLCh fgUTF16LEncodingString[]; static const XMLCh fgUTF16LEncodingString2[]; static const XMLCh fgVersionString[]; static const XMLCh fgValidityDomain[]; static const XMLCh fgWin1252EncodingString[]; static const XMLCh fgXMLChEncodingString[]; static const XMLCh fgXMLDOMMsgDomain[]; static const XMLCh fgXMLString[]; static const XMLCh fgXMLStringSpace[]; static const XMLCh fgXMLStringHTab[]; static const XMLCh fgXMLStringCR[]; static const XMLCh fgXMLStringLF[]; static const XMLCh fgXMLStringSpaceU[]; static const XMLCh fgXMLStringHTabU[]; static const XMLCh fgXMLStringCRU[]; static const XMLCh fgXMLStringLFU[]; static const XMLCh fgXMLDeclString[]; static const XMLCh fgXMLDeclStringSpace[]; static const XMLCh fgXMLDeclStringHTab[]; static const XMLCh fgXMLDeclStringLF[]; static const XMLCh fgXMLDeclStringCR[]; static const XMLCh fgXMLDeclStringSpaceU[]; static const XMLCh fgXMLDeclStringHTabU[]; static const XMLCh fgXMLDeclStringLFU[]; static const XMLCh fgXMLDeclStringCRU[]; static const XMLCh fgXMLNSString[]; static const XMLCh fgXMLNSColonString[]; static const XMLCh fgXMLNSURIName[]; static const XMLCh fgXMLErrDomain[]; static const XMLCh fgXMLURIName[]; static const XMLCh fgInfosetURIName[]; static const XMLCh fgYesString[]; static const XMLCh fgZeroLenString[]; static const XMLCh fgDTDEntityString[]; static const XMLCh fgAmp[]; static const XMLCh fgLT[]; static const XMLCh fgGT[]; static const XMLCh fgQuot[]; static const XMLCh fgApos[]; static const XMLCh fgWFXMLScanner[]; static const XMLCh fgIGXMLScanner[]; static const XMLCh fgSGXMLScanner[]; static const XMLCh fgDGXMLScanner[]; static const XMLCh fgXSAXMLScanner[]; static const XMLCh fgCDataStart[]; static const XMLCh fgCDataEnd[]; // Exception Name static const XMLCh fgArrayIndexOutOfBoundsException_Name[]; static const XMLCh fgEmptyStackException_Name[]; static const XMLCh fgIllegalArgumentException_Name[]; static const XMLCh fgInvalidCastException_Name[]; static const XMLCh fgIOException_Name[]; static const XMLCh fgNoSuchElementException_Name[]; static const XMLCh fgNullPointerException_Name[]; static const XMLCh fgXMLPlatformUtilsException_Name[]; static const XMLCh fgRuntimeException_Name[]; static const XMLCh fgTranscodingException_Name[]; static const XMLCh fgUnexpectedEOFException_Name[]; static const XMLCh fgUnsupportedEncodingException_Name[]; static const XMLCh fgUTFDataFormatException_Name[]; static const XMLCh fgNetAccessorException_Name[]; static const XMLCh fgMalformedURLException_Name[]; static const XMLCh fgNumberFormatException_Name[]; static const XMLCh fgParseException_Name[]; static const XMLCh fgInvalidDatatypeFacetException_Name[]; static const XMLCh fgInvalidDatatypeValueException_Name[]; static const XMLCh fgSchemaDateTimeException_Name[]; static const XMLCh fgXPathException_Name[]; static const XMLCh fgXSerializationException_Name[]; static const XMLCh fgXMLXIncludeException_Name[]; // Numerical String static const XMLCh fgNegINFString[]; static const XMLCh fgNegZeroString[]; static const XMLCh fgPosZeroString[]; static const XMLCh fgPosINFString[]; static const XMLCh fgNaNString[]; static const XMLCh fgEString[]; static const XMLCh fgZeroString[]; static const XMLCh fgNullString[]; // Xerces features/properties names static const XMLCh fgXercesDynamic[]; static const XMLCh fgXercesSchema[]; static const XMLCh fgXercesSchemaFullChecking[]; static const XMLCh fgXercesLoadSchema[]; static const XMLCh fgXercesIdentityConstraintChecking[]; static const XMLCh fgXercesSchemaExternalSchemaLocation[]; static const XMLCh fgXercesSchemaExternalNoNameSpaceSchemaLocation[]; static const XMLCh fgXercesSecurityManager[]; static const XMLCh fgXercesLoadExternalDTD[]; static const XMLCh fgXercesContinueAfterFatalError[]; static const XMLCh fgXercesValidationErrorAsFatal[]; static const XMLCh fgXercesUserAdoptsDOMDocument[]; static const XMLCh fgXercesCacheGrammarFromParse[]; static const XMLCh fgXercesUseCachedGrammarInParse[]; static const XMLCh fgXercesScannerName[]; static const XMLCh fgXercesParserUseDocumentFromImplementation[]; static const XMLCh fgXercesCalculateSrcOfs[]; static const XMLCh fgXercesStandardUriConformant[]; static const XMLCh fgXercesDOMHasPSVIInfo[]; static const XMLCh fgXercesGenerateSyntheticAnnotations[]; static const XMLCh fgXercesValidateAnnotations[]; static const XMLCh fgXercesIgnoreCachedDTD[]; static const XMLCh fgXercesIgnoreAnnotations[]; static const XMLCh fgXercesDisableDefaultEntityResolution[]; static const XMLCh fgXercesSkipDTDValidation[]; static const XMLCh fgXercesEntityResolver[]; static const XMLCh fgXercesHandleMultipleImports[]; static const XMLCh fgXercesDoXInclude[]; static const XMLCh fgXercesLowWaterMark[]; // SAX2 features/properties names static const XMLCh fgSAX2CoreValidation[]; static const XMLCh fgSAX2CoreNameSpaces[]; static const XMLCh fgSAX2CoreNameSpacePrefixes[]; // Introduced in DOM Level 3 // DOMLSParser features static const XMLCh fgDOMCanonicalForm[]; static const XMLCh fgDOMCDATASections[]; static const XMLCh fgDOMComments[]; static const XMLCh fgDOMCharsetOverridesXMLEncoding[]; static const XMLCh fgDOMCheckCharacterNormalization[]; static const XMLCh fgDOMDatatypeNormalization[]; static const XMLCh fgDOMDisallowDoctype[]; static const XMLCh fgDOMElementContentWhitespace[]; static const XMLCh fgDOMErrorHandler[]; static const XMLCh fgDOMEntities[]; static const XMLCh fgDOMIgnoreUnknownCharacterDenormalization[]; static const XMLCh fgDOMInfoset[]; static const XMLCh fgDOMNamespaces[]; static const XMLCh fgDOMNamespaceDeclarations[]; static const XMLCh fgDOMNormalizeCharacters[]; static const XMLCh fgDOMResourceResolver[]; static const XMLCh fgDOMSchemaLocation[]; static const XMLCh fgDOMSchemaType[]; static const XMLCh fgDOMSplitCDATASections[]; static const XMLCh fgDOMSupportedMediatypesOnly[]; static const XMLCh fgDOMValidate[]; static const XMLCh fgDOMValidateIfSchema[]; static const XMLCh fgDOMWellFormed[]; static const XMLCh fgDOMXMLSchemaType[]; static const XMLCh fgDOMDTDType[]; // Introduced in DOM Level 3 // DOMLSSerializer feature static const XMLCh fgDOMWRTCanonicalForm[]; static const XMLCh fgDOMWRTDiscardDefaultContent[]; static const XMLCh fgDOMWRTEntities[]; static const XMLCh fgDOMWRTFormatPrettyPrint[]; static const XMLCh fgDOMWRTNormalizeCharacters[]; static const XMLCh fgDOMWRTSplitCdataSections[]; static const XMLCh fgDOMWRTValidation[]; static const XMLCh fgDOMWRTWhitespaceInElementContent[]; static const XMLCh fgDOMWRTBOM[]; static const XMLCh fgDOMXMLDeclaration[]; static const XMLCh fgDOMWRTXercesPrettyPrint[]; // Private interface names static const XMLCh fgXercescInterfacePSVITypeInfo[]; static const XMLCh fgXercescInterfaceDOMDocumentTypeImpl[]; static const XMLCh fgXercescInterfaceDOMDocumentImpl[]; static const XMLCh fgXercescInterfaceDOMMemoryManager[]; // Locale static const char fgXercescDefaultLocale[]; // Default Exception String static const XMLCh fgDefErrMsg[]; // Datatype static const XMLCh fgValueZero[]; static const XMLCh fgNegOne[]; static const XMLCh fgValueOne[]; static const XMLCh fgLongMaxInc[]; static const XMLCh fgLongMinInc[]; static const XMLCh fgIntMaxInc[]; static const XMLCh fgIntMinInc[]; static const XMLCh fgShortMaxInc[]; static const XMLCh fgShortMinInc[]; static const XMLCh fgByteMaxInc[]; static const XMLCh fgByteMinInc[]; static const XMLCh fgULongMaxInc[]; static const XMLCh fgUIntMaxInc[]; static const XMLCh fgUShortMaxInc[]; static const XMLCh fgUByteMaxInc[]; static const XMLCh fgLangPattern[]; static const XMLCh fgBooleanValueSpace[][8]; static const XMLSize_t fgBooleanValueSpaceArraySize; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLUni(); }; #ifdef __GNUC__ # pragma GCC diagnostic pop #endif XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/PSVIUni.hpp000644 000765 000024 00000021153 13241160336 021212 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: PSVIUni.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_PSVIUNI_HPP) #define XERCESC_INCLUDE_GUARD_PSVIUNI_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT PSVIUni { public : static const XMLCh fgPsvColon[]; //Infoset Element Names static const XMLCh fgAllDeclarationsProcessed[]; static const XMLCh fgAttribute[]; static const XMLCh fgAttributes[]; static const XMLCh fgAttributeType[]; static const XMLCh fgBaseURI[]; static const XMLCh fgCharacter[]; static const XMLCh fgCharacterEncodingScheme[]; static const XMLCh fgChildren[]; static const XMLCh fgComment[]; static const XMLCh fgContent[]; static const XMLCh fgDocument[]; static const XMLCh fgDocTypeDeclaration[]; static const XMLCh fgDocumentElement[]; static const XMLCh fgElement[]; static const XMLCh fgInScopeNamespaces[]; static const XMLCh fgLocalName[]; static const XMLCh fgNamespace[]; static const XMLCh fgNamespaceAttributes[]; static const XMLCh fgNamespaceName[]; static const XMLCh fgNormalizedValue[]; static const XMLCh fgNotations[]; static const XMLCh fgPrefix[]; static const XMLCh fgProcessingInstruction[]; static const XMLCh fgReferences[]; static const XMLCh fgSpecified[]; static const XMLCh fgStandalone[]; static const XMLCh fgTarget[]; static const XMLCh fgText[]; static const XMLCh fgTextContent[]; static const XMLCh fgUnparsedEntities[]; static const XMLCh fgVersion[]; //PSVI Element Names static const XMLCh fgAbstract[]; static const XMLCh fgAnnotation[]; static const XMLCh fgAnnotations[]; static const XMLCh fgApplicationInformation[]; static const XMLCh fgAttributeDeclaration[]; static const XMLCh fgAttributeGroupDefinition[]; static const XMLCh fgAttributeUse[]; static const XMLCh fgAttributeUses[]; static const XMLCh fgAttributeWildcard[]; static const XMLCh fgBaseTypeDefinition[]; static const XMLCh fgCanonicalRepresentation[]; static const XMLCh fgComplexTypeDefinition[]; static const XMLCh fgCompositor[]; static const XMLCh fgContentType[]; static const XMLCh fgDeclaration[]; static const XMLCh fgDerivationMethod[]; static const XMLCh fgDisallowedSubstitutions[]; static const XMLCh fgPsvDocument[]; static const XMLCh fgDocumentLocation[]; static const XMLCh fgElementDeclaration[]; static const XMLCh fgFacets[]; static const XMLCh fgFacetFixed[]; static const XMLCh fgFields[]; static const XMLCh fgFinal[]; static const XMLCh fgFundamentalFacets[]; static const XMLCh fgIdentityConstraintCategory[]; static const XMLCh fgIdentityConstraintDefinition[]; static const XMLCh fgIdentityConstraintDefinitions[]; static const XMLCh fgIdentityConstraintTable[]; static const XMLCh fgIdIdrefTable[]; static const XMLCh fgItemTypeDefinition[]; static const XMLCh fgMaxOccurs[]; static const XMLCh fgMemberTypeDefinition[]; static const XMLCh fgMemberTypeDefinitions[]; static const XMLCh fgMinOccurs[]; static const XMLCh fgModelGroup[]; static const XMLCh fgModelGroupDefinition[]; static const XMLCh fgName[]; static const XMLCh fgNamespaceConstraint[]; static const XMLCh fgNamespaces[]; static const XMLCh fgNamespaceSchemaInformation[]; static const XMLCh fgNil[]; static const XMLCh fgNillable[]; static const XMLCh fgNotation[]; static const XMLCh fgNotationDeclaration[]; static const XMLCh fgParticle[]; static const XMLCh fgParticles[]; static const XMLCh fgPrimitiveTypeDefinition[]; static const XMLCh fgProcessContents[]; static const XMLCh fgProhibitedSubstitutions[]; static const XMLCh fgPublicIdentifier[]; static const XMLCh fgReferencedKey[]; static const XMLCh fgRequired[]; static const XMLCh fgSchemaAnnotations[]; static const XMLCh fgSchemaComponents[]; static const XMLCh fgSchemaDefault[]; static const XMLCh fgSchemaDocument[]; static const XMLCh fgSchemaDocuments[]; static const XMLCh fgSchemaErrorCode[]; static const XMLCh fgSchemaInformation[]; static const XMLCh fgSchemaNamespace[]; static const XMLCh fgSchemaNormalizedValue[]; static const XMLCh fgSchemaSpecified[]; static const XMLCh fgScope[]; static const XMLCh fgSelector[]; static const XMLCh fgSimpleTypeDefinition[]; static const XMLCh fgSubstitutionGroupAffiliation[]; static const XMLCh fgSubstitutionGroupExclusions[]; static const XMLCh fgSystemIdentifier[]; static const XMLCh fgTargetNamespace[]; static const XMLCh fgTerm[]; static const XMLCh fgTypeDefinition[]; static const XMLCh fgUserInformation[]; static const XMLCh fgValidationAttempted[]; static const XMLCh fgValidationContext[]; static const XMLCh fgValidity[]; static const XMLCh fgValue[]; static const XMLCh fgValueConstraint[]; static const XMLCh fgVariety[]; static const XMLCh fgWildcard[]; static const XMLCh fgXpath[]; //PSVI Element Values static const XMLCh fgAll[]; static const XMLCh fgAny[]; static const XMLCh fgAppinfo[]; static const XMLCh fgAtomic[]; static const XMLCh fgChoice[]; static const XMLCh fgDefault[]; static const XMLCh fgDocumentation[]; static const XMLCh fgElementOnly[]; static const XMLCh fgEmpty[]; static const XMLCh fgExtension[]; static const XMLCh fgFalse[]; static const XMLCh fgFull[]; static const XMLCh fgGlobal[]; static const XMLCh fgInfoset[]; static const XMLCh fgInvalid[]; static const XMLCh fgKey[]; static const XMLCh fgKeyref[]; static const XMLCh fgLax[]; static const XMLCh fgList[]; static const XMLCh fgLocal[]; static const XMLCh fgMixed[]; static const XMLCh fgNone[]; static const XMLCh fgNotKnown[]; static const XMLCh fgNsNamespace[]; static const XMLCh fgOnePointZero[]; static const XMLCh fgPartial[]; static const XMLCh fgRestrict[]; static const XMLCh fgRestriction[]; static const XMLCh fgSchema[]; static const XMLCh fgSequence[]; static const XMLCh fgSimple[]; static const XMLCh fgSkip[]; static const XMLCh fgStrict[]; static const XMLCh fgSubstitution[]; static const XMLCh fgTotal[]; static const XMLCh fgTrue[]; static const XMLCh fgUnbounded[]; static const XMLCh fgUnion[]; static const XMLCh fgUnique[]; static const XMLCh fgUnknown[]; static const XMLCh fgValid[]; static const XMLCh fgVCFixed[]; static const XMLCh fgXMLChNull[]; //PSVI Element Types (Shortened) static const XMLCh fgAg[]; static const XMLCh fgAnnot[]; static const XMLCh fgAttr[]; static const XMLCh fgAu[]; static const XMLCh fgElt[]; static const XMLCh fgIdc[]; static const XMLCh fgMg[]; static const XMLCh fgNot[]; static const XMLCh fgType[]; //Facets static const XMLCh fgBounded[]; static const XMLCh fgCardinality[]; static const XMLCh fgEnumeration[]; static const XMLCh fgFractionDigits[]; static const XMLCh fgLength[]; static const XMLCh fgMaxExclusive[]; static const XMLCh fgMaxInclusive[]; static const XMLCh fgMaxLength[]; static const XMLCh fgMinExclusive[]; static const XMLCh fgMinInclusive[]; static const XMLCh fgMinLength[]; static const XMLCh fgNumeric[]; static const XMLCh fgOrdered[]; static const XMLCh fgPattern[]; static const XMLCh fgTotalDigits[]; static const XMLCh fgWhiteSpace[]; //Namespaces and prefixes static const XMLCh fgNamespaceInfoset[]; static const XMLCh fgXsi[]; static const XMLCh fgNamespaceInstance[]; static const XMLCh fgPsv[]; static const XMLCh fgNamespacePsvi[]; static const XMLCh fgXml[]; static const XMLCh fgNamespaceXmlSchema[]; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/JanitorExports.cpp000644 000765 000024 00000001711 13272177434 022754 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include XERCES_CPP_NAMESPACE_BEGIN template class ArrayJanitor; template class ArrayJanitor; XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLAbstractDoubleFloat.hpp000644 000765 000024 00000014676 13241160336 024236 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLAbstractDoubleFloat.hpp 605828 2007-12-20 08:05:47Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XML_ABSTRACT_DOUBLE_FLOAT_HPP) #define XERCESC_INCLUDE_GUARD_XML_ABSTRACT_DOUBLE_FLOAT_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /*** * 3.2.5.1 Lexical representation * * double values have a lexical representation consisting of a mantissa followed, * optionally, by the character "E" or "e", followed by an exponent. * * The exponent must be an integer. * The mantissa must be a decimal number. * The representations for exponent and mantissa must follow the lexical rules * for integer and decimal. * * If the "E" or "e" and the following exponent are omitted, * an exponent value of 0 is assumed. ***/ /*** * 3.2.4.1 Lexical representation * * float values have a lexical representation consisting of a mantissa followed, * optionally, by the character "E" or "e", followed by an exponent. * * The exponent must be an integer. * The mantissa must be a decimal number. * The representations for exponent and mantissa must follow the lexical rules * for integer and decimal. * * If the "E" or "e" and the following exponent are omitted, * an exponent value of 0 is assumed. ***/ class XMLUTIL_EXPORT XMLAbstractDoubleFloat : public XMLNumber { public: enum LiteralType { NegINF, PosINF, NaN, SpecialTypeNum, Normal }; virtual ~XMLAbstractDoubleFloat(); static XMLCh* getCanonicalRepresentation ( const XMLCh* const rawData , MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager ); virtual XMLCh* getRawData() const; virtual const XMLCh* getFormattedString() const; virtual int getSign() const; MemoryManager* getMemoryManager() const; inline bool isDataConverted() const; inline bool isDataOverflowed() const; inline double getValue() const; inline LiteralType getType() const; /*** * * The decimal point delimiter for the schema double/float type is * defined to be a period and is not locale-specific. So, it must * be replaced with the local-specific delimiter before converting * from string to double/float. * ***/ static void normalizeDecimalPoint(char* const toNormal); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLAbstractDoubleFloat) protected: // // To be used by derived class exclusively // XMLAbstractDoubleFloat(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); void init(const XMLCh* const strValue); /** * Compares this object to the specified object. * The result is true if and only if the argument is not * null and is an XMLAbstractDoubleFloat object that contains * the same int value as this object. * * @param lValue the object to compare with. * @param rValue the object to compare against. * @param manager The MemoryManager to use to allocate objects * @return true if the objects are the same; * false otherwise. */ static int compareValues(const XMLAbstractDoubleFloat* const lValue , const XMLAbstractDoubleFloat* const rValue , MemoryManager* const manager); // // to be overridden by derived class // virtual void checkBoundary(char* const strValue) = 0; void convert(char* const strValue); private: // // Unimplemented // // copy ctor // assignment ctor // XMLAbstractDoubleFloat(const XMLAbstractDoubleFloat& toCopy); XMLAbstractDoubleFloat& operator=(const XMLAbstractDoubleFloat& toAssign); void normalizeZero(XMLCh* const); inline bool isSpecialValue() const; static int compareSpecial(const XMLAbstractDoubleFloat* const specialValue , MemoryManager* const manager); void formatString(); protected: double fValue; LiteralType fType; bool fDataConverted; bool fDataOverflowed; private: int fSign; XMLCh* fRawData; // // If the original string is not lexcially the same as the five // special value notations, and the value is converted to // special value due underlying platform restriction on data // representation, then this string is constructed and // takes the form "original_string (special_value_notation)", // otherwise it is empty. // XMLCh* fFormattedString; MemoryManager* fMemoryManager; }; inline bool XMLAbstractDoubleFloat::isSpecialValue() const { return (fType < SpecialTypeNum); } inline MemoryManager* XMLAbstractDoubleFloat::getMemoryManager() const { return fMemoryManager; } inline bool XMLAbstractDoubleFloat::isDataConverted() const { return fDataConverted; } inline bool XMLAbstractDoubleFloat::isDataOverflowed() const { return fDataOverflowed; } inline double XMLAbstractDoubleFloat::getValue() const { return fValue; } inline XMLAbstractDoubleFloat::LiteralType XMLAbstractDoubleFloat::getType() const { return fType; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/UnexpectedEOFException.hpp000644 000765 000024 00000002271 13241160336 024272 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: UnexpectedEOFException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_UNEXPECTEDEOFEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_UNEXPECTEDEOFEXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(UnexpectedEOFException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMemory.cpp000644 000765 000024 00000006765 13241160335 021363 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMemory.cpp 635226 2008-03-09 12:04:39Z borisk $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN void* XMemory::operator new(size_t size) { size_t headerSize = XMLPlatformUtils::alignPointerForNewBlockAllocation( sizeof(MemoryManager*)); void* const block = XMLPlatformUtils::fgMemoryManager->allocate ( headerSize + size ); *(MemoryManager**)block = XMLPlatformUtils::fgMemoryManager; return (char*)block + headerSize; } #if defined(XERCES_MFC_SUPPORT) void* XMemory::operator new(size_t size, const char* /*file*/, int /*line*/) { return operator new(size); } void XMemory::operator delete(void* p, const char* /*file*/, int /*line*/) { operator delete(p); } #endif void* XMemory::operator new(size_t size, MemoryManager* manager) { assert(manager != 0); size_t headerSize = XMLPlatformUtils::alignPointerForNewBlockAllocation( sizeof(MemoryManager*)); void* const block = manager->allocate(headerSize + size); *(MemoryManager**)block = manager; return (char*)block + headerSize; } void* XMemory::operator new(size_t /*size*/, void* ptr) { return ptr; } void XMemory::operator delete(void* p) { if (p != 0) { size_t headerSize = XMLPlatformUtils::alignPointerForNewBlockAllocation( sizeof(MemoryManager*)); void* const block = (char*)p - headerSize; MemoryManager* const manager = *(MemoryManager**)block; assert(manager != 0); manager->deallocate(block); } } //The Borland compiler is complaining about duplicate overloading of delete #if !defined(XERCES_NO_MATCHING_DELETE_OPERATOR) void XMemory::operator delete(void* p, MemoryManager* manager) { assert(manager != 0); if (p != 0) { size_t headerSize = XMLPlatformUtils::alignPointerForNewBlockAllocation(sizeof(MemoryManager*)); void* const block = (char*)p - headerSize; /*** * assert(*(MemoryManager**)block == manager); * * NOTE: for compiler which can't properly trace the memory manager used in the * placement new, we use the memory manager embedded in the memory rather * than the one passed in */ MemoryManager* pM = *(MemoryManager**)block; pM->deallocate(block); } } void XMemory::operator delete(void* /*p*/, void* /*ptr*/) { } #endif XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/EncodingValidator.hpp000644 000765 000024 00000005624 13241160336 023356 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: EncodingValidator.hpp 635560 2008-03-10 14:10:09Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_ENCODINGVALIDATOR_HPP) #define XERCESC_INCLUDE_GUARD_ENCODINGVALIDATOR_HPP // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN /** * A singleton class that checks whether an encoding name is a valid IANA * encoding */ class XMLUTIL_EXPORT EncodingValidator { public: // ----------------------------------------------------------------------- // Validation methods // ----------------------------------------------------------------------- bool isValidEncoding(const XMLCh* const encName); // ----------------------------------------------------------------------- // Instance methods // ----------------------------------------------------------------------- static EncodingValidator* instance(); private: // ----------------------------------------------------------------------- // Constructor and destructors // ----------------------------------------------------------------------- EncodingValidator(); ~EncodingValidator(); // ----------------------------------------------------------------------- // Private Helpers methods // ----------------------------------------------------------------------- /* * Initializes the registry with a set of valid IANA encoding names */ void initializeRegistry(); // ----------------------------------------------------------------------- // Private data members // // fEncodingRegistry // Contains a set of IANA encoding names // // fInstance // An EncodingValidator singleton instance // ----------------------------------------------------------------------- ValueHashTableOf* fEncodingRegistry; static EncodingValidator* fInstance; friend class XMLInitializer; }; XERCES_CPP_NAMESPACE_END #endif /** * End file EncodingValidator.hpp */ xerces-c-3.2.2/src/xercesc/util/TransService.cpp000644 000765 000024 00000065727 13241160336 022377 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: TransService.cpp 1802231 2017-07-18 01:12:46Z scantor $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local, static data // // gStrictIANAEncoding // A flag to control whether strict IANA encoding names checking should // be done // // --------------------------------------------------------------------------- static bool gStrictIANAEncoding = false; RefHashTableOf* XMLTransService::gMappings = 0; RefVectorOf * XMLTransService::gMappingsRecognizer = 0; void XMLInitializer::initializeTransService() { XMLTransService::gMappings = new RefHashTableOf(103); XMLTransService::gMappingsRecognizer = new RefVectorOf( (XMLSize_t)XMLRecognizer::Encodings_Count); } void XMLInitializer::terminateTransService() { delete XMLTransService::gMappingsRecognizer; XMLTransService::gMappingsRecognizer = 0; delete XMLTransService::gMappings; XMLTransService::gMappings = 0; } // --------------------------------------------------------------------------- // XMLTransService: Constructors and destructor // --------------------------------------------------------------------------- XMLTransService::XMLTransService() { } XMLTransService::~XMLTransService() { } // --------------------------------------------------------------------------- // Allow user specific encodings to be added to the mappings table. // Should be called after platform init // --------------------------------------------------------------------------- void XMLTransService::addEncoding(const XMLCh* const encoding, ENameMap* const ownMapping) { gMappings->put((void *) encoding, ownMapping); } // --------------------------------------------------------------------------- // XMLTransService: Non-virtual API // --------------------------------------------------------------------------- XMLTranscoder* XMLTransService::makeNewTranscoderFor( const char* const encodingName , XMLTransService::Codes& resValue , const XMLSize_t blockSize , MemoryManager* const manager) { XMLCh* tmpName = XMLString::transcode(encodingName, manager); ArrayJanitor janName(tmpName, manager); return makeNewTranscoderFor(tmpName, resValue, blockSize, manager); } XMLTranscoder* XMLTransService::makeNewTranscoderFor( const XMLCh* const encodingName , XMLTransService::Codes& resValue , const XMLSize_t blockSize , MemoryManager* const manager) { // // If strict IANA encoding flag is set, validate encoding name // if (gStrictIANAEncoding) { if (!EncodingValidator::instance()->isValidEncoding(encodingName)) { resValue = XMLTransService::UnsupportedEncoding; return 0; } } // // First try to find it in our list of mappings to intrinsically // supported encodings. We have to upper case the passed encoding // name because we use a hash table and we stored all our mappings // in all uppercase. // const XMLSize_t bufSize = 2048; XMLCh upBuf[bufSize + 1]; if (!XMLString::copyNString(upBuf, encodingName, bufSize)) { resValue = XMLTransService::InternalFailure; return 0; } XMLString::upperCaseASCII(upBuf); ENameMap* ourMapping = gMappings->get(upBuf); // If we found it, then call the factory method for it if (ourMapping) { XMLTranscoder* temp = ourMapping->makeNew(blockSize, manager); resValue = temp ? XMLTransService::Ok : XMLTransService::InternalFailure; return temp; } // // It wasn't an intrinsic and it wasn't disallowed, so pass it on // to the trans service to see if he can make anything of it. // XMLTranscoder* temp = makeNewXMLTranscoder(encodingName, resValue, blockSize, manager); // if successful, set resValue to OK // if failed, the makeNewXMLTranscoder has already set the proper failing resValue if (temp) resValue = XMLTransService::Ok; return temp; } XMLTranscoder* XMLTransService::makeNewTranscoderFor( XMLRecognizer::Encodings encodingEnum , XMLTransService::Codes& resValue , const XMLSize_t blockSize , MemoryManager* const manager) { // // We can only make transcoder if the passed encodingEnum is under this range // if (encodingEnum < XMLRecognizer::Encodings_Min || encodingEnum > XMLRecognizer::Encodings_Max) { resValue = XMLTransService::InternalFailure; return 0; } ENameMap* ourMapping = gMappingsRecognizer->elementAt(encodingEnum); // If we found it, then call the factory method for it if (ourMapping) { XMLTranscoder* temp = ourMapping->makeNew(blockSize, manager); resValue = temp ? XMLTransService::Ok : XMLTransService::InternalFailure; return temp; } else { XMLTranscoder* temp = makeNewXMLTranscoder(XMLRecognizer::nameForEncoding(encodingEnum, manager), resValue, blockSize, manager); // if successful, set resValue to OK // if failed, the makeNewXMLTranscoder has already set the proper failing resValue if (temp) resValue = XMLTransService::Ok; return temp; } } // --------------------------------------------------------------------------- // XMLTransTransService: Hidden Init Method // // This is called by platform utils during startup. // --------------------------------------------------------------------------- void XMLTransService::initTransService() { // // A stupid way to increment the fCurCount inside the RefVectorOf // for (XMLSize_t i = 0; i < (XMLSize_t)XMLRecognizer::Encodings_Count; i++) gMappingsRecognizer->addElement(0); // // Add in the magical mapping for the native XMLCh transcoder. This // is used for internal entities. // gMappingsRecognizer->setElementAt(new ENameMapFor(XMLUni::fgXMLChEncodingString), XMLRecognizer::XERCES_XMLCH); gMappings->put((void*)XMLUni::fgXMLChEncodingString, new ENameMapFor(XMLUni::fgXMLChEncodingString)); // // Add in our mappings for ASCII. // gMappingsRecognizer->setElementAt(new ENameMapFor(XMLUni::fgUSASCIIEncodingString), XMLRecognizer::US_ASCII); gMappings->put((void*)XMLUni::fgUSASCIIEncodingString, new ENameMapFor(XMLUni::fgUSASCIIEncodingString)); gMappings->put((void*)XMLUni::fgUSASCIIEncodingString2, new ENameMapFor(XMLUni::fgUSASCIIEncodingString2)); gMappings->put((void*)XMLUni::fgUSASCIIEncodingString3, new ENameMapFor(XMLUni::fgUSASCIIEncodingString3)); gMappings->put((void*)XMLUni::fgUSASCIIEncodingString4, new ENameMapFor(XMLUni::fgUSASCIIEncodingString4)); // // Add in our mappings for UTF-8 // gMappingsRecognizer->setElementAt(new ENameMapFor(XMLUni::fgUTF8EncodingString), XMLRecognizer::UTF_8); gMappings->put((void*)XMLUni::fgUTF8EncodingString, new ENameMapFor(XMLUni::fgUTF8EncodingString)); gMappings->put((void*)XMLUni::fgUTF8EncodingString2, new ENameMapFor(XMLUni::fgUTF8EncodingString2)); // // Add in our mappings for Latin1 // gMappings->put((void*)XMLUni::fgISO88591EncodingString, new ENameMapFor(XMLUni::fgISO88591EncodingString)); gMappings->put((void*)XMLUni::fgISO88591EncodingString2, new ENameMapFor(XMLUni::fgISO88591EncodingString2)); gMappings->put((void*)XMLUni::fgISO88591EncodingString3, new ENameMapFor(XMLUni::fgISO88591EncodingString3)); gMappings->put((void*)XMLUni::fgISO88591EncodingString4, new ENameMapFor(XMLUni::fgISO88591EncodingString4)); gMappings->put((void*)XMLUni::fgISO88591EncodingString5, new ENameMapFor(XMLUni::fgISO88591EncodingString5)); gMappings->put((void*)XMLUni::fgISO88591EncodingString6, new ENameMapFor(XMLUni::fgISO88591EncodingString6)); gMappings->put((void*)XMLUni::fgISO88591EncodingString7, new ENameMapFor(XMLUni::fgISO88591EncodingString7)); gMappings->put((void*)XMLUni::fgISO88591EncodingString8, new ENameMapFor(XMLUni::fgISO88591EncodingString8)); gMappings->put((void*)XMLUni::fgISO88591EncodingString9, new ENameMapFor(XMLUni::fgISO88591EncodingString9)); gMappings->put((void*)XMLUni::fgISO88591EncodingString10, new ENameMapFor(XMLUni::fgISO88591EncodingString10)); gMappings->put((void*)XMLUni::fgISO88591EncodingString11, new ENameMapFor(XMLUni::fgISO88591EncodingString11)); gMappings->put((void*)XMLUni::fgISO88591EncodingString12, new ENameMapFor(XMLUni::fgISO88591EncodingString12)); // // Add in our mappings for UTF-16 and UCS-4, little endian // bool swapped = XMLPlatformUtils::fgXMLChBigEndian; gMappingsRecognizer->setElementAt(new EEndianNameMapFor(XMLUni::fgUTF16LEncodingString, swapped), XMLRecognizer::UTF_16L); gMappings->put ( (void*)XMLUni::fgUTF16LEncodingString, new EEndianNameMapFor ( XMLUni::fgUTF16LEncodingString , swapped ) ); gMappings->put ( (void*)XMLUni::fgUTF16LEncodingString2, new EEndianNameMapFor ( XMLUni::fgUTF16LEncodingString2 , swapped ) ); gMappingsRecognizer->setElementAt(new EEndianNameMapFor(XMLUni::fgUCS4LEncodingString, swapped), XMLRecognizer::UCS_4L); gMappings->put ( (void*)XMLUni::fgUCS4LEncodingString, new EEndianNameMapFor ( XMLUni::fgUCS4LEncodingString , swapped ) ); gMappings->put ( (void*)XMLUni::fgUCS4LEncodingString2, new EEndianNameMapFor ( XMLUni::fgUCS4LEncodingString2 , swapped ) ); // // Add in our mappings for UTF-16 and UCS-4, big endian // swapped = !XMLPlatformUtils::fgXMLChBigEndian; gMappingsRecognizer->setElementAt(new EEndianNameMapFor(XMLUni::fgUTF16BEncodingString, swapped), XMLRecognizer::UTF_16B); gMappings->put ( (void*)XMLUni::fgUTF16BEncodingString, new EEndianNameMapFor ( XMLUni::fgUTF16BEncodingString , swapped ) ); gMappings->put ( (void*)XMLUni::fgUTF16BEncodingString2, new EEndianNameMapFor ( XMLUni::fgUTF16BEncodingString2 , swapped ) ); gMappingsRecognizer->setElementAt(new EEndianNameMapFor(XMLUni::fgUCS4BEncodingString, swapped), XMLRecognizer::UCS_4B); gMappings->put ( (void*)XMLUni::fgUCS4BEncodingString, new EEndianNameMapFor ( XMLUni::fgUCS4BEncodingString , swapped ) ); gMappings->put ( (void*)XMLUni::fgUCS4BEncodingString2, new EEndianNameMapFor ( XMLUni::fgUCS4BEncodingString2 , swapped ) ); // // Add in our mappings for UTF-16 and UCS-4 which does not indicate endian // assumes the same endian encoding as the OS // gMappings->put ( (void*)XMLUni::fgUTF16EncodingString, new EEndianNameMapFor ( XMLUni::fgUTF16EncodingString , false ) ); gMappings->put ( (void*)XMLUni::fgUTF16EncodingString2, new EEndianNameMapFor ( XMLUni::fgUTF16EncodingString2 , false ) ); gMappings->put ( (void*)XMLUni::fgUTF16EncodingString3, new EEndianNameMapFor ( XMLUni::fgUTF16EncodingString3 , false ) ); gMappings->put ( (void*)XMLUni::fgUTF16EncodingString4, new EEndianNameMapFor ( XMLUni::fgUTF16EncodingString4 , false ) ); gMappings->put ( (void*)XMLUni::fgUTF16EncodingString5, new EEndianNameMapFor ( XMLUni::fgUTF16EncodingString5 , false ) ); gMappings->put ( (void*)XMLUni::fgUTF16EncodingString6, new EEndianNameMapFor ( XMLUni::fgUTF16EncodingString6 , false ) ); gMappings->put ( (void*)XMLUni::fgUTF16EncodingString7, new EEndianNameMapFor ( XMLUni::fgUTF16EncodingString7 , false ) ); gMappings->put ( (void*)XMLUni::fgUCS4EncodingString, new EEndianNameMapFor ( XMLUni::fgUCS4EncodingString , false ) ); gMappings->put ( (void*)XMLUni::fgUCS4EncodingString2, new EEndianNameMapFor ( XMLUni::fgUCS4EncodingString2 , false ) ); gMappings->put ( (void*)XMLUni::fgUCS4EncodingString3, new EEndianNameMapFor ( XMLUni::fgUCS4EncodingString3 , false ) ); gMappings->put ( (void*)XMLUni::fgUCS4EncodingString4, new EEndianNameMapFor ( XMLUni::fgUCS4EncodingString4 , false ) ); gMappings->put ( (void*)XMLUni::fgUCS4EncodingString5, new EEndianNameMapFor ( XMLUni::fgUCS4EncodingString5 , false ) ); // // Add in our mappings for IBM037, and the one alias we support for // it, which is EBCDIC-CP-US. // gMappingsRecognizer->setElementAt(new ENameMapFor(XMLUni::fgEBCDICEncodingString), XMLRecognizer::EBCDIC); gMappings->put((void*)XMLUni::fgIBM037EncodingString, new ENameMapFor(XMLUni::fgIBM037EncodingString)); gMappings->put((void*)XMLUni::fgIBM037EncodingString2, new ENameMapFor(XMLUni::fgIBM037EncodingString2)); //hhe gMappings->put((void*)XMLUni::fgIBM1047EncodingString, new ENameMapFor(XMLUni::fgIBM1047EncodingString)); gMappings->put((void*)XMLUni::fgIBM1047EncodingString2, new ENameMapFor(XMLUni::fgIBM1047EncodingString2)); // // Add in our mappings for IBM037 with Euro update, i.e. IBM1140. It // has alias IBM01140, the one suggested by IANA // gMappings->put((void*)XMLUni::fgIBM1140EncodingString, new ENameMapFor(XMLUni::fgIBM1140EncodingString)); gMappings->put((void*)XMLUni::fgIBM1140EncodingString2, new ENameMapFor(XMLUni::fgIBM1140EncodingString2)); gMappings->put((void*)XMLUni::fgIBM1140EncodingString3, new ENameMapFor(XMLUni::fgIBM1140EncodingString3)); gMappings->put((void*)XMLUni::fgIBM1140EncodingString4, new ENameMapFor(XMLUni::fgIBM1140EncodingString4)); // // Add in our mappings for Windows-1252. We don't have any aliases for // this one, so there is just one mapping. // gMappings->put((void*)XMLUni::fgWin1252EncodingString, new ENameMapFor(XMLUni::fgWin1252EncodingString)); } // --------------------------------------------------------------------------- // XMLTransService: IANA encoding setting // --------------------------------------------------------------------------- void XMLTransService::strictIANAEncoding(const bool newState) { gStrictIANAEncoding = newState; } bool XMLTransService::isStrictIANAEncoding() { return gStrictIANAEncoding; } // --------------------------------------------------------------------------- // XMLTranscoder: Public Destructor // --------------------------------------------------------------------------- XMLTranscoder::~XMLTranscoder() { fMemoryManager->deallocate(fEncodingName);//delete [] fEncodingName; } // --------------------------------------------------------------------------- // XMLTranscoder: Hidden Constructors // --------------------------------------------------------------------------- XMLTranscoder::XMLTranscoder(const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager) : fBlockSize(blockSize) , fEncodingName(0) , fMemoryManager(manager) { fEncodingName = XMLString::replicate(encodingName, fMemoryManager); } // --------------------------------------------------------------------------- // XMLTranscoder: Protected helpers // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // XMLLCPTranscoder: Public Destructor // --------------------------------------------------------------------------- XMLLCPTranscoder::XMLLCPTranscoder() { } // --------------------------------------------------------------------------- // XMLLCPTranscoder: Hidden Constructors // --------------------------------------------------------------------------- XMLLCPTranscoder::~XMLLCPTranscoder() { } // --------------------------------------------------------------------------- // TranscodeToStr: Public constructors and destructor // --------------------------------------------------------------------------- TranscodeToStr::TranscodeToStr(const XMLCh *in, const char *encoding, MemoryManager *manager) : fString(0), fBytesWritten(0), fMemoryManager(manager) { XMLTransService::Codes failReason; const XMLSize_t blockSize = 2048; XMLTranscoder* trans = XMLPlatformUtils::fgTransService->makeNewTranscoderFor(encoding, failReason, blockSize, fMemoryManager); if (!trans) { ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Trans_CantCreateCvtrFor , encoding , fMemoryManager ); } Janitor janTrans(trans); transcode(in, XMLString::stringLen(in), trans); } TranscodeToStr::TranscodeToStr(const XMLCh *in, XMLSize_t length, const char *encoding, MemoryManager *manager) : fString(0), fBytesWritten(0), fMemoryManager(manager) { XMLTransService::Codes failReason; const XMLSize_t blockSize = 2048; XMLTranscoder* trans = XMLPlatformUtils::fgTransService->makeNewTranscoderFor(encoding, failReason, blockSize, fMemoryManager); if (!trans) { ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Trans_CantCreateCvtrFor , encoding , fMemoryManager ); } Janitor janTrans(trans); transcode(in, length, trans); } TranscodeToStr::TranscodeToStr(const XMLCh *in, XMLTranscoder* trans, MemoryManager *manager) : fString(0), fBytesWritten(0), fMemoryManager(manager) { transcode(in, XMLString::stringLen(in), trans); } TranscodeToStr::TranscodeToStr(const XMLCh *in, XMLSize_t length, XMLTranscoder* trans, MemoryManager *manager) : fString(0), fBytesWritten(0), fMemoryManager(manager) { transcode(in, length, trans); } TranscodeToStr::~TranscodeToStr() { } // --------------------------------------------------------------------------- // TranscodeToStr: Private helper methods // --------------------------------------------------------------------------- void TranscodeToStr::transcode(const XMLCh *in, XMLSize_t len, XMLTranscoder* trans) { if(!in) return; XMLSize_t allocSize = (len * sizeof(XMLCh)) + 4; fString.reset((XMLByte*)fMemoryManager->allocate(allocSize), fMemoryManager); XMLSize_t charsDone = 0; bool bufferExpanded = false; while(charsDone < len) { XMLSize_t charsRead = 0; fBytesWritten += trans->transcodeTo(in + charsDone, len - charsDone, fString.get() + fBytesWritten, allocSize - fBytesWritten, charsRead, XMLTranscoder::UnRep_Throw); if (charsRead == 0) { if (bufferExpanded) { ThrowXMLwithMemMgr(TranscodingException, XMLExcepts::Trans_BadSrcSeq, fMemoryManager); } // it may have not enough space, try expanding the buffer allocSize *= 2; XMLByte *newBuf = (XMLByte*)fMemoryManager->allocate(allocSize); memcpy(newBuf, fString.get(), fBytesWritten); fString.reset(newBuf, fMemoryManager); bufferExpanded = true; } else { charsDone += charsRead; bufferExpanded = false; } } // null terminate if((fBytesWritten + 4) > allocSize) { allocSize = fBytesWritten + 4; XMLByte *newBuf = (XMLByte*)fMemoryManager->allocate(allocSize); memcpy(newBuf, fString.get(), fBytesWritten); fString.reset(newBuf, fMemoryManager); } fString[fBytesWritten + 0] = 0; fString[fBytesWritten + 1] = 0; fString[fBytesWritten + 2] = 0; fString[fBytesWritten + 3] = 0; } // --------------------------------------------------------------------------- // TranscodeFromStr: Public constructors and destructor // --------------------------------------------------------------------------- TranscodeFromStr::TranscodeFromStr(const XMLByte *data, XMLSize_t length, const char *encoding, MemoryManager *manager) : fString(0), fCharsWritten(0), fMemoryManager(manager) { XMLTransService::Codes failReason; const XMLSize_t blockSize = 2048; XMLTranscoder* trans = XMLPlatformUtils::fgTransService->makeNewTranscoderFor(encoding, failReason, blockSize, fMemoryManager); if (!trans) { ThrowXMLwithMemMgr1 ( TranscodingException , XMLExcepts::Trans_CantCreateCvtrFor , encoding , fMemoryManager ); } Janitor janTrans(trans); transcode(data, length, trans); } TranscodeFromStr::TranscodeFromStr(const XMLByte *data, XMLSize_t length, XMLTranscoder *trans, MemoryManager *manager) : fString(0), fCharsWritten(0), fMemoryManager(manager) { transcode(data, length, trans); } TranscodeFromStr::~TranscodeFromStr() { } // --------------------------------------------------------------------------- // TranscodeFromStr: Private helper methods // --------------------------------------------------------------------------- void TranscodeFromStr::transcode(const XMLByte *in, XMLSize_t length, XMLTranscoder *trans) { if(!in) return; XMLSize_t allocSize = length + 1; fString.reset((XMLCh*)fMemoryManager->allocate(allocSize * sizeof(XMLCh)), fMemoryManager); XMLSize_t csSize = allocSize; ArrayJanitor charSizes((unsigned char*)fMemoryManager->allocate(csSize * sizeof(unsigned char)), fMemoryManager); XMLSize_t bytesDone = 0; while(bytesDone < length) { if((allocSize - fCharsWritten) > csSize) { csSize = allocSize - fCharsWritten; charSizes.reset((unsigned char*)fMemoryManager->allocate(csSize * sizeof(unsigned char)), fMemoryManager); } XMLSize_t bytesRead = 0; fCharsWritten += trans->transcodeFrom(in + bytesDone, length - bytesDone, fString.get() + fCharsWritten, allocSize - fCharsWritten, bytesRead, charSizes.get()); if(bytesRead == 0) ThrowXMLwithMemMgr(TranscodingException, XMLExcepts::Trans_BadSrcSeq, fMemoryManager); bytesDone += bytesRead; if(((allocSize - fCharsWritten)*sizeof(XMLCh)) < (length - bytesDone)) { allocSize *= 2; XMLCh *newBuf = (XMLCh*)fMemoryManager->allocate(allocSize * sizeof(XMLCh)); memcpy(newBuf, fString.get(), fCharsWritten*sizeof(XMLCh)); fString.reset(newBuf, fMemoryManager); } } // null terminate if((fCharsWritten + 1) > allocSize) { allocSize = fCharsWritten + 1; XMLCh *newBuf = (XMLCh*)fMemoryManager->allocate(allocSize * sizeof(XMLCh)); memcpy(newBuf, fString.get(), fCharsWritten*sizeof(XMLCh)); fString.reset(newBuf, fMemoryManager); } fString[fCharsWritten] = 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/TransENameMap.hpp000644 000765 000024 00000013427 13241160336 022415 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: TransENameMap.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_TRANSENAMEMAP_HPP) #define XERCESC_INCLUDE_GUARD_TRANSENAMEMAP_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN // // This class is really private to the TransService class. However, some // compilers are too dumb to allow us to hide this class there in the Cpp // file that uses it. // class ENameMap : public XMemory { public : // ----------------------------------------------------------------------- // Destructor // ----------------------------------------------------------------------- virtual ~ENameMap() { //delete [] fEncodingName; XMLPlatformUtils::fgMemoryManager->deallocate(fEncodingName); } // ----------------------------------------------------------------------- // Virtual factory method // ----------------------------------------------------------------------- virtual XMLTranscoder* makeNew ( const XMLSize_t blockSize , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) const = 0; // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- const XMLCh* getKey() const { return fEncodingName; } protected : // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- ENameMap(const XMLCh* const encodingName) : fEncodingName(XMLString::replicate(encodingName, XMLPlatformUtils::fgMemoryManager)) { } private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ENameMap(); ENameMap(const ENameMap&); ENameMap& operator=(const ENameMap&); // ----------------------------------------------------------------------- // Private data members // // fEncodingName // This is the encoding name for the transcoder that is controlled // by this map instance. // ----------------------------------------------------------------------- XMLCh* fEncodingName; }; template class ENameMapFor : public ENameMap { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- ENameMapFor(const XMLCh* const encodingName); ~ENameMapFor(); // ----------------------------------------------------------------------- // Implementation of virtual factory method // ----------------------------------------------------------------------- virtual XMLTranscoder* makeNew(const XMLSize_t blockSize, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) const; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ENameMapFor(); ENameMapFor(const ENameMapFor&); ENameMapFor& operator=(const ENameMapFor&); }; template class EEndianNameMapFor : public ENameMap { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- EEndianNameMapFor(const XMLCh* const encodingName, const bool swapped); ~EEndianNameMapFor(); // ----------------------------------------------------------------------- // Implementation of virtual factory method // ----------------------------------------------------------------------- virtual XMLTranscoder* makeNew(const XMLSize_t blockSize, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) const; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- EEndianNameMapFor(const EEndianNameMapFor&); EEndianNameMapFor& operator=(const EEndianNameMapFor&); // ----------------------------------------------------------------------- // Private data members // // fSwapped // Indicates whether the endianness of the encoding is opposite of // that of the local host. // ----------------------------------------------------------------------- bool fSwapped; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/XMLDateTime.hpp000644 000765 000024 00000027121 13241160336 022033 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLDateTime.hpp 1803924 2017-08-02 21:14:44Z scantor $ */ #if !defined(XERCESC_INCLUDE_GUARD_XML_DATETIME_HPP) #define XERCESC_INCLUDE_GUARD_XML_DATETIME_HPP #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XSValue; class XMLUTIL_EXPORT XMLDateTime : public XMLNumber { public: enum valueIndex { CentYear = 0, Month , Day , Hour , Minute , Second , MiliSecond , //not to be used directly utc , TOTAL_SIZE }; enum utcType { UTC_UNKNOWN = 0, UTC_STD , // set in parse() or normalize() UTC_POS , // set in parse() UTC_NEG // set in parse() }; // ----------------------------------------------------------------------- // ctors and dtor // ----------------------------------------------------------------------- XMLDateTime(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); XMLDateTime(const XMLCh* const, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); XMLDateTime(time_t epoch, bool duration, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~XMLDateTime(); inline void setBuffer(const XMLCh* const); // ----------------------------------------------------------------------- // Copy ctor and Assignment operators // ----------------------------------------------------------------------- XMLDateTime(const XMLDateTime&); XMLDateTime& operator=(const XMLDateTime&); // ----------------------------------------------------------------------- // Implementation of Abstract Interface // ----------------------------------------------------------------------- virtual XMLCh* getRawData() const; virtual const XMLCh* getFormattedString() const; virtual int getSign() const; // ----------------------------------------------------------------------- // Canonical Representation // ----------------------------------------------------------------------- XMLCh* getDateTimeCanonicalRepresentation(MemoryManager* const memMgr) const; XMLCh* getTimeCanonicalRepresentation(MemoryManager* const memMgr) const; XMLCh* getDateCanonicalRepresentation(MemoryManager* const memMgr) const; // ----------------------------------------------------------------------- // parsers // ----------------------------------------------------------------------- void parseDateTime(); //DateTime void parseDate(); //Date void parseTime(); //Time void parseDay(); //gDay void parseMonth(); //gMonth void parseYear(); //gYear void parseMonthDay(); //gMonthDay void parseYearMonth(); //gYearMonth void parseDuration(); //duration // ----------------------------------------------------------------------- // Comparison // ----------------------------------------------------------------------- static int compare(const XMLDateTime* const , const XMLDateTime* const); static int compare(const XMLDateTime* const , const XMLDateTime* const , bool ); static int compareOrder(const XMLDateTime* const , const XMLDateTime* const); int getYear() const {return fValue[CentYear];} int getMonth() const {return fValue[Month];} int getDay() const {return fValue[Day];} int getHour() const {return fValue[Hour];} int getMinute() const {return fValue[Minute];} int getSecond() const {return fValue[Second];} time_t getEpoch(bool duration=false) const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLDateTime) private: // ----------------------------------------------------------------------- // Constant data // ----------------------------------------------------------------------- // enum timezoneIndex { hh = 0, mm , TIMEZONE_ARRAYSIZE }; // ----------------------------------------------------------------------- // Comparison // ----------------------------------------------------------------------- static int compareResult(int , int , bool); static void addDuration(XMLDateTime* pDuration , const XMLDateTime* const pBaseDate , int index); static int compareResult(const XMLDateTime* const , const XMLDateTime* const , bool , int); static inline int getRetVal(int, int); // ----------------------------------------------------------------------- // helper // ----------------------------------------------------------------------- inline void reset(); inline void assertBuffer() const; inline void copy(const XMLDateTime&); // allow multiple parsing inline bool initParser(); inline bool isNormalized() const; // ----------------------------------------------------------------------- // scaners // ----------------------------------------------------------------------- void getDate(); void getTime(); void getYearMonth(); void getTimeZone(const XMLSize_t); void parseTimeZone(); // ----------------------------------------------------------------------- // locator and converter // ----------------------------------------------------------------------- int findUTCSign(const XMLSize_t start); int indexOf(const XMLSize_t start , const XMLSize_t end , const XMLCh ch) const; int parseInt(const XMLSize_t start , const XMLSize_t end) const; int parseIntYear(const XMLSize_t end) const; double parseMiliSecond(const XMLSize_t start , const XMLSize_t end) const; // ----------------------------------------------------------------------- // validator and normalizer // ----------------------------------------------------------------------- void validateDateTime() const; void normalize(); void fillString(XMLCh*& ptr, int value, XMLSize_t expLen) const; int fillYearString(XMLCh*& ptr, int value) const; void searchMiliSeconds(XMLCh*& miliStartPtr, XMLCh*& miliEndPtr) const; // ----------------------------------------------------------------------- // Unimplemented operator == // ----------------------------------------------------------------------- bool operator==(const XMLDateTime& toCompare) const; // ----------------------------------------------------------------------- // Private data members // // fValue[] // object representation of date time. // // fTimeZone[] // temporary storage for normalization // // fStart, fEnd // pointers to the portion of fBuffer being parsed // // fBuffer // raw data to be parsed, own it. // // ----------------------------------------------------------------------- int fValue[TOTAL_SIZE]; int fTimeZone[TIMEZONE_ARRAYSIZE]; XMLSize_t fStart; XMLSize_t fEnd; XMLSize_t fBufferMaxLen; double fMilliSecond; bool fHasTime; XMLCh* fBuffer; MemoryManager* fMemoryManager; friend class XSValue; }; inline void XMLDateTime::setBuffer(const XMLCh* const aString) { reset(); fEnd = XMLString::stringLen(aString); for (; fEnd > 0; fEnd--) { if (!XMLChar1_0::isWhitespace(aString[fEnd - 1])) break; } if (fEnd > 0) { if (fEnd > fBufferMaxLen) { fMemoryManager->deallocate(fBuffer); fBufferMaxLen = fEnd + 8; fBuffer = (XMLCh*) fMemoryManager->allocate((fBufferMaxLen+1) * sizeof(XMLCh)); } memcpy(fBuffer, aString, (fEnd) * sizeof(XMLCh)); fBuffer[fEnd] = '\0'; } } inline void XMLDateTime::reset() { for ( int i=0; i < TOTAL_SIZE; i++ ) fValue[i] = 0; fMilliSecond = 0; fHasTime = false; fTimeZone[hh] = fTimeZone[mm] = 0; fStart = fEnd = 0; if (fBuffer) *fBuffer = 0; } inline void XMLDateTime::copy(const XMLDateTime& rhs) { for ( int i = 0; i < TOTAL_SIZE; i++ ) fValue[i] = rhs.fValue[i]; fMilliSecond = rhs.fMilliSecond; fHasTime = rhs.fHasTime; fTimeZone[hh] = rhs.fTimeZone[hh]; fTimeZone[mm] = rhs.fTimeZone[mm]; fStart = rhs.fStart; fEnd = rhs.fEnd; if (fEnd > 0) { if (fEnd > fBufferMaxLen) { fMemoryManager->deallocate(fBuffer);//delete[] fBuffer; fBufferMaxLen = rhs.fBufferMaxLen; fBuffer = (XMLCh*) fMemoryManager->allocate((fBufferMaxLen+1) * sizeof(XMLCh)); } memcpy(fBuffer, rhs.fBuffer, (fEnd+1) * sizeof(XMLCh)); } } inline bool XMLDateTime::initParser() { if (!fBuffer || fBuffer[0] == chNull) return false; fStart = 0; // to ensure scan from the very first beginning // in case the pointer is updated accidentally by // someone else. return true; } inline bool XMLDateTime::isNormalized() const { return ( fValue[utc] == UTC_STD ? true : false ); } inline int XMLDateTime::getRetVal(int c1, int c2) { if ((c1 == LESS_THAN && c2 == GREATER_THAN) || (c1 == GREATER_THAN && c2 == LESS_THAN) ) { return INDETERMINATE; } return ( c1 != INDETERMINATE ) ? c1 : c2; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/Mutexes.cpp000644 000765 000024 00000004623 13241160336 021405 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Mutexes.cpp 734985 2009-01-16 12:21:14Z johns $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLMutex: Constructors and Destructor // --------------------------------------------------------------------------- XMLMutex::XMLMutex(MemoryManager* const manager) : fHandle(0), fManager(manager) { // Ask the per-platform driver to make us a mutex fHandle = XMLPlatformUtils::makeMutex(manager); } XMLMutex::~XMLMutex() { if (fHandle) { XMLPlatformUtils::closeMutex(fHandle, fManager); fHandle = 0; } } // --------------------------------------------------------------------------- // XMLMutex: Lock control methods // --------------------------------------------------------------------------- void XMLMutex::lock() { XMLPlatformUtils::lockMutex(fHandle); } void XMLMutex::unlock() { XMLPlatformUtils::unlockMutex(fHandle); } // --------------------------------------------------------------------------- // XMLMutexLock: Constructors and Destructor // --------------------------------------------------------------------------- XMLMutexLock::XMLMutexLock(XMLMutex* const toLock) : fToLock(toLock) { fToLock->lock(); } XMLMutexLock::~XMLMutexLock() { fToLock->unlock(); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/StringPool.hpp000644 000765 000024 00000013732 13241160336 022061 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: StringPool.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_STRINGPOOL_HPP) #define XERCESC_INCLUDE_GUARD_STRINGPOOL_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN // // This class implements a string pool, in which strings can be added and // given a unique id by which they can be referred. It has to provide fast // access both mapping from a string to its id and mapping from an id to // its string. This requires that it provide two separate data structures. // The map one is a hash table for quick storage and look up by name. The // other is an array ordered by unique id which maps to the element in the // hash table. // // This works because strings cannot be removed from the pool once added, // other than flushing it completely, and because ids are assigned // sequentially from 1. // class XMLUTIL_EXPORT XMLStringPool : public XSerializable, public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- XMLStringPool ( const unsigned int modulus = 109 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~XMLStringPool(); // ----------------------------------------------------------------------- // Pool management methods // ----------------------------------------------------------------------- virtual unsigned int addOrFind(const XMLCh* const newString); virtual bool exists(const XMLCh* const newString) const; virtual bool exists(const unsigned int id) const; virtual void flushAll(); virtual unsigned int getId(const XMLCh* const toFind) const; virtual const XMLCh* getValueForId(const unsigned int id) const; virtual unsigned int getStringCount() const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLStringPool) XMLStringPool(MemoryManager* const manager); private : // ----------------------------------------------------------------------- // Private data types // ----------------------------------------------------------------------- struct PoolElem { unsigned int fId; XMLCh* fString; }; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLStringPool(const XMLStringPool&); XMLStringPool& operator=(const XMLStringPool&); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- unsigned int addNewEntry(const XMLCh* const newString); // ----------------------------------------------------------------------- // Private data members // // fIdMap // This is an array of pointers to the pool elements. It is ordered // by unique id, so using an id to index it gives instant access to // the string of that id. This is grown as required. // // fHashTable // This is the hash table used to store and quickly access the // strings. // // fMapCapacity // The current capacity of the id map. When the current id hits this // value the map must must be expanded. // // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; PoolElem** fIdMap; RefHashTableOf* fHashTable; unsigned int fMapCapacity; protected: // protected data members // fCurId // This is the counter used to assign unique ids. It is just bumped // up one for each new string added. unsigned int fCurId; }; // Provide inline versions of some of the simple functions to improve performance. inline unsigned int XMLStringPool::addOrFind(const XMLCh* const newString) { PoolElem* elemToFind = fHashTable->get(newString); if (elemToFind) return elemToFind->fId; return addNewEntry(newString); } inline unsigned int XMLStringPool::getId(const XMLCh* const toFind) const { PoolElem* elemToFind = fHashTable->get(toFind); if (elemToFind) return elemToFind->fId; // Not found, so return zero, which is never a legal id return 0; } inline bool XMLStringPool::exists(const XMLCh* const newString) const { return fHashTable->containsKey(newString); } inline bool XMLStringPool::exists(const unsigned int id) const { return (id > 0 && (id < fCurId)); } inline const XMLCh* XMLStringPool::getValueForId(const unsigned int id) const { if (!id || (id >= fCurId)) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::StrPool_IllegalId, fMemoryManager); // Just index the id map and return that element's string return fIdMap[id]->fString; } inline unsigned int XMLStringPool::getStringCount() const { return fCurId-1; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/SynchronizedStringPool.hpp000644 000765 000024 00000006551 13241160335 024461 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: SynchronizedStringPool.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_SYNCHRONIZEDSTRINGPOOL_HPP) #define XERCESC_INCLUDE_GUARD_SYNCHRONIZEDSTRINGPOOL_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN // // This class provides a synchronized string pool implementation. // This will necessarily be slower than the regular XMLStringPool, so it // should only be used when updates need to be made in a thread-safe // way. Updates will be made on datastructures local to this object; // all queries that don't involve mutation will first be directed at // the XMLStringPool implementation with which this object is // constructed. class XMLUTIL_EXPORT XMLSynchronizedStringPool : public XMLStringPool { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- XMLSynchronizedStringPool ( const XMLStringPool * constPool , const unsigned int modulus = 109 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~XMLSynchronizedStringPool(); // ----------------------------------------------------------------------- // Pool management methods // ----------------------------------------------------------------------- virtual unsigned int addOrFind(const XMLCh* const newString); virtual bool exists(const XMLCh* const newString) const; virtual bool exists(const unsigned int id) const; virtual void flushAll(); virtual unsigned int getId(const XMLCh* const toFind) const; virtual const XMLCh* getValueForId(const unsigned int id) const; virtual unsigned int getStringCount() const; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLSynchronizedStringPool(const XMLSynchronizedStringPool&); XMLSynchronizedStringPool& operator=(const XMLSynchronizedStringPool&); // ----------------------------------------------------------------------- // private data members // fConstPool // the pool whose immutability we're protecting // fMutex // mutex to permit synchronous updates of our StringPool const XMLStringPool* fConstPool; XMLMutex fMutex; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/DefaultPanicHandler.hpp000644 000765 000024 00000004332 13241160336 023612 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: DefaultPanicHandler.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_DEFAULT_PANICHANDLER_HPP) #define XERCESC_INCLUDE_GUARD_DEFAULT_PANICHANDLER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN /** * Receive notification of panic. * *

This is Xerces' default implementation of the PanicHanlder * interface, which will be instantiated and used in the * absence of an application's panic handler. *

*/ class XMLUTIL_EXPORT DefaultPanicHandler : public XMemory, public PanicHandler { public: /** @name hidden Constructors */ //@{ /** Default constructor */ DefaultPanicHandler(){}; /** Destructor */ virtual ~DefaultPanicHandler(){}; //@} /** @name Implement virtual panic handler interface */ //@{ /** * Receive notification of panic * *

Upon invocation, a corresponding error message will be output * to the stderr, and program exit. *

* * @param reason The reason of panic * */ virtual void panic(const PanicHandler::PanicReasons reason); //@} private: /* Unimplemented Constructors and operators */ /* Copy constructor */ DefaultPanicHandler(const PanicHandler&); /** Assignment operator */ DefaultPanicHandler& operator=(const DefaultPanicHandler&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLIBM1047Transcoder.hpp000644 000765 000024 00000005145 13241160336 023311 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLIBM1047Transcoder.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLIBM1047TRANSCODER_HPP) #define XERCESC_INCLUDE_GUARD_XMLIBM1047TRANSCODER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN // // This class provides an implementation of the XMLTranscoder interface // for a simple 1047-US transcoder. The parser does some encodings // intrinsically without depending upon external transcoding services. // To make everything more orthogonal, we implement these internal // transcoders using the same transcoder abstraction as the pluggable // transcoding services do. // // class XMLUTIL_EXPORT XMLIBM1047Transcoder : public XML256TableTranscoder { public : // ----------------------------------------------------------------------- // Public, static methods // ----------------------------------------------------------------------- static XMLCh xlatThisOne(const XMLByte toXlat); // ----------------------------------------------------------------------- // Public constructors and destructor // ----------------------------------------------------------------------- XMLIBM1047Transcoder ( const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~XMLIBM1047Transcoder(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLIBM1047Transcoder(); XMLIBM1047Transcoder(const XMLIBM1047Transcoder&); void operator=(const XMLIBM1047Transcoder&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/Janitor.c000644 000765 000024 00000011177 13241160336 021023 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Janitor.c 1449010 2013-02-22 12:02:22Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Janitor: Constructors and Destructor // --------------------------------------------------------------------------- template Janitor::Janitor(T* const toDelete) : fData(toDelete) { } template Janitor::~Janitor() { reset(); } // --------------------------------------------------------------------------- // Janitor: Public, non-virtual methods // --------------------------------------------------------------------------- template void Janitor::orphan() { release(); } template T& Janitor::operator*() const { return *fData; } template T* Janitor::operator->() const { return fData; } template T* Janitor::get() const { return fData; } template T* Janitor::release() { T* p = fData; fData = 0; return p; } template void Janitor::reset(T* p) { if (fData) delete fData; fData = p; } template bool Janitor::isDataNull() { return (fData == 0); } // ----------------------------------------------------------------------- // ArrayJanitor: Constructors and Destructor // ----------------------------------------------------------------------- template ArrayJanitor::ArrayJanitor(T* const toDelete) : fData(toDelete) , fMemoryManager(0) { } template ArrayJanitor::ArrayJanitor(T* const toDelete, MemoryManager* const manager) : fData(toDelete) , fMemoryManager(manager) { } template ArrayJanitor::~ArrayJanitor() { reset(); } // ----------------------------------------------------------------------- // ArrayJanitor: Public, non-virtual methods // ----------------------------------------------------------------------- template void ArrayJanitor::orphan() { release(); } // Look, Ma! No hands! Don't call this with null data! template T& ArrayJanitor::operator[](XMLSize_t index) const { // TODO: Add appropriate exception return fData[index]; } template T* ArrayJanitor::get() const { return fData; } template T* ArrayJanitor::release() { T* p = fData; fData = 0; return p; } template void ArrayJanitor::reset(T* p) { if (fData) { if (fMemoryManager) fMemoryManager->deallocate((void*)fData); else delete [] fData; } fData = p; fMemoryManager = 0; } template void ArrayJanitor::reset(T* p, MemoryManager* const manager) { if (fData) { if (fMemoryManager) fMemoryManager->deallocate((void*)fData); else delete [] fData; } fData = p; fMemoryManager = manager; } // // JanitorMemFunCall // template JanitorMemFunCall::JanitorMemFunCall( T* object, MFPT toCall) : fObject(object), fToCall(toCall) { } template JanitorMemFunCall::~JanitorMemFunCall() { reset (); } template T& JanitorMemFunCall::operator*() const { return *fObject; } template T* JanitorMemFunCall::operator->() const { return fObject; } template T* JanitorMemFunCall::get() const { return fObject; } template T* JanitorMemFunCall::release() { T* p = fObject; fObject = 0; return p; } template void JanitorMemFunCall::reset(T* p) { if (fObject != 0 && fToCall != 0) (fObject->*fToCall)(); fObject = p; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLChar.hpp000644 000765 000024 00000036142 13241160335 021216 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLChar.hpp 1517488 2013-08-26 10:33:26Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLCHAR_HPP) #define XERCESC_INCLUDE_GUARD_XMLCHAR_HPP #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // This file defines Char and utility that conforms to XML 1.0 and XML 1.1 // --------------------------------------------------------------------------- // Masks for the fgCharCharsTable1_0 array const XMLByte gNCNameCharMask = 0x1; const XMLByte gFirstNameCharMask = 0x2; const XMLByte gNameCharMask = 0x4; const XMLByte gPlainContentCharMask = 0x8; const XMLByte gSpecialStartTagCharMask = 0x10; const XMLByte gControlCharMask = 0x20; const XMLByte gXMLCharMask = 0x40; const XMLByte gWhitespaceCharMask = 0x80; // --------------------------------------------------------------------------- // This class is for XML 1.0 // --------------------------------------------------------------------------- class XMLUTIL_EXPORT XMLChar1_0 { public: // ----------------------------------------------------------------------- // Public, static methods, check the string // ----------------------------------------------------------------------- static bool isAllSpaces ( const XMLCh* const toCheck , const XMLSize_t count ); static bool containsWhiteSpace ( const XMLCh* const toCheck , const XMLSize_t count ); static bool isValidNmtoken ( const XMLCh* const toCheck , const XMLSize_t count ); static bool isValidName ( const XMLCh* const toCheck , const XMLSize_t count ); static bool isValidName ( const XMLCh* const toCheck ); static bool isValidNCName ( const XMLCh* const toCheck , const XMLSize_t count ); static bool isValidQName ( const XMLCh* const toCheck , const XMLSize_t count ); // ----------------------------------------------------------------------- // Public, static methods, check the XMLCh // surrogate pair is assumed if second parameter is not null // ----------------------------------------------------------------------- static bool isXMLLetter(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isFirstNameChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isNameChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isPlainContentChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isSpecialStartTagChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isXMLChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isWhitespace(const XMLCh toCheck); static bool isWhitespace(const XMLCh toCheck, const XMLCh toCheck2); static bool isControlChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isPublicIdChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isFirstNCNameChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isNCNameChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); // ----------------------------------------------------------------------- // Special Non-conformant Public, static methods // ----------------------------------------------------------------------- /** * Return true if NEL (0x85) and LSEP (0x2028) to be treated as white space char. */ static bool isNELRecognized(); /** * Method to enable NEL (0x85) and LSEP (0x2028) to be treated as white space char. */ static void enableNELWS(); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLChar1_0(); // ----------------------------------------------------------------------- // Static data members // // fgCharCharsTable1_0 // The character characteristics table. Bits in each byte, represent // the characteristics of each character. It is generated via some // code and then hard coded into the cpp file for speed. // // fNEL // Flag to represents whether NEL and LSEP newline recognition is enabled // or disabled // ----------------------------------------------------------------------- static XMLByte fgCharCharsTable1_0[0x10000]; static bool enableNEL; friend class XMLReader; }; // --------------------------------------------------------------------------- // XMLReader: Public, static methods // --------------------------------------------------------------------------- inline bool XMLChar1_0::isXMLLetter(const XMLCh toCheck, const XMLCh toCheck2) { // An XML letter is a FirstNameChar minus ':' and '_'. if (!toCheck2) { return (((fgCharCharsTable1_0[toCheck] & gFirstNameCharMask) != 0) && (toCheck != chColon) && (toCheck != chUnderscore)); } return false; } inline bool XMLChar1_0::isFirstNameChar(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) return ((fgCharCharsTable1_0[toCheck] & gFirstNameCharMask) != 0); else { if ((toCheck >= 0xD800) && (toCheck <= 0xDB7F)) if ((toCheck2 >= 0xDC00) && (toCheck2 <= 0xDFFF)) return true; } return false; } inline bool XMLChar1_0::isFirstNCNameChar(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) { return (((fgCharCharsTable1_0[toCheck] & gFirstNameCharMask) != 0) && (toCheck != chColon)); } else { if ((toCheck >= 0xD800) && (toCheck <= 0xDB7F)) if ((toCheck2 >= 0xDC00) && (toCheck2 <= 0xDFFF)) return true; } return false; } inline bool XMLChar1_0::isNameChar(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) return ((fgCharCharsTable1_0[toCheck] & gNameCharMask) != 0); else { if ((toCheck >= 0xD800) && (toCheck <= 0xDB7F)) if ((toCheck2 >= 0xDC00) && (toCheck2 <= 0xDFFF)) return true; } return false; } inline bool XMLChar1_0::isNCNameChar(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) return ((fgCharCharsTable1_0[toCheck] & gNCNameCharMask) != 0); else { if ((toCheck >= 0xD800) && (toCheck <= 0xDB7F)) if ((toCheck2 >= 0xDC00) && (toCheck2 <= 0xDFFF)) return true; } return false; } inline bool XMLChar1_0::isPlainContentChar(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) return ((fgCharCharsTable1_0[toCheck] & gPlainContentCharMask) != 0); else { if ((toCheck >= 0xD800) && (toCheck <= 0xDBFF)) if ((toCheck2 >= 0xDC00) && (toCheck2 <= 0xDFFF)) return true; } return false; } inline bool XMLChar1_0::isSpecialStartTagChar(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) return ((fgCharCharsTable1_0[toCheck] & gSpecialStartTagCharMask) != 0); return false; } inline bool XMLChar1_0::isXMLChar(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) return ((fgCharCharsTable1_0[toCheck] & gXMLCharMask) != 0); else { if ((toCheck >= 0xD800) && (toCheck <= 0xDBFF)) if ((toCheck2 >= 0xDC00) && (toCheck2 <= 0xDFFF)) return true; } return false; } inline bool XMLChar1_0::isWhitespace(const XMLCh toCheck) { return ((fgCharCharsTable1_0[toCheck] & gWhitespaceCharMask) != 0); } inline bool XMLChar1_0::isWhitespace(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) return ((fgCharCharsTable1_0[toCheck] & gWhitespaceCharMask) != 0); return false; } inline bool XMLChar1_0::isControlChar(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) return ((fgCharCharsTable1_0[toCheck] & gControlCharMask) != 0); return false; } inline bool XMLChar1_0::isNELRecognized() { return enableNEL; } // --------------------------------------------------------------------------- // This class is for XML 1.1 // --------------------------------------------------------------------------- class XMLUTIL_EXPORT XMLChar1_1 { public: // ----------------------------------------------------------------------- // Public, static methods, check the string // ----------------------------------------------------------------------- static bool isAllSpaces ( const XMLCh* const toCheck , const XMLSize_t count ); static bool containsWhiteSpace ( const XMLCh* const toCheck , const XMLSize_t count ); static bool isValidNmtoken ( const XMLCh* const toCheck , const XMLSize_t count ); static bool isValidName ( const XMLCh* const toCheck , const XMLSize_t count ); static bool isValidName ( const XMLCh* const toCheck ); static bool isValidNCName ( const XMLCh* const toCheck , const XMLSize_t count ); static bool isValidQName ( const XMLCh* const toCheck , const XMLSize_t count ); // ----------------------------------------------------------------------- // Public, static methods, check the XMLCh // ----------------------------------------------------------------------- static bool isXMLLetter(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isFirstNameChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isNameChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isPlainContentChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isSpecialStartTagChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isXMLChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isWhitespace(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isControlChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isPublicIdChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isFirstNCNameChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); static bool isNCNameChar(const XMLCh toCheck, const XMLCh toCheck2 = 0); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLChar1_1(); // ----------------------------------------------------------------------- // Static data members // // fgCharCharsTable1_1 // The character characteristics table. Bits in each byte, represent // the characteristics of each character. It is generated via some // code and then hard coded into the cpp file for speed. // // ----------------------------------------------------------------------- static XMLByte fgCharCharsTable1_1[0x10000]; friend class XMLReader; }; // --------------------------------------------------------------------------- // XMLReader: Public, static methods // --------------------------------------------------------------------------- inline bool XMLChar1_1::isXMLLetter(const XMLCh toCheck, const XMLCh toCheck2) { /** XML 1.1 does not define a letter, so we use the 1.0 definition */ return XMLChar1_0::isXMLLetter(toCheck, toCheck2); } inline bool XMLChar1_1::isFirstNameChar(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) return ((fgCharCharsTable1_1[toCheck] & gFirstNameCharMask) != 0); else { if ((toCheck >= 0xD800) && (toCheck <= 0xDB7F)) if ((toCheck2 >= 0xDC00) && (toCheck2 <= 0xDFFF)) return true; } return false; } inline bool XMLChar1_1::isFirstNCNameChar(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) { return (((fgCharCharsTable1_1[toCheck] & gFirstNameCharMask) != 0) && (toCheck != chColon)); } else { if ((toCheck >= 0xD800) && (toCheck <= 0xDB7F)) if ((toCheck2 >= 0xDC00) && (toCheck2 <= 0xDFFF)) return true; } return false; } inline bool XMLChar1_1::isNameChar(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) return ((fgCharCharsTable1_1[toCheck] & gNameCharMask) != 0); else { if ((toCheck >= 0xD800) && (toCheck <= 0xDB7F)) if ((toCheck2 >= 0xDC00) && (toCheck2 <= 0xDFFF)) return true; } return false; } inline bool XMLChar1_1::isNCNameChar(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) return ((fgCharCharsTable1_1[toCheck] & gNCNameCharMask) != 0); else { if ((toCheck >= 0xD800) && (toCheck <= 0xDB7F)) if ((toCheck2 >= 0xDC00) && (toCheck2 <= 0xDFFF)) return true; } return false; } inline bool XMLChar1_1::isPlainContentChar(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) return ((fgCharCharsTable1_1[toCheck] & gPlainContentCharMask) != 0); else { if ((toCheck >= 0xD800) && (toCheck <= 0xDBFF)) if ((toCheck2 >= 0xDC00) && (toCheck2 <= 0xDFFF)) return true; } return false; } inline bool XMLChar1_1::isSpecialStartTagChar(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) return ((fgCharCharsTable1_1[toCheck] & gSpecialStartTagCharMask) != 0); return false; } inline bool XMLChar1_1::isXMLChar(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) return ((fgCharCharsTable1_1[toCheck] & gXMLCharMask) != 0); else { if ((toCheck >= 0xD800) && (toCheck <= 0xDBFF)) if ((toCheck2 >= 0xDC00) && (toCheck2 <= 0xDFFF)) return true; } return false; } inline bool XMLChar1_1::isWhitespace(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) return ((fgCharCharsTable1_1[toCheck] & gWhitespaceCharMask) != 0); return false; } inline bool XMLChar1_1::isControlChar(const XMLCh toCheck, const XMLCh toCheck2) { if (!toCheck2) return ((fgCharCharsTable1_1[toCheck] & gControlCharMask) != 0); return false; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/RefVectorOf.c000644 000765 000024 00000003626 13241160336 021601 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: RefVectorOf.c 676911 2008-07-15 13:27:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // RefVectorOf: Constructors and Destructor // --------------------------------------------------------------------------- template RefVectorOf::RefVectorOf(const XMLSize_t maxElems, const bool adoptElems, MemoryManager* const manager) : BaseRefVectorOf(maxElems, adoptElems, manager) { } template RefVectorOf::~RefVectorOf() { if (this->fAdoptedElems) { for (XMLSize_t index = 0; index < this->fCurCount; index++) delete this->fElemList[index]; } this->fMemoryManager->deallocate(this->fElemList);//delete [] this->fElemList; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/BinInputStream.hpp000644 000765 000024 00000010216 13241160336 022657 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BinInputStream.hpp 1137953 2011-06-21 10:52:28Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_BININPUTSTREAM_HPP) #define XERCESC_INCLUDE_GUARD_BININPUTSTREAM_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT BinInputStream : public XMemory { public : // ----------------------------------------------------------------------- // Virtual destructor for derived classes // ----------------------------------------------------------------------- virtual ~BinInputStream(); // ----------------------------------------------------------------------- // The virtual input stream interface // ----------------------------------------------------------------------- virtual XMLFilePos curPos() const = 0; virtual XMLSize_t readBytes ( XMLByte* const toFill , const XMLSize_t maxToRead ) = 0; /** * Return the "out-of-band" content type for the data supplied by this * input stream in the form of the media-type production (mime type * with optional parameters such as encoding) as defined by the HTTP 1.1 * specification. If no such content type is provided for the data, 0 is * returned. This function is expected to return the correct value at * any time after the construction of the stream. * * An example of the stream that may return non-0 from this function is * an HTTP stream with the value returned taken from the "Content-Type" * HTTP header. Note also that if the encoding of the data is known * to the application by some other means then the setEncoding function * in the InputSource object should be used instead. The getContentType * function should only be used to return information that is intrinsic * to the stream. * * @return The content type, or 0 if one is not available. */ virtual const XMLCh* getContentType() const = 0; /** * Return the "out-of-band" encoding for the data supplied by this * input stream. If no such content type is provided for the data, 0 is * returned. This function is expected to return the correct value at * any time after the construction of the stream. * * An example of the stream that may return non-0 from this function is * an HTTP stream with the value returned taken from the "Content-Type" * HTTP header. Note also that if the encoding of the data is known * to the application by some other means then the setEncoding function * in the InputSource object should be used instead. The getEncoding * function should only be used to return information that is intrinsic * to the stream. * * @return The name of the encoding, or 0 if one is not available. */ virtual const XMLCh *getEncoding() const; protected : // ----------------------------------------------------------------------- // Hidden Constructors // ----------------------------------------------------------------------- BinInputStream(); private : // ----------------------------------------------------------------------- // Unimplemented Constructors // ----------------------------------------------------------------------- BinInputStream(const BinInputStream&); BinInputStream& operator=(const BinInputStream&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/BinFileInputStream.cpp000644 000765 000024 00000007372 13241160336 023463 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BinFileInputStream.cpp 1597057 2014-05-23 10:50:16Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // BinFileInputStream: Constructors and Destructor // --------------------------------------------------------------------------- BinFileInputStream::BinFileInputStream(const XMLCh* const fileName , MemoryManager* const manager) : fSource(XMLPlatformUtils::openFile(fileName, manager)) , fMemoryManager(manager) { } BinFileInputStream::BinFileInputStream(const char* const fileName, MemoryManager* const manager) : fSource(XMLPlatformUtils::openFile(fileName, manager)) , fMemoryManager(manager) { } BinFileInputStream::BinFileInputStream(const FileHandle toAdopt , MemoryManager* const manager) : fSource(toAdopt) , fMemoryManager(manager) { } BinFileInputStream::~BinFileInputStream() { if (getIsOpen()) { try { XMLPlatformUtils::closeFile(fSource, fMemoryManager); } catch (...) { // There is nothing we can do about it here. } } } // --------------------------------------------------------------------------- // BinFileInputStream: Getter methods // --------------------------------------------------------------------------- XMLFilePos BinFileInputStream::getSize() const { return XMLPlatformUtils::fileSize(fSource, fMemoryManager); } // --------------------------------------------------------------------------- // BinFileInputStream: Stream management methods // --------------------------------------------------------------------------- void BinFileInputStream::reset() { XMLPlatformUtils::resetFile(fSource, fMemoryManager); } // --------------------------------------------------------------------------- // BinFileInputStream: Implementation of the input stream interface // --------------------------------------------------------------------------- XMLFilePos BinFileInputStream::curPos() const { return XMLPlatformUtils::curFilePos(fSource, fMemoryManager); } XMLSize_t BinFileInputStream::readBytes( XMLByte* const toFill , const XMLSize_t maxToRead) { // // Read up to the maximum bytes requested. We return the number // actually read. // return XMLPlatformUtils::readFileBuffer(fSource, maxToRead, toFill, fMemoryManager); } const XMLCh* BinFileInputStream::getContentType() const { return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/PlatformUtils.hpp000644 000765 000024 00000100026 13243370666 022572 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: PlatformUtils.hpp 1825016 2018-02-21 22:04:13Z rleigh $ */ #if !defined(XERCESC_INCLUDE_GUARD_PLATFORMUTILS_HPP) #define XERCESC_INCLUDE_GUARD_PLATFORMUTILS_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLMsgLoader; class XMLNetAccessor; class XMLTransService; class MemoryManager; class XMLMutex; // // For internal use only // // This class provides a simple abstract API via which lazily evaluated // data can be cleaned up. // class XMLUTIL_EXPORT XMLDeleter { public : virtual ~XMLDeleter(); protected : XMLDeleter(); private : XMLDeleter(const XMLDeleter&); XMLDeleter& operator=(const XMLDeleter&); }; /** * Utilities that must be implemented in a platform-specific way. * * This class contains methods that must be implemented in a platform * specific manner. The actual implementations of these methods are * available in the per-platform files inside src/util/Platforms * . */ class XMLUTIL_EXPORT XMLPlatformUtils { public : /** @name Public Static Data */ //@{ /** The network accessor * * This is provided by the per-platform driver, so each platform can * choose what actual implementation it wants to use. The object must * be dynamically allocated. * * Note that you may optionally, if your platform driver does not * install a network accessor, set it manually from your client code * after calling Initialize(). This works because this object is * not required during initialization, and only comes into play during * actual XML parsing. */ static XMLNetAccessor* fgNetAccessor; /** The transcoding service. * * This is provided by the per platform driver, so each platform can * choose what implementation it wants to use. When the platform * independent initialization code needs to get a transcoding service * object, it will call makeTransService() to ask the * per-platform code to create one. Only one transcoding service * object is requested per-process, so it is shared and synchronized * among parser instances within that process. */ static XMLTransService* fgTransService; #ifdef OS390 static XMLTransService* fgTransService2; #endif /** The Panic Handler * * This is the application provided panic handler. */ static PanicHandler* fgUserPanicHandler; /** The Panic Handler * * This is the default panic handler. */ static PanicHandler* fgDefaultPanicHandler; /** The configurable memory manager * * This is the pluggable memory manager. If it is not provided by an * application, a default implementation is used. */ static MemoryManager* fgMemoryManager; static XMLFileMgr* fgFileMgr; static XMLMutexMgr* fgMutexMgr; /** Global mutex for fast or infrequent operations. * * Use this mutex only for fast (e.g., increment an integer, * check flag, etc.) or infrequent (e.g., once-off initialization) * operations. */ static XMLMutex* fgAtomicMutex; static bool fgXMLChBigEndian; static bool fgSSE2ok; //@} /** @name Initialization and Panic methods */ //@{ /** Perform per-process parser initialization * * Initialization must be called first in any client code. * * @param locale The locale to use for messages. * * The locale is set iff the Initialize() is invoked for the very first time, * to ensure that each and every message loader, in the process space, share * the same locale. * * All subsequent invocations of Initialize(), with a different locale, have * no effect on the message loaders, either instantiated, or to be instantiated. * * To set to a different locale, client application needs to Terminate() (or * multiple Terminate() in the case where multiple Initialize() have been invoked * before), followed by Initialize(new_locale). * * The default locale is "en_US". * * @param nlsHome User specified location where MsgLoader retrieves error message files. * the discussion above with regard to locale, applies to nlsHome as well. * * @param panicHandler Application's panic handler, application owns this handler. * Application shall make sure that the plugged panic handler persists * through the call to XMLPlatformUtils::Terminate(). * * @param memoryManager Plugged-in memory manager which is owned by the * application. Applications must make sure that the * plugged-in memory manager persist through the call to * XMLPlatformUtils::Terminate() */ static void Initialize(const char* const locale = XMLUni::fgXercescDefaultLocale , const char* const nlsHome = 0 , PanicHandler* const panicHandler = 0 , MemoryManager* const memoryManager = 0); /** Perform per-process parser initialization * * Initialization must be called first in any client code. * * @param initialDOMHeapAllocSize The size of the first memory block * allocated by the DOMDocument heap. Note that changing this parameter * may result in poor performance and/or excessive memory usage. For * the default value refer to dom/impl/DOMDocumentImpl.cpp. * * @param maxDOMHeapAllocSize The maximum size of the memory block * allocated by the DOMDocument heap. As the document grows, the * allocated by the heap memory blocks grow from initialDOMHeapAllocSize * to maxDOMHeapAllocSize. Note that changing this parameter may result * in poor performance and/or excessive memory usage. For the default * value refer to dom/impl/DOMDocumentImpl.cpp. * * @param maxDOMSubAllocationSize The maximum size of the memory block * requested that is handled by the DOMDocument heap. A request for a * larger block is handled directly by the memory manager. Note that * changing this parameter may result in poor performance and/or * excessive memory usage. For the default value refer to * dom/impl/DOMDocumentImpl.cpp. * * @param locale The locale to use for messages. * * The locale is set iff the Initialize() is invoked for the very first time, * to ensure that each and every message loader, in the process space, share * the same locale. * * All subsequent invocations of Initialize(), with a different locale, have * no effect on the message loaders, either instantiated, or to be instantiated. * * To set to a different locale, client application needs to Terminate() (or * multiple Terminate() in the case where multiple Initialize() have been invoked * before), followed by Initialize(new_locale). * * The default locale is "en_US". * * @param nlsHome User specified location where MsgLoader retrieves error message files. * the discussion above with regard to locale, applies to nlsHome as well. * * @param panicHandler Application's panic handler, application owns this handler. * Application shall make sure that the plugged panic handler persists * through the call to XMLPlatformUtils::Terminate(). * * @param memoryManager Plugged-in memory manager which is owned by the * application. Applications must make sure that the plugged-in memory * manager persist through the call to XMLPlatformUtils::Terminate() */ static void Initialize(XMLSize_t initialDOMHeapAllocSize , XMLSize_t maxDOMHeapAllocSize , XMLSize_t maxDOMSubAllocationSize , const char* const locale = XMLUni::fgXercescDefaultLocale , const char* const nlsHome = 0 , PanicHandler* const panicHandler = 0 , MemoryManager* const memoryManager = 0); /** Perform per-process parser termination * * The termination call is currently optional, to aid those dynamically * loading the parser to clean up before exit, or to avoid spurious * reports from leak detectors. */ static void Terminate(); /** The panic mechanism. * * If, during initialization, we cannot even get far enough along * to get transcoding up or get message loading working, we call * this method.

* * Each platform can implement it however they want. This method will * delegate the panic handling to a user specified panic handler or * in the absence of it, the default panic handler. * * In case the default panic handler does not support a particular * platform, the platform specific panic handling shall be implemented * here

. * * @param reason The enumeration that defines the cause of the failure */ static void panic ( const PanicHandler::PanicReasons reason ); //@} /** @name File Methods */ //@{ /** Make a new file object appropriate for the platform. * * @param manager The MemoryManager to use to allocate objects */ static XMLFileMgr* makeFileMgr(MemoryManager* const manager); /** Get the current file position * * This must be implemented by the per-platform driver, which should * use local file services to determine the current position within * the passed file. * * Since the file API provided here only reads, if the host platform * supports separate read/write positions, only the read position is * of any interest, and hence should be the one returned. * * @param theFile The file handle * @param manager The MemoryManager to use to allocate objects */ static XMLFilePos curFilePos(FileHandle theFile , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Closes the file handle * * This must be implemented by the per-platform driver, which should * use local file services to close the passed file handle, and to * destroy the passed file handle and any allocated data or system * resources it contains. * * @param theFile The file handle to close * @param manager The MemoryManager to use to allocate objects */ static void closeFile(FileHandle theFile , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Returns the file size * * This must be implemented by the per-platform driver, which should * use local file services to determine the current size of the file * represented by the passed handle. * * @param theFile The file handle whose size you want * @param manager The MemoryManager to use to allocate objects * @return Returns the size of the file in bytes */ static XMLFilePos fileSize(FileHandle theFile , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Opens the file * * This must be implemented by the per-platform driver, which should * use local file services to open passed file. If it fails, a * null handle pointer should be returned. * * @param fileName The string containing the name of the file * @param manager The MemoryManager to use to allocate objects * @return The file handle of the opened file */ static FileHandle openFile(const char* const fileName , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Opens a named file * * This must be implemented by the per-platform driver, which should * use local file services to open the passed file. If it fails, a * null handle pointer should be returned. * * @param fileName The string containing the name of the file * @param manager The MemoryManager to use to allocate objects * @return The file handle of the opened file */ static FileHandle openFile(const XMLCh* const fileName , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Open a named file to write * * This must be implemented by the per-platform driver, which should * use local file services to open passed file. If it fails, a * null handle pointer should be returned. * * @param fileName The string containing the name of the file * @param manager The MemoryManager to use to allocate objects * @return The file handle of the opened file */ static FileHandle openFileToWrite(const char* const fileName , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Open a named file to write * * This must be implemented by the per-platform driver, which should * use local file services to open the passed file. If it fails, a * null handle pointer should be returned. * * @param fileName The string containing the name of the file * @param manager The MemoryManager to use to allocate objects * @return The file handle of the opened file */ static FileHandle openFileToWrite(const XMLCh* const fileName , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Opens the standard input as a file * * This must be implemented by the per-platform driver, which should * use local file services to open a handle to the standard input. * It should be a copy of the standard input handle, since it will * be closed later! * * @param manager The MemoryManager to use to allocate objects * @return The file handle of the standard input stream */ static FileHandle openStdInHandle(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Reads the file buffer * * This must be implemented by the per-platform driver, which should * use local file services to read up to 'toRead' bytes of data from * the passed file, and return those bytes in the 'toFill' buffer. It * is not an error not to read the requested number of bytes. When the * end of file is reached, zero should be returned. * * @param theFile The file handle to be read from. * @param toRead The maximum number of byte to read from the current * position * @param toFill The byte buffer to fill * @param manager The MemoryManager to use to allocate objects * * @return Returns the number of bytes read from the stream or file */ static XMLSize_t readFileBuffer ( FileHandle theFile , const XMLSize_t toRead , XMLByte* const toFill , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Writes the buffer to the file * * This must be implemented by the per-platform driver, which should * use local file services to write up to 'toWrite' bytes of data to * the passed file. Unless exception raised by local file services, * 'toWrite' bytes of data is to be written to the passed file. * * @param theFile The file handle to be written to. * @param toWrite The maximum number of byte to write from the current * position * @param toFlush The byte buffer to flush * @param manager The MemoryManager to use to allocate objects * @return void */ static void writeBufferToFile ( FileHandle const theFile , XMLSize_t toWrite , const XMLByte* const toFlush , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Resets the file handle * * This must be implemented by the per-platform driver which will use * local file services to reset the file position to the start of the * the file. * * @param theFile The file handle that you want to reset * @param manager The MemoryManager to use to allocate objects */ static void resetFile(FileHandle theFile , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); //@} /** @name File System Methods */ //@{ /** Gets the full path from a relative path * * This must be implemented by the per-platform driver. It should * complete a relative path using the 'current directory', or whatever * the local equivalent of a current directory is. If the passed * source path is actually fully qualified, then a straight copy of it * will be returned. * * @param srcPath The path of the file for which you want the full path * * @param manager Pointer to the memory manager to be used to * allocate objects. * * @return Returns the fully qualified path of the file name including * the file name. This is dyanmically allocated and must be * deleted by the caller when its no longer needed! The memory * returned will beallocated using the static memory manager, if * user do not supply a memory manager. Users then need to make * sure to use either the default or user specific memory manager * to deallocate the memory. */ static XMLCh* getFullPath ( const XMLCh* const srcPath , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Gets the current working directory * * This must be implemented by the per-platform driver. It returns * the current working directory is. * @param manager The MemoryManager to use to allocate objects * @return Returns the current working directory. * This is dyanmically allocated and must be deleted * by the caller when its no longer needed! The memory returned * will be allocated using the static memory manager, if users * do not supply a memory manager. Users then need to make sure * to use either the default or user specific memory manager to * deallocate the memory. */ static XMLCh* getCurrentDirectory ( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Check if a character is a slash * * This must be implemented by the per-platform driver. * * @param c the character to be examined * * @return true if the character examined is a slash * false otherwise */ static inline bool isAnySlash(XMLCh c); /** Remove occurrences of the pair of dot slash * * To remove the sequence, dot slash if it is part of the sequence, * slash dot slash. * * @param srcPath The path for which you want to remove the dot slash sequence. * @param manager The MemoryManager to use to allocate objects * @return */ static void removeDotSlash(XMLCh* const srcPath , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Remove occurrences of the dot dot slash * * To remove the sequence, slash dot dot slash and its preceding path segment * if and only if the preceding path segment is not slash dot dot slash. * * @param srcPath The path for which you want to remove the slash dot * dot slash sequence and its preceding path segment. * @param manager The MemoryManager to use to allocate objects * @return */ static void removeDotDotSlash(XMLCh* const srcPath , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Determines if a path is relative or absolute * * This must be implemented by the per-platform driver, which should * determine whether the passed path is relative or not. The concept * of relative and absolute might be... well relative on different * platforms. But, as long as the determination is made consistently * and in coordination with the weavePaths() method, it should work * for any platform. * * @param toCheck The file name which you want to check * @param manager The MemoryManager to use to allocate objects * @return Returns true if the filename appears to be relative */ static bool isRelative(const XMLCh* const toCheck , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Utility to join two paths * * This must be implemented by the per-platform driver, and should * weave the relative path part together with the base part and return * a new path that represents this combination. * * If the relative part turns out to be fully qualified, it will be * returned as is. If it is not, then it will be woven onto the * passed base path, by removing one path component for each leading * "../" (or whatever is the equivalent in the local system) in the * relative path. * * @param basePath The string containing the base path * @param relativePath The string containing the relative path * @param manager The MemoryManager to use to allocate objects * @return Returns a string containing the 'woven' path. It should * be dynamically allocated and becomes the responsibility of the * caller to delete. */ static XMLCh* weavePaths ( const XMLCh* const basePath , const XMLCh* const relativePath , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** @name Timing Methods */ //@{ /** Gets the system time in milliseconds * * This must be implemented by the per-platform driver, which should * use local services to return the current value of a running * millisecond timer. Note that the value returned is only as accurate * as the millisecond time of the underlying host system. * * @return Returns the system time as an unsigned long */ static unsigned long getCurrentMillis(); //@} /** @name Mutex Methods */ //@{ /** Factory method for creating MutexMgr object. * * This factory method creates a mutexmgr that will be used * on the particular platform. * * @param manager The MemoryManager to use to allocate objects */ static XMLMutexMgr* makeMutexMgr(MemoryManager* const manager); /** Closes a mutex handle * * Each per-platform driver must implement this. Only it knows what * the actual content of the passed mutex handle is. * * @param mtxHandle The mutex handle that you want to close * @param manager The MemoryManager used to allocate the object */ static void closeMutex(void* const mtxHandle, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Locks a mutex handle * * Each per-platform driver must implement this. Only it knows what * the actual content of the passed mutex handle is. * * @param mtxHandle The mutex handle that you want to lock */ static void lockMutex(void* const mtxHandle); /** Make a new mutex * * Each per-platform driver must implement this. Only it knows what * the actual content of the passed mutex handle is. The returned * handle pointer will be eventually passed to closeMutex() which is * also implemented by the platform driver. * * @param manager The MemoryManager to use to allocate objects */ static void* makeMutex(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Unlocks a mutex * * Each per-platform driver must implement this. Only it knows what * the actual content of the passed mutex handle is. * * Note that, since the underlying system synchronization services * are used, Xerces cannot guarantee that lock/unlock operations are * correctly enforced on a per-thread basis or that incorrect nesting * of lock/unlock operations will be caught. * * @param mtxHandle The mutex handle that you want to unlock */ static void unlockMutex(void* const mtxHandle); //@} /** @name External Message Support */ //@{ /** Loads the message set from among the available domains * * The returned object must be dynamically allocated and the caller * becomes responsible for cleaning it up. * * @param msgDomain The message domain which you want to load */ static XMLMsgLoader* loadMsgSet(const XMLCh* const msgDomain); //@} /** @name NEL Character Handling */ //@{ /** * This function enables the recognition of NEL(0x85) char and LSEP (0x2028) as newline chars * which is disabled by default. * It is only called once per process. Once it is set, any subsequent calls * will result in exception being thrown. * * Note: 1. Turning this option on will make the parser non compliant to XML 1.0. * 2. This option has no effect to document conforming to XML 1.1 compliant, * which always recognize these two chars (0x85 and 0x2028) as newline characters. * */ static void recognizeNEL(bool state , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Return the value of fgNEL flag. */ static bool isNELRecognized(); //@} /** @name Strict IANA Encoding Checking */ //@{ /** * This function enables/disables strict IANA encoding names checking. * * The strict checking is disabled by default. * * @param state If true, a strict IANA encoding name check is performed, * otherwise, no checking. * */ static void strictIANAEncoding(const bool state); /** * Returns whether a strict IANA encoding name check is enabled or * disabled. */ static bool isStrictIANAEncoding(); //@} /** * Aligns the specified pointer per platform block allocation * requirements. * * The results of this function may be altered by defining * XML_PLATFORM_NEW_BLOCK_ALIGNMENT. */ static inline XMLSize_t alignPointerForNewBlockAllocation(XMLSize_t ptrSize); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLPlatformUtils(); /** @name Private static methods */ //@{ /** Loads a message set from the available domains * * @param msgDomain The message domain containing the message to be * loaded */ static XMLMsgLoader* loadAMsgSet(const XMLCh* const msgDomain); /** Creates a net accessor object. * * Each per-platform driver must implement this method. However, * having a Net Accessor is optional and this method can return a * null pointer if remote access via HTTP and FTP URLs is not required. * * @return An object derived from XMLNetAccessor. It must be dynamically * allocated, since it will be deleted later. */ static XMLNetAccessor* makeNetAccessor(); /** Creates a Transcoding service * * Each per-platform driver must implement this method and return some * derivative of the XMLTransService class. This object serves as the * transcoder factory for this process. The object must be dynamically * allocated and the caller is responsible for cleaning it up. * * @return A dynamically allocated object of some class derived from * the XMLTransService class. */ static XMLTransService* makeTransService(); /** Search for sequence, slash dot dot slash * * @param srcPath the path to search * * @return the position of the first occurrence of slash dot dot slash * -1 if no such sequence is found */ static int searchSlashDotDotSlash(XMLCh* const srcPath); //@} /** @name Private static methods */ //@{ /** * Indicates whether the memory manager was supplied by the user * or not. Users own the memory manager, and if none is supplied, * Xerces uses a default one that it owns and is responsible for * deleting in Terminate(). */ static bool fgMemMgrAdopted; //@} }; MakeXMLException(XMLPlatformUtilsException, XMLUTIL_EXPORT) // --------------------------------------------------------------------------- // XMLPlatformUtils: alignPointerForNewBlockAllocation // --------------------------------------------------------------------------- // Calculate alignment required by platform for a new // block allocation. We use this in our custom allocators // to ensure that returned blocks are properly aligned. // Note that, although this will take a pointer and return the position // at which it should be placed for correct alignment, in our code // we normally use XMLSize_t parameters to discover what the alignment // of header blocks should be. Thus, if this is to be // used for the former purpose, to make compilers happy // some casting will be necessary - neilg. // // Note: XML_PLATFORM_NEW_BLOCK_ALIGNMENT may be specified on a // per-architecture basis to dictate the alignment requirements // of the architecture. In the absense of this specification, // this routine guesses at the correct alignment value. // // A XML_PLATFORM_NEW_BLOCK_ALIGNMENT value of zero is illegal. // If a platform requires absolutely no alignment, a value // of 1 should be specified ("align pointers on 1 byte boundaries"). // inline XMLSize_t XMLPlatformUtils::alignPointerForNewBlockAllocation(XMLSize_t ptrSize) { // Macro XML_PLATFORM_NEW_BLOCK_ALIGNMENT may be defined // as needed to dictate alignment requirements on a // per-architecture basis. In the absense of that we // take an educated guess. #ifdef XML_PLATFORM_NEW_BLOCK_ALIGNMENT const XMLSize_t alignment = XML_PLATFORM_NEW_BLOCK_ALIGNMENT; #else const XMLSize_t alignment = (sizeof(void*) >= sizeof(double)) ? sizeof(void*) : sizeof(double); #endif // Calculate current alignment of pointer XMLSize_t current = ptrSize % alignment; // Adjust pointer alignment as needed return (current == 0) ? ptrSize : (ptrSize + alignment - current); } // --------------------------------------------------------------------------- // XMLDeleter: Public Destructor // --------------------------------------------------------------------------- inline XMLDeleter::~XMLDeleter() { } // --------------------------------------------------------------------------- // XMLDeleter: Hidden constructors and operators // --------------------------------------------------------------------------- inline XMLDeleter::XMLDeleter() { } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLInitializer.cpp000644 000765 000024 00000006654 13241160336 022625 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLInitializer.cpp 1329261 2012-04-23 14:35:09Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLInitializer: Initialization methods // --------------------------------------------------------------------------- void XMLInitializer::initializeStaticData() { try { // Note that in some cases the order of initialization can be // important. // // Core // initializeEncodingValidator(); initializeXMLException(); initializeXMLScanner(); initializeXMLValidator(); // Regex // initializeRangeTokenMap(); initializeRegularExpression(); // DTD // initializeDTDGrammar(); // Schema // initializeXSDErrorReporter(); initializeDatatypeValidatorFactory(); initializeGeneralAttributeCheck(); initializeXSValue(); initializeComplexTypeInfo(); // DOM // initializeDOMImplementationRegistry(); initializeDOMImplementationImpl(); initializeDOMDocumentTypeImpl(); initializeDOMNodeListImpl(); initializeDOMNormalizer(); // XInclude // initializeXInclude(); } catch(...) { XMLPlatformUtils::panic(PanicHandler::Panic_AllStaticInitErr); } } void XMLInitializer::terminateStaticData() { // Terminate in the reverse order of initialization. There shouldn't // be any exceptions and if there are, we can't do anything about them // since we are no longer initialized (think of it as throwing from // a destructor). // // XInclude // terminateXInclude(); // DOM // terminateDOMNormalizer(); terminateDOMNodeListImpl(); terminateDOMDocumentTypeImpl(); terminateDOMImplementationImpl(); terminateDOMImplementationRegistry(); // Schema // terminateComplexTypeInfo(); terminateXSValue(); terminateGeneralAttributeCheck(); terminateDatatypeValidatorFactory(); terminateXSDErrorReporter(); // DTD // terminateDTDGrammar(); // Regex // terminateRegularExpression(); terminateRangeTokenMap(); // Core // terminateXMLValidator(); terminateXMLScanner(); terminateXMLException(); terminateEncodingValidator(); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/KVStringPair.cpp000644 000765 000024 00000007021 13241160336 022271 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: KVStringPair.cpp 554580 2007-07-09 09:09:51Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // KVStringPair: Constructors and Destructor // --------------------------------------------------------------------------- KVStringPair::KVStringPair(MemoryManager* const manager) :fKeyAllocSize(0) ,fValueAllocSize(0) ,fKey(0) ,fValue(0) ,fMemoryManager(manager) { } KVStringPair::KVStringPair(const XMLCh* const key, const XMLCh* const value, MemoryManager* const manager) :fKeyAllocSize(0) ,fValueAllocSize(0) ,fKey(0) ,fValue(0) ,fMemoryManager(manager) { set(key, value); } KVStringPair::KVStringPair(const XMLCh* const key, const XMLCh* const value, const XMLSize_t valueLength, MemoryManager* const manager) :fKeyAllocSize(0) ,fValueAllocSize(0) ,fKey(0) ,fValue(0) ,fMemoryManager(manager) { setKey(key); setValue(value, valueLength); } KVStringPair::KVStringPair(const XMLCh* const key, const XMLSize_t keyLength, const XMLCh* const value, const XMLSize_t valueLength, MemoryManager* const manager) :fKeyAllocSize(0) ,fValueAllocSize(0) ,fKey(0) ,fValue(0) ,fMemoryManager(manager) { setKey(key, keyLength); setValue(value, valueLength); } KVStringPair::KVStringPair(const KVStringPair& toCopy) :XSerializable(toCopy) ,XMemory(toCopy) ,fKeyAllocSize(0) ,fValueAllocSize(0) ,fKey(0) ,fValue(0) ,fMemoryManager(toCopy.fMemoryManager) { set(toCopy.fKey, toCopy.fValue); } KVStringPair::~KVStringPair() { fMemoryManager->deallocate(fKey); //delete [] fKey; fMemoryManager->deallocate(fValue); //delete [] fValue; } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(KVStringPair) void KVStringPair::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng.writeString(fKey, fKeyAllocSize, XSerializeEngine::toWriteBufferLen); serEng.writeString(fValue, fValueAllocSize, XSerializeEngine::toWriteBufferLen); } else { XMLSize_t dataLen = 0; serEng.readString(fKey, fKeyAllocSize, dataLen, XSerializeEngine::toReadBufferLen); serEng.readString(fValue, fValueAllocSize, dataLen, XSerializeEngine::toReadBufferLen); } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLStringTokenizer.cpp000644 000765 000024 00000011470 13241160336 023473 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLStringTokenizer.cpp 555320 2007-07-11 16:05:13Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLStringTokenizer: Local const data // --------------------------------------------------------------------------- const XMLCh fgDelimeters[] = { chSpace, chHTab, chCR, chLF, chNull }; // --------------------------------------------------------------------------- // XMLStringTokenizer: Constructors and Destructor // --------------------------------------------------------------------------- typedef JanitorMemFunCall CleanupType; XMLStringTokenizer::XMLStringTokenizer( const XMLCh* const srcStr , MemoryManager* const manager) : fOffset(0) , fStringLen(XMLString::stringLen(srcStr)) , fString(XMLString::replicate(srcStr, manager)) , fDelimeters(fgDelimeters) , fTokens(0) , fMemoryManager(manager) { CleanupType cleanup(this, &XMLStringTokenizer::cleanUp); try { if (fStringLen > 0) { fTokens = new (fMemoryManager) RefArrayVectorOf(4, true, fMemoryManager); } } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XMLStringTokenizer::XMLStringTokenizer(const XMLCh* const srcStr, const XMLCh* const delim, MemoryManager* const manager) : fOffset(0) , fStringLen(XMLString::stringLen(srcStr)) , fString(XMLString::replicate(srcStr, manager)) , fDelimeters(XMLString::replicate(delim, manager)) , fTokens(0) , fMemoryManager(manager) { CleanupType cleanup(this, &XMLStringTokenizer::cleanUp); try { if (fStringLen > 0) { fTokens = new (fMemoryManager) RefArrayVectorOf(4, true, fMemoryManager); } } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XMLStringTokenizer::~XMLStringTokenizer() { cleanUp(); } // --------------------------------------------------------------------------- // XMLStringTokenizer: CleanUp methods // --------------------------------------------------------------------------- void XMLStringTokenizer::cleanUp() { fMemoryManager->deallocate(fString);//delete [] fString; if (fDelimeters != fgDelimeters) { fMemoryManager->deallocate((void*)fDelimeters);//delete [] fDelimeters; } delete fTokens; } // --------------------------------------------------------------------------- // XMLStringTokenizer: Management methods // --------------------------------------------------------------------------- XMLCh* XMLStringTokenizer::nextToken() { if (fOffset >= fStringLen) { return 0; } bool tokFound = false; XMLSize_t startIndex = fOffset; XMLSize_t endIndex = fOffset; for (; endIndex < fStringLen; endIndex++) { if (isDelimeter(fString[endIndex])) { if (tokFound) { break; } startIndex++; continue; } tokFound = true; } fOffset = endIndex; if (tokFound) { XMLCh* tokStr = (XMLCh*) fMemoryManager->allocate ( (endIndex - startIndex + 1) * sizeof(XMLCh) );//new XMLCh[(endIndex - startIndex) + 1]; XMLString::subString(tokStr, fString, startIndex, endIndex, fMemoryManager); fTokens->addElement(tokStr); return tokStr; } return 0; } bool XMLStringTokenizer::hasMoreTokens() { if (countTokens() > 0) return true; return false; } XERCES_CPP_NAMESPACE_END /** * End of file XMLStringTokenizer.cpp */ xerces-c-3.2.2/src/xercesc/util/XMLExceptMsgs.hpp000644 000765 000024 00000044551 13241160335 022426 0ustar00scantorstaff000000 000000 // This file is generated, don't edit it!! #if !defined(XERCESC_INCLUDE_GUARD_ERRHEADER_XMLExcepts) #define XERCESC_INCLUDE_GUARD_ERRHEADER_XMLExcepts #include #include XERCES_CPP_NAMESPACE_BEGIN // Ignore warning about private constructor #ifdef __GNUC__ # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wctor-dtor-privacy" #endif class XMLExcepts { public : enum Codes { NoError = 0 , W_LowBounds = 1 , Scan_CouldNotOpenSource_Warning = 2 , W_HighBounds = 3 , F_LowBounds = 4 , Array_BadIndex = 5 , Array_BadNewSize = 6 , AttrList_BadIndex = 7 , AttDef_BadAttType = 8 , AttDef_BadDefAttType = 9 , Bitset_BadIndex = 10 , Bitset_NotEqualSize = 11 , BufMgr_NoMoreBuffers = 12 , BufMgr_BufferNotInPool = 13 , CPtr_PointerIsZero = 14 , CM_BinOpHadUnaryType = 15 , CM_MustBeMixedOrChildren = 16 , CM_NoPCDATAHere = 17 , CM_UnaryOpHadBinType = 18 , CM_UnknownCMType = 19 , CM_UnknownCMSpecType = 20 , CM_NoParentCSN = 21 , CM_NotValidSpecTypeForNode = 22 , DTD_UnknownCreateReason = 23 , ElemStack_EmptyStack = 24 , ElemStack_StackUnderflow = 25 , ElemStack_NoParentPushed = 26 , Enum_NoMoreElements = 27 , File_CouldNotOpenFile = 28 , File_CouldNotGetCurPos = 29 , File_CouldNotCloseFile = 30 , File_CouldNotSeekToEnd = 31 , File_CouldNotSeekToPos = 32 , File_CouldNotDupHandle = 33 , File_CouldNotReadFromFile = 34 , File_CouldNotWriteToFile = 35 , File_CouldNotResetFile = 36 , File_CouldNotGetSize = 37 , File_CouldNotGetBasePathName = 38 , Gen_ParseInProgress = 39 , Gen_NoDTDValidator = 40 , Gen_CouldNotOpenDTD = 41 , Gen_CouldNotOpenExtEntity = 42 , Gen_UnexpectedEOF = 43 , HshTbl_ZeroModulus = 44 , HshTbl_BadHashFromKey = 45 , HshTbl_NoSuchKeyExists = 46 , Mutex_CouldNotDestroy = 47 , NetAcc_InternalError = 48 , NetAcc_LengthError = 49 , NetAcc_InitFailed = 50 , NetAcc_TargetResolution = 51 , NetAcc_CreateSocket = 52 , NetAcc_ConnSocket = 53 , NetAcc_WriteSocket = 54 , NetAcc_ReadSocket = 55 , NetAcc_UnsupportedMethod = 56 , Pool_ElemAlreadyExists = 57 , Pool_InvalidId = 58 , Pool_ZeroModulus = 59 , RdrMgr_ReaderIdNotFound = 60 , Reader_BadAutoEncoding = 61 , Reader_CouldNotDecodeFirstLine = 62 , Reader_NelLsepinDecl = 63 , Reader_SrcOfsNotSupported = 64 , Reader_EncodingStrRequired = 65 , Scan_CouldNotOpenSource = 66 , Scan_UnbalancedStartEnd = 67 , Scan_BadPScanToken = 68 , Stack_BadIndex = 69 , Stack_EmptyStack = 70 , Str_ZeroSizedTargetBuf = 71 , Str_UnknownRadix = 72 , Str_TargetBufTooSmall = 73 , Str_StartIndexPastEnd = 74 , Str_ConvertOverflow = 75 , StrPool_IllegalId = 76 , Trans_Unrepresentable = 77 , Trans_BadSrcSeq = 78 , Trans_BadSrcCP = 79 , Trans_BadTrailingSurrogate = 80 , Trans_CantCreateCvtrFor = 81 , URL_MalformedURL = 82 , URL_UnsupportedProto = 83 , URL_UnsupportedProto1 = 84 , URL_NoProtocolPresent = 85 , URL_ExpectingTwoSlashes = 86 , URL_RelativeBaseURL = 87 , URL_BadPortField = 88 , UTF8_FormatError = 89 , UTF8_Invalid_3BytesSeq = 90 , UTF8_Irregular_3BytesSeq = 91 , UTF8_Invalid_4BytesSeq = 92 , UTF8_Exceeds_BytesLimit = 93 , Vector_BadIndex = 94 , Val_InvalidElemId = 95 , Val_CantHaveIntSS = 96 , XMLRec_UnknownEncoding = 97 , Parser_Parse1 = 98 , Parser_Parse2 = 99 , Parser_Next1 = 100 , Parser_Next2 = 101 , Parser_Next3 = 102 , Parser_Next4 = 103 , Parser_Factor1 = 104 , Parser_Factor2 = 105 , Parser_Factor3 = 106 , Parser_Factor4 = 107 , Parser_Factor5 = 108 , Parser_Factor6 = 109 , Parser_Atom1 = 110 , Parser_Atom2 = 111 , Parser_Atom3 = 112 , Parser_Atom4 = 113 , Parser_Atom5 = 114 , Parser_CC1 = 115 , Parser_CC2 = 116 , Parser_CC3 = 117 , Parser_CC5 = 118 , Parser_CC6 = 119 , Parser_Ope1 = 120 , Parser_Ope2 = 121 , Parser_Ope3 = 122 , Parser_Descape1 = 123 , Parser_Descape3 = 124 , Parser_Descape4 = 125 , Parser_Descape5 = 126 , Parser_Process2 = 127 , Parser_Quantifier1 = 128 , Parser_Quantifier2 = 129 , Parser_Quantifier3 = 130 , Parser_Quantifier4 = 131 , Parser_Quantifier5 = 132 , Gen_NoSchemaValidator = 133 , SubGrpComparator_NGR = 134 , FACET_Invalid_Len = 135 , FACET_Invalid_maxLen = 136 , FACET_Invalid_minLen = 137 , FACET_NonNeg_Len = 138 , FACET_NonNeg_maxLen = 139 , FACET_NonNeg_minLen = 140 , FACET_Len_maxLen = 141 , FACET_Len_minLen = 142 , FACET_maxLen_minLen = 143 , FACET_Invalid_Tag = 144 , FACET_Len_baseLen = 145 , FACET_minLen_baseminLen = 146 , FACET_minLen_basemaxLen = 147 , FACET_maxLen_basemaxLen = 148 , FACET_maxLen_baseminLen = 149 , FACET_Len_baseMinLen = 150 , FACET_Len_baseMaxLen = 151 , FACET_minLen_baseLen = 152 , FACET_maxLen_baseLen = 153 , FACET_enum_base = 154 , FACET_Invalid_WS = 155 , FACET_WS_collapse = 156 , FACET_WS_replace = 157 , FACET_Invalid_MaxIncl = 158 , FACET_Invalid_MaxExcl = 159 , FACET_Invalid_MinIncl = 160 , FACET_Invalid_MinExcl = 161 , FACET_Invalid_TotalDigit = 162 , FACET_Invalid_FractDigit = 163 , FACET_PosInt_TotalDigit = 164 , FACET_NonNeg_FractDigit = 165 , FACET_max_Incl_Excl = 166 , FACET_min_Incl_Excl = 167 , FACET_maxExcl_minExcl = 168 , FACET_maxExcl_minIncl = 169 , FACET_maxIncl_minExcl = 170 , FACET_maxIncl_minIncl = 171 , FACET_TotDigit_FractDigit = 172 , FACET_maxIncl_base_maxExcl = 173 , FACET_maxIncl_base_maxIncl = 174 , FACET_maxIncl_base_minIncl = 175 , FACET_maxIncl_base_minExcl = 176 , FACET_maxExcl_base_maxExcl = 177 , FACET_maxExcl_base_maxIncl = 178 , FACET_maxExcl_base_minIncl = 179 , FACET_maxExcl_base_minExcl = 180 , FACET_minExcl_base_maxExcl = 181 , FACET_minExcl_base_maxIncl = 182 , FACET_minExcl_base_minIncl = 183 , FACET_minExcl_base_minExcl = 184 , FACET_minIncl_base_maxExcl = 185 , FACET_minIncl_base_maxIncl = 186 , FACET_minIncl_base_minIncl = 187 , FACET_minIncl_base_minExcl = 188 , FACET_maxIncl_notFromBase = 189 , FACET_maxExcl_notFromBase = 190 , FACET_minIncl_notFromBase = 191 , FACET_minExcl_notFromBase = 192 , FACET_totalDigit_base_totalDigit = 193 , FACET_fractDigit_base_totalDigit = 194 , FACET_fractDigit_base_fractDigit = 195 , FACET_maxIncl_base_fixed = 196 , FACET_maxExcl_base_fixed = 197 , FACET_minIncl_base_fixed = 198 , FACET_minExcl_base_fixed = 199 , FACET_totalDigit_base_fixed = 200 , FACET_fractDigit_base_fixed = 201 , FACET_maxLen_base_fixed = 202 , FACET_minLen_base_fixed = 203 , FACET_whitespace_base_fixed = 204 , FACET_internalError_fixed = 205 , FACET_List_Null_baseValidator = 206 , FACET_Union_Null_memberTypeValidators = 207 , FACET_Union_Null_baseValidator = 208 , FACET_Union_invalid_baseValidatorType = 209 , VALUE_NotMatch_Pattern = 210 , VALUE_Not_Base64 = 211 , VALUE_Not_HexBin = 212 , VALUE_GT_maxLen = 213 , VALUE_LT_minLen = 214 , VALUE_NE_Len = 215 , VALUE_NotIn_Enumeration = 216 , VALUE_exceed_totalDigit = 217 , VALUE_exceed_fractDigit = 218 , VALUE_exceed_maxIncl = 219 , VALUE_exceed_maxExcl = 220 , VALUE_exceed_minIncl = 221 , VALUE_exceed_minExcl = 222 , VALUE_WS_replaced = 223 , VALUE_WS_collapsed = 224 , VALUE_Invalid_NCName = 225 , VALUE_Invalid_Name = 226 , VALUE_ID_Not_Unique = 227 , VALUE_ENTITY_Invalid = 228 , VALUE_QName_Invalid = 229 , VALUE_NOTATION_Invalid = 230 , VALUE_no_match_memberType = 231 , VALUE_URI_Malformed = 232 , XMLNUM_emptyString = 233 , XMLNUM_WSString = 234 , XMLNUM_2ManyDecPoint = 235 , XMLNUM_Inv_chars = 236 , XMLNUM_null_ptr = 237 , XMLNUM_URI_Component_Empty = 238 , XMLNUM_URI_Component_for_GenURI_Only = 239 , XMLNUM_URI_Component_Invalid_EscapeSequence = 240 , XMLNUM_URI_Component_Invalid_Char = 241 , XMLNUM_URI_Component_Set_Null = 242 , XMLNUM_URI_Component_Not_Conformant = 243 , XMLNUM_URI_No_Scheme = 244 , XMLNUM_URI_NullHost = 245 , XMLNUM_URI_NullPath = 246 , XMLNUM_URI_PortNo_Invalid = 247 , XMLNUM_DBL_FLT_InvalidType = 248 , Regex_Result_Not_Set = 249 , Regex_CompactRangesError = 250 , Regex_MergeRangesTypeMismatch = 251 , Regex_SubtractRangesError = 252 , Regex_IntersectRangesError = 253 , Regex_ComplementRangesInvalidArg = 254 , Regex_InvalidCategoryName = 255 , Regex_KeywordNotFound = 256 , Regex_BadRefNo = 257 , Regex_UnknownOption = 258 , Regex_UnknownTokenType = 259 , Regex_RangeTokenGetError = 260 , Regex_NotSupported = 261 , Regex_InvalidChildIndex = 262 , Regex_RepPatMatchesZeroString = 263 , Regex_InvalidRepPattern = 264 , NEL_RepeatedCalls = 265 , Out_Of_Memory = 266 , DV_InvalidOperation = 267 , XPath_NoAttrSelector = 268 , XPath_NoUnionAtStart = 269 , XPath_NoMultipleUnion = 270 , XPath_MissingAttr = 271 , XPath_ExpectedToken1 = 272 , XPath_PrefixNoURI = 273 , XPath_NoDoubleColon = 274 , XPath_ExpectedStep1 = 275 , XPath_ExpectedStep2 = 276 , XPath_ExpectedStep3 = 277 , XPath_NoForwardSlash = 278 , XPath_NoDoubleForwardSlash = 279 , XPath_NoForwardSlashAtStart = 280 , XPath_NoSelectionOfRoot = 281 , XPath_EmptyExpr = 282 , XPath_NoUnionAtEnd = 283 , XPath_InvalidChar = 284 , XPath_TokenNotSupported = 285 , XPath_FindSolution = 286 , DateTime_dt_invalid = 287 , DateTime_dt_missingT = 288 , DateTime_gDay_invalid = 289 , DateTime_gMth_invalid = 290 , DateTime_gMthDay_invalid = 291 , DateTime_dur_invalid = 292 , DateTime_dur_Start_dashP = 293 , DateTime_dur_noP = 294 , DateTime_dur_DashNotFirst = 295 , DateTime_dur_inv_b4T = 296 , DateTime_dur_NoTimeAfterT = 297 , DateTime_dur_NoElementAtAll = 298 , DateTime_dur_inv_seconds = 299 , DateTime_date_incomplete = 300 , DateTime_date_invalid = 301 , DateTime_time_incomplete = 302 , DateTime_time_invalid = 303 , DateTime_ms_noDigit = 304 , DateTime_ym_incomplete = 305 , DateTime_ym_invalid = 306 , DateTime_year_invalid = 307 , DateTime_year_tooShort = 308 , DateTime_year_leadingZero = 309 , DateTime_ym_noMonth = 310 , DateTime_tz_noUTCsign = 311 , DateTime_tz_stuffAfterZ = 312 , DateTime_tz_invalid = 313 , DateTime_year_zero = 314 , DateTime_mth_invalid = 315 , DateTime_day_invalid = 316 , DateTime_hour_invalid = 317 , DateTime_min_invalid = 318 , DateTime_second_invalid = 319 , DateTime_tz_hh_invalid = 320 , PD_EmptyBase = 321 , PD_NSCompat1 = 322 , PD_OccurRangeE = 323 , PD_NameTypeOK1 = 324 , PD_NameTypeOK2 = 325 , PD_NameTypeOK3 = 326 , PD_NameTypeOK4 = 327 , PD_NameTypeOK5 = 328 , PD_NameTypeOK6 = 329 , PD_NameTypeOK7 = 330 , PD_Recurse1 = 331 , PD_Recurse2 = 332 , PD_ForbiddenRes1 = 333 , PD_ForbiddenRes2 = 334 , PD_ForbiddenRes3 = 335 , PD_ForbiddenRes4 = 336 , PD_NSSubset1 = 337 , PD_NSSubset2 = 338 , PD_NSRecurseCheckCardinality1 = 339 , PD_RecurseUnordered = 340 , PD_MapAndSum = 341 , PD_InvalidContentType = 342 , NodeIDMap_GrowErr = 343 , XSer_ProtoType_Null_ClassName = 344 , XSer_ProtoType_NameLen_Dif = 345 , XSer_ProtoType_Name_Dif = 346 , XSer_InStream_Read_LT_Req = 347 , XSer_InStream_Read_OverFlow = 348 , XSer_Storing_Violation = 349 , XSer_StoreBuffer_Violation = 350 , XSer_LoadPool_UppBnd_Exceed = 351 , XSer_LoadPool_NoTally_ObjCnt = 352 , XSer_Loading_Violation = 353 , XSer_LoadBuffer_Violation = 354 , XSer_Inv_ClassIndex = 355 , XSer_Inv_checkFillBuffer_Size = 356 , XSer_Inv_checkFlushBuffer_Size = 357 , XSer_Inv_Null_Pointer = 358 , XSer_CreateObject_Fail = 359 , XSer_ObjCount_UppBnd_Exceed = 360 , XSer_GrammarPool_Empty = 361 , XSer_GrammarPool_NotEmpty = 362 , XSer_StringPool_NotEmpty = 363 , XSer_Storer_Loader_Mismatch = 364 , VALUE_QName_Invalid2 = 365 , F_HighBounds = 366 , E_LowBounds = 367 , E_HighBounds = 368 }; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLExcepts(); }; #ifdef __GNUC__ # pragma GCC diagnostic pop #endif XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLASCIITranscoder.hpp000644 000765 000024 00000006335 13241160336 023220 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLASCIITranscoder.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLASCIITRANSCODER_HPP) #define XERCESC_INCLUDE_GUARD_XMLASCIITRANSCODER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN // // This class provides an implementation of the XMLTranscoder interface // for a simple ASCII transcoder. The parser does some encodings // intrinsically without depending upon external transcoding services. // To make everything more orthogonal, we implement these internal // transcoders using the same transcoder abstraction as the pluggable // transcoding services do. // class XMLUTIL_EXPORT XMLASCIITranscoder : public XMLTranscoder { public : // ----------------------------------------------------------------------- // Constructors and destructor // ----------------------------------------------------------------------- XMLASCIITranscoder ( const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~XMLASCIITranscoder(); // ----------------------------------------------------------------------- // Implementation of the XMLTranscoder interface // ----------------------------------------------------------------------- virtual XMLSize_t transcodeFrom ( const XMLByte* const srcData , const XMLSize_t srcCount , XMLCh* const toFill , const XMLSize_t maxChars , XMLSize_t& bytesEaten , unsigned char* const charSizes ); virtual XMLSize_t transcodeTo ( const XMLCh* const srcData , const XMLSize_t srcCount , XMLByte* const toFill , const XMLSize_t maxBytes , XMLSize_t& charsEaten , const UnRepOpts options ); virtual bool canTranscodeTo ( const unsigned int toCheck ); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLASCIITranscoder(const XMLASCIITranscoder&); XMLASCIITranscoder& operator=(const XMLASCIITranscoder&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLNumber.cpp000644 000765 000024 00000005111 13241160336 021555 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLNumber.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include //since we need to dynamically created each and every derivatives //during deserialization by XSerializeEngine>>Derivative, we got //to include all hpp #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN XMLNumber::XMLNumber() {} XMLNumber::XMLNumber(const XMLNumber& toCopy) : XSerializable(toCopy) , XMemory(toCopy) {} XMLNumber::~XMLNumber() {} /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_NOCREATE(XMLNumber) void XMLNumber::serialize(XSerializeEngine&) { // this class has no data to serialize/de-serilize } XMLNumber* XMLNumber::loadNumber(XMLNumber::NumberType numType , XSerializeEngine& serEng) { switch((XMLNumber::NumberType) numType) { case XMLNumber::Float: XMLFloat* floatNum; serEng>>floatNum; return floatNum; break; case XMLNumber::Double: XMLDouble* doubleNum; serEng>>doubleNum; return doubleNum; break; case XMLNumber::BigDecimal: XMLBigDecimal* bigdecimalNum; serEng>>bigdecimalNum; return bigdecimalNum; break; case XMLNumber::DateTime: XMLDateTime* datetimeNum; serEng>>datetimeNum; return datetimeNum; break; case XMLNumber::UnKnown: return 0; break; } //we treat this same as UnKnown return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/regx/000755 000765 000024 00000000000 13345765732 020227 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/util/XMLBigInteger.hpp000644 000765 000024 00000013702 13241160335 022355 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLBigInteger.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XML_BIGINTEGER_HPP) #define XERCESC_INCLUDE_GUARD_XML_BIGINTEGER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT XMLBigInteger : public XMemory { public: /** * Constructs a newly allocated XMLBigInteger object that * represents the value represented by the string. The string is * converted to an int value as if by the valueOf method. * * @param strValue the String to be converted to an * XMLBigInteger. * @param manager Pointer to the memory manager to be used to * allocate objects. * @exception NumberFormatException if the String does not * contain a parsable XMLBigInteger. */ XMLBigInteger ( const XMLCh* const strValue , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~XMLBigInteger(); XMLBigInteger(const XMLBigInteger& toCopy); static XMLCh* getCanonicalRepresentation ( const XMLCh* const rawData , MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager , bool isNonPositiveInteger = false ); static void parseBigInteger(const XMLCh* const toConvert , XMLCh* const retBuffer , int& signValue , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); static int compareValues(const XMLBigInteger* const lValue ,const XMLBigInteger* const rValue , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); static int compareValues(const XMLCh* const lString , const int& lSign , const XMLCh* const rString , const int& rSign , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); void multiply(const unsigned int byteToShift); void divide(const unsigned int byteToShift); unsigned int getTotalDigit() const; /** * Return a copy of the fMagnitude. * This is similar to toString, except the internal buffer is returned directly * Caller is not required to delete the returned memory. */ inline XMLCh* getRawData() const; /** * Compares this object to the specified object. * The result is true if and only if the argument is not * null and is an XMLBigInteger object that contains * the same int value as this object. * * @param toCompare the object to compare with. * @return true if the objects are the same; * false otherwise. */ bool operator==(const XMLBigInteger& toCompare) const; /** * Returns the signum function of this number (i.e., -1, 0 or 1 as * the value of this number is negative, zero or positive). */ int getSign() const; int intValue() const; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLBigInteger& operator=(const XMLBigInteger&); void setSign(int); /* * The number is internally stored in "minimal" sign-fMagnitude format * (i.e., no BigIntegers have a leading zero byte in their magnitudes). * Zero is represented with a signum of 0 (and a zero-length fMagnitude). * Thus, there is exactly one representation for each value. */ // ----------------------------------------------------------------------- // Private data members // // fSign // to represent the sign of the number. // // fMagnitude // the buffer holding the number. // // fRawData // to preserve the original string used to construct this object, // needed for pattern matching. // // ----------------------------------------------------------------------- int fSign; XMLCh* fMagnitude; //null terminated XMLCh* fRawData; MemoryManager* fMemoryManager; }; inline int XMLBigInteger::getSign() const { return fSign; } inline unsigned int XMLBigInteger::getTotalDigit() const { return ((getSign() ==0) ? 0 : (unsigned int)XMLString::stringLen(fMagnitude)); } inline bool XMLBigInteger::operator==(const XMLBigInteger& toCompare) const { return ( compareValues(this, &toCompare, fMemoryManager) ==0 ? true : false); } inline void XMLBigInteger::setSign(int newSign) { fSign = newSign; } inline XMLCh* XMLBigInteger::getRawData() const { return fRawData; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLEntityResolver.hpp000644 000765 000024 00000015016 13241160336 023335 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLEntityResolver.hpp 1701582 2015-09-07 09:21:15Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLENTITYRESOLVER_HPP) #define XERCESC_INCLUDE_GUARD_XMLENTITYRESOLVER_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN class InputSource; /** * Revised interface for resolving entities. * *

If an application needs to implement customized handling * for external entities, it can implement this interface and * register an instance with the parser using the parser's * setXMLEntityResolver method or it can use the basic SAX interface * (EntityResolver). The difference between the two interfaces is * the arguments to the resolveEntity() method. With the SAX * EntityResolve the arguments are systemId and publicId. With this * interface the argument is a XMLResourceIdentifier object. Only * one EntityResolver can be set using setEntityResolver() or * setXMLEntityResolver, if both are set the last one set is * used.

* *

The parser will then allow the application to intercept any * external entities (including the external DTD subset and external * parameter entities, if any) before including them.

* *

Many applications will not need to implement this interface, * but it will be especially useful for applications that build * XML documents from databases or other specialised input sources, * or for applications that use URI types other than URLs.

* *

The following resolver would provide the application * with a special character stream for the entity with the system * identifier "http://www.myhost.com/today":

* * * \#include
* \#include
*
* class MyResolver : public XMLEntityResolver {
*  public:
*   InputSource* resolveEntity (XMLResourceIdentifier* xmlri);
*   ...
*  };
*
* MyResolver::resolveEntity(XMLResourceIdentifier* xmlri) {
*  switch(xmlri->getResourceIdentifierType()) {
*   case XMLResourceIdentifier::SystemId:
*    if (XMLString::compareString(xmlri->getSystemId(), "http://www.myhost.com/today")) {
*     MyReader* reader = new MyReader();
*     return new InputSource(reader);
*    } else {
*     return null;
*    }
*    break;
*   default:
*    return null;
*  }
* }
* *

The application can also use this interface to redirect system * identifiers to local URIs or to look up replacements in a catalog * (possibly by using the public identifier).

* *

The HandlerBase class implements the default behaviour for * this interface, which is simply always to return null (to request * that the parser use the default system identifier).

* * @see XMLResourceIdentifier * @see Parser#setXMLEntityResolver * @see InputSource#InputSource * @see HandlerBase#HandlerBase */ class XMLUTIL_EXPORT XMLEntityResolver { public: /** @name Constructors and Destructor */ //@{ /** Destructor */ virtual ~XMLEntityResolver() { } //@} /** @name The XMLEntityResolver interface */ //@{ /** * Allow the application to resolve external entities. * *

The Parser will call this method before opening any external * entity except the top-level document entity (including the * external DTD subset, external entities referenced within the * DTD, and external entities referenced within the document * element): the application may request that the parser resolve * the entity itself, that it use an alternative URI, or that it * use an entirely different input source.

* *

Application writers can use this method to redirect external * system identifiers to secure and/or local URIs, to look up * public identifiers in a catalogue, or to read an entity from a * database or other input source (including, for example, a dialog * box).

* *

If the system identifier is a URL, the SAX parser must * resolve it fully before reporting it to the application.

* * @param resourceIdentifier An object containing the type of * resource to be resolved and the associated data members * corresponding to this type. * @return An InputSource object describing the new input source, * or null to request that the parser open a regular * URI connection to the system identifier. * The returned InputSource is owned by the parser which is * responsible to clean up the memory. * @exception SAXException Any SAX exception, possibly * wrapping another exception. * @exception IOException An IO exception, * possibly the result of creating a new InputStream * or Reader for the InputSource. * * @see InputSource#InputSource * @see XMLResourceIdentifier */ virtual InputSource* resolveEntity ( XMLResourceIdentifier* resourceIdentifier ) = 0; //@} protected: /** Default Constructor */ XMLEntityResolver() { } private : /* Unimplemented constructors and operators */ /* Copy constructor */ XMLEntityResolver(const XMLEntityResolver&); /* Assignment operator */ XMLEntityResolver& operator=(const XMLEntityResolver&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLMsgLoader.hpp000644 000765 000024 00000014431 13241160336 022214 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLMsgLoader.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLMSGLOADER_HPP) #define XERCESC_INCLUDE_GUARD_XMLMSGLOADER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN // // This header defines an abstract message loading API. This is the API via // which the parser system loads translatable text, and there can be multiple // actual implementations of this mechanism. The API is very simple because // there can be many kinds of underlying systems on which implementations are // based and we don't want to get into portability trouble by being overly // smart. // // Each instance of the message loader loads a file of messages, which are // accessed by key and which are associated with a particular language. The // actual source information may be in many forms, but by the time it is // extracted for use it will be in Unicode format. The language is always // the default language for the local machine. // // Msg loader derivatives are not required to be thread safe. The parser will // never use a single instance in more than one thread. // class XMLUTIL_EXPORT XMLMsgLoader : public XMemory { public : // ----------------------------------------------------------------------- // Class specific types // // XMLMsgId // A simple typedef to give us flexibility about the representation // of a message id. // ----------------------------------------------------------------------- typedef unsigned int XMLMsgId; // ----------------------------------------------------------------------- // Public Constructors and Destructor // ----------------------------------------------------------------------- virtual ~XMLMsgLoader(); // ----------------------------------------------------------------------- // The virtual message loader API // ----------------------------------------------------------------------- virtual bool loadMsg ( const XMLMsgId msgToLoad , XMLCh* const toFill , const XMLSize_t maxChars ) = 0; virtual bool loadMsg ( const XMLMsgId msgToLoad , XMLCh* const toFill , const XMLSize_t maxChars , const XMLCh* const repText1 , const XMLCh* const repText2 = 0 , const XMLCh* const repText3 = 0 , const XMLCh* const repText4 = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) = 0; virtual bool loadMsg ( const XMLMsgId msgToLoad , XMLCh* const toFill , const XMLSize_t maxChars , const char* const repText1 , const char* const repText2 = 0 , const char* const repText3 = 0 , const char* const repText4 = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ) = 0; /** @name Locale Handling */ //@{ /** * This function enables set the locale information which * all concrete message loaders shall refer to during instantiation. * * Note: for detailed discussion, refer to PlatformUtils::initialize() */ static void setLocale(const char* const localeToAdopt); /** * For the derived to retrieve locale info during construction */ static const char* getLocale(); //@} /** @name NLSHome Handling */ //@{ /** * This function enables set the NLSHome information which * all concrete message loaders shall refer to during instantiation. * * Note: for detailed discussion, refer to PlatformUtils::initialize() */ static void setNLSHome(const char* const nlsHomeToAdopt); /** * For the derived to retrieve NLSHome info during construction */ static const char* getNLSHome(); //@} protected : // ----------------------------------------------------------------------- // Hidden Constructors // ----------------------------------------------------------------------- XMLMsgLoader(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLMsgLoader(const XMLMsgLoader&); XMLMsgLoader& operator=(const XMLMsgLoader&); // ----------------------------------------------------------------------- // Private data members // // fLocale // Locale info set through PlatformUtils::init(). // The derived class may refer to this for locale information. // // fPath // NLSHome info set through PlatformUtils::init(). // The derived class may refer to this for NLSHome information. // // ----------------------------------------------------------------------- static char* fLocale; static char* fPath; }; // --------------------------------------------------------------------------- // XMLMsgLoader: Public Constructors and Destructor // --------------------------------------------------------------------------- inline XMLMsgLoader::~XMLMsgLoader() { } // --------------------------------------------------------------------------- // XMLMsgLoader: Hidden Constructors // --------------------------------------------------------------------------- inline XMLMsgLoader::XMLMsgLoader() { } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLUTF16Transcoder.hpp000644 000765 000024 00000007144 13241160336 023174 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLUTF16Transcoder.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLUTF16TRANSCODER_HPP) #define XERCESC_INCLUDE_GUARD_XMLUTF16TRANSCODER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN // // This class provides an implementation of the XMLTranscoder interface // for a simple UTF16 transcoder. The parser does some encodings // intrinsically without depending upon external transcoding services. // To make everything more orthogonal, we implement these internal // transcoders using the same transcoder abstraction as the pluggable // transcoding services do. // class XMLUTIL_EXPORT XMLUTF16Transcoder : public XMLTranscoder { public : // ----------------------------------------------------------------------- // Public constructors and destructor // ----------------------------------------------------------------------- XMLUTF16Transcoder ( const XMLCh* const encodingName , const XMLSize_t blockSize , const bool swapped , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~XMLUTF16Transcoder(); // ----------------------------------------------------------------------- // Implementation of the XMLTranscoder interface // ----------------------------------------------------------------------- virtual XMLSize_t transcodeFrom ( const XMLByte* const srcData , const XMLSize_t srcCount , XMLCh* const toFill , const XMLSize_t maxChars , XMLSize_t& bytesEaten , unsigned char* const charSizes ); virtual XMLSize_t transcodeTo ( const XMLCh* const srcData , const XMLSize_t srcCount , XMLByte* const toFill , const XMLSize_t maxBytes , XMLSize_t& charsEaten , const UnRepOpts options ); virtual bool canTranscodeTo ( const unsigned int toCheck ); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLUTF16Transcoder(const XMLUTF16Transcoder&); XMLUTF16Transcoder& operator=(const XMLUTF16Transcoder&); // ----------------------------------------------------------------------- // Private data members // // fSwapped // Indicates whether the encoding is of the opposite endianness from // the local host. // ----------------------------------------------------------------------- bool fSwapped; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLChTranscoder.cpp000644 000765 000024 00000010134 13241160336 022705 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLChTranscoder: Constructors and Destructor // --------------------------------------------------------------------------- XMLChTranscoder::XMLChTranscoder(const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager) : XMLTranscoder(encodingName, blockSize, manager) { } XMLChTranscoder::~XMLChTranscoder() { } // --------------------------------------------------------------------------- // XMLChTranscoder: Implementation of the transcoder API // --------------------------------------------------------------------------- XMLSize_t XMLChTranscoder::transcodeFrom( const XMLByte* const srcData , const XMLSize_t srcCount , XMLCh* const toFill , const XMLSize_t maxChars , XMLSize_t& bytesEaten , unsigned char* const charSizes) { // // Calculate the max chars we can do here. Its the lesser of the // max output chars and the number of chars in the source. // const XMLSize_t srcChars = srcCount / sizeof(XMLCh); const XMLSize_t countToDo = srcChars < maxChars ? srcChars : maxChars; // // Copy over the count of chars that we precalculated. Notice we // convert char count to byte count here!!! // memcpy(toFill, srcData, countToDo * sizeof(XMLCh)); // Set the bytes eaten bytesEaten = countToDo * sizeof(XMLCh); // Set the character sizes to the fixed size memset(charSizes, sizeof(XMLCh), countToDo); // Return the chars we transcoded return countToDo; } XMLSize_t XMLChTranscoder::transcodeTo(const XMLCh* const srcData , const XMLSize_t srcCount , XMLByte* const toFill , const XMLSize_t maxBytes , XMLSize_t& charsEaten , const UnRepOpts) { // // Calculate the max chars we can do here. Its the lesser of the // max chars we can store in the output byte buffer, and the number // of chars in the source. // const XMLSize_t maxOutChars = maxBytes / sizeof(XMLCh); const XMLSize_t countToDo = maxOutChars < srcCount ? maxOutChars : srcCount; // // Copy over the number of chars we calculated. Note that we have // to convert the char count to a byte count!! // memcpy(toFill, srcData, countToDo * sizeof(XMLCh)); // Set the chars eaten charsEaten = countToDo; // Return the bytes we transcoded return countToDo * sizeof(XMLCh); } bool XMLChTranscoder::canTranscodeTo(const unsigned int) { // We can handle anything return true; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/BinMemInputStream.hpp000644 000765 000024 00000010601 13241160336 023314 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BinMemInputStream.hpp 670359 2008-06-22 13:43:45Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_BINMEMINPUTSTREAM_HPP) #define XERCESC_INCLUDE_GUARD_BINMEMINPUTSTREAM_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT BinMemInputStream : public BinInputStream { public : // ----------------------------------------------------------------------- // Class specific types // ----------------------------------------------------------------------- enum BufOpts { BufOpt_Adopt , BufOpt_Copy , BufOpt_Reference }; // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- BinMemInputStream ( const XMLByte* const initData , const XMLSize_t capacity , const BufOpts bufOpt = BufOpt_Copy , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~BinMemInputStream(); // ----------------------------------------------------------------------- // Stream management methods // ----------------------------------------------------------------------- void reset(); // ----------------------------------------------------------------------- // Implementation of the input stream interface // ----------------------------------------------------------------------- virtual XMLFilePos curPos() const; virtual XMLSize_t readBytes ( XMLByte* const toFill , const XMLSize_t maxToRead ); virtual const XMLCh* getContentType() const; inline XMLSize_t getSize() const; private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- BinMemInputStream(const BinMemInputStream&); BinMemInputStream& operator=(const BinMemInputStream&); // ----------------------------------------------------------------------- // Private data members // // fBuffer // The buffer of bytes that we are streaming. // // fBufOpt // Indicates the ownership status of the buffer. The caller can have // us adopt it (we delete it), reference it, or just make our own // copy of it. // // fCapacity // The size of the buffer being streamed. // // fCurIndex // The current index where the next byte will be read from. When it // hits fCapacity, we are done. // ----------------------------------------------------------------------- const XMLByte* fBuffer; BufOpts fBufOpt; XMLSize_t fCapacity; XMLSize_t fCurIndex; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // BinMemInputStream: Stream management methods // --------------------------------------------------------------------------- inline void BinMemInputStream::reset() { fCurIndex = 0; } // --------------------------------------------------------------------------- // BinMemInputStream: Implementation of the input stream interface // --------------------------------------------------------------------------- inline XMLFilePos BinMemInputStream::curPos() const { return fCurIndex; } inline XMLSize_t BinMemInputStream::getSize() const { return fCapacity; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLURL.cpp000644 000765 000024 00000125505 13241160336 021001 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLURL.cpp 1799602 2017-06-22 18:14:37Z scantor $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local types // // TypeEntry // This structure defines a single entry in the list of URL types. Each // entry indicates the prefix for that type of URL, and the SourceTypes // value it maps to. // --------------------------------------------------------------------------- struct ProtoEntry { XMLURL::Protocols protocol; const XMLCh* prefix; unsigned int defPort; }; // --------------------------------------------------------------------------- // Local data // // gXXXString // These are the strings for our prefix types. They all have to be // Unicode strings all the time, so we can't just do regular strings. // // gProtoList // The list of URL types that we support and some info related to each // one. // // gMaxProtoLen // The length of the longest protocol string // // NOTE:!!! Be sure to keep this up to date if new protocols are added! // --------------------------------------------------------------------------- static const XMLCh gFileString[] = { chLatin_f, chLatin_i, chLatin_l, chLatin_e, chNull }; static const XMLCh gFTPString[] = { chLatin_f, chLatin_t, chLatin_p, chNull }; static const XMLCh gHTTPString[] = { chLatin_h, chLatin_t, chLatin_t, chLatin_p, chNull }; static const XMLCh gHTTPSString[] = { chLatin_h, chLatin_t, chLatin_t, chLatin_p, chLatin_s, chNull }; static ProtoEntry gProtoList[XMLURL::Protocols_Count] = { { XMLURL::File , gFileString , 0 } , { XMLURL::HTTP , gHTTPString , 80 } , { XMLURL::FTP , gFTPString , 21 } , { XMLURL::HTTPS , gHTTPSString , 443 } }; // !!! Keep these up to date with list above! static const unsigned int gMaxProtoLen = 5; static const XMLCh gListOne[] = { chColon, chForwardSlash, chNull }; static const XMLCh gListTwo[] = { chAt, chNull }; static const XMLCh gListThree[] = { chColon, chNull }; static const XMLCh gListFour[] = { chForwardSlash, chNull }; static const XMLCh gListFive[] = { chPound, chQuestion, chNull }; static const XMLCh gListSix[] = { chPound, chNull }; // --------------------------------------------------------------------------- // Local methods // --------------------------------------------------------------------------- static bool isHexDigit(const XMLCh toCheck) { if (((toCheck >= chDigit_0) && (toCheck <= chDigit_9)) || ((toCheck >= chLatin_A) && (toCheck <= chLatin_F)) || ((toCheck >= chLatin_a) && (toCheck <= chLatin_f))) { return true; } return false; } static unsigned int xlatHexDigit(const XMLCh toXlat) { if ((toXlat >= chDigit_0) && (toXlat <= chDigit_9)) return (unsigned int)(toXlat - chDigit_0); if ((toXlat >= chLatin_A) && (toXlat <= chLatin_F)) return (unsigned int)(toXlat - chLatin_A) + 10; return (unsigned int)(toXlat - chLatin_a) + 10; } // --------------------------------------------------------------------------- // XMLURL: Public, static methods // --------------------------------------------------------------------------- XMLURL::Protocols XMLURL::lookupByName(const XMLCh* const protoName) { for (unsigned int index = 0; index < XMLURL::Protocols_Count; index++) { if (!XMLString::compareIStringASCII(protoName, gProtoList[index].prefix)) return gProtoList[index].protocol; } return XMLURL::Unknown; } // --------------------------------------------------------------------------- // XMLURL: Constructors and Destructor // --------------------------------------------------------------------------- XMLURL::XMLURL(MemoryManager* const manager) : fMemoryManager(manager) , fFragment(0) , fHost(0) , fPassword(0) , fPath(0) , fPortNum(0) , fProtocol(XMLURL::Unknown) , fQuery(0) , fUser(0) , fURLText(0) , fHasInvalidChar(false) { } typedef JanitorMemFunCall CleanupType; XMLURL::XMLURL(const XMLCh* const baseURL , const XMLCh* const relativeURL , MemoryManager* const manager) : fMemoryManager(manager) , fFragment(0) , fHost(0) , fPassword(0) , fPath(0) , fPortNum(0) , fProtocol(XMLURL::Unknown) , fQuery(0) , fUser(0) , fURLText(0) , fHasInvalidChar(false) { CleanupType cleanup(this, &XMLURL::cleanUp); try { setURL(baseURL, relativeURL); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XMLURL::XMLURL(const XMLCh* const baseURL , const char* const relativeURL , MemoryManager* const manager) : fMemoryManager(manager) , fFragment(0) , fHost(0) , fPassword(0) , fPath(0) , fPortNum(0) , fProtocol(XMLURL::Unknown) , fQuery(0) , fUser(0) , fURLText(0) , fHasInvalidChar(false) { CleanupType cleanup(this, &XMLURL::cleanUp); XMLCh* tmpRel = XMLString::transcode(relativeURL, fMemoryManager); ArrayJanitor janRel(tmpRel, fMemoryManager); try { setURL(baseURL, tmpRel); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XMLURL::XMLURL(const XMLURL& baseURL , const XMLCh* const relativeURL) : fMemoryManager(baseURL.fMemoryManager) , fFragment(0) , fHost(0) , fPassword(0) , fPath(0) , fPortNum(0) , fProtocol(XMLURL::Unknown) , fQuery(0) , fUser(0) , fURLText(0) , fHasInvalidChar(false) { CleanupType cleanup(this, &XMLURL::cleanUp); try { setURL(baseURL, relativeURL); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XMLURL::XMLURL(const XMLURL& baseURL , const char* const relativeURL) : fMemoryManager(baseURL.fMemoryManager) , fFragment(0) , fHost(0) , fPassword(0) , fPath(0) , fPortNum(0) , fProtocol(XMLURL::Unknown) , fQuery(0) , fUser(0) , fURLText(0) , fHasInvalidChar(false) { CleanupType cleanup(this, &XMLURL::cleanUp); XMLCh* tmpRel = XMLString::transcode(relativeURL, fMemoryManager); ArrayJanitor janRel(tmpRel, fMemoryManager); try { setURL(baseURL, tmpRel); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XMLURL::XMLURL(const XMLCh* const urlText, MemoryManager* const manager) : fMemoryManager(manager) , fFragment(0) , fHost(0) , fPassword(0) , fPath(0) , fPortNum(0) , fProtocol(XMLURL::Unknown) , fQuery(0) , fUser(0) , fURLText(0) , fHasInvalidChar(false) { CleanupType cleanup(this, &XMLURL::cleanUp); try { setURL(urlText); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XMLURL::XMLURL(const char* const urlText, MemoryManager* const manager) : fMemoryManager(manager) , fFragment(0) , fHost(0) , fPassword(0) , fPath(0) , fPortNum(0) , fProtocol(XMLURL::Unknown) , fQuery(0) , fUser(0) , fURLText(0) , fHasInvalidChar(false) { CleanupType cleanup(this, &XMLURL::cleanUp); XMLCh* tmpText = XMLString::transcode(urlText, fMemoryManager); ArrayJanitor janRel(tmpText, fMemoryManager); try { setURL(tmpText); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XMLURL::XMLURL(const XMLURL& toCopy) : XMemory(toCopy) , fMemoryManager(toCopy.fMemoryManager) , fFragment(0) , fHost(0) , fPassword(0) , fPath(0) , fPortNum(toCopy.fPortNum) , fProtocol(toCopy.fProtocol) , fQuery(0) , fUser(0) , fURLText(0) , fHasInvalidChar(toCopy.fHasInvalidChar) { CleanupType cleanup(this, &XMLURL::cleanUp); try { fFragment = XMLString::replicate(toCopy.fFragment, fMemoryManager); fHost = XMLString::replicate(toCopy.fHost, fMemoryManager); fPassword = XMLString::replicate(toCopy.fPassword, fMemoryManager); fPath = XMLString::replicate(toCopy.fPath, fMemoryManager); fQuery = XMLString::replicate(toCopy.fQuery, fMemoryManager); fUser = XMLString::replicate(toCopy.fUser, fMemoryManager); fURLText = XMLString::replicate(toCopy.fURLText, fMemoryManager); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XMLURL::~XMLURL() { cleanUp(); } // --------------------------------------------------------------------------- // XMLURL: Public operators // --------------------------------------------------------------------------- XMLURL& XMLURL::operator=(const XMLURL& toAssign) { if (this == &toAssign) return *this; // Clean up our stuff cleanUp(); // And copy his stuff fMemoryManager = toAssign.fMemoryManager; fFragment = XMLString::replicate(toAssign.fFragment, fMemoryManager); fHost = XMLString::replicate(toAssign.fHost, fMemoryManager); fPassword = XMLString::replicate(toAssign.fPassword, fMemoryManager); fPath = XMLString::replicate(toAssign.fPath, fMemoryManager); fPortNum = toAssign.fPortNum; fProtocol = toAssign.fProtocol; fQuery = XMLString::replicate(toAssign.fQuery, fMemoryManager); fUser = XMLString::replicate(toAssign.fUser, fMemoryManager); fURLText = XMLString::replicate(toAssign.fURLText, fMemoryManager); fHasInvalidChar = toAssign.fHasInvalidChar; return *this; } bool XMLURL::operator==(const XMLURL& toCompare) const { // // Compare the two complete URLs (which have been processed the same // way so they should now be the same even if they came in via different // relative parts. // if (!XMLString::equals(getURLText(), toCompare.getURLText())) return false; return true; } // --------------------------------------------------------------------------- // XMLURL: Getter methods // --------------------------------------------------------------------------- unsigned int XMLURL::getPortNum() const { // // If it was not provided explicitly, then lets return the default one // for the protocol. // if (!fPortNum) { if (fProtocol == Unknown) return 0; return gProtoList[fProtocol].defPort; } return fPortNum; } const XMLCh* XMLURL::getProtocolName() const { // Check to see if its ever been set if (fProtocol == Unknown) ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_NoProtocolPresent, fMemoryManager); return gProtoList[fProtocol].prefix; } // --------------------------------------------------------------------------- // XMLURL: Setter methods // --------------------------------------------------------------------------- void XMLURL::setURL(const XMLCh* const urlText) { // // Try to parse the URL. // cleanUp(); parse(urlText); } void XMLURL::setURL(const XMLCh* const baseURL , const XMLCh* const relativeURL) { cleanUp(); // Parse our URL string parse(relativeURL); // // If its relative and the base is non-null and non-empty, then // parse the base URL string and conglomerate them. // if (isRelative() && baseURL) { if (*baseURL) { XMLURL basePart(baseURL, fMemoryManager); if (!conglomerateWithBase(basePart, false)) { cleanUp(); ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_RelativeBaseURL, fMemoryManager); } } } } // this version of setURL doesn't throw a malformedurl exception // instead it returns false when it failed (or when it would of // thrown a malformedurl exception) bool XMLURL::setURL(const XMLCh* const baseURL , const XMLCh* const relativeURL , XMLURL& xmlURL) { cleanUp(); // Parse our URL string if (parse(relativeURL, xmlURL)) { // If its relative and the base is non-null and non-empty, then // parse the base URL string and conglomerate them. // if (isRelative() && baseURL && *baseURL) { XMLURL basePart(fMemoryManager); if (parse(baseURL, basePart) && conglomerateWithBase(basePart, false)) { return true; } } else return true; } return false; } void XMLURL::setURL(const XMLURL& baseURL , const XMLCh* const relativeURL) { cleanUp(); // Parse our URL string parse(relativeURL); // If its relative, then conglomerate with the base URL if (isRelative()) conglomerateWithBase(baseURL); } // --------------------------------------------------------------------------- // XMLURL: Miscellaneous methods // --------------------------------------------------------------------------- bool XMLURL::isRelative() const { // If no protocol then relative if (fProtocol == Unknown) return true; // If no path, or the path is not absolute, then relative if (!fPath) return true; if (*fPath != chForwardSlash) return true; return false; } bool XMLURL::hasInvalidChar() const { return fHasInvalidChar; } BinInputStream* XMLURL::makeNewStream() const { // // If its a local host, then we short circuit it and use our own file // stream support. Otherwise, we just let it fall through and let the // installed network access object provide a stream. // if (fProtocol == XMLURL::File) { if (!fHost || !XMLString::compareIStringASCII(fHost, XMLUni::fgLocalHostString)) { XMLCh* realPath = XMLString::replicate(fPath, fMemoryManager); ArrayJanitor basePathName(realPath, fMemoryManager); // // Need to manually replace any character reference %xx first // HTTP protocol will be done automatically by the netaccessor // XMLSize_t end = XMLString::stringLen(realPath); int percentIndex = XMLString::indexOf(realPath, chPercent, 0, fMemoryManager); while (percentIndex != -1) { // Isolate the length/boundary check so we don't try and copy off the end. if (percentIndex+2 >= (int)end) { XMLCh value1[3]; value1[1] = chNull; value1[2] = chNull; XMLString::moveChars(value1, &(realPath[percentIndex]), (percentIndex + 1 >= (int)end ? 1 : 2)); ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_EscapeSequence , realPath , value1 , fMemoryManager); } else if (!isHexDigit(realPath[percentIndex+1]) || !isHexDigit(realPath[percentIndex+2])) { XMLCh value1[4]; XMLString::moveChars(value1, &(realPath[percentIndex]), 3); value1[3] = chNull; ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_EscapeSequence , realPath , value1 , fMemoryManager); } unsigned int value = (xlatHexDigit(realPath[percentIndex+1]) * 16) + xlatHexDigit(realPath[percentIndex+2]); realPath[percentIndex] = XMLCh(value); XMLSize_t i =0; for (i = percentIndex + 1; i < end - 2 ; i++) realPath[i] = realPath[i+2]; realPath[i] = chNull; end = i; if (((XMLSize_t)(percentIndex + 1)) < end) percentIndex = XMLString::indexOf(realPath, chPercent, percentIndex + 1, fMemoryManager); else percentIndex = -1; } BinFileInputStream* retStrm = new (fMemoryManager) BinFileInputStream(realPath, fMemoryManager); if (!retStrm->getIsOpen()) { delete retStrm; return 0; } return retStrm; } } // // If we don't have have an installed net accessor object, then we // have to just throw here. // if (!XMLPlatformUtils::fgNetAccessor) ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_UnsupportedProto, fMemoryManager); // Else ask the net accessor to create the stream return XMLPlatformUtils::fgNetAccessor->makeNew(*this); } void XMLURL::makeRelativeTo(const XMLCh* const baseURLText) { // If this one is not relative, don't bother if (!isRelative()) return; XMLURL baseURL(baseURLText, fMemoryManager); conglomerateWithBase(baseURL); } void XMLURL::makeRelativeTo(const XMLURL& baseURL) { // If this one is not relative, don't bother if (!isRelative()) return; conglomerateWithBase(baseURL); } // --------------------------------------------------------------------------- // XMLURL: Private helper methods // --------------------------------------------------------------------------- // // This method will take the broken out parts of the URL and build up the // full text. We don't do this unless someone asks us to, since its often // never required. // void XMLURL::buildFullText() { // Calculate the worst case size of the buffer required XMLSize_t bufSize = gMaxProtoLen + 1 + XMLString::stringLen(fFragment) + 1 + XMLString::stringLen(fHost) + 2 + XMLString::stringLen(fPassword) + 1 + XMLString::stringLen(fPath) + XMLString::stringLen(fQuery) + 1 + XMLString::stringLen(fUser) + 1 + 32; // Clean up the existing buffer and allocate another fMemoryManager->deallocate(fURLText);//delete [] fURLText; fURLText = (XMLCh*) fMemoryManager->allocate((bufSize) * sizeof(XMLCh));//new XMLCh[bufSize]; *fURLText = 0; XMLCh* outPtr = fURLText; if (fProtocol != Unknown) { XMLString::catString(fURLText, getProtocolName()); outPtr += XMLString::stringLen(fURLText); *outPtr++ = chColon; *outPtr++ = chForwardSlash; *outPtr++ = chForwardSlash; } if (fUser) { XMLString::copyString(outPtr, fUser); outPtr += XMLString::stringLen(fUser); if (fPassword) { *outPtr++ = chColon; XMLString::copyString(outPtr, fPassword); outPtr += XMLString::stringLen(fPassword); } *outPtr++ = chAt; } if (fHost) { XMLString::copyString(outPtr, fHost); outPtr += XMLString::stringLen(fHost); // // If the port is zero, then we don't put it in. Else we need // to because it was explicitly provided. // if (fPortNum) { *outPtr++ = chColon; XMLCh tmpBuf[17]; XMLString::binToText(fPortNum, tmpBuf, 16, 10, fMemoryManager); XMLString::copyString(outPtr, tmpBuf); outPtr += XMLString::stringLen(tmpBuf); } } if (fPath) { XMLString::copyString(outPtr, fPath); outPtr += XMLString::stringLen(fPath); } if (fQuery) { *outPtr++ = chQuestion; XMLString::copyString(outPtr, fQuery); outPtr += XMLString::stringLen(fQuery); } if (fFragment) { *outPtr++ = chPound; XMLString::copyString(outPtr, fFragment); outPtr += XMLString::stringLen(fFragment); } // Cap it off in case the last op was not a string copy *outPtr = 0; } // // Just a central place to handle cleanup, since its done from a number // of different spots. // void XMLURL::cleanUp() { fMemoryManager->deallocate(fFragment);//delete [] fFragment; fMemoryManager->deallocate(fHost);//delete [] fHost; fMemoryManager->deallocate(fPassword);//delete [] fPassword; fMemoryManager->deallocate(fPath);//delete [] fPath; fMemoryManager->deallocate(fQuery);//delete [] fQuery; fMemoryManager->deallocate(fUser);//delete [] fUser; fMemoryManager->deallocate(fURLText);//delete [] fURLText; fFragment = 0; fHost = 0; fPassword = 0; fPath = 0; fQuery = 0; fUser = 0; fURLText = 0; fProtocol = Unknown; fPortNum = 0; fHasInvalidChar = false; } //This function has been modified to take a bool parameter and the //functionality inside looks irrational but is only to make //solaris 2.7 CC 5.0 optimized build happy. bool XMLURL::conglomerateWithBase(const XMLURL& baseURL, bool useExceptions) { // The base URL cannot be relative if (baseURL.isRelative()) { if (useExceptions) ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_RelativeBaseURL, fMemoryManager); else return false; } // // Check a special case. If all we have is a fragment, then we want // to just take the base host and path, plus our fragment. // if ((fProtocol == Unknown) && !fHost && !fPath && fFragment) { // Just in case, make sure we don't leak the user or password values fMemoryManager->deallocate(fUser);//delete [] fUser; fUser = 0; fMemoryManager->deallocate(fPassword);//delete [] fPassword; fPassword = 0; // Copy over the protocol and port number as is fProtocol = baseURL.fProtocol; fPortNum = baseURL.fPortNum; // Replicate the base fields that are provided fHost = XMLString::replicate(baseURL.fHost, fMemoryManager); fUser = XMLString::replicate(baseURL.fUser, fMemoryManager); fPassword = XMLString::replicate(baseURL.fPassword, fMemoryManager); fPath = XMLString::replicate(baseURL.fPath, fMemoryManager); return true; } // // All we have to do is run up through our fields and, for each one // that we don't have, use the based URL's. Once we hit one field // that we have, we stop. // if (fProtocol != Unknown) return true; fProtocol = baseURL.fProtocol; // // If the protocol is not file, and we either already have our own // host, or the base does not have one, then we are done. // if (fProtocol != File) { if (fHost || !baseURL.fHost) return true; } // Replicate all of the hosty stuff if the base has one if (baseURL.fHost) { // Just in case, make sure we don't leak a user or password field fMemoryManager->deallocate(fUser);//delete [] fUser; fUser = 0; fMemoryManager->deallocate(fPassword);//delete [] fPassword; fPassword = 0; fMemoryManager->deallocate(fHost);//delete [] fHost; fHost = 0; fHost = XMLString::replicate(baseURL.fHost, fMemoryManager); fUser = XMLString::replicate(baseURL.fUser, fMemoryManager); fPassword = XMLString::replicate(baseURL.fPassword, fMemoryManager); fPortNum = baseURL.fPortNum; } // If we have a path and its absolute, then we are done const bool hadPath = (fPath != 0); if (hadPath) { if (*fPath == chForwardSlash) return true; } // Its a relative path, so weave them together. if (baseURL.fPath) { XMLCh* temp = XMLPlatformUtils::weavePaths(baseURL.fPath, fPath ,fMemoryManager); fMemoryManager->deallocate(fPath);//delete [] fPath; fPath = temp; } // If we had any original path, then we are done if (hadPath) return true; // We had no original path, so go on to deal with the query/fragment parts if (fQuery || !baseURL.fQuery) return true; fQuery = XMLString::replicate(baseURL.fQuery, fMemoryManager); if (fFragment || !baseURL.fFragment) return true; fFragment = XMLString::replicate(baseURL.fFragment, fMemoryManager); return true; } void XMLURL::parse(const XMLCh* const urlText) { // Simplify things by checking for the psycho scenarios first if (!*urlText) ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_NoProtocolPresent, fMemoryManager); // Before we start, check if this urlText contains valid uri characters if (!XMLUri::isURIString(urlText)) fHasInvalidChar = true; else fHasInvalidChar = false; // // The first thing we will do is to check for a file name, so that // we don't waste time thinking its a URL. If its in the form x:\ or x:/ // and x is an ASCII letter, then assume that's the deal. // if (((*urlText >= chLatin_A) && (*urlText <= chLatin_Z)) || ((*urlText >= chLatin_a) && (*urlText <= chLatin_z))) { if (*(urlText + 1) == chColon) { if ((*(urlText + 2) == chForwardSlash) || (*(urlText + 2) == chBackSlash)) { ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_NoProtocolPresent, fMemoryManager); } } } // Get a copy of the URL that we can modify XMLCh* srcCpy = XMLString::replicate(urlText, fMemoryManager); ArrayJanitor janSrcCopy(srcCpy, fMemoryManager); // // Get a pointer now that we can run up thrown the source as we parse // bits and pieces out of it. // XMLCh* srcPtr = srcCpy; // Run up past any spaces while (*srcPtr) { if (!XMLChar1_0::isWhitespace(*srcPtr)) break; srcPtr++; } // Make sure it wasn't all space if (!*srcPtr) ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_NoProtocolPresent, fMemoryManager); // // Ok, the next thing we have to do is to find either a / or : character. // If the : is first, we assume we have a protocol. If the / is first, // then we skip to the host processing. // XMLCh* ptr1 = XMLString::findAny(srcPtr, gListOne); XMLCh* ptr2; // If we found a protocol, then deal with it if (ptr1) { if (*ptr1 == chColon) { // Cap the string at the colon *ptr1 = 0; // And try to find it in our list of protocols fProtocol = lookupByName(srcPtr); if (fProtocol == Unknown) { ThrowXMLwithMemMgr1 ( MalformedURLException , XMLExcepts::URL_UnsupportedProto1 , srcPtr , fMemoryManager ); } // And move our source pointer up past what we've processed srcPtr = (ptr1 + 1); } } // // Ok, next we need to see if we have any host part. If the next // two characters are //, then we need to check, else move on. // if ((*srcPtr == chForwardSlash) && (*(srcPtr + 1) == chForwardSlash)) { // Move up past the slashes srcPtr += 2; // // If we aren't at the end of the string, then there has to be a // host part at this point. we will just look for the next / char // or end of string and make all of that the host for now. // if (*srcPtr) { // Search from here for a / character ptr1 = XMLString::findAny(srcPtr, gListFour); // // If we found something, then the host is between where // we are and what we found. Else the host is the rest of // the content and we are done. If its empty, leave it null. // if (ptr1) { if (ptr1 != srcPtr) { fMemoryManager->deallocate(fHost);//delete [] fHost; fHost = (XMLCh*) fMemoryManager->allocate ( ((ptr1 - srcPtr) + 1) * sizeof(XMLCh) );//new XMLCh[(ptr1 - srcPtr) + 1]; ptr2 = fHost; while (srcPtr < ptr1) *ptr2++ = *srcPtr++; *ptr2 = 0; } } else { fMemoryManager->deallocate(fHost);//delete [] fHost; fHost = XMLString::replicate(srcPtr, fMemoryManager); // Update source pointer to the end srcPtr += XMLString::stringLen(fHost); } } } else { // // http protocol requires two forward slashes // we didn't get them, so throw an exception // if (fProtocol == HTTP) { ThrowXMLwithMemMgr ( MalformedURLException , XMLExcepts::URL_ExpectingTwoSlashes , fMemoryManager ); } } // // If there was a host part, then we have to grovel through it for // all the bits and pieces it can hold. // if (fHost) { // // Look for a '@' character, which indicates a user name. If we // find one, then everything between the start of the host data // and the character is the user name. // ptr1 = XMLString::findAny(fHost, gListTwo); if (ptr1) { // Get this info out as the user name *ptr1 = 0; fMemoryManager->deallocate(fUser);//delete [] fUser; fUser = XMLString::replicate(fHost, fMemoryManager); ptr1++; // And now cut these chars from the host string XMLString::cut(fHost, ptr1 - fHost); // Is there a password inside the user string? ptr2 = XMLString::findAny(fUser, gListThree); if (ptr2) { // Remove it from the user name string *ptr2 = 0; // And copy out the remainder to the password field ptr2++; fMemoryManager->deallocate(fPassword);//delete [] fPassword; fPassword = XMLString::replicate(ptr2, fMemoryManager); } } // // Ok, so now we are at the actual host name, if any. If we are // not at the end of the host data, then lets see if we have a // port trailing the // ptr1 = XMLString::findAny(fHost, gListThree); if (ptr1) { // Remove it from the host name *ptr1 = 0; // Try to convert it to a numeric port value and store it ptr1++; if (!XMLString::textToBin(ptr1, fPortNum, fMemoryManager)) ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_BadPortField, fMemoryManager); } // If the host ended up empty, then toss is if (!*fHost) { fMemoryManager->deallocate(fHost);//delete[] fHost; fHost = 0; } } // If we are at the end, then we are done now if (!*srcPtr) { if(fHost) { static const XMLCh slash[] = { chForwardSlash, chNull }; fPath = XMLString::replicate(slash, fMemoryManager); } return; } // // Next is the path part. It can be absolute, i.e. starting with a // forward slash character, or relative. Its basically everything up // to the end of the string or to any trailing query or fragment. // ptr1 = XMLString::findAny(srcPtr, gListFive); if (!ptr1) { fMemoryManager->deallocate(fPath);//delete [] fPath; fPath = XMLString::replicate(srcPtr, fMemoryManager); return; } // Everything from where we are to what we found is the path if (ptr1 > srcPtr) { fMemoryManager->deallocate(fPath);//delete [] fPath; fPath = (XMLCh*) fMemoryManager->allocate ( ((ptr1 - srcPtr) + 1) * sizeof(XMLCh) );//new XMLCh[(ptr1 - srcPtr) + 1]; ptr2 = fPath; while (srcPtr < ptr1) *ptr2++ = *srcPtr++; *ptr2 = 0; } // // If we found a fragment, then it is the rest of the string and we // are done. // if (*srcPtr == chPound) { srcPtr++; fMemoryManager->deallocate(fFragment);//delete [] fFragment; fFragment = XMLString::replicate(srcPtr, fMemoryManager); return; } // // The query is either the rest of the string, or up to the fragment // separator. // srcPtr++; ptr1 = XMLString::findAny(srcPtr, gListSix); fMemoryManager->deallocate(fQuery);//delete [] fQuery; if (!ptr1) { fQuery = XMLString::replicate(srcPtr, fMemoryManager); return; } else { fQuery = (XMLCh*) fMemoryManager->allocate ( ((ptr1 - srcPtr) + 1) * sizeof(XMLCh) );//new XMLCh[(ptr1 - srcPtr) + 1]; ptr2 = fQuery; while (srcPtr < ptr1) *ptr2++ = *srcPtr++; *ptr2 = 0; } // If we are not at the end now, then everything else is the fragment if (*srcPtr == chPound) { srcPtr++; fMemoryManager->deallocate(fFragment);//delete [] fFragment; fFragment = XMLString::replicate(srcPtr, fMemoryManager); } } bool XMLURL::parse(const XMLCh* const urlText, XMLURL& xmlURL) { // Simplify things by checking for the psycho scenarios first if (!*urlText) return false; // Before we start, check if this urlText contains valid uri characters if (!XMLUri::isURIString(urlText)) xmlURL.fHasInvalidChar = true; else xmlURL.fHasInvalidChar = false; // // The first thing we will do is to check for a file name, so that // we don't waste time thinking its a URL. If its in the form x:\ or x:/ // and x is an ASCII letter, then assume that's the deal. // if (((*urlText >= chLatin_A) && (*urlText <= chLatin_Z)) || ((*urlText >= chLatin_a) && (*urlText <= chLatin_z))) { if (*(urlText + 1) == chColon) { if ((*(urlText + 2) == chForwardSlash) || (*(urlText + 2) == chBackSlash)) { return false; } } } // Get a copy of the URL that we can modify XMLCh* srcCpy = XMLString::replicate(urlText, xmlURL.fMemoryManager); ArrayJanitor janSrcCopy(srcCpy, xmlURL.fMemoryManager); // // Get a pointer now that we can run up thrown the source as we parse // bits and pieces out of it. // XMLCh* srcPtr = srcCpy; // Run up past any spaces while (*srcPtr) { if (!XMLChar1_0::isWhitespace(*srcPtr)) break; srcPtr++; } // Make sure it wasn't all space if (!*srcPtr) return false; // // Ok, the next thing we have to do is to find either a / or : character. // If the : is first, we assume we have a protocol. If the / is first, // then we skip to the host processing. // XMLCh* ptr1 = XMLString::findAny(srcPtr, gListOne); XMLCh* ptr2; // If we found a protocol, then deal with it if (ptr1) { if (*ptr1 == chColon) { // Cap the string at the colon *ptr1 = 0; // And try to find it in our list of protocols xmlURL.fProtocol = lookupByName(srcPtr); if (xmlURL.fProtocol == Unknown) return false; // And move our source pointer up past what we've processed srcPtr = (ptr1 + 1); } } // // Ok, next we need to see if we have any host part. If the next // two characters are //, then we need to check, else move on. // if ((*srcPtr == chForwardSlash) && (*(srcPtr + 1) == chForwardSlash)) { // Move up past the slashes srcPtr += 2; // // If we aren't at the end of the string, then there has to be a // host part at this point. we will just look for the next / char // or end of string and make all of that the host for now. // if (*srcPtr) { // Search from here for a / character ptr1 = XMLString::findAny(srcPtr, gListFour); // // If we found something, then the host is between where // we are and what we found. Else the host is the rest of // the content and we are done. If its empty, leave it null. // if (ptr1) { if (ptr1 != srcPtr) { xmlURL.fHost = (XMLCh*) xmlURL.fMemoryManager->allocate ( ((ptr1 - srcPtr) + 1) * sizeof(XMLCh) );//new XMLCh[(ptr1 - srcPtr) + 1]; ptr2 = xmlURL.fHost; while (srcPtr < ptr1) *ptr2++ = *srcPtr++; *ptr2 = 0; } } else { xmlURL.fHost = XMLString::replicate(srcPtr, xmlURL.fMemoryManager); // Update source pointer to the end srcPtr += XMLString::stringLen(xmlURL.fHost); } } } else { // // http protocol requires two forward slashes // we didn't get them, so throw an exception // if (xmlURL.fProtocol == HTTP) return false; } // // If there was a host part, then we have to grovel through it for // all the bits and pieces it can hold. // if (xmlURL.fHost) { // // Look for a '@' character, which indicates a user name. If we // find one, then everything between the start of the host data // and the character is the user name. // ptr1 = XMLString::findAny(xmlURL.fHost, gListTwo); if (ptr1) { // Get this info out as the user name *ptr1 = 0; xmlURL.fUser = XMLString::replicate(xmlURL.fHost, xmlURL.fMemoryManager); ptr1++; // And now cut these chars from the host string XMLString::cut(xmlURL.fHost, ptr1 - xmlURL.fHost); // Is there a password inside the user string? ptr2 = XMLString::findAny(xmlURL.fUser, gListThree); if (ptr2) { // Remove it from the user name string *ptr2 = 0; // And copy out the remainder to the password field ptr2++; xmlURL.fPassword = XMLString::replicate(ptr2, xmlURL.fMemoryManager); } } // // Ok, so now we are at the actual host name, if any. If we are // not at the end of the host data, then lets see if we have a // port trailing the // ptr1 = XMLString::findAny(xmlURL.fHost, gListThree); if (ptr1) { // Remove it from the host name *ptr1 = 0; // Try to convert it to a numeric port value and store it ptr1++; if (!XMLString::textToBin(ptr1, xmlURL.fPortNum, xmlURL.fMemoryManager)) return false; } // If the host ended up empty, then toss is if (!*(xmlURL.fHost)) { xmlURL.fMemoryManager->deallocate(xmlURL.fHost);//delete[] fHost; xmlURL.fHost = 0; } } // If we are at the end, then we are done now if (!*srcPtr) { if(xmlURL.fHost) { static const XMLCh slash[] = { chForwardSlash, chNull }; xmlURL.fPath = XMLString::replicate(slash, xmlURL.fMemoryManager); } return true; } // // Next is the path part. It can be absolute, i.e. starting with a // forward slash character, or relative. Its basically everything up // to the end of the string or to any trailing query or fragment. // ptr1 = XMLString::findAny(srcPtr, gListFive); if (!ptr1) { xmlURL.fPath = XMLString::replicate(srcPtr, xmlURL.fMemoryManager); return true; } // Everything from where we are to what we found is the path if (ptr1 > srcPtr) { xmlURL.fPath = (XMLCh*) xmlURL.fMemoryManager->allocate ( ((ptr1 - srcPtr) + 1) * sizeof(XMLCh) );//new XMLCh[(ptr1 - srcPtr) + 1]; ptr2 = xmlURL.fPath; while (srcPtr < ptr1) *ptr2++ = *srcPtr++; *ptr2 = 0; } // // If we found a fragment, then it is the rest of the string and we // are done. // if (*srcPtr == chPound) { srcPtr++; xmlURL.fFragment = XMLString::replicate(srcPtr, xmlURL.fMemoryManager); return true; } // // The query is either the rest of the string, or up to the fragment // separator. // srcPtr++; ptr1 = XMLString::findAny(srcPtr, gListSix); if (!ptr1) { xmlURL.fQuery = XMLString::replicate(srcPtr, xmlURL.fMemoryManager); return true; } else { xmlURL.fQuery = (XMLCh*) xmlURL.fMemoryManager->allocate ( ((ptr1 - srcPtr) + 1) * sizeof(XMLCh) );//new XMLCh[(ptr1 - srcPtr) + 1]; ptr2 = xmlURL.fQuery; while (srcPtr < ptr1) *ptr2++ = *srcPtr++; *ptr2 = 0; } // If we are not at the end now, then everything else is the fragment if (*srcPtr == chPound) { srcPtr++; xmlURL.fFragment = XMLString::replicate(srcPtr, xmlURL.fMemoryManager); } return true; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLDouble.cpp000644 000765 000024 00000003762 13241160335 021550 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLDouble.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // ctor/dtor // --------------------------------------------------------------------------- XMLDouble::XMLDouble(const XMLCh* const strValue, MemoryManager* const manager) :XMLAbstractDoubleFloat(manager) { init(strValue); } XMLDouble::~XMLDouble() { } void XMLDouble::checkBoundary(char* const strValue) { convert(strValue); } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(XMLDouble) XMLDouble::XMLDouble(MemoryManager* const manager) :XMLAbstractDoubleFloat(manager) { } void XMLDouble::serialize(XSerializeEngine& serEng) { XMLAbstractDoubleFloat::serialize(serEng); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLInteger.hpp000644 000765 000024 00000004107 13241160336 021733 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLInteger.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XML_INTEGER_HPP) #define XERCESC_INCLUDE_GUARD_XML_INTEGER_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT XMLInteger : public XMemory { public: /** * Constructs a newly allocated XMLInteger object * * @param intVal the integer */ XMLInteger(const int intVal); ~XMLInteger(); /** * Returns the built in integer value. */ int intValue() const; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLInteger(const XMLInteger&); XMLInteger& operator=(const XMLInteger&); // ----------------------------------------------------------------------- // Private data members // // fData // the value // // ----------------------------------------------------------------------- int fData; }; inline XMLInteger::XMLInteger(const int intVal) :fData(intVal) { } inline XMLInteger::~XMLInteger() { } inline int XMLInteger::intValue() const { return fData; } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLFloat.cpp000644 000765 000024 00000005512 13241160336 021377 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLFloat.cpp 803857 2009-08-13 12:16:44Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // ctor/dtor // --------------------------------------------------------------------------- XMLFloat::XMLFloat(const XMLCh* const strValue, MemoryManager* const manager) :XMLAbstractDoubleFloat(manager) { init(strValue); } XMLFloat::~XMLFloat() { } void XMLFloat::checkBoundary(char* const strValue) { convert(strValue); if (fDataConverted == false) { /** * float related checking */ // 3.2.4 The basic value space of float consists of the values m × 2^e, where // m is an integer whose absolute value is less than 2^24, // and e is an integer between -149 and 104, inclusive static const double fltMin = pow(2.0,-149); static const double fltMax = pow(2.0,24) * pow(2.0,104); if (fValue < (-1) * fltMax) { fType = NegINF; fDataConverted = true; fDataOverflowed = true; } else if (fValue > (-1)*fltMin && fValue < 0) { fDataConverted = true; fValue = 0; } else if (fValue > 0 && fValue < fltMin ) { fDataConverted = true; fValue = 0; } else if (fValue > fltMax) { fType = PosINF; fDataConverted = true; fDataOverflowed = true; } } } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(XMLFloat) XMLFloat::XMLFloat(MemoryManager* const manager) :XMLAbstractDoubleFloat(manager) { } void XMLFloat::serialize(XSerializeEngine& serEng) { XMLAbstractDoubleFloat::serialize(serEng); } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/ValueArrayOf.hpp000644 000765 000024 00000012324 13241160336 022315 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ValueArrayOf.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_VALUEARRAY_HPP) #define XERCESC_INCLUDE_GUARD_VALUEARRAY_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN template class ValueArrayOf : public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- ValueArrayOf ( const XMLSize_t size , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ValueArrayOf ( const TElem* values , const XMLSize_t size , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ValueArrayOf(const ValueArrayOf& source); ~ValueArrayOf(); // ----------------------------------------------------------------------- // Public operators // ----------------------------------------------------------------------- TElem& operator[](const XMLSize_t index); const TElem& operator[](const XMLSize_t index) const; ValueArrayOf& operator=(const ValueArrayOf& toAssign); bool operator==(const ValueArrayOf& toCompare) const; bool operator!=(const ValueArrayOf& toCompare) const; // ----------------------------------------------------------------------- // Copy operations // ----------------------------------------------------------------------- XMLSize_t copyFrom(const ValueArrayOf& srcArray); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- XMLSize_t length() const; TElem* rawData() const; // ----------------------------------------------------------------------- // Miscellaneous methods // ----------------------------------------------------------------------- void resize(const XMLSize_t newSize); private : // ----------------------------------------------------------------------- // Data members // ----------------------------------------------------------------------- XMLSize_t fSize; TElem* fArray; MemoryManager* fMemoryManager; }; // // An enumerator for a value array. It derives from the basic enumerator // class, so that value vectors can be generically enumerated. // template class ValueArrayEnumerator : public XMLEnumerator, public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- ValueArrayEnumerator ( ValueArrayOf* const toEnum , const bool adopt = false ); virtual ~ValueArrayEnumerator(); // ----------------------------------------------------------------------- // Enum interface // ----------------------------------------------------------------------- bool hasMoreElements() const; TElem& nextElement(); void Reset(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ValueArrayEnumerator(const ValueArrayEnumerator&); ValueArrayEnumerator& operator=(const ValueArrayEnumerator&); // ----------------------------------------------------------------------- // Data Members // // fAdopted // Indicates whether we have adopted the passed vector. If so then // we delete the vector when we are destroyed. // // fCurIndex // This is the current index into the vector. // // fToEnum // The value array being enumerated. // ----------------------------------------------------------------------- bool fAdopted; XMLSize_t fCurIndex; ValueArrayOf* fToEnum; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/ValueVectorOf.hpp000644 000765 000024 00000013335 13241160335 022503 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ValueVectorOf.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_VALUEVECTOROF_HPP) #define XERCESC_INCLUDE_GUARD_VALUEVECTOROF_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN template class ValueVectorOf : public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- ValueVectorOf ( const XMLSize_t maxElems , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager , const bool toCallDestructor = false ); ValueVectorOf(const ValueVectorOf& toCopy); ~ValueVectorOf(); // ----------------------------------------------------------------------- // Operators // ----------------------------------------------------------------------- ValueVectorOf& operator=(const ValueVectorOf& toAssign); // ----------------------------------------------------------------------- // Element management // ----------------------------------------------------------------------- void addElement(const TElem& toAdd); void setElementAt(const TElem& toSet, const XMLSize_t setAt); void insertElementAt(const TElem& toInsert, const XMLSize_t insertAt); void removeElementAt(const XMLSize_t removeAt); void removeAllElements(); bool containsElement(const TElem& toCheck, const XMLSize_t startIndex = 0); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- const TElem& elementAt(const XMLSize_t getAt) const; TElem& elementAt(const XMLSize_t getAt); XMLSize_t curCapacity() const; XMLSize_t size() const; MemoryManager* getMemoryManager() const; // ----------------------------------------------------------------------- // Miscellaneous // ----------------------------------------------------------------------- void ensureExtraCapacity(const XMLSize_t length); const TElem* rawData() const; private: // ----------------------------------------------------------------------- // Data members // // fCurCount // The count of values current added to the vector, which may be // less than the internal capacity. // // fMaxCount // The current capacity of the vector. // // fElemList // The list of elements, which is dynamically allocated to the needed // size. // ----------------------------------------------------------------------- bool fCallDestructor; XMLSize_t fCurCount; XMLSize_t fMaxCount; TElem* fElemList; MemoryManager* fMemoryManager; }; // // An enumerator for a value vector. It derives from the basic enumerator // class, so that value vectors can be generically enumerated. // template class ValueVectorEnumerator : public XMLEnumerator, public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- ValueVectorEnumerator ( ValueVectorOf* const toEnum , const bool adopt = false ); virtual ~ValueVectorEnumerator(); // ----------------------------------------------------------------------- // Enum interface // ----------------------------------------------------------------------- bool hasMoreElements() const; TElem& nextElement(); void Reset(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ValueVectorEnumerator(const ValueVectorEnumerator&); ValueVectorEnumerator& operator=(const ValueVectorEnumerator&); // ----------------------------------------------------------------------- // Data Members // // fAdopted // Indicates whether we have adopted the passed vector. If so then // we delete the vector when we are destroyed. // // fCurIndex // This is the current index into the vector. // // fToEnum // The value vector being enumerated. // ----------------------------------------------------------------------- bool fAdopted; XMLSize_t fCurIndex; ValueVectorOf* fToEnum; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/NameIdPool.c000644 000765 000024 00000021464 13241160336 021404 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: NameIdPool.c 883368 2009-11-23 15:28:19Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // NameIdPool: Constructors and Destructor // --------------------------------------------------------------------------- template NameIdPool::NameIdPool( const XMLSize_t hashModulus , const XMLSize_t initSize , MemoryManager* const manager) : fMemoryManager(manager) , fIdPtrs(0) , fIdPtrsCount(initSize) , fIdCounter(0) , fBucketList(hashModulus, manager) { if (!hashModulus) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Pool_ZeroModulus, fMemoryManager); // // Allocate the initial id pointers array. We don't have to zero them // out since the fIdCounter value tells us which ones are valid. The // zeroth element is never used (and represents an invalid pool id.) // if (!fIdPtrsCount) fIdPtrsCount = 256; fIdPtrs = (TElem**) fMemoryManager->allocate ( fIdPtrsCount * sizeof(TElem*) ); fIdPtrs[0] = 0; } template NameIdPool::~NameIdPool() { // // Delete the id pointers list. The stuff it points to will be cleaned // up when we clean the bucket lists. // fMemoryManager->deallocate(fIdPtrs); //delete [] fIdPtrs; } // --------------------------------------------------------------------------- // NameIdPool: Element management // --------------------------------------------------------------------------- template inline bool NameIdPool:: containsKey(const XMLCh* const key) const { if (fIdCounter == 0) return false; return fBucketList.containsKey(key); } template void NameIdPool::removeAll() { if (fIdCounter == 0) return; fBucketList.removeAll(); // Reset the id counter fIdCounter = 0; } // --------------------------------------------------------------------------- // NameIdPool: Getters // --------------------------------------------------------------------------- template inline TElem* NameIdPool:: getByKey(const XMLCh* const key) { if (fIdCounter == 0) return 0; return fBucketList.get(key); } template inline const TElem* NameIdPool:: getByKey(const XMLCh* const key) const { if (fIdCounter == 0) return 0; return fBucketList.get(key); } template inline TElem* NameIdPool:: getById(const XMLSize_t elemId) { // If its either zero or beyond our current id, its an error if (!elemId || (elemId > fIdCounter)) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Pool_InvalidId, fMemoryManager); return fIdPtrs[elemId]; } template inline const TElem* NameIdPool:: getById(const XMLSize_t elemId) const { // If its either zero or beyond our current id, its an error if (!elemId || (elemId > fIdCounter)) ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Pool_InvalidId, fMemoryManager); return fIdPtrs[elemId]; } template inline MemoryManager* NameIdPool::getMemoryManager() const { return fMemoryManager; } // --------------------------------------------------------------------------- // NameIdPool: Setters // --------------------------------------------------------------------------- template XMLSize_t NameIdPool::put(TElem* const elemToAdopt) { // First see if the key exists already. If so, its an error if(containsKey(elemToAdopt->getKey())) { ThrowXMLwithMemMgr1 ( IllegalArgumentException , XMLExcepts::Pool_ElemAlreadyExists , elemToAdopt->getKey() , fMemoryManager ); } fBucketList.put((void*)elemToAdopt->getKey(), elemToAdopt); // // Give this new one the next available id and add to the pointer list. // Expand the list if that is now required. // if (fIdCounter + 1 == fIdPtrsCount) { // Create a new count 1.5 times larger and allocate a new array XMLSize_t newCount = (XMLSize_t)(fIdPtrsCount * 1.5); TElem** newArray = (TElem**) fMemoryManager->allocate ( newCount * sizeof(TElem*) ); //new TElem*[newCount]; // Copy over the old contents to the new array memcpy(newArray, fIdPtrs, fIdPtrsCount * sizeof(TElem*)); // Ok, toss the old array and store the new data fMemoryManager->deallocate(fIdPtrs); //delete [] fIdPtrs; fIdPtrs = newArray; fIdPtrsCount = newCount; } const XMLSize_t retId = ++fIdCounter; fIdPtrs[retId] = elemToAdopt; // Set the id on the passed element elemToAdopt->setId(retId); // Return the id that we gave to this element return retId; } // --------------------------------------------------------------------------- // NameIdPoolEnumerator: Constructors and Destructor // --------------------------------------------------------------------------- template NameIdPoolEnumerator:: NameIdPoolEnumerator(NameIdPool* const toEnum , MemoryManager* const manager) : XMLEnumerator() , fCurIndex(0) , fToEnum(toEnum) , fMemoryManager(manager) { Reset(); } template NameIdPoolEnumerator:: NameIdPoolEnumerator(const NameIdPoolEnumerator& toCopy) : XMLEnumerator(toCopy) , XMemory(toCopy) , fCurIndex(toCopy.fCurIndex) , fToEnum(toCopy.fToEnum) , fMemoryManager(toCopy.fMemoryManager) { } template NameIdPoolEnumerator::~NameIdPoolEnumerator() { // We don't own the pool being enumerated, so no cleanup required } // --------------------------------------------------------------------------- // NameIdPoolEnumerator: Public operators // --------------------------------------------------------------------------- template NameIdPoolEnumerator& NameIdPoolEnumerator:: operator=(const NameIdPoolEnumerator& toAssign) { if (this == &toAssign) return *this; fMemoryManager = toAssign.fMemoryManager; fCurIndex = toAssign.fCurIndex; fToEnum = toAssign.fToEnum; return *this; } // --------------------------------------------------------------------------- // NameIdPoolEnumerator: Enum interface // --------------------------------------------------------------------------- template bool NameIdPoolEnumerator:: hasMoreElements() const { // If our index is zero or past the end, then we are done if (!fCurIndex || (fCurIndex > fToEnum->fIdCounter)) return false; return true; } template TElem& NameIdPoolEnumerator::nextElement() { // If our index is zero or past the end, then we are done if (!fCurIndex || (fCurIndex > fToEnum->fIdCounter)) ThrowXMLwithMemMgr(NoSuchElementException, XMLExcepts::Enum_NoMoreElements, fMemoryManager); // Return the current element and bump the index return *fToEnum->fIdPtrs[fCurIndex++]; } template void NameIdPoolEnumerator::Reset() { // // Find the next available bucket element in the pool. We use the id // array since its very easy to enumerator through by just maintaining // an index. If the id counter is zero, then its empty and we leave the // current index to zero. // fCurIndex = fToEnum->fIdCounter ? 1:0; } template XMLSize_t NameIdPoolEnumerator::size() const { return fToEnum->fIdCounter; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/ParseException.hpp000644 000765 000024 00000002231 13241160336 022702 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ParseException.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_PARSEEXCEPTION_HPP) #define XERCESC_INCLUDE_GUARD_PARSEEXCEPTION_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN MakeXMLException(ParseException, XMLUTIL_EXPORT) XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/QName.hpp000644 000765 000024 00000015060 13241160335 020755 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: QName.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_QNAME_HPP) #define XERCESC_INCLUDE_GUARD_QNAME_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT QName : public XSerializable, public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- /** Default constructor. */ QName(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** Constructs a specified qname using prefix, and localpart. */ QName ( const XMLCh* const prefix , const XMLCh* const localPart , const unsigned int uriId , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Constructs a specified qname using rawName. */ QName ( const XMLCh* const rawName , const unsigned int uriId , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Copy constructor. */ QName(const QName& qname); ~QName(); // ----------------------------------------------------------------------- // Getters // ----------------------------------------------------------------------- const XMLCh* getPrefix() const; XMLCh* getPrefix(); const XMLCh* getLocalPart() const; XMLCh* getLocalPart(); unsigned int getURI() const; const XMLCh* getRawName() const; XMLCh* getRawName(); MemoryManager* getMemoryManager() const; // ----------------------------------------------------------------------- // Setters // ----------------------------------------------------------------------- void setName ( const XMLCh* const prefix , const XMLCh* const localPart , const unsigned int uriId ); void setName ( const XMLCh* const rawName , const unsigned int uriId ); void setPrefix(const XMLCh*) ; void setLocalPart(const XMLCh*) ; void setNPrefix(const XMLCh*, const XMLSize_t ) ; void setNLocalPart(const XMLCh*, const XMLSize_t ) ; void setURI(const unsigned int) ; void setValues(const QName& qname); // ----------------------------------------------------------------------- // comparison // ----------------------------------------------------------------------- bool operator==(const QName&) const; // ----------------------------------------------------------------------- // Misc // ----------------------------------------------------------------------- void cleanUp(); /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(QName) private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- QName& operator=(const QName&); // ----------------------------------------------------------------------- // Private instance variables // // We copy the followings from XMLAttr.hpp, but stick to Java version's // naming convention // // fPrefix // fPrefixBufSz // The prefix that was applied to this attribute's name, and the // current size of the buffer (minus one for the null.) Prefixes // really don't matter technically but it might be required for // practical reasons, to recreate the original document for instance. // // fLocalPart // fLocalPartBufSz // The base part of the name of the attribute, and the current size // of the buffer (minus one, where the null is.) // // fRawName // fRawNameBufSz // This is the QName form of the name, which is faulted in (from the // prefix and name) upon request. The size field indicates the // current size of the buffer (minus one for the null.) It will be // zero until filled in. // // fURIId // The id of the URI that this attribute belongs to. // ----------------------------------------------------------------------- XMLSize_t fPrefixBufSz; XMLSize_t fLocalPartBufSz; XMLSize_t fRawNameBufSz; unsigned int fURIId; XMLCh* fPrefix; XMLCh* fLocalPart; XMLCh* fRawName; MemoryManager* fMemoryManager; }; // --------------------------------------------------------------------------- // QName: Getter methods // --------------------------------------------------------------------------- inline const XMLCh* QName::getPrefix() const { return fPrefix; } inline XMLCh* QName::getPrefix() { return fPrefix; } inline const XMLCh* QName::getLocalPart() const { return fLocalPart; } inline XMLCh* QName::getLocalPart() { return fLocalPart; } inline unsigned int QName::getURI() const { return fURIId; } inline MemoryManager* QName::getMemoryManager() const { return fMemoryManager; } // --------------------------------------------------------------------------- // QName: Setter methods // --------------------------------------------------------------------------- inline void QName::setURI(const unsigned int uriId) { fURIId = uriId; } inline void QName::setPrefix(const XMLCh* prefix) { setNPrefix(prefix, XMLString::stringLen(prefix)); } inline void QName::setLocalPart(const XMLCh* localPart) { setNLocalPart(localPart, XMLString::stringLen(localPart)); } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/ValueStackOf.hpp000644 000765 000024 00000012370 13241160335 022304 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ValueStackOf.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_VALUESTACKOF_HPP) #define XERCESC_INCLUDE_GUARD_VALUESTACKOF_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN // // Forward declare the enumerator so he can be our friend. Can you say // friend? Sure... // template class ValueStackEnumerator; template class ValueStackOf : public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- ValueStackOf ( const XMLSize_t fInitCapacity , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager , const bool toCallDestructor = false ); ~ValueStackOf(); // ----------------------------------------------------------------------- // Element management methods // ----------------------------------------------------------------------- void push(const TElem& toPush); const TElem& peek() const; TElem pop(); void removeAllElements(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- bool empty(); XMLSize_t curCapacity(); XMLSize_t size(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ValueStackOf(const ValueStackOf&); ValueStackOf& operator=(const ValueStackOf&); // ----------------------------------------------------------------------- // Declare our friends // ----------------------------------------------------------------------- friend class ValueStackEnumerator; // ----------------------------------------------------------------------- // Data Members // // fVector // The vector that is used as the backing data structure for the // stack. // ----------------------------------------------------------------------- ValueVectorOf fVector; }; // // An enumerator for a value stack. It derives from the basic enumerator // class, so that value stacks can be generically enumerated. // template class ValueStackEnumerator : public XMLEnumerator, public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- ValueStackEnumerator ( ValueStackOf* const toEnum , const bool adopt = false ); virtual ~ValueStackEnumerator(); // ----------------------------------------------------------------------- // Enum interface // ----------------------------------------------------------------------- bool hasMoreElements() const; TElem& nextElement(); void Reset(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ValueStackEnumerator(const ValueStackEnumerator&); ValueStackEnumerator& operator=(const ValueStackEnumerator&); // ----------------------------------------------------------------------- // Data Members // // fAdopted // Indicates whether we have adopted the passed stack. If so then // we delete the stack when we are destroyed. // // fCurIndex // This is the current index into the vector inside the stack being // enumerated. // // fToEnum // The stack that is being enumerated. This is just kept for // adoption purposes, since we really are enumerating the vector // inside of it. // ----------------------------------------------------------------------- bool fAdopted; XMLSize_t fCurIndex; ValueVectorOf* fVector; ValueStackOf* fToEnum; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/XMLWin1252Transcoder.hpp000644 000765 000024 00000004277 13241160336 023442 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLWin1252Transcoder.hpp 570552 2007-08-28 19:57:36Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLWIN1252TRANSCODER_HPP) #define XERCESC_INCLUDE_GUARD_XMLWIN1252TRANSCODER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN // // This class provides an implementation of the XMLTranscoder interface // for the Windows variant of Latin1, called Windows-1252. Its close to // Latin1, but is somewhat different. // class XMLUTIL_EXPORT XMLWin1252Transcoder : public XML256TableTranscoder { public : // ----------------------------------------------------------------------- // Public constructors and destructor // ----------------------------------------------------------------------- XMLWin1252Transcoder ( const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~XMLWin1252Transcoder(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLWin1252Transcoder(); XMLWin1252Transcoder(const XMLWin1252Transcoder&); XMLWin1252Transcoder& operator=(const XMLWin1252Transcoder&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLEBCDICTranscoder.hpp000644 000765 000024 00000005255 13241160336 023301 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLEBCDICTranscoder.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLEBCDICTRANSCODER_HPP) #define XERCESC_INCLUDE_GUARD_XMLEBCDICTRANSCODER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN // // This class provides an implementation of the XMLTranscoder interface // for a simple EBCDIC-US transcoder. The parser does some encodings // intrinsically without depending upon external transcoding services. // To make everything more orthogonal, we implement these internal // transcoders using the same transcoder abstraction as the pluggable // transcoding services do. // // EBCDIC-US is the same as IBM037, CP37, EBCDIC-CP-US, etc... // class XMLUTIL_EXPORT XMLEBCDICTranscoder : public XML256TableTranscoder { public : // ----------------------------------------------------------------------- // Public, static methods // ----------------------------------------------------------------------- static XMLCh xlatThisOne(const XMLByte toXlat); // ----------------------------------------------------------------------- // Public constructors and destructor // ----------------------------------------------------------------------- XMLEBCDICTranscoder ( const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~XMLEBCDICTranscoder(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLEBCDICTranscoder(); XMLEBCDICTranscoder(const XMLEBCDICTranscoder&); XMLEBCDICTranscoder& operator=(const XMLEBCDICTranscoder&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/PanicHandler.cpp000644 000765 000024 00000004227 13241160336 022303 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: PanicHandler.cpp 471747 2006-11-06 14:31:56Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include XERCES_CPP_NAMESPACE_BEGIN const char* PanicHandler::getPanicReasonString(const PanicReasons reason) { const char* reasonStr; switch (reason) { case Panic_NoTransService: reasonStr = "Could not load a transcoding service"; break; case Panic_NoDefTranscoder: reasonStr = "Could not load a local code page transcoder"; break; case Panic_CantFindLib: reasonStr = "Could not find the xerces-c DLL"; break; case Panic_UnknownMsgDomain: reasonStr = "Unknown message domain"; break; case Panic_CantLoadMsgDomain: reasonStr = "Cannot load message domain"; break; case Panic_SynchronizationErr: reasonStr = "Cannot synchronize system or mutex"; break; case Panic_SystemInit: reasonStr = "Cannot initialize the system or mutex"; break; case Panic_MutexErr: reasonStr = "Cannot create, lock or unlock a mutex"; break; default: reasonStr = "Unknown reason"; break; } return reasonStr; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLUri.cpp000644 000765 000024 00000230457 13241160335 021100 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLUri.cpp 1799602 2017-06-22 18:14:37Z scantor $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XMLUri: static data // --------------------------------------------------------------------------- // Amended by RFC2732 // reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | // "$" | "," | "[" | "]" // const XMLCh XMLUri::RESERVED_CHARACTERS[] = { chSemiColon, chForwardSlash, chQuestion, chColon, chAt, chAmpersand, chEqual, chPlus, chDollarSign, chComma, chOpenSquare, chCloseSquare, chNull }; // // mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | // "(" | ")" // const XMLCh XMLUri::MARK_CHARACTERS[] = { chDash, chUnderscore, chPeriod, chBang, chTilde, chAsterisk, chSingleQuote, chOpenParen, chCloseParen, chNull }; // combination of MARK and RESERVED const XMLCh XMLUri::MARK_OR_RESERVED_CHARACTERS[] = { chDash, chUnderscore, chPeriod, chBang, chTilde, chAsterisk, chSingleQuote, chOpenParen, chCloseParen, chSemiColon, chForwardSlash, chQuestion, chColon, chAt, chAmpersand, chEqual, chPlus, chDollarSign, chComma, chOpenSquare, chCloseSquare, chNull }; // // scheme = alpha *( alpha | digit | "+" | "-" | "." ) // const XMLCh XMLUri::SCHEME_CHARACTERS[] = { chPlus, chDash, chPeriod, chNull }; // // userinfo = *( unreserved | escaped | // ";" | ":" | "&" | "=" | "+" | "$" | "," ) // const XMLCh XMLUri::USERINFO_CHARACTERS[] = { chSemiColon, chColon, chAmpersand, chEqual, chPlus, chDollarSign, chPeriod, chNull }; // // reg_name = 1*( unreserved | escaped | "$" | "," | // ";" | ":" | "@" | "&" | "=" | "+" ) // const XMLCh XMLUri::REG_NAME_CHARACTERS[] = { chDollarSign, chComma, chSemiColon, chColon, chAt, chAmpersand, chEqual, chPlus, chNull }; // pchar plus ';' and '/'. // pchar = unreserved | escaped | // ":" | "@" | "&" | "=" | "+" | "$" | "," const XMLCh XMLUri::PATH_CHARACTERS[] = { chSemiColon, chForwardSlash, chColon, chAt, chAmpersand, chEqual, chPlus, chDollarSign, chComma, chNull }; // --------------------------------------------------------------------------- // Local methods and data // --------------------------------------------------------------------------- static const int BUF_LEN = 64; // // "Scheme" // "Parameters" // "UserInfo" // "Host" // "Port" // "RegName" // "Path" // "Query" // "Fragment" // static const XMLCh errMsg_SCHEME[] = { chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_e, chNull }; static const XMLCh errMsg_PARAMS[] = { chLatin_p, chLatin_a, chLatin_r, chLatin_a, chLatin_m, chLatin_e, chLatin_t, chLatin_e, chLatin_r, chLatin_s, chNull }; static const XMLCh errMsg_USERINFO[] = { chLatin_u, chLatin_s, chLatin_e, chLatin_r, chLatin_i, chLatin_n, chLatin_f, chLatin_o, chNull }; static const XMLCh errMsg_HOST[] = { chLatin_h, chLatin_o, chLatin_s, chLatin_t, chNull }; static const XMLCh errMsg_PORT[] = { chLatin_p, chLatin_o, chLatin_r, chLatin_t, chNull }; static const XMLCh errMsg_REGNAME[] = { chLatin_R, chLatin_e, chLatin_g, chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull }; static const XMLCh errMsg_PATH[] = { chLatin_p, chLatin_a, chLatin_t, chLatin_h, chNull }; static const XMLCh errMsg_QUERY[] = { chLatin_q, chLatin_u, chLatin_e, chLatin_r, chLatin_y, chNull }; static const XMLCh errMsg_FRAGMENT[] = { chLatin_f, chLatin_r, chLatin_a, chLatin_g, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chNull }; // // "//" // "/" // "./" // "/." // "/../" // "/.." // static const XMLCh DOUBLE_SLASH[] = { chForwardSlash, chForwardSlash, chNull }; static const XMLCh SINGLE_SLASH[] = { chForwardSlash, chNull }; static const XMLCh SLASH_DOT_SLASH[] = { chForwardSlash, chPeriod, chForwardSlash, chNull }; static const XMLCh SLASH_DOT[] = { chForwardSlash, chPeriod, chNull }; static const XMLCh SLASH_DOTDOT_SLASH[] = { chForwardSlash, chPeriod, chPeriod, chForwardSlash, chNull }; static const XMLCh SLASH_DOTDOT[] = { chForwardSlash, chPeriod, chPeriod, chNull }; // // ":/?#" // // REVISIT: why? static const XMLCh SCHEME_SEPARATORS[] = { chColon, chForwardSlash, chQuestion, chPound, chNull }; // --------------------------------------------------------------------------- // XMLUri: Constructors and Helper methods // --------------------------------------------------------------------------- // ctor# 2 typedef JanitorMemFunCall CleanupType; XMLUri::XMLUri(const XMLCh* const uriSpec, MemoryManager* const manager) : fPort(-1) , fScheme(0) , fUserInfo(0) , fHost(0) , fRegAuth(0) , fPath(0) , fQueryString(0) , fFragment(0) , fURIText(0) , fMemoryManager(manager) { CleanupType cleanup(this, &XMLUri::cleanUp); try { initialize((XMLUri *)0, uriSpec); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } // ctor# 7 relative ctor XMLUri::XMLUri(const XMLUri* const baseURI , const XMLCh* const uriSpec , MemoryManager* const manager) : fPort(-1) , fScheme(0) , fUserInfo(0) , fHost(0) , fRegAuth(0) , fPath(0) , fQueryString(0) , fFragment(0) , fURIText(0) , fMemoryManager(manager) { CleanupType cleanup(this, &XMLUri::cleanUp); try { initialize(baseURI, uriSpec); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } //Copy constructor XMLUri::XMLUri(const XMLUri& toCopy) : XSerializable(toCopy) , XMemory(toCopy) , fPort(-1) , fScheme(0) , fUserInfo(0) , fHost(0) , fRegAuth(0) , fPath(0) , fQueryString(0) , fFragment(0) , fURIText(0) , fMemoryManager(toCopy.fMemoryManager) { CleanupType cleanup(this, &XMLUri::cleanUp); try { initialize(toCopy); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XMLUri& XMLUri::operator=(const XMLUri& toAssign) { cleanUp(); CleanupType cleanup(this, &XMLUri::cleanUp); try { initialize(toAssign); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); return *this; } XMLUri::~XMLUri() { cleanUp(); } void XMLUri::cleanUp() { if (fScheme) XMLString::release(&fScheme, fMemoryManager);//delete[] fScheme; if (fUserInfo) XMLString::release(&fUserInfo, fMemoryManager);//delete[] fUserInfo; if (fHost) XMLString::release(&fHost, fMemoryManager);//delete[] fHost; if (fRegAuth) XMLString::release(&fRegAuth, fMemoryManager);//delete[] fRegAuth; if (fPath) XMLString::release(&fPath, fMemoryManager);//delete[] fPath; if (fQueryString) XMLString::release(&fQueryString, fMemoryManager);//delete[] fQueryString; if (fFragment) XMLString::release(&fFragment, fMemoryManager);//delete[] fFragment; XMLString::release(&fURIText, fMemoryManager);//delete[] fURIText; } void XMLUri::initialize(const XMLUri& toCopy) { // // assuming that all fields from the toCopy are valid, // therefore need NOT to go through various setXXX() methods // fMemoryManager = toCopy.fMemoryManager; fScheme = XMLString::replicate(toCopy.fScheme, fMemoryManager); fUserInfo = XMLString::replicate(toCopy.fUserInfo, fMemoryManager); fHost = XMLString::replicate(toCopy.fHost, fMemoryManager); fPort = toCopy.fPort; fRegAuth = XMLString::replicate(toCopy.fRegAuth, fMemoryManager); fPath = XMLString::replicate(toCopy.fPath, fMemoryManager); fQueryString = XMLString::replicate(toCopy.fQueryString, fMemoryManager); fFragment = XMLString::replicate(toCopy.fFragment, fMemoryManager); } void XMLUri::initialize(const XMLUri* const baseURI , const XMLCh* const uriSpec) { // get a trimmed version of uriSpec // uriSpec will NO LONGER be used in this function. // XMLCh* trimmedUriSpec = XMLString::replicate(uriSpec, fMemoryManager); XMLString::trim(trimmedUriSpec); ArrayJanitor janName(trimmedUriSpec, fMemoryManager); XMLSize_t trimmedUriSpecLen = XMLString::stringLen(trimmedUriSpec); if ( !baseURI && (!trimmedUriSpec || trimmedUriSpecLen == 0)) { ThrowXMLwithMemMgr1(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Empty , errMsg_PARAMS , fMemoryManager); } // just make a copy of the base if spec is empty if (!trimmedUriSpec || trimmedUriSpecLen == 0) { initialize(*baseURI); return; } XMLSize_t index = 0; bool foundScheme = false; // Check for scheme, which must be before `/', '?' or '#'. int colonIdx = XMLString::indexOf(trimmedUriSpec, chColon); int slashIdx = XMLString::indexOf(trimmedUriSpec, chForwardSlash); int queryIdx = XMLString::indexOf(trimmedUriSpec, chQuestion); int fragmentIdx = XMLString::indexOf(trimmedUriSpec, chPound); if ((colonIdx <= 0) || (colonIdx > slashIdx && slashIdx != -1) || (colonIdx > queryIdx && queryIdx != -1) || (colonIdx > fragmentIdx && fragmentIdx != -1)) { // A standalone base is a valid URI according to spec if ( colonIdx == 0 || (!baseURI && fragmentIdx != 0) ) { ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::XMLNUM_URI_No_Scheme, fMemoryManager); } } else { foundScheme = true; initializeScheme(trimmedUriSpec); index = XMLString::stringLen(fScheme)+1; } // It's an error if we stop here if (index == trimmedUriSpecLen || (foundScheme && (trimmedUriSpec[index] == chPound))) { ThrowXMLwithMemMgr1(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Empty , errMsg_PATH , fMemoryManager); } // two slashes means generic URI syntax, so we get the authority XMLCh* authUriSpec = (XMLCh*) fMemoryManager->allocate ( (trimmedUriSpecLen+1) * sizeof(XMLCh) );//new XMLCh[trimmedUriSpecLen+1]; ArrayJanitor authName(authUriSpec, fMemoryManager); XMLString::subString(authUriSpec, trimmedUriSpec, index, trimmedUriSpecLen, fMemoryManager); if (((index+1) < trimmedUriSpecLen) && XMLString::startsWith(authUriSpec, DOUBLE_SLASH)) { index += 2; XMLSize_t startPos = index; // get authority - everything up to path, query or fragment XMLCh testChar; while (index < trimmedUriSpecLen) { testChar = trimmedUriSpec[index]; if (testChar == chForwardSlash || testChar == chQuestion || testChar == chPound ) { break; } index++; } // if we found authority, parse it out, otherwise we set the // host to empty string if (index > startPos) { XMLString::subString(authUriSpec, trimmedUriSpec, startPos, index, fMemoryManager); initializeAuthority(authUriSpec); } else { //fHost = 0; setHost(XMLUni::fgZeroLenString); } } // we need to check if index has exceed the lenght or not if (index >= trimmedUriSpecLen) return; XMLCh* pathUriSpec = (XMLCh*) fMemoryManager->allocate ( (trimmedUriSpecLen+1) * sizeof(XMLCh) );//new XMLCh[trimmedUriSpecLen+1]; ArrayJanitor pathUriSpecName(pathUriSpec, fMemoryManager); XMLString::subString(pathUriSpec, trimmedUriSpec, index, trimmedUriSpecLen, fMemoryManager); initializePath(pathUriSpec); // Resolve relative URI to base URI - see RFC 2396 Section 5.2 // In some cases, it might make more sense to throw an exception // (when scheme is specified is the string spec and the base URI // is also specified, for example), but we're just following the // RFC specifications if ( baseURI ) { // check to see if this is the current doc - RFC 2396 5.2 #2 // note that this is slightly different from the RFC spec in that // we don't include the check for query string being null // - this handles cases where the urispec is just a query // string or a fragment (e.g. "?y" or "#s") - // see which // identified this as a bug in the RFC if ((!fPath || !*fPath) && fScheme == 0 && fHost == 0 && fRegAuth == 0) { fScheme = XMLString::replicate(baseURI->getScheme(), fMemoryManager); fMemoryManager->deallocate(fUserInfo);//delete [] fUserInfo; fUserInfo = XMLString::replicate(baseURI->getUserInfo(), fMemoryManager); fHost = XMLString::replicate(baseURI->getHost(), fMemoryManager); fPort = baseURI->getPort(); fRegAuth = XMLString::replicate(baseURI->getRegBasedAuthority(), fMemoryManager); fMemoryManager->deallocate(fPath);//delete [] fPath; fPath = XMLString::replicate(baseURI->getPath(), fMemoryManager); if ( !fQueryString ) { fQueryString = XMLString::replicate(baseURI->getQueryString(), fMemoryManager); } return; } // check for scheme - RFC 2396 5.2 #3 // if we found a scheme, it means absolute URI, so we're done if (fScheme == 0) { fScheme = XMLString::replicate(baseURI->getScheme(), fMemoryManager); } else { return; } // check for authority - RFC 2396 5.2 #4 // if we found a host, then we've got a network path, so we're done if (fHost == 0 && fRegAuth == 0) { fMemoryManager->deallocate(fUserInfo);//delete [] fUserInfo; fUserInfo = XMLString::replicate(baseURI->getUserInfo(), fMemoryManager); fHost = XMLString::replicate(baseURI->getHost(), fMemoryManager); fPort = baseURI->getPort(); fRegAuth = XMLString::replicate(baseURI->getRegBasedAuthority(), fMemoryManager); } else { return; } // check for absolute path - RFC 2396 5.2 #5 if ((fPath && *fPath) && XMLString::startsWith(fPath, SINGLE_SLASH)) { return; } // if we get to this point, we need to resolve relative path // RFC 2396 5.2 #6 XMLCh* basePath = XMLString::replicate(baseURI->getPath(), fMemoryManager); ArrayJanitor basePathName(basePath, fMemoryManager); XMLSize_t bufLen = trimmedUriSpecLen+XMLString::stringLen(fPath)+XMLString::stringLen(basePath)+1; XMLCh* path = (XMLCh*) fMemoryManager->allocate(bufLen * sizeof(XMLCh));//new XMLCh[bufLen]; ArrayJanitor pathName(path, fMemoryManager); path[0] = 0; XMLCh* tmp1 = (XMLCh*) fMemoryManager->allocate(bufLen * sizeof(XMLCh));//new XMLCh[bufLen]; ArrayJanitor tmp1Name(tmp1, fMemoryManager); XMLCh* tmp2 = (XMLCh*) fMemoryManager->allocate(bufLen * sizeof(XMLCh));//new XMLCh[bufLen]; ArrayJanitor tmp2Name(tmp2, fMemoryManager); // 6a - get all but the last segment of the base URI path if (basePath) { int lastSlash = XMLString::lastIndexOf(basePath, chForwardSlash); if (lastSlash != -1) { XMLString::subString(path, basePath, 0, lastSlash+1, fMemoryManager); } } // 6b - append the relative URI path XMLString::catString(path, fPath); // 6c - remove all "./" where "." is a complete path segment int iIndex = -1; while ((iIndex = XMLString::patternMatch(path, SLASH_DOT_SLASH)) != -1) { XMLString::subString(tmp1, path, 0, iIndex, fMemoryManager); XMLString::subString(tmp2, path, iIndex+2, XMLString::stringLen(path), fMemoryManager); path[0] = 0; XMLString::catString(path, tmp1); XMLString::catString(path, tmp2); } // 6d - remove "." if path ends with "." as a complete path segment if (XMLString::endsWith(path, SLASH_DOT)) { path[XMLString::stringLen(path) - 1] = chNull; } // 6e - remove all "/../" where "" is a complete // path segment not equal to ".." iIndex = -1; int segIndex = -1; int offset = 1; while ((iIndex = XMLString::patternMatch(&(path[offset]), SLASH_DOTDOT_SLASH)) != -1) { // Undo offset iIndex += offset; // Find start of within substring ending at found point. XMLString::subString(tmp1, path, 0, iIndex-1, fMemoryManager); segIndex = XMLString::lastIndexOf(tmp1, chForwardSlash); // Ensure exists and != ".." if (segIndex != -1 && (path[segIndex+1] != chPeriod || path[segIndex+2] != chPeriod || segIndex + 3 != iIndex)) { XMLString::subString(tmp1, path, 0, segIndex, fMemoryManager); XMLString::subString(tmp2, path, iIndex+3, XMLString::stringLen(path), fMemoryManager); path[0] = 0; XMLString::catString(path, tmp1); XMLString::catString(path, tmp2); offset = (segIndex == 0 ? 1 : segIndex); } else { offset += 4; } }// while // 6f - remove ending "/.." where "" is a // complete path segment if (XMLString::endsWith(path, SLASH_DOTDOT)) { // Find start of within substring ending at found point. index = XMLString::stringLen(path) - 3; XMLString::subString(tmp1, path, 0, index-1, fMemoryManager); segIndex = XMLString::lastIndexOf(tmp1, chForwardSlash); if (segIndex != -1 && (path[segIndex+1] != chPeriod || path[segIndex+2] != chPeriod || segIndex + 3 != (int)index)) { path[segIndex+1] = chNull; } } if (getPath()) fMemoryManager->deallocate(fPath);//delete [] fPath; fPath = XMLString::replicate(path, fMemoryManager); } } // --------------------------------------------------------------------------- // Components initialization // --------------------------------------------------------------------------- // // authority = server | reg_name // server = [ [ userinfo "@" ] hostport ] // hostport = host [ ":" port ] // // reg_name = 1*( unreserved | escaped | "$" | "," | // ";" | ":" | "@" | "&" | "=" | "+" ) // // userinfo = *( unreserved | escaped | // ";" | ":" | "&" | "=" | "+" | "$" | "," ) // void XMLUri::initializeAuthority(const XMLCh* const uriSpec) { int index = 0; XMLSize_t start = 0; const XMLSize_t end = XMLString::stringLen(uriSpec); // // server = [ [ userinfo "@" ] hostport ] // userinfo is everything up @, // XMLCh* userinfo = (XMLCh*) fMemoryManager->allocate ( (end+1) * sizeof(XMLCh) );//new XMLCh[end+1]; ArrayJanitor userName(userinfo, fMemoryManager); index = XMLString::indexOf(&(uriSpec[start]), chAt); if ( index != -1) { XMLString::subString(userinfo, &(uriSpec[start]), 0, index, fMemoryManager); index++; // skip the @ start += index; } else { userinfo = 0; } // // hostport = host [ ":" port ] // host is everything up to ':', or up to // and including ']' if followed by ':'. // XMLCh* host = (XMLCh*) fMemoryManager->allocate ( (end+1) * sizeof(XMLCh) );//new XMLCh[end+1]; ArrayJanitor hostName(host, fMemoryManager); // Search for port boundary. if (start < end && uriSpec[start] == chOpenSquare) { index = XMLString::indexOf(&(uriSpec[start]), chCloseSquare); if (index != -1) { // skip the ']' index = ((start + index + 1) < end && uriSpec[start + index + 1] == chColon) ? index+1 : -1; } } else { index = XMLString::indexOf(&(uriSpec[start]), chColon); } if ( index != -1 ) { XMLString::subString(host, &(uriSpec[start]), 0, index, fMemoryManager); index++; // skip the : start +=index; } else { XMLString::subString(host, &(uriSpec[start]), 0, end-start, fMemoryManager); start = end; } // port is everything after ":" XMLCh* portStr = (XMLCh*) fMemoryManager->allocate ( (end+1) * sizeof(XMLCh) );//new XMLCh[end+1]; ArrayJanitor portName(portStr, fMemoryManager); int port = -1; if ((host && *host) && // non empty host (index != -1) && // ":" found (start < end) ) // ":" is not the last { XMLString::subString(portStr, &(uriSpec[start]), 0, end-start, fMemoryManager); if (portStr && *portStr) { port = XMLString::parseInt(portStr, fMemoryManager); } } // if > 0 // Check if we have server based authority. if (isValidServerBasedAuthority(host, port, userinfo, fMemoryManager)) { if (fHost) fMemoryManager->deallocate(fHost);//delete [] fHost; if (fUserInfo) fMemoryManager->deallocate(fUserInfo);//delete[] fUserInfo; fHost = XMLString::replicate(host, fMemoryManager); fPort = port; fUserInfo = XMLString::replicate(userinfo, fMemoryManager); return; } // This must be registry based authority or the URI is malformed. setRegBasedAuthority(uriSpec); } // scheme = alpha *( alpha | digit | "+" | "-" | "." ) void XMLUri::initializeScheme(const XMLCh* const uriSpec) { const XMLCh* tmpPtr = XMLString::findAny(uriSpec, SCHEME_SEPARATORS); if ( !tmpPtr ) { ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::XMLNUM_URI_No_Scheme, fMemoryManager); } else { XMLCh* scheme = (XMLCh*) fMemoryManager->allocate ( (XMLString::stringLen(uriSpec) + 1) * sizeof(XMLCh) );//new XMLCh[XMLString::stringLen(uriSpec)+1]; ArrayJanitor tmpName(scheme, fMemoryManager); XMLString::subString(scheme, uriSpec, 0, (tmpPtr - uriSpec), fMemoryManager); setScheme(scheme); } } void XMLUri::initializePath(const XMLCh* const uriSpec) { if ( !uriSpec ) { ThrowXMLwithMemMgr1(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Empty , errMsg_PATH , fMemoryManager); } XMLSize_t index = 0; XMLSize_t start = 0; XMLSize_t end = XMLString::stringLen(uriSpec); XMLCh testChar = 0; // path - everything up to query string or fragment if (start < end) { // RFC 2732 only allows '[' and ']' to appear in the opaque part. if (!getScheme() || uriSpec[start] == chForwardSlash) { // Scan path. // abs_path = "/" path_segments // rel_path = rel_segment [ abs_path ] while (index < end) { testChar = uriSpec[index]; if (testChar == chQuestion || testChar == chPound) { break; } // check for valid escape sequence if (testChar == chPercent) { if (index + 2 >= end) { XMLCh value1[3]; value1[1] = chNull; value1[2] = chNull; XMLString::moveChars(value1, &(uriSpec[index]), (index + 1 >= end ? 1 : 2)); ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_EscapeSequence , errMsg_PATH , value1 , fMemoryManager); } else if (!XMLString::isHex(uriSpec[index+1]) || !XMLString::isHex(uriSpec[index+2])) { XMLCh value1[4]; XMLString::moveChars(value1, &(uriSpec[index]), 3); value1[3] = chNull; ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_EscapeSequence , errMsg_PATH , value1 , fMemoryManager); } } else if (!isUnreservedCharacter(testChar) && !isPathCharacter(testChar)) { XMLCh value1[2]; value1[0] = testChar; value1[1] = chNull; ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_Char , errMsg_PATH , value1 , fMemoryManager); } index++; }//while (index < end) } else { // Scan opaque part. // opaque_part = uric_no_slash *uric while (index < end) { testChar = uriSpec[index]; if (testChar == chQuestion || testChar == chPound) { break; } // check for valid escape sequence if (testChar == chPercent) { if (index + 2 >= end) { XMLCh value1[3]; value1[1] = chNull; value1[2] = chNull; XMLString::moveChars(value1, &(uriSpec[index]), (index + 1 >= end ? 1 : 2)); ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_EscapeSequence , errMsg_PATH , value1 , fMemoryManager); } else if (!XMLString::isHex(uriSpec[index+1]) || !XMLString::isHex(uriSpec[index+2])) { XMLCh value1[4]; XMLString::moveChars(value1, &(uriSpec[index]), 3); value1[3] = chNull; ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_EscapeSequence , errMsg_PATH , value1 , fMemoryManager); } } // If the scheme specific part is opaque, it can contain '[' // and ']'. uric_no_slash wasn't modified by RFC 2732, which // I've interpreted as an error in the spec, since the // production should be equivalent to (uric - '/'), and uric // contains '[' and ']'. else if (!isReservedOrUnreservedCharacter(testChar)) { XMLCh value1[2]; value1[0] = testChar; value1[1] = chNull; ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_Char , errMsg_PATH , value1 , fMemoryManager); } index++; }//while (index < end) } } //if (start < end) if (getPath()) { fMemoryManager->deallocate(fPath);//delete [] fPath; } fPath = (XMLCh*) fMemoryManager->allocate((index+1) * sizeof(XMLCh));//new XMLCh[index+1]; XMLString::subString(fPath, uriSpec, start, index, fMemoryManager); // query - starts with ? and up to fragment or end if (testChar == chQuestion) { index++; start = index; while (index < end) { testChar = uriSpec[index]; if (testChar == chPound) { break; } if (testChar == chPercent) { if (index + 2 >= end) { XMLCh value1[3]; value1[1] = chNull; value1[2] = chNull; XMLString::moveChars(value1, &(uriSpec[index]), (index + 1 >= end ? 1 : 2)); ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_EscapeSequence , errMsg_QUERY , value1 , fMemoryManager); } if (!XMLString::isHex(uriSpec[index+1]) || !XMLString::isHex(uriSpec[index+2])) { XMLCh value1[4]; XMLString::moveChars(value1, &(uriSpec[index]), 3); value1[3] = chNull; ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_EscapeSequence , errMsg_QUERY , value1 , fMemoryManager); } } else if (!isReservedOrUnreservedCharacter(testChar)) { XMLCh value1[2]; value1[0] = testChar; value1[1] = chNull; ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_Char , errMsg_QUERY , value1 , fMemoryManager); } index++; } if (getQueryString()) { fMemoryManager->deallocate(fQueryString);//delete [] fQueryString; } fQueryString = (XMLCh*) fMemoryManager->allocate ( (index - start + 1) * sizeof(XMLCh) );//new XMLCh[index - start + 1]; XMLString::subString(fQueryString, uriSpec, start, index, fMemoryManager); } // fragment - starts with # if (testChar == chPound) { index++; start = index; while (index < end) { testChar = uriSpec[index]; if (testChar == chPercent) { if (index + 2 >= end) { XMLCh value1[3]; value1[1] = chNull; value1[2] = chNull; XMLString::moveChars(value1, &(uriSpec[index]), (index + 1 >= end ? 1 : 2)); ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_EscapeSequence , errMsg_FRAGMENT , value1 , fMemoryManager); } if (!XMLString::isHex(uriSpec[index+1]) || !XMLString::isHex(uriSpec[index+2])) { XMLCh value1[4]; XMLString::moveChars(value1, &(uriSpec[index]), 3); value1[3] = chNull; ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_EscapeSequence , errMsg_FRAGMENT , value1 , fMemoryManager); } } else if (!isReservedOrUnreservedCharacter(testChar)) { XMLCh value1[2]; value1[0] = testChar; value1[1] = chNull; ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_Char , errMsg_FRAGMENT , value1 , fMemoryManager); } index++; } if (getFragment()) fMemoryManager->deallocate(fFragment);//delete [] fFragment; //make sure that there is something following the '#' if (index > start) { fFragment = (XMLCh*) fMemoryManager->allocate ( (index - start + 1) * sizeof(XMLCh) );//new XMLCh[index - start + 1]; XMLString::subString(fFragment, uriSpec, start, index, fMemoryManager); } else { // RFC 2396, 4.0. URI Reference // URI-reference = [absoulteURI | relativeURI] [# fragment] // // RFC 2396, 4.1. Fragment Identifier // fragment = *uric // // empty fragment is valid fFragment = 0; } } } // --------------------------------------------------------------------------- // Setter // --------------------------------------------------------------------------- void XMLUri::setScheme(const XMLCh* const newScheme) { if ( !newScheme ) { ThrowXMLwithMemMgr1(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Set_Null , errMsg_SCHEME , fMemoryManager); } if (!isConformantSchemeName(newScheme)) { ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Not_Conformant , errMsg_SCHEME , newScheme , fMemoryManager); } if (getScheme()) { fMemoryManager->deallocate(fScheme);//delete [] fScheme; } fScheme = XMLString::replicate(newScheme, fMemoryManager); XMLString::lowerCase(fScheme); } // // server = [ [ userinfo "@" ] hostport ] // hostport = host [":" port] // // setUserInfo(), setHost() and setPort() are closely related // three methods, in a word, userinfo and port has dependency // on host. // // if host is not present, userinfo must be null and port = -1 // void XMLUri::setUserInfo(const XMLCh* const newUserInfo) { if ( newUserInfo && !getHost() ) { ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_NullHost , errMsg_USERINFO , newUserInfo , fMemoryManager); } isConformantUserInfo(newUserInfo, fMemoryManager); if (getUserInfo()) { fMemoryManager->deallocate(fUserInfo);//delete [] fUserInfo; } //sometimes we get passed a empty string rather than a null. //Other procedures rely on it being null if(newUserInfo && *newUserInfo) { fUserInfo = XMLString::replicate(newUserInfo, fMemoryManager); } else fUserInfo = 0; } void XMLUri::setHost(const XMLCh* const newHost) { if ( !newHost ) { if (getHost()) fMemoryManager->deallocate(fHost);//delete [] fHost; fHost = 0; setUserInfo(0); setPort(-1); return; } if ( *newHost && !isWellFormedAddress(newHost, fMemoryManager)) { ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Not_Conformant , errMsg_HOST , newHost , fMemoryManager); } if (getHost()) { fMemoryManager->deallocate(fHost);//delete [] fHost; } fHost = XMLString::replicate(newHost, fMemoryManager); setRegBasedAuthority(0); } void XMLUri::setPort(int newPort) { if (newPort >= 0 && newPort <= 65535) { if (!getHost()) { XMLCh value1[BUF_LEN+1]; XMLString::binToText(newPort, value1, BUF_LEN, 10, fMemoryManager); ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_NullHost , errMsg_PORT , value1 , fMemoryManager); } } else if (newPort != -1) { XMLCh value1[BUF_LEN+1]; XMLString::binToText(newPort, value1, BUF_LEN, 10, fMemoryManager); ThrowXMLwithMemMgr1(MalformedURLException , XMLExcepts::XMLNUM_URI_PortNo_Invalid , value1 , fMemoryManager); } fPort = newPort; } void XMLUri::setRegBasedAuthority(const XMLCh* const newRegAuth) { if ( !newRegAuth ) { if (getRegBasedAuthority()) fMemoryManager->deallocate(fRegAuth);//delete [] fRegAuth; fRegAuth = 0; return; } // reg_name = 1*( unreserved | escaped | "$" | "," | // ";" | ":" | "@" | "&" | "=" | "+" ) else if ( !*newRegAuth || !isValidRegistryBasedAuthority(newRegAuth) ) { ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Not_Conformant , errMsg_REGNAME , newRegAuth , fMemoryManager); } if (getRegBasedAuthority()) fMemoryManager->deallocate(fRegAuth);//delete [] fRegAuth; fRegAuth = XMLString::replicate(newRegAuth, fMemoryManager); setHost(0); } // // setPath(), setQueryString() and setFragment() are closely // related three methods as well. // void XMLUri::setPath(const XMLCh* const newPath) { if (!newPath) { if (getPath()) fMemoryManager->deallocate(fPath);//delete [] fPath; fPath = 0; setQueryString(0); setFragment(0); } else { initializePath(newPath); } } // // fragment = *uric // void XMLUri::setFragment(const XMLCh* const newFragment) { if ( !newFragment ) { if (getFragment()) fMemoryManager->deallocate(fFragment);//delete [] fFragment; fFragment = 0; } else if (!isGenericURI()) { ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_for_GenURI_Only , errMsg_FRAGMENT , newFragment , fMemoryManager); } else if ( !getPath() ) { ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_NullPath , errMsg_FRAGMENT , newFragment , fMemoryManager); } else if (!isURIString(newFragment)) { ThrowXMLwithMemMgr1(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_Char , errMsg_FRAGMENT , fMemoryManager); } else { if (getFragment()) { fMemoryManager->deallocate(fFragment);//delete [] fFragment; } fFragment = XMLString::replicate(newFragment, fMemoryManager); } } // // query = *uric // void XMLUri::setQueryString(const XMLCh* const newQueryString) { if ( !newQueryString ) { if (getQueryString()) fMemoryManager->deallocate(fQueryString);//delete [] fQueryString; fQueryString = 0; } else if (!isGenericURI()) { ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_for_GenURI_Only , errMsg_QUERY , newQueryString , fMemoryManager); } else if ( !getPath() ) { ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_NullPath , errMsg_QUERY , newQueryString , fMemoryManager); } else if (!isURIString(newQueryString)) { ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_Char , errMsg_QUERY , newQueryString , fMemoryManager); } else { if (getQueryString()) { fMemoryManager->deallocate(fQueryString);//delete [] fQueryString; } fQueryString = XMLString::replicate(newQueryString, fMemoryManager); } } // --------------------------------------------------------------------------- // XMLUri: Public, static methods // --------------------------------------------------------------------------- // // scheme = alpha *( alpha | digit | "+" | "-" | "." ) // alphanum = alpha | digit // bool XMLUri::isConformantSchemeName(const XMLCh* const scheme) { if ( !scheme ) return false; const XMLCh* tmpStr = scheme; if (!XMLString::isAlpha(*tmpStr)) // first: alpha return false; // second onwards: ( alpha | digit | "+" | "-" | "." ) tmpStr++; while (*tmpStr) { if ( !XMLString::isAlphaNum(*tmpStr) && (XMLString::indexOf(SCHEME_CHARACTERS, *tmpStr) == -1)) return false; tmpStr++; } return true; } // // userinfo = *( unreserved | escaped | // ";" | ":" | "&" | "=" | "+" | "$" | "," ) // void XMLUri::isConformantUserInfo(const XMLCh* const userInfo , MemoryManager* const manager) { if ( !userInfo ) return; const XMLCh* tmpStr = userInfo; while (*tmpStr) { if ( isUnreservedCharacter(*tmpStr) || (XMLString::indexOf(USERINFO_CHARACTERS, *tmpStr) != -1)) { tmpStr++; } else if (*tmpStr == chPercent) // '%' { if (XMLString::stringLen(tmpStr) >= 3 && XMLString::isHex(*(tmpStr+1)) // 1st hex && XMLString::isHex(*(tmpStr+2)) ) // 2nd hex { tmpStr+=3; } else { XMLCh value1[4]; value1[0] = chPercent; value1[1] = *(tmpStr+1); value1[2] = *(tmpStr+2); value1[3] = chNull; ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_EscapeSequence , errMsg_USERINFO , value1 , manager); } } else { ThrowXMLwithMemMgr2(MalformedURLException , XMLExcepts::XMLNUM_URI_Component_Invalid_Char , errMsg_USERINFO , userInfo , manager); } } //while return; } bool XMLUri::isValidServerBasedAuthority(const XMLCh* const host, const XMLSize_t hostLen, const int port, const XMLCh* const userinfo, const XMLSize_t userLen) { // The order is important, do not change if (!isWellFormedAddress(host, hostLen)) return false; // check port number if ((port > 65535) || (port < 0 && port != -1)) return false; // check userinfo XMLSize_t index = 0; while (index < userLen) { if (isUnreservedCharacter(userinfo[index]) || (XMLString::indexOf(USERINFO_CHARACTERS, userinfo[index]) != -1)) { index++; } else if (userinfo[index] == chPercent) // '%' { if (index + 2 < userLen && XMLString::isHex(userinfo[index+1]) // 1st hex && XMLString::isHex(userinfo[index+2]) ) // 2nd hex index +=3; else return false; } else return false; } //while return true; } bool XMLUri::isValidServerBasedAuthority(const XMLCh* const host , const int port , const XMLCh* const userinfo , MemoryManager* const manager) { // The order is important, do not change if (!isWellFormedAddress(host, manager)) return false; // check port number if ((port > 65535) || (port < 0 && port != -1)) return false; // check userinfo if (!userinfo) return true; const XMLCh* tmpStr = userinfo; while (*tmpStr) { if ( isUnreservedCharacter(*tmpStr) || (XMLString::indexOf(USERINFO_CHARACTERS, *tmpStr) != -1)) { tmpStr++; } else if (*tmpStr == chPercent) // '%' { if (XMLString::stringLen(tmpStr) >= 3 && XMLString::isHex(*(tmpStr+1)) // 1st hex && XMLString::isHex(*(tmpStr+2)) ) // 2nd hex { tmpStr+=3; } else return false; } else return false; } //while return true; } bool XMLUri::isValidRegistryBasedAuthority(const XMLCh* const authority, const XMLSize_t authLen) { // check authority XMLSize_t index = 0; while (index < authLen) { if (isUnreservedCharacter(authority[index]) || (XMLString::indexOf(REG_NAME_CHARACTERS, authority[index]) != -1)) { index++; } else if (authority[index] == chPercent) // '%' { if (index + 2 < authLen && XMLString::isHex(authority[index+1]) // 1st hex && XMLString::isHex(authority[index+2]) ) // 2nd hex index +=3; else return false; } else return false; } //while return true; } bool XMLUri::isValidRegistryBasedAuthority(const XMLCh* const authority) { // check authority if (!authority) return false; const XMLCh* tmpStr = authority; while (*tmpStr) { if (isUnreservedCharacter(*tmpStr) || (XMLString::indexOf(REG_NAME_CHARACTERS, *tmpStr) != -1)) { tmpStr++; } else if (*tmpStr == chPercent) // '%' { if (XMLString::stringLen(tmpStr) >= 3 && XMLString::isHex(*(tmpStr + 1)) // 1st hex && XMLString::isHex(*(tmpStr + 2))) // 2nd hex { tmpStr+=3; } else return false; } else return false; } //while return true; } // // uric = reserved | unreserved | escaped // escaped = "%" hex hex // hex = digit | "A" | "B" | "C" | "D" | "E" | "F" | // "a" | "b" | "c" | "d" | "e" | "f" // bool XMLUri::isURIString(const XMLCh* const uricString) { if (!uricString || !*uricString) return false; const XMLCh* tmpStr = uricString; while (*tmpStr) { if (isReservedOrUnreservedCharacter(*tmpStr)) { tmpStr++; } else if (*tmpStr == chPercent) // '%' { if (XMLString::stringLen(tmpStr) >=3 && XMLString::isHex(*(tmpStr+1)) // 1st hex && XMLString::isHex(*(tmpStr+2)) ) // 2nd hex { tmpStr+=3; } else { return false; } } else { return false; } } return true; } // // host = hostname | IPv4address // // hostname = *( domainlabel "." ) toplabel [ "." ] // domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum // toplabel = alpha | alpha *( alphanum | "-" ) alphanum // // IPv4address = 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT // bool XMLUri::isWellFormedAddress(const XMLCh* const addrString , MemoryManager* const manager) { // Check that we have a non-zero length string. if (!addrString || !*addrString) return false; // Get address length. XMLSize_t addrStrLen = XMLString::stringLen(addrString); // Check if the host is a valid IPv6reference. if (*addrString == chOpenSquare) { return isWellFormedIPv6Reference(addrString, addrStrLen); } // // Cannot start with a '.', '-', or end with a '-'. // if (*addrString == chPeriod || *addrString == chDash || addrString[addrStrLen-1] == chDash) return false; // rightmost domain label starting with digit indicates IP address // since top level domain label can only start with an alpha // see RFC 2396 Section 3.2.2 int lastPeriodPos = XMLString::lastIndexOf(addrString, chPeriod); // if the string ends with "." // get the second last "." if (XMLSize_t(lastPeriodPos + 1) == addrStrLen) { XMLCh* tmp2 = (XMLCh*) manager->allocate ( addrStrLen * sizeof(XMLCh) );//new XMLCh[addrStrLen]; XMLString::subString(tmp2, addrString, 0, lastPeriodPos, manager); lastPeriodPos = XMLString::lastIndexOf(tmp2, chPeriod); manager->deallocate(tmp2);//delete [] tmp2; if ( XMLString::isDigit(addrString[lastPeriodPos + 1])) return false; } if (XMLString::isDigit(addrString[lastPeriodPos + 1])) { return isWellFormedIPv4Address(addrString, addrStrLen); } // end of IPv4address else { // // hostname = *( domainlabel "." ) toplabel [ "." ] // domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum // toplabel = alpha | alpha *( alphanum | "-" ) alphanum // RFC 2396 states that hostnames take the form described in // RFC 1034 (Section 3) and RFC 1123 (Section 2.1). According // to RFC 1034, hostnames are limited to 255 characters. if (addrStrLen > 255) { return false; } unsigned int labelCharCount = 0; // domain labels can contain alphanumerics and '-" // but must start and end with an alphanumeric for (XMLSize_t i = 0; i < addrStrLen; i++) { if (addrString[i] == chPeriod) { if (((i > 0) && (!XMLString::isAlphaNum(addrString[i-1]))) || ((i + 1 < addrStrLen) && (!XMLString::isAlphaNum(addrString[i+1]))) ) { return false; } labelCharCount = 0; } else if (!XMLString::isAlphaNum(addrString[i]) && addrString[i] != chDash) { return false; } // RFC 1034: Labels must be 63 characters or less. else if (++labelCharCount > 63) { return false; } } //for } return true; } // // RFC 2732 amended RFC 2396 by replacing the definition // of IPv4address with the one defined by RFC 2373. // // IPv4address = 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT // bool XMLUri::isWellFormedIPv4Address(const XMLCh* const addr, const XMLSize_t length) { int numDots = 0; int numDigits = 0; // IPv4address = 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT // // make sure that // 1) we see only digits and dot separators, // 2) that any dot separator is preceded and followed by a digit // 3) that we find 3 dots // 4) that each segment contains 1 to 3 digits. // 5) that each segment is not greater than 255. for (XMLSize_t i = 0; i < length; ++i) { if (addr[i] == chPeriod) { if ((i == 0) || (i+1 == length) || !XMLString::isDigit(addr[i+1])) { return false; } numDigits = 0; if (++numDots > 3) return false; } else if (!XMLString::isDigit(addr[i])) { return false; } // Check that that there are no more than three digits // in this segment. else if (++numDigits > 3) { return false; } // Check that this segment is not greater than 255. else if (numDigits == 3) { XMLCh first = addr[i-2]; XMLCh second = addr[i-1]; XMLCh last = addr[i]; if (!(first < chDigit_2 || (first == chDigit_2 && (second < chDigit_5 || (second == chDigit_5 && last <= chDigit_5))))) { return false; } } } //for return (numDots == 3); } // // IPv6reference = "[" IPv6address "]" // bool XMLUri::isWellFormedIPv6Reference(const XMLCh* const addr, const XMLSize_t length) { XMLSize_t end = length-1; // Check if string is a potential match for IPv6reference. if (!(length > 2 && addr[0] == chOpenSquare && addr[end] == chCloseSquare)) { return false; } // Counter for the number of 16-bit sections read in the address. int counter = 0; // Scan hex sequence before possible '::' or IPv4 address. int iIndex = scanHexSequence(addr, 1, end, counter); if (iIndex == -1) return false; XMLSize_t index=(XMLSize_t)iIndex; // Address must contain 128-bits of information. if (index == end) { return (counter == 8); } if (index+1 < end && addr[index] == chColon) { if (addr[index+1] == chColon) { // '::' represents at least one 16-bit group of zeros. if (++counter > 8) { return false; } index += 2; // Trailing zeros will fill out the rest of the address. if (index == end) { return true; } } // If the second character wasn't ':', in order to be valid, // the remainder of the string must match IPv4Address, // and we must have read exactly 6 16-bit groups. else { if (counter == 6) return isWellFormedIPv4Address(addr+index+1, end-index-1); else return false; } } else { return false; } // 3. Scan hex sequence after '::'. int prevCount = counter; iIndex = scanHexSequence(addr, index, end, counter); if (iIndex == -1) return false; index=(XMLSize_t)iIndex; // If this is the end of the address then // we've got 128-bits of information. if (index == end) { return true; } // The address ends in an IPv4 address, or it is invalid. // scanHexSequence has already made sure that we have the right number of bits. XMLSize_t shiftCount = (counter > prevCount) ? index+1 : index; return isWellFormedIPv4Address(addr + shiftCount, end - shiftCount); } // // For use with isWellFormedIPv6Reference only. // int XMLUri::scanHexSequence (const XMLCh* const addr, XMLSize_t index, XMLSize_t end, int& counter) { XMLCh testChar = chNull; int numDigits = 0; XMLSize_t start = index; // Trying to match the following productions: // hexseq = hex4 *( ":" hex4) // hex4 = 1*4HEXDIG for (; index < end; ++index) { testChar = addr[index]; if (testChar == chColon) { // IPv6 addresses are 128-bit, so there can be at most eight sections. if (numDigits > 0 && ++counter > 8) { return -1; } // This could be '::'. if (numDigits == 0 || ((index+1 < end) && addr[index+1] == chColon)) { return (int)index; } numDigits = 0; } // This might be invalid or an IPv4address. If it's potentially an IPv4address, // backup to just after the last valid character that matches hexseq. else if (!XMLString::isHex(testChar)) { if (testChar == chPeriod && numDigits < 4 && numDigits > 0 && counter <= 6) { int back = (int)index - numDigits - 1; return (back >= (int)start) ? back : (int)start; } return -1; } // There can be at most 4 hex digits per group. else if (++numDigits > 4) { return -1; } } return (numDigits > 0 && ++counter <= 8) ? (int)end : -1; } bool XMLUri::isGenericURI() { return (getHost() != 0); } // // This method will take the broken out parts of the URI and build up the // full text. We don't do this unless someone asks us to, since its often // never required. // void XMLUri::buildFullText() { // Calculate the worst case size of the buffer required XMLSize_t bufSize = XMLString::stringLen(fScheme) + 1 + XMLString::stringLen(fFragment) + 1 + XMLString::stringLen(fHost ? fHost : fRegAuth) + 2 + XMLString::stringLen(fPath) + XMLString::stringLen(fQueryString) + 1 + XMLString::stringLen(fUserInfo) + 1 + 32; // Clean up the existing buffer and allocate another fMemoryManager->deallocate(fURIText);//delete [] fURIText; fURIText = (XMLCh*) fMemoryManager->allocate(bufSize * sizeof(XMLCh));//new XMLCh[bufSize]; *fURIText = 0; XMLCh* outPtr = fURIText; if (fScheme != 0) { XMLString::catString(fURIText, getScheme()); outPtr += XMLString::stringLen(fURIText); *outPtr++ = chColon; } // Authority if (fHost || fRegAuth) { *outPtr++ = chForwardSlash; *outPtr++ = chForwardSlash; // Server based authority. if (fHost) { if (fUserInfo) { XMLString::copyString(outPtr, fUserInfo); outPtr += XMLString::stringLen(fUserInfo); *outPtr++ = chAt; } XMLString::copyString(outPtr, fHost); outPtr += XMLString::stringLen(fHost); // // If the port is -1, then we don't put it in. Else we need // to because it was explicitly provided. // if (fPort != -1) { *outPtr++ = chColon; XMLCh tmpBuf[17]; XMLString::binToText(fPort, tmpBuf, 16, 10, fMemoryManager); XMLString::copyString(outPtr, tmpBuf); outPtr += XMLString::stringLen(tmpBuf); } } // Registry based authority. else { XMLString::copyString(outPtr, fRegAuth); outPtr += XMLString::stringLen(fRegAuth); } } if (fPath) { XMLString::copyString(outPtr, fPath); outPtr += XMLString::stringLen(fPath); } if (fQueryString) { *outPtr++ = chQuestion; XMLString::copyString(outPtr, fQueryString); outPtr += XMLString::stringLen(fQueryString); } if (fFragment) { *outPtr++ = chPound; XMLString::copyString(outPtr, fFragment); outPtr += XMLString::stringLen(fFragment); } // Cap it off in case the last op was not a string copy *outPtr = 0; } // NOTE: no check for NULL value of uriStr (caller responsiblilty) bool XMLUri::isValidURI(const XMLUri* const baseURI , const XMLCh* const uriStr , bool bAllowSpaces/*=false*/) { // get a trimmed version of uriStr // uriStr will NO LONGER be used in this function. const XMLCh* trimmedUriSpec = uriStr; while (XMLChar1_0::isWhitespace(*trimmedUriSpec)) trimmedUriSpec++; XMLSize_t trimmedUriSpecLen = XMLString::stringLen(trimmedUriSpec); while (trimmedUriSpecLen) { if (XMLChar1_0::isWhitespace(trimmedUriSpec[trimmedUriSpecLen-1])) trimmedUriSpecLen--; else break; } if (trimmedUriSpecLen == 0) { if (!baseURI) return false; else return true; } XMLSize_t index = 0; bool foundScheme = false; // Check for scheme, which must be before `/', '?' or '#'. int colonIdx = XMLString::indexOf(trimmedUriSpec, chColon); int slashIdx = XMLString::indexOf(trimmedUriSpec, chForwardSlash); int queryIdx = XMLString::indexOf(trimmedUriSpec, chQuestion); int fragmentIdx = XMLString::indexOf(trimmedUriSpec, chPound); if ((colonIdx <= 0) || (colonIdx > slashIdx && slashIdx != -1) || (colonIdx > queryIdx && queryIdx != -1) || (colonIdx > fragmentIdx && fragmentIdx != -1)) { // A standalone base is a valid URI according to spec if (colonIdx == 0 || (!baseURI && fragmentIdx != 0)) return false; } else { if (!processScheme(trimmedUriSpec, index)) return false; foundScheme = true; ++index; } // It's an error if we stop here if (index == trimmedUriSpecLen || (foundScheme && (trimmedUriSpec[index] == chPound))) return false; // two slashes means generic URI syntax, so we get the authority const XMLCh* authUriSpec = trimmedUriSpec + index; if (((index+1) < trimmedUriSpecLen) && XMLString::startsWith(authUriSpec, DOUBLE_SLASH)) { index += 2; XMLSize_t startPos = index; // get authority - everything up to path, query or fragment XMLCh testChar; while (index < trimmedUriSpecLen) { testChar = trimmedUriSpec[index]; if (testChar == chForwardSlash || testChar == chQuestion || testChar == chPound ) { break; } index++; } // if we found authority, parse it out, otherwise we set the // host to empty string if (index > startPos) { if (!processAuthority(trimmedUriSpec + startPos, index - startPos)) return false; } } // we need to check if index has exceed the lenght or not if (index < trimmedUriSpecLen) { if (!processPath(trimmedUriSpec + index, trimmedUriSpecLen - index, foundScheme, bAllowSpaces)) return false; } return true; } // NOTE: no check for NULL value of uriStr (caller responsiblilty) // NOTE: this routine is the same as above, but it uses a flag to // indicate the existance of a baseURI rather than an XMLuri. bool XMLUri::isValidURI(bool haveBaseURI, const XMLCh* const uriStr, bool bAllowSpaces/*=false*/) { // get a trimmed version of uriStr // uriStr will NO LONGER be used in this function. const XMLCh* trimmedUriSpec = uriStr; while (XMLChar1_0::isWhitespace(*trimmedUriSpec)) trimmedUriSpec++; XMLSize_t trimmedUriSpecLen = XMLString::stringLen(trimmedUriSpec); while (trimmedUriSpecLen) { if (XMLChar1_0::isWhitespace(trimmedUriSpec[trimmedUriSpecLen-1])) trimmedUriSpecLen--; else break; } if (trimmedUriSpecLen == 0) { if (!haveBaseURI) return false; return true; } XMLSize_t index = 0; bool foundScheme = false; // Check for scheme, which must be before `/', '?' or '#'. int colonIdx = XMLString::indexOf(trimmedUriSpec, chColon); int slashIdx = XMLString::indexOf(trimmedUriSpec, chForwardSlash); int queryIdx = XMLString::indexOf(trimmedUriSpec, chQuestion); int fragmentIdx = XMLString::indexOf(trimmedUriSpec, chPound); if ((colonIdx <= 0) || (colonIdx > slashIdx && slashIdx != -1) || (colonIdx > queryIdx && queryIdx != -1) || (colonIdx > fragmentIdx && fragmentIdx != -1)) { // A standalone base is a valid URI according to spec if (colonIdx == 0 || (!haveBaseURI && fragmentIdx != 0)) return false; } else { if (!processScheme(trimmedUriSpec, index)) return false; foundScheme = true; ++index; } // It's an error if we stop here if (index == trimmedUriSpecLen || (foundScheme && (trimmedUriSpec[index] == chPound))) return false; // two slashes means generic URI syntax, so we get the authority const XMLCh* authUriSpec = trimmedUriSpec + index; if (((index+1) < trimmedUriSpecLen) && XMLString::startsWith(authUriSpec, DOUBLE_SLASH)) { index += 2; XMLSize_t startPos = index; // get authority - everything up to path, query or fragment XMLCh testChar; while (index < trimmedUriSpecLen) { testChar = trimmedUriSpec[index]; if (testChar == chForwardSlash || testChar == chQuestion || testChar == chPound ) { break; } index++; } // if we found authority, parse it out, otherwise we set the // host to empty string if (index > startPos) { if (!processAuthority(trimmedUriSpec + startPos, index - startPos)) return false; } } // we need to check if index has exceed the length or not if (index < trimmedUriSpecLen) { if (!processPath(trimmedUriSpec + index, trimmedUriSpecLen - index, foundScheme, bAllowSpaces)) return false; } return true; } bool XMLUri::isWellFormedAddress(const XMLCh* const addrString, const XMLSize_t addrStrLen) { // Check that we have a non-zero length string. if (addrStrLen == 0) return false; // Check if the host is a valid IPv6reference. if (*addrString == chOpenSquare) { return isWellFormedIPv6Reference(addrString, addrStrLen); } // // Cannot start with a '.', '-', or end with a '-'. // if (*addrString == chPeriod || *addrString == chDash || addrString[addrStrLen-1] == chDash) return false; // rightmost domain label starting with digit indicates IP address // since top level domain label can only start with an alpha // see RFC 2396 Section 3.2.2 int lastPeriodPos = XMLString::lastIndexOf(chPeriod, addrString, addrStrLen); // if the string ends with "." // get the second last "." if (XMLSize_t(lastPeriodPos + 1) == addrStrLen) { lastPeriodPos = XMLString::lastIndexOf(chPeriod, addrString, lastPeriodPos); if ( XMLString::isDigit(addrString[lastPeriodPos + 1])) return false; } if (XMLString::isDigit(addrString[lastPeriodPos + 1])) { return isWellFormedIPv4Address(addrString, addrStrLen); } // end of IPv4address else { // // hostname = *( domainlabel "." ) toplabel [ "." ] // domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum // toplabel = alpha | alpha *( alphanum | "-" ) alphanum // RFC 2396 states that hostnames take the form described in // RFC 1034 (Section 3) and RFC 1123 (Section 2.1). According // to RFC 1034, hostnames are limited to 255 characters. if (addrStrLen > 255) { return false; } unsigned int labelCharCount = 0; // domain labels can contain alphanumerics and '-" // but must start and end with an alphanumeric for (XMLSize_t i = 0; i < addrStrLen; i++) { if (addrString[i] == chPeriod) { if (((i > 0) && (!XMLString::isAlphaNum(addrString[i-1]))) || ((i + 1 < addrStrLen) && (!XMLString::isAlphaNum(addrString[i+1]))) ) { return false; } labelCharCount = 0; } else if (!XMLString::isAlphaNum(addrString[i]) && addrString[i] != chDash) { return false; } // RFC 1034: Labels must be 63 characters or less. else if (++labelCharCount > 63) { return false; } } //for } return true; } bool XMLUri::processScheme(const XMLCh* const schemeStr, XMLSize_t& index) { const XMLCh* tmpPtr = XMLString::findAny(schemeStr, SCHEME_SEPARATORS); if (tmpPtr) { index = tmpPtr - schemeStr; return isConformantSchemeName(schemeStr, index); } else { return false; } } bool XMLUri::isConformantSchemeName( const XMLCh* const scheme , const XMLSize_t schemeLen) { if (!XMLString::isAlpha(*scheme)) // first: alpha return false; // second onwards: ( alpha | digit | "+" | "-" | "." ) for (XMLSize_t i=1; i= authLen) index = -1; } host = &(authSpec[start]); if (index != -1) { hostLen = index; start += index + 1; // skip the : } else { hostLen = authLen - start; start = authLen; } // port is everything after ":" int port = -1; if ((hostLen) && // non empty host (index != -1) && // ":" found (start < authLen) ) // ":" is not the last { const XMLCh* portStr = &(authSpec[start]); if (*portStr) { port = 0; for (XMLSize_t i=0; i<(authLen - start); i++) { if (portStr[i] < chDigit_0 || portStr[i] > chDigit_9) { // Assume this is a registry-based authority. // port = -1; hostLen = 0; host = XMLUni::fgZeroLenString; userInfoLen = 0; userinfo = XMLUni::fgZeroLenString; break; } port = (port * 10) + (int) (portStr[i] - chDigit_0); } } } return isValidServerBasedAuthority(host, hostLen, port, userinfo, userInfoLen) || isValidRegistryBasedAuthority(authSpec, authLen); } bool XMLUri::processPath(const XMLCh* const pathStr, const XMLSize_t pathStrLen, const bool isSchemePresent, const bool bAllowSpaces/*=false*/) { if (pathStrLen != 0) { XMLSize_t index = 0; XMLCh testChar = chNull; bool isOpaque = (!isSchemePresent || *pathStr == chForwardSlash); // path - everything up to query string or fragment // // RFC 2732 only allows '[' and ']' to appear in the opaque part. while (index < pathStrLen) { testChar = pathStr[index]; if (testChar == chQuestion || testChar == chPound) break; if (testChar == chPercent) { if (index+2 >= pathStrLen || !XMLString::isHex(pathStr[index+1]) || !XMLString::isHex(pathStr[index+2])) return false; } else if (testChar==chSpace) { if(!bAllowSpaces) return false; } else if (!isUnreservedCharacter(testChar) && ((isOpaque && !isPathCharacter(testChar)) || (!isOpaque && !isReservedCharacter(testChar)))) { return false; } index++; } // query - starts with ? and up to fragment or end // fragment - starts with # bool isQuery = (testChar == chQuestion); if (isQuery || testChar == chPound) { index++; while (index < pathStrLen) { testChar = pathStr[index]; if (testChar == chPound && isQuery) { isQuery = false; index++; continue; } if (testChar == chPercent) { if (index+2 >= pathStrLen || !XMLString::isHex(pathStr[index+1]) || !XMLString::isHex(pathStr[index+2])) return false; } else if (testChar==chSpace) { if(!bAllowSpaces) return false; } else if (!isReservedOrUnreservedCharacter(testChar)) { return false; } index++; } } } //if (pathStrLen...) return true; } /*** * [Bug7698]: filenames with embedded spaces in schemaLocation strings not handled properly * * This method is called when Scanner/TraverseSchema knows that the URI reference is * for local file. * ***/ void XMLUri::normalizeURI(const XMLCh* const systemURI, XMLBuffer& normalizedURI) { const XMLCh* pszSrc = systemURI; normalizedURI.reset(); while (*pszSrc) { if ((*(pszSrc) == chPercent) && (*(pszSrc+1) == chDigit_2) && (*(pszSrc+2) == chDigit_0)) { pszSrc += 3; normalizedURI.append(chSpace); } else { normalizedURI.append(*pszSrc); pszSrc++; } } } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(XMLUri) void XMLUri::serialize(XSerializeEngine& serEng) { if (serEng.isStoring()) { serEng<>fPort; serEng.readString(fScheme); serEng.readString(fUserInfo); serEng.readString(fHost); serEng.readString(fRegAuth); serEng.readString(fPath); serEng.readString(fQueryString); serEng.readString(fFragment); serEng.readString(fURIText); } } XMLUri::XMLUri(MemoryManager* const manager) : fPort(-1) , fScheme(0) , fUserInfo(0) , fHost(0) , fRegAuth(0) , fPath(0) , fQueryString(0) , fFragment(0) , fURIText(0) , fMemoryManager(manager) { } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLFileMgr.hpp000644 000765 000024 00000005036 13241160336 021665 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLFileMgr.hpp 527149 2007-04-10 14:56:39Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLFILEMGR_HPP) #define XERCESC_INCLUDE_GUARD_XMLFILEMGR_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN typedef void* FileHandle; #define XERCES_Invalid_File_Handle 0 // Abstract class for files. This is be used to allow multiple file handling implementations. class XMLFileMgr : public XMemory { public: XMLFileMgr() {} virtual ~XMLFileMgr() {} // File access virtual FileHandle fileOpen(const XMLCh* path, bool toWrite, MemoryManager* const manager) = 0; virtual FileHandle fileOpen(const char* path, bool toWrite, MemoryManager* const manager) = 0; virtual FileHandle openStdIn(MemoryManager* const manager) = 0; virtual void fileClose(FileHandle f, MemoryManager* const manager) = 0; virtual void fileReset(FileHandle f, MemoryManager* const manager) = 0; virtual XMLFilePos curPos(FileHandle f, MemoryManager* const manager) = 0; virtual XMLFilePos fileSize(FileHandle f, MemoryManager* const manager) = 0; virtual XMLSize_t fileRead(FileHandle f, XMLSize_t byteCount, XMLByte* buffer, MemoryManager* const manager) = 0; virtual void fileWrite(FileHandle f, XMLSize_t byteCount, const XMLByte* buffer, MemoryManager* const manager) = 0; // Ancillary path handling routines virtual XMLCh* getFullPath(const XMLCh* const srcPath, MemoryManager* const manager) = 0; virtual XMLCh* getCurrentDirectory(MemoryManager* const manager) = 0; virtual bool isRelative(const XMLCh* const toCheck, MemoryManager* const manager) = 0; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/ValueStackOf.c000644 000765 000024 00000010562 13241160336 021741 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ValueStackOf.c 676911 2008-07-15 13:27:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #if defined(XERCES_TMPLSINC) #include #endif XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // ValueStackOf: Constructors and Destructor // --------------------------------------------------------------------------- template ValueStackOf::ValueStackOf(const XMLSize_t fInitCapacity, MemoryManager* const manager, const bool toCallDestructor) : fVector(fInitCapacity, manager, toCallDestructor) { } template ValueStackOf::~ValueStackOf() { } // --------------------------------------------------------------------------- // ValueStackOf: Element management methods // --------------------------------------------------------------------------- template void ValueStackOf::push(const TElem& toPush) { fVector.addElement(toPush); } template const TElem& ValueStackOf::peek() const { const XMLSize_t curSize = fVector.size(); if (curSize == 0) ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::Stack_EmptyStack, fVector.getMemoryManager()); return fVector.elementAt(curSize-1); } template TElem ValueStackOf::pop() { const XMLSize_t curSize = fVector.size(); if (curSize == 0) ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::Stack_EmptyStack, fVector.getMemoryManager()); TElem retVal = fVector.elementAt(curSize-1); fVector.removeElementAt(curSize-1); return retVal; } template void ValueStackOf::removeAllElements() { fVector.removeAllElements(); } // --------------------------------------------------------------------------- // ValueStackOf: Getter methods // --------------------------------------------------------------------------- template bool ValueStackOf::empty() { return (fVector.size() == 0); } template XMLSize_t ValueStackOf::curCapacity() { return fVector.curCapacity(); } template XMLSize_t ValueStackOf::size() { return fVector.size(); } // --------------------------------------------------------------------------- // ValueStackEnumerator: Constructors and Destructor // --------------------------------------------------------------------------- template ValueStackEnumerator:: ValueStackEnumerator( ValueStackOf* const toEnum , const bool adopt) : fAdopted(adopt) , fCurIndex(0) , fToEnum(toEnum) , fVector(&toEnum->fVector) { } template ValueStackEnumerator::~ValueStackEnumerator() { if (fAdopted) delete fToEnum; } // --------------------------------------------------------------------------- // ValueStackEnumerator: Enum interface // --------------------------------------------------------------------------- template bool ValueStackEnumerator::hasMoreElements() const { if (fCurIndex >= fVector->size()) return false; return true; } template TElem& ValueStackEnumerator::nextElement() { return fVector->elementAt(fCurIndex++); } template void ValueStackEnumerator::Reset() { fCurIndex = 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLIBM1140Transcoder.hpp000644 000765 000024 00000005164 13241160335 023303 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLIBM1140Transcoder.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLIBM1140TRANSCODER_HPP) #define XERCESC_INCLUDE_GUARD_XMLIBM1140TRANSCODER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN // // This class provides an implementation of the XMLTranscoder interface // for a simple IBM-1140 transcoder. The parser does some encodings // intrinsically without depending upon external transcoding services. // To make everything more orthogonal, we implement these internal // transcoders using the same transcoder abstraction as the pluggable // transcoding services do. // class XMLUTIL_EXPORT XMLIBM1140Transcoder : public XML256TableTranscoder { public : // ----------------------------------------------------------------------- // Public, static methods // ----------------------------------------------------------------------- static XMLCh xlatThisOne(const XMLByte toXlat); // ----------------------------------------------------------------------- // Public constructors and destructor // ----------------------------------------------------------------------- XMLIBM1140Transcoder ( const XMLCh* const encodingName , const XMLSize_t blockSize , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~XMLIBM1140Transcoder(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLIBM1140Transcoder(); XMLIBM1140Transcoder(const XMLIBM1140Transcoder&); XMLIBM1140Transcoder& operator=(const XMLIBM1140Transcoder&); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XercesVersion.hpp.cmake.in000644 000765 000024 00000021671 13242664434 024256 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id$ */ #if !defined(XERCESC_INCLUDE_GUARD_XERCESVERSION_HPP) #define XERCESC_INCLUDE_GUARD_XERCESVERSION_HPP // --------------------------------------------------------------------------- // 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 /** * User Documentation for Xerces Version Values: * * * * Xerces Notes: * * Xerces Committers Documentation: * * Xerces committers normally only need to modify one or two of the * following macros: * * XERCES_VERSION_MAJOR * XERCES_VERSION_MINOR * XERCES_VERSION_REVISION * * The integer values of these macros define the Xerces version number. All * other constants and preprocessor macros are automatically generated from * these three definitions. * * The macro XERCES_GRAMMAR_SERIALIZATION_LEVEL has been added so that during * development if users are using the latest code they can use the grammar * serialization/deserialization features. Whenever a change is made to the * serialization code this macro should be incremented. * * Xerces User Documentation: * * The following sections in the user documentation have examples based upon * the following three version input values: * * #define XERCES_VERSION_MAJOR 19 * #define XERCES_VERSION_MINOR 3 * #define XERCES_VERSION_REVISION 74 * * The minor and revision (patch level) numbers have two digits of resolution * which means that '3' becomes '03' in this example. This policy guarantees * that when using preprocessor macros, version 19.3.74 will be greater than * version 1.94.74 since the first will expand to 190374 and the second to * 19474. * * Preprocessor Macros: * * _XERCES_VERSION defines the primary preprocessor macro that users will * introduce into their code to perform conditional compilation where the * version of Xerces is detected in order to enable or disable version * specific capabilities. The value of _XERCES_VERSION for the above example * will be 190374. To use it a user would perform an operation such as the * following: * * #if _XERCES_VERSION >= 190374 * // code specific to new version of Xerces... * #else * // old code here... * #endif * * XERCES_FULLVERSIONSTR is a preprocessor macro that expands to a string * constant whose value, for the above example, will be "19_3_74". * * XERCES_FULLVERSIONDOT is a preprocessor macro that expands to a string * constant whose value, for the above example, will be "19.3.74". * * XERCES_VERSIONSTR is a preprocessor macro that expands to a string * constant whose value, for the above example, will be "19_3". This * particular macro is very dangerous if it were to be used for comparing * version numbers since ordering will not be guaranteed. * * Xerces_DLLVersionStr is a preprocessor macro that expands to a string * constant whose value, for the above example, will be "19_3_74". This * macro is provided for backwards compatibility to pre-1.7 versions of * Xerces. * * String Constants: * * gXercesVersionStr is a global string constant whose value corresponds to * the value "19_3" for the above example. * * gXercesFullVersionStr is a global string constant whose value corresponds * to the value "19_3_74" for the above example. * * Numeric Constants: * * gXercesMajVersion is a global integer constant whose value corresponds to * the major version number. For the above example its value will be 19. * * gXercesMinVersion is a global integer constant whose value corresponds to * the minor version number. For the above example its value will be 3. * * gXercesRevision is a global integer constant whose value corresponds to * the revision (patch) version number. For the above example its value will * be 74. * */ // --------------------------------------------------------------------------- // 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 /** * MODIFY THESE NUMERIC VALUES TO COINCIDE WITH XERCES VERSION * AND DO NOT MODIFY ANYTHING ELSE IN THIS VERSION HEADER FILE */ #define XERCES_VERSION_MAJOR @XERCES_VERSION_MAJOR@ #define XERCES_VERSION_MINOR @XERCES_VERSION_MINOR@ #define XERCES_VERSION_REVISION @XERCES_VERSION_REVISION@ /*** * * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 4 SchemaAttDef, SchemaElementDecl serialize fPSVIScope * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 5 XercesStep serializes the axis as an int * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 6 added fIsExternal to XMLEntityDecl * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 7 size of line/column fields has changed * ***/ #define XERCES_GRAMMAR_SERIALIZATION_LEVEL @XERCES_GRAMMAR_SERIALIZATION_LEVEL@ /** DO NOT MODIFY BELOW THIS LINE */ /** * MAGIC THAT AUTOMATICALLY GENERATES THE FOLLOWING: * * Xerces_DLLVersionStr, gXercesVersionStr, gXercesFullVersionStr, * gXercesMajVersion, gXercesMinVersion, gXercesRevision */ // --------------------------------------------------------------------------- // 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 // two argument concatenation routines #define CAT2_SEP_UNDERSCORE(a, b) #a "_" #b #define CAT2_SEP_PERIOD(a, b) #a "." #b #define CAT2_SEP_NIL(a, b) #a #b #define CAT2_RAW_NUMERIC(a, b) a ## b // two argument macro invokers #define INVK_CAT2_SEP_UNDERSCORE(a,b) CAT2_SEP_UNDERSCORE(a,b) #define INVK_CAT2_SEP_PERIOD(a,b) CAT2_SEP_PERIOD(a,b) #define INVK_CAT2_STR_SEP_NIL(a,b) CAT2_SEP_NIL(a,b) #define INVK_CAT2_RAW_NUMERIC(a,b) CAT2_RAW_NUMERIC(a,b) // --------------------------------------------------------------------------- // 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 // three argument concatenation routines #define CAT3_SEP_UNDERSCORE(a, b, c) #a "_" #b "_" #c #define CAT3_SEP_PERIOD(a, b, c) #a "." #b "." #c #define CAT3_SEP_NIL(a, b, c) #a #b #c #define CAT3_RAW_NUMERIC(a, b, c) a ## b ## c #define CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a, b, c) a ## _ ## b ## _ ## c // three argument macro invokers #define INVK_CAT3_SEP_UNDERSCORE(a,b,c) CAT3_SEP_UNDERSCORE(a,b,c) #define INVK_CAT3_SEP_PERIOD(a,b,c) CAT3_SEP_PERIOD(a,b,c) #define INVK_CAT3_SEP_NIL(a,b,c) CAT3_SEP_NIL(a,b,c) #define INVK_CAT3_RAW_NUMERIC(a,b,c) CAT3_RAW_NUMERIC(a,b,c) #define INVK_CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a,b,c) CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a,b,c) // --------------------------------------------------------------------------- // 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 #define MULTIPLY(factor,value) factor * value #define CALC_EXPANDED_FORM(a,b,c) ( MULTIPLY(10000,a) + MULTIPLY(100,b) + MULTIPLY(1,c) ) // --------------------------------------------------------------------------- // X E R C E S V E R S I O N I N F O R M A T I O N // Xerces version strings; these particular macros cannot be used for // conditional compilation as they are not numeric constants #define XERCES_FULLVERSIONSTR INVK_CAT3_SEP_UNDERSCORE(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION) #define XERCES_FULLVERSIONDOT INVK_CAT3_SEP_PERIOD(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION) #define XERCES_FULLVERSIONNUM INVK_CAT3_SEP_NIL(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION) #define XERCES_VERSIONSTR INVK_CAT2_SEP_UNDERSCORE(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR) // Xerces C++ Namespace string, concatenated with full version string #define XERCES_PRODUCT xercesc #define XERCES_CPP_NAMESPACE INVK_CAT3_RAW_NUMERIC_SEP_UNDERSCORE(XERCES_PRODUCT,XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR) // original from Xerces header #define Xerces_DLLVersionStr XERCES_FULLVERSIONSTR const char* const gXercesVersionStr = XERCES_VERSIONSTR; const char* const gXercesFullVersionStr = XERCES_FULLVERSIONSTR; const unsigned int gXercesMajVersion = XERCES_VERSION_MAJOR; const unsigned int gXercesMinVersion = XERCES_VERSION_MINOR; const unsigned int gXercesRevision = XERCES_VERSION_REVISION; // Xerces version numeric constants that can be used for conditional // compilation purposes. #define _XERCES_VERSION CALC_EXPANDED_FORM (XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION) #endif // XERCESVERSION_HPP xerces-c-3.2.2/src/xercesc/util/RefStackOf.hpp000644 000765 000024 00000012373 13241160336 021750 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: RefStackOf.hpp 676911 2008-07-15 13:27:32Z amassari $ */ #if !defined(XERCESC_INCLUDE_GUARD_REFSTACKOF_HPP) #define XERCESC_INCLUDE_GUARD_REFSTACKOF_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN // // Forward declare the enumerator so he can be our friend. Can you say // friend? Sure... // template class RefStackEnumerator; template class RefStackOf : public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- RefStackOf(const XMLSize_t initElems, const bool adoptElems = true, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~RefStackOf(); // ----------------------------------------------------------------------- // Element management methods // ----------------------------------------------------------------------- const TElem* elementAt(const XMLSize_t index) const; TElem* popAt(const XMLSize_t index); void push(TElem* const toPush); const TElem* peek() const; TElem* pop(); void removeAllElements(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- bool empty(); XMLSize_t curCapacity(); XMLSize_t size(); private : // ----------------------------------------------------------------------- // Declare our friends // ----------------------------------------------------------------------- friend class RefStackEnumerator; // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- RefStackOf(const RefStackOf&); RefStackOf& operator=(const RefStackOf&); // ----------------------------------------------------------------------- // Data Members // // fVector // The vector that is used as the backing data structure for the // stack. // ----------------------------------------------------------------------- RefVectorOf fVector; }; // // An enumerator for a value stack. It derives from the basic enumerator // class, so that value stacks can be generically enumerated. // template class RefStackEnumerator : public XMLEnumerator, public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- RefStackEnumerator ( RefStackOf* const toEnum , const bool adopt = false ); virtual ~RefStackEnumerator(); // ----------------------------------------------------------------------- // Enum interface // ----------------------------------------------------------------------- bool hasMoreElements() const; TElem& nextElement(); void Reset(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- RefStackEnumerator(const RefStackEnumerator&); RefStackEnumerator& operator=(const RefStackEnumerator&); // ----------------------------------------------------------------------- // Data Members // // fAdopted // Indicates whether we have adopted the passed stack. If so then // we delete the stack when we are destroyed. // // fCurIndex // This is the current index into the vector inside the stack being // enumerated. // // fToEnum // The stack that is being enumerated. This is just kept for // adoption purposes, since we really are enumerating the vector // inside of it. // ----------------------------------------------------------------------- bool fAdopted; XMLSize_t fCurIndex; RefVectorOf* fVector; RefStackOf* fToEnum; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/NameIdPool.hpp000644 000765 000024 00000017056 13241160335 021752 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: NameIdPool.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_NAMEIDPOOL_HPP) #define XERCESC_INCLUDE_GUARD_NAMEIDPOOL_HPP #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // // Forward declare the enumerator so he can be our friend. Can you say // friend? Sure... // template class NameIdPoolEnumerator; // // This class is provided to serve as the basis of many of the pools that // are used by the scanner and validators. They often need to be able to // store objects in such a way that they can be quickly accessed by the // name field of the object, and such that each element added is assigned // a unique id via which it can be accessed almost instantly. // // Object names are enforced as being unique, since that's what all these // pools require. So its effectively a hash table in conjunction with an // array of references into the hash table by id. Ids are assigned such that // id N can be used to get the Nth element from the array of references. // This provides very fast access by id. // // The way these pools are used, elements are never removed except when the // whole thing is flushed. This makes it very easy to maintain the two // access methods in sync. // // For efficiency reasons, the id reference array is never flushed until // the dtor. This way, it does not have to be regrown every time its reused. // // All elements are assumed to be owned by the pool! // template class NameIdPool : public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- NameIdPool ( const XMLSize_t hashModulus , const XMLSize_t initSize = 128 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); ~NameIdPool(); // ----------------------------------------------------------------------- // Element management // ----------------------------------------------------------------------- bool containsKey(const XMLCh* const key) const; void removeAll(); // ----------------------------------------------------------------------- // Getters // ----------------------------------------------------------------------- TElem* getByKey(const XMLCh* const key); const TElem* getByKey(const XMLCh* const key) const; TElem* getById(const XMLSize_t elemId); const TElem* getById(const XMLSize_t elemId) const; MemoryManager* getMemoryManager() const; // ----------------------------------------------------------------------- // Putters // // Dups are not allowed and cause an IllegalArgumentException. The id // of the new element is returned. // ----------------------------------------------------------------------- XMLSize_t put(TElem* const valueToAdopt); protected : // ----------------------------------------------------------------------- // Declare the enumerator our friend so he can see our members // ----------------------------------------------------------------------- friend class NameIdPoolEnumerator; private : // ----------------------------------------------------------------------- // Unused constructors and operators // ----------------------------------------------------------------------- NameIdPool(const NameIdPool&); NameIdPool& operator=(const NameIdPool&); // ----------------------------------------------------------------------- // Data members // // fBucketList // This is the hash table that contains the values. // // fIdPtrs // fIdPtrsCount // This is the array of pointers to the bucket elements in order of // their assigned ids. So taking id N and referencing this array // gives you the element with that id. The count field indicates // the current size of this list. When fIdCounter+1 reaches this // value the list must be expanded. // // fIdCounter // This is used to give out unique ids to added elements. It starts // at zero (which means empty), and is bumped up for each newly added // element. So the first element is 1, the next is 2, etc... This // means that this value is set to the top index of the fIdPtrs array. // // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; TElem** fIdPtrs; XMLSize_t fIdPtrsCount; XMLSize_t fIdCounter; RefHashTableOf fBucketList; }; // // An enumerator for a name id pool. It derives from the basic enumerator // class, so that pools can be generically enumerated. // template class NameIdPoolEnumerator : public XMLEnumerator, public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- NameIdPoolEnumerator ( NameIdPool* const toEnum , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); NameIdPoolEnumerator ( const NameIdPoolEnumerator& toCopy ); virtual ~NameIdPoolEnumerator(); // ----------------------------------------------------------------------- // Public operators // ----------------------------------------------------------------------- NameIdPoolEnumerator& operator= ( const NameIdPoolEnumerator& toAssign ); // ----------------------------------------------------------------------- // Enum interface // ----------------------------------------------------------------------- bool hasMoreElements() const; TElem& nextElement(); void Reset(); XMLSize_t size() const; private : // ----------------------------------------------------------------------- // Data Members // // fCurIndex // This is the current index into the pool's id mapping array. This // is now we enumerate it. // // fToEnum // The name id pool that is being enumerated. // ----------------------------------------------------------------------- XMLSize_t fCurIndex; NameIdPool* fToEnum; MemoryManager* fMemoryManager; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/XMLUCS4Transcoder.hpp000644 000765 000024 00000007145 13241160336 023106 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLUCS4Transcoder.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XMLUCS4TRANSCODER_HPP) #define XERCESC_INCLUDE_GUARD_XMLUCS4TRANSCODER_HPP #include #include XERCES_CPP_NAMESPACE_BEGIN // // This class provides an implementation of the XMLTranscoder interface // for a simple UCS4 transcoder. The parser does some encodings // intrinsically without depending upon external transcoding services. // To make everything more orthogonal, we implement these internal // transcoders using the same transcoder abstraction as the pluggable // transcoding services do. // class XMLUTIL_EXPORT XMLUCS4Transcoder : public XMLTranscoder { public : // ----------------------------------------------------------------------- // Public constructors and destructor // ----------------------------------------------------------------------- XMLUCS4Transcoder ( const XMLCh* const encodingName , const XMLSize_t blockSize , const bool swapped , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual ~XMLUCS4Transcoder(); // ----------------------------------------------------------------------- // Implementation of the XMLTranscoder interface // ----------------------------------------------------------------------- virtual XMLSize_t transcodeFrom ( const XMLByte* const srcData , const XMLSize_t srcCount , XMLCh* const toFill , const XMLSize_t maxChars , XMLSize_t& bytesEaten , unsigned char* const charSizes ); virtual XMLSize_t transcodeTo ( const XMLCh* const srcData , const XMLSize_t srcCount , XMLByte* const toFill , const XMLSize_t maxBytes , XMLSize_t& charsEaten , const UnRepOpts options ); virtual bool canTranscodeTo ( const unsigned int toCheck ); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLUCS4Transcoder(const XMLUCS4Transcoder&); XMLUCS4Transcoder& operator=(const XMLUCS4Transcoder&); // ----------------------------------------------------------------------- // Private data members // // fSwapped // This tells us if our input is going to be in the same endianness // as the local host or swapped. // ----------------------------------------------------------------------- bool fSwapped; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XMLBigDecimal.cpp000644 000765 000024 00000035031 13241160336 022311 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XMLBigDecimal.cpp 557254 2007-07-18 13:28:54Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN /** * Constructs a BigDecimal from a string containing an optional (plus | minus) * sign followed by a sequence of zero or more decimal digits, optionally * followed by a fraction, which consists of a decimal point followed by * zero or more decimal digits. The string must contain at least one * digit in the integer or fractional part. The scale of the resulting * BigDecimal will be the number of digits to the right of the decimal * point in the string, or 0 if the string contains no decimal point. * Any extraneous characters (including whitespace) will result in * a NumberFormatException. * since parseBigDecimal() may throw exception, * caller of XMLBigDecimal need to catch it. // **/ typedef JanitorMemFunCall CleanupType; XMLBigDecimal::XMLBigDecimal(const XMLCh* const strValue, MemoryManager* const manager) : fSign(0) , fTotalDigits(0) , fScale(0) , fRawDataLen(0) , fRawData(0) , fIntVal(0) , fMemoryManager(manager) { if ((!strValue) || (!*strValue)) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_emptyString, fMemoryManager); CleanupType cleanup(this, &XMLBigDecimal::cleanUp); try { fRawDataLen = XMLString::stringLen(strValue); fRawData = (XMLCh*) fMemoryManager->allocate ( ((fRawDataLen*2) + 2) * sizeof(XMLCh) //fRawData and fIntVal ); memcpy(fRawData, strValue, fRawDataLen * sizeof(XMLCh)); fRawData[fRawDataLen] = chNull; fIntVal = fRawData + fRawDataLen + 1; parseDecimal(strValue, fIntVal, fSign, (int&) fTotalDigits, (int&) fScale, fMemoryManager); } catch(const OutOfMemoryException&) { cleanup.release(); throw; } cleanup.release(); } XMLBigDecimal::~XMLBigDecimal() { cleanUp(); } void XMLBigDecimal::cleanUp() { if (fRawData) fMemoryManager->deallocate(fRawData); //XMLString::release(&fRawData); } void XMLBigDecimal::setDecimalValue(const XMLCh* const strValue) { fScale = fTotalDigits = 0; XMLSize_t valueLen = XMLString::stringLen(strValue); if (valueLen > fRawDataLen) { fMemoryManager->deallocate(fRawData); fRawData = (XMLCh*) fMemoryManager->allocate ( ((valueLen * 2) + 4) * sizeof(XMLCh) );//XMLString::replicate(strValue, fMemoryManager); } memcpy(fRawData, strValue, valueLen * sizeof(XMLCh)); fRawData[valueLen] = chNull; fRawDataLen = valueLen; fIntVal = fRawData + fRawDataLen + 1; parseDecimal(strValue, fIntVal, fSign, (int&) fTotalDigits, (int&) fScale, fMemoryManager); } /*** * 3.2.3 decimal * * . the preceding optional "+" sign is prohibited. * . The decimal point is required. * . Leading and trailing zeroes are prohibited subject to the following: * there must be at least one digit to the right and to the left of the decimal point which may be a zero. * ***/ XMLCh* XMLBigDecimal::getCanonicalRepresentation(const XMLCh* const rawData , MemoryManager* const memMgr) { XMLCh* retBuf = (XMLCh*) memMgr->allocate( (XMLString::stringLen(rawData)+1) * sizeof(XMLCh)); ArrayJanitor janName(retBuf, memMgr); int sign, totalDigits, fractDigits; try { parseDecimal(rawData, retBuf, sign, totalDigits, fractDigits, memMgr); } catch (const NumberFormatException&) { return 0; } //Extra space reserved in case strLen is zero XMLSize_t strLen = XMLString::stringLen(retBuf); XMLCh* retBuffer = (XMLCh*) memMgr->allocate( (strLen + 4) * sizeof(XMLCh)); if ( (sign == 0) || (totalDigits == 0)) { retBuffer[0] = chDigit_0; retBuffer[1] = chPeriod; retBuffer[2] = chDigit_0; retBuffer[3] = chNull; } else { XMLCh* retPtr = retBuffer; if (sign == -1) { *retPtr++ = chDash; } if (fractDigits == totalDigits) // no integer { *retPtr++ = chDigit_0; *retPtr++ = chPeriod; XMLString::copyNString(retPtr, retBuf, strLen); retPtr += strLen; *retPtr = chNull; } else if (fractDigits == 0) // no fraction { XMLString::copyNString(retPtr, retBuf, strLen); retPtr += strLen; *retPtr++ = chPeriod; *retPtr++ = chDigit_0; *retPtr = chNull; } else // normal { int intLen = totalDigits - fractDigits; XMLString::copyNString(retPtr, retBuf, intLen); retPtr += intLen; *retPtr++ = chPeriod; XMLString::copyNString(retPtr, &(retBuf[intLen]), fractDigits); retPtr += fractDigits; *retPtr = chNull; } } return retBuffer; } void XMLBigDecimal::parseDecimal(const XMLCh* const toParse , XMLCh* const retBuffer , int& sign , int& totalDigits , int& fractDigits , MemoryManager* const manager) { //init retBuffer[0] = chNull; totalDigits = 0; fractDigits = 0; // Strip leading white space, if any. const XMLCh* startPtr = toParse; while (XMLChar1_0::isWhitespace(*startPtr)) startPtr++; // If we hit the end, then return failure if (!*startPtr) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_WSString, manager); // Strip tailing white space, if any. const XMLCh* endPtr = toParse + XMLString::stringLen(toParse); while (XMLChar1_0::isWhitespace(*(endPtr - 1))) endPtr--; // '+' or '-' is allowed only at the first position // and is NOT included in the return parsed string sign = 1; if (*startPtr == chDash) { sign = -1; startPtr++; if (startPtr == endPtr) { ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, manager); } } else if (*startPtr == chPlus) { startPtr++; if (startPtr == endPtr) { ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, manager); } } // Strip leading zeros while (*startPtr == chDigit_0) startPtr++; // containning zero, only zero, nothing but zero // it is a zero, indeed if (startPtr >= endPtr) { sign = 0; return; } XMLCh* retPtr = (XMLCh*) retBuffer; // Scan data bool dotSignFound = false; while (startPtr < endPtr) { if (*startPtr == chPeriod) { if (!dotSignFound) { dotSignFound = true; fractDigits = (int)(endPtr - startPtr - 1); startPtr++; continue; } else // '.' is allowed only once ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_2ManyDecPoint, manager); } // If not valid decimal digit, then an error if ((*startPtr < chDigit_0) || (*startPtr > chDigit_9)) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, manager); // copy over *retPtr++ = *startPtr++; totalDigits++; } /*** E2-44 totalDigits ... by restricting it to numbers that are expressible as i x 10^-n where i and n are integers such that |i| < 10^totalDigits and 0 <= n <= totalDigits. normalization: remove all trailing zero after the '.' and adjust the scaleValue as well. ***/ while ((fractDigits > 0) && (*(retPtr-1) == chDigit_0)) { retPtr--; fractDigits--; totalDigits--; } // 0.0 got past the check for zero because of the decimal point, so we need to double check it here if(totalDigits==0) sign = 0; *retPtr = chNull; //terminated return; } void XMLBigDecimal::parseDecimal(const XMLCh* const toParse , MemoryManager* const manager) { // Strip leading white space, if any. const XMLCh* startPtr = toParse; while (XMLChar1_0::isWhitespace(*startPtr)) startPtr++; // If we hit the end, then return failure if (!*startPtr) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_WSString, manager); // Strip tailing white space, if any. const XMLCh* endPtr = toParse + XMLString::stringLen(toParse); while (XMLChar1_0::isWhitespace(*(endPtr - 1))) endPtr--; // '+' or '-' is allowed only at the first position // and is NOT included in the return parsed string if (*startPtr == chDash) { startPtr++; if (startPtr == endPtr) { ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, manager); } } else if (*startPtr == chPlus) { startPtr++; if (startPtr == endPtr) { ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, manager); } } // Strip leading zeros while (*startPtr == chDigit_0) startPtr++; // containning zero, only zero, nothing but zero // it is a zero, indeed if (startPtr >= endPtr) { return; } // Scan data bool dotSignFound = false; while (startPtr < endPtr) { if (*startPtr == chPeriod) { if (!dotSignFound) { dotSignFound = true; startPtr++; continue; } else // '.' is allowed only once ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_2ManyDecPoint, manager); } // If not valid decimal digit, then an error if ((*startPtr < chDigit_0) || (*startPtr > chDigit_9)) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_Inv_chars, manager); startPtr++; } return; } int XMLBigDecimal::compareValues( const XMLBigDecimal* const lValue , const XMLBigDecimal* const rValue , MemoryManager* const manager) { if ((!lValue) || (!rValue) ) ThrowXMLwithMemMgr(NumberFormatException, XMLExcepts::XMLNUM_null_ptr, manager); return lValue->toCompare(*rValue); } /** * Returns -1, 0 or 1 as this is less than, equal to, or greater * than rValue. * * This method is based on the fact, that parsebigDecimal() would eliminate * unnecessary leading/trailing zeros. **/ int XMLBigDecimal::toCompare(const XMLBigDecimal& other) const { /*** * different sign */ int lSign = this->getSign(); if (lSign != other.getSign()) return (lSign > other.getSign() ? 1 : -1); /*** * same sign, zero */ if (lSign == 0) // optimization return 0; /*** * same sign, non-zero */ unsigned int lIntDigit = this->getTotalDigit() - this->getScale(); unsigned int rIntDigit = other.getTotalDigit() - other.getScale(); if (lIntDigit > rIntDigit) { return 1 * lSign; } else if (lIntDigit < rIntDigit) { return -1 * lSign; } else // compare fraction { int res = XMLString::compareString ( this->getValue() , other.getValue() ); if (res > 0) return 1 * lSign; else if (res < 0) return -1 * lSign; else return 0; } } /*** * Support for Serialization/De-serialization ***/ IMPL_XSERIALIZABLE_TOCREATE(XMLBigDecimal) XMLBigDecimal::XMLBigDecimal(MemoryManager* const manager) : fSign(0) , fTotalDigits(0) , fScale(0) , fRawDataLen(0) , fRawData(0) , fIntVal(0) , fMemoryManager(manager) { } void XMLBigDecimal::serialize(XSerializeEngine& serEng) { //REVISIT: may not need to call base since it does nothing XMLNumber::serialize(serEng); if (serEng.isStoring()) { serEng<>fSign; serEng>>fTotalDigits; serEng>>fScale; XMLCh* rawdataStr; serEng.readString(rawdataStr); ArrayJanitor rawdataName(rawdataStr, serEng.getMemoryManager()); fRawDataLen = XMLString::stringLen(rawdataStr); XMLCh* intvalStr; serEng.readString(intvalStr); ArrayJanitor intvalName(intvalStr, serEng.getMemoryManager()); XMLSize_t intvalStrLen = XMLString::stringLen(intvalStr); if (fRawData) fMemoryManager->deallocate(fRawData); fRawData = (XMLCh*) fMemoryManager->allocate ( ((fRawDataLen + intvalStrLen) + 4) * sizeof(XMLCh) ); memcpy(fRawData, rawdataStr, fRawDataLen * sizeof(XMLCh)); fRawData[fRawDataLen] = chNull; fIntVal = fRawData + fRawDataLen + 1; memcpy(fIntVal, intvalStr, intvalStrLen * sizeof(XMLCh)); fIntVal[intvalStrLen] = chNull; } } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/RefArrayOf.hpp000644 000765 000024 00000012305 13241160336 021754 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: RefArrayOf.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_REFARRAY_HPP) #define XERCESC_INCLUDE_GUARD_REFARRAY_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN template class RefArrayOf : public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- RefArrayOf ( const XMLSize_t size , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); RefArrayOf ( TElem* values[] , const XMLSize_t size , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); RefArrayOf(const RefArrayOf& source); ~RefArrayOf(); // ----------------------------------------------------------------------- // Public operators // ----------------------------------------------------------------------- TElem*& operator[](const XMLSize_t index); const TElem* operator[](const XMLSize_t index) const; RefArrayOf& operator=(const RefArrayOf& toAssign); bool operator==(const RefArrayOf& toCompare) const; bool operator!=(const RefArrayOf& toCompare) const; // ----------------------------------------------------------------------- // Copy operations // ----------------------------------------------------------------------- XMLSize_t copyFrom(const RefArrayOf& srcArray); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- XMLSize_t length() const; TElem** rawData() const; // ----------------------------------------------------------------------- // Element management methods // ----------------------------------------------------------------------- void deleteAt(const XMLSize_t index); void deleteAllElements(); void resize(const XMLSize_t newSize); private : // ----------------------------------------------------------------------- // Data members // ----------------------------------------------------------------------- XMLSize_t fSize; TElem** fArray; MemoryManager* fMemoryManager; }; // // An enumerator for a reference array. It derives from the basic enumerator // class, so that value vectors can be generically enumerated. // template class RefArrayEnumerator : public XMLEnumerator, public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- RefArrayEnumerator ( RefArrayOf* const toEnum , const bool adopt = false ); virtual ~RefArrayEnumerator(); // ----------------------------------------------------------------------- // Enum interface // ----------------------------------------------------------------------- bool hasMoreElements() const; TElem& nextElement(); void Reset(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- RefArrayEnumerator(const RefArrayEnumerator&); RefArrayEnumerator& operator=(const RefArrayEnumerator&); // ----------------------------------------------------------------------- // Data Members // // fAdopted // Indicates whether we have adopted the passed array. If so then // we delete it when we are destroyed. // // fCurIndex // This is the current index into the array. // // fToEnum // The reference array being enumerated. // ----------------------------------------------------------------------- bool fAdopted; XMLSize_t fCurIndex; RefArrayOf* fToEnum; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/HexBin.hpp000644 000765 000024 00000007723 13241160336 021141 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: HexBin.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_HEXBIN_HPP) #define XERCESC_INCLUDE_GUARD_HEXBIN_HPP #include XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT HexBin { public : //@{ /** * return the length of hexData in terms of HexBinary. * * @param hexData A string containing the HexBinary * * return: -1 if it contains any invalid HexBinary * the length of the HexNumber otherwise. */ static int getDataLength(const XMLCh* const hexData); /** * check an array of data against the Hex table. * * @param hexData A string containing the HexBinary * * return: false if it contains any invalid HexBinary * true otherwise. */ static bool isArrayByteHex(const XMLCh* const hexData); /** * get canonical representation * * Caller is responsible for the proper deallocation * of the string returned. * * @param hexData A string containing the HexBinary * @param manager The MemoryManager to use to allocate the string * * return: the canonical representation of the HexBinary * if it is a valid HexBinary, * 0 otherwise */ static XMLCh* getCanonicalRepresentation ( const XMLCh* const hexData , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Decodes HexBinary data into XMLByte * * NOTE: The returned buffer is dynamically allocated and is the * responsibility of the caller to delete it when not longer needed. * Use the memory manager to release the returned buffer. * * @param hexData HexBinary data in XMLCh stream. * @param manager client provided memory manager * @return Decoded binary data in XMLByte stream, * or NULL if input data can not be decoded. */ static XMLByte* decodeToXMLByte( const XMLCh* const hexData , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} private : // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- static bool isHex(const XMLCh& octet); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- HexBin(); HexBin(const HexBin&); HexBin& operator=(const HexBin&); // ----------------------------------------------------------------------- // Private data members // // isInitialized // // set once hexNumberTable is initialized. // // hexNumberTable // // arrany holding valid hexNumber character. // // ----------------------------------------------------------------------- static const XMLByte hexNumberTable[]; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/ValueHashTableOf.hpp000644 000765 000024 00000021104 13241160336 023066 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ValueHashTableOf.hpp 679340 2008-07-24 10:28:29Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_VALUEHASHTABLEOF_HPP) #define XERCESC_INCLUDE_GUARD_VALUEHASHTABLEOF_HPP #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // Forward declare the enumerator so it can be our friend. // template class ValueHashTableOfEnumerator; // // This should really be a nested class, but some of the compilers we // have to support cannot deal with that! // template struct ValueHashTableBucketElem { ValueHashTableBucketElem(void* key, const TVal& value, ValueHashTableBucketElem* next) : fData(value), fNext(next), fKey(key) { } ValueHashTableBucketElem(){}; ~ValueHashTableBucketElem(){}; TVal fData; ValueHashTableBucketElem* fNext; void* fKey; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ValueHashTableBucketElem(const ValueHashTableBucketElem&); ValueHashTableBucketElem& operator=(const ValueHashTableBucketElem&); }; template class ValueHashTableOf : public XMemory { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- ValueHashTableOf( const XMLSize_t modulus, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ValueHashTableOf( const XMLSize_t modulus, const THasher& hasher, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); ~ValueHashTableOf(); // ----------------------------------------------------------------------- // Element management // ----------------------------------------------------------------------- bool isEmpty() const; bool containsKey(const void* const key) const; void removeKey(const void* const key); void removeAll(); // ----------------------------------------------------------------------- // Getters // ----------------------------------------------------------------------- TVal& get(const void* const key, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); const TVal& get(const void* const key) const; // ----------------------------------------------------------------------- // Putters // ----------------------------------------------------------------------- void put(void* key, const TVal& valueToAdopt); private : // ----------------------------------------------------------------------- // Declare our friends // ----------------------------------------------------------------------- friend class ValueHashTableOfEnumerator; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ValueHashTableOf(const ValueHashTableOf&); ValueHashTableOf& operator=(const ValueHashTableOf&); // ----------------------------------------------------------------------- // Private methods // ----------------------------------------------------------------------- ValueHashTableBucketElem* findBucketElem(const void* const key, XMLSize_t& hashVal); const ValueHashTableBucketElem* findBucketElem(const void* const key, XMLSize_t& hashVal) const; void removeBucketElem(const void* const key, XMLSize_t& hashVal); void initialize(const XMLSize_t modulus); void rehash(); // ----------------------------------------------------------------------- // Data members // // fBucketList // This is the array that contains the heads of all of the list // buckets, one for each possible hash value. // // fHashModulus // The modulus used for this hash table, to hash the keys. This is // also the number of elements in the bucket list. // // fHash // The hasher for the key data type. // ----------------------------------------------------------------------- MemoryManager* fMemoryManager; ValueHashTableBucketElem** fBucketList; XMLSize_t fHashModulus; XMLSize_t fInitialModulus; XMLSize_t fCount; THasher fHasher; }; // // An enumerator for a value array. It derives from the basic enumerator // class, so that value vectors can be generically enumerated. // template class ValueHashTableOfEnumerator : public XMLEnumerator, public XMemory { public : // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- ValueHashTableOfEnumerator(ValueHashTableOf* const toEnum , const bool adopt = false , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); virtual ~ValueHashTableOfEnumerator(); // ----------------------------------------------------------------------- // Enum interface // ----------------------------------------------------------------------- bool hasMoreElements() const; TVal& nextElement(); void Reset(); // ----------------------------------------------------------------------- // New interface specific for key used in ValueHashable // ----------------------------------------------------------------------- void* nextElementKey(); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ValueHashTableOfEnumerator(const ValueHashTableOfEnumerator&); ValueHashTableOfEnumerator& operator=(const ValueHashTableOfEnumerator&); // ----------------------------------------------------------------------- // Private methods // ----------------------------------------------------------------------- void findNext(); // ----------------------------------------------------------------------- // Data Members // // fAdopted // Indicates whether we have adopted the passed vector. If so then // we delete the vector when we are destroyed. // // fCurElem // This is the current bucket bucket element that we are on. // // fCurHash // The is the current hash buck that we are working on. Once we hit // the end of the bucket that fCurElem is in, then we have to start // working this one up to the next non-empty bucket. // // fToEnum // The value array being enumerated. // ----------------------------------------------------------------------- bool fAdopted; ValueHashTableBucketElem* fCurElem; XMLSize_t fCurHash; ValueHashTableOf* fToEnum; MemoryManager* const fMemoryManager; }; XERCES_CPP_NAMESPACE_END #if !defined(XERCES_TMPLSINC) #include #endif #endif xerces-c-3.2.2/src/xercesc/util/MsgLoaders/000755 000765 000024 00000000000 13345765730 021320 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/util/Base64.hpp000644 000765 000024 00000023060 13241160336 021000 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: Base64.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_BASE64_HPP) #define XERCESC_INCLUDE_GUARD_BASE64_HPP #include #include #include XERCES_CPP_NAMESPACE_BEGIN // // This class provides encode/decode for RFC 2045 Base64 as // defined by RFC 2045, N. Freed and N. Borenstein. // RFC 2045: Multipurpose Internet Mail Extensions (MIME) // Part One: Format of Internet Message Bodies. Reference // 1996 Available at: http://www.ietf.org/rfc/rfc2045.txt // This class is used by XML Schema binary format validation // // class XMLUTIL_EXPORT Base64 { public : enum Conformance { Conf_RFC2045 , Conf_Schema }; //@{ /** * Encodes octets into Base64 data * * NOTE: The returned buffer is dynamically allocated and is the * responsibility of the caller to delete it when not longer needed. * Use the memory manager to release the returned buffer or * operator delete() if none was provided. * * @param inputData Binary data in XMLByte stream. * @param inputLength Length of the XMLByte stream. * @param outputLength Length of the encoded Base64 byte stream. * @param memMgr client provided memory manager * @return Encoded Base64 data in XMLByte stream, * or NULL if input data can not be encoded. */ static XMLByte* encode(const XMLByte* const inputData , const XMLSize_t inputLength , XMLSize_t* outputLength , MemoryManager* const memMgr = 0); /** * Decodes Base64 data into octets * * NOTE: The returned buffer is dynamically allocated and is the * responsibility of the caller to delete it when not longer needed. * Use the memory manager to release the returned buffer or * operator delete() if none was provided. * * @param inputData Base64 data in XMLByte stream. * @param decodedLength Length of decoded XMLByte stream. * @param memMgr client provided memory manager * @param conform conformance specified: if the input data conforms to the * RFC 2045 it is allowed to have any number of whitespace * characters inside; if it conforms to the XMLSchema specs, * it is allowed to have at most one whitespace character * between the quartets * @return Decoded binary data in XMLByte stream, * or NULL if input data can not be decoded. */ static XMLByte* decode( const XMLByte* const inputData , XMLSize_t* decodedLength , MemoryManager* const memMgr = 0 , Conformance conform = Conf_RFC2045 ); /** * Decodes Base64 data into octets * * NOTE: The returned buffer is dynamically allocated and is the * responsibility of the caller to delete it when not longer needed. * Use the memory manager to release the returned buffer or * operator delete() if none was provided. * * @param inputData Base64 data in XMLCh stream. * @param decodedLength Length of decoded XMLByte stream. * @param memMgr client provided memory manager * @param conform conformance specified: if the input data conforms to the * RFC 2045 it is allowed to have any number of whitespace * characters inside; if it conforms to the XMLSchema specs, * it is allowed to have at most one whitespace character * between the quartets * @return Decoded binary data in XMLByte stream, * or NULL if input data can not be decoded. */ static XMLByte* decodeToXMLByte( const XMLCh* const inputData , XMLSize_t* decodedLength , MemoryManager* const memMgr = 0 , Conformance conform = Conf_RFC2045 ); /** * Get data length * * Returns length of decoded data given an array * containing encoded data. * * @param inputData Base64 data in XMLCh stream. * @param memMgr client provided memory manager * @param conform conformance specified * @return Length of decoded data, * or -1 if input data can not be decoded. */ static int getDataLength( const XMLCh* const inputData , MemoryManager* const memMgr = 0 , Conformance conform = Conf_RFC2045 ); //@} /** * get canonical representation * * Caller is responsible for the proper deallocation * of the string returned. * * @param inputData A string containing the Base64 * @param memMgr client provided memory manager * @param conform conformance specified * * return: the canonical representation of the Base64 * if it is a valid Base64 * 0 otherwise */ static XMLCh* getCanonicalRepresentation ( const XMLCh* const inputData , MemoryManager* const memMgr = 0 , Conformance conform = Conf_RFC2045 ); private : // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- static XMLByte* decode( const XMLByte* const inputData , XMLSize_t* outputLength , XMLByte*& canRepData , MemoryManager* const memMgr = 0 , Conformance conform = Conf_RFC2045 ); static bool isData(const XMLByte& octet); static bool isPad(const XMLByte& octet); static XMLByte set1stOctet(const XMLByte&, const XMLByte&); static XMLByte set2ndOctet(const XMLByte&, const XMLByte&); static XMLByte set3rdOctet(const XMLByte&, const XMLByte&); static void split1stOctet(const XMLByte&, XMLByte&, XMLByte&); static void split2ndOctet(const XMLByte&, XMLByte&, XMLByte&); static void split3rdOctet(const XMLByte&, XMLByte&, XMLByte&); // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- Base64(); Base64(const Base64&); // ----------------------------------------------------------------------- // Private data members // // base64Alphabet // The Base64 alphabet (see RFC 2045). // // base64Padding // Padding character (see RFC 2045). // // base64Inverse // Table used in decoding base64. // // isInitialized // Set once base64Inverse is initialized. // // quadsPerLine // Number of quadruplets per one line. The encoded output // stream must be represented in lines of no more // than 19 quadruplets each. // // ----------------------------------------------------------------------- static const XMLByte base64Alphabet[]; static const XMLByte base64Padding; static const XMLByte base64Inverse[]; static const unsigned int quadsPerLine; }; // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- inline bool Base64::isPad(const XMLByte& octet) { return ( octet == base64Padding ); } inline XMLByte Base64::set1stOctet(const XMLByte& b1, const XMLByte& b2) { return (( b1 << 2 ) | ( b2 >> 4 )); } inline XMLByte Base64::set2ndOctet(const XMLByte& b2, const XMLByte& b3) { return (( b2 << 4 ) | ( b3 >> 2 )); } inline XMLByte Base64::set3rdOctet(const XMLByte& b3, const XMLByte& b4) { return (( b3 << 6 ) | b4 ); } inline void Base64::split1stOctet(const XMLByte& ch, XMLByte& b1, XMLByte& b2) { b1 = ch >> 2; b2 = ( ch & 0x3 ) << 4; } inline void Base64::split2ndOctet(const XMLByte& ch, XMLByte& b2, XMLByte& b3) { b2 |= ch >> 4; // combine with previous value b3 = ( ch & 0xf ) << 2; } inline void Base64::split3rdOctet(const XMLByte& ch, XMLByte& b3, XMLByte& b4) { b3 |= ch >> 6; // combine with previous value b4 = ( ch & 0x3f ); } XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/BitSet.cpp000644 000765 000024 00000016576 13241160336 021157 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: BitSet.cpp 676911 2008-07-15 13:27:32Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local const data // // kBitsPerUnit // The number of bits in each of our allocation units, which is a 32 // bit value in this case. // // kGrowBy // The minimum allocation units to grow the buffer by. // --------------------------------------------------------------------------- const XMLSize_t kBitsPerUnit = 32; const XMLSize_t kGrowBy = 1; // --------------------------------------------------------------------------- // BitSet: Constructors and Destructor // --------------------------------------------------------------------------- BitSet::BitSet( const XMLSize_t size , MemoryManager* const manager) : fMemoryManager(manager) , fBits(0) , fUnitLen(0) { ensureCapacity(size); } BitSet::BitSet(const BitSet& toCopy) : XMemory(toCopy) , fMemoryManager(toCopy.fMemoryManager) , fBits(0) , fUnitLen(toCopy.fUnitLen) { fBits = (unsigned long*) fMemoryManager->allocate ( fUnitLen * sizeof(unsigned long) ); //new unsigned long[fUnitLen]; for (XMLSize_t i = 0; i < fUnitLen; i++) fBits[i] = toCopy.fBits[i]; } BitSet::~BitSet() { fMemoryManager->deallocate(fBits); //delete [] fBits; } // --------------------------------------------------------------------------- // BitSet: Equality methods // --------------------------------------------------------------------------- bool BitSet::equals(const BitSet& other) const { if (this == &other) return true; if (fUnitLen != other.fUnitLen) return false; for (XMLSize_t i = 0; i < fUnitLen; i++) { if (fBits[i] != other.fBits[i]) return false; } return true; } // --------------------------------------------------------------------------- // BitSet: Getter methods // --------------------------------------------------------------------------- bool BitSet::get(const XMLSize_t index) const { const XMLSize_t unitOfBit = (index / kBitsPerUnit); const XMLSize_t bitWithinUnit = index % kBitsPerUnit; // // If the index is beyond our size, don't actually expand. Just return // false, which is what the state would be if we did expand it. // bool retVal = false; if (unitOfBit <= fUnitLen) { if (fBits[unitOfBit] & (1 << bitWithinUnit)) retVal = true; } return retVal; } XMLSize_t BitSet::size() const { return fUnitLen * kBitsPerUnit; } // --------------------------------------------------------------------------- // BitSet: Setter methods // --------------------------------------------------------------------------- bool BitSet::allAreCleared() const { for (XMLSize_t index = 0; index < fUnitLen; index++) { if (fBits[index]) return false; } return true; } bool BitSet::allAreSet() const { for (XMLSize_t index = 0; index < fUnitLen; index++) { if (fBits[index] != 0xFFFFFFFF) return false; } return true; } void BitSet::clearAll() { // Just zero out all the units for (XMLSize_t index = 0; index < fUnitLen; index++) fBits[index] = 0; } void BitSet::clear(const XMLSize_t index) { ensureCapacity(index+1); const XMLSize_t unitOfBit = (index / kBitsPerUnit); const XMLSize_t bitWithinUnit = index % kBitsPerUnit; fBits[unitOfBit] &= ~(1UL << bitWithinUnit); } void BitSet::set(const XMLSize_t index) { ensureCapacity(index+1); const XMLSize_t unitOfBit = (index / kBitsPerUnit); const XMLSize_t bitWithinUnit = index % kBitsPerUnit; fBits[unitOfBit] |= (1UL << bitWithinUnit); } // --------------------------------------------------------------------------- // BitSet: Bitwise logical methods // --------------------------------------------------------------------------- void BitSet::andWith(const BitSet& other) { if (fUnitLen < other.fUnitLen) ensureCapacity(other.fUnitLen * kBitsPerUnit); for (XMLSize_t index = 0; index < other.fUnitLen; index++) fBits[index] &= other.fBits[index]; } void BitSet::orWith(const BitSet& other) { if (fUnitLen < other.fUnitLen) ensureCapacity(other.fUnitLen * kBitsPerUnit); for (XMLSize_t index = 0; index < other.fUnitLen; index++) fBits[index] |= other.fBits[index]; } void BitSet::xorWith(const BitSet& other) { if (fUnitLen < other.fUnitLen) ensureCapacity(other.fUnitLen * kBitsPerUnit); for (XMLSize_t index = 0; index < other.fUnitLen; index++) fBits[index] ^= other.fBits[index]; } // --------------------------------------------------------------------------- // BitSet: Miscellaneous methods // --------------------------------------------------------------------------- XMLSize_t BitSet::hash(const XMLSize_t hashModulus) const { const unsigned char* pBytes = (const unsigned char*)fBits; const XMLSize_t len = fUnitLen * sizeof(unsigned long); XMLSize_t hashVal = 0; for (XMLSize_t index = 0; index < len; index++) { hashVal <<= 1; hashVal ^= *pBytes; } return hashVal % hashModulus; } // --------------------------------------------------------------------------- // BitSet: Private methods // --------------------------------------------------------------------------- void BitSet::ensureCapacity(const XMLSize_t size) { // If we have enough space, do nothing if(fUnitLen * kBitsPerUnit >= size) return; // Calculate the units required to hold the passed bit count. XMLSize_t unitsNeeded = size / kBitsPerUnit; if (size % kBitsPerUnit) unitsNeeded++; // Regrow the unit length by at least the expansion unit if (unitsNeeded < (fUnitLen + kGrowBy)) unitsNeeded = fUnitLen + kGrowBy; // Allocate the array, copy the old stuff, and zero the new stuff unsigned long* newBits = (unsigned long*) fMemoryManager->allocate ( unitsNeeded * sizeof(unsigned long) ); //new unsigned long[unitsNeeded]; XMLSize_t index; for (index = 0; index < fUnitLen; index++) newBits[index] = fBits[index]; for (; index < unitsNeeded; index++) newBits[index] = 0; fMemoryManager->deallocate(fBits); //delete [] fBits; fBits = newBits; fUnitLen = unitsNeeded; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XML256TableTranscoder.cpp000644 000765 000024 00000016130 13241160336 023641 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // XML256TableTranscoder: Public Destructor // --------------------------------------------------------------------------- XML256TableTranscoder::~XML256TableTranscoder() { // We don't own the tables, we just reference them } // --------------------------------------------------------------------------- // XML256TableTranscoder: Implementation of the transcoder API // --------------------------------------------------------------------------- XMLSize_t XML256TableTranscoder::transcodeFrom(const XMLByte* const srcData , const XMLSize_t srcCount , XMLCh* const toFill , const XMLSize_t maxChars , XMLSize_t& bytesEaten , unsigned char* const charSizes) { // // Calculate the max chars we can do here. Its the lesser of the // max output chars and the number of chars in the source. // const XMLSize_t countToDo = srcCount < maxChars ? srcCount : maxChars; // // Loop through the count we have to do and map each char via the // lookup table. // const XMLByte* srcPtr = srcData; const XMLByte* endPtr = (srcPtr + countToDo); XMLCh* outPtr = toFill; while (srcPtr < endPtr) { const XMLCh uniCh = fFromTable[*srcPtr++]; if (uniCh != 0xFFFF) { *outPtr++ = uniCh; continue; } } // Set the bytes eaten bytesEaten = countToDo; // Set the character sizes to the fixed size memset(charSizes, 1, countToDo); // Return the chars we transcoded return countToDo; } XMLSize_t XML256TableTranscoder::transcodeTo( const XMLCh* const srcData , const XMLSize_t srcCount , XMLByte* const toFill , const XMLSize_t maxBytes , XMLSize_t& charsEaten , const UnRepOpts options) { // // Calculate the max chars we can do here. Its the lesser of the // max output chars and the number of chars in the source. // const XMLSize_t countToDo = srcCount < maxBytes ? srcCount : maxBytes; // // Loop through the count we have to do and map each char via the // lookup table. // const XMLCh* srcPtr = srcData; const XMLCh* endPtr = (srcPtr + countToDo); XMLByte* outPtr = toFill; XMLByte nextOut; while (srcPtr < endPtr) { // // Get the next src char out to a temp, then do a binary search // of the 'to' table for this entry. // if ((nextOut = xlatOneTo(*srcPtr))!=0) { *outPtr++ = nextOut; srcPtr++; continue; } // // Its not representable so, according to the options, either // throw or use the replacement. // if (options == UnRep_Throw) { XMLCh tmpBuf[17]; XMLString::binToText((unsigned int)*srcPtr, tmpBuf, 16, 16, getMemoryManager()); ThrowXMLwithMemMgr2 ( TranscodingException , XMLExcepts::Trans_Unrepresentable , tmpBuf , getEncodingName() , getMemoryManager() ); } // Eat the source char and use the replacement char srcPtr++; *outPtr++ = 0x3F; } // Set the chars eaten charsEaten = countToDo; // Return the bytes we transcoded return countToDo; } bool XML256TableTranscoder::canTranscodeTo(const unsigned int toCheck) { return (xlatOneTo(toCheck) != 0); } // --------------------------------------------------------------------------- // XML256TableTranscoder: Hidden constructor // --------------------------------------------------------------------------- XML256TableTranscoder:: XML256TableTranscoder( const XMLCh* const encodingName , const XMLSize_t blockSize , const XMLCh* const fromTable , const XMLTransService::TransRec* const toTable , const XMLSize_t toTableSize , MemoryManager* const manager) : XMLTranscoder(encodingName, blockSize, manager) , fFromTable(fromTable) , fToSize(toTableSize) , fToTable(toTable) { } // --------------------------------------------------------------------------- // XML256TableTranscoder: Private helper methods // --------------------------------------------------------------------------- XMLByte XML256TableTranscoder::xlatOneTo(const XMLCh toXlat) const { XMLSize_t lowOfs = 0; XMLSize_t hiOfs = fToSize - 1; do { // Calc the mid point of the low and high offset. const XMLSize_t midOfs = ((hiOfs - lowOfs) / 2) + lowOfs; // // If our test char is greater than the mid point char, then // we move up to the upper half. Else we move to the lower // half. If its equal, then its our guy. // if (toXlat > fToTable[midOfs].intCh) { lowOfs = midOfs; } else if (toXlat < fToTable[midOfs].intCh) { hiOfs = midOfs; } else { return fToTable[midOfs].extCh; } } while (lowOfs + 1 < hiOfs); // Check the high end of the range otherwise the // last item in the table may never be found. if (toXlat == fToTable[hiOfs].intCh) { return fToTable[hiOfs].extCh; } return 0; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/XMLDOMMsg.hpp000644 000765 000024 00000007503 13241160336 021427 0ustar00scantorstaff000000 000000 // This file is generated, don't edit it!! #if !defined(XERCESC_INCLUDE_GUARD_ERRHEADER_XMLDOMMsg) #define XERCESC_INCLUDE_GUARD_ERRHEADER_XMLDOMMsg #include #include #include XERCES_CPP_NAMESPACE_BEGIN class XMLDOMMsg { public : enum Codes { NoError = 0 , F_LowBounds = 1 , DOMEXCEPTION_ERRX = 2 , INDEX_SIZE_ERR = 3 , DOMSTRING_SIZE_ERR = 4 , HIERARCHY_REQUEST_ERR = 5 , WRONG_DOCUMENT_ERR = 6 , INVALID_CHARACTER_ERR = 7 , NO_DATA_ALLOWED_ERR = 8 , NO_MODIFICATION_ALLOWED_ERR = 9 , NOT_FOUND_ERR = 10 , NOT_SUPPORTED_ERR = 11 , INUSE_ATTRIBUTE_ERR = 12 , INVALID_STATE_ERR = 13 , SYNTAX_ERR = 14 , INVALID_MODIFICATION_ERR = 15 , NAMESPACE_ERR = 16 , INVALID_ACCESS_ERR = 17 , VALIDATION_ERR = 18 , TYPE_MISMATCH_ERR = 19 , DOMRANGEEXCEPTION_ERRX = 20 , BAD_BOUNDARYPOINTS_ERR = 21 , INVALID_NODE_TYPE_ERR = 22 , DOMLSEXCEPTION_ERRX = 23 , PARSE_ERR = 24 , SERIALIZE_ERR = 25 , DOMXPATHEXCEPTION_ERRX = 26 , INVALID_EXPRESSION_ERR = 27 , TYPE_ERR = 28 , NO_RESULT_ERR = 29 , Writer_NestedCDATA = 30 , Writer_NotRepresentChar = 31 , Writer_NotRecognizedType = 32 , LSParser_ParseInProgress = 33 , LSParser_ParsingAborted = 34 , LSParser_ParsingFailed = 35 , F_HighBounds = 36 , W_LowBounds = 37 , W_HighBounds = 38 , E_LowBounds = 39 , E_HighBounds = 40 }; static bool isFatal(const XMLDOMMsg::Codes toCheck) { return ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds)); } static bool isWarning(const XMLDOMMsg::Codes toCheck) { return ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds)); } static bool isError(const XMLDOMMsg::Codes toCheck) { return ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds)); } static XMLErrorReporter::ErrTypes errorType(const XMLDOMMsg::Codes toCheck) { if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds)) return XMLErrorReporter::ErrType_Warning; else if ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds)) return XMLErrorReporter::ErrType_Fatal; else if ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds)) return XMLErrorReporter::ErrType_Error; return XMLErrorReporter::ErrTypes_Unknown; } static DOMError::ErrorSeverity DOMErrorType(const XMLDOMMsg::Codes toCheck) { if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds)) return DOMError::DOM_SEVERITY_WARNING; else if ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds)) return DOMError::DOM_SEVERITY_FATAL_ERROR; else return DOMError::DOM_SEVERITY_ERROR; } private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLDOMMsg(); }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/XercesDefs.hpp000644 000765 000024 00000015146 13241160336 022015 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: XercesDefs.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_XERCESDEFS_HPP) #define XERCESC_INCLUDE_GUARD_XERCESDEFS_HPP // --------------------------------------------------------------------------- // The file xerces_hdr_config defines critical configuration information // used by the remainder of this file. // // There are two major configuration files: // - xerces_autoconf_config.hpp-- Contains defines that are safe for // access through public headers. // // - config.h -- Contains defines that may conflict // with other packages; should only be // included by Xerces implementation files. // // Both of these files are generated through the autoconf/configure process. // --------------------------------------------------------------------------- // // If this is an autoconf configured build, we include Xerces_autoconf_config.hpp // Otherwise we include a preconfigured config appropriate for the particular // platform that the specific makefile should copy over. // // If the next line generates an error then you haven't run ./configure #include // --------------------------------------------------------------------------- // Include the Xerces version information; this is kept in a separate file to // make modification simple and obvious. Updates to the version header file // --------------------------------------------------------------------------- #include // --------------------------------------------------------------------------- // Some general typedefs that are defined for internal flexibility. // // Note that UTF16Ch is fixed at 16 bits, whereas XMLCh floats in size per // platform, to whatever is the native wide char format there. UCS4Ch is // fixed at 32 bits. The types we defined them in terms of are defined per // compiler, using whatever types are the right ones for them to get these // 16/32 bit sizes. // // --------------------------------------------------------------------------- typedef unsigned char XMLByte; typedef XMLUInt16 UTF16Ch; typedef XMLUInt32 UCS4Ch; // --------------------------------------------------------------------------- // Handle boolean. If the platform can handle booleans itself, then we // map our boolean type to the native type. Otherwise we create a default // one as an int and define const values for true and false. // // This flag will be set in the per-development environment stuff above. // --------------------------------------------------------------------------- #if defined(XERCES_NO_NATIVE_BOOL) #ifndef bool typedef int bool; #endif #ifndef true #define true 1 #endif #ifndef false #define false 0 #endif #endif // --------------------------------------------------------------------------- // According to whether the compiler supports L"" type strings, we define // the XMLStrL() macro one way or another. // --------------------------------------------------------------------------- #if defined(XERCES_LSTRSUPPORT) #define XMLStrL(str) L##str #else #define XMLStrL(str) str #endif // --------------------------------------------------------------------------- // Define namespace symbols if the compiler supports it. // --------------------------------------------------------------------------- #if defined(XERCES_HAS_CPP_NAMESPACE) #define XERCES_CPP_NAMESPACE_BEGIN namespace XERCES_CPP_NAMESPACE { #define XERCES_CPP_NAMESPACE_END } #define XERCES_CPP_NAMESPACE_USE using namespace XERCES_CPP_NAMESPACE; #define XERCES_CPP_NAMESPACE_QUALIFIER XERCES_CPP_NAMESPACE:: namespace XERCES_CPP_NAMESPACE { } namespace xercesc = XERCES_CPP_NAMESPACE; #else #define XERCES_CPP_NAMESPACE_BEGIN #define XERCES_CPP_NAMESPACE_END #define XERCES_CPP_NAMESPACE_USE #define XERCES_CPP_NAMESPACE_QUALIFIER #endif #if defined(XERCES_STD_NAMESPACE) #define XERCES_USING_STD(NAME) using std :: NAME; #define XERCES_STD_QUALIFIER std :: #else #define XERCES_USING_STD(NAME) #define XERCES_STD_QUALIFIER #endif // --------------------------------------------------------------------------- // Set up the import/export keyword for our core projects. The // PLATFORM_XXXX keywords are set in the per-development environment // include above. // --------------------------------------------------------------------------- // The DLL_EXPORT flag should be defined on the command line during the build of a DLL // configure conspires to make this happen. #if defined(DLL_EXPORT) #if defined(XERCES_BUILDING_LIBRARY) #define XMLUTIL_EXPORT XERCES_PLATFORM_EXPORT #define XMLPARSER_EXPORT XERCES_PLATFORM_EXPORT #define SAX_EXPORT XERCES_PLATFORM_EXPORT #define SAX2_EXPORT XERCES_PLATFORM_EXPORT #define CDOM_EXPORT XERCES_PLATFORM_EXPORT #define PARSERS_EXPORT XERCES_PLATFORM_EXPORT #define VALIDATORS_EXPORT XERCES_PLATFORM_EXPORT #define XINCLUDE_EXPORT XERCES_PLATFORM_EXPORT #else #define XMLUTIL_EXPORT XERCES_PLATFORM_IMPORT #define XMLPARSER_EXPORT XERCES_PLATFORM_IMPORT #define SAX_EXPORT XERCES_PLATFORM_IMPORT #define SAX2_EXPORT XERCES_PLATFORM_IMPORT #define CDOM_EXPORT XERCES_PLATFORM_IMPORT #define PARSERS_EXPORT XERCES_PLATFORM_IMPORT #define VALIDATORS_EXPORT XERCES_PLATFORM_IMPORT #define XINCLUDE_EXPORT XERCES_PLATFORM_IMPORT #endif #if defined(XERCES_BUILDING_DEPRECATED_LIBRARY) #define DEPRECATED_DOM_EXPORT XERCES_PLATFORM_EXPORT #else #define DEPRECATED_DOM_EXPORT XERCES_PLATFORM_IMPORT #endif #else #define XMLUTIL_EXPORT #define XMLPARSER_EXPORT #define SAX_EXPORT #define SAX2_EXPORT #define CDOM_EXPORT #define DEPRECATED_DOM_EXPORT #define PARSERS_EXPORT #define VALIDATORS_EXPORT #define XINCLUDE_EXPORT #endif #endif xerces-c-3.2.2/src/xercesc/util/MsgLoaders/MsgCatalog/000755 000765 000024 00000000000 13345765734 023345 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/util/MsgLoaders/InMemory/000755 000765 000024 00000000000 13345765734 023063 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/util/MsgLoaders/ICU/000755 000765 000024 00000000000 13345765734 021744 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/util/MsgLoaders/ICU/ICUMsgLoader.hpp000644 000765 000024 00000007601 13241160335 024654 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ICUMsgLoader.hpp 932889 2010-04-11 13:10:10Z borisk $ */ #if !defined(XERCESC_INCLUDE_GUARD_ICUMSGLOADER_HPP) #define XERCESC_INCLUDE_GUARD_ICUMSGLOADER_HPP #include #include "unicode/ures.h" XERCES_CPP_NAMESPACE_BEGIN // // This is the ICU specific implementation of the XMLMsgLoader interface. // This one uses ICU resource bundles to store its messages. // class XMLUTIL_EXPORT ICUMsgLoader : public XMLMsgLoader { public : // ----------------------------------------------------------------------- // Public Constructors and Destructor // ----------------------------------------------------------------------- ICUMsgLoader(const XMLCh* const msgDomain); ~ICUMsgLoader(); // ----------------------------------------------------------------------- // Implementation of the virtual message loader API // ----------------------------------------------------------------------- virtual bool loadMsg ( const XMLMsgLoader::XMLMsgId msgToLoad , XMLCh* const toFill , const XMLSize_t maxChars ); virtual bool loadMsg ( const XMLMsgLoader::XMLMsgId msgToLoad , XMLCh* const toFill , const XMLSize_t maxChars , const XMLCh* const repText1 , const XMLCh* const repText2 = 0 , const XMLCh* const repText3 = 0 , const XMLCh* const repText4 = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); virtual bool loadMsg ( const XMLMsgLoader::XMLMsgId msgToLoad , XMLCh* const toFill , const XMLSize_t maxChars , const char* const repText1 , const char* const repText2 = 0 , const char* const repText3 = 0 , const char* const repText4 = 0 , MemoryManager * const manager = XMLPlatformUtils::fgMemoryManager ); private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- ICUMsgLoader(); ICUMsgLoader(const ICUMsgLoader&); ICUMsgLoader& operator=(const ICUMsgLoader&); // ----------------------------------------------------------------------- // Private data members // // fLocaleBundle // pointer to the required locale specific resource bundle, // or to the default locale resource bundle in case the required // locale specific resource bundle unavailable. // // fDomainBundle // pointer to the domain specific resource bundle with in the // required locale specific (or default locale) resource bundle. // // ----------------------------------------------------------------------- UResourceBundle* fLocaleBundle; UResourceBundle* fDomainBundle; }; XERCES_CPP_NAMESPACE_END #endif xerces-c-3.2.2/src/xercesc/util/MsgLoaders/ICU/resources/000755 000765 000024 00000000000 13241160335 023733 5ustar00scantorstaff000000 000000 xerces-c-3.2.2/src/xercesc/util/MsgLoaders/ICU/ICUMsgLoader.cpp000644 000765 000024 00000023162 13241160335 024647 0ustar00scantorstaff000000 000000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ICUMsgLoader.cpp 1800344 2017-06-30 01:14:49Z scantor $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include #include #include #include #include #include #include "ICUMsgLoader.hpp" #include "unicode/putil.h" #include "unicode/uloc.h" #include "unicode/udata.h" #include "string.h" #include #include XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // Local static methods // --------------------------------------------------------------------------- /* * Resource Data Reference. * * The data is packaged as a dll (or .so or whatever, depending on the platform) that exports a data symbol. * The application (this *.cpp) references that symbol here, and will pass the data address to ICU, which * will then be able to fetch resources from the data. */ #define ENTRY_POINT xercesc_messages_3_2_dat #define BUNDLE_NAME "xercesc_messages_3_2" extern "C" void U_IMPORT *ENTRY_POINT; /* * Tell ICU where our resource data is located in memory. The data lives in the xercesc_nessages dll, and we just * pass the address of an exported symbol from that library to ICU. */ static bool setAppDataOK = false; static void setAppData() { static bool setAppDataDone = false; if (setAppDataDone) { return; } else { setAppDataDone = true; UErrorCode err = U_ZERO_ERROR; udata_setAppData(BUNDLE_NAME, &ENTRY_POINT, &err); if (U_SUCCESS(err)) { setAppDataOK = true; } } } // --------------------------------------------------------------------------- // Public Constructors and Destructor // --------------------------------------------------------------------------- ICUMsgLoader::ICUMsgLoader(const XMLCh* const msgDomain) :fLocaleBundle(0) ,fDomainBundle(0) { /*** Validate msgDomain ***/ if (!XMLString::equals(msgDomain, XMLUni::fgXMLErrDomain) && !XMLString::equals(msgDomain, XMLUni::fgExceptDomain) && !XMLString::equals(msgDomain, XMLUni::fgXMLDOMMsgDomain) && !XMLString::equals(msgDomain, XMLUni::fgValidityDomain) ) { XMLPlatformUtils::panic(PanicHandler::Panic_UnknownMsgDomain); } /*** Resolve domainName ***/ int index = XMLString::lastIndexOf(msgDomain, chForwardSlash); char* domainName = XMLString::transcode(&(msgDomain[index + 1]), XMLPlatformUtils::fgMemoryManager); ArrayJanitor jan1(domainName, XMLPlatformUtils::fgMemoryManager); /*** Location resolution priority 1. XMLMsgLoader::getNLSHome(), set by user through XMLPlatformUtils::Initialize(), which provides user-specified location where the message loader shall retrieve error messages. 2. environment var: XERCESC_NLS_HOME 3. path $XERCESCROOT/msg ***/ char locationBuf[1024]; memset(locationBuf, 0, sizeof locationBuf); const char *nlsHome = XMLMsgLoader::getNLSHome(); if (nlsHome) { strcpy(locationBuf, nlsHome); strcat(locationBuf, U_FILE_SEP_STRING); } else { nlsHome = getenv("XERCESC_NLS_HOME"); if (nlsHome) { strcpy(locationBuf, nlsHome); strcat(locationBuf, U_FILE_SEP_STRING); } else { nlsHome = getenv("XERCESCROOT"); if (nlsHome) { strcpy(locationBuf, nlsHome); strcat(locationBuf, U_FILE_SEP_STRING); strcat(locationBuf, "msg"); strcat(locationBuf, U_FILE_SEP_STRING); } else { /*** leave it to ICU to decide where to search for the error message. ***/ setAppData(); } } } /*** Open the locale-specific resource bundle ***/ strcat(locationBuf, BUNDLE_NAME); UErrorCode err = U_ZERO_ERROR; uloc_setDefault("root", &err); // in case user-specified locale unavailable err = U_ZERO_ERROR; fLocaleBundle = ures_open(locationBuf, XMLMsgLoader::getLocale(), &err); if (!U_SUCCESS(err) || fLocaleBundle == NULL) { /*** in case user specified location does not work try the dll ***/ if (strcmp(locationBuf, BUNDLE_NAME) !=0 ) { setAppData(); err = U_ZERO_ERROR; fLocaleBundle = ures_open(BUNDLE_NAME, XMLMsgLoader::getLocale(), &err); if (!U_SUCCESS(err) || fLocaleBundle == NULL) { XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain); } } else { XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain); } } /*** Open the domain specific resource bundle within the locale-specific resource bundle ***/ err = U_ZERO_ERROR; fDomainBundle = ures_getByKey(fLocaleBundle, domainName, NULL, &err); if (!U_SUCCESS(err) || fDomainBundle == NULL) { XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain); } } ICUMsgLoader::~ICUMsgLoader() { ures_close(fDomainBundle); ures_close(fLocaleBundle); } // --------------------------------------------------------------------------- // Implementation of the virtual message loader API // --------------------------------------------------------------------------- bool ICUMsgLoader::loadMsg( const XMLMsgLoader::XMLMsgId msgToLoad , XMLCh* const toFill , const XMLSize_t maxChars) { UErrorCode err = U_ZERO_ERROR; int32_t strLen = 0; // Assuming array format const UChar *name = ures_getStringByIndex(fDomainBundle, (int32_t)msgToLoad-1, &strLen, &err); if (!U_SUCCESS(err) || (name == NULL)) { return false; } int retStrLen = strLen > (int32_t)maxChars ? maxChars : strLen; if (sizeof(UChar)==sizeof(XMLCh)) { XMLString::moveChars(toFill, (XMLCh*)name, retStrLen); toFill[retStrLen] = (XMLCh) 0; } else { XMLCh* retStr = toFill; const UChar *srcPtr = name; while (retStrLen--) *retStr++ = *srcPtr++; *retStr = 0; } return true; } bool ICUMsgLoader::loadMsg( const XMLMsgLoader::XMLMsgId msgToLoad , XMLCh* const toFill , const XMLSize_t maxChars , const XMLCh* const repText1 , const XMLCh* const repText2 , const XMLCh* const repText3 , const XMLCh* const repText4 , MemoryManager* const manager ) { // Call the other version to load up the message if (!loadMsg(msgToLoad, toFill, maxChars)) return false; // And do the token replacement XMLString::replaceTokens(toFill, maxChars, repText1, repText2, repText3, repText4, manager); return true; } bool ICUMsgLoader::loadMsg( const XMLMsgLoader::XMLMsgId msgToLoad , XMLCh* const toFill , const XMLSize_t maxChars , const char* const repText1 , const char* const repText2 , const char* const repText3 , const char* const repText4 , MemoryManager * const manager) { // // Transcode the provided parameters and call the other version, // which will do the replacement work. // XMLCh* tmp1 = 0; XMLCh* tmp2 = 0; XMLCh* tmp3 = 0; XMLCh* tmp4 = 0; bool bRet = false; if (repText1) tmp1 = XMLString::transcode(repText1, manager); if (repText2) tmp2 = XMLString::transcode(repText2, manager); if (repText3) tmp3 = XMLString::transcode(repText3, manager); if (repText4) tmp4 = XMLString::transcode(repText4, manager); bRet = loadMsg(msgToLoad, toFill, maxChars, tmp1, tmp2, tmp3, tmp4, manager); if (tmp1) manager->deallocate(tmp1);//delete [] tmp1; if (tmp2) manager->deallocate(tmp2);//delete [] tmp2; if (tmp3) manager->deallocate(tmp3);//delete [] tmp3; if (tmp4) manager->deallocate(tmp4);//delete [] tmp4; return bRet; } XERCES_CPP_NAMESPACE_END xerces-c-3.2.2/src/xercesc/util/MsgLoaders/ICU/resources/res-file-list.txt000644 000765 000024 00000000011 13241160335 027143 0ustar00scantorstaff000000 000000 root.res xerces-c-3.2.2/src/xercesc/util/MsgLoaders/ICU/resources/root.txt000644 000765 000024 00000124422 13241160335 025464 0ustar00scantorstaff000000 000000 root { // an array XMLErrors { "W_ Start " , "notation '{0}' has already been declared" , "attribute '{0}' has already been declared for element '{1}'" , "encoding '{0}' from XML declaration or manually set contradicts the auto-sensed encoding; ignoring" , "element '{0}' is referenced in a content model but was never declared" , "element '{0}' is referenced in an ATTLIST but was never declared" , "{0}" , "unable to include document '{0}'" , "unable to open text file target '{0}'" , "unable to include resource '{0}'" , "W_ End " , "E_ Start " , "'{0}' is not allowed for the content of simpleType; only list, union, and restriction are allowed" , "globally-defined complex type must have a name" , "globally-declared attribute must have a name" , "attribute declaration must have name or 'ref' attribute" , "element declaration must have name or 'ref' attribute" , "group declaration must have name or a 'ref' attribute" , "attributeGroup declaration must have name or 'ref' attribute" , "anonymous complexType in element '{0}' has name" , "anonymous simpleType in element '{0}' has name" , "content of element declaration must match (annotation?, (simpleType | complexType)?, (unique | key | keyref)*)" , "invalid content in simple type '{0}'; only list, union, and restriction are allowed" , "expected simpleType in list definition for type '{0}'" , "list, union, or restriction content is invalid for type '{0}'" , "invalid content in list definition for type '{0}'" , "expected simpleType in restriction definition for type '{0}'" , "facet '{0}' is already defined" , "expected simpleType in union definition for type '{0}'" , "content in simpleType definition is empty" , "expected restriction or extension in simpleContent definition" , "base attribute must be specified for restriction or extension definition" , "expected restriction or extension in complexContent definition" , "invalid content in 'schema' element" , "invalid content for type '{0}'" , "unknown simpleType '{0}'" , "unknown complexType '{0}'" , "prefix '{0}' can not be resolved to namespace URI" , "referenced element '{0}' not found" , "type '{0}:{1}' not found" , "attribute '{0}' not found" , "invalid element '{0}' in complex type definition" , "base type '{0}' not found" , "unable to create validator for '{0}'" , "invalid element following simpleContent definition in complexType" , "invalid element following complexContent definition in complexType" , "attribute '{0}' cannot have both fixed and default values" , "attribute '{0}' with default value must be optional" , "attribute '{0}' declared more than once in the same scope" , "attribute '{0}' cannot have both 'type' attribute and simpleType definition" , "simpleType '{0}:{1}' for attribute '{2}' not found" , "element '{0}' cannot have both fixed and default values" , "invalid {0} name '{1}'" , "element '{0}' cannot have both 'type' attribute and simpleType/complexType definition" , "element '{0}' has fixed or default value and must have mixed simple or simple content model" , "simpleType '{0}' that '{1}' extends has a value of the final attribute that does not permit extension" , "type '{0}' specified as the base in simpleContent definition must not have complex content" , "type '{0}' is a simple type and cannot be used in derivation by restriction in complexType definition" , "invalid element following restriction or extension definition in simpleContent" , "invalid element following restriction or extension definition in complexContent" , "duplicate annotation in type '{0}'" , "type '{0}' cannot be used in its own union, list, or restriction definition" , "block value '{0}' is invalid" , "final value '{0}' is invalid" , "element '{0}' cannot be part of the substitution group headed by '{1}'" , "element '{0}' has a type which does not derive from the type of the element at the head of the substitution group" , "element '{0}' declared more than once in the same scope" , "value '{0}' invalid for attribute '{1}'" , "attribute '{0}' has both 'ref' attribute and inline simpleType definition or 'form' or 'type' attribute" , "duplicate reference attribute '{0}:{1}' in complexType definition" , "derivation by restriction is forbidden by either base type '{0}' or globally" , "derivation by extension is forbidden by either base type '{0}' or globally" , "base type specified in complexContent definition must be a complex type" , "imported schema '{0}' has different target namespace '{1}'; expected '{2}'" , "'schemaLocation' attribute must be specified in element '{0}'" , "included schema '{0}' has different target namespace '{1}'" , "at most one annotation is allowed" , "content of attribute '{0}' must match (annotation?, simpleType?)" , "attribute '{0}' must appear in global {1} declarations" , "attribute '{0}' must appear in local {1} declarations" , "attribute '{0}' cannot appear in global {1} declarations" , "attribute '{0}' cannot appear in local {1} declarations" , "minOccurs value '{0}' must not be greater than maxOccurs value '{1}'" , "duplicate annotation in anyAttribute declaration" , "global {0} declaration must have name" , "circular definition in '{0}'" , "global type '{0}:{1}' declared more than once or also declared as {2}" , "global {0} '{1}' declared more than once" , "invalid value '{0}' for whiteSpace facet; expected 'collapse'" , "namespace of import declaration must be different from target namespace of importing schema" , "importing schema must have target namespace if namespace in import declaration is not present" , "element '{0}' cannot have value constraint '{1}' if its type is derived from ID" , "element/attribute '{0}' is of NOTATION type" , "element '{0}' has mixed content type and the content type's particle must be emptiable" , "complexType definition has empty content but base type is not empty or does not have emptiable particle" , "content types of base type '{0}' and derived type '{1}' must both be mixed or element-only" , "derived content type is not a valid restriction of base content type" , "derivation by extension or restriction is forbidden by either base type '{0}' or globally" , "item type definition must have variety of atomic or union where all member types must be atomic" , "group '{0}' must contain all, choice, or sequence compositor" , "content of attributeGroup '{0}' must match (annotation?, ((attribute | attributeGroup)*, anyAttribute?))" , "top-level compositor in a group must not have 'minOccurs' or 'maxOccurs' attribute" , "{0} '{1}:{2}' not found" , "group with the all compositor must only appear as content type of a complex type" , "group with the all compositor constituting the content type of a complex type must have both minOccurs and maxOccurs equal 1" , "element declaration in the all compositor must have minOccurs and maxOccurs equal 0 or 1" , "attribute '{0}' is already defined in base" , "intensional intersection of attribute wildcards must be expressible" , "base type does not have any attributes" , "attribute '{0}' has incompatible use value in the base" , "type of attribute '{0}' must be derived by restriction from type of the corresponding attribute in the base" , "attribute '{0}' does not have a fixed value or has a different fixed value from that of the base" , "attribute '{0}' has invalid target namespace with respect to the base wildcard constraint or base has no wildcard" , "attribute wildcard is present in the derived type but not in the base" , "attribute wildcard in the derived type is not a valid subset of that in the base" , "attribute '{0}' cannot have different use value in the derived type if the base attribute use value is 'prohibited'" , "attribute wildcard in the derived type must be identical to or stricter than the one in the base" , "unexpected '{0}' in the content of the all compositor; only elements are allowed" , "redefined schema '{0}' has a different target namespace '{1}'" , "simpleType in redefine must have a restriction definition" , "simpleType base attribute in redefine must reference the original type with the same name" , "complexType in redefine must have a restriction or extension definition" , "complexType base attribute in redefine must reference the original type with the same name" , "group '{0}' must have minOccurs and maxOccurs equal 1" , "unable to find declaration in the schema being redefined corresponding to '{0}'" , "group declaration in redefine may only contain one reference to itself" , "attributeGroup declaration in redefine may only contain one reference to itself" , "redefine declaration cannot contain '{0}'" , "notation declaration '{0}:{1}' not found" , "more than one identity constraint has name '{0}'" , "identity constraint declaration must match (annotation?, selector, field+)" , "key reference declaration '{0}' refers to unknown key '{1}'" , "field cardinalities for keyref '{0}' and key '{1}' must match" , "XPath expression is missing or empty" , "fixed value in attribute reference is not set or differs from the fixed value of '{0}'" , "attribute '{0}' is of ID type or type derived from ID and cannot have default/fixed value constraint" , "attribute '{0}' is a subsequent attribute in this complex type with a type derived from ID" , "attribute '{0}' is a subsequent attribute in this attribute group with a type derived from ID" , "empty value illegal for 'targetNamespace' attribute; target namespace must be absent or contain non-empty value" , "{0}" , "'{0}' has already been included or redefined" , "namespace '{0}' is referenced without import declaration" , "all compositor that is part of a complex type definition must constitute the entire content of the definition" , "annotation can only contain appinfo and documentation declarations" , "invalid facet name '{0}'" , "root element name of XML Schema document must be 'schema'" , "circular substitution group in element '{0}'" , "element '{0}' must be from the XML Schema namespace" , "target namespace of attribute '{0}' cannot be http://www.w3.org/2001/XMLSchema-instance" , "invalid namespace declaration" , "namespace fix-up cannot be performed on DOM Level 1 node" , "more than one anyAttribute declaration found in complex type declaration" , "anyAttribute must not be followed by other declarations" , "E_ End " , "F_ Start " , "parser has encountered more than '{0}' entity expansions in the document; this is the limit imposed by the application" , "expected comment or CDATA section" , "attribute name expected" , "notation name expected" , "illegal repetition of elements in mixed content model" , "default attribute declaration expected" , "equal sign expected" , "element name expected" , "comment must start with

DOMPrint parses an XML file, constructs the DOM tree, and invokes DOMLSSerializer::write() to serialize the resultant DOM tree back to XML stream.

The DOMPrint sample parses an XML file, using either a validating or non-validating DOM parser configuration, builds a DOM tree, and then invokes DOMLSSerializer::write() to serialize the resultant DOM tree. To run DOMPrint, enter the following:

DOMPrint <XML file>

The following parameters may be set from the command line

Usage: DOMPrint [options] <XML file> This program invokes the DOM parser, and builds the DOM tree It then asks the DOMLSSerializer to serialize the DOM tree. Options: -e create entity reference nodes. Default is no expansion. -v=xxx Validation scheme [always | never | auto*]. -n Enable namespace processing. Default is off. -s Enable schema processing. Default is off. -f Enable full schema constraint checking. Defaults is off. -wenc=XXX Use a particular encoding for output. Default is the same encoding as the input XML file. UTF-8 if input XML file has not XML declaration. -wfile=xxx Write to a file instead of stdout. -wscs=xxx Enable/Disable split-cdata-sections. Default on. -wddc=xxx Enable/Disable discard-default-content. Default on. -wflt=xxx Enable/Disable filtering. Default off. -wfpp=xxx Enable/Disable format-pretty-print. Default off. -wbom=xxx Enable/Disable write Byte-Order-Mark Default off. -? Show this help * = Default if not provided explicitly. The parser has intrinsic support for the following encodings:\n" UTF-8, US-ASCII, ISO8859-1, UTF-16[BL]E, UCS-4[BL]E,\n" WINDOWS-1252, IBM1140, IBM037, IBM1047.\n"

-v=always will force validation
-v=never will not use any validation
-v=auto will validate if a DOCTYPE declaration or a schema declaration is present in the XML document

Here is a sample output from DOMPrint

cd &XercesC3InstallDir;/samples/data DOMPrint -v=always personal.xml <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE personnel SYSTEM "personal.dtd"> <!-- @version: --> <personnel> <person id="Big.Boss"> <name><family>Boss</family> <given>Big</given></name> <email>chief@foo.com</email> <link subordinates="one.worker two.worker three.worker four.worker five.worker"></link> </person> <person id="one.worker"> <name><family>Worker</family> <given>One</given></name> <email>one@foo.com</email> <link manager="Big.Boss"></link> </person> <person id="two.worker"> <name><family>Worker</family> <given>Two</given></name> <email>two@foo.com</email> <link manager="Big.Boss"></link> </person> <person id="three.worker"> <name><family>Worker</family> <given>Three</given></name> <email>three@foo.com</email> <link manager="Big.Boss"></link> </person> <person id="four.worker"> <name><family>Worker</family> <given>Four</given></name> <email>four@foo.com</email> <link manager="Big.Boss"></link> </person> <person id="five.worker"> <name><family>Worker</family> <given>Five</given></name> <email>five@foo.com</email> <link manager="Big.Boss"></link> </person> </personnel>

Note that DOMPrint does not reproduce the original XML file. DOMPrint and SAXPrint produce different results because of the way the two APIs store data and capture events.

Application needs to provide its own implementation of DOMErrorHandler (in this sample, the DOMPrintErrorHandler), if it would like to receive notification from the serializer in the case any error occurs during the serialization.

Application needs to provide its own implementation of DOMLSSerializerFilter (in this sample, the DOMPrintFilter), if it would like to filter out certain part of the DOM representation, but must be aware that thus may render the resultant XML stream invalid.

Application may choose any combination of characters as the end of line sequence to be used in the resultant XML stream, but must be aware that this may render the resultant XML stream ill formed.

Application may choose a particular encoding name in which the output XML stream should be, but must be aware that if unrepresentable in the encoding specified characters appear in the markup, it may force the serializer to terminate serialization prematurely, and thus no complete serialization would be done.

Application shall query the serializer first, before set any feature/mode(true, false), or be ready to catch exception if this feature/mode is not supported by the serializer.

Application needs to release the filter, error handler and format target objects created for the serialization.

xerces-c-3.2.2/doc/source-repository.xml000644 000765 000024 00000004473 13241416724 021063 0ustar00scantorstaff000000 000000

The &XercesCName; source code is stored in the Subversion repository (SVN). The SVN repository is public and everyone has read access. The repository uses a standard layout of:

https://svn.apache.org/repos/asf/xerces/c/ | | - branches/ | | - tags/ \ - trunk/

For example, to check out the trunk (the place where the main development is taking place), execute:

svn co https://svn.apache.org/repos/asf/xerces/c/trunk

To check out the code in the xerces-3.1 branch (the place where the development for the next 3.1-series release, if any, is taking place), execute:

svn co https://svn.apache.org/repos/asf/xerces/c/branches/xerces-3.1

To check out the code for the &XercesC3Version; release, execute:

svn co https://svn.apache.org/repos/asf/xerces/c/tags/Xerces-C_&XercesC3UVersion;

You can also browse the repository and examine individual files using the Web interface.

xerces-c-3.2.2/doc/faq-contributing.xml000644 000765 000024 00000022173 13241160343 020610 0ustar00scantorstaff000000 000000 I have a problem and I think I know how to fix it. How can I communicate my ideas to the &XercesCName; team?

To maximize the probability that your ideas will grab the attention of one of the &XercesCName; developers who knows about the area of the parser you're concerned with, you should follow these steps:

  1. Check out and build the most recent &XercesCName; code. For instructions on how to do this, see &XercesCName; Repository Information. If you do this, you can confirm that your bug still exists and has not been fixed since the last release.
  2. Write up your bug report as per the instructions described in the Bug-Reporting page.
  3. Describe why your solution works.
  4. Prepare a patch to fix &XercesCName; code. To do this, when you have applied your changes to a local copy of the most recent &XercesCName; source code, do svn diff file for each file you have changed. Keep in mind the coding guidelines for &XercesCName; as described below.
  5. Zip (or tar) up your patches. If you send them in the body of a message or bug report they are very difficult to apply.
  6. Submit a bug report to the &XercesCName; bug database as described on the Bug-Reporting page. Pick the product "&XercesCName;" (remembering to attach your patches and test code) or, if you think your patch might need some discussion, post it to the developer mailing list.
  7. If you are submitting a substantial amount of code, provide the information required in the Contributors section of the Project Charter.
What are the release policies for &XercesCName;?

The informal release policies for &XercesCName; are (using a versioning of version.release.modification):

  • We don't try to enforce binary compatibility between new versions and releases.
  • New versions and releases will be delivered when a certain number of bug fixes/new features have been added (as decided by the committers).
  • New modification levels will almost never be issued, the only exception is a showstopper bug encountered within a release.
  • Any normal bug is fixed only in the HEAD branch (latest development code).

The specific source and binary compatibility objectives for these release policies and the corresponding allowed source changes are:

  • x.x.x to x.x.y: the API is the same to ensure binary compatibility.
    • To maintain binary compatibility the allowed source code changes are:
      • Add new non-virtual functions.
      • Add new classes.
      • Add new STATIC data members.
    • To maintain binary compatibility you cannot:
      • Add new virtual functions as this will change the layout of the virtual function table.
      • Change the order of virtual functions in the class declaration.
      • Change the signature of a function (including adding additional parameters with defaults).
      • Change the access specifier (private/public/protected) on functions or data members as this may be part of the signature with some compilers.
      • Add new data members to a class (other than STATIC members).
      • Change the order of data members in the class declaration (other than STATIC members).
      • Change the class hierarchy (other than adding new classes).
    • Methods that are deprecated should be marked with the Doxygen tag @deprecated in the header file.
  • x.x.x to x.y.z: the API is source code compatible but not binary compatible (a recompilation of an application that uses the public headers of &XercesCName; should work).
    • This means that to maintain release to release source code compatibility the signature of public methods can only be changed by adding default parameters.
    • Signatures of private and protected methods can be changed and/or removed.
    • Methods that are deprecated should be marked with the Doxygen tag @deprecated in the header file.
  • x.x.x to a.b.c: the API may not be source code compatible and is not binary compatible (a recompilation of an application using &XercesCName; may fail).
    • In this situation, a separate branch of the code will be created so that bug fixes may be applied to the last version.
    • Deprecated methods may be removed. Deprecated methods that are removed should be documented in the migration information (migration.xml).
What are the coding conventions for &XercesCName;?

As with any coding effort, there are always arguments over what coding conventions to use. Everyone thinks that they have the best style which leads to the entire source tree looking different. This causes consternation as well as eye fatigue on subsequent developers that need to maintain the code. Therefore, we are going to make an attempt at defining some basic coding conventions for &XercesCName;. When committing files or providing patches please keep them in mind:

  1. All classes should have a constructor, destructor, assignment operator and copy constructor to avoid compiler generated default versions of these.
    • If a class contains only static methods, only a private constructor is required.
    • If a class contains any virtual methods, the destructor should be virtual.
    • If a class has a public or protected constructor, it should declare private assignment operator and copy constructor which are not implemented (unless of course you need either of these).
  2. If you add a catch(...) block be sure to add the following block catch(const OutOfMemoryException&) { throw; } so the OutOfMemory condition does not get absorbed.
  3. If you change the serialization format (by adding something to be serialized or removing something that was serialized) increment the XERCES_GRAMMAR_SERIALIZATION_LEVEL constant in XercesVersion.hpp.
  4. If a class allocates memory or is instantiated with new then it should inherit from XMemory.
  5. Use a tab size of 4 and insert them as spaces instead of keeping tabs.
  6. The code is written to be platform independent. Platform specific code should only be in the util/FileManagers, util/MutexManagers, util/Transcoders, util/MsgLoaders, and util/NetAccessors directories.
  7. The header file name and the source file name should both be named corresponding to the primary class they contain. For example class StringPool should be in the header file StringPool.hpp and in the source file StringPool.cpp.
  8. In general, code should be documented with comments. Use Doxygen tags to describe methods.
  9. The naming convention for enumerations should be chosen to be unique and descriptive (i.e. INVALID or UNKNOWN) to avoid colliding with predefined macros in other products. The current style of using ALL CAP enums should be phased out with Mixed Case instead, except for names specified in standards (for example, TEXT_NODE should not be converted to mixed case for standards compliance).
xerces-c-3.2.2/doc/program-others.xml000644 000765 000024 00000071356 13241160343 020314 0ustar00scantorstaff000000 000000

&XercesCName; defines a numeric preprocessor macro, _XERCES_VERSION, for users to introduce into their code to perform conditional compilation where the version of &XercesCName; is detected in order to enable or disable version specific capabilities. For example,

#if _XERCES_VERSION >= 30102 // Code specific to Xerces-C++ version 3.1.2 and later. #else // Old code. #endif

The minor and revision (patch level) numbers have two digits of resolution which means that '1' becomes '01' and '2' becomes '02' in this example.

There are also other string macros or constants to represent the Xerces-C++ version. Please refer to the xercesc/util/XercesVersion.hpp header for details.

&XercesCName; contains an implementation of the W3C XML Schema Language. See the XML Schema Support page for details.

In addition to using the parse() method to parse an XML File. You can use the other two parsing methods, parseFirst() and parseNext() to do the so called progressive parsing. This way you don't have to depend on throwing an exception to terminate the parsing operation.

Calling parseFirst() will cause the DTD (both internal and external subsets), and any pre-content, i.e. everything up to but not including the root element, to be parsed. Subsequent calls to parseNext() will cause one more pieces of markup to be parsed, and propagated from the core scanning code to the parser (and hence either on to you if using SAX/SAX2 or into the DOM tree if using DOM).

You can quit the parse any time by just not calling parseNext() anymore and breaking out of the loop. When you call parseNext() and the end of the root element is the next piece of markup, the parser will continue on to the end of the file and return false, to let you know that the parse is done. So a typical progressive parse loop will look like this:

// Create a progressive scan token XMLPScanToken token; if (!parser.parseFirst(xmlFile, token)) { cerr << "scanFirst() failed\n" << endl; return 1; } // // We started ok, so lets call scanNext() // until we find what we want or hit the end. // bool gotMore = true; while (gotMore && !handler.getDone()) gotMore = parser.parseNext(token);

In this case, our event handler object (named 'handler') is watching for some criteria and will return a status from its getDone() method. Since the handler sees the SAX events coming out of the SAXParser, it can tell when it finds what it wants. So we loop until we get no more data or our handler indicates that it saw what it wanted to see.

When doing non-progressive parses, the parser can easily know when the parse is complete and insure that any used resources are cleaned up. Even in the case of a fatal parsing error, it can clean up all per-parse resources. However, when progressive parsing is done, the client code doing the parse loop might choose to stop the parse before the end of the primary file is reached. In such cases, the parser will not know that the parse has ended, so any resources will not be reclaimed until the parser is destroyed or another parse is started.

This might not seem like such a bad thing; however, in this case, the files and sockets which were opened in order to parse the referenced XML entities will remain open. This could cause serious problems. Therefore, you should destroy the parser instance in such cases, or restart another parse immediately. In a future release, a reset method will be provided to do this more cleanly.

Also note that you must create a scan token and pass it back in on each call. This insures that things don't get done out of sequence. When you call parseFirst() or parse(), any previous scan tokens are invalidated and will cause an error if used again. This prevents incorrect mixed use of the two different parsing schemes or incorrect calls to parseNext().

&XercesCName; provides a function to pre-parse the grammar so that users can check for any syntax error before using the grammar. Users can also optionally cache these pre-parsed grammars for later use during actual parsing.

Here is an example:

XercesDOMParser parser; // Enable schema processing. parser.setDoSchema(true); parser.setDONamespaces(true); // Let's preparse the schema grammar (.xsd) and cache it. Grammar* grammar = parser.loadGrammar(xmlFile, Grammar::SchemaGrammarType, true);

Besides caching pre-parsed schema grammars, users can also cache any grammars encountered during an xml document parse.

Here is an example:

SAXParser parser; // Enable grammar caching by setting cacheGrammarFromParse to true. // The parser will cache any encountered grammars if it does not // exist in the pool. // If the grammar is DTD, no internal subset is allowed. parser.cacheGrammarFromParse(true); // Let's parse our xml file (DTD grammar) parser.parse(xmlFile); // We can get the grammar where the root element was declared // by calling the parser's method getRootGrammar; // Note: The parser owns the grammar, and the user should not delete it. Grammar* grammar = parser.getRootGrammar();

We can use any previously cached grammars when parsing new xml documents. Here are some examples on how to use those cached grammars:

/** * Caching and reusing XML Schema (.xsd) grammar * Parse an XML document and cache its grammar set. Then, use the cached * grammar set in subsequent parses. */ XercesDOMParser parser; // Enable schema processing parser.setDoSchema(true); parser.setDoNamespaces(true); // Enable grammar caching parser.cacheGrammarFromParse(true); // Let's parse the XML document. The parser will cache any grammars encountered. parser.parse(xmlFile); // No need to enable re-use by setting useCachedGrammarInParse to true. It is // automatically enabled with grammar caching. for (int i=0; i< 3; i++) parser.parse(xmlFile); // This will flush the grammar pool parser.resetCachedGrammarPool(); /** * Caching and reusing DTD grammar * Preparse a grammar and cache it in the pool. Then, we use the cached grammar * when parsing XML documents. */ SAX2XMLReader* parser = XMLReaderFactory::createXMLReader(); // Load grammar and cache it parser->loadGrammar(dtdFile, Grammar::DTDGrammarType, true); // enable grammar reuse parser->setFeature(XMLUni::fgXercesUseCachedGrammarInParse, true); // Parse xml files parser->parse(xmlFile1); parser->parse(xmlFile2);

There are some limitations about caching and using cached grammars:

  • When caching/reusing DTD grammars, no internal subset is allowed.
  • When preparsing grammars with caching option enabled, if a grammar, in the result set, already exists in the pool (same namespace for schema or same system id for DTD), the entire set will not be cached. This behavior is the default but can be overridden for XML Schema caching. See the SAX/SAX2/DOM parser features for details.
  • When parsing an XML document with the grammar caching option enabled, the reuse option is also automatically enabled. We will only parse a grammar if it does not exist in the pool.

The &XercesCName; supports loadable message text. Although the current distribution only supports English, it is capable of supporting other languages. Anyone interested in contributing any translations should contact us. This would be an extremely useful service.

In order to support the local message loading services, all the error messages are captured in an XML file in the src/xercesc/NLS/ directory. There is a simple program, in the tools/NLS/Xlat/ directory, which can translate that text in various formats. It currently supports a simple 'in memory' format (i.e. an array of strings), the Win32 resource format, and the message catalog format. The 'in memory' format is intended for very simple installations or for use when porting to a new platform (since you can use it until you can get your own local message loading support done.)

In the src/xercesc/util/ directory, there is an XMLMsgLoader class. This is an abstraction from which any number of message loading services can be derived. Your platform driver file can create whichever type of message loader it wants to use on that platform. &XercesCName; currently has versions for the in memory format, the Win32 resource format, the message catalog format, and ICU message loader. Some of the platforms can support multiple message loaders, in which case a #define token is used to control which one is used. You can set this in your build projects to control the message loader type used.

&XercesCName; also supports pluggable transcoding services. The XMLTransService class is an abstract API that can be derived from, to support any desired transcoding service. XMLTranscoder is the abstract API for a particular instance of a transcoder for a particular encoding. The platform driver file decides what specific type of transcoder to use, which allows each platform to use its native transcoding services, or the ICU service if desired.

Implementations are provided for Win32 native services, ICU services, and the iconv services available on many Unix platforms. The Win32 version only provides native code page services, so it can only handle XML code in the intrinsic encodings ASCII, UTF-8, UTF-16 (Big/Small Endian), UCS4 (Big/Small Endian), EBCDIC code pages IBM037, IBM1047 and IBM1140 encodings, ISO-8859-1 (aka Latin1) and Windows-1252. The ICU version provides all of the encodings that ICU supports. The iconv version will support the encodings supported by the local system. You can use transcoders we provide or create your own if you feel ours are insufficient in some way, or if your platform requires an implementation that &XercesCName; does not provide.

All platform dependent code in &XercesCName; has been isolated to a couple of files, which should ease the porting effort. The src/xercesc/util directory contains all such files. In particular:

  • The src/xercesc/util/FileManagers directory contains implementations of file managers for various platforms.
  • The src/xercesc/util/MutexManagers directory contains implementations of mutex managers for various platforms.
  • The src/xercesc/util/Xerces_autoconf_const* files provide base definitions for various platforms.

Other concerns are:

  • Does ICU compile on your platform? If not, then you'll need to create a transcoder implementation that uses your local transcoding services. The iconv transcoder should work for you, though perhaps with some modifications.
  • What message loader will you use? To get started, you can use the "in memory" one, which is very simple and easy. Then, once you get going, you may want to adapt the message catalog message loader, or write one of your own that uses local services.
  • What should I define XMLCh to be? Please refer to What should I define XMLCh to be? for further details.

Finally, you need to decide about how to define XMLCh. Generally, XMLCh should be defined to be a type suitable for holding a utf-16 encoded (16 bit) value, usually an unsigned short.

All XML data is handled within &XercesCName; as strings of XMLCh characters. Regardless of the size of the type chosen, the data stored in variables of type XMLCh will always be utf-16 encoded values.

Unlike XMLCh, the encoding of wchar_t is platform dependent. Sometimes it is utf-16 (AIX, Windows), sometimes ucs-4 (Solaris, Linux), sometimes it is not based on Unicode at all (HP/UX, AS/400, system 390).

Some earlier releases of &XercesCName; defined XMLCh to be the same type as wchar_t on most platforms, with the goal of making it possible to pass XMLCh strings to library or system functions that were expecting wchar_t parameters. This approach has been abandoned because of

  • Portability problems with any code that assumes that the types of XMLCh and wchar_t are compatible
  • Excessive memory usage, especially in the DOM, on platforms with 32 bit wchar_t.
  • utf-16 encoded XMLCh is not always compatible with ucs-4 encoded wchar_t on Solaris and Linux. The problem occurs with Unicode characters with values greater than 64k; in ucs-4 the value is stored as a single 32 bit quantity. With utf-16, the value will be stored as a "surrogate pair" of two 16 bit values. Even with XMLCh equated to wchar_t, xerces will still create the utf-16 encoded surrogate pairs, which are illegal in ucs-4 encoded wchar_t strings.

&XercesCName; makes use of C++ namespace to make sure its definitions do not conflict with other libraries and applications. As a result applications must namespace-qualify all &XercesCName; classes, data and variables using the xercesc name. Alternatively, applications can use using xercesc::<Name>; declarations to make individual &XercesCName; names visible in the current scope or using namespace xercesc; definition to make all &XercesCName; names visible in the current scope.

While the above information should be sufficient for the majority of applications, for cases where several versions of the &XercesCName; library must be used in the same application, namespace versioning is provided. The following convenience macros can be used to access the &XercesCName; namespace names with versions embedded (see src/xercesc/util/XercesDefs.hpp):

#define XERCES_CPP_NAMESPACE_BEGIN namespace &XercesC3NSVersion; { #define XERCES_CPP_NAMESPACE_END } #define XERCES_CPP_NAMESPACE_USE using namespace &XercesC3NSVersion;; #define XERCES_CPP_NAMESPACE_QUALIFIER &XercesC3NSVersion;:: namespace &XercesC3NSVersion; { } namespace &XercesC3Namespace; = &XercesC3NSVersion;;

&XercesCName; provides mechanisms for Native Language Support (NLS). Even though the current distribution has only English message file, it is capable of supporting other languages once the translated version of the target language is available.

An application can specify the locale for the message loader in their very first invocation to XMLPlatformUtils::Initialize() by supplying a parameter for the target locale intended. The default locale is "en_US".

// Initialize the parser system try { XMLPlatformUtils::Initialize("fr_FR"); } catch () { }

&XercesCName; searches for message files at the location specified in the XERCESC_NLS_HOME environment variable and, if that is not set, at the default message directory, $XERCESCROOT/msg.

Application can specify an alternative location for the message files in their very first invocation to XMLPlatformUtils::Initialize() by supplying a parameter for the alternative location.

// Initialize the parser system try { XMLPlatformUtils::Initialize("en_US", "/usr/nls"); } catch () { }

&XercesCName; reports panic conditions encountered to the panic handler installed. The panic handler can take whatever action appropriate to handle the panic condition.

&XercesCName; allows application to provide a customized panic handler (class implementing the interface PanicHandler), in its very first invocation of XMLPlatformUtils::Initialize().

In the absence of an application-specific panic handler, &XercesCName; default panic handler is installed and used, which aborts program whenever a panic condition is encountered.

// Initialize the parser system try { PanicHandler* ph = new MyPanicHandler(); XMLPlatformUtils::Initialize("en_US", "/usr/nls", ph); } catch () { }

Certain applications wish to maintain precise control over memory allocation. This enables them to recover more easily from crashes of individual components, as well as to allocate memory more efficiently than a general-purpose OS-level procedure with no knowledge of the characteristics of the program making the requests for memory. In &XercesCName; this is supported via the Pluggable Memory Handler.

Users who wish to implement their own MemoryManager, an interface found in xercesc/framework/MemoryManager.hpp, need to implement only two methods:

// This method allocates requested memory. // the parameter is the requested memory size // A pointer to the allocated memory is returned. virtual void* allocate(XMLSize_t size) = 0; // This method deallocates memory // The parameter is a pointer to the allocated memory to be deleted virtual void deallocate(void* p) = 0;

To maximize the amount of flexibility that applications have in terms of controlling memory allocation, a MemoryManager instance may be set as part of the call to XMLPlatformUtils::Initialize() to allow for static initialization to be done with the given MemoryHandler; a (possibly different) MemoryManager may be passed in to the constructors of all Xerces parser objects as well, and all dynamic allocations within the parsers will make use of this object. Assuming that MyMemoryHandler is a class that implements the MemoryManager interface, here is a bit of pseudocode which illustrates these ideas:

MyMemoryHandler *mm_for_statics = new MyMemoryHandler(); MyMemoryHandler *mm_for_particular_parser = new MyMemoryManager(); // initialize the parser information; try/catch // removed for brevity XMLPlatformUtils::Initialize(XMLUni::fgXercescDefaultLocale, 0,0, mm_for_statics); // create a parser object XercesDOMParser *parser = new XercesDomParser(mm_for_particular_parser); // ... delete parser; XMLPlatformUtils::Terminate();

If a user provides a MemoryManager object to the parser, then the user owns that object. It is also important to note that &XercesCName; default implementation simply uses the global new and delete operators.

The purpose of the SecurityManager class is to permit applications a means to have the parser reject documents whose processing would otherwise consume large amounts of system resources. Malicious use of such documents could be used to launch a denial-of-service attack against a system running the parser. Initially, the SecurityManager only knows about attacks that can result from exponential entity expansion; this is the only known attack that involves processing a single XML document. Other, similar attacks can be launched if arbitrary schemas may be parsed; there already exist means (via use of the EntityResolver interface) by which applications can deny processing of untrusted schemas. In future, the SecurityManager will be expanded to take these other exploits into account.

The SecurityManager class is very simple: It will contain getters and setters corresponding to each known variety of exploit. These will reflect limits that the application may impose on the parser with respect to the processing of various XML constructs. When an instance of SecurityManager is instantiated, default values for these limits will be provided that should suit most applications.

By default, &XercesCName; is a wholly conformant XML parser; that is, no security-related considerations will be observed by default. An application must provide an instance of the SecurityManager class to a parser in order to make that parser behave in a security-conscious manner. For example:

SAXParser *myParser = new SAXParser(); SecurityManager *myManager = new SecurityManager(); myManager->setEntityExpansionLimit(100000); // larger than default myParser->setSecurityManager(myManager); // ... use the parser

Note that SecurityManager instances may be set on all kinds of &XercesCName; parsers; please see the documentation for the individual parsers for details.

Note also that the application always owns the SecurityManager instance. The default SecurityManager that &XercesCName; provides is not thread-safe; although it only uses primitive operations at the moment, users may need to extend the class with a thread-safe implementation on some platforms.

For performance and modularity &XercesCName; provides a mechanism for specifying the scanner to be used when scanning an XML document. Such mechanism will enable the creation of special purpose scanners that can be easily plugged in.

&XercesCName; supports the following scanners:

The WFXMLScanner is a non-validating scanner which performs well-formedness check only. It does not do any DTD/XMLSchema processing. If the XML document contains a DOCTYPE, it will be silently ignored (i.e. no warning message is issued). Similarly, any schema specific attributes (e.g. schemaLocation), will be treated as normal element attributes. Setting grammar specific features/properties will have no effect on its behavior (e.g. setLoadExternalDTD(true) is ignored).

// Create a DOM parser XercesDOMParser parser; // Specify scanner name parser.useScanner(XMLUni::fgWFXMLScanner); // Specify other parser features, e.g. parser.setDoNamespaces(true);

The DGXMLScanner handles XML documents with DOCTYPE information. It does not do any XMLSchema processing, which means that any schema specific attributes (e.g. schemaLocation), will be treated as normal element attributes. Setting schema grammar specific features/properties will have no effect on its behavior (e.g. setDoSchema(true) and setLoadSchema(true) are ignored).

// Create a SAX parser SAXParser parser; // Specify scanner name parser.useScanner(XMLUni::fgDGXMLScanner); // Specify other parser features, e.g. parser.setLoadExternalDTD(true);

The SGXMLScanner handles XML documents with XML schema grammar information. If the XML document contains a DOCTYPE, it will be ignored. Namespace and schema processing features are on by default, and setting them to off has not effect.

// Create a SAX2 parser SAX2XMLReader* parser = XMLReaderFactory::createXMLReader(); // Specify scanner name parser->setProperty(XMLUni::fgXercesScannerName, (void *)XMLUni::fgSGXMLScanner); // Specify other parser features, e.g. parser->setFeature(XMLUni::fgXercesSchemaFullChecking, false);

The IGXMLScanner is an integrated scanner and handles XML documents with DTD and/or XML schema grammar. This is the default scanner used by the various parsers if no scanner is specified.

// Create a DOMLSParser parser DOMLSParser *parser = ((DOMImplementationLS*)impl)->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); // Specify scanner name - This is optional as IGXMLScanner is the default parser->getDomConfig()->setParameter( XMLUni::fgXercesScannerName, (void *)XMLUni::fgIGXMLScanner); // Specify other parser features, e.g. parser->getDomConfig()->setParameter(XMLUni::fgDOMNamespaces, doNamespaces); parser->getDomConfig()->setParameter(XMLUni::fgXercesSchema, doSchema);
xerces-c-3.2.2/doc/secadv.xml000644 000765 000024 00000004064 13245660267 016616 0ustar00scantorstaff000000 000000

The following security advisories apply to versions of Xerces-C older than V3.2.1:

  • CVE-2017-12627: Apache Xerces-C DTD vulnerability processing external paths

The following security advisories apply to versions of Xerces-C older than V3.1.4:

  • CVE-2016-4463: Apache Xerces-C XML Parser Crashes on Malformed DTD

The following security advisories apply to versions of Xerces-C older than V3.1.3:

  • CVE-2016-0729: Apache Xerces-C XML Parser Crashes on Malformed Input

The following security advisories apply to versions of Xerces-C older than V3.1.2:

  • CVE-2015-0252: Apache Xerces-C XML Parser Crashes on Malformed Input
xerces-c-3.2.2/doc/install.xml000644 000765 000024 00000020514 13241160343 016777 0ustar00scantorstaff000000 000000

This section contains installation instructions for the Windows platform.

The &XercesCName; source is available in the source distribution: &XercesC3SrcInstallDir;.zip.

Install the &XercesCName; source distribution by using unzip on the &XercesC3SrcInstallDir;.zip archive in the Windows environment. You can use WinZip, or any other UnZip utility:

unzip &XercesC3SrcInstallDir;.zip

This creates the '&XercesC3SrcInstallDir;' sub-directory containing the &XercesCName; source distribution.

To build the &XercesCName; source after installation, please follow the Build Instructions.

This section contains installation instructions for the UNIX, Linux, and Mac OS X platforms.

The &XercesCName; source is available in the source distribution: &XercesC3SrcInstallDir;.tar.gz (other formats also available).

Install the &XercesCName; source distribution &XercesC3SrcInstallDir;.tar.gz by extracting the files from the compressed archive:

gzip -d &XercesC3SrcInstallDir;.tar.gz tar -xf &XercesC3SrcInstallDir;.tar

This creates the '&XercesC3SrcInstallDir;' sub-directory containing the &XercesCName; source distribution.

To build the &XercesCName; source after installation, please follow the Build Instructions.

This section contains installation instructions for the Cygwin platform.

The &XercesCName; source is available in the source distribution: &XercesC3SrcInstallDir;.tar.gz (other formats available).

Install the &XercesCName; source distribution &XercesC3SrcInstallDir;.tar.gz by extracting the files from the compressed archive:

tar -xfz &XercesC3SrcInstallDir;.tar.gz

This creates the '&XercesC3SrcInstallDir;' sub-directory containing the &XercesCName; source distribution.

To build the &XercesCName; source after installation, please follow the Build Instructions.

Precompiled Xerces-C++ libraries for Cygwin may be provided as part of the Cygwin package repository. To install the binary distribution run Cygwin setup.exe. When you reach the Packages step of the Cygwin Setup wizard, expand the Devel category, then click in the New column next to "xerces-c-devel" until it reads "&XercesC3Version;-X".

xerces-c-3.2.2/doc/domcount.xml000644 000765 000024 00000005474 13241160343 017171 0ustar00scantorstaff000000 000000

DOMCount uses the provided DOM API to parse an XML file, construct the DOM tree and walk through the tree counting the elements (using just one API call).

The DOMCount sample parses an XML file and prints out the number of elements in the file. To run DOMCount, enter the following

DOMCount <XML file>

The following parameters may be set from the command line

Usage: DOMCount [options] <XML file | List file> This program invokes the DOMLSParser, builds the DOM tree, and then prints the number of elements found in each XML file. Options: -l Indicate the input file is a List File that has a list of xml files. Default to off (Input file is an XML file). -v=xxx Validation scheme [always | never | auto*]. -n Enable namespace processing. Defaults to off. -s Enable schema processing. Defaults to off. -f Enable full schema constraint checking. Defaults to off. -d Disallow doctype. Defaults to off. -locale=ll_CC specify the locale, default: en_US -p Print out names of elements and attributes encountered. -? Show this help. * = Default if not provided explicitly.

-v=always will force validation
-v=never will not use any validation
-v=auto will validate if a DOCTYPE declaration or a schema declaration is present in the XML document

Here is a sample output from DOMCount

cd &XercesC3InstallDir;/samples/data DOMCount -v=always personal.xml personal.xml: 20 ms (37 elems) The time reported by the system may be different, depending on your processor speed.
xerces-c-3.2.2/doc/CMakeLists.txt000644 000765 000024 00000010502 13241416724 017352 0ustar00scantorstaff000000 000000 # CMake build for xerces-c # # Written by Roger Leigh # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Install docs. Install from source tree if pre-generated, then the # build tree if generated during the build. file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html") install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/html" DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT "development") install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT "development") # Add createdocs target (if Java is available, plus the needed jars) find_package(Java COMPONENTS Runtime) if(Java_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/tools/jars/stylebook-1.0-b2.jar" AND EXISTS "${PROJECT_SOURCE_DIR}/tools/jars/xalan.jar" AND EXISTS "${PROJECT_SOURCE_DIR}/tools/jars/xerces.jar") if(UNIX) set(cpsep ":") else() set(cpsep ";") endif() set(classpath "${PROJECT_SOURCE_DIR}/tools/jars/stylebook-1.0-b2.jar${cpsep}${PROJECT_SOURCE_DIR}/tools/jars/xalan.jar${cpsep}${PROJECT_SOURCE_DIR}/tools/jars/xerces.jar") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doc/style/dtd}") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/style/dtd/entities.ent.in ${CMAKE_CURRENT_BINARY_DIR}/style/dtd/entities.ent @ONLY) add_custom_target(createdocs COMMAND "${CMAKE_COMMAND}" -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/style ${CMAKE_CURRENT_BINARY_DIR}/style COMMAND "${Java_JAVA_EXECUTABLE}" -Djava.awt.headless=true -classpath "${classpath}" org.apache.stylebook.StyleBook "targetDirectory=${CMAKE_CURRENT_BINARY_DIR}/html" ${CMAKE_CURRENT_SOURCE_DIR}/xerces-c_book.xml ${CMAKE_CURRENT_BINARY_DIR}/style WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ) set_target_properties(createdocs PROPERTIES FOLDER "Documentation") endif() # Add createapidocs target (if doxygen is available) find_program(DOXYGEN_EXECUTABLE doxygen) if(DOXYGEN_EXECUTABLE) set(VERSION "${PROJECT_VERSION}") set(abs_top_srcdir "${PROJECT_SOURCE_DIR}") set(abs_top_builddir "${PROJECT_BINARY_DIR}") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) add_custom_target(createapidocs COMMAND "${DOXYGEN_EXECUTABLE}" Doxyfile WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ) set_target_properties(createapidocs PROPERTIES FOLDER "Documentation") endif() # Add docs to IDE file(GLOB doc_xml "${CMAKE_CURRENT_SOURCE_DIR}/*.xml") file(GLOB doc_style "${CMAKE_CURRENT_SOURCE_DIR}/style/dtd/*.ent" "${CMAKE_CURRENT_SOURCE_DIR}/style/graphics/*.gif" "${CMAKE_CURRENT_SOURCE_DIR}/style/*.xml" "${CMAKE_CURRENT_SOURCE_DIR}/style/resources/*.gif" "${CMAKE_CURRENT_SOURCE_DIR}/style/stylesheets/*.xsl") add_custom_target(doc-xml SOURCES ${doc_xml}) set_target_properties(doc-xml PROPERTIES FOLDER "Documentation") add_custom_target(doc-style SOURCES ${doc_style}) set_target_properties(doc-style PROPERTIES FOLDER "Documentation") # Source file grouping (for IDE project layout) set(source_files ${doc_style}) list(SORT source_files) unset(group_dir) unset(group_files) foreach(file IN LISTS source_files) get_filename_component(dir "${file}" PATH) file(RELATIVE_PATH dir "${CMAKE_CURRENT_SOURCE_DIR}" "${dir}") if(group_dir AND NOT dir STREQUAL group_dir) if(group_files) source_group("${group_dir}" FILES ${group_files}) endif() unset(group_files) endif() list(APPEND group_files "${file}") set(group_dir "${dir}") endforeach() if(group_files) source_group("${group_dir}" FILES ${group_files}) endif() unset(group_dir) unset(group_files) xerces-c-3.2.2/doc/download.xml000644 000765 000024 00000016013 13241160343 017137 0ustar00scantorstaff000000 000000

Use the links below to download &XercesCName; from one of our mirrors. You must verify the integrity of the downloaded files using signatures downloaded from our main distribution directory.

You can download the &XercesCName; distributions from the master distribution directory or, preferably, its mirror. Only current recommended releases are available on the main distribution site and its mirrors.

Older releases are available from the archive download site, but you should be aware that there is a lot of accumulated "cruft" in the archives, and many confusingly named files. Anything labeled "current" is likely not.

The currently selected mirror is [preferred]. If you encounter a problem with this mirror, please select another mirror. If all mirrors are failing, there are backup mirrors (at the end of the mirrors list) that should be available.

Other mirrors:

You may also consult the complete list of mirrors.

The &XercesCName; &XercesCLatest; release is available in source code distributions only. If binaries are produced at a future point, this page will be updated.

xerces-c-&XercesCLatest;.zip [PGP] [MD5] [SHA1] [SHA2]
xerces-c-&XercesCLatest;.tar.gz [PGP] [MD5] [SHA1] [SHA2]
xerces-c-&XercesCLatest;.tar.bz2 [PGP] [MD5] [SHA1] [SHA2]
xerces-c-&XercesCLatest;.tar.xz [PGP] [MD5] [SHA1] [SHA2]

It is essential that you verify the integrity of the downloaded files using the PGP or MD5/SHA files. Please read Verifying HTTP Server Releases for more information on why you should verify our releases.

The PGP signatures can be verified using PGP or GPG. First download the &XercesCName; KEYS as well as the .asc signature file for the particular distribution. Make sure you get these files from the main distribution directory, rather than from a mirror. Then verify the signatures using:

% pgpk -a KEYS % pgpv <distribution-name>.asc

or

% pgp -ka KEYS % pgp <distribution-name>.asc

or

% gpg --import KEYS % gpg --verify <distribution-name>.asc

Alternatively, you can verify the digests on the files. A command line program called md5 or md5sum is included in most UNIX distributions. It is also available as part of GNU Textutils. Windows users can get binary md5 programs from here, here, or here.

xerces-c-3.2.2/doc/faq-build.xml000644 000765 000024 00000011273 13241160344 017200 0ustar00scantorstaff000000 000000 Why do I get compilation error saying DOMDocument was declared twice using Microsoft Visual C++?

Your application somehow has picked up the Microsoft SDK header Msxml.h which has its own typedef of DOMDocument. This confuses with the &XercesCName; &XercesC3Version; &XercesC3Namespace;::DOMDocument and thus lead to the compilation errors.

Qualifier the use of DOMDocument in your application explicitly e.g.,

xercesc::DOMDocument* doc;

will eliminate these compilation problems. Alternatively, you may want to get rid of the Msxml.h header inclusion.

Why does my application give unresolved linking errors?

Please check the following:

  1. Verify that you have specified the appropriate option and library path in the linker command line
  2. If you're using the binary build of &XercesCName;, make sure that the CPU architecture, OS, and compiler are the same as the ones used to build the application. Different OS and compiler versions might cause unresolved linking problems or compilation errors. If the versions are different, rebuild the &XercesCName; library on your system before building your application.
  3. If you are using Microsoft Visual Studio 2003 (7.1), 2005 (8.0), or 2008 (9.0), check that the "Treat wchar_t as a built-in type" option has been set to the same value as used to build &XercesCName;. The binary distribution for Visual Studio 7.1 is built with this option turned off. The binary distributions for Visual Studio 8.0 and 9.0 are built with this option turned on.
I cannot run the sample applications. What is wrong?

In order to run an application built using &XercesCProjectName; you must set up your path and library search path properly. For more information refer to the Installation instructions.

Why my document is valid on some platform while invalid on others?

The parser relies on the system call, strtod(), to parse a string representation of a double/float data. In the case of no invalid characters found, the strtod() returns a double/float value if it is representable on that platform, or raises ERANGE to indicate either underflow or underflow occurs. And the parser assigns zero to the said data if underflow is found.

The threshold, where the strtod() decides if an underflow occurs, varies on platforms. On Windows, it is roughly the order of e-308, on Linux, e-325, and on AIX, HP-UX and Solaris, e-324.

So in an instance document, a data of value 1.0e-310 from a type with minExclusive 0, is considered invalid on windows (since it is converted to 0 and therefore violates the minExclusive constraint), but valid on other Unix platforms (since it remains the original value).

The discussion above applies to data in xsd file as well.

xerces-c-3.2.2/doc/xinclude.xml000644 000765 000024 00000003224 13241160343 017143 0ustar00scantorstaff000000 000000

The XInclude example uses the provided DOM API to parse an XML file while expanding the xi:include elements. It then writes the resulting DOM tree in the expanded form.

The XInclude sample converts an input XML file into an expanded output XML file. To run XInclude, enter the following

XInclude <Input XML file> <Output XML file>

The following parameters may be set from the command line

Usage: XInclude [-h] InputFile OutputFile -h : Prints this help message and exits.
xerces-c-3.2.2/doc/build.xml000644 000765 000024 00000061554 13272177434 016456 0ustar00scantorstaff000000 000000

Build instructions are provided for the following platforms and compilers:

  • All platforms
  • UNIX/Linux/Mac OS X/Cygwin/MinGW

For building on any platform with any supported build system &XercesCName; uses the CMake build generator and requires that you have CMake installed. Additionally, a build tool such as GNU make or Ninja is required for building. CMake supports a wide range of generators for several different compilers, build tools and popular IDEs, including Eclipse, Kate, Visual Studio, Sublime Text and more. Any of these may be used to build &XercesCName;. Run cmake --help to display the full list of supported generators for your platform.

As with all CMake projects, the build process is divided into several parts: configuration and building, followed by (optional) testing and installation. The configuration part is performed by running the cmake command. The build part is performed by invoking the chosen build tool such as make or ninja, or by opening the generated project files in your IDE, and building from within the IDE.

Besides the standard cmake variables, &XercesCName; provides a number of project-specific options that are worth mentioning. You can specify one option for each category outlined below. If you do not specify anything for a particular category then cmake will select the most appropriate default, based upon the available options for your system. At the end of its execution cmake prints the selected values for each category.

Net Accessor (used to access network resources):

Option Description
-Dnetwork-accessor=curl use the libcurl library (only on UNIX)
-Dnetwork-accessor=socket use plain sockets (only on UNIX)
-Dnetwork-accessor=cfurl use the CFURL API (only on Mac OS X)
-Dnetwork-accessor=winsock use WinSock (only on Windows, Cygwin, MinGW)
-Dnetwork:BOOL=OFF disable network support

Transcoder (used to convert between internal UTF-16 and other encodings):

Option Description
-Dtranscoder=gnuiconv use the GNU iconv library
-Dtranscoder=iconv use the iconv library
-Dtranscoder=icu use the ICU library
-Dtranscoder=macosunicodeconverter use Mac OS X APIs (only on Mac OS X)
-Dtranscoder=windows use Windows APIs (only on Windows and MinGW)

Message Loader (used to access diagnostics messages):

Option Description
-Dmessage-loader=inmemory store the messages in memory
-Dmessage-loader=icu store the messages using the ICU resource bundles
-Dmessage-loader=iconv store the messages in the iconv message catalog

XMLCh type (UTF-16 character type):

Option Description
-Dxmlch-type=char16_t use char16_t (requires a C++11 compiler)
-Dxmlch-type=uint16_t use uint16_t from <cstdint> or <stdint.h>, or another unsigned 16-bit type such as unsigned short if the standard types are unavailable
-Dxmlch-type=wchar_t use wchar_t (Windows only)

MFC debug support is enabled by default (Windows only) and can be disabled with the -Dmfc-debug:BOOL=OFF option.

Thread support is enabled by default and can be disabled with the -Dthreads:BOOL=OFF option. If disabled, it will not be possible to select a mutex manager other than nothreads. If enabled, one of the following mutex managers may be selected:

Option Description
-Dmutex-manager=standard Use Standard C++ mutex (requires a C++11 compiler)
-Dmutex-manager=posix Use POSIX threads (pthreads) mutex (only on UNIX and Cygwin)
-Dmutex-manager=windows Use Windows threads mutex (Windows and MinGW only)
-Dmutex-manager=nothreads Use dummy implementation (default if threading is disabled)

Shared libraries are built by default. You can use the -DBUILD_SHARED_LIBS:BOOL=OFF option to build static libraries.

If you need to specify compiler executables that should be used to build &XercesCName;, you can set the CC and CXX environment variables when invoking cmake. Similarly, if you need to specify additional compiler or linker options, you can set the CFLAGS, CXXFLAGS, and LDFLAGS environment variables. For example:

CC=gcc-5.3 CXX=g++-5.3 CFLAGS=-O3 CXXFLAGS=-O3 cmake ... If building on Windows, the specific Visual Studio version may be selected with some generators, and this may be run from a normal command prompt. If using a generic generator such as Ninja, then cmake should be run from a Visual Studio command prompt, or in a suitably configured environment, so that the correct compiler will be detected.

Once the configuration part is complete you can run the build tool of choice. This may be done generically using cmake --build . [--config=Debug|Release]. Alternatively, a specific build tool, e.g. make, gmake, ninja or msbuild corresponding to the chosen generator may be used directly. When invoked without a specific target, it will build the &XercesCName; library, all examples and all unit tests.

If you would like to run the automated test suite, run ctest [-V] [-C Debug|Release]. This will run all tests. Additional options are available, such as running a subset of the tests and running the tests in parallel. If any discrepancies in the output are detected, the differences will be displayed if a diff program is available.

Finally, install the library and examples. This may be done generically using cmake --build . --target install. Alternatively, a specific build tool may be used, e.g. make install. To change the installation directory, use the -DCMAKE_INSTALL_PREFIX=prefix cmake option.

Some platforms and configurations may require extra cmake options. Run cmake -LH to list the additional options, along with a short description for each. For each of the selection categories mentioned above, the help text will list the valid choices detected for your platform. Run cmake -LAH for all the additional advanced settings.

Several examples of configuring, building, testing and installing with CMake using different platforms, generators, and installation options are shown below:

Platform Generator Example
Any Ninja mkdir build
cd build
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/opt/xerces-c -DCMAKE_BUILD_TYPE=Release -Dnetwork-accessor=curl /path/to/xerces-c/source
ninja
ctest -V -j 8
ninja install
Unix Unix Makefiles mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/opt/xerces-c -DCMAKE_BUILD_TYPE=Debug -Dmessage-loader=icu /path/to/xerces-c/source
make -j8
make test
make install
Windows msbuild with VS2015 x64 mkdir build
cd build
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX=D:\libs    \path\to\xerces-c\source
cmake --build . --config Debug
ctest -V -C Debug -j 4
cmake --build . --config Debug --target install

Note that different UNIX platforms use different system environment variables for finding shared libraries. On Linux and Solaris, the environment variable name is LD_LIBRARY_PATH, on AIX it is LIBPATH, on Mac OS X it is DYLD_FALLBACK_LIBRARY_PATH, and on HP-UX it is SHLIB_PATH. Note that Windows is different from the UNIX platforms in the way it finds shared libraries at run time. While UNIX platforms may use the LD_LIBRARY_PATH environment variable, Windows uses the PATH environment variable if the library is not in the same directory as the executable.

For building on UNIX and UNIX-like (GNU/Linux, Max OS X, Cygwin, MinGW-MSYS) platforms &XercesCName; uses the GNU automake-based build systems and requires that you have GNU make installed. On some platforms GNU make is called gmake instead of make.

As with all automake-based projects the build process is divided into two parts: configuration and building. The configuration part is performed using the configure script that can be found in the &XercesC3SrcInstallDir; directory. The build part is performed by invoking make.

Besides the standard configure options which you can view by running configure --help, &XercesCName; provides a number of project-specific options that are worth mentioning. You can specify one option for each category outlined below. If you do not specify anything for a particular category then configure will select the most appropriate default. At the end of its execution configure prints the selected values for each category.

Net Accessor (used to access network resources):

Option Description
--enable-netaccessor-curl use the libcurl library
--enable-netaccessor-socket use plain sockets
--enable-netaccessor-cfurl use the CFURL API (only on Mac OS X)
--enable-netaccessor-winsock use WinSock (only on Windows, Cygwin, MinGW)
--disable-network disable network support

Transcoder (used to convert between internal UTF-16 and other encodings):

Option Description
--enable-transcoder-gnuiconv use the GNU iconv library
--enable-transcoder-iconv use the iconv library
--enable-transcoder-icu use the ICU library
--enable-transcoder-macosunicodeconverter use Mac OS X APIs (only on Mac OS X)
--enable-transcoder-windows use Windows APIs (only on Windows, Cygwin, MinGW)

Message Loader (used to access diagnostics messages):

Option Description
--enable-msgloader-inmemory store the messages in memory
--enable-msgloader-icu store the messages using the ICU resource bundles
--enable-msgloader-iconv store the messages in the iconv message catalog

XMLCh type (UTF-16 character type):

Option Description
--enable-xmlch-char16_t use char16_t (requires a C++11 compiler)
--enable-xmlch-uint16_t use uint16_t from <cstdint> or <stdint.h>, or another unsigned 16-bit type such as unsigned short if the standard types are unavailable
--enable-xmlch-wchar_t use wchar_t (Windows only)

Thread support is enabled by default and can be disabled with the --disable-threads option. If disabled, it will not be possible to select a mutex manager other than nothreads. If enabled, one of the following mutex managers may be selected:

Option Description
--enable-mutexmgr-standard Use Standard C++ mutex (requires a C++11 compiler)
--enable-mutexmgr-posix Use POSIX threads (pthreads) mutex (only on UNIX and Cygwin)
--enable-mutexmgr-windows Use Windows threads mutex (Windows and MinGW only)
--enable-mutexmgr-nothreads Use dummy implementation (default if threading is disabled)

By default configure selects both shared and static libraries. You can use the --disable-shared and --disable-static options to avoid building the version you don't need.

Finally, to make the build process cleaner the &XercesCName; build system hides actual compiler commands being executed by make. If you would like to see those then you can specify the --disable-pretty-make option.

If you need to specify compiler executables that should be used to build &XercesCName;, you can set the CC and CXX variables when invoking configure. Similarly, if you need to specify additional compiler or linker options, you can set the CFLAGS, CXXFLAGS, and LDFLAGS variables. For example:

./configure --disable-static CC=gcc-4.3 CXX=g++-4.3 CFLAGS=-O3 CXXFLAGS=-O3

Once the configuration part is complete you can run make (or gmake). Running make from the &XercesC3SrcInstallDir; directory builds &XercesCName; library and examples. The library is placed into the src/.libs directory. If you like to build only the library, you can run make from &XercesC3SrcInstallDir;/src.

If you would like to build the tests and run the automated test suite, run make check from the &XercesC3SrcInstallDir; directory. The automated test suite required Perl and the diff command.

Finally, to install the library and examples you can run make install (or gmake install). To change the installation directory, use the --prefix configure option.

Some platforms and configurations require extra configure and make options which are shown in the following table.

Platform Compiler Options
Solaris x86 Sun CC ./configure CXX=CC CC=cc
Solaris x86-64 Sun CC ./configure CXX=CC CC=cc CFLAGS=-xarch=amd64 CXXFLAGS=-xarch=amd64
(for newer Sun CC versions use -m64 instead of -xarch=amd64)
Solaris SPARC Sun CC ./configure CXX=CC CC=cc
Solaris SPARCv9 Sun CC ./configure CXX=CC CC=cc CFLAGS=-xarch=v9 CXXFLAGS=-xarch=v9
(for newer Sun CC versions use -m64 instead of -xarch=v9)
AIX PowerPC IBM XL C++ ./configure CXX=xlC_r CC=xlc_r
gmake libxerces_c_la_LDFLAGS=-qmkshrobj
AIX PowerPC-64 IBM XL C++ export OBJECT_MODE=64
./configure CXX=xlC_r CC=xlc_r CXXFLAGS=-q64 CFLAGS=-q64
gmake libxerces_c_la_LDFLAGS=-qmkshrobj
HP-UX IA-64-32 HP aCC ./configure CXX=aCC CC=aCC CFLAGS=-mt CXXFLAGS=-mt LDFLAGS=-mt
HP-UX IA-64 HP aCC ./configure CXX=aCC CC=aCC CFLAGS="-mt +DD64" CXXFLAGS="-mt +DD64" LDFLAGS="-mt +DD64"
Mac OS X x86-64 GCC ./configure CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64"
Mac OS X PowerPC-64 GCC ./configure CFLAGS="-arch ppc64" CXXFLAGS="-arch ppc64"
Mac OS X x86/PowerPC GCC ./configure --disable-dependency-tracking CFLAGS="-arch i386 -arch ppc" CXXFLAGS="-arch i386 -arch ppc"
Mingw x86 GCC ./configure LDFLAGS=-no-undefined
Cygwin x86 GCC ./configure LDFLAGS=-no-undefined

Note that different UNIX platforms use different system environment variable for finding shared libraries. On Linux and Solaris, the environment variable name is LD_LIBRARY_PATH, on AIX it is LIBPATH, on Mac OS X it is DYLD_LIBRARY_PATH, and on HP-UX it is SHLIB_PATH. Note that Cygwin and MinGW are different from the UNIX platforms in the way they find shared libraries at run time. While UNIX platforms may use the LD_LIBRARY_PATH environment variable, Cygwin and MinGW use the PATH environment variable. xerces-c-3.2.2/doc/stdinparse.xml000644 000765 000024 00000005766 13241160343 017521 0ustar00scantorstaff000000 000000

StdInParse demonstrates streaming XML data from standard input.

The StdInParse sample parses an XML file from standard input and prints out the number of elements in the file. To run StdInParse, enter the following:

StdInParse < <XML file>

The following parameters may be set from the command line

Usage: StdInParse [options] < <XML file> This program demonstrates streaming XML data from standard input. It then uses the SAX Parser, and prints the number of elements, attributes, spaces and characters found in the input, using SAX API. Options: -v=xxx Validation scheme [always | never | auto*]. -n Enable namespace processing. Defaults to off. -s Enable schema processing. Defaults to off. -f Enable full schema constraint checking. Defaults to off. -? Show this help. * = Default if not provided explicitly.

-v=always will force validation
-v=never will not use any validation
-v=auto will validate if a DOCTYPE declaration or a schema declaration is present in the XML document

Make sure that you run StdInParse in the samples/data directory.

Here is a sample output from StdInParse:

cd &XercesC3InstallDir;/samples/data StdInParse -v=always < personal.xml stdin: 10 ms (37 elems, 12 attrs, 0 spaces, 268 chars)

Running StdInParse with the validating parser gives a different result because ignorable white-space is counted separately from regular characters.

StdInParse -v=never < personal.xml stdin: 10 ms (37 elems, 12 attrs, 0 spaces, 268 chars)

Note that the sum of spaces and characters in both versions is the same.

The time reported by the program may be different depending on your processor speed.
xerces-c-3.2.2/doc/releases_archive.xml000644 000765 000024 00001356600 13345573230 020656 0ustar00scantorstaff000000 000000
  • Release Information for &XercesCName; 3.2.1
  • Release Information for &XercesCName; 3.2.0
  • Release Information for &XercesCName; 3.1.4
  • Release Information for &XercesCName; 3.1.3
  • Release Information for &XercesCName; 3.1.2
  • Release Information for &XercesCName; 3.1.1
  • Release Information for &XercesCName; 3.1.0
  • Release Information for &XercesCName; 3.0.1
  • Release Information for &XercesCName; 3.0.0
  • Release Information for &XercesCName; 2.8.0
  • Release Information for &XercesCName; 2.7.0
  • Release Information for &XercesCName; 2.6.0
  • Release Information for &XercesCName; 2.5.0
  • Release Information for &XercesCName; 2.4.0
  • Release Information for &XercesCName; 2.3.0
  • Release Information for &XercesCName; 2.2.0
  • Release Information for &XercesCName; 2.1.0
  • Release Information for &XercesCName; 2.0.0
  • Release Information for &XercesCName; 1.7.0
  • Release Information for &XercesCName; 1.6.0
  • Release Information for &XercesCName; 1.5.2
  • Release Information for &XercesCName; 1.5.1
  • Release Information for &XercesCName; 1.5.0
  • Release Information for &XercesCName; 1.4.0
  • Release Information for &XercesCName; 1.3.0
  • Release Information for &XercesCName; 1.2.0
  • Release Information for &XercesCName; 1.1.0
  • Release Information for &XercesCName; 1.0.1
  • Release Information for &XercesCName; 1.0.0
  • Release Information for &XercesCName; BETA

For a list of bug fixes in &XercesCName; 3.2.1, see the Release Notes

For a list of bug fixes in &XercesCName; 3.2.0, see the Release Notes

For a list of bug fixes in &XercesCName; 3.1.4, see the Release Notes

For a list of bug fixes in &XercesCName; 3.1.3, see the Release Notes

For a list of bug fixes in &XercesCName; 3.1.2, see the Release Notes

The following new features and bug fixes have been implemented in &XercesCName; 3.1.1:

Date Contributor Description
2010-04-21Boris KolpackovCheck that we have non-NULL host before trying to connect (XERCESC-1920).
2010-04-18Boris KolpackovRecover from the mismatching start/end even count which may happen when we continue parsing an invalid document (XERCESC-1919).
2010-04-16Boris KolpackovAdd Visual Studio 2010 projects and solution.
2010-04-16Boris KolpackovUse proper VC++ version in PDB file name.
2010-04-13Alberto MassariIf the transcoder doesn't process any input, throw an exception (XERCESC-1916).
2010-04-12Alberto MassariDelay the recursive expansion of includes until the document fragment has been placed in the final location (XERCESC-1918).
2010-04-12Alberto MassariThe code formatting a content model was skipping the cardinality indicators (*, +, ?) (XERCESC-1914).
2010-04-11Boris KolpackovFix a few bugs and memory leaks in XInclude code.
2010-04-11Boris KolpackovGive proper name to 64-bit PDB file in static build (XERCESC-1907).
2010-04-11Boris KolpackovSpelling fixes (XERCESC-1911).
2010-04-11Boris KolpackovDon't include cpuid.h if we are using intrin.h (XERCESC-1912).
2010-04-07Boris KolpackovFix socket leak.
2010-03-19Boris KolpackovSet scanner object on validation context. Needed during QName validation. Don't re-validate default/fixed values in preContentValidation when called from loadGrammar. This values are already validated in TraverseSchema.
2010-02-17Boris KolpackovRemove explicit setting of prefix for cloned elements and attributes since it is done properly by the create*() functions (XERCESC-1913).

The following new features and bug fixes have been implemented in &XercesCName; 3.1.0:

Date Contributor Description
2010-01-26Boris KolpackovRemove the "experimental" marker from the loadGrammar API.
2010-01-20John SnelsonFix an infinite loop bug in XML 1.1 NCName parsing.
2010-01-20Boris KolpackovGet rid of warnings uncovered with g++ -W -Wall.
2009-11-24Boris KolpackovDon't call u_init in ICU 3.6 and later.
2009-11-23Boris KolpackovStore the anonymous type count in the SchemaGrammar object.
2009-11-23Boris KolpackovSave the scope count to the grammar object in case we will be adding to this schema (multi-import case).
2009-11-23Boris KolpackovMark schema DOM representation as unavailable after the call to TraverseSchema.
2009-11-23Alberto MassariDon't use intrinsics in VS.NET 2003 since they are not available.
2009-11-23Boris KolpackovRedo libcurl check to avoid liking to the library when we don't use it. Also update the make pretty-printing code.
2009-11-20Boris KolpackovFix a bug in the new LocalFileFormatTarget buffering implementation.
2009-11-20Boris KolpackovClear the cached GrammarInfo list when calling resedCachedGrammarPool.
2009-11-20Boris KolpackovLimit the buffer growth in LocalFileFormatTarget to 64Kb. Optimize MemBufFormatTarget.
2009-11-20Boris KolpackovMake sure that imported schemas, as well as those loaded with loadGrammar or via the schemaLocation attributes get taken into account when we decide whether the schema in question has already been loaded.
2009-11-19Boris KolpackovImplement loading of multiple schemas with the same namespace in loadGrammar() when multi-import is enabled.
2009-11-19Boris KolpackovExtend multi-import support to schemas provided with the schemaLocation attributes (XERCESC-1659).
2009-11-18Boris KolpackovTry to switch to the XML Schema mode if we see xsi:type or xsi:nill (XERCESC-1263).
2009-11-18Boris KolpackovProvide a more descriptive error message for empty date-time type values (XERCESC-1703).
2009-11-18Boris KolpackovSkip the character that we just unescaped when searching for the next percent sign (XERCESC-1826).
2009-11-18Boris KolpackovRecognize a register-based authority in URI (XERCESC-1748, XERCESC-1747).
2009-11-18Boris KolpackovCommit a partial fix for XERCESC-1866 by David Bertoni.
2009-11-18Boris KolpackovLoad schemas specified with the external schema location properties even if the load-schema property is set to false (XERCESC-1713).
2009-11-17Boris KolpackovCatch and ignore exceptions in destructors (XERCESC-1898).
2009-11-13John SnelsonFixed DOMDocumentImpl::importNode() to copy the prefix of element and attribute nodes.
2009-11-13Alberto MassariAdd a variant to test for XERCESC-1893.
2009-11-13Boris KolpackovCall getDatatypeValidator before checking whether the schema has been imported.
2009-11-12Boris KolpackovRework the way we search for and detect the ICU and libcurl libraries (XERCESC-1892).
2009-11-11Boris KolpackovRework the binToText implementation and usage so that we don't need the XERCES_SIZEOF_* macros. This should allow using the same set of headers for 32 and 64-bit builds (XERCESC-1874).
2009-11-11Boris KolpackovFix ICU message loader makefile to handle dist properly.
2009-11-10Alberto MassariAs we now generate source files for the ICU message loader, use standard automake code.
2009-11-10Boris KolpackovRework compilation of ICU message loader resources (XERCESC-1882).
2009-11-10Boris KolpackovDo not complain that the XSD namespace is not imported (XERCESC-1896).
2009-11-05Boris KolpackovEnable multiple import handling in examples and test.
2009-11-05Boris KolpackovAllow the user to change the low water mark used by the parsers (XERCESC-1607).
2009-11-04Boris KolpackovFree resources if we throw from c-tors (XERCESC-1480).
2009-11-04Boris KolpackovRemove mentioning of XMLString::release (XERCESC-1847).
2009-11-04Boris KolpackovUse US-ASCII instead of USASCII.
2009-11-04Boris KolpackovExpand setNewLine() documentation (XERCESC-1507).
2009-11-04Boris KolpackovDisable throwing of an exception from the DOMLSParser::parse*() functions (XERCESC-1894).
2009-10-30Alberto MassariExport PDB also for static builds (XERCESC-1759).
2009-10-28Alberto MassariImplemented DOMLSParser::parseWithContext.
2009-10-28Alberto MassariWhen the base type for a complex type cannot be found in an imported schema that has already been processed, check if a simple type with the same name exists (XERCESC-1893).
2009-10-27Boris KolpackovCheck if glibtoolize exist. Otherwise call libtoolize.
2009-10-20James BerryFor builds with curl, use curl-config to get appropriate compiler and linker flags (XERCESC-1892).
2009-10-06Alberto MassariPlace the creation of token in the main function to avoid misalignments.
2009-09-04Alberto MassariWhen releasing an element, remove and release also its attributes (XERCESC-646).
2009-09-04Alberto MassariImprove support for DOMLSParserFilter: (1) if startElement() returned REJECT it was treated like SKIP, and it was changing the current parent node one time too much; (2) the acceptNode() callback was invoked on text nodes every time some data was added to them, potentially removing it many times; (3) the nodes rejected by the callback were not recycled, leading to the same memory footprint as they were accepted.
2009-09-02Alberto MassariPerformance improvements.
2009-08-28Alberto MassariThe test to detect if the CPU was SSE2-enabled using __get_cpuid was reversed; configure.ac was testing for the presence of emmintrin.h before detecting which compiler option turned on SSE2, and the header cannot be used until that switch has been set.
2009-08-28Alberto MassariIf a minOccurs/maxOccurs cannot be parsed in a valid integer because it's too big, assume it is 500.
2009-08-26Alberto MassariUse SSE2 instructions to speed up bit operations used in schema validation with large maxOccurs.
2009-08-26Alberto MassariThe invalid xs:float is now e-46, not e-39.
2009-08-25Alberto MassariUpdated documentation to reflect the change in limits for xs:float datatype.
2009-08-25Alberto MassariFixed memory leak; added optimization to the bitfield enumerator.
2009-08-24Alberto MassariImproved performance and reduced memory footprint of schema validation involving large maxOccurs: (1) the CMStateSet uses a sparsely allocated matrix to store the bits, resulting in less memory usage and faster bitwise operations (when analyzing an unallocated chunk, no operations are done); also, having moved the dynamic buffer data members into a separate structure, the space used by two pointers has been added to the cached bit fields, that is now 128 bits; (2) the DFA builder chooses the faster algorithm depending on the data being analyzed. The regression test for XERCESC-1051 now completes in 30 seconds instead of 80.
2009-08-21Alberto MassariWhen testing for simple type blocked substitutions, allow list and unions when base type is anySimpleType.
2009-08-21Alberto MassariWhen testing for blocked substitutions, check the entire inheritance chain.
2009-08-21Alberto MassariAdded optimizations forgotten in previous commit, plus tests.
2009-08-20Alberto MassariWhen retrieving an attribute of a schema declaration, specify its type so that the proper whitespace collapse operation can be performed.
2009-08-20Alberto MassariImproved validation of xsi:nil.
2009-08-14Alberto MassariMove the list with the imported targetNamespace in TraverseSchema, so that a schema can "see" what an imported schema imports (XERCESC-1249).
2009-08-14Alberto MassariWhen matching an XPath expression, don't accept a node only if it's the first branch of an union that matches. The XPath parser takes care of removing identical branches (XERCESC-809).
2009-08-14Alberto MassariIgnore the lax directive if an element has an xsi:type directive (XERCESC-1707).
2009-08-14Alberto MassariWhen storing a default/fixed value, use the canonical representation.
2009-08-14Alberto MassariUse an entity resolver to feed the grammar for the XML namespace.
2009-08-14Alberto MassariWhen building the key for identity constraints, use the topmost validator.
2009-08-13Alberto MassariName and reference to names should be whitespace collapsed.
2009-08-13Alberto MassariDon't manipulate the XPath expression to ensure it starts with "./" before parsing; add the proper token after the scanner phase.
2009-08-13Alberto MassariComplain if an identity constraint has an empty name.
2009-08-13Alberto MassariWhen placing a value in the identity constraint map, store the actual validator used, instead of the official one.
2009-08-13Alberto MassariInstead of using the FLT_MIN and FLT_MAX macros, use the XMLSchema definition of minimum and maximum value for a xs:float (XERCESC-1833).
2009-08-13Alberto MassariWhen the xsi:type attribute is present, don't emit validation errors complaining of a missing declaration (XERCESC-1481).
2009-08-13Alberto MassariAttributes in the xsi namespace were not whitespace-normalized.
2009-08-12Alberto MassariBlocked substitution was not checked when defined on a complex type (XERCESC-1568): (1) Blocked substitution should not be checked when xsi:type names the same original type; (2) Blocked substitution didn't check the bit of the restriction/extension, but it performed an equality check.
2009-08-12Alberto MassariWhen parsing a "block" attribute, an empty value means an empty set, not "use blockDefault".
2009-08-12Alberto MassariWhen parsing a "final" attribute, an empty value means an empty set, not "use finalDefault" (XERCESC-1716).
2009-08-12Alberto MassariWhen an identity constraint involves a QName, store the value using its Clark name so that values using different prefixes can be matched.
2009-08-11Alberto MassariWhen validating an annotation, report the location of the error in the source schema, not inside the annotation itself.
2009-08-10Alberto MassariTest that runs a few parse operations with an input stream that splits the source in bad locations.
2009-08-10Alberto MassariBefore assuming that a complex type has a simple type as base type simply because it has a data type validator, inspect the base type definition (XERCESC-697).
2009-08-10Alberto MassariBefore processing a schema location, remove the 0xFFFF characters present in the non-normalized attribute value (XERCESC-1831).
2009-08-10Alberto MassariIf a derived attribute is prohibited, don't check type substitution and fixed facet (XERCESC-961).
2009-08-10Alberto MassariDeprecate two symbols because of a typo in the name; added a version with the correct spelling.
2009-08-10Alberto MassariAdd check for NULL (XERCESC-1863).
2009-08-10Alberto MassariDon't report repetitions in the block/final schema attributes as errors. If a derived attribute is prohibited, don't check type substitution and fixed facet (XERCESC-961).
2009-08-05Alberto MassariOn Linux, iconv requires char*; on Solaris, const char*. Use autoconf to pick the correct code.
2009-08-05Alberto MassariAllow GNUiconv to be compiled on Solaris (XERCESC-1856).
2009-08-04Alberto MassariAllow platform with machine/endian.h to select the GNUiconv transcoder.
2009-08-04Alberto MassariAdd an autoconf test to verify if the compiler supports the matching operator delete (XERCESC-1380).
2009-07-30Alberto MassariBefore complaining that there are not enough child nodes, test the existing ones to be correct (XERCESC-1246).
2009-07-29Alberto MassariFix end position for fixed string pattern matching (XERCESC-1021).
2009-07-29Alberto MassariReport an error if more than one anyAttribute declaration is found, or if it is not the last declaration (XERCESC-1717).
2009-07-29Alberto MassariIf an imported schema had a keyref definition, all the others keyref definition ended up in that schema, and would not be enforced (XERCESC-1583).
2009-07-29Alberto MassariIf there is no complex type in the stack, fallback to the schema element definition, like it is done a few lines earlier (XERCESC-1808).
2009-07-29Alberto MassariWhen copying a context object, allocate new memory for fMatch and fOffsets only if the size of the data being copied is different, so that a user-provided fMatch object can be properly filled (XERCESC-1870).
2009-07-28Alberto MassariImprove scalability of identity checking by using a hash table whose hash value is computed on the canonical values of the values (XERCESC-1878).
2009-07-08Alberto MassariAdded methods defined in the Element Traversal specification (http://www.w3.org/TR/2008/REC-ElementTraversal-20081222/).
2009-06-30Alberto MassariInclude system-dependent files only if the appropriate macro is defined (XERCESC-1852).
2009-06-30Alberto MassariFix warning (XERCESC-1872).
2009-06-03Alberto MassariAvoid recursion when parsing simply nested DTD structures. This issue is referenced in the following document: CVE-2009-1885 (http://nvd.nist.gov/nvd.cfm?cvename=CVE-2009-1885). Thanks to Jukka Taimisto, Tero Rontti and Rauli Kaksonen from the CROSS project at Codenomicon Ltd. and CERT-FI for bringing this issue to our attention.
2009-06-03Alberto MassariImprove XSTSHarness to also run the XML Test Suite.
2009-05-28Alberto MassariAdd quotes around path in custom build command (XERCESC-1868).
2009-05-28Alberto MassariThe PDB file for VC 9.0 used "vc80" (XERCESC-1869).
2009-05-26Boris KolpackovCheck return value of getaddrinfo for non-zero instead of less-than-zero (XERCESC-1871).
2009-04-27Alberto MassariThe implementation of some methods didn't match exactly the signature (XERCESC-1867).
2009-04-23Boris KolpackovSave the scope count value in the SchemaGrammar object. This is necessary for the multiple import option to function correctly.
2009-03-30John SnelsonInitializing unitialized variables in TranscodeToStr and TranscodeFromStr (#XERCESC-1858).
2009-03-27John SnelsonFixed a bug when transcoding small strings using TranscodeToStr (XERCESC-1858).
2009-03-12Alberto MassariWhen the DOMLSInput contains a stringData buffer, the encoding of the source is XMLCh.

The following bugs have been fixed in &XercesCName; 3.0.1:

Date Contributor Description
2009-02-12Boris KolpackovMore robust handling of leading/trailing whitespaces (XERCESC-1838).
2009-02-12Boris KolpackovMinor documentation updates, including a fix for XERCESC-1848.
2009-02-10Boris KolpackovAdd --disable-rpath configure option.
2009-01-29Alberto MassariRemove class name from method declaration (XERCESC-1850).
2009-01-16John SnelsonFix a bug in the socket and winsock net accessors when a redirection response does not contain a "Location" header.
2009-01-16John SnelsonMake XMLMutex use the correct MemoryManager when it closes it's mutex.
2008-11-12Boris KolpackovDocumentation fixes (XERCESC-1841).
2008-10-30Alberto MassariBackport fixes for memory leaks.
2008-10-29Alberto MassariForce Borland projects to use CRLF EOL.
2008-10-39Alberto MassariThe wrong constructor was called, causing a memory leak (XERCESC-1840).
2008-10-23Alberto MassariFix memory leak (XERCESC-1834).
2008-10-21Boris KolpackovUpdate URLs in source code to point to the new pages.

The following new features and bug fixes have been implemented in &XercesCName; 3.0.0:

Date Contributor Description
2008-09-22Vitaly PrapirnyCreate Borland project for NetAccessor test.
2008-09-22Boris KolpackovAllow use of the Windows transcoder and net accessor on Cygwin but only if the user explicitly asks for it.
2008-09-19Alberto MassariAvoid DOMDocument definition from Windows SDK (XERCESC-1830).
2008-09-17Boris KolpackovPass raw names to start/endElement if namespaces are disabled. Patch by David Bertoni.
2008-09-17Boris KolpackovReimplement skippedString logic to handle "short" and "long" strings separately.
2008-09-17David BertoniTemporary fix for XERCESC-1827 along with sanity test case.
2008-09-16Boris KolpackovAvoid pretty-printing comments only in text-only nodes.
2008-09-16Boris KolpackovDo not add any whitespaces around CDATA sections and comments since they might be non-ignorable (XERCESC-1823).
2008-09-16Boris KolpackovAdd support for generating pkgconfig file. Patch by Jay Berkenbilt (XERCESC-1824).
2008-09-16Boris KolpackovPass proper memory manager to mutex.
2008-09-15Boris KolpackovAllow changing global DOMDocument heap parameters via overloaded Initialize().
2008-07-24Alberto MassariInclude winnt.h from the Platform SDK instead of winres.h from MFC.
2008-07-23Alberto MassariPerformance improvement.
2008-07-22Alberto MassariRemove the PCRE-like regular expression engine, and replace it with a XPath 2.0-compatible one (XERCESC-1816). Original patch by John Snelson, modified to fix an exception thrown when expressions negating a character class (e.g. [^\s]) were used.
2008-07-22Boris KolpackovXML to DOM parsing optimizations.
2008-07-21Boris KolpackovVarious optimizations.
2008-07-21Boris KolpackovRemove repetitive calls to the getOwnerDocument() virtual function and in some cases use the data member directly. Put DOMStringPool functionality directly into DOMDocumentImpl, make getPooledString() inline.
2008-07-19Boris KolpackovGet rid of unused MemoryManager argument in hash functions.
2008-07-17Alberto MassariFixed regression in determining lax/skip/strict processing of an xsd:any preceded by another xsd:any represented using compact syntax (XERCESC-1822).
2008-07-17Alberto MassariThe XSTS schema allows multiple schema files to be loaded before a test.
2008-07-17Alberto MassariWhen comparing two unions, use the validator that correctly parses both instances.
2008-07-17Alberto MassariIf an element cannot be found in the schema for its namespace, it is also searched in the empty namespace to see if the user mistakenly forgot about undefining the default namespace; in this case a better error report is generated and (if schema processing is allowed to continue) the empty namespace definition is taken. However, even if the empty namespace definition didn't pass a few checks, we ended up silently using it -> we changed the namespace of the element without notifying the user (XERCESC-1819).
2008-07-16Alberto MassariBuild a compact tree also for xsd:any nodes (XERCESC-1051). Reduce the memory required to build a DFA by creating a shallow CMNode hierarchy. Avoid stack overflow when analyzing non-compact model trees. Optimized the building of the DFA state table by avoiding linear searches.
2008-07-15Boris KolpackovCygwin is a POSIX emulation layer so use POSIX file manager, transcoder, path delimiter, and net accessor. Still using Windows mutex manager because of the problem in Cygwin pthread emulation.
2008-07-15Boris KolpackovRequire the exact match for the schema loader and storer version.
2008-07-15David BertoniFix for XERCESC-1806.
2008-07-15David BertoniMore cleanup for unsigned int/XMLSize_t changes and various compiler warnings.
2008-07-15David BertoniFix for XERCESC-1818.
2008-07-13Alberto MassariBackported fix for XERCESJ-773: build a representation of large minOccurs/maxOccurs in constant time and memory (which uses a counter during validation) for element and wildcard particles when each model group particle in the content model: has minOccurs/maxOccurs == 1 or contains only one element/wildcard particle with minOccurs/maxOccurs == 1. (XERCESC-1051).
2008-07-13Boris KolpackovUse mutex to synchronize access to global document. Fixes XERCESC-1652.
2008-07-12Boris KolpackovDisable automatic selection of ICU message loader when ICU is available (XERCESC-1769).
2008-07-11Boris KolpackovReview, cleanup and make consistent all error messages.
2008-07-09Boris KolpackovUse the ISO8859-1 encoding in net accessors. Add support for httpInfo in the curl net accessor. Patch by John Snelson (XERCESC-1805).
2008-07-09Alberto MassariAdded more checks to the XSD syntax.
2008-07-04Boris KolpackovIncrement XERCES_GRAMMAR_SERIALIZATION_LEVEL since the size of line/column fields has changed.
2008-07-04Boris KolpackovCleanup interfaces in parsers/ to use XMLSize_t.
2008-07-03Boris KolpackovCleanup public interfaces in framework/ to use XMLSize_t.
2008-07-02Alberto MassariUse the _wcsupr naming instead of wcsupr (only Visual C++ defines both, Borland only defines the version prefixed by the underscore).
2008-06-29Boris KolpackovAdd 64-bit support.
2008-06-28David BertoniFix for XERCESC-1813.
2008-06-27Boris KolpackovUse XMLFileLoc consistently to represent line/column. Clean up the SAX interface to use XMLSize_t instead of int/long.
2008-06-27Boris KolpackovAdd XMLFileLoc type (64-bit) that represents location in a file (line/column). Use it in DOM interfaces.
2008-06-26Alberto MassariAdded missing "Is" in front of the "MusicalSymbols" regex group.
2008-06-26Boris KolpackovUse XMLSize_t instead of int/long for indexes and sizes in DOM interfaces. Use enum types instead of short.
2008-06-26Alberto MassariDefine regular expression category \w as defined by the XMLSchema specs (XERCESC-541).
2008-06-25Boris KolpackovProvide a way to disable automatic loading of schemas specified in XML documents. Patch by Wouter Coene.
2008-06-25Boris KolpackovMove XMLGrammarPoolImpl from internal/ to framework/ so that it can be instantiated directly by the use.
2008-06-24Alberto MassariXSTSHarness now handles the 2006 version of the test suite.
2008-06-24Boris KolpackovImplement the revised interpretation of ##other in which unqualified names are not matched. Fixes XERCESC-1758, XERCESC-1655.
2008-06-22Boris KolpackovAdd getContentType function to the BinInputStream to allow stream to report out-of-band content type. Implement it in various streams. Factor out and cleanup common code from Socket and WinSock net accessors. Fix a number of bugs. Patch by John Snelson (XERCESC-1805).
2008-06-20Boris KolpackovChange the DOMXPathResult interface to accommodate both XPath 1 and 2 models. Return DOMXPathResult* instead of void* from evaluate. Add basic auto pointer operations to JanitorMemFunCall class template.
2008-06-19Boris KolpackovMake regular expressions thread-safe and use runtime memory manager when executing. Add new allMatches() function for advanced use-cases. Patch by John Snelson (XERCESC-1803).
2008-06-19Boris KolpackovDOM XPath support: Support for resolving default namespace. Support for removing namespace-prefix bindings. Additional documentation.
2008-05-21Alberto MassariAvoid that an external entity having an empty SYSTEM id is treated as internal (XERCESC-1763).
2008-05-20David CargillSchema fixes for e1-16 errata and full schema checking of any choice restricted by any.
2008-05-13Alberto MassariAdd addNamespaceBinding() and release() APIs to XPathNSResolver class (XERCESC-1802) - patch by John Snelson.
2008-05-13Alberto MassariDon't blindly subtract a number from an unsigned int, it could overflow (XERCESC-1804).
2008-05-01Alberto MassariRewrite the storage mechanism to avoid cast (XERCESC-1678).
2008-04-07Alberto MassariAvoid error messages where English words are specified at runtime.
2008-04-02Alberto MassariReplace copyrighted schema with a simple test case (XERCESC-1791).
2008-03-22Boris KolpackovFix XERCESC-1790. Other error messages cleanups.
2008-03-14Alberto MassariDOMPrint now shows how to run an XPath query on a DOM tree (XERCESC-1786).
2008-03-14Alberto MassariIf the XPath parser returns 'false', it means the XPath is invalid. (XERCESC-1787).
2008-03-14Alberto MassariIdentity constraints on xs:anySimpleType instances are enforced by comparing their lexical values (XERCESC-1393).
2008-03-11Boris KolpackovLock the mutex when performing cleanup in the WinSock net accessor.
2008-03-11Alberto MassariWhen looking for the best encoding, match both char size and endianness.
2008-03-11Alberto MassariAdd UTF16-LE and UTF16-BE to the list of encodings tested by GNUiconv (XERCESC-1663).
2008-03-10Boris KolpackovGet rid of lazy initialization that relied on double-checked locking. Now every static object is initialized in Initialize() and released in Terminate() via XMLInitializer.
2008-03-09Boris KolpackovGet rid of atomic operations.
2008-03-07Boris KolpackovNew RPM spec by Scott Cantor.
2008-03-03Boris KolpackovApply the fast DOM child append patch (XERCESC-1735).
2008-03-03Boris KolpackovAdjust DOM heap allocation parameters to be the same as in 2.8.0 which appears to give the best overall performance.
2008-02-26Alberto MassariAdd VC9 target, remove references to deprecated DOM.
2008-02-25Alberto MassariValidate the attributes of a simple type definition before trusting its content (XERCESC-1718).
2008-02-25Alberto MassariReport an error when a grammar or a type is not found (XERCESC-1745).
2008-02-21Alberto MassariAdded configuration to VC9 project files to build Xerces with the ICU transcoder.
2008-02-21Alberto MassariAdded configuration to VC8 project files to build Xerces with the ICU transcoder.
2008-02-21Alberto MassariAdded configuration to VC7.1 project files to build Xerces with the ICU transcoder.
2008-02-20Alberto MassariCheck for the callback pointer to be valid before each call, as a callback could be resetting it (XERCESC-1781).
2008-02-13Boris KolpackovMake sure the base type was provided when trying to resolve the schema grammar (addition to the previous fix) (XERCESC-1777).
2008-02-12Boris KolpackovIn restriction checking, when looking for a declaration of a base element, use the schema grammar corresponding to the type this element is declared in (XERCESC-1777).
2008-01-22Alberto MassariUpdate gMaxProtoLen to reflect the addition of "https" (XERCESC-1698).
2008-01-22Alberto MassariUse the same code as in the fopen.c sample from libcurl (XERCESC-1756).
2008-01-22Alberto MassariShow how to release a transcoded string (XERCESC-1767).
2008-01-22Alberto MassariFixed 64 bit issue (XERCESC-1768).
2007-11-21Alberto MassariAdd project files for Visual Studio 2008.
2007-10-08David CargillEncode characters for anyURI using xlink 5.4 algorithm. Patch from Gilbert Chan.
2007-08-30Alberto Massari- Don't allocate a stack unless the string to be matched is longer than 256 characters. Don't use backtracking if the regex pattern doesn't have ambiguities (XERCESC-1242).
2007-08-28Alberto Massari- SrcOffset is a XMLFilePos (64 bit). MsgLoader and Transcode API needed some more XMLSize_t (XERCESC-1531).
2007-08-24Alberto MassariAvoid recursion when checking for closures. Patch by Vitaly Prapirny (XERCESC-1242).
2007-07-30Alberto MassariThe GroupContentRestricted error is used for both 'sequence' and 'choice' models, so get the model at runtime (XERCESC-1724).
2007-07-18Alberto MassariParser interfaces now use XMLSize_t for characters, comment, ignorableWhitespace, docCharacters, doctypeWhitespace (XERCESC-1531).
2007-07-18Alberto MassariFixed signed/unsigned conversions (XERCESC-1531).
2007-07-18Alberto MassariSend the NODE_CLONED notification for each node in the tree when cloning the entire DOMDocument (XERCESC-1722).
2007-07-17Alberto MassariGNUIconv should not look at APP_NO_THREADS, and look at where endian.h is located (XERCESC-1709).
2007-07-11Alberto MassariLine numbers should use unsigned long (XERCESC-1531).
2007-07-11Alberto MassariXMLString, XMLBuffer and Base64 should use XMLSize_t (XERCESC-1531).
2007-07-10Alberto MassariXMLTransService should use XMLSize_t (XERCESC-1531).
2007-07-09Alberto MassariXSerializeEngine should use XMLSize_t (XERCESC-1531).
2007-07-06Alberto MassariAll lists and vectors should use unsigned int to report size and access items (XERCESC-1531).
2007-07-06Alberto MassariChanged MemBufInputSource to use XMLSize_t (XERCESC-1531).
2007-07-06Alberto MassariChanged XMLFormatTarget interface to have writeChars use XMLSize_t (XERCESC-1531).
2007-07-06Alberto MassariChanged XMLTransService interface to have transcodeFrom and transcodeTo use XMLSize_t (XERCESC-1531).
2007-07-06Alberto MassariChanged BinOutputStream interface to have curPos return a 64-bit integer, and use XMLSize_t in writeBytes (XERCESC-1531).
2007-07-06Alberto MassariChanged BinInputStream interface to have curPos return a 64-bit integer, and use XMLSize_t in readBytes (XERCESC-1531).
2007-06-09David CargillApply base whitespace facet to enumeration values. Patch from Gilbert Chan.
2007-06-09David CargillSuppress DTD error message for attribute referring to unknown entity when attribute not used. Patch from John Kim.
2007-05-21Alberto MassariIn the fix for XERCESC-1592, code to set xmlns="" that was moved from retrieveNamespaceMappping to preprocessSchema was not executed for imported schemas.
2007-05-15Alberto Massarimblen returns 0 when given an empty string; rewrote code to only use mbstowcs (XERCESC-1702).
2007-05-08Alberto MassariAdd https to the list of valid protocols for XMLURL (XERCESC-1698).
2007-04-25Alberto MassariAdd x64 target to VC8 project files.
2007-04-17Alberto MassariFix for XERCESC-1092.
2007-04-10Alberto MassariMake the header guards less obvious (XERCESC-1693).
2007-04-06Alberto MassariFix for XERCESC-1592.
2007-03-08Alberto MassariFixed infinite loop when an XPath expression contained an unexpected character (XERCESC-1682).
2007-03-06Alberto MassariIconvGNU and IconvFBSD transcoders override application-set locale, XERCESC-1660 (patch by Boris Kolpackov).
2007-03-02Alberto MassariInitial commit of XInclude support (by Simon Rowland).
2007-02-07Alberto MassariEven if the XSTS suite thinks differently, the XMLSchema 1.1 clarifies that two values derived from the same value space should be treated as equals; so find out the common ancestor and use it to perform the comparison.
2007-02-02Alberto MassariImplemented the DOML3 XPath interfaces, reusing the XPath processor used inside the XMLSchema validation; this means it understands only a limited subset of the XPath syntax, and can only return DOMElement nodes. However, it could be useful for simple navigations, or maybe be later expanded.
2007-01-30Alberto MassariAllow 'list' and 'union' in the finalDefault attribute of a schema (XERCESC-1633).
2007-01-30Alberto MassariFix backport of XERCESC-1237.
2007-01-30Alberto MassariOnly xs:key should complain if not all the fields of an identity constraint are not found in the XML instance (XERCESC-1237).
2007-01-02Alberto MassariWhen calling getAttributeNodeNS, ensure we are providing a localName (XERCESC-1473).
2006-12-18Alberto MassariThe 'dst' argument in the DOMUserDataHandler::handle callback is non-const, in order to let the application modify the newly created node (XERCESC-783).
2006-12-11Alberto MassariPerformance improvement: allocate memory only when the data inside the XMLElementDecl cannot be reused.
2006-12-01Alberto MassariUse the algorithm from http://unicode.org/unicode/faq/utf_bom.html#35 to encode/decode surrogate pairs (XERCESC-1654).
2006-10-20Alberto MassariEnable IPv6 addresses by using getaddrinfo when available [based on a patch by Ramanjaneyulu Malisetti].
2006-10-20Alberto MassariHandle both IPv4 and IPv6 on Windows (to be enabled via a macro, as it is only available starting with Windows XP) [based on a patch by Ramanjaneyulu Malisetti].
2006-10-20Alberto MassariReport the correct error when the XML PI has 'XML' instead of 'xml' (XERCESC-1641).
2006-10-16Alberto MassariAllow the user to specify the memory manager used by LSSerializer::writeToString.
2006-09-26Alberto MassariRemoved warnings (XERCESC-1619).
2006-09-26Alberto MassariMake some methods const (XERCESC-1628).
2006-09-26Alberto MassariWhen checking for a valid restriction, take into account substitution groups (XERCESC-1281).
2006-08-30Alberto MassariDon't crash if an external parameter entity has no SYSTEM id (XERCESC-1536).
2006-08-28Alberto MassariIconvGNU transcoder now works on big endian machines.
2006-08-23Alberto MassariDefault or fixed attribute values should be whitespace normalized, if the datatype requires it, before being validated.
2006-08-23Alberto MassariDOMLSParserImpl::loadGrammar should not release the previously loaded DOMDocument (XERCESC-1626).
2006-07-25Alberto MassariReduce the number of allocations needed by text and attribute nodes (XERCESC-1585).
2006-07-25Alberto MassariRemove support for building Xerces with VC7.
2006-07-04Alberto MassariRemoved usage of MB_CUR_MAX from iconv transcoder; if the block-oriented APIs are available, use them (XERCESC-1444, patch by Axel Weiss).
2006-06-12Alberto MassariAdded parameter space-first-level-elements to DOMLSSerializer to let the user control whether the children of the document root should have an extra line feed between them (XERCESC- 1561).
2006-05-30Alberto MassariSAX2XMLReader should use the prefix reported by the reader, not the one stored in the element declaration (XERCESC-1598).
2006-05-30Alberto MassariDGXMLScanner was treating predefined entities inside attribute values as if they were in the element content (XERCESC-1597).
2006-05-23James BerryFix for XERCESC-1595.
2006-05-12Alberto MassariAllow spaces in anyURIs, as they are 'legal but highly discouraged' (XERCESC-1581).
2006-03-19Alberto MassariFactory method is no more inline to avoid including an internal header in a public one (XERCESC-1579).
2006-02-28Alberto MassariRemove BOM-detection code inside refreshCharBuffer: the fix for XERCESC-1284 makes it unnecessary, and the UTF-8 part was updating the wrong index (XERCESC-1385).
2006-02-18Alberto MassariWhen serializing attribute values, escape also carriage returns and tabs (XERCESC-1547).
2006-02-18Alberto MassariIf an encoding has been forced on a InputSource, ignore a compatible BOM found in the stream (XERCESC-1284).
2006-02-06David BertoniPatch from Tobias Schuette for XERCESC-1491.
2006-01-21David BertoniFix for XERCESC-1555 from Mark Weaver.
2006-01-21David BertoniFixes for XERCESC-1548.
2006-01-16David CargillFix for XERCESC-1546. Canonical value of list was putting in an extra null character.
2006-01-16Alberto MassariWhen evaluating a union in a regular expression, take the branch that matches the longest part of the input string (XERCESC-1521).
2005-12-27Alberto MassariImprove validation performances when dealing with schemas with lots of top level definitions (XERCESC-1542).
2005-12-26Alberto MassariFix for XERCESC-1533 (default attributes in the definition for an element that is not validated because of errors would be added to the list of attributes even if already present).
2005-12-20Alberto MassariExpose the memory allocation functionalities of DOMDocumentImpl through the DOMMemoryManager interface; this removes dangerous casts in the operator new and allows to tune the size of the memory chunks (XERCESC-1475).
2005-12-14Alberto MassariWhen cloning or importing a node, also copy the type information (XERCESC- 1517).
2005-12-01Alberto MassariAdded projects for Visual Studio 2005.
2005-10-25Alberto MassariNodes that implement getFeature should also implement isSupported (XERCESC-1479).
2005-10-15David CargillMessage update for qname fix and XERCESC-1515.
2005-09-28Alberto Massariclosesocket should be dynamically bound (XERCESC-1467).
2005-08-26David CargillFix for XERCESC-1240.
2005-08-26David CargillFix for XERCESC-896.
2005-08-25David CargillFix for XERCESC-896.
2005-08-15David CargillSchema errata e2-67 fix, ported from java to allow [^+-].
2005-08-10David CargillRemove references to nonexist DOMSystemException. XERCESC-1400.
2005-08-10Alberto MassariDocumentation for Base64::decode now state how whitespace is treated (XERCESC-974).
2005-08-09Alberto MassariClose the socket even in case of exceptions being thrown (XERCESC-1467).
2005-08-08garethAdded comment to state the namespace info wont work with this parser. XERCESC-1377.
2005-07-28David CargillFollow-up fix to XERCESC-990. Allow lookup for imported schema with no namespace.
2005-07-27David BertoniFixes for XERCESC-1463.
2005-07-27David CargillSchema errata E2-27: don't have negative sign in front of zero.
2005-07-26Alberto MassariReset the flag used to signal a trailing space if the chunk doesn't end with a space (XERCESC-1239).
2005-07-25Alberto MassariAfter looking for the DOM element defining the required type we should use the registry to perform the lookup instead of assuming the one we just parsed is the right one (XERCESC-990).
2005-07-25David CargillFix problem where incorrect xsmodel was generated for UseCachedGrammarInParse.
2005-07-25David CargillFix various schema date time problems.
2005-07-20David CargillUpdate XMLDateTime to correctly test for timezone.
2005-07-20David CargillEmpty content for Base64Binary & HexBinary should be allowed.
2005-06-29Alberto MassariAdded getter methods for flags (XERCESC-1450).
2005-06-29Alberto MassariFix for XERCESC-1449.
2005-06-28Alberto MassariSchema errata E2-67: allow unescaped '-' at the beginning and end of a regex.
2005-06-17James BerryAdd const qualifier to getDocumentLocations to match interface (patch to 191040 for bug XERCESC-1153).
2005-06-17Alberto MassariXMLSchemaDescriptionImpl::getLocationHints() returns a const pointer (XERCESC-1153).
2005-06-17Alberto MassariDOMDocument::importNode accepts a const pointer (XERCESC-1223).
2005-06-11James BerryResolve bug XERCESC-1436. Header and implementation of OpFactory used inconsistent function signature. Thanks to Axel Weiss.
2005-06-08David BertoniFixes for XERCESC-1409.
2005-06-08David CargillFix for XERCESC-1423 from Christian.
2005-06-06David BertoniFixes for XERCESC-1368.
2005-06-04David BertoniPatch for XERCESC-1420.
2005-06-03David BertoniFixes for XERCESC-1348.
2005-06-03David CargillFix for XERCESC-1115. Allow zero length content.
2005-06-03David BertoniFixes for XERCESC-1417.
2005-06-02David CargillDon't treat characters 0x2028 and 0x85 as plain characters in XML 1.1.
2005-06-02David CargillSchema errata update. Ignore length, minLength and maxLength facets for qname and notation.

The following new features and bug fixes have been implemented in &XercesCName; 2.8.0:

Date Contributor Description
2007-08-23Scott CantorRPM spec file update to support 64 bit builds (XERCESC-1740)
2007-08-22Boris KolpackovRemove option to explicitly link against libc.
2007-08-22Alberto MassariRename afxres.h to winres.h (XERCESC-1737).
2007-08-21Boris KolpackovStatic build option.
2007-08-21Boris KolpackovExponential growth for DOM heap.
2007-08-21Boris KolpackovAdd HTTPS scheme to URI.
2007-08-21Boris Kolpackov64 bit Windows build (XERCESC-1531).
2007-08-21Boris KolpackovExplicit type conversion to get rid of a warning.
2007-08-21Boris KolpackovAuto-detect HP aCC3 vs aCC6 compiler versions.
2007-08-21Boris KolpackovVerbose mode (add VERBOSE=1 to the gmake command line).
2007-08-21Boris KolpackovSupport for g++ on AIX and HP-UX.
2007-08-21Boris KolpackovChange optimization level on GNU/Linux from -O to -O2.
2007-08-21Boris KolpackovAdd appendChildFast and call it in parser. Performance patch.
2007-08-21Boris Kolpackov64 bit compile/link options auto-detection for Solaris.
2007-08-21Boris KolpackovVC8 projects.
2007-07-30Alberto MassariThe GroupContentRestricted error is used for both 'sequence' and 'choice' models, so get the model at runtime (XERCESC-1724).
2007-07-26Alberto MassariXSWildcard was always getting a 'strict' processContent when the namespace list contained more than 2 elements.
2007-07-23Christian WillPerformance patch for XERCESC-1657.
2007-07-23Anton Nikolaevsky Patch for XERCESC-1591.
2007-07-18Alberto MassariSend the NODE_CLONED notification for each node in the tree when cloning the entire DOMDocument (XERCESC-1722).
2007-06-15David BertoniFix for null pointer dereference in the case where the expression is empty and the case-insensitive option is specified.
2007-06-09Gilbert ChanApply base whitespace facet to enumeration values.
2007-06-09John KimSuppress DTD error message for attribute referring to unknown entity when attribute not used.
2007-06-08Alberto MassariAdd missing include for MinGW (XERCESC-1617)
2007-06-01David CargillSchema fixes for anonymous type with mixed and substitution with bock.
2007-05-22David CargillFor enumeration only check base as per spec.
2007-05-22David CargillOnly complain when NOTATION is in schema namespace.
2007-05-15Alberto Massarimblen returns 0 when given an empty string; rewrote code to only use mbstowcs (XERCESC-1702).
2007-04-17Alberto MassariIn the Windows registry, the code page for an encoding is stored in @InternetEncoding, not in @Codepage (XERCESC-1092).
2007-03-28David CargillVarious schema fixes.
2007-03-27Alberto MassariPerformance improvements.
2007-03-27Alberto MassariA decimal value of 0.0 was treated as a positive number, so it was different from 0.
2007-03-08Alberto MassariFixed infinite loop when an XPath expression contained an unexpected character (XERCESC-1682).
2007-03-06Boris KolpackovIconvGNU and IconvFBSD transcoders override application-set locale (XERCESC-1660).
2007-02-07Alberto MassariEven if the XSTS suite thinks differently, the XMLSchema 1.1 clarifies that two values derived from the same value space should be treated as equals; so find out the common ancestor and use it to perform the comparison.
2007-02-06Alberto MassariWhen invoking the userData handlers, first build a snapshot of the map, so that the callbacks can update it safely.
2007-01-31Alberto MassariEqual lexical values of unrelated types must be treated as different.
2007-01-31Alberto MassariHandle escaped characters in schemaLocation attributes.
2007-01-31Alberto MassariBefore using a local memory manager, check that we have a valid pointer.
2007-01-30Alberto MassariAllow 'list' and 'union' in the finalDefault attribute of a schema (XERCESC-1633).
2007-01-30Alberto MassariOnly xs:key should complain if not all the fields of an identity constraint are not found in the XML instance (XERCESC-1237).
2007-01-29David CargillComplex type restriction with substation group fix.
2007-01-25David CargillSchema and UTF32 fixes.
2007-01-02Alberto MassariWhen calling getAttributeNodeNS, ensure we are providing a localName (XERCESC-1473).
2006-12-30Charles McLouthAdded support for WinSock and Windows Transcoder on Mingw/msys platform (XERCESC-1617).
2006-12-27Alberto MassariDetect open() failures (XERCESC-1658).
2006-12-11Alberto MassariPerformance improvement: allocate memory only when the data inside the XMLElementDecl cannot be reused.
2006-12-03David CargillSchema derivation fixes.
2006-12-03David CargillCase insensitive regular expression fixes.
2006-12-03David CargillStatic initialization fix.
2006-10-20Alberto MassariReport the correct error when the XML PI has 'XML' instead of 'xml' (XERCESC-1641).
2006-10-10Alberto MassariAllow whitespace-only nodes to be added as children of a DOMDocument.
2006-10-05David CargillHandle anonymous types properly.
2006-10-05David CargillDon't add extra whitespace when validating datatypes.
2006-10-05David CargillTreat "." as invalid double/float.
2006-09-29David BertoniRemoved unnecessary transcoding of file names, that resulted in round-trip transcoding. Moved calls to initializer list to avoid initializing to a default value.
2006-09-27David BertoniFixed some bugs where the literal 0 was being used as the value of an invalid file handle. This affects platforms like Solaris, which use open/close, etc., instead of fopen/fclose, etc.
2006-09-26Boris KolpackovWhen checking for a valid restriction, take into account substitution groups (XERCESC-1281).
2006-09-11Alberto MassariDon't crash if an external parameter entity has no SYSTEM id (XERCESC-1536).
2006-08-23Alberto MassariDefault or fixed attribute values should be whitespace normalized, if the datatype requires it, before being validated.
2006-08-23Alberto MassariDOMLSParserImpl::loadGrammar should not release the previously loaded DOMDocument (XERCESC-1626).
2006-08-10Alberto MassariFix memory leak (XERCESC-1624).
2006-07-07Jay HansenOS400 fixes.
2006-07-06David CargillFix crashes that can occur when a non-default memory manager tries to clean up after running out of memory.
2006-05-30Alberto MassariSAX2XMLReader should use the prefix reported by the reader, not the one stored in the element declaration (XERCESC-1598)
2006-05-30Alberto MassariDGXMLScanner was treating predefined entities inside attribute values as if they were in the element content (XERCESC-1597)
2006-05-08David CargillDocumentation update. Default validation is never, not auto.
2006-04-29David CargillBetter message for invalid boolean datatype.
2006-04-28David CargillPerformance fix, don't use QName as colon location is already available.
2006-04-28David CargillUse ln -fs instead of ln -f to avoid error message during Unix build.
2006-04-19Alberto MassariFix an error that manifested itself when a DTD defined a general entity using a parameter entity for specifying the name.
2006-04-18Alberto MassarisetEncoding was relying on XMLRecognizer::encodingForName to return OtherEncoding when presented with a endian-neutral UTF16/UTF32 encoding, but it doesn't do it anymore.
2006-04-18David CargillPut xmlns attributes in registry to avoid errors when checking for required attributes.
2006-04-18David CargillEnsure decimal is valid on getActualValue call when toValidate is true.
2006-04-18David CargillThread safety fix, don't do lazy evaluation of patterns.
2006-03-27Alberto MassariAllow whitespace at the beginning and after the union operator in XPath expressions of identity constraints.
2006-03-23David CargillMake getCanonical for float and double have consistent behaviour with getActual.
2006-03-21Alberto MassariIf "entities" feature is set to TRUE, entities reference inside attribute values should be serialized as "&ent;"
2006-03-19Alberto MassariFactory method is no more inline to avoid including an internal header in a public one (XERCESC-1579).
2006-03-17David CargillDisplay actual errorCode when reporting an error.
2006-03-05Alberto MassariAllow non-standard names for the C++ compiler.
2006-03-03Alberto MassariUpdated Borland C++ 6 projects.
2006-02-28Alberto MassariRemove BOM-detection code inside refreshCharBuffer: the fix for XERCESC-1284 makes it unnecessary, and the UTF-8 part was updating the wrong index (XERCESC-1385).
2006-02-24Alberto MassariImprove performances of addRange.
2006-02-18Alberto MassariWhen serializing attribute values, escape also carriage returns and tabs (XERCESC-1547).
2006-02-18Alberto MassariIf an encoding has been forced on a InputSource, ignore a compatible BOM found in the stream (XERCESC-1284).
2006-02-06Tobias SchuetteFix for XERCESC-1491.
2006-02-06David CargillPut annotations for duplicate elements on the first element.
2006-02-06David CargillUpdate schema limitations and clarify float and double behaviour.
2006-01-30Khaled NoamanDo not generate error message if switchGrammar fails when laxly validating.
2006-01-21Mark WeaverFix for XERCESC-1555.
2006-01-21David BertoniFixes for XERCESC-1548.
2006-01-16David CargillFix for XERCESC-1546. Canonical value of list was putting in an extra null character.
2006-01-16Alberto MassariWhen evaluating a union in a regular expression, take the branch that matches the longest part of the input string (XERCESC-1521).
2005-12-30Khaled NoamanFix for erroneous duplicate id problem.
2005-12-28David CargillUniconv390 fixes.
2005-12-28David CargillPut debug code under specific flag so it only gets built when needed instead of for each debug build.
2005-12-28David CargillFix size of boolean structure.
2005-12-28David CargillSchema fixes for union of union and empty element.
2005-12-27Alberto MassariImprove validation performances when dealing with schemas with lots of top level definitions (XERCESC-1542).
2005-12-26Alberto MassariFix for XERCESC-1533 (default attributes in the definition for an element that is not validated because of errors would be added to the list of attributes even if already present).
2005-12-15David BertoniAdded missing parameter (XERCESC-1538).
2005-12-14Alberto MassariWhen cloning or importing a node, also copy the type information (XERCESC-1517).
2005-11-15David CargillTreat "+" and "-" as invalid numeric schema values.
2005-11-15David CargillFix bug where very long element names gives parsing error.
2005-11-09Alberto MassariGenerated static library in lowercase like the dynamic one (XERCESC-1522).
2005-10-31Alberto MassariNodes that implement getFeature should also implement isSupported (XERCESC- 1479).
2005-10-15David CargillFix for XERCESC-1515.
2005-10-15David CargillMessage update for QName fix and XERCESC-1515.
2005-10-12David CargillQName fix. Need to verify that the prefix is defined.
2005-10-12David CargillCheck for valid schema characters for float and double.
2005-10-12David CargillAnnotation bug fixes.
2005-09-28Alberto Massariclosesocket should be dynamically bound (XERCESC-1467).

Here is the list of bugs that are resolved in this release, &XercesCName; 2.7.0.

Date Contributor Description
2005-05-19David Cargill390 update: use ICU table which is present with the uniconv390
2005-05-19David CargillUpdate table used for patterns to the Unicode 4.0.1 level.
2005-05-18David CargillFor time schema datatypes, ensure milisecond only contains 0-9
2005-05-18Jay HansenOS400 updates
2005-05-08James BerryModify runConfigure to accept the names of C++ compilers that it doesn't recognize
2005-05-06David BertoniChange for loop control variable for compilers that don't enforce for scope.
2005-05-05David CargillUpdate XSValue to handle float and double the same way the main library does
2005-05-05Mike PawlowskiUpdate HP 64 bit options
2005-05-04David BertoniFix for Jira issue XERCESC-1416
2005-05-04David BertoniFix for Jira issue XERCESC-1391
2005-04-29David BertoniPatch for Jira issue XERCESC-1407
2005-04-29David BertoniPatch for Jira issue XERCESC-1390
2005-04-28Alberto MassariMove implementation of setDocument to the cpp file, where DOMDocumentImpl is a known class (jira 968)
2005-04-27David Cargill Fix for problem on Solaris where open may return 0 as a valid FileHandle. Check for -1 instead.
2005-04-26David Cargill Fix for xercesc-1413: invalid operator equal template signature
2005-04-26David Cargill Schema updates to match spec
2005-04-26David Cargill Prefix mapping update to handle schema correctly.
2005-04-24David Cargill Remove collaboration graph from apiDocs
2005-04-22David Bertoni Patch for Jira issue XERCESC-1411
2005-04-22David Cargill Use isspace instead of isSpace as data is char not xmlch
2005-04-22David Bertoni Patch for Jira issue XERCESC-1410
2005-04-21David Cargill Add support for ucs-2
2005-04-14David BertoniFix Jira 1406. Added include
2005-04-12Alberto MassariFix compiler errors on IRIX (jira 1405)
2005-04-07Khaled Noaman Update chars table with an NCName char mask instead of an XML letter mask
2005-04-07Alberto Massari appendChild now throws an exception when a NULL pointer is given (jira# 1401)
2005-04-05David CargillUpdate XSValue to handle leading and trailing whitespace
2005-04-05David Cargill Change platform mutex code to do a panic
2005-04-05Khaled Noaman Performance: do not make a copy of the expression to match
2005-04-05David Cargill Implement version of lowercase that only check a to z
2005-04-05David CargillUpdate Redirect sample to use newer entity resolver callback
2005-04-05David CargillImplement support for disabling default entity resolution
2005-04-05Khaled Noaman skip DTD validation feature
2005-04-05David Bertoni Fix thread safety issues
2005-04-05Axel Weib Fix for jira 1397. *Much* nicer make output
2005-04-05Gareth Reakes Fix for Jira 1396. make distclean now removes all files
2005-04-04David Cargill Fix a problem where illegal qualified names were not reported as errors
2005-04-04David Cargill Fix memory leak when deserializing grammars
2005-04-04David Cargill Add support for not creating xsannotations when deserializing a grammar
2005-04-01David Bertoni Fix for Jira issue XERCESC-1389: memory manager
2005-04-01Alberto Massari In case of a mixed-case standalone value, the flag was always set to false
2005-03-31Alberto MassariDon't invoke the resolver when an empty xs:import is found
2005-03-30David Cargill Allow XSAnnotation generation to be controlled by a feature
2005-03-29David Cargill Begin work on adding some new features by checking in the feature handling support
2005-03-25Alberto Massari On Windows, export the class from the DLL
2005-03-22Christian Will Perf patches for Xercesc-1369 and 1370
2005-03-20David Cargill Implement versions of uppercase and compareIstring that only check a to z
2005-03-20David Cargill Add FLOAT(IEEE) to list of 390 compiler options so XSValueTest will compile
2005-03-20Christian Will [jira 1381] Memory leak in GrammarResolver
2005-03-17Alberto Massari Aligned method declaration (jira# 1386)
2005-03-17Gareth Reake Updated doc to refect real behaviour with adoptBuffer
2005-03-17Alberto MassariRemove variable declaration from 'if' statement (jira# 1379)
2005-03-17Alberto Massari Fully qualify enum (jira# 1383)
2005-03-17Alberto Massari Aligned method declaration (jira# 1384)
2005-03-16Matthew Hall Fix possible overflow problem
2005-03-14Gareth Reakes Fix for Jira 1376: wrong memory manager
2005-03-14Gareth ReakesFix to Jira 1375. Removed space char between #! and /.
2005-03-11Christian Will XERCESC-1345: Reset fDTDElemeNonDeclPool in scanreset
2005-03-11David Earlam XERCESC-1363: Increase size of BaseRefVectorOf based on size of data not by 32
2005-03-09Alberto Massari Protected getSrcOffset to avoid crashing when parsing has finished; updated documentation
2005-03-08Alberto Massari Redeclare a namespace binding if the prefix is already bound to a different namespace (jira# 1371)
2005-03-08Christian Will Improve performances of XMLString::tokenizeString (jira# 1363)
2005-03-07Khaled Noaman Eliminate lazy creation of attribute lists
2005-03-04Markus Scherer Initialize ICU to avoid multithreading problems
2005-03-04Alberto Massari The URL fragments were leaked (jira# 1362)
2005-03-03Steve Dulin Update samples to use XERCESCOUT instead of XERCESCROOT
2005-03-03Alberto Massari Removing makefile project, as BCB6 users should use the .bpr project (jira# 1347)
2005-03-03David Bertoni Removed superfluous const qualifiers
2005-02-25David Cargill Attempt to fix compiler errors
2005-02-25David Bertoni Performance improvements
2005-02-25Alberto Massari Fixing spelling errors
2005-02-25Scott Cantor Fix for compile under gcc 4
2005-02-25David Bertoni Fix thread safety issues. Jira #30380. Thanks to David Bertoni
2005-02-23Mike Boos Various PSVI fixes
2005-02-23Steve DulinAllow ICU to be used for transcoding and casing
2005-02-23David Cargill Copy performance change made to XMLUTF8Transcoder.cpp to the 390 version
2005-02-21James Berry Bugfix: XERCESC-1074; get rid of warnings
2005-02-21David Cargill Doc updates, including xercesc-1352
2005-02-21Christian WillPerformance fixes
2005-02-21Alberto Massari Updated makefile (bug# 1346)
2005-02-19David Cargill Update error message from regular expressions
2005-02-19David Bertoni Prefix mapping fix
2005-02-19David Cargill Store key for recreating table instead of using enclosingscope
2005-02-18James BerryUpdate release plan with tenative 3.0 list
2005-02-14James BerryFix spelling of fgMacLCPEncodingName
2005-02-11James Berry Remove from project obsolete files XObjectComparator and XTemplateComparator.
2005-02-11Chris CatesExplicitly create a unicode collator for Mac
2005-02-07Alberto Massari AStatic builds had incomplete MIDL command lines
2005-02-02Alberto Massari Enable building of tests and samples under Interix (jira# 1330)
2005-02-02Alberto Massari Mark global variables for this module as static (jira# 1331)
2005-02-02Alberto Massari Added rehashing capabilities
2005-01-26Alberto MassariIf the option /Zc:wchar_t is specified, map XMLCh to wchar_t (jira# 413)
2005-01-26Alberto MassariXMemory updates
2005-01-20David Cargill Xercesc-1326: Documentation update for getTextContext.
2005-01-20David Cargill Xercesc-1328: Fix spelling of XMLUni::fgXercesUseCachedGrammarInParse (missing an a in parse)
2005-01-18Steve DulinDelete memory for parser and grammarpool
2005-01-14Alberto MassariWhen entity reference creation was on, the document created by the parser was leaked (jira# 490)
2005-01-13Alberto Massari Support for UnixWare 7.1.1 (jira# 1148)
2005-01-12David Cargill Fix for xercesc-1219
2005-01-12David CargillRemove warning messages.
2005-01-08Alberto Massari Fixes to compile with Visual Studio 2005 (jira# 1253)
2005-01-08David Cargill Fix for Xercesc-1283: incorrect case for xmluni predefined constant in doc
2005-01-07David Cargill Fix for Xercesc-1314: clarify what is xercescroot.
2005-01-07Alberto Massari Updated Borland makefile
2005-01-07Alberto Massari scanReset() should always clear the maps used to detect duplicate attributes
2005-01-06Alberto Massari Removed warnings
2005-01-06Alberto Massari When emitting a "duplicate attribute" error, we were using an unitialized pointer variable
2005-01-06David Cargill Update SAX2Print sample project files to add new files recently added to sample
2005-01-05Alberto Massari Add icpc to the list of C++ compilers (jira# 1311)
2005-01-03James Berry Add support for use of ICU with Mac OS X version
2005-01-03Alberto Massari maps used to detect duplicate attributes are now cleaned
2005-01-03Alberto Massari Fixed name of include file [jira#1321]
2004-12-30Alberto MassariNotify advanced handlers of the whitespace before and after the root document element (jira# 729)
2004-12-30Alberto MassariDelete the user data informations only after invoking all the NODE_DELETED handlers (jira# 620)
2004-12-30Alberto MassariAdded API to remove all entries having the same primary key
2004-12-29Alberto MassariThe second call to ucnv_fromUChars was causing the buffer not to be terminated (jira#1300)
2004-12-28James BerryAdd support for use of sockets netaccessor on Mac OS X.
2004-12-28James BerryFix syntax error caught by GCC 4
2004-12-28Alberto MassariDOMDocument::cloneNode can clone the element definitions (bug# 647)
2004-12-28Alberto MassariStore fAxisType as an integer, not as a XMLCh (bug# 1177)
2004-12-24Alberto MassariAdd support for SAX2 filters (jira# 1133)
2004-12-23David CargillXSValue Updates
2004-12-23Alberto MassariUse correct prefix on end tag
2004-12-21David CargillAttempt to fix various apidoc problems
2004-12-20David CargillAdd assert to avoid memory violation
2004-12-13Christian WillPerformance improvement
2004-12-12Alberto MassariTake into account the fExpandEntityReferences setting [jira# 1303]
2004-12-10David CargillFix problem with hexbin::decode and use XMLByte instead of XMLCh for output of decoding.
2004-12-09Khaled Noman DOM L3: pass schema normalized value only when datatype-normalization feature is enabled.
2004-12-09Alberto MassariFxi for jira392
2004-12-07Khaled NomanAn option to ignore a cached DTD grammar
2004-12-07Alberto MassariFixed memory leak in operator= [jira# 1307]
2004-12-06Alberto MassariTake into account the fExpandEntityReferences setting [jira# 1303]
2004-12-06David CargillClean-up error text for a message that said unsupported
2004-12-05Alberto MassariAdded XMLString::release(void**, MemoryManager*) [jira# 1301]
2004-12-05Alberto Massarientity resolver behaviour
2004-12-01Alberto MassariAvoid throwing an exception when orphaning a cached grammar that has not been used yet
2004-12-01David CargillUpdate two error messages: add missing parameter, remove extra parameter
2004-12-01Stephen DulinUpdate ccsid.h for new release of icu
2004-12-01David CargillFix for bug xercesc-1304
2004-11-29David CargillUpdate MS VC7.1 build options
2004-11-29David CargillRemove XObjectComparator and XTemplateComparator. These are debug files that aren't used.
2004-11-25Khaled NoamanFix for synthetic annotation generation on 'extension' element of simpleContent
2004-11-25Khaled NoamanFix problem with an All content model with minOccurs of 0.
2004-11-24Dave BertoniFix to correctly report the boundaries of an external subset
2004-11-18Christian WillMemory improvement to utility classes
2004-11-18David CargillChanges for linker problems with linux build using xlc.
2004-11-17Christian WillPerformance improvement to utility classes.
2004-11-15Alberto MassariAdd build target for VC7.1 to create a static library
2004-11-14PeiYong ZhangXSValue updates
2004-11-13David CargillFix for validate annotations.
2004-11-12Khaled NoamanFix multi threading problem.
2004-11-10PeiYong ZhangTo build ICU3.2 and on Linux/xlC_r
2004-11-09PeiYong ZhangStorer_NewerThan_Loader
2004-11-08PeiYong ZhangMSVC 7.1
2004-11-08Alberto MassariFix for jira#1298: NetBSD uses r+ to open files for reading
2004-11-07PeiYong Zhangread/write Storer level
2004-11-05PeiYong ZhangMsg build versioning
2004-11-02PeiYong Zhang[Jira#1294] Compiler Warnings on IRIX with MIPSpro compiler ver 7.4
2004-11-02PeiYong ZhangHandling OutOfMemory exception
2004-10-28David CargillAdd missing parameter to three error messages.
2004-10-28PeiYong ZhangData member reshuffle and store/load
2004-10-27PeiYong ZhangOptimized alignment for various data types
2004-10-27James BerryMacOS build updates
2004-10-26PeiYong ZhangMaintain consistent order among multiple store/load session to allow comparison
2004-10-26Gareth ReakesFixed version number
2004-10-20Khaled NoamanAllow option of initializing static data in XMLPlatformUtils::Initialize
2004-10-19PeiYong ZhangXercesC2_6_0 updates: build debuged libary on Windows/VC6
2004-10-19PeiYong Zhang[Jira#1287] new deprecated DOM libraries not included in .spec file for Linux
2004-10-19Khaled NoamanPerformance improvement
2004-10-15David CargillFix for jira bug 1234. Infinite loop in XSComplexTypeDefinition::derviedFromType.
2004-10-13PeiYong Zhangusing ValueHashTableOf to reduce footprint
2004-10-13David CargillFix for jira bug 1282: empty exception message being generated
2004-10-13David CargillSerialization fix, fPVSIScope not serialized.
2004-10-12PeiYong ZhangChange attribute number threshold to 100
2004-10-04PeiYong ZhangSupport to build ICU3.0 on Solaris2.8 64-bit
2004-10-04Alberto MassariFix for Jira 866

Here is the list of bugs that are resolved in this release, &XercesCName; 2.6.0.

Date Contributor Description
2004-09-29Khaled Noaman Bug 1209
2004-09-29David Cargill Mark SAXParser as deprecated.
2004-09-29David Cargill jira1217
2004-09-29Dan Rosen jira1207
2004-09-28Khaled Noaman, Anthony O'Dowd Performance: improve src offset calculation.
2004-09-28PeiYong Zhang Optimized duplicated attributes checking for large number of attributes
2004-09-28Alberto Massari BCC 511 updates
2004-09-27David Cargill Update sample to use an error handler and only generate xsmodel when a schema document has been loaded successfully.
2004-09-27David Cargill Update documentation to describe new features
2004-09-27Khaled Noaman, David Cargill Validate annotations
2004-09-27Khaled Noaman Reset datatype validator
2004-09-27David Cargill XERCESC-1277
2004-09-26Khaled Noaman [Bug 1197]
2004-09-25Gareth Reakes, Adam Heinz Fix to 1264. All refererences to public headers now use the include files.
2004-09-25James Littlejohn Fix documentation generation problem.
2004-09-23Alberto Massari jira1259
2004-09-22David Cargill Add support for generating synthetic XSAnnotations.
2004-09-22David Cargill Fix memory leak in PSVIWriter sample.
2004-09-22John Hibbert Bug fixes
2004-09-22David Cargill Remove unused variable and data member.
2004-09-22Alberto Massari Reorder initialization of variables in constructor
2004-09-21PeiYong Zhang Do not build/ship debug version lib on Windows
2004-09-21PeiYong Zhang Change lib name on Windows from 2_5_0 to 2_5
2004-09-21David Cargill Documentation Updates.
2004-09-21PeiYong Zhang Handle partial PSVIElement
2004-09-20James Berry Mac updates
2004-09-20Alberto Massari Added a setCreateSchemaInfo method to the DOM parsers, to store PSVI informations in element and attribute nodes
2004-09-20Alberto Massari Mark some methods as deprecated
2004-09-16Alberto Massari Remove XercesMessages_en_US.hpp from the Win32 projects (they use the WinRC MsgLoader)
2004-09-16PeiYong Zhang provide default implementation for CreateDocumentType
2004-09-16Alberto Massari Don't include icudata.lib to the Windows projects: ICU 3.0 has renamed and it's no more needed since ICU 2.0
2004-09-16Alberto Massari Updated error message for UPA to also state the complex type that is failing the test
2004-09-14Alberto Massari, Ron Romero jira 855)
2004-09-14Alberto Massarijira1248
2004-09-14Alberto Massari jira1261
2004-09-13PeiYong Zhang new method: getActualValue()
2004-09-10 David BertoniPerformance improvement fix to more efficiently findattdef.
2004-09-10David Bertoni Return bool as described in the interface for cacheGrammar instead of throwing an exception.
2004-09-09David Cargill, Steve Dulin 0S/390 build updates
2004-09-08PeiYong Zhang Apache License Version 2.0
2004-09-04David Cargill XercesC-1269 Fix: Remove extra comma.
2004-09-02David Cargill Fix API Doc warning message
2004-09-02David Cargill, Patrick Townsend and Jay Hansen OS400 Build updates
2004-09-02 David Cargill Specify bmaxdata for AIX samples and tests.
2004-09-02David Cargill Add OutOfMemoryException block to samples and tests.
2004-08-31David Cargill Thread safety change for getTypeLocalName and getTypeUri
2004-08-30Alberto Massari Reduce memory footprint of DOMNode::setUserData
2004-08-30Alberto Massari Don't allocate a DOMTypeInfo object if there is no type info to store
2004-08-30Alberto Massari Added transferElement API
2004-08-27Alberto Massari getXSModel fix
2004-08-20David CargillJira bug XERCESC-1257
2004-08-19PeiYong Zhang Add XSValue test
2004-08-11Andrew Fang Fixing Xerces-C crash when creating a MixedContentModel
2004-08-11PeiYong Zhang Externalised validation, actual/canonical value production for Schema built-in data types
2004-07-27PeiYong Zhang build on aix xlC_r v6 with v5 comptiable name mangling scheme
2004-07-26Alberto Massari reset() was not resetting the stack of types (jira1245)
2004-07-23Anders HybertzcalcRequiredSize assumed all the characters were of the same size (jira1142)
2004-07-23Alberto Massari jira1179
2004-07-23Alberto Massari jira1206
2004-07-23Alberto Massari A global mutex was not cleaned up
2004-07-23Alberto Massari jira 862
2004-07-22Bob Buck jira1186
2004-07-22Khaled NoamanUse file static instance instead of local static instance
2004-07-22Khaled NoamanEliminate the need to create a temporary content model when performing UPA checking
2004-07-21PeiYong Zhang use the supplied memory manager
2004-07-16Alberto Massari Enable libWWW on Solaris
2004-07-13Joanne BogartFixed bugzilla bug 23100.
2004-07-12PeiYong Zhang Increment patnIndex only when a match is found
2004-07-12David Bertoni IGXMLScanner::fErrorStack not cleared if an exception is thrown
2004-07-09PeiYong Zhang Build on HP-Itanium, aCC A.05.52
2004-07-09Syam Gadde jira957
2004-07-08Alberto Massari jira1236
2004-07-08Alberto Massari Force the destruction of an XMLBuffer before terminating Xerces
2004-07-08David Cargill, Khaled Noaman, Steve Dulin ThreadTest updates
2004-07-07PeiYong Zhang Upgrade to ICU3.0
2004-07-07Alberto Massari Fix for jira1170
2004-07-07Ray Logel Fir for jira1136
2004-07-06Alberto Massari Fix for jira1226
2004-07-06Alberto Massari Fix for jira1238
2004-07-06Alberto Massari Fix for jira1210
2004-07-06David Cargill Rename VALUE_CONSTRAINT enumeration names
2004-06-28David CargillInitialize memory manager to default.
2004-06-24PeiYong Zhang Schema-Errata
2004-06-23Neil Graham fix for compilation under gcc 3.5
2004-06-22Alberto Massari Fix for jira1181
2004-06-21Neil Graham don't switch grammars unnecessarily
2004-06-21Alberto Massari Fixed memory leak (jira1228)
2004-06-15David Bertoni Memory Leakage Fixed
2004-06-15Steve Dulin make sure tables are properly aligned
2004-06-15Neil Graham supported C++ namespaces doc update
2004-06-14PeiYong Zhang Consolidated End Of Line Handling
2004-06-09John SnelsonFixed null pointer bug
2004-06-02Neil Graham Fix bug where scanners would accept malformed tags and perf improvements
2004-06-01David Cargill Fix memory leak.
2004-05-31PeiYong Zhang XML 1.1
2004-05-27Neil Graham Performance fix: clearing the undeclared attribute maps on start tags
2004-05-25PeiYong Zhang normalizeURI() added
2004-05-25PeiYong Zhang XMLString::removeChar added
2004-05-21David Bertoni [jira1216] GrammarResolver never clears internal cache of Grammar instances
2004-05-19PeiYong Zhang MingGW updates
2004-05-14PeiYong Zhang UTF-8 new error message
2004-05-11Alberto Massari The net accessor input source now can be used to get data using PUT or POST
2004-05-10Alberto Massari Performance: push a new map on the namespace stack only when an element has a xmlns attribute
2004-05-05Alberto Massari Enable libWWW on Linux
2004-05-05Alberto Massari Added error message for the HTTP NetAccessor
2004-05-05Alberto Massari xlat doesn't compile on Windows
2004-05-04David Cargill Enable IDs to work on all kinds of schema components
2004-05-03David Bertoni To resolveGrammar correctly
2004-04-22Steve Dulin not all 390 processors support the new transcoding instructions
2004-04-22David Cargill Misc fix to update fCount in the correct place.
2004-04-22David Cargill Schema bug with group redefined
2004-04-22David Cargill Misc doc updates
2004-04-20PeiYong Zhang xlat generate code for private default constructor
2004-04-20PeiYong Zhang XML1.0 3rd Edition Updates
2004-04-19Shin'ya MORINOAdd "UTF16" as a synonym for UTF-16 (bug #XERCESC-1198)
2004-04-16David Cargill Doc updates for Jira
2004-04-15James Berry Various MAC fixes
2004-04-14David Cargill Various PSVI Fixes
2004-04-13PeiYong Zhang Identity Constraints
2004-04-12David Cargill Doc updates
2004-04-07PeiYong Zhang Add createDocumentType
2004-04-07PeiYong Zhang Grammar caching of DTD internal subsets
2004-04-06Steve Dulin fix for file resolution problems on OS/390
2004-04-06Alberto Massari DTDs included from XML Schema were not opened using the entity resolver specified by the user (bug# 27008)
2004-04-05PeiYong Zhang make comparison case insensitive, typo in error message corrected.
2004-04-02PeiYong Zhang Annotation reporting improvements
2004-04-02Berin Lautenbach item() was could only return items found in the first non-empty bucket
2004-04-01PeiYong Zhang Add Messages to DOMExceptions
2004-03-30PeiYong Zhang packageBinaries.pl improvements
2004-03-24Alberto Massari importNode bug fix
2004-03-19PeiYong Zhang Serialization Changes
2004-03-17PeiYong Zhang Deprecated DOM
2004-03-17Alberto Massari Inside attribute values, new lines must be escaped (bug#20858)
2004-03-15Alberto Massari Added support for MinGW (bug#23176)
2004-03-10Alberto MassariFix documentation for binToText (bug# 9207)
2004-03-09PeiYong Zhang Serialization changes
2004-03-05Alberto Massari DOMNamedNodeMap Performance Improvements
2004-03-05Michael Boos PSVI Fixes
2004-03-05Alberto Massari The maps inside the DTD are declared of the right type, removing the need for casts
2004-03-05Alberto Massari Removed unnecessary inclusion of implementation headers
2004-03-03Alberto Massari DOMNodeVector is used only to store attributes; save memory
2004-03-03Alberto Massari WFXMLScanner was throwing an index out of bound exception
2004-03-03Alberto Massari [bug# 7051] The "hash" argument clashes with STL hash
2004-03-02PeiYong Zhang save/load TypeUri/TypeLocalName more accurately
2004-03-02PeiYong Zhang eliminate leakage
2004-03-02Alberto Massari Check for errors when saving a document to a file (bug# 2594)
2004-03-02Steve Dulin OS/390 transcoder update
2004-03-02Alberto Massari Added test for bug# 26919
2004-03-02Alberto Massari If insertBefore(A,A) is invoked, a crash would occur (bug# 26919)
2004-03-02Alberto Massari When cloning a DOMDocument, clone also the encoding, version and standalone info (bug#13056)
2004-03-01PeiYong Zhang Instantiate XSerializeEngine with GrammarPool
2004-03-01Khaled NoamanFix for UPA checking
2004-03-01PeiYong Zhangnew getter: getHashModulus
2004-02-28James BerryRevise the Mac OS Transcoder to use the Mac Text Encoding Converter
2004-02-28James BerryUpdate Mac OS Projects for newly added files
2004-02-27Alberto MassariFixed memory leaks
2004-02-26Alberto MassariFix for bug# 27263 (extra = in registration script
2004-02-25Alberto MassariThe COM wrapper doesn't use the deprecated DOM anymore
2004-02-25Alberto MassariFixed typo in documentation
2004-02-25PeiYong ZhangBug#27209: Xerces 2.5.0 does not build with option -t IconvGNU because of syntax errors!
2004-02-24PeiYong ZhangXercesDeprecatedDOMLib
2004-02-20David BertoniBug#27046
2004-02-18PeiYong ZhangDoxyfile update to 2.5.0
2004-02-17Abe Backus, Neil Grahamfix for bug 25035: cygwin support
2004-02-17Neil Grahamfix potential memory leak

Below is the list of fixed bugzilla bugs that are resolved in this release, &XercesCName; 2.5.0.

Date Contributor Description
2004-02-15 Neil Graham make first parameter of BinOutputStream::writeBytes const * const; bug 26936
2004-02-13 Khaled Noaman Remove the limitation on providing PSVI information
2004-02-13 David Cargill Update threadtest to accept -init option instead of using compiler directive.
2004-02-13 David Cargill Remove unnecessary if statement
2004-02-13 David Cargill Bug#26900 fix, remove virtual on destructor
2004-02-12 Alberto Massari Xercesc2_5_0 Updates
2004-02-12 PeiYong Zhang Xercesc2_5_0 Updates
2004-02-12 David Cargill PSVIWriter documentation updates
2004-02-12 Merlin Bug#26607 fix
2004-02-12 Alberto Massari Bug#21965: A substitution group with no type is always valid
2004-02-12 David Cargill SCMPrint build error fix
2004-02-12 Alberto Massari Xercesc2_5_0: com updates
2004-02-12 Erik Rydgren Implemented setTextContent
2004-02-11 PeiYong Zhang Project SUMPrint
2004-02-11 PeiYong Zhang PSVIWriter to build with intel
2004-02-11 David Cargill PSVIWriter to build on AIX
2004-02-11 David Bertoni Bug#26648 fix
2004-02-11 David Cargill Bug#26131fix.
2004-02-11 David Cargill Bug#25541fix
2004-02-10 David Cargill PSVIWriter build fix
2004-02-09 C-J Berg Bug#20684 fix
2004-02-09 David Cargill PSVIWriter build fix and usage update
2004-02-06 PeiYong Zhang Project PSVIWriter
2004-02-06 David Cargill Misc 390 changes.
2004-02-06 David Cargill Intrinsic transcoding support for 390.
2004-02-05 David Cargill Fix a seg fault with PSVI and set basetype of anysimpletype to be anytype.
2004-02-05 David Cargill Code cleanup changes to get rid of various compiler diagnostic messages.
2004-02-04 Alberto Massari Added support for the Interix platform (Windows Services for Unix 3.5)
2004-02-04 Berin Lautenbach Bug#26426 fix
2004-02-03 PeiYong Zhang Bug#26315 fix
2004-02-03 PeiYong Zhang put back the parameter to build debug
2004-01-31 David Cargill Update script to flush buffer
2004-01-29 David Cargill Update sanity tests so that each test result can be uniquely identified
2004-01-29 David Cargill Code cleanup changes to get rid of various compiler diagnostic messages.
2004-01-28 James Berry Add include for unistd.h
2004-01-28 James Berry Define away some gcc garbage so that /usr/include/unistd.h will compile with the CodeWarrior MachO target
2004-01-26 James Berry Add a check for a corner-case buffer condition
2004-01-25 James Berry Bug #26419 fix
2004-01-25 James Berry Step around CodeWarrior compiler warning
2004-01-25 James Berry Update Mac OS Xcode project to reflect recent file additions
2004-01-25 James Berry Update Mac OS CodeWarrior project to reflect recent file additions
2004-01-21 PeiYong Zhang Bug#25751fix
2004-01-19 Alberto Massari WideCharToMultiByte and MultiByteToWideChar return 0 on failure, not -1
2004-01-16 PeiYong Zhang maintain the same size on both 32/64 bit architecture
2004-01-16 PeiYong Zhang Project XSerializerTest
2004-01-16 Alberto Massari In the Win32LCPTranscoder, don't use wcstombs or mbstowcs, as they don't pick up the correct local code page; use the Win32 API using CP_ACP as the code page
2004-01-16 Alberto Massari Removed usage of undeclared macro MIN
2004-01-15 PeiYong Zhang proper allignment for built-in datatype read/write
2004-01-15 Khaled Noaman HP compiler (after upgrade) is no longer complaining about placement delete
2004-01-15 Alberto Massari Bug#18341 fix
2004-01-15 Michael Wuschek Bug#24929 fix
2004-01-13 PeiYong Zhang revert code back to previous version
2004-01-13 Kahled Noaman Remove unnecessary local static data
2004-01-13 PeiYong Zhang set optimization level#2 on hp aCC
2004-01-13 David Cargill Misc build updates
2004-01-13 David Cargill Undo previous change memory management changes.
2004-01-13 David Cargill Misc memory management changes
2004-01-13 Khaled Noaman For sanity, use class name to qualify method
2004-01-13 Khaled Noaman Fix wrong size of allocation
2004-01-12 Neil Graham remove unused static member
2004-01-12 Neil Graham update Copyright year
2004-01-12 David Cargill Minor performance change for handling reserved and unreserved characters.
2004-01-12 David Cargill Fix 390 compilation errors.
2004-01-12 Khaled Noaman Use a global static mutex for locking when creating local static mutexes instead of compareAndSwap
2004-01-12 Neil Graham remove use of static buffers
2004-01-12 David Cargill Avoid throwing malformedurl exceptions in XMLURL to avoid a threading problem on AIX.
2004-01-06 Khaled Noaman PSVI: inherit facets from base type
2004-01-06 Neil Graham Bug#25660 fix
2004-01-06 Joanne Bogart, Neil Graham Bug#25542 fix
2004-01-06 Alberto Massari Bug#25768 fix: Replaced the call to wcstombs using a NULL target buffer with the equivalent call to WideCharToMultiByte ()
2004-01-06 Jeroen Witmond, Neil Graham Bug#25412 fix
2004-01-06 Khaled Noaman Fix segfault when adding S4S
2004-01-06 Khaled Noaman Reset list of grammars after building XSModel
2004-01-06 PeiYong Zhang using the no-exception-thrown ctor
2004-01-06 Reid Spencer, Neil Graham Bug#28517 static initialization problems
2004-01-06 Neil Graham make sure locally-declared attributes have declarations in the PSVI
2004-01-06 Neil Graham On some platforms, it is problematic to throw a different exception from inside the catch block of another exception
2004-01-05 Khaled Noaman Various PSVI fixes
2004-01-03 PeiYong Zhang using ctor/parseContent to avoid exception thrown from ctor
2003-12-31 David Cargill Update AIX build to generate .a libraries as -brtl is no longer used so that a build generated without using packageBinaires.pl will be clean.
2003-12-31 David Cargill Release memory when an error is encountered.
2003-12-31 Alberto Massari Updated project for BCC551
2003-12-31 Alberto Massari Made virtual function checkAdditionalFacet 'const', so that it matches the declaration in a derived class
2003-12-30 Neil Graham Even if the resolver has no grammars, since all schema processors are aware of the schema-for-schemas, an XSModel should be produced.
2003-12-30 Neil Graham fix one more buffer overrun, affecting boolean lists
2003-12-30 Neil Graham enable production of canonical representations for dates with negative years, or years >9999
2003-12-30 Neil Graham ensure an XSModel
2003-12-30 Neil Graham even if there are no grammars to add to an XSModel, the S4S grammar must be included
2003-12-30 Neil Graham do not report anything about default/fixed values for non-global attribute declarations
2003-12-30 Neil Graham use a null-terminated string when tokenizing pattern facets
2003-12-30 Neil Graham more PSVI bug fixes
2003-12-30 Neil Graham some indices in the PSVIAttributeList were 1 off
2003-12-30 Neil Graham fix segfault when validation of a union type fails
2003-12-30 Neil Graham initialize undeclared attribute registry appropriately for its local use in scanStartTag
2003-12-30 Neil Graham allow schema normalized values to be associated with a PSVIAttribute after it is reset
2003-12-29 PeiYong Zhang use the original memory manager to deallocate in assignment operator
2003-12-29 Khaled Noaman PSVI: return value constraint only if global declaration
2003-12-29 Khaled Noaman PSVI: add whitespace facet if missing
2003-12-29 Khaled Noaman More PSVI updates
2003-12-29 Alberto Massari When parsing a new element, clear the maps holding the unparsed attribute we have seen. This because these maps keep pointers to the name of the attributes object that gets recycled for every element (and their name is deallocated when recycled)
2003-12-24 David Cargill Memory management update.
2003-12-24 David Cargill Improved algorithm for finding derivedFrom.
2003-12-24 David Cargill More updates to memory management so that the static memory manager.
2003-12-23 PeiYong Zhang Absorb exception thrown in getCanonicalRepresentation and return 0, only validate when required
2003-12-22 Michael Glavassevich Bug#18611 fix.
2003-12-22 Gareth Reakes Bug #25699 fix: made getRootElemID const.
2003-12-22 Jeroen N. Witmond, Gareth Reakes Bug#25164: Patch for doc enhancement
2003-12-20 Neil Graham add attribute names to PSVIAttributeList and fix some problems with calculation of canonical values in element content
2003-12-20 Neil Graham fix canonical representation production
2003-12-20 Neil Graham store name/namespace of corresponding attribute in PSVIAttributeList; not all PSVIAttributes have XSAttributeDeclarations
2003-12-19 David Cargill Fix compiler messages on OS390.
2003-12-19 David Cargill More memory management updates.
2003-12-19 Khaled Noaman PSVI: process 'final' information
2003-12-19 Neil Graham when validating a skipped element or attribute, we should not look for a declaration.
2003-12-19 Neil Graham remove a throw clause inserted during debugging
2003-12-18 PeiYong Zhang do not assert memorymanager in placement delete.
2003-12-17 David Cargill Fix AIX compiler error.
2003-12-17 Khaled Noaman PSVI: Use complex type info if present, otherwise use datatype validator
2003-12-17 Khaled Noaman PSVI: fix for annotation of attributes in attributeGroup/derived types
2003-12-17 Neil Graham fix two overflow conditions
2003-12-17 Neil Graham fix a segfault and a possible buffer overflow condition
2003-12-17 David Cargill Update for memory management so that the static memory manager (one used to call Initialize) is only for static data.
2003-12-17 Khaled Noaman Check for NULL when building XSParticle
2003-12-16 Neil Graham fix compilation error
2003-12-16 Neil Graham ensure all uses of ArrayJanitor use a memory manager
2003-12-16 Neil Graham add default memory manager parameter to loadMsg method that uses char * parameters
2003-12-16 David Cargill Fix memhandlertest failure (memory not deleted).
2003-12-16 PeiYong Zhang XSerializerTest updates
2003-12-16 PeiYong Zhang exception thrown upon invalid number, thanks Gareth Reakes.
2003-12-16 Khaled Noaman Make IC_Field stateless, fMayMatch is no longer a data member of IC_Field
2003-12-16 Khaled Noaman Add nextElementKey method
2003-12- BinMemOutputStream
2003-12-16 Alberto Massari The DOMTypeInfo should have a NULL namespace and type name when DTD validation is used, not empty strings
2003-12-16 PeiYong Zhang don't expand ContextSpecNode when deserilized
2003-12-16 Steve Dulin, Neil Graham update
2003-12-16 David Cargill Change a conditional expression to an if-else to avoid a compiler problem.
2003-12-15 Neil Graham fix segfault when a writeAnnotation() method was called
2003-12-15 David Cargill psvi updates; cleanup revisits and bug fixes
2003-12-14 Neil Graham make use of XMLDocumentHandler::elementTypeInfo instead of non-thread-safe XMLElementDecl methods
2003-12-13 Han Ming, Neil Graham Bug#25494 fix
2003-12-13 Neil Graham fix compilation errors under gcc
2003-12-13 Neil Graham configure scripts need to be told about XSerializerTests before they can build its Makefile
2003-12-12 Michael Glavassevich, Neil Graham fix small bugs that made sanity tests fails
2003-12-12 PeiYong Zhang Project XSerializerTest
2003-12-11 PeiYong Zhang trailing zeros for double/float w/o decimal point
2003-12- Michael Glavassevich, Neil Graham fixes for the URI implementation to take registry names into account
2003-12-11 PeiYong Zhang Canonical Representation Support
2003-12-11 Khaled Noaman Store non schema attributes from parent in XSAnnotation
2003-12-10 Steve Dulin, Neil Graham OS/390 updates
2003-12-10 Steve Dulin, Neil Graham make documentation accord with what Xerces-C supports
2003-12-10 Steve Dulin, Neil Graham ICU has deprecated the -s390 encoding suffix. This patch uses the new convention for XML documents that make use of this suffix
2003-12-10 Steve Dulin, Neil Graham make CreateDOMDocument sample more robust
2003-12-10 Neil Graham fixes for canonical value production; memory management was not implemented correctly
2003-12-10 Stephen Dulin Eliminate the preparsing stage
2003-12-10 Neil Graham change some hash constants
2003-12-10 Neil Graham fix seg fault caused when a complex type had simple content; we were not processing the complex type itself, only its base
2003-12-09 James Berry Remove GCC2 build styles from xcode samples
2003-12-09 Han Ming Ong Bug #25343 Add xcode project for SEnumVal sample
2003-12-09 Han Ming Ong Bug#25337: Enable DEPLOYMENT_POSTPROCESSING for Mac OS X GCC3 Deployment Build.
2003-12-07 Neil Graham fix bug in PSVI where a segfault would occur if an attribute was not defined
2003-12-07 Neil Graham fix duplicate attribute detection when namespaces are disabled
2003-12-03 Neil Graham PSVI fix: cannot allow validator to reset its element content buffer before exposing it to the application
2003-12-03 Neil Graham uninitialize panic handlers so they will be ready for subsequent initalizations
2003-12-03 Pete Lloyd, Neil Graham when an empty element is valid, it will not have a datatype validator
2003-12-02 Jeroen Whitmond, Neil Graham Bug#25118, additional fix once again
2003-12-02 Neil Graham since there are certain things, such as schemaLocation attributes, that have a datatype and which we nonetheless do not validate, make canonical-value production dependent on validity being valid
2003-12-02 Pete Lloyd, Neil Graham fix for ArrayIndexOutOfBoundsException in PSVIAttributeList
2003-12-02 Alberto Massari Bug#20169, openFile was opening the file for read and write, while only read was required
2003-12-02 Alberto Massari Removed /version option from the linker
2003-12-02 Alberto Massari Don't use the word "exception" as a variable name, as VC 7.1 complains about it
2003-12-02 Alberto Massari Bug#16055 fix, Make the code compilable on Windows when UNICODE is defined
2003-12-01 Khaled Noaman Properly set fAnnotation data member

Below is the list of fixed bugzilla bugs that are resolved in this release, &XercesCName; 2.4.0.

Date Contributor Description
2003-12-01 Jeroen Witmond/Neil Graham fix Doxygen warnings; bug 25118
2003-12-01 Neil Graham fix bug 28084
2003-11-28 Khaled Noaman Set root element if not previpusly set, Use memory manager when creating root element name
2003-11-27 Neil Graham in preparation for stateless DOMTypeInfo for elements
2003-11-27 Neil Graham Fix state-ful duplicate attribute detection when the integrated scanner is in use and namespaces are off. Also, implement change to PSVIHandler interface to remove prefix passing.
2003-11-27 Khaled Noaman PSVIElement implementation
2003-11-27 David Cargill implement writeAnnotation
2003-11-27 Neil Graham create XSModels if a PSVIHandler has been set on the scanner. Make PSVI production more robust
2003-11-27 Pete Lloyd implement isSpecified
2003-11-27 David Cargill fixes for segfaults and infinite loops in schema component model implementation;
2003-11-26 Neil Graham mark DOMTypeInfo-related methods on XMLElementDecl deprecated since they are not thread-safe
2003-11-26 Vitaly Prapirny Bug#24983: Proposed changes of bcc.551 and bcb6 project files for forthcoming 2.4.0 release
2003-11-26 PeiYong Zhang DOMPrint run result updated.
2003-11-26 Neil Graham more complete implementation of PSVIAttributeList; remove some problematic const-ness
2003-11-26 Khaled Noaman Store XSModel.
2003-11-25 Neil Graham remove XMLIBM1047Transcoder's dependence on iostream
2003-11-25 Khaled Noaman Add a method to return the XSObject mapped to a schema grammar component
2003-11-25 James Berry Update Mac OS Codewarrior project, Cleanup build errors/warnings from CodeWarrior
2003-11-25 David Cargill Serialize enclosing complex type, Check for out of memory exception and document updates
2003-11-25 David Cargill Make XSObjectFactory inherit from XMemory
2003-11-25 David Cargill Misc. PSVI updates
2003-11-25 David Cargill Update expected result
2003-11-25 Khaled Noaman Fix AIX linking error
2003-11-25 James Berry Add Mac OS project for Xcode, Revise build instructions to reflect deprecation of Project Builder projects, and elevation of the Xcode projects.
2003-11-24 James Berry Eliminate some compiler warnings concerning comments inside of comments
2003-11-24 Hongguo He add IBM1047 to the list of intrinsic transcoders
2003-11-24 Neil Graham allow classes derived from XMLTransService to tailor the intrinsic maps to their taste.
2003-11-24 Khaled Noaman Reset memory manager in Terminate
2003-11-24 Khaled Noaman PSVI: finish construction of XSSimpleTypeDefinition
2003-11-24 Gareth Reakes added in support for xml-declaration feature.
2003-11-24 Adam Heinz Fix for bug 22917
2003-11-23 Neil Graham update method documentation
2003-11-23 Neil Graham DatatypeValidator support for PSVI
2003-11-23 Khaled Noaman PSVI updates
2003-11- David Cargill Enable grammar pools and grammar resolvers to manufacture XSModels. This also cleans up handling in the parser classes by eliminating the need to tell the grammar pool that schema compoments need to be produced.
2003-11-21 David Cargill Setting the stage for PSVI (element and attribute) implementation: pointing out all places in scanners where validation updates need to occur
2003-11-21 David Cargill More schema component model implementation, In particular, this cleans up and completes the XSModel, XSNamespaceItem, XSAttributeDeclaration and XSAttributeGroup implementations.
2003-11-21 Khaled Noaman PSVI: Use XSObjectFactory to create various components.
2003-11-21 Alberto Massari insertElementAt was not checking if there was room for the new element (bug#24714)
2003-11-21 Jeroen Witmond Wrong filename in error messages (bug#24883)
2003-11-21 Alberto Massari Protect getEntityDeclPool from invoking a method on a NULL pointer (bug#24881)
2003-11-21 Alberto Massari Updated COM for xerces-c_2_4_0
2003-11-21 Alberto Massari Updated project to copy xerces-c_2_4_0, not xerces-c_2_3_0
2003-11-20 Khaled Noaman PSVI: element declaration, content model, PSVIutil
2003-11-20 Alberto Massari Updated Borland makefile
2003-11-20 Neil Graham PSVI: store name and namespace information
2003-11-20 PeiYong Zhang build xercesc2_4_0 with icu2.6.1
2003-11-19 Neil Graham increment version to 2.4.0 in docs
2003-11-19 PeiYong Zhang build xercesc2_4_0
2003-11-17 Pete Lloyd, Neil Graham PSVIAttributeList needs to be included by PSVIHandler
2003-11-17 PeiYong Zhang Fix to #4556
2003-11-17 Ronald Landheer-Cieslak Fix for bug 23930
2003-11-17 Alberto Massari Fixed documentation bug#24746
2003-11-14 David Cargill changes in support of second phase of XSModel implementation
2003-11-14 David Cargill removed methods made unnecessary by new XSModel implementation design
2003-11-14 Neil Graham PSVI updates
2003-11-14 Alberto Massari When invoking resolveEntity, specify the current document as the base URI
2003-11-14 Graham Bennett Fix to bug #4556
2003-11-13 PeiYong Zhang Pass correct initSize to container during deserialization
2003-11-13 PeiYong Zhang Solve Compilation/Linkage error on AIX/Solaris/HP/Linux
2003-11-12 PeiYong Zhang Stateless Grammar: Validation Context
2003-11-11 Khaled Noaman Serialization of XSAnnotation.
2003-11-10 Neil Graham implementation for new stateless means of traversing attribute definition lists
2003-11-10 Alberto Massari Fixed memory leak
2003-11-08 Abe Backus fix for bug 24287
2003-11-07 David Cargill PSVI/schema component model implementation
2003-11-07 David Cargill fix compilation errors on AIX and HPUX
2003-11-07 Khaled Noaman For PSVI support, distinguish wildcard elements with namespace lists.
2003-11-06 Neil Graham update KEYS file with public key as newly-signed by two other Apache-ites
2003-11-06 James Berry Add Mac OS X DYLD_LIBRARY_PATH notes to unix build instructions
2003-11-06 Neil Graham update grammar pool interface so that cacheGrammar(Grammar) can tell the caller whether the grammar was accepted. Also fix some documentation errors.
2003-11-06 PeiYong Zhang Patch to Solaris compiler error
2003-11-06 Khaled Noaman PSVI support for annotations.
2003-11-06 David Cargill first part of PSVI/schema component model implementation.
2003-11-05 PeiYong Zhang Grammar Pool Specification updates
2003-11-05 PeiYong Zhang
2003-11-05 PeiYong Zhang don't serialize built-in baseValidator, and don't serialize localName/uriName
2003-11-04 Alberto Massari When invoking resolveEntity, specify the base URI
2003-11-04 Alberto Massari When loading a grammar that's going to be cached, re-use the grammars already in the cache
2003-11-03 Alberto Massari A version of lastIndexOf would crash the application if the character to be searched was not found in the string
2003-11-01 Alberto Massari Updated BCB6 project
2003-10-31 PeiYong Zhang Serialization test fix
2003-10-30 David Cargill Enhanced Entity Resolver Support.
2003-10-29 PeiYong Zhang GrammarPool serialization/deserialization
2003-10-29 PeiYong Zhang Support for Template serialization/deserialization added
2003-10-29 PeiYong Zhang XObjectComparator/XTemplateComparator
2003-10-27 James Berry Add comment regarding permissible values for XML_PLATFORM_NEW_BLOCK_ALIGNMENT.
2003-10-24 David Cargill. Fix for bug #24207
2003-10-23 Khaled Noaman Fix memory leak
2003-10-22 Khaled Noaman Annotation support
2003-10-21 Alberto Massari Fixed memory leak [bug 23073]
2003-10-21 Alberto Massari Update COM project files
2003-10-21 PeiYong Zhang update XercesLib.mak
2003-10-21 Alberto Massari Inside a schema, the properties "fixed" and "default" for a reference to an attribute were ignored unless the "required" property were also present [bug 11767]
2003-10-20 Khaled Noaman Fix multithreading problem
2003-10-20 Gareth Reakes Pass in memory manager to constructors and use for creation of enumerators.
2003-10-18 James Berry Open files for reading as "r", not "r+". on MacOS
2003-10-18 PeiYong Zhang Support for Template class serialization/deserialization
2003-10-17 Khaled Noaman Fix multithreading problem for regular expression.
2003-10-15 PeiYong Zhang Implementation of Serialization/Deserialization for Schema components
2003-10-10 Neil Graham update XSModel and XSObject interface so that IDs can be used to query components in XSModels, and so that those IDs can be recovered from components
2003-10-10 PeiYong Zhang Implementation of Serialization/Deserialization for Grammar components
2003-10-09 David Cargill fix for bug 21780
2003-10-09 Neil Graham Synchronized StringPool for thread-safe updates.
2003-10-08 PeiYong Zhang Synchronize ContentSpec/ContentModel/FormattedModel
2003-10-07 PeiYong Zhang API for Template_Class Object Serialization/Deserialization
2003-10-07 David Cargill. Fix #23413
2003-10-06 Mike Pawlowski Rewrite packageSources
2003-10-04 Neil Graham Stateless Grammar
2003-10-02 PeiYong Zhang Implementation of Serialization/Deserialization for Datatype Validators
2003-10-02 Gareth Reakes Removed ^Z from end of files which was preventing compilation under gcc 2.96.
2003-10-01 David Cargill. improve handling of out of memory conditions, bug #23415
2003-10-01 Khaled Noaman Refactoring of some code to improve performance.
2003-09-26 PeiYong Zhang Synchronize ContentSpecNode and formattedModel
2003-09-26 David Cargill fix for bug #23427
2003-09-25 PeiYong Zhang Loose the assert condition so that Serializable class need NOT to check the actual string length before read/write.
2003-09-24 Alby useImplementation should use memory maneger.
2003-09-23 PeiYong Zhang Inplementation for Serialization/Deserialization
2003-09-23 PeiYong Zhang Macro re-organized: provide create/nocreate macros for abstract and nonabstract classes
2003-09-22 Neil Graham change Grammar::putElemDecl(XMLElementDecl, bool) so that it does not require the Grammar object to be const. Also, mark findOrAddGrammar as being dangerous in multithreaded situations
2003-09-22 Gareth Reakes doc fix
2003-09-18 PeiYong Zhang OSU: Object Serialization Utilities
2003-09-18 Gareth Reakes updated the distribution directory.
2003-09-16 Neil Graham make Grammar pool be responsible for creating and owning URI string pools. This is one more step towards having grammars be independent of the parsers involved in their creation
2003-09-16 Neil Graham PSVI/schema component model classes
2003-09-12 Jay Hansen enable MemParse to work on OS400.
2003-09-10 Neil Graham fix compiler warnings on ISeries; add Apache copyright notice
2003-09-08 PeiYong Zhang Restore pre2.3 constructors
2003-09-06 Dave Bertoni Fix bug #22938. Deletion of void* is illegal.
2003-09-04 Gareth Reakes Fix for bug #22008. Removed the ability to adopt the DOMObject.
2003-09-04 David Cargill. Fix bug #19605. Problem with CDATA END TAG
2003-09-01 Gareth Reakes added API to get an enumerator for the cached grammars.
2003-08-31 Shin'ya Morino. Fix for bug 21990
2003-08-29 Gareth Reakes If a type was explicitly declared as anyType that now gets set in DOMTypeInfo. Added test cases.
2003-08-27 James Berry Add new static global that always points to array-allocating memory manager
2003-08-27 Gareth Reakes Fixed a bug where multiple invalid elements with the same name/uri were not being set with appropriate PSVI info. Added a test case to expose the problem.
2003-08-26 James Berry Add new memory allocator that allocates using new[], for use where returned memory must be able to be deleted using delete []. This saves duplicated code in cases where a routine is optionally called with a specific memory manager, such as in the case of transcode
2003-08-26 Neil Graham fix compilation errors on HPUX and Solaris
2003-08-26 benoit.blaquiere@ign.fr Fix bug #22697; transcodeFrom incorrectly throws on kTECOutputBufferFullStatus.
2003-08-25 Alberto Massari fix for bug 22178
2003-08-22 Alberto Massari keep the fGrammarFromPool in sync to avoid problems when parseing multiple times.
2003-08-22 Gareth Reakes Not all unknown attributes are faulted in. In these cases the DOMTypeINfo should report AnySimpleType, not AnyURI as they were.
2003-08-21 Neil Graham add the Apache license to various Perl scripts that did not have it
2003-08-21 PeiYong Zhang use PlatformUtils::panic()
2003-08-20 Neil Graham Added a method for use in XercesDOMParser (and others derived from AbstractDOMParser) and a feature in DOMBuilder that allows the creation of the document during parse to be from an DOMImplementation other than the default.
2003-08-20 Gareth Reakes Changed constuctors to protected to be derivatable
2003-08-20 Gareth Reakes Reorderd initializer list to prevent compiler warning.
2003-08-20 Steven White A basic perl script that takes a DOM header file and creates the format used in HTML bindings file.
2003-08-20 Gareth Reakes Added Level 3 XPath interfaces.
2003-08-20 David Cargill fix for bug 22565
2003-08-19 David Cargill fixing bug 21001
2003-08-19 Neil Graham fix for bug 22537
2003-08-16 Neil Graham fix for bug 22457. Union types that are restrictions of other union types were previously considered not to inherit their parents member types. This is at variance with the behaviour of the Java parser and apparently with the spec.
2003-08-14 Gareth Reakes Method added to allow serilization of custom nodes from derived classes.
2003-08-14 Vitaly Prapirny patch for bug 16933
2003-08-13 Khaled Noaman Code refactoring to improve performance of validation.
2003-08-13 Alberto Massari fix to bug 22177
2003-08-13 David Cargill fix for bug 20058
2003-08-12 Caroline Rioux. Added serialization for attribute nodes
2003-08-08 Steve Dulin. fixes to make OS390PlatformUtils.cpp compile
2003-08-07 Neil Graham fix segmentation faults that may arise when the parser throws exceptions during document parsing. In general, XMLPlatformUtils::Terminate() should not be called from within a catch statement.
2003-08-04 Zeid Derhally Update Win32 CodeWarrior project for recent file additions/deletions;
2003-08-04 James Berry Update Mac OS ProjectBuilder project for recent file additions/deletions
2003-07-31 James Berry Resolve bug #21623; document that XMLParsePath... routines may fail if the file doesn't exist
2003-07-31 PeiYong Zhang GrammarPool
2003-07-28 Steve Dulin fix to permit the samples source to be copied from a non-writable to a writable part of the filesystem, then compiled. Binaries will also be dropped in a writable directory. This should make experimentation easier on multi-user systems.
2003-07-25 Michael Glavassevich The patch fixes Bugzilla #19787, #20006, #20009, #20010 and #20287, and several other issues.
2003-07-24 Michael Glavassevich Fix for bug #20005
2003-07-24 David Cargill Patch for bug #20530 - Attributes which have the same expanded name are not considered duplicates.
2003-07-24 Erik Rydgren getTextContent fix
2003-07-22 Steven White. Fix build under VC7
2003-07-21 June Ng fixing bug 21573
2003-07-17 Pedro Lopes and Vitaly Prapirny fix for bug 18860
2003-07-16 PeiYong Zhang Documentation on system call, strtod
2003-07-14 Vitaly Prapirny and Anthon Pang patch to bug 20353
2003-07-14 Abe Backus patch to bug 21527
2003-07-10 PeiYong Zhang Stateless Grammar: create grammar components with grammarPool's memory Manager
2003-07-10 PeiYong Zhang Stateless Grammar: Initialize scanner with grammarResolver
2003-07-04 PeiYong Zhang specify library with version on AIX
2003-06-26 PeiYong Zhang GrammarPool
2003-06-23 PeiYong Zhang to solve unresolved symbol on Solaris
2003-06-23 PeiYong Zhang clean up temporary XMLGrammarDescription to make MemoryTest happy
2003-06-20 PeiYong Zhang Stateless Grammar Pool :: Part I
2003-06-16 Tuan Hoang update xerces-c.spec file
2003-06-10 James Berry Add support to threadtest for Mac OS X
2003-06-09 James Berry Add DYLIB_LIBRARY_PATH directions for running samples under Mac OS X.
2003-06-06 Robort Buck Bug#20552 Updated VC7 Project files.
2003-06-03 PeiYong Zhang for build on WinXP.NET and Intel Electron
2003-06-02 Neil Graham new test for the pluggable memory management mechanism.
2003-06-02 Berin Lautenbach fix for bug #20092
2003-06-02 Berin Lautenbach Bug 20413 Xerces 2.3 does not compile under NetBSD 1.6
2003-05-30 Alberto Massari Fixes so we compile under VC7.1.
2003-05-30 Gareth Reakes Use new macros for iostream.h and std:: issues.
2003-05-30 Sean McInerney fix to bug #20350. Fix 2 typos.
2003-05-29 Gareth Reakes fixed typo for version number
2003-05-29 Khaled Noaman Fix memory leak when using deprecated dom.
2003-05-29 Nathan Codding Fix to bug #16817. Non leaf nodes and attributes now get notified of release
2003-05-29 Gareth Reakes fix to bug #20325. Removed unused file and updated Projects.
2003-05-29 Gareth Reakes Added macros in so we can determine whether to do things like iostream as opposed to iostream.h and whether to use std:: or not.
2003-05-28 Neil Graham update copyright notice
2003-05-27 Neil Graham upload public key used for signing releases
2003-05-27 Michael Glavassevich fix typo that could have been impacting correct operation of reference counting.
2003-05-26 PeiYong Zhang Use memory manager embedded in rather than the one passed in to de-allocate memory.
2003-05-24 Neil Graham fix segfault on GCC 2.9x. The depreacted DOM attribute implementation had a cute trick where a void * field could be either a NodeChild pointer or a DOMString; the latter played havoc with the new memory management paradigm. Now a union of a DOMString * and a ChildNode * is used.
2003-05-22 Neil Graham make GCC happy and make it clearer what we actually use alignPointerForNewBlockAllocation() for in our code.
2003-05-22 James Berry Move pointer alignment functionality into XMLPlatform header; revise XMemory and DOMDocumentImpl to return blocks aligned by this function
2003-05-22 PeiYong Zhang removal of isOwnerDocSingleton
2003-05-22 PeiYong Zhang Build memory manager on hp
2003-05-22 Neil Graham PanicHandler interface should not inherit from XMemory
2003-05-22 Gareth Reakes Removed usage of std to compile under gcc and other platforms
2003-05-22 Magnus Strand Fix another case where use of fallback characters during transcode could cause undesired failure of transcode
2003-05-21 James Berry Ensure proper block alignment for blocks allocated with XMemory new operators
2003-05-21 Khaled Noaman Handle allocation of document types not created by a DOM document
2003-05-21 Khaled Noaman Fix to HP-UX compiler's complaint about the duplicate overload of delete
2003-05-21 Khaled Noaman fix to gcc 2.95.x internal error for some template definitions
2003-05-21 PeiYong Zhang release document
2003-05-21 James Berry Mac OS LCP transcoder fix
2003-05-21 James Berry CodeWarrior Mac OS Project File updates
2003-05-21 Zeid Derhally CodeWarror Win32 Project File updates
2003-05-21 James Berry First cut at Mac OS X Project Builder changes
2003-05-20 PeiYong Zhang Apply Memory Manager to Base64
2003-05-20 Khaled Noaman Initialize ValueVectorOf
2003-05-19 Gareth Reakes NetBSD compilation fix

Below is the list of fixed bugzilla bugs that are resolved in this release, &XercesCName; 2.3.0.

Date Contributor Description
2003-05-16 Khaled Noaman Configurable Memory Management
2003-05-15 Gareth Reakes Partial Document::normalizeDocument() Implementaion
2003-05-15 Nathan Codding Optimization. We now resize the hash when appropriate.
2003-05-14 Alberto Massari Fix to problem with multiple default namespace attributes being serialized
2003-05-14 Hiramatsu Yoshifumi port to NetBSD
2003-05-13 Neil Graham Fix a bug that caused ComplexTypeInfo#elementCount() to report values including references to global elements only when the schema-full-checking flag was true
2003-05-12 Alberto Massari [Bug 18832] Corrected serilization with regards to namespace nodes
2003-05-10 Zeid Derhally Fix bugs 19816, 19817, 19818;
2003-05-06 Neil Graham Fix GCC compilation problem and incorrect #include
2003-05-05 Urs Muff/Neil Graham Adding optional support for reference counting of nodes within the DOM
2003-05-01 James Devries Socket support added on OS400
2003-04-30 Khaled Noaman MemoryManager and XMemory
2003-04-30 Andrew Hefford [Bug 19472]Spelling mistake correction.
2003-04-29 Khaled Noaman Cut link to XMLBigInteger
2003-04-28 Neil Graham Implement namespaces 1.1
2003-04-28 Ailian Ding [Bug 19402] OS2PlatformUtils.cpp compareAndSwap() need to return retVal.
2003-04-28 James Berry Add function prototype to eliminate compiler warning
2003-04-27 James Berry Add new files to Mac OS CodeWarrior project
2003-04-27 James Berry Add include for stdlib to pull in size_t declaration
2003-04-27 James Berry Add new files to Mac OS ProjectBuilder projects
2003-04-27 James Berry PanicHandler, GetCurrentDir() and isAnySlash() on MAC
2003-04-25 Khaled Noaman Replicate key2 and key3 when putting an item in the list
2003-04-25 PeiYong Zhang throw exception if getcwd() fails
2003-04-25 Neil Graham Win32PlatformUtils: use WIN API to make it compilable on Windows with both cygwin and MSVC++
2003-04-24 PeiYong Zhang Logical Path Resolution
2003-04-22 Khaled Noaman Initialize security manager in Scanner constructor
2003-04-22 Neil Graham change const static member (in SecurityManager) to an enum to make MSVC happy
2003-04-21 Khaled Noaman Use XMLString::release to prepare for configurable memory manager.
2003-04-21 Khaled Noaman Performance: use memcpy in moveChars and replicate.
2003-04-21 Khaled Noaman MemoryManager and MemoryManagerImpl
2003-04-21 PeiYong Zhang Performance tuning to XMLPlatformUtils::getFullPath()
2003-04-17 Neil Graham new property, http://apache.org/xml/properties/security-manager
2003-04-15 Berin Lautenbach [Bug 17096] XMLUri relative path calculation badly broken
2003-04-09 Pedro Lopes [Bug 18860] Samples on Borland C++ 6 - access violations and build errors
2003-04-09 Guido Gagliardi [Bug 18856] Example code do not compile
2003-04-07 Vasily Tchekalkin [Bug 18672] IconvGNUTranscoder can't be build when namespaces is on.
2003-04-04 Neil Graham Update to project file: DOMConfigurationImpl
2003-04-03 PeiYong Zhang Revised Implementation of getTextContent() to use castToNodeImpl()
2003-04-02 Erik Rydgren Implementation of getTextContent().
2003-04-02 Neil Graham Fix to personal.xsd to permit xml:base on on elements
2003-04-01 PeiYong Zhang [Bug 18594] DOMWriter does not recognize Document Fragment
2003-04-01 PeiYong Zhang Link in version numbered ICU on AIX
2003-03-31 Gareth Reakes Changed the API for document normalization to the new Level 3 WD
2003-03-31 Caroline Rioux DOMConfiguration
2003-03-27 Tinny Ng use __IBMCPP__ instead of __xlC__ to determine xlC compiler
2003-03-25 Khaled Noaman Fix typo in program-others.xml
2003-03-24 Tinny Ng Link in version numbered ICU so that multiple version of XML4C can coexist
2003-03-23 PeiYong Zhang Invalid second values in XMLDateTime
2003-03-21 Khaled Noaman Should reset reader manager before returning loaded grammar
2003-03-20 PeiYong Zhang Fix to 'genrb' on Linux
2003-03-20 Neil Graham [Bug 12436] Add detection of invalid UTF-8 byte sequences
2003-03-19 Vinayak Added flag (p) and code to the countChildElements fn to enable printing of nodes and all associated attributes
2003-03-18 PeiYong Zhang Build versioned shared library, libXercesMessages on UNIX
2003-03-18 Khaled Noaman Schema Errata E2-18.
2003-03-18 Alberto Massari [Bug 18063] References to attributeGroup/group definition are not allowed to have annotations
2003-03-17 PeiYong Zhang Build versioned Message on Windows
2003-03-16 PeiYong Zhang [Bug 18051] Memory leak in Formatter
2003-03-15 PeiYong [Bug 17983] Formatter does not escape control characters
2003-03-14 PeiYong Zhang Copy non-versioned libXercesMessages to target directory
2003-03-14 PeiYong Zhang Enable to locate libXercesMessage
2003-03-14 Tinny Ng Change to 2.3
2003-03-14 Tinny Ng [Bug 17147] C++ namespace breaks build of XercesCOM DLL.
2003-03-13 Chris McKillop [Bug 17858] Support for QNX/Neutrino.
2003-03-13 Vitaly Prapirny [Bug 11974] mak-files for bcc32 v.5.5.1 (free or from BCB5).
2003-03-11 PeiYong Zhang Build versioned dll for ICU message files.
2003-03-11 Khaled Noaman Schema Fix: Check that target namespace of global/local attribute declarations is not the xsi uri.
2003-03-11 Khaled Noaman Schema Fix for circular substitution group check.
2003-03-10 Khaled Noaman Schema Fix for complex type declarations with mixed content.
2003-03-10 PeiYong Zhang Schema Errata E2-40 double/float.
2003-03-10 Khaled Noaman Schema Fix for types referred to without explicitly specifying its namespace.
2003-03-10 Tinny Ng XML1.0 Errata E38.
2003-03-09 PeiYong Zhang Pluggable PanicHandler.
2003-03-07 Jacques Legare [Bug 17589] Refactoring ....
2003-03-07 Peter Crozier [Bug 17774] Unixware platform utils not implemented.
2003-03-07 Tinny Ng [Bug 11692] Unimplement the hidden constructors and assignment operator to remove warnings from gcc.
2003-03-07 Tinny Ng Return a reference instead of void for operator=.
2003-03-07 Bjoern A. Zeeb [Bug 17571] fix building IconvFBSD (namespaces).
2003-03-07 Bjoern A. Zeeb [Bug 17570] IconvFBSD build on alpha,sparc.
2003-03-06 Alberto Massari [Bug 17633] Empty complex type definition is always non-mixed even if declaration says otherwise.
2003-03-04 Khaled Noaman [Bug 17516] Thread safety problems in ../util/ and ../util/regx.
2003-03-04 Khaled Noaman RegEx: fix for character category escape.
2003-03-01 PeiYong Zhang Schema Fix: TotalDigits value must be a positiveInteger.
2003-02-26 Khaled Noaman [Bug 17425] Schema using cyclic import fails validation.
2003-02-26 PeiYong Zhang Schema Errata E2-43: disallow trailing decimal point and a new pattern added to the Integer definition.
2003-02-25 Tinny Ng [Bug 12192] File named 'CVS' should be deleted.
2003-02-25 Steve Dulin Modify UnixHTTPURLInputStream for it to work on ebcdic platform.
2003-02-25 James Berry Fixes to runConfigure which was worrying overmuch if no C++ compiler was specified. and fix the test for TRU64
2003-02-25 PeiYong Zhang Schema Errata: E2-44 totalDigits/fractDigits.
2003-02-25 Tinny Ng [Bug 13491] avoid deleting through void* in DOMDocumentImpl.cpp.
2003-02-25 Tinny Ng [Bug 7072] Documentation for XMLString::transcode states invalid return value.
2003-02-25 Tinny Ng [Bug 13493] Use const on static data in DOMWriterImpl.cpp.
2003-02-25 Duncan Stodart [Bug 12350] Xerces compilation problems on Tandem (HP Nonstop).
2003-02-25 Dan Gohman [Bug 13492] Unintended comma expression in DOMRangeImpl.cpp.
2003-02-25 Michael Cahill [Bug 17358] C++ namespace support in IconvFBSD doesn't compile.
2003-02-22 James Berry Improvements to Mac OS port:
- Refactor Mac OS file handling into distinct files per file type.
- Add Posix file handling to use posix file apis directly where possible.
- Carbon file access is now used only where posix files aren't available.
- Tweaks to FSSpec/FSRef routines to handle directories better.
2003-02-22 PeiYong Zhang Schema Errata E2-35 Length, minLength and maxLength in different derivation steps.
2003-02-21 Neil Graham Fix packageBinaries.pl so that it pays attention when you set the compiler to gcc under cygwin.
2003-02-21 Neil Graham [Bug 13429] Text in part of the Programming/Parsing FAQ is truncated/missing.
2003-02-20 PeiYong Zhang [Bug 7077] build error message shared library for ICUMsgLoader.
2003-02-19 Khaled Noaman Schema errata E2-38.
2003-02-17 Dan Egnor [Bug 17131] File writing on Win32 very very very slow.
2003/02/17 PeiYong Zhang Allow set user specified error message file location in PlatformUtils::Initialize().
2003-02-10 PeiYong Zhang Remove -weol from the command line option list of sample DOMPrint.

Below is the list of fixed bugzilla bugs that are resolved in this release, &XercesCName; 2.2.0.

Date Contributor Description
2003-02-06 Khaled Noaman Schema Errata:
1. E1-2
2. E1-10
3. E1-15
4. E1-16
5. E1-20
6. E1-21
7. E1-22
8. E1-23
9. E1-27
2003-02-06 PeiYong Zhang Schema Errata:
1. E2-9 Base64.
2. E2-12 gMonth.
3. E2-16 maxExclusive.
4. E2-23 seconds part shall have at least one digit after the dot if it appears.
5. E2-24 Duration 'T': allow SchemaDateTimeException be propogated to client.
6. E2-25 language.
2003-02-06 Khaled Noaman Performance: Scanner Reorganization. Create XMLScannerResolver, WFXMLScanner, IGXMLScanner, DGXMLScanner, and SGXMLScanner.
2003-02-06 Khaled Noaman Performance:
1. [Bug 13695] Performance problem with large text nodes and XMLFormatter.cpp.
2. Make getNextChar/peekNextChar inline.
3. Reduce instruction counts in XMLReader.
4. Do not call XMLString::stringLen in XMLString::indexOf.
5. Use existing QName in XMLElementDecl instead of creating a new one everytime.
6. Allow creating/setting of XMLAttr using a rawname (i.e. 'prefix:localpart').
7. Enable/disable calculation of src offset.
8. No need to use temporary buffer to hold namespace value in SAX2XMLReaderImpl.
9. Eliminate unnecessary condition in compareNString.
10. Use global buffer to eliminate repetitive memory creation/deletion
2003-02-06 Tinny Ng Performance:
1. DOM: call fParent.fOwnerDocument directly instead of fNode.getOwnerDocument.
2. Check for null string directly isntead of calling XMLString::stringLen.
3. New inline function XMLString::equals that simply returns true or false, use it instead of XMLString::compareString wherever applicable.
4. XERCES_XMLCH should not be classified as XMLRecognizer::OtherEncodings.
5. Pre uppercase the encodingString before calling encodingForName to avoid calling compareIString.
6. Use XMLRecognizer::Encodings enum to make new transcode, faster than comparing the encoding string every time.
7. Reduce some instruction counts in XMLUTF8Transcoder.
8. [Bug 13447] Using LocalFileFormatTarget with DOMWriter is very slow.
9. Define fGlobalDeclarations as an array of ValueVectorOf to avoid string comparison.
2003-02-06 David Bertoni [Bug 16826] RefVectorOf.c has errors in strict ANSI mode.
2003-02-06 Gareth Reakes Schema Fix: bug with multiple attributes being validated by the same union type.
2003-02-05 Tinny Ng [Bug 7592] XMLURL::lookupByName() should be static.
2003-02-05 Tinny Ng [Bug 3111] Problem with LexicalHandler::startDTD() and LexicalHandler::endDTD().
2003-02-05 Tinny Ng [Bug 16322] DOMDocumentImpl::replaceChild should honor fDocElement.
2003-02-05 Tinny Ng [Bug 11915] Utility for freeing memory.
2003-02-05 Tinny Ng [Bug 13437] Incorrect memory management in XXXPlatformUtils.cpp.
2003-02-05 Zeid Derhally [Bug 14599] Metrowerks in support of CodeWarrior for Windows.
2003-02-05 PeiYong Zhang [Bug 16796] Possible out of bounds memory read in XMLRecognizer::basicEncodingProbe.
2003-02-05 Khaled Noaman [Bug 16747] Parser loses ValidationScheme setting between parse attempts.
2003-02-04 PeiYong Zhang [Bug 16784] Obsolete documentation on XMLTranscoder
2003-02-04 PeiYong Zhang [Bug 16652] data from CDATA section is not passed for validation.
2003-01-30 Tinny Ng [Bug 3041] wrong PLATFORM_IMPORT in MVSCPPDefs.hpp.
2003-01-29 Gareth Reakes Partial PSVI Support.
2003-01-29 Gareth Reakes DOM L3: DOMTypeInfo and an associated test case.
2003-01-29 Lenny Hoffman [Bug 6271] Invalid Precondition Test.
2003-01-29 Khaled Noaman [Bug 15787] Reduce array size to reduce memory footprint.
2003-01-28 PeiYong Zhang [Bug 13694]: Allow Xerces to write the BOM to XML files.
2003-01-23 Tinny Ng [Bug 16188] Consistent crashes with BCB6.
2003-01-23 Tinny Ng [Bug 16277] Readme should make note of threaded library problems in BCB6.
2003-01-16 David Bertoni [Bug 16151] Memory leak in DTDScanner with ill-formed DTD declaration.
2003-01-13 Khaled Noaman [Bug 16024] SchemaSymbols.hpp conflicts C++ Builder 6 dir.h.
2003-01-13 Khaled Noaman [Bug 14390] C++ Indentifier collision with Python.
2003-01-13 Khaled Noaman [Bug 14469] Validator doesn't enforce xsd:key.
2003-01-10 Tinny Ng [Bug 13909] Use of non standard mbstowcs feature.
2003-01-10 Tinny Ng [Bug 14545] samples/Makefile.incl has bad -L for linux.
2003-01-10 Alberto Massari [Bug 14912] crashes inside UnionDatatypeValidator::isSubstitutableBy.
2003-01-10 Albert Strasheim [Bug 5854] Patches and .spec file for rpm creation of 2.2.0.
2003-01-09 Tinny Ng [Bug 14955] error validating parser.
2003-01-09 Tinny Ng [Bug 15928] Output with LocalFileFormatTarget fails silently.
2003-01-09 Tinny Ng [Bug 15371] Fix documentation. The default of schema processing shoud be false.
2003-01-09 Tinny Ng [Bug 15372] DOMBuilder::parseFromURI ignores result of handleErrors.
2003-01-09 Tinny Ng [Bug 15802] Add "const" qualifier to getURIText.
2003-01-09 Tinny Ng [Bug 15427] DOMWriter dose not flush the output stream.
2003-01-09 Colin Adams [Bug 15796] surroundContents seg-faults.
2003-01-03 Tinny Ng New feature StandardUriConformant to force strict standard uri conformance.
2002-12-31 Tinny Ng [Bug 15590] BeOSDefs.hpp has wrong case in CVS.
2002-12-31 Tinny Ng [Bug 15608] IconvLCPTranscoder::transcode() is wrong at wcstombs() usage.
2002-12-30 Gareth Reakes Added isDocumentAdopted API and recognize feature fgXercesUserAdoptsDOMDocument in DOMBuilder::getFeature/canSetFeature.
2002-12-24 Tinny Ng Build with ICU 2.4.
2002-12-24 Tinny Ng [Bug 15160] TrueCoverage build fails in Window.
2002-12-23 Khaled Noaman New public api to various parsers to return the src offset within the input source.
2002-12-20 Tinny Ng XML 1.1
2002-12-19 Peter A. Volchek Schema: get/set methods to see if the represented type is anonymous.
2002-12-18 Gareth Reakes [Bug 13438] Mismatched new[]/delete in template vector class. Added new abstract base class BaseRefVectorOf from which both RefVectorOf and the new class RefArrayVectorOf inherit from it.
2002-12-18 Jennifer Schachter New Regx functionality - tokenize and replace.
2002-12-16 James Berry [Bug 14805] Mac OS transcoder should return pointer to zero length string (rather than NULL) on receipt of zero length input.
2002-12-10 PeiYong Zhang Validating Schema Float/Double in value space. Converting out-of-bound value into special values.
2002-12-10 Tinny Ng NLS: DOMWriter should use message loader to load message instead of using hardcoded static stirng.
2002-12-06 Kevin King [Bug 13840] DOMWriter: more pretty-print format feature.
2002-12-06 Tinny Ng Fix: for file protocol, need to manually replace any character reference %xx first.
2002-12-06 Tinny Ng [Bug 9083] Make some classes be exportable.
2002-12-06 Tinny Ng [Bug 9697] Make GrammarResolver to be exportable.
2002-12-02 Andrew Bachmann [Bug 12490] Patches required to build Xerces-C++ on BeOS R5.
2002-12-02 Adam Zell [Bug 14723] Memory leak in atomicOpsMutex.
2002-12-02 Abe Backus [Bug 13804] Update build and installation docs for cygwin.
2002-12-02 Peter A. Volchek [Bug 14960] Opened up interface to expose user defined and built in registries.
2002-12-02 Gareth Reakes and Peter A. Volchek [Bug 12188] Create NMTOKEN, ID, IDREF, ENTITY, NAME, NCNAME with appropriate base types. Some reordering of creation was required where dependencies resulted.
2002-12-02 Peter A. Volchek [Bug 12238] Attributes without type declarations should be validated using AnySimpleTypeValidator, not the string validator.
2002-11-26 Tinny Ng Namespace Check:
1. xmlns:a="" where namespace URI is null is not valid.
2. xmlns:doc where xmlns is used as element prefix is not valid.
3. xmlns:xmlns where xmlns is used as prefix is not valid.
4. xmlns:xml="a" where xml is used as prefix but URI does not match the xml uri (http://www.w3.org/XML/1999/namespace) is not valid.
5. if validation is on, attribute values declared to be of types ID, IDREF(S), ENTITY(IES), and NOTATION are also Names, and thus should be colon-free.
2002-11-25 Tinny Ng Thread-safe the static variable TransService::gMappings.
2002-11-22 Robert Buck Add autodetection of MSVC++ version in packageBinaries.pl.
2002-11-22 Chris Larsson and Stephen Dulin 390: support record-oriented MVS datasets with the DOM Level 3 serialization APIs.
2002-11-22 Chris Larsson and Stephen Dulin 390: Uniconv390 support.
2002-11-21 Jennifer Schachter Fixed bug in Token::analyzeFirstCharacter so that . matches new line with head character optimisation enabled.
2002-11-21 Gareth Reakes and Jennifer Schachter DOM L3: isId, setIdAttribute, setIdAttributeNS and setIdAttributeNode.
2002-11-21 PeiYong Zhang Schema Fix: validate content as a whole against pattern.
2002-11-20 PeiYong Zhang Update ThreadTest to use DOMWriter to dump DOM.
2002-11-19 Tinny Ng [Bug 13487] Linux runs on many non-i386 platforms.
2002-11-19 Cameron Dorrat [Bug 14661] Caldera implemented openFileToWrite and writeBufferToFile.
2002-11-18 Steven White Problems using make tarball under linux.
2002-11-18 Abe Backus [Bug 14612] GCCDefs clashes with cygwin's string.h for stricmp and strnicmp.
2002-11-15 Abe Backus [Bug 13801] cygwin libxerces-c.dll symlinks misleading.
2002-11-15 Tinny Ng [Bug 13751] Documentation for DOMNamedNodeMap incorrect.
2002-11-15 Richard Balint [Bug 14598] IRIX 6.5 / g++ 3.0.4 compilation bugs.
2002-11-14 Tinny Ng [Bug 14265] Access violation with Null systemId/publicId in DTDScanner.
2002-11-14 Tinny Ng [Bug 14479] XMLString::subString failure when len(source)==0.
2002-11-14 Tinny Ng [Bug 14389] DOMPrint - gDoCreate - wrong default value.
2002-11-13 PeiYong Zhang [Bug 14528] Encounters of the end tag "]]>" are ignored.
2002-11-13 James Berry [Bug 14260] MacOSUnicodeConverter::upperCase() passes wrong arguments to Carbon function.
2002-11-13 James Berry Update Mac OS build for compatiblity with namespace additions.
2002-11-12 Tinny Ng DOM Message: make use of the non-standard extension DOMImplementation::loadDOMExceptionMsg to load the default error text message for the correspond Exception Code.
2002-11-12 Tinny Ng DOM Message: introduce a new message domain, XMLDOMMsg, for DOM Messages.
2002-11-04 PeiYong Zhang New feature XMLPlatformUtils::Initialize(const char* const locale) to set the locale for message loader.
2002-11-04 Tinny Ng C++ Namespace Support
2002-10-30 Tinny Ng [Bug 13641] compiler-generated copy-constructor for QName doesn't do the right thing.
2002-10-29 Chris Larsson Modify DOMPrint to accept a file name as a parameter.
2002-10-29 Tinny Ng Support for Linux/390 which is big endian.
2002-10-23 PeiYong Zhang [Bug 13213] DOMImplementation::hasFeature() should be const.
2002-10-17 PeiYong Zhang [Bug 13640] Getter methods not public in DecimalDatatypeValidator.
2002-10-16 Khaled Noaman [Bug 13293] Schema ID validation can fail depending on declaration ordering.
2002-10-15 Khaled Noaman [Bug 13604] while loop never terminates.
2002-10-15 Khaled Noaman [Bug 13639] Failure to parse xsi:schemaLocation attribute value correctly.
2002-10-15 Khaled Noaman [Bug 13494] use unsigned instead of signed in TraverseSchema.cpp.
2002-10-15 Khaled Noaman [Bug 13490] new[]/delete mismatch in RangeToken.cpp.
2002-10-15 Khaled Noaman [Bug 13489] missing 'return' in Token.cpp.
2002-10-15 Khaled Noaman [Bug 13485] incorrect return from getWSstring.
2002-10-04 Duncan Stodart [Bug 12560] Use const in DOMWriter.
2002-10-01 Tinny Ng [Bug 13139] Building Promblems on HP-UX.
2002-09-30 PeiYong Zhang Support ICU Message Loader.
2002-09-30 PeiYong Zhang Xlat: To generate icu resource file (in text) for error message.
2002-09-30 Tinny Ng [Bug 13109] DOMRange::toString eventually cycles forever.
2002-09-27 Guillaume Morin [Bug 12547] Xerces C++ 2.1 fails to build on Linux 64 bits arch with -tlinux.
2002-09-27 Tinny Ng [Bug 13073] GeneralAttributeCheck.cpp : compilation fails with Sun C++ 4.2 on Solaris2.7 system.
2002-09-27 Peter Volchek [Bug 12740] Extra include.
2002-09-27 Gareth Reakes [Bug 12847] bulid warning for non-virtual constuctor.
2002-09-27 Gareth Reakes [Bug 12848] newline warning whist building.
2002-09-26 Gareth Reakes [Bug 12849] comparison is always false warning.
2002-09-26 Erik Rydgren [Bug 12914] Bug in AbstractDOMParser::resetPool().
2002-09-26 Gareth Reakes DOM L3: Add const to isSameNode, isEqualNode, compareTreePosition.
2002-09-23 PeiYong Zhang Issue Panic_CantLoadMsgDomain if loadAMsgSet() fails.
2002-09-23 PeiYong Zhang Support MsgCatalog Message Loader.
2002-09-23 Gareth Reakes, Thomas Ford and Tinny Ng DOM L3: Support baseURI.
2002-09-18 Stephen Dulin OS390 Performance Enhancement: instead of calling isPosixOn everytime, store the information in a static flag during initialization.
2002-09-17 Thomas Woerner RPM for Linux.
2002-09-16 Tinny Ng Infinite loop for malformed xml (e.g. simple has "XXXX") w/ setexitonfirstfatal(false).
2002-09-16 Tinny Ng [Bug 12442] Fix typo: "Mode:" which should be "Model".
2002-09-09 PeiYong Zhang [Bug 12369] invalid output from DOMWriter using MemBufFormatTarget.
2002-09-05 James Berry Add export directives for Mac OS path utility routines .
2002-09-05 Tinny Ng [Bug 12232] Make operator to be constant.
2002-09-05 Tinny Ng [Bug 12290] example on webpage won't compile.
2002-09-05 Tinny Ng [Bug 12279] Makefiles contain tabs causing "commands commence" error.
2002-09-05 Tinny Ng [Bug 12275] DOMCount -n gives DOM Error.
2002-09-03 Tinny Ng [Bug 12897] System ID is missing inside DOCTYPE.
2002/08/27 Khaled Noaman Identity Constraint: handle case of recursive elements.
2002-08-27 Tom Ford [Bug 12087] XMLString::patternMatch() is not accurate.

Below is the list of fixed bugzilla bugs that are resolved in this release, &XercesCName; 2.1.0.

Date Contributor Description
2002-08-26 Abe Backus [Bug 12004] Samples/Tests don't build under cygwin.
2002-08-23 Tinny Ng [Bug 11981] inproper "AND" operator in AutoSense.hpp
2002-08-23 Tinny Ng Memory leak fix: enums is not deleted if an error occurred.
2002-08-23 Tinny Ng Memory leak fix: XMLUri data not deleted if constructor failed.
2002-08-23 James Berry Begin addition of support for Codewarrior MachO build of Xerces framework.
2002-08-23 James Berry [Bug 11776] MacOSUnicodeConvertor::upperCase doesn't work correctly.
2002-08-23 Robert Buck [Bug 11975] Update to XercesLib VC7 Project File.
2002-08-22 Tinny Ng [Bug 7512] Wrong error message created.
2002-08-22 Tinny Ng [Bug 11448] DomCount has problems with XHTML1.1 DTD.
2002-08-22 Robert Buck [Bug 11946] Updated VC7 Project Files for Xerces-C 2.1.
2002-08-22 Khaled Noaman [Bug 11906] Wrong comparison in TraverseSchema.
2002-08-22 PeiYong Zhang [Bug 10653] XMLString::parseInt possible overflow.
2002-08-21 Tinny Ng [Bug 11869] Add the const modifier (XMLBuffer.hpp).
2002-08-21 Tinny Ng [Bug 7087] compiler warnings when using gcc.
2002-08-20 Benjamin Piwowarski [Bug 11515] Exponential time using DOMTreeWalker.
2002-08-20 Tinny Ng [Bug 6251] Info during compilation.
2002-08-19 Vasily Tchekalkin [Bug 11771] Linux specific IconvGNU transcoder.
2002-08-19 Derek Harmon and Abe Backus [Bug 6467] Installing Xerces C++ on cygwin environment.
2002-08-19 Tinny Ng [Bug 11229] bogus -I statements order in CXXFLAGS.
2002-08-19 Tinny Ng [Bug 1471] getInternalSubset returns NDATA with quote. Also fix internalsubset to include notation.
2002-08-19 Khaled Noaman [Bug 11770] - Xerces does not validate the XMLSchema's root element name.
2002-08-16 Khaled Noaman [Bug 7698] Filenames with embedded spaces in schemaLocation strings not handled properly.
2002-08-16 PeiYong Zhang New Configure: Win64 Debug for samples Project / Makefiles.
2002-08-16 Gareth Reakes DOM L3: support lookupNamespacePrefix, lookupNamespaceURL, isDefaultNamespace.
2002-08-16 Tinny Ng [Bug 11360] Release user data using handler.
2002-08-14 Khaled Noaman [Bug 3111] Problem with LexicalHandler::startDTD() and LexicalHandler::endDTD().
2002-08-13 PeiYong Zhang [Bug 9442] minInclusive factet validation alters value.
2002-08-13 Khaled Noaman Recognize UTF16.
2002-08-12 PeiYong Zhang [Bug 11462] MemBufFormatTarget issues (2) - const-ness, thread-safety.
2002-08-12 Tinny Ng Support Intel IA32 C++ Compiler, icc.
2002-08-09 Gareth Reakes DOM L3: support compareTreePosition.
2002-08-08 Stephen Dulin DOMWriter support on z/OS.
2002-08-08 Tinny Ng DOM Fix: Recycle node value buffer to avoid memory growth.
2002-08-07 PeiYong Zhang [Bug 11534] Wrong CDATA Terminator in DOMWriterImpl.
2002-08-07 Khaled Noaman Pass proper value of actual encoding to XMLDecl callback.
2002-08-01 Khaled Noaman If the NamespaceURI, qualifiedName, and doctype are null, the returned Document is empty with no document element.
2002-08-01 Khaled Noaman Ensure that we add only DOM Attr nodes to the attributes NamedNodeMap.
2002-08-01 Khaled Noaman DOM L2 does not support editing DocumentType nodes.
2002-07-31 Tinny Ng [Bug 11338] missing const keyword for DOMNodeList methods.
2002-07-31 Tinny Ng [Bug 6227] Make method getLastExtLocation() constant.
2002-07-31 Tinny Ng [Bug 3788] very long lines in CppErrMsgs_EN_US.hpp causes problems for OS390 compiler.
2002-07-31 Eric Zurcher [Bug 11099] BCB6 project for Xerceslib 2.0 has wrong files.
2002-07-31 Tinny Ng [Bug 6321] gmake error in regx/Makefile.in.
2002-07-30 Tinny Ng [Bug 8550] No explanation of XMLFormatter escape options.
2002-07-30 Khaled Noaman Create default attributes with the namespace URI mapped to the attributes' prefixes.
2002-07-29 PeiYong Zhang Build Xerces with ICU -- Itanium/WinXP/IntelC++Compiler.
2002-07-29 Tinny Ng [Bug 9084] scripts/packageBinaries -j option not well documented.
2002-07-29 Tom Keane [Bug 9533] Win32TransService does not recognize aliases for encodings.
2002-07-26 Tinny Ng Memory Leak in DOMDocumentTypeImpl.
2002-07-26 Joé St-Germain [Bug 10337] XMLString::patternMatch doesn't find pattern in particular context.
2002-07-26 David Bertoni [Bug 11189] Tru64 utilities missing implementation of new functions.
2002-07-26 Jonathan Lennox [Bug 2681] Can't build with gcc/g++ not named 'gcc'/'g++'.
2002-07-26 Khaled Noaman For a given DOM Element and DOM DocumentType node, explicitly cast to the implementation of that DOM node when calling setReadOnly.
2002-07-26 Khaled Noaman Public/System id for notations should be stored as NULL if missing.
2002-07-25 Robert Buck [Bug 11141] Fix To Broken VC7 Builds.
2002-07-25 Khaled Noaman [Bug 11153] getOwnerDocument() on PI that's child of Document returns NULL.
2002-07-24 Khaled Noaman Remove check for disallowed encodings - not needed anymore.
2002/07/23 Tinny Ng Build with ICU 2.2.

Below is the list of fixed bugzilla bugs that are resolved in this release, &XercesCName; 2.0.0.

Date Contributor Description
2002-07-19 Tinny Ng [Bug 10968] Default attributes from Schema not restored by removeAttribute.
2002-07-18 Khaled Noaman Feature to control strict IANA encoding name.
2002-07-18 Tinny Ng [Bug 9707] config.guess out of date. From AutoConf dated July 18, 2002, CVS Tag AUTOCONF-2_53b.
2002-07-17 PeiYong Zhang Add Win64 to Windows VC6 Project files
2002-07-16 Tinny Ng [Bug 6070] warning unused variable in HandlerBase.hpp.
2002-07-16 Tinny Ng [Bug 6576] Exception on processing UTF-16 InputSource buffer with set encoding.
2002-07-16 Tinny Ng [Bug 6590] Improper Internal subset filling.
2002-07-16 Alberto Massari [Bug 7458] Schema validator does not automatically associate the xml prefix to the "http://www.w3.org/XML/1998/namespace" URI.
2002-07-16 Case Larsen [Bug 9502] purify UMR in DocumentImpl::DocumentImpl.
2002-07-16 Case Larsen [Bug 9553] purify UMR in XMLRecognizer::basicEncodingProbe.
2002-07-16 Tinny Ng [Bug 10651] CMStateSet.hpp includes both memory.h and string.h.
2002-07-16 Tinny Ng [Bug 10648] DOMDocumentImpl misaligned allocations on machines with a 64 bits 'long' type.
2002-07-15 Tinny Ng DOM Level 3 C++ Binding.
2002-07-15 Tinny Ng DOM L3: DOMText::getIsWhitespaceInElementContent, DOMDocument::set/getStrictErrorChecking.
2002-07-15 Robert Buck [Bug 10834] Update version header to handle two digit revision and patch levels.
2002-07-12 Khaled Noaman Grammar caching/preparsing.
2002-07-12 Khaled Noaman Add getRootGrammar and modify SEnumVal.
2002-07-12 James Berry Add some support for testing of Mac OS X builds with GCC3 compiler.
2002-07-12 James Berry [Bug 10649] XercesDefs.hpp and AutoSense.hpp assume CodeWarrior is MacOS.
2002-07-10 Tinny Ng Enable embedded path link option in HP.
2002-07-10 Robert Buck [Bug 9154] Requesting Xerces Version Macro.
2002-07-08 PeiYong Zhang [Bug 10525] runConfigure fails to recognize '-d' flag.
2002-07-05 Max Gotlib [Bug 10250]: Implementation of new platform methods in FreeBSD.
2002-07-05 Tinny Ng [Bug 9788] VecAttrListImpl::getValue skips prefix if SAX namespace validation is on.
2002-07-05 Robert Buck [Bug 10065] xml4com bugs found when porting to Visual Studio .NET project files.
2002-07-05 Tinny Ng [Bug 10105] Exception in parse() despite setErrorHandler().
2002-07-05 Tinny Ng [Bug 10119] Grammar::getGrammarType need a const modifier.
2002-07-05 Max Gotlib [Bug 10252] Modify FreeBSD build environment for the samples.
2002-07-04 PeiYong Zhang [Bug 10482] XMLUri crashes with empty fragment.
2002-07-04 Max Gotlib [Bug 10253] Bugfix for the IconvFBSD transcoder.
2002-07-04 Tinny Ng [Bug 10336] Error in Error Message (set 3, #56, English).
2002-07-04 Tinny Ng DOM L3: Add DOMDocument::renameNode.
2002-06-27 Tinny Ng DOM L3: Add DOMNode::isSameNode and DOMNode::isEqualNode.
2002-06-25 Tinny Ng Add "adoptDocument" to XercesDOMParser so that document can optionally live outside the parser.
2002-06-25 Tinny Ng [Bug 7675] IDOM memory management problem.
2002-06-25 Tinny Ng DOM C++ Binding: add function release().
2002-06-24 James Berry Support CodeWarrior 8. (Important Note: Since Codewarrior 8 at long last supports HFS+ long file names, these projects now directly reference the src/xercesc files instead of the previously shortened file names in the MacSrc directory. With CodeWarrior 8 and these projects it is no longer necessary to run the perl script ShortenNames.pl to generate that MacSrc directory.)
2002-06-24 Robert Buck [Bug 10067] SEnumVal bugs found when porting to Visual Studio .NET.
2002-06-24 Robert Buck [Bug 10180] New Visual Studio .NET Project Files.
2002-06-18 Khaled Noaman DOM L3: Add Wrapper4DOMInputSource and Wrapper4InputSource.
2002-06-18 Khaled Noaman DOM L3: Modify DOMCount to modify DOMBuilder.
2002-06-18 Peter A. Volchek Bug#9950: Compilation error on MSVC5.
2002-06-17 Tinny Ng Add feature "http://apache.org/xml/features/validation-error-as-fatal", and users should use setFeature instead of setValidationConstraintFatal in SAX2XMLReader.
2002-06-17 Tinny Ng Add feature "http://apache.org/xml/features/continue-after-fatal-error", and users should use setFeature instead of setExitOnFirstFatalError in SAX2XMLReader.
2002-06-17 Tinny Ng Name Xerces features as XMLUni::fgXercesXXXX instead of XMLUni::fgSAX2XercesXXXX so that they can be shared with DOM parser.
2002-06-14 PeiYong Zhang Build 64bit production on Itaniums platform (Windows and Linux) using Intel Compiler.
2002-06-12 Tinny Ng DOM L3: Add DOMUserDataHandler, DOMNode::set/getUserData.
2002-06-12 Tinny Ng Fix: Thread-safety in DOMString. The reference or update to DOMString::gLiveStringHandleCount should be synchronized (locked).
2002-06-07 Tinny Ng DOM L3: Add Entity::get/setActualEncoding, get/setEncoding, get/setVersion.
2002-06-07 Tinny Ng DOM L3: Add Document::get/setActualEncoding, get/setEncoding, get/setVersion, get/setStandalone, get/setDocumentURI.
2002-06-03 Tinny Ng DOM L3: Add DOMImplementationRegistry and DOMImplementationSource.
2002-05-30 Tinny Ng Add feature http://apache.org/xml/features/nonvalidating/load-external-dtd to optionally ignore external DTD.
2002-05-29 Khaled Noaman DOM L3: Add DOMInputSource, DOMEntityResolver, DOMImplementationLS and DOMBuilder.
2002-05-29 Gereon Steffens [Bug 9489] Malformed HTTP GET Requests in UnixHTTPUrlInputStream.
2002-05-28 PeiYong Zhang DOM L3: Modify DOMPrint to use DOMWriter.
2002-05-28 PeiYong Zhang DOM L3: Add DOMWriter, DOMWriterFilter, LocalFileFormatTarget, StdOutFormatTarget, and MemBufFormatTarget.
2002-05-28 Tinny Ng [Bug 9104] prefixes dissapearing when schema validation turned on.
2002-05-27 Tinny Ng Add DOMDocumentRange and DOMDocumentTraversal.
2002-05-27 Khaled Noaman Performance: Lazily store top-level components to eliminate unnecessary traversal of DOM tree when looking up for a top level component.
2002-05-27 Khaled Noaman Performance: Use pre-built element-attribute map table.
2002-05-27 Tinny Ng To get ready for 64 bit large file, use XMLSSize_t to represent line and column number.
2002-05-27 Tinny Ng Define XMLSize, XMLSSize_t and their associate MAX.
2002-05-24 Khaled Noaman Performance: Eliminate mulitple calls to addRange and sort in regx.
2002-05-23 Khaled Noaman Performance: Use XMLBufferMgr instead of local creation of XMLBuffer(s).
2002-05-22 Khaled Noaman DOM L3: Add AbstractDOMParser, DOMError, DOMErrorHandler, and DOMLocator.
2002-05-21 Tinny Ng DOM Reorganization (rename IDOM and deprecate old DOM) and other documentation update.
2002-05-19 James Berry [Bug 9237] Encoding spec in lower case (DTD/XML) not recognized.
2002-05-10 Tinny Ng [Bug 8967] Default element behaviour is incorrect (schema only).
2002-05-08 Martin Kalen [Bug 7701] NameIdPoolEnumerator copy constructor should call base class.
2002-05-08 PeiYong Zhang [Bug 8899] Missing implementation of Op::Op(const Op&) causes Intel C++ Win32 link to fail.
2002-05-08 Khaled Noaman [Bug 8301] INFINITY used as enum member.
2002-05-08 David Bertoni [Bug 8381] XMLScanner performance fixes.
2002-05-08 PeiYong Zhang [Bug 8898] SchemaElementDecl doesn't compile with Intel C++ for IA32.
2002-05-07 Tinny Ng Schema Fix: re-add the ID, IDREF ... datatype validators only if they were not there.
2002-05-07 Khaled Noaman Update SAX2 documentation to tell users it is necessary to delete the parser returned by XMLReaderFactory::createXMLReader.
2002-05-07 David Bertoni [Bug 8852] UnixHTTPURLInputStream.cpp includes unneeded file.
2002-05-06 David Bertoni [Bug 8492] Incorrect HP link options.
2002-05-03 Martin Kalen [Bug 7341] Missing newline at end of util and DOM source files.
2002-05-03 Martin Kalen [Bug 7261] Remove obsolete define in UnixWareDefs.hpp.
2002-05-03 PeiYong Zhang [Bug 8769] UMR (uninitialized memory read) detected by memory tool.
2002-05-01 Tinny Ng [Bug 7265] UnixWare port broken in platformTerm().
2002-04-24 Jason Stewart [Bug 8495] URLInputSource constructor initializes fURL member incorrectly.
2002-04-22 PeiYong Zhang Build AIX 64 bit binary.
2002-04-19 Khaled Noaman [Bug 8236] Problem with recursive and derived elements.
2002-04-18 PeiYong Zhang [Bug 7301] Redundant range-check in HexBin.cpp.
2002-04-17 Tinny Ng [Bug 7583] Build warnings with MS Visual Studio .NET.
2002-04-17 Tinny Ng [Bug 7493] The word "occured" is misspelled and it is a global error.
2002-04-17 PeiYong Zhang [Bug 8195] Invalid path to build 'samples' target.
2002-04-16 PeiYong Zhang [Bug 8156] Bad path name breaks build.
2002-04-16 PeiYong Zhang [Bug 8168] Error when attempting to build NetAccessors.
2002-04-09 Khaled Noaman [Bug 7706] XMLString::lowerCase() does not work.
2002-04-09 PeiYong Zhang [Bug 6095] Modify .so name to have version number.
2002-04-08 Tinny Ng ICU 2.0.2 Update.
2002-04-04 Khaled Noaman Change min/maxOccurs from unsigned int to int.
2002-04-03 Khaled Noaman [Bug 7565] Attributes in different namespaces produce a Fatal Exception.
2002-04-03 Tinny Ng check null string first in isWSCollapsed and fix [Bug 6902] Typo in XMLString.cpp.
2002-04-02 Martin Kalen [Bug 7555] Enable AIX build with newer xlC versions.
2002-04-02 Khaled Noaman Modiy QName comparison (operator==).
2002-04-01 Tinny Ng According to DOM spec, setNodeValue by default is no-op.
2002-04-01 Tinny Ng Do not issue DOM_DOMException::INUSE_ATTRIBUTE_ERR if the owner is the same.
2002-04-01 Tinny Ng DOMString problem with Asian codepages.
2002-04-01 PeiYong Zhang [Bug 7551] Exceptions are caught by value, rather than by reference.
2002-04-01 Tinny Ng [Bug 7585] xml4com.dsp - Cannot open source file.
2002-04-01 Khaled Noaman [Bug 7297] Validation of schema included in document fails with improper error.
2002-04-01 Khaled Noaman Move Element Consistency checking (ref to global declarations) to SchemaValidator.
2002-03-27 Tinny Ng [Bug 1173] DOMParser entity resolution property is messed about.
2002-03-27 Tinny Ng Fix: not all the children of EntityReference Node is set to readOnly.
2002-03-27 Tinny Ng Should call setReadOnly instead of isReadOnly to populate the flag.
2002-03-27 Tinny Ng [Bug 3010] DocumentImpl::importNode - Missed Readonly Flag Restore.
2002-03-27 Tinny Ng Correct count element routine in IDOMCount.
2002-03-26 Khaled Noaman [Bug 7471] Failed to validate correctly when schema has <xsd:extension> and the base has an attribute.
2002-03-25 Khaled Noaman Move particle derivation checking from TraverseSchema to SchemaValidator.
2002-03-22 Khaled Noaman [Bug 7358] About TraverseSchema::traverseSimpleTypeDecl member function.
2002-03-21 Khaled Noaman Add support for reporting line/column numbers of schema errors.
2002-03-19 PeiYong Zhang [Bug 7164] DOMParser with a DTD leak!
2002-03-19 Khaled Noaman Fix for declarations referenced from a different NS in the case of a circular import.
2002-03-19 PeiYong Zhang [Bug 7243] Base64 encoding is not working.
2002-03-19 Khaled Noaman [Bug 7074] Unwarranted error regarding "no circular definitions allowed".
2002-03-18 Khaled Noaman [Regx Fix] Change constant names to eliminate possible conflict with user defined ones.
2002-03-18 Tinny Ng [Bug 7162] IconvFreeBSDTransService.cpp needs an #include statement fixed to use xercesc.
2002-03-15 Tinny Ng [Bug 6888] NodeIterator. Retrofit this typo that was applied to Xerces-J, although this function "matchNodeOrParent" is not used in Xerces-C++.
2002-03-15 Tinny Ng DOMString Thread safe Fix: should lock the entire deleter function where freeListPtr and blockListPtr are modified.
2002-03-15 Tinny Ng Issue DOMException::INDEX_SIZE_ERR if count is greater than length, equal to length is ok.
2002-03-14 Tinny Ng IDOM Fix: Issue IDOM_DOMException::INDEX_SIZE_ERR if count or offset is negative.
2002-03-14 Tinny Ng IDOM Fix: Initialize fPublic/fSystemId to zero in IDNotationImpl.
2002-03-14 Tinny Ng Certain IDOM Node should call fParent.normalize().
2002-03-14 Tinny Ng Run methods test[NodeType] in the IDOMTest and other fixes.
2002-03-12 Mark Russell [Bug 1687] resValue not always updated when making a transcoder.
2002/03/11 PeiYong Zhang [Bug 7000] The URL is corrupted in UnixHTTPURLInputStream.cpp.

Below is the list of fixed bugzilla bugs that are resolved in this release, &XercesCName; 1.7.0.

Date Contributor Description
2002-03-07 Tinny Ng Add a keys file to store public key of committers who sign and upload packages to Apache.
2002-03-07 PeiYong Zhang Call Terminate() to avoid memory tools reporting memory leak in Traversal test cases.
2002-03-06 PeiYong Zhang Schema: Allow [+]? [0]* '.'? [0]* and normalize the input to positive zero string. And similarly input conforming to '-' [0]* '.'? [0]* is normalized to negative zero.
2002-03-04 Tinny Ng [Bug 2869] AIX 4.3.3 mutex/atomic-operation changes for build.
2002-03-04 Khaled Noaman [Bug 6834] apparently correct schema/instance not validating.
2002-03-01 Tinny Ng NodeIDMap informational message about growing only be printed if debug is on. Besides the throw message should be encap in the XMLErrList_EN_US.Xml, not hardcoded in the code.
2002-02-28 PeiYong Zhang [Bug 2717] Unterminated INCLUDE section causes infinite loop with setExitOnFirstFatalError(false)
2002-02-28 Tinny Ng Fix: ReaderMgr Should check if XMLReader is created successfully.
2002-02-28 Tinny Ng [Bug 1368] improper DOMStringHandle locking.
2002-02-28 Martin Kalen [Bug 6445] Caldera (SCO) OpenServer Port.
2002-02-27 Tinny Ng Fix: default attribute are not added when namespace is on and validation is off.
2002-02-27 Tinny Ng Fix: SAX AttributeList::getName should attach prefix if present
2002-02-26 Tinny Ng [Bug 6672] SAXValidator results in an access violation when validating against schema with empty element that has default value.
2002-02-26 Khaled Noaman Fix: Create ZeroOrOne node for PCDATA only if needed.
2002-02-25 Tinny Ng Schema Fix: Thread-safe the built-in datatype validator registry.
2002-02-25 Tinny Ng Schema Fix: Ensure no invalid uri index for UPA checking.
2002-02-25 Tinny Ng Merge IThreadTest and ThreadTest. Modify ThreadTest to do schema processing, and add ThreadTest to sanityTest.pl
2002-02-20 Don Mastrovito Project files for BCB6.
2002-02-20 Tinny Ng [Bug 2845] HP-UX 10.20 with CC A.10.40 needs +Z instead of +z.
2002-02-20 Tinny Ng [Bug 5977] Warnings on generating apiDocs.
2002-02-18 PeiYong Zhang Fix: Add code for ContentSpecNode::All in formatNode.
2002-02-18 James Berry Add support for building with new MacOSURLAccessCF NetAccessor that doesn't require Carbon but can allow Xerces to live solely within CoreServices layer.
2002-02-17 James Berry [Bug 6092] stricmp and strnicmp not present in FreeBSD.
2002-02-17 James Berry Update Mac OS projects to reflect "sane includes" changes.
2002-02-15 Tinny Ng Add IDOM to API documentation.
2002-02-15 PeiYong Zhang Base64 interface redefined for conversion in XMLByte.
2002-02-14 PeiYong Zhang Add getEnumString to DatatypeValidator.
2002-02-14 Khaled Noaman [Bug 6461] Unexpected recursion errors reported against schema.
2002-02-13 Khaled Noaman Add constraint checking for the extension of an 'all' content model.
2002-02-13 Khaled Noaman [Bug 4581] erroneous static cast in programming examples.
2002-02-13 Khaled Noaman [Bug 6336] Output of XMLString::transcode not freed?
2002-02-13 Khaled Noaman Update samples to use SAX2 features/properties constants from XMLUni.
2002-02-11 PeiYong Zhang [Bug 6330] Base64::encode does not work.
2002-02-11 Tinny Ng [Bug 2715] Build recursion suppresses make failures.
2002-02-11 Tinny Ng [Bug 2496] libxerces-c1_5_0 fails to build correctly on Solaris.
2002-02-06 Khaled Noaman Added a new flag '-p' to SAX2 samples to set the 'namespace-prefixes' feature.
2002-02-06 Khaled Noaman Use IDOM for schema processing.
2002-02-05 Tinny Ng Remove 3rd party jar style-apachexmljar, expand into physical files.
2002-02-05 Tinny Ng Add IDOMMemTest.
2002-02-05 Tinny Ng Modify InitTermTest to take option flag like -s, -f , and -n.
2002-02-05 Tinny Ng [Bug 5716] Can't parse with Validation more than one file.
2002-02-05 Tinny Ng Recognize IBM01140 (IANA encoding) as alias of intrinsic encoding IBM1140.
2002-02-04 Tinny Ng [Bug 6114] Memory leaks on IDOM getElementsByTagName().
2002-02-04 Tinny Ng Add DOM Level2 missing functions: NodeIterator::getRoot, TreeWalker::getRoot Element::hasAttribute, Element::hasAttributeNS and Node::hasAttribute
2002-02-04 Tinny Ng Memory leak fix in samples / test cases.
2002-02-01 PeiYong Zhang src and include folder reorganization for "sane_include".
2002-01-28 Khaled Noaman Fix: some SAX calls were not passed to the LexicalHandler.
2002-01-29 Tinny Ng Remove those jar files that are not clear in license issue.
2002-01-28 Khaled Noaman Add a 'null' string constant in XMLUni.
2002-01-28 Khaled Noaman Add SAX2-ext's DeclHandler support.
2002-01-28 Khaled Noaman The namespace-prefixes feature in SAX2 should be off by default.
2002-01-24 Tinny Ng [Bug 3111] Problem with LexicalHandler::startDTD() and LexicalHandler::endDTD().
2002-01-23 Tinny Ng Progressive parse does not do post-validation and thus ID/IDREF are not checked.
2002-01-23 Tinny Ng [Bug 5545] Progressive Parse trashes when encountering "<! ... "
2002-01-23 Tinny Ng Update DOM/IDOM hasFeature method to correctly reflect current status. And add more hasFeature test to DOMMemTest.
2002-01-21 Tinny Ng Some intrinsic encodings support (e.g. UTF-16) only work as input encoding while reading in XML data; but do not work as output encoding in XMLformatter.
2002-01-21 Tinny Ng Document encoding alias for intrinsic encoding support.
2002-01-21 Tinny Ng [Bug 5847] ICUMsgLoader can't be compiled with gcc 3.0.3 and ICU2. And also fix the memory leak introduced by Bug 2730 fix.
2002-01-18 Max Gotlib Adds the capability to compile the tests under FreeBSD and either ICU or IconvFBSD transservice (the transcoding service is automatically detected during configuration stage), with or without pthreads.
2002-01-18 Tinny Ng [Bug 5371] runConfigure extra linker options ignored in Makefiles for tests and samples.
2002-01-18 Tinny Ng Break program.xml which takes too long to load, into program-sax.xml, program-sax2.xml program-dom.xml, program-idom.xml.
2002-01-18 Tinny Ng Break faq-parse.xml which becomes longer and longer into faq-parse.xml and faq-build.xml to better categorize the FAQ, and update the FAQ
2002-01-18 Tinny Ng Create symbolic link to those duplicate ICU libraries, instead of physical duplicate copies.
2002-01-15 Khaled Noaman [Bug 5807] Parser produces unexpected errors from 'Good' document.
2002-01-14 PeiYong Zhang XMLURi bug fix: related to Authority and wellformedAddress
2002-01-14 Max Gotlib [Bug 5570] DOM_Range lacks the copy constructor.
2002-01-14 Max Gotlib Support IconvFBSD in multi-threading environment with all the possible combinations of threading and transcoding options.
2002-01-10 Khaled Noaman [Bug 5786] Unexpected Schema errors.
2002-01-03 Khaled Noaman Fix for identity constraints - union operation.
2002-01-03 Khaled Noaman Resolve namespace first before resolving the schema location in <import>.
2002-01-03 Khaled Noaman [Bug 5675] Use of setExternalSchemaLocation() yields inconsistent behavior.
2002-01-02 Khaled Noaman Fix for validity constraint check for standalone documents.
2002-01-02 Khaled Noaman Fix for regular expression patterns that begin with ".".
2002-01-02 Khaled Noaman Fix for error message when checking for attributes with a namespace prefix.
2002-01-02 Khaled Noaman [Bug 5569] <extension> does not work -- ancestor elements not recognized.
2002-01-02 Tinny Ng Schema Fix: should not store a temp value as the key in the element pool and the attribute pool.
2001-12-22 Jason Stewart [Bug 4953] Propagate existing CFLAGS and CXXFLAGS.
2001-12-21 Jason Stewart [Bug 5514] XMLEnumerator needs virtual destructor.
2001-12-21 Tinny Ng [Bug 2680] Remove '-instances=static' from the compile step.
2001-12-21 Tinny Ng [Bug 1833] LexicalHandler::startDTD not called correctly.
2001-12-21 Frank Balluffi [Bug 5466] Memory Leak: ElementImpl.cpp's ElementImpl::ElementImpl copy constructor does not cleanup attributes before assignment.
2001-12-21 Frank Balluffi [Bug 5464] Memory Leak: DocumentImpl::importNode does not delete old attribute if its reference count equals zero.
2001-12-21 Tinny Ng Schema fix: leading whitespace should be preserved for CData type.
2001-12-14 Khaled Noaman Add surrogate support to comments and processing instructions.
2001-12-14 Tinny Ng Performance: Do not transcode twice in DOMString constructor.
2001-12-14 Tinny Ng update BUILDINSTRUCTIONS.TXT to be in sync with build instruction in build*.xml.
2001-12-13 PeiYong Zhang Fix: Invalid Argument to FreeLibrary (Hint: 0x0000000).
2001-12-13 Linda Swan iSeries (AS/400) documentation update and other iSeries related fixes.
2001-12-13 Khaled Noaman [Bug 5410] non-schema <attribute> attributes cause error.
2001-12-12 Tinny Ng Fix typos in messages.
2001-12-12 PeiYong Zhang Memory leak: fRedefineList.
2001-12-12 Tinny Ng [Bug 5367] Progressive parse does not throw error when file is empty.
2001-12-12 Tinny Ng Performance: Remove obsolete code in ElemStack.
2001-12-11 Max Gotlib More changes to IconvFBSDTransService. Allow using "old" TransServece implementation (via '-t native' option to runConfigure) or to employ libiconv (it is a part of FreeBSD ports-collection) services.
2001-12-11 Christopher Just [Bug 5320] 1.5.2 Build fails on IRIX. The variable "atomicOpsMutex" has been defined twice.
2001/12/10 PeiYong Zhang Swap checking to avoid "dangling pointer" reported by BoundsChecker.
2001-12-10 PeiYong Zhang Memory Leak: fLeafNameTypeVector.

Below is the list of fixed bugzilla bugs that are resolved in this release, &XercesCName; 1.6.0.

Date Contributor Description
2001-12-06 Khaled Noaman Schema: Add Identity Constraint(Key, KeyRef, Unique, Selector, Field, and Partial XPath Support).
Add XPathSymbols,
XPathMatcherStack,
XPathMatcher,
XPathException,
XercesXPath,
ValueStoreCache,
ValueStore,
IdentityConstraint,
IC_Unique,
IC_Selector,
IC_KeyRef,
IC_Key,
IC_Field,
FieldValueMap,
FieldActivator.
Support Particle Derivation Constraint Checking.
2001-12-06 PeiYong Zhang DatatypeValidator:
Support DateTimeValidator,
DateTimeDatatypeValidator,
DateDatatypeValidator,
TimeDatatypeValidator,
DayDatatypeValidator,
MonthDatatypeValidator,
MonthDayDatatypeValidator,
YearDatatypeValidator,
YearMonthDatatypeValidator,
DurationDatatypeValidator.
Add SchemaDataTimeException,
XMLAbstractDoubleFloat,
XMLDateTime.
2001-12-06 Tinny Ng [Bug 1959] setNodeValue throws exception when spec specifies NOP.
2001-12-06 Erik Rydgren [Bug 2174] Bug in NamedNodeMapImpl.
2001-12-06 Henry Zongaro Performance Enhancement. Added setNPrefix and setNLocalPart methods in QName that allow code to take advantage of the fact that it knows the length of the prefix and local name, when possible.
2001-12-06 Henry Zongaro Performance Enhancement. Added a second ContentSpecNode constructor that allows the QName to be just assigned, not copied.
2001-12-06 Henry Zongaro Performance Enhancement. Added a second CMLeaf constructor that indicated the QName passed in was to be adopted.
2001-12-06 Henry Zongaro Performance Enhancement. Modify the handling of the fNEL option so that it results in fgCharCharsTable being modified, instead of having all of the low-level routines check the option.
2001-12-06 Tinny Ng Make the runConfigure and associated config*, Makefile* in folders tests, samples and src more consistent.
2001-12-05 Khaled Noaman [Bug 1236] Incorrect NMTOKENS attribute normalization.
2001-12-05 Khaled Noaman [Bug 2752] Surrogate support incomplete.
2001-12-05 Edward Avis Fix runConfigure which can run into infinite loop with invalid argument
2001-12-05 Tinny Ng Generate linker map for certain platforms
2001-12-03 Tinny Ng [Bug 5237] PATH_MAX undefined during build without threading support.
2001-12-03 Tinny Ng [Bug 5179] Misprint in downcasting description.
2001-12-03 Max Gotlib Add FreeBSD native transcoder (IconvFBSD).
2001-11-30 PeiYong Zhang Build all tests on HP-UX 11.
2001-11-29 Michael Huedepohl Add FreeBSD Support.
2001-11-28 PeiYong Zhang DOMMemTest: delete compiler generated temporary DOMString object "Hello Goodbye".
2001-11-28 Tinny Ng Fix broken ParserTest.
2001-11-28 Tinny Ng Do not increment the error count if it is a warning.
2001-11-28 Phil Brown [Bug 4019] XMLReader::getNextChar can over read (UTF-16).
2001-11-28 Tinny Ng [Bug 4544] DOM_NodeList::getLength incorrect when called twice for empty list.
2001-11-28 Artur Klauser [Bug 2238]libWWW problems with broken proxys and range requests.
2001-11-28 Artur Klauser [Bug 2237] libWWW redirect error.
2001-11-28 Matt Lovett [Bug 4422] BinMemInputStream::readBytes is inefficient.
2001-11-28 Tinny Ng [Bug 3683] Access Violations when performing custom schema validation.
2001-11-28 Tinny Ng Check tohash pointer before accessing content in XMLString::hash.
2001-11-27 Tinny Ng Fix packageBinaries.pl to correctly strip the zip file name from the target directory which has "." dot in it.
2001-11-26 Don Mastrovito BCB4 can use wchar_t.
2001-11-23 Tinny Ng Support ICU 2.0.
2001-11-23 Tinny Ng Eliminate Warning from Solaris Forte C++: Warning (Anachronism): Formal argument start_routine of type extern "C".
2001-11-23 Tinny Ng Eliminate Warning from Solaris Forte C++: Warning: String literal converted to char* in initialization.
2001-11-23 Tinny Ng Eliminate Warning from AIX xlC 3.6:1540-399.
2001-11-23 Tinny Ng [Bug 4655] config.status be included in all future binary releases.
2001-11-23 Tinny Ng [Bug 4873] ICU 2.0 breaks Xerces 1.5.2 build.
2001-11-22 PeiYong Zhang Eliminate Visual C++ compiler warning C4273.
2001-11-22 PeiYong Zhang Schema: Allow "0.0" to be a valid lexcial representation of ZERO.
2001-11-21 Peter A. Volchek and PeiYong Zhang Add sample SEnumVal.
2001-11-21 Tinny Ng New method InputSource::get/setIssueFatalErrorIfNotFound to tell the parser whether to issue fatal error or not if cannot find it (the InputSource). This is required for schema processing as it shouldn't be a fatal error if the schema is not found.
2001-11-20 Tinny Ng Allow schemaLocation and noNamespaceSchemaLocation to be specified outside the instance document. New methods setExternalSchemaLocation and setExternalNoNamespaceSchemaLocation are added (for SAX2, two new properties are added).
2001-11-19 PeiYong Zhang XMLFloat and XMLDouble boundary Values updated.
2001-11-16 Tinny Ng Add test case InitTermTest to test XMLPlatformUtils:Initialize/Terminate() pair.
2001-11-16 Khaled Noaman Design change: GeneralAttributeCheck is not longer a singleton class.
2001-11-15 Khaled Noaman Re-organize constant values in XMLAttDef.
2001-11-13 Tinny Ng Move root element check from XMLValidator to XMLScanner and deprecate XMLValidator::checkRootElement().
2001-11-13 Tinny Ng Update documentation for SAX2XMLReader, DefaultHandler and DOMParser.
2001-11-09 Tinny Ng Regular Expression: Update the Block Names and Block Range to comply to the latest standard.
2001-11-09 Carolyn Weiss DOMIDTest/MemParse fix: Pulled the hardcoded encoding out of the document itself and made it a #define to make it easier to support other encodings.
2001-11-09 Carolyn Weiss DOMMemTest fix: Changed some literal values to their equivalent hex values so they work correctly on both ASCII and EBCDIC systems.
2001-11-09 Linda Swan Bug Fix: maxChars in XMLString::copyNString is more related to the target than the src.
2001-11-07 Tinny Ng Performance: Create QName in ContentSpecNode only if it is a leaf/Any/PCDataNode.
2001-11-07 Tinny Ng Performance: move getRawName() to outer loop in DFAContentModel so that it is called only once per outer loop.
2001-11-06 Khaled Noaman [Bug 4644] Memory leak in schema traverser.
2001-11-02 Jason Stewart [Bug 4133] --prefix not used properly in configure.
2001-11-01 Jason Stewart [Bug 2730] Can't build xerces-c-1.5.1 with ICUMsgLoader.
2001-11-01 Jason Stewart [Bug 4578] No documentation for XMLTranscoder.
2001-11-01 Tinny Ng IDOM: Leak: should allocate the fNodeListPool with the overloaded new.
2001/10/29 Tinny Ng Update samples doc to reflect the latest changes. Also update runConfigure usage in build doc to reflect the latest changes.
2001-10-26 PeiYong Zhang Thread safe XMLFloat and XMLDouble.
2001-10-26 Tinny Ng Update SAX standard web link.

Below is the list of fixed bugzilla bugs that are resolved in this release, &XercesCName; 1.5.2.

Date Contributor Description
2001-10-26 Khaled Noaman Schema:
Support group,
attributeGroup,
all,
any,
anyAttribute,
annotation,
notation,
redefine,
circular import.
Add AnySimpleTypeDatatypeValidator.
Add XercesGroupInfo.
More complex type constraint checking.
2001-10-26 PeiYong Zhang DatatypeValidator:
Support DoubleDatatypeValidator,
FloatDatatypeValidator,
AnyURIDatatypeValidator,
AbstractStringValidator,
AbstractNumericValidator,
AbstractNumericFacetValidator,
NCNameDatatypeValidator,
NameDatatypeValidator.
Add XMLDouble,
XMLFloat,
XMLInteger,
XMLNumber,
XMLUri.
2001-10-26 Tinny Ng Schema:
Support xsi:type,
Unique Particle Attribution Constraint Checking,
anyAttribute in Scanner and Validator.
Add XercesElementWildCard,
AllContentModel,
XMLInternalErrorHandler.
2001-10-25 PeiYong Zhang XMLDeleterFor related functions and data are removed. Replace with XMLRegisterCleanup.
2001-10-25 Henry Zongaro [Bug 2924] runConfigure script to accept multiple linker options.
2001-10-25 John Warrier [Bug 2924] runConfigure script to accept multiple compiler options.
2001-10-25 Mark Weaver [Bug 4213] BinHTTPURLInputStream initialization not thread safe.
2001-10-25 John Clayton [Bug 4121] BinHTTPUrlInputStream needs to read entire HTTP header.
2001-10-25 Tinny Ng [Bug 4318] Single threaded build fails due to obsolete #define.
2001-10-25 Tinny Ng [Bug 2860] gAtomicMutex should be used when APP_NO_THREADS is not defined in both Tru64 and OS400.
2001-10-25 Tinny Ng Comment outside root element should also be reported.
2001-10-24 PeiYong Zhang [Bug 4342] Validator mutex is not deleted.
2001-10-24 PeiYong Zhang [Bug 3975] XMLPlatformUtils::Initialize() leaks memory after thousands of calls.
2001-10-24 Kevin Philips [Bug 3813] BinHTTPURLInputStream has weak HTTP request capabilities.
2001-10-24 Peter A. Volchek [Bug 2305] Include stdlib.h to BinHTTPURLInputStream.cpp.
2001-10-24 Sean Bright [Bug 2456] loadXML gives an exception.
2001-10-24 Curt Arnold Fixed xml4com.idl which attempts to set the version of the type library to 1.5.2 when only major.minor format is allowed.
2001-10-23 Mark Weaver [Bug 4060] XMLPlatformUtils leaks a mutex on Solaris, Linux and others.
2001-10-23 Mark Weaver [Bug 880] XMLPlatformUtils::Terminate cannot be called more than once.
2001-10-22 Tinny Ng [Bug 3660] Off-by-one error in DOMString.cpp.
2001-10-22 Tinny Ng Check that memory has been acquired successfully after memory acquisition requests in DOMString.
2001-10-22 Tinny Ng [Bug 3361] "String pool id was not legal" error in Attributes::getURI().
2001-10-22 Linda Swan castToNodeImpl is inconsistent with other cast routines in IDCasts.
2001-10-19 James Berry Add new file name shortening hints; chmod +x.
2001-10-19 James Berry Cleanup handling of transcoder failure to transcode a character; implement canTranscodeTo; thanks to Geoff Coffey.
2001-10-19 James Berry Correctly swap / and : in classic environment MacOS pathnames; thanks to Geoff Coffey.
2001-10-19 James Berry Update MacOS projects for CodeWarrior 7 and ProjectBuilder 1.1, new files.
2001-10-19 Tinny Ng [Bug 3909] return non-zero an exit code when error was encountered.
2001-10-19 Tinny Ng Modify PParse not to hardcode the number of expected elements as this may vary.
2001-10-19 David McCreedy Fixed the binary search in XML256TableTranscoder.cpp which fails for the last item in whichever table it is searching.
2001-10-19 David McCreedy Added U+0110 to XMLEBCDICTranscoder.cpp's "Unicode to IBM037" translation table.
2001-10-19 David McCreedy Modified DOMPrint and IDOMPrint not to use "endl" method which puts out a newline in the local code page to generate output.
2001-10-18 Jerry Carter [Bug 3666] Win32MsgLoader unable to retrieve error text if DLL is renamed.
2001-10-18 Tinny Ng Use opt2 on AIX platform.
2001-10-18 Tinny Ng [Bug 1699] Redirect "delete this" to a temp ptr to bypass AIX xlC v5 optimization memory leak problem.
2001-10-18 Tinny Ng [Bug 4015] IDDOMImplementation::createDocumentType hopelessly broken.
2001-10-16 Khaled Noaman [Bug 3750] GeneralAttributeCheck threading bug.
2001-10-15 Khaled Noaman [Bug 4177] setupRange uses non-portable code.
2001-10-13 Jason Stewart [Bug 2409] undocumented XMLException in LocalFileInputSource::new().
2001-10-13 Jason Stewart [Bug 4133] --prefix not used properly in configure.
2001-10-10 Jason Stewart XMLURL::parse now throws an exception if it sees a an http URL without two forward slashes ('//') following the protocol.
2001-10-10 Petr Gotthard Add "Base64::encode" for encoding binary data.
2001-10-09 Tinny Ng [Bug 1685] memory leak after parsing document with validation error.
And other miscellaneous memory leak.
2001-10-05 PeiYong Zhang [Bug 3831] -1 returned from getIndex() needs to be checked.
2001-10-03 Tinny Ng [Bug 3867] IDOM_Element::getElementsByTagName() threading problem.
2001-10-02 Tinny Ng Memory leak in IDOM, need to delete the fDocument created.
2001-09-13 Artur Klauser Patch: Xerces 1.5 w/ libWWW for Tru64.
2001-09-13 Artur Klauser Patch: Xerces 1.5 samples with g++ compiler.
2001-09-12 PeiYong Zhang [Bug 3565] Stream leaked in ReaderMgr.
2001-09-12 Tinny Ng [Bug 3155] SAX2 does not offer progressive parse.
2001-09-11 Tinny Ng [Bug 3523] SchemaElementDecl.cpp(242) : error C2202 : not all control paths return a value.
2001-09-10 Tinny Ng Performance: Store the fGrammarType instead of calling getGrammarType all the time for faster performance.
2001-09-04 Christopher Just Support IRIX's sproc().
2001-09-04 Kevin Philips [Bug 3170] URLs with ? type fragments in them don't work.
2001-08-29 Henry Zongaro Allowing -p as argument to -z or -l in runConfigure.
2001-08-29 Tinny Ng Performance: Use XMLBufBid instead of XMLBuffer directly for better performance.
2001-08-29 Tinny Ng Performance: No need to new the child QName in ElemStack addChild. Remove it for performance gain.
2001-08-22 Don Mastrovito Project files for BCB5.
2001-08-21 PeiYong Zhang [Bug 2816]Numerous datatype headers cause CC error 1144.
2001-08-21 PeiYong Zhang [Bug 3017] MSVC5.0: C2202: 'compareSpecial' : not all control paths return a value.
2001-08-17 Nick Chiang Fix to memory leak in buildDFA().
2001-08-16 PeiYong Zhang Performance: stateTable created to optimize the identification of new state created.
2001-08-10 PeiYong Zhang Add isHex(), isAlphaNum(), isAllWhiteSpace() and patternMatch() in XMLString.
2001-08-09 Tinny Ng [Bug 2947]IDOM segfault calling getElementsByTagName() using a DOM_Document().
2001-08-09 Tinny Ng Port test case DOMTest to IDOMTest.
2001-08-07 Tinny Ng [Bug 2676] IDOM: pure virtual called in IDDeepNodeListImpl::item().
2001-08-07 Kari Whitcomb IDOM: Unaligned Access warnings in IDOM samples.
2001-08-02 Tinny Ng [Bug 1329] SAX2XMLReaderImpl leaks XMLBuffers.
2001-08-02 Tinny Ng Allow DOMCount/SAXCount/IDOMCount/SAX2Count to take a file that has a list of xml file as input.
2001-07-31 PeiYong Zhang Fix: memory leak in DFAContentModel::postTreeBuildInit().
2001/07/27 Tinny Ng Fix bug in 'transcode' functions reported by Evgeniy Gabrilovich.
2001-07-27 Tinny Ng put getScanner() back as they were there before, not to break existing apps.
2001-07-26 Tinny Ng [Bug 2751] Several NameChar characters missing from internal tables.
2001-07-26 Khaled Noaman [Bug 2815] util/regx/RegxParser.cpp compile fails on HP-UX 10.20 with CC A.10.40.
2001-07-24 PeiYong Zhang [Bug 2707] DFAContentModel memory leaks.
2001-07-19 Tinny Ng Add IDOMCount, IDOMPrint, SAX2Count, and SAX2Print to samples.dsw.
2001-07-19 Tinny Ng Add more tests in sanityTest.pl.

Below is the list of fixed bugzilla bugs that are resolved in this release, &XercesCName; 1.5.1.

Date Contributor Description
2001-07-17 Khaled Noaman [Bug 2643] - derivation by extension of complex types does not permit addition of ONLY element content.
2001-07-16 Tinny Ng [Bug 2410] DOMParser::parse() throws undocumented exceptions.
2001-07-16 Tinny Ng [Bug 2512] typing mistake in code example of chapter "Constructing an XML Reader".
2001-07-16 Tinny Ng APIDocs fix: default for schema processing in DOMParser, IDOMParser, and SAXParser should be false.
2001-07-15 James Berry Add new files to UnionTypeValidator and ListDataTypeValidator to MacOS Project files.
2001-07-09 Khaled Noaman Add constraint checking for simple types.
2001-07-11 PeiYong Zhang Fix to normalizeWhiteSpace: synchronize fDatatypeBuffer with toFill.
2001-07-05 PeiYong Zhang Add ListDatatypeValidator and UnionDatatypeValidator.
2001-07-10 Tinny Ng Give proper error message when scanning external id.
2001-07-10 Tinny Ng The first char of PI Target Name should be checked.
2001-07-09 Khaled Noaman Add <any> declaration.
2001-07-09 Khaled Noaman Fixes for import/include declarations.
2001-07-09 Tinny Ng Partial Markup in Parameter Entity is validity constraint and thus should be just error, not fatal error.
2001-07-08 James Berry Add new samples projects: IDOMPPrint and SAX2Print for ProjectBuilder
2001-07-08 James Berry Update ProjectBuilder Xerces project for latest file additions.
2001-07-08 James Berry [Bug 2486] Files missing from XercesLib.mcp.
2001-07-08 James Berry Add new samples for CodeWarrior build: IDOMPrint and SAX2Print.
2001-07-08 James Berry New file for use in building Carbon samples.
2001-07-08 James Berry Simplify file existence checks.
2001-07-08 James Berry [Bug 2495] Missing ( in xerces-c-src1_5_0/obj/Makefile.in.
2001-07-08 James Berry Fix clean and distclean targets; broken because rm fails if passed no files.
2001-07-06 Tinny Ng [Bug 2472] Linker options ignored on IRIX.
2001-07-06 Martin Kalen Automatic build of single-threaded library.
2001-07-05 Tinny Ng Encoding String must present for external entity text decl.
2001-07-05 Tinny Ng Standalone checking is validity constraint and thus should be just error, not fatal error.
2001-07-05 PeiYong Zhang Add NotationDatatypeValidator, QNameDatatypeValidator and ENTITYDatatypeValidator.
2001-07-04 PeiYong Zhang Add IDREFDatatypeValidator and IDDatatypeValidator.
2001-07-04 PeiYong Zhang XMLString:isValidName(): to validate Name (XML [4][5]).
2001-07-03 Tinny Ng Some compilers (e.g. the HP compiler) has mistaken the parameter 'std', which is short for standalone as the special prefix used by the standard libraries.
2001-07-03 Miroslaw Dobrzanski-Neumann Supporting dce threading on AIX and Solaris.
2001-06-27 David Bertoni [Bug 2365] Huge performance problem with the parser in XMLScanner::sendCharData().
2001-06-27 David Bertoni [Bug 2363] XMLScanner::sendCharData() can send the wrong length to the handler.
2001-06-27 Khaled Noaman [Bug 2353] Validating Parser parses after validation failed.
2001-06-27 Murray Cumming [Bug 1147] Headers install in wrong directory.
2001-06-26 Tinny Ng [Bug 2119] DOMString::print() should use DOMString::transcode() for transcoding.
2001-06-25 Stephen Dulin OS390 updates.
2001-06-25 Linda Swan AS400 updates.
2001-06-25 PeiYong Zhang [Bug 1393] Converting from Unicode to iso8859.
2001-06-25 Matt Lovett [Bug 965] scanDocTypeDecl messes up the source offsets.
2001-06-25 Khaled Noaman Add constraint checking on elements in complex types.
2001-06-22 James Berry [Bug 2277] Bad argument to ConvertFromUnicodeToText.
2001-06-22 PeiYong Zhang [Bug 2263] 'SIZE' : redefinition ( BooleanDatatypeValidator.cpp ).
2001-06-22 Khaled Noaman [Bug 2258] Bug in Iconv and Iconv390.
2001-06-22 Tinny Ng [Bug 2225] assignment vs. comparison in if clause.
2001-06-22 Tinny Ng [Bug 2257] 1.5 thinks a <?xml-stylesheet ...> tag is a <?xml ...> tag.
2001-06-21 Khaled Noaman [Bug 1946] Standalone validity check only for external decl.
2001-06-21 Tinny Ng [Bug 2262] Duplicated header guard.
2001-06-20 PeiYong Zhang Proper Debug Guard: Reported by Dean.
2001-06-19 Tinny Ng Namespace should be off by default in XMLScanner.
2001/06/19 Tinny Ng Add installAdvDocHandler to SAX2XMLReader as the code is there already.
2001-06-19 Khaled Noaman Handle maxChars > length(toTranscode).
2001-06-18 Erik Rydgren Memory leak fix: to addlevel().
2001-06-18 Khaled Noaman and PeiYong Zhang Add support for 'fixed' facet.
2001-06-15 Khaled Noaman Added constraint checking for ref on elements.
2001-06-15 Tinny Ng ICU 1.8.1 update.

Below is the list of fixed bugzilla bugs that are resolved in this release &XercesCName; 1.5.0.

Date Contributor Description
2001-06-15 Tinny Ng Schema:
Add Schema support in XMLParsers (DOM/SAX/SAX2), XMLScanner.
Create SchemaValidator.
Add Grammar Model.
Support xsi:nil.
Support xsi:schemaLocation and xsi:noNamespaceSchemaLocation.
Update samples to enable schema.
2001-06-15 Tinny Ng Break DTDValidator into DTDGrammar, DTDScanner, and DTDValidator.
2001-06-15 Tinny Ng IDOM:
Complete the Range, TreeWalker, NodeIterator, and other memory fixes.
Support IDOM on UNIX platform.
Add samples IDOMPrint, and IDOMCount.
Add test cases IRangeTest and ITraversal.
2001-06-15 Khaled Noaman Schema:
Add Regular Expression.
Add Schema Messages.
Add Schema Simple Type Support.
Add Schema Complex Type Support (Except Group).
Add Schema Attribute Declarations support.
Add Schema Element Declarations support.
Support Simple Content and Complex Content.
Support Element and attribute reuse using "ref".
Support Schema Choice and Sequence.
Support Schema Import and Include.
2001-06-15 Khaled Noaman DatatypeValidator:
Add DatatypeValidator and DatatypeValidatorFactory.
2001-06-15 PeiYong Zhang Schema:
Add Schema support in Content Model.
Add Schema Exception Handling.
Add Schema XUtil.
Add QName Support.
Support SubstitutionGroup.
2001-06-15 PeiYong Zhang DatatypeValidator:
Support Base64DatatypeValidator,
BooleanDatatypeValidator,
DecimalDatatypeValidator,
HexBinDatatypeValidator,
StringDatatypeValidator,
InvalidDatatypeFacetException,
InvalidDatatypeValueException.
2001-06-13 Erik Rydgren [Bug 812] Memory leak with multiple !ATTLIST on single !ELEMENT.
2001-06-08 Tinny Ng [Bug 2043] XMLFormatter unallocates arrays incorrectly.
2001-06-08 PeiYong Zhang Documentation and project files update for Xerces 1.5.
2001-06-08 Khaled Noaman IDOM Documentation.
2001-06-07 Khaled Noaman Fix no error message for faulted-in attributes if reuse grammar for 3+ times.
2001-06-06 Peter A. Volchek /Platforms/Win32/Win32PlatformUtils.cpp
Include stdlib.h.
2001-06-06 James Berry Update Mac OS ProjectBuilder projects.
2001-06-06 James Berry Fix invalid file references in project.
2001-06-06 James Berry /src/util XMLString.cpp
Clean up compiler warning.
2001-06-06 James Berry /src/util/regx RegxParser.cpp
Fix two improper NULL tests.
2001-06-05 James Berry Add support for Mac OS X command line configuration and build.
2001-06-5 Peter A. Volchek Add 'const' to getGrammar.
2001-06-04 PeiYong Zhang The start tag "<?xml" could be followed by (#x20 | #x9 | #xD | #xA)+.
2001-06-04 James Berry Add support for tracking error count during parse; enables simple parse without requiring error handler.
2001-06-01 Tinny Ng /scripts/packageSources.pl
Keep the BCB4 project files in the source package.
2001-05-22 James Berry Check for existence of MacOS Unicode Converter routines prior to instantiating our transcoder object; Xerces will thus panic, rather than crash, if they don't exist. Add support to check for existence of MacOS Unicode Converter to avoid calling through NULL pointer.
2001-05-16 Henry Zongaro IDOM: Add DeepNodeList support.
2001-05-16 Henry Zongaro IDOM: Add namespace support.
2001-05-10 Christian Schuhegger [Bug 1158] built-in buffer limit could be smaller than system limit, use PATH_MAX instead.
2001-05-10 Arnaud LeHors [Bug 1605] AttrNSImpl.cpp: fixed typo in constructor.
2001-05-09 Curt Arnold [Bug 1500] The public id was set twice and the system id was not set on Notations.
2001-05-04 Tinny Ng DOMPrint: Check error before continuing.
2001-05-03 Tinny Ng ICU 1.8 update.
2001-05-03 Khaled Noaman Added new option to the parsers so that the NEL (0x85) char can be treated as a newline character.
2001-04-23 Erik Rydgren DTDScanner: Reuse grammar should allow users to use any stored element decl as root.
2001-04-19 William L Hopper Win32PlatformUtils: InterlockedCompareExchange on different Windows.
2001-04-19 William L Hopper BCB project changes.
2001-04-16 James Berry MacOSUnicodeConverter: Fix include path, Updates to reflect changes for Mac OS X final and Update MacOS projects for Mac OS X final ProjectBuilder.
2001-04-11 Arnaud LeHors [Bug 1303] AttrImpl: allow value to be set to null.
2001-04-11 Tinny Ng DOMParser: Attribute default values not printed in document type internal subset interface.
2001-04-10 Tinny Ng createdocs.bat: fix PDF generation.
2001-04-04 Alberto Massari DTDElementDecl: Error checking for null content spec.
2001-04-02 Andy Heninger IDOM: imported.
2001-04-02 Andy Heninger IThreadTest: imported.
2001-03-30 Tinny Ng [Bug 1150] Problems with Namespaces and validating parsing.
2001-03-27 Roman Sulzhyk [Bug 1069] Explicit Makefile dependency for 'lib' build.
2001-03-26 PeiYong Zhang When Standalone="yes", it is NOT supposed to accept element which is defined in external DTD with #FIXED attribute.
2001-03-26 Andy Heninger Update packageBinaries.pl for ICU 1.8. ICU debug .lib file names and locations changed.
2001-03-23 Jeff Harrell [Bug 1018] AutoSense looks for "IRIX" when it should look for "sgi" or "__sgi".
2001-03-22 Roman Sulzhyk [Bug 1069] The Makefiles fail to locate .cpp -> .o dependency and rebuild .o all the time.
2001-03-22 John Rope [Bug 1021] Accessing an XML file using the file "protocol" and a UNC path fails to open the file.
2001-03-09 Tinny Ng [Bug 733] Seg fault when trying to parse empty filename.
2001-03-06 Tinny Ng [Bug 677] Infinite loop caused by malformed XML. Happen when namespace is on.
2001-03-02 Martin Kalen Enabling libWWW NetAccessor support under UNIX. Tested with latest tarball of libWWW (w3c-libwww-5.3.2) under RedHat Linux 6.1.
2001-02-27 Tinny Ng [Bug 676] Linux for S/390 build requires -fPIC.
2001-02-22 Tinny Ng [Bug 678] StdInParse doesn't output filename or duration.
2001-02-21 Matt Lovett ICUTranscoder::transcodeFrom() expects ICU function ucnv_toUnicode to return an extra element in fSrcOffsets to allow us to figure out the last char size, which in fact it is not. The fix is to compute the last char size ourselves using the total bytes used.
2001/02/16 Andy Heninger Change limit test to reduce spurious pointer assignment warnings from BoundsChecker.
2001-02-14 Bob Kline Better FAQ for the checksum error.
2001-02-14 Mark Everline Core dump when UTF-16 encoding contradicts actual encoding.
2001-02-13 Hiram Clawson Update samples/tests files for on UnixWare 7.1.1 with gcc 2.95. Add UNIXWARE platform defines to Makefile.incl, add recognition of sysv5uw7 to configure.in, and add unixware as recognized platform to runConfigure.
2001-02-09 Martin Kalen Update support for SCO UnixWare 7 (gcc). Tested under UnixWare 7.1.1 with gcc version 2.95.2 19991024 (release) with gmake 3.79.1.
2001-02-08 Martin Kalen Enable COMPAQ Tru64 UNIX machines to build xerces-c with gcc (tested using COMPAQ gcc version2.95.2 19991024 (release) and Tru64 V5.0 1094).
2001-02-07 Bill Schindler Rearranged statements in Initialize() so that platformInit() is called before an XMLMutex is created.
2001-02-07 Richard Ko Storage overlay in ucnv_setFromUCallBack.
2001-02-05 Tinny Ng [Bug 766] /src/util/Compilers/CSetDefs.hpp: define NO_NATIVE_BOOL macro only if not pre-defined/reserved.
2001-02-05 Jordan Naftolin Add createPDF.jar and apachPDFStyle.xsl to convert documentation xml files to pdf format.
Date Contributor Description
2001-01-26 Walker Curtis Undefined symbol error when building a single threaded version of the xerces lib on irix.
2001-01-25 Arnaud LeHors Added a flag to turn off error checking in the DOM, this is primarily used while building the DOM from the parser to get better performance.
2001-01-25 Khaled Noaman Let users add their encoding to the intrinsic mapping table.
2001-01-25 Khaled Noaman const should be used instead of static const. And other clean up bug fixes.
2001-01-24 Arnaud LeHors Fixed replaceChild to handle the case where a node is replaced by itself. Cleaned up insertBefore.
2001-01-24 Tinny Ng Guard the use of '-ptr${OUTDIR}' in EnumVal/Makefile.in
2001-01-22 Curt Arnold. Loads winsock dynamically.
2001-01-19 Curt Arnold. COM various updates: updated the GUID's so both can coexist, better error reporting and fixed a new minor bugs.
2001-01-18 Bill Schindler FAQ spell check, fix typos, fix grammar, readability editing, clean up formatting, re-organize so related topics appear together.
2001-01-18 Bill Schindler Project file updated due to removal of ChildAndParentNode.cpp.
2001-01-17 Arnaud LeHors DOM Implementation Optimization.
2001-01-17 Volker Krause ElementImpl::getAttributeNS should check null pointer.
2001-01-17 Arnaud LeHors Have a single counter global to the document. Removed node basis change counter.
2001-01-17 Arnaud LeHors Removed unused field in NodeImpl that was left over.
2001-01-17 Tinny Ng Access violations and stack overflows in insertBefore.
2001-01-15 David Bertoni Performance Patches.
2001-01-12 Tinny Ng Fix style-ibm.zip for documentation generation.
2001-01-12 Tinny Ng Remove the two obsolete file: stylesheets\Copy of book2project.xsl and stylesheets\Copy of document2html.xsl in style-apachexml.jar
2001-01-12 Tinny Ng Documentation Enhancement: explain values of Val_Scheme.
2001-01-12 Tinny Ng Documentation Enhancement: Add list of SAX2 feature strings that are supported.
2001-01-04 Khaled Noaman Assertion `size > 0' failure when cloning a node if the last attributes has been removed.
2000-12-28 James Berry Omit include carbon.h in favor of specific include files.
2000-12-28 James Berry Add or modify cvs header in various files.
2000-12-28 James Berry Eliminate compiler warning in RangeImpl.cpp.
2000-12-28 James Berry Replace include of Carbon.h with specific include files.
2000-12-28 James Berry Move away from include of Carbon.h; include only needed files instead. Fix bug in parsing of upwardly relative paths under classic (thanks to Lawrence You).
2000-12-22 Tinny Ng XMLUni::fgEmptyString which is defined as "EMPTY" is incorrectly used as an empty string; in fact XMLUni::fgZeroLenString should be used instead.
2000-12-22 Tinny Ng Add the new header LexicalHandler.hpp to Makefile.in.
2000-12-22 Murray Cumming removes '-instances=static' from the Linux link sections.
2000-12-22 David Bertoni SAX2-ext's LexicalHandler support.
2000-12-14 Tinny Ng Better instruction for using packageBinaries.pl. Use symbol XercesCInstallDir and XercesCSrcInstallDir instead of hardcoding the Xerces version number in the file.
2000-12-14 Tinny Ng Fix API document generation warning: "Warning: end of member group without matching begin".
2000-12-14 Tinny Ng Add RangeTest as part of the xerces-all MSVC++ workspace.
2000-12-12 Gareth Reakes null pointer bug.
2000-12-08 Tinny Ng Entity Reference cleanup dumping core if the last entity reference is deleted.
2000-12-06 Tinny Ng fix the link to FAQ.
2000-12-06 Tinny Ng further fixes to Range, and update RangeTest.cpp with more test coverage.
2000-11-30 Bill Schindler Spell check, fix typos, fix grammar, readability editing, clean up formatting.
2000-11-30 Bill Schindler Remove dead code (old StdOut and StdErr functions); minor clean-up.
2000-11-30 Tinny Ng patch to fix a number of Range problems. See mail of 11/21/2000.
2000-11-30 Tinny Ng DOM_Text::splitText(), fix off by one error in the test for index too big error.
2000-11-30 Tinny Ng reuseValidator - fix bugs (spurious errors) that occurred on reuse due to pools already containing some items.
2000-11-08 Andrei Smirnov Build updates for Solaris 2.8 64 bit.
2000/11/07 Tinny Ng Bug fix for DTD entity reference problem reported by Tony Wuebben on 10/25.
2000-11-07 Tinny Ng config.guess and config.sub updated to newer versions.
2000-11-07 Pieter Van-Dyck Change InterlockedCompareExchange for compatibility with Borland BCB5
2000-11-07 Pieter Van-Dyck Fix incorrect version number in gXercesMinVersion.
2000-11-01 Tinny Ng SAX bug fix: Attribute lists were throwing exceptions rather than returning null when an attribute could not be found by name.
2000-11-01 Tinny Ng Scanner bug fix: with progressive parsing, namespace and validation options were not being set correctly. Symptoms included failure to detect ignorable white space.
2000-10-31 Tinny Ng DOM NodeIterator bug fix: iterators would sometimes continue beyond their starting (root) node.
2000-10-20 Andy Heninger DOMParser bug fix - erroneous attempt to look up name space URIs while scanning default attribute values in DTD removed. Was a crashing bug when namespaces were enabled.
2000-10-20 Andy Heninger DOM NodeFilter - define values for FilterAction enum to match those in the DOM spec.
2000-10-19 Andy Heninger SAXCount sample, allow multiple files on command line. DOMCount sample, rename error handler class to say that it is an error handler.
2000-10-18 James Berry MacOS project file updates. Small code optimization. Add comments to clarify and to reflect new fixed XMLCh size.
2000-10-17 Andy Heninger Bug Fix - problems with multi-byte characters on input buffer boundaries.
2000-10-17 Andy Heninger DOMPRintFormatTarget, bad override of writeChars fixed (missing const). XMLFormatTarget, removed version of writeChars with no length. Can not be safely used, and obscured other errors.
2000-10-16 Andy Heninger Change XMLCh back to unsigned short on all platforms
2000-10-13 Devin Barnhart COM: interpret BSTR as UTF-16 in documents
2000-10-13 Edward Bortner Solaris: change detection for native support for type bool to defined(_BOOL).
2000-10-13 Nadav Aharoni MXLString::trim() bug fix: failure to null terminate result.
2000-10-10 Bill Schindler XMLFormatter: Fix problems with output to multi-byte encodings.
2000-10-10 Andy Heninger From Janitor, remove the addition that is having compile problems in MSVC.
2000-10-10 James Berry Fix a bug in returned length of transcoded string. Add a few comments.
2000-10-09 James Berry ProjectBuilder project to build Xerces.
2000-10-09 James Berry Numerous Changes: - Increase environmental sensitivity with hope of supporting pre OS 9 OS versions. - Enhanced path creation/interpretation to support proper unix style paths under Mac OS X instead of the volume rooted paths we previously used. Paths under Classic remain the same. - Better timer resolution. - Detect functionality via unresolved symbols rather than Gestalt where possible. - Softly back away from URLAccess...if it's not installed, we just don't support a net accessor. - Additional support for XMLCh/UniChar size differences under GCC on Mac OS X. - Fix Mac OS X support. GCC in this environment sets wchar_t to a 32 bit value which requires an additional transcoding stage (bleh...) - Improve sensitivity to environment in order to support a broader range of system versions. - Fix a few compiler sensitivities. - Carbon.h header support
2000-10-09 James Berry Add some auto_ptr functionality to allow modification of monitored pointer value. This eases use of Janitor in some situations.
2000-10-09 James Berry Autosense.hpp: modify sensing of Mac OS X.
2000-09-28 Andy Heninger DOM_Document::putIdentifier() removed. There never was an implementation for this function.
2000-09-28 Curt Arnold COM wrappers updated.
2000-09-28 Linda Swan AS400 related changes.
2000-09-28 Andy Heninger DOM_Document - remove the un-implemented function putIdentifier() from the header.
2000-09-28 Andy Heninger DOMParser MemoryLeak fixed. Occurred when a document redefined the a builtin entity, e.g. <.
2000-09-28 Andy Heninger DOMPrint sample: add deletes before exit so boundschecker runs cleanly.
2000-09-22 James Berry Change file access permissions to fsRdPerm. Since we never write, there's no reason to request write access. Thanks to John Mostrom @ Adobe. Also nuke a few spaces and the entire defunct support for reading directly from MacOS resources.
2000-09-22 Arundhari Bhowmick DOM Parser: internal subset entity printing update.
Date Contributor Description
2000-09-21 Torbjörn Bäckström HPUX - Incorrect use of Array Janitor in Platform Utils removed.
2000-09-21 Arundhati Bhowmick DOMPrint - DTD internal subset, printing of attribute value enumerations was broken.
2000/09/19 Arundhati Bhowmick DOMPrint - output entity reference nodes as XML entity references, instead of just printing their children.
2000-09-19 Bill Schindler OS/2 - port update
2000-09-18 Arundhati Bhowmick DOM EntityReferences, fixed bugs with length() and hasChildNodes() methods.
2000-09-12 Arundhati Bhowmick DOM: changed name of expandEntityReferences option to createEntityReferenceNodes. More accurately describes what it does. Fixed bugs that caused creation of Entity Reference nodes to fail.
2000-09-12 IBM AS400 - transcoder updates.
2000-09-11 Shengkai Qu OS390 - makefile updates
2000-09-11 Kirk Wylie Alpha processor support update in config.sub.
2000-09-08 Kirk Wylie Reordered member variables in ThrowEOEJanitor.
2000-09-08 Arnaud LeHors DOM NamedNodeMap - because in many cases we may have to deal with both nodes with a namespace and nodes without any, NS methods through findNamePoint must handle both types of nodes.
2000-09-08 Kirk Wylie Some destructors not virtual that should have been; some members of DOM_Entity virtual that should not have been.
2000-09-08 Andy Heninger Removed incorrect detection of nested CDATA sections. Problem reported by Johannes Lipp.
2000-09-08 Andy Heninger DOMPrint incorrectly handled DOCTYPE declarations containing both a public and system id. Problem reported by Jesse Pelton.
2000-09-08 Radovan Chytracek MSVC: RangeTest project settings incorrect, build failed.
2000-09-07 Bob Kline XMLReader::skippedString(), failed under certain rare circumstances.
2000-09-07 Andy Heninger Fix SAXException assignment operator. Now non-virtual, and SAXParseException subclass invokes base class operator.
2000-09-06 William L. Hopper Borland updates. It had fallen way behind.
2000-09-06 Andy Heninger HPUX 11, packageBinaries build script, DCEThreads no longer default
2000-09-06 James Berry Macintosh: Add support for new compile time options defined in prefix file. These control the selection of the msgloader, transcoder, and netaccessor. Add a tiny bit of robustness to the nasty panic method..
2000-09-06 Shengkai Qu S390: socket related changes
2000-09-06 James Berry Macintosh: Allow ShortenFiles to work even when destination directory already exists.
2000-09-06 Arundhati Bhowmick HP compile options modified for ICU compatibility
2000-09-05 Michael Crawford Macintosh: Fix atomic increment & decrement to return value after operation rather than before.
2000-09-05 Andy Heninger Cleaned up various compiler warnings.
2000-09-05 Andy Heninger SAX parser: added advanced callback support for XMLDecl
2000-09-01 Andy Heninger Fix ICU transcoding service, crashing bug on Linux, Solaris
2000-08-30 Andy Heninger Builds - clean up a number of compiler warnings.
2000-08-24 Andy Heninger DOMPrint - fixed crash when input xml file was not found.
2000-08-23 Andy Heninger Build Script updates and cleanups
2000-08-18 Andy Heninger Version number bumped to 1.3 in preparation for the upcoming xerces 1.3 / xml4c 3.3 release
2000-08-17 Arnaud Lehors DOM: Rewrote code updating the linked list on node addition and removal. I believe it is now easier to read and it uses fewer tests so it is also a little faster.
2000-08-17 Arnaud Lehors DOM: small cleanup: renamed a set of [] boolean flag methods. yes, I know, I also wish I got them right in the first place...
2000-08-17 Sumit Chawla PTX port updates
2000-08-16 Andy Heninger Fixed crash when XML text content has very long lines. Bug pointed out by Simon Fell.
2000-08-14 Joe Polastre SAX2 DefaultHandler, inconsistency in const parameters fixed.
2000-08-11 Arundhati Bhowmick ICU Transcoding - updates to support ICU 1.6
2000-08-09 Arundhati Bhowmick DOM Range: Add const to API where appropriate.
2000-08-09 Joe Polastre Many conformance and stability changes:
- ContentHandler::resetDocument() removed
- attrs param of ContentHandler::startDocument() made const
- SAXExceptions thrown now have msgs
- removed duplicate function signatures that had 'const'
[ eg: getContentHander() ]
- changed getFeature and getProperty to apply to const objs
- setProperty now takes a void* instead of const void*
- SAX2XMLReaderImpl does not inherit from SAXParser anymore
- Reuse Validator (http://apache.org/xml/features/reuse-validator) implemented
- Features & Properties now read-only during parse
2000-08-09 Joe Polastre Namespaces bug - bogus default namespace removed.
2000-08-09 Joe Polastre SAXException enhanced, messages added.
2000-08-08 Joe Polastre SAX2Count - new sample program for SAX2.
2000-08-07 Arundhati Bhowmick Remove detach() method from TreeWalker.
2000-08-03 James Berry Add Mac Codewarrior projects.
2000-08-01 Joe Polastre SAX2 support added
2000-08-01 Gary Gale Compaq Tru64 port added.
2000-07-31 Joe Polastre bug fix in removeAll() to zero out all the pointers.
2000-07-31 Andy Heninger utf-8 byte order mark recognition
2000-07-29 James Berry Mac OS Port, general cleanups.
2000-07-28 James Berry Addition of NetAccessor functionality for MacOS, built on URLAccess library.
2000-07-28 Arundhati Bhowmick ICU Transcoding service: changes for move to ICU 1.6
2000-07-27 Arundhati Bhowmick DOM Range added. (Major new feature)
2000-07-27 Murray Cumming makefile fixes for SUNW_0.7
2000-07-25 Arundhati Bhowmick XMLCh character constants definitions moved to XMLUniDefs.h. Removes name clashes with application defined symbols.
2000-07-25 Joe Polastre allow nesting of PlatformUtils::Init() and Terminate()
2000-07-25 Gary Gale ICU transcoding: fix off by one error.
2000-07-21 <check> Change wcsupr to _wcsupr
2000-07-21 Eric Schroeder Win32TransService - fix error in use of hashtables
2000-07-21 Joe Polastre DOMPrint: fixed error in handling of null CDATA sections.
2000-07-20 Andy Heninger Improved net access (parse of URLs). Still weak, though.
2000-07-20 Erik Schroeder XMLScaner.cpp bugfix: call startDocument() at beginning of scan.
2000-07-20 Arundhati Bhowmick DOMCount exception handling cleaned up.
2000-07-19 Todd Collins runConfigure: modified to take "configureoptions"
2000-07-19 <check> Add 'make install' target to src/util/Platforms/Makefile.in
2000-07-19 <check> DOM: BugFix: DocumentType nodes can not have children.
2000-07-19 <check> DOM: Bug in NodeIDMap constructor.
2000-07-18 Anupam Bagchi Documentation generation tools updated.
2000-07-17 James Berry Mac OS port brought up to date (was very old)
2000-07-17 Andy Heninger Change windows project to link with ws2_32.lib instead of winsock32.lib
2000-07-17 Grace Yan, Joe Kesselman DOM NodeIterator: bug fix for SHOW_ELEMENT flag incorrectly being retrieved.
2000-07-17 Joe Polastre switched scanMisc() with endDoc() in scanNext. Pointed out by Dean Roddey.
2000-07-17 Jim Reitz fix for uninitialized variable gotData bug in XMLScanner.cpp.
2000-07-12 Arundhati Bhowmick DOM: fix bug in setting previous sibling pointer during insertNode
2000-07-07 Joe Polastre Update to use of hashtables.
2000-07-07 Joe Polastre DOM userdata: several bug fixes.
2000-07-06 Andy Heninger Speedups in XMLScanner, XMLReader
2000-07-07 <check> bug fixes in IXMLDOM*
2000-07-06 Joe Polastre Performance tweaks, added more inlines.
2000-07-05 Anupam Bagchi Documentation updates.
2000-07-05 Joe Polastre DOM: Attribute node default value handling implemented.
2000-07-05 Joe Polastre DOM Attr nodes - fixed setting of specified when cloning. (change may be in error)
2000-07-04 Dean Roddey Fixed a memory leak when namespaces are enabled.
2000-06-28 Curt Arnold COM object usage documentation update.
2000-06-28 Joe Polastre DOM Userdata - put pointers in a hash table rather than having one pre-allocated per node. Memory footprint reduction.
2000-06-27 Joe Polastre extended the (implementation) hash table classes.
2000-06-26 John Roper@iOra.com Bug fix: check if initialized in Terminate() to stop access violations.
2000-06-26 <check> Solaris build - template directory related changes.
Date Contributor Description
2000/06/22 <check> OS/2 Port updated.
2000-06-22 Joe Polastre DOM Attr nodes, specified flag not set correctly by parser. Fixed.
2000-06-20 Rahul, Joe, Arundhati Many doc updates in preparation for release of 1.2
2000-06-19 Rahul Jain Update Package Binaries script to build Xerces with ICU.
2000-06-19 Joe Polastre Added help messages to PParse and StdInParse samples.
2000-06-19 Joe Polastre Changed "XML4C" to "Xerces-C" in DOMPrint. (Missed in earlier mass name change.)
2000-06-19 Arundhati Bhowmick Moved version.incl up one directory level.
2000-06-19 Curt Arnold Improved Windows project file.
2000-06-16 John Smirl Bug Fix: Document Handler was not called for PIs occurring before the document element. Bug identified by John Smirl and Rich Taylor
2000-06-16 Rahul Jain DOMPrint, SAXPrint: remove extra space in printing PIs.
2000-06-16 Rahul Jain Windows Debug Build: add 'D' suffix to DLL name in VCPPDefs.hpp
2000-06-16 Rahul Jain Samples: added -v option (validate always). Needed for testing scripts.
2000-06-14 Joe Polastre Fixed null ptr failures in DOM NamedNodeMap
2000-06-12 Andy Heninger Fixed bug in XMLString::trim(), reported by Michele Laghi
2000-06-07 Joe Polastre DOM: reduced memory usage for elements with no attributes.
2000-06-01 Andy Heninger DOMString - add const to return type of const XMLCh *DOMString::rawBuffer()
2000-06-01 Arundhati Bhowmick Fix crash with Solaris optimized build. Modified XMLURL.cpp to dodge compiler code generation error.
2000-06-01 Joe Polastre Bug fix: DOM Attr Specified flag was incorrectly set when cloning or importing attributes.
2000-05-31 Andy Heninger MSVC projects modified to produce separate debug and release versions of Xerces lib and dll.
2000-05-31 Rahul Jain Bug fix: DOMPrint, SAXPrint produced garbage output on Solaris. Solaris library problem.
2000-05-31 Joe Polastre Fixed incorrect error check for end of file in Win32 platform utils.
2000-05-31 Rahul Jain DOMPrint enhancements. Add options for specifying character encoding of the output, better control over escaping of characters, better handling of CDATA sections. Default validation is now "auto"
2000-05-22 Dean Roddey XMLFormatter now escapes characters, as reqd., occurring midway in strings. Reported by Hugo Duncan.
2000-05-22 Andy Heninger Bug fix in implementation of DOM_Document::GetElementById()
2000-05-18 Anupam Bagchi Documentation, DTD for source xml files moved into xerces-c project, sbk: prefixes removed, xml can now be validated locally.
2000-05-15 Dean Fixed 'fatal error' when 'reusing the validator' problem reported
by Rocky Raccoon (rrockey@bigfoot.com). Fix submitted by
Dean Roddey (droddey@charmedquark.com).
2000-05-15 James Berry Changed #include <memory.h> to <string.h> everywhere. <jberry@criticalpath.com>
2000-05-15 Andy H. DOMTest: removed incorrectly failing entity tests
2000-05-12 Andy H. Revised implementation of DOMDocument::getElementsById(), removed memory leaks, new test program for it.
2000-05-12 Dean Bug fix - A PE ref appearing at the start of a skipped conditional section
was incorrectly being processed rather than ignored. Fix from Dean Roddey.
2000-05-11 Rahul Jain Start using the socket based netaccessor by default on most Unix platforms.
2000-05-11 Rahul Jain Update ICUTransService to work with latest revision of ICU which provides a hard linked data DLL. i.e. icudata.dll will be loaded when xerces-c is loaded.
2000-05-05 Dean Problem with progressive parsing. parseNext() would through an exception when the document contains entities, either or external.
2000-05-11 Sean MacRoibeaird Add missing validity checks for stand-alone documents, character range
and Well-formed parsed entities.
2000-05-10 Radovan Chytracek Fix compilation problems on MSVC 5. <Radovan.Chytracek@cern.ch>
2000-05-10 Dean Fix XMLReader defect reported by SHOGO SAWAKI
2000-05-09 Andy H Fix problem with Windows filenames containing '\' in Japanese and Korean encodings.
2000-05-08 Andy H Memory Cleanup. XMLPlatformUtils::Terminate() deletes all lazily allocated memory
2000-05-05 Dean Fixed defect in progressive parsing 'parseNext()' reported by Tim Johnston
2000-05-03 Tom Jordahl Fixed Solaris build problems with static character constants. Tom Jordahl <tomj@allaire.com>
2000-04-28 Arnaud LeHors Reduced memory usage for DOM Attributes.
2000-04-28 boercher@kidata.de New runConfigure options -P and -C
2000-04-27 Andy H Memory leaks in TransService. Joseph Chen <JosephC@plumtree.com>
2000-04-27 Arnaud LeHors DOM - storage requirements for nodes substantially reduced.
2000-04-27 Arundhati Added DOM XMLDecl node type; provides access to XML declaration.
2000-04-20 Arundhati Added DOM access to DTD subset (DOM Level 2 feature)
2000-04-19 Anupam Bagchi API document generation changed to Doxygen from Doc++
2000-04-18 Arundhati Full support for DOM_EntityReference, DOM_Entity and DOM_DocumentType introduced
2000-04-18 Dean Roddey Don't allow spaces before PI target. Bug #42
2000-04-17 Anupam Bagchi Follow the SMP/E procedures for the OS/390 BATCH install
2000-04-12 Dean Roddey Auto-validate mode. Validate only when a DTD is present.
2000-04-11 Dean Roddey If a SAX error handler is installed, then the resetErrors() event handler
should call the one on the installed SAX error handler.
2000-04-10 Dean Roddey Allow an empty DOCTYPE declaration, with just the root name.
2000-04-06 Dean Roddey Add low level support for transcoding XML output to different character encodings.
2000-04-06 Arnaud Lehors DOM node memory footprint reduction.
2000-04-06 Dean Roddey Fixed hanging bug in character transcoding.
2000-04-05 Dean Roddey Enable installation of DTDHandler on SAX parser.
2000-04-04 Anupam Bagchi Support for PTX platform
2000-04-03   IRIX 6.5 port
2000-03-30   COM wrappers
2000-03-24 Jeff Lewis DOM_Document::GetElementsByTagId() added.
2000-03-23 Chih Hsiang Chou DOM: support for identifying "ignorable white space" text nodes.
2000-03-23 Rahul Jain URL Net Accessor added.
2000-03-20 Dean Roddey Fix null pointer exception with some bad documents.
2000-03-17 Dean Roddey Initial support for two-way transcoding.
2000-03-17 Dean Roddey Intrinsic transcoding table generation utility added.
2000-03-17 Anupam Bagchi UNIX build: Now generates object files in platform-specific directories
2000-03-13 Anupam Bagchi Fix GCC build problem: Changed XML_GNUG to XML_GCC
2000-03-13 Helmut Eiken Fixed #54. Changed self-assignment to now use the parameter value.
Reported by Helmut Eiken <H.Eiken@cli.de>
2000-03-10 Chih Hsiang Chou Fix bug # 19, add const keyword to API. As a result, update test case.
2000-03-10 Chih Hsiang Chou DOM: "specified" flag of attributes now set correctly.
2000-03-08 Dean Roddey Some fixes for content models that have multiple, trailing, empty
PE refs (for content model extension.)
2000-03-07 Dean Roddey First cut for additions to Win32 xcode. Based very loosely on a
prototype from Eric Ulevik.
2000-03-03 Dean Roddey Fixed a bug in SimpleContentModel that allowed an <a/> to be taken
as valid for a content model of (a,b).
2000-03-02 Dean Roddey Added a scanReset()/parseReset() method to the scanner and
parsers, to allow for reset after early exit from a progressive parse.
Added calls to new Terminate() call to all of the samples. Improved
documentation in SAX and DOM parsers.
2000-03-02 Dean Roddey Change "XML4C" to "Xerces" in many places
Add a cleanup method to XMLPlatformUtils.
Implement the Locator scheme for SAX.
Add a -n option to most of the samples, to enable namespaces
Fix an error where XMLScanner::parseNext() was falling through on an
exception instead of return a failure.
Implement the specialized string loading for Win98, since LoadStringW()
doesn't work on 98 and makes the loaded error text from the Win32
message loader come out junk
fix error when two trailing entity references in a content model, like so:
<!ELEMENT foo (a|b|c|d|e %one;%two;)*>
Date Contributor Description
2000/02/18 Dean Roddey XMLCh defaults to wchar_t on platforms where wchar_t uses Unicode.
2000-02-18 Dean Roddey Add Windows-1252 as a built in encoding
2000-02-17 Dean Roddey Fixed an infinite loop caused while trying to trim leading white space from the raw URL during parsing.
2000-02-17 Rahul Jain Add LibWWW based net accessor
2000-02-17 Chih Hsiang Chou DOM: NodeIterator, TreeWalker added.
2000-02-16 Dean Roddey Updates for EBCDIC code page issues.
2000-02-15 Chih Hsiang Chou DOM: several namespace bugfixes
2000-02-14 Dean Roddey Disallow EBCDIC documents without an encoding declaration
2000-02-10 Bill Schindler Fixed defect in compare[N]IString function. Defect and fix reported
by Bill Schindler from developer@bitranch.com
2000-02-10 Anupam Bagchi Sample source code cleaned up.
2000-02-08 Dean Roddey Fixed bug: xmlns:xxx="" should affect the mapping of the prefixes of sibling attributes
2000-02-07 Dean Roddey Don't weave base and relative paths unless relative part is really relative.
2000-02-03 Dietrich Wolf C++-Builder 4 support
2000-02-03 Robert Weir DOMString enhancements
2000-01-31 Dean Roddey Win32 mutex implementation was changed to use critical sections for speed.
2000-01-28 Dean Roddey The API is not in place to allow client code to make sense of start/end entity
ref calls from attribute values. So suppress them for now.
2000-01-28 Andy Heninger Fix multi-threading problem in DOM.
2000-01-27 Dean Roddey Fixed bug: If an entity ends on the last > of some markup, then the end of entity
won't be sent because the end of entity is not sensed.
2000-01-24 Dean Roddey Fixes a bogus error about ]]> in char data.
2000-01-24 Dean Roddey Exposed the APIs to get to the byte offset in the source XML buffer.
2000-01-21 Dean Roddey Added a check for a broken pipe error on file read.
2000-01-18 Dean Roddey Update to support new ICU 1.4 release
2000-01-18 Dean Roddey Remove dependence on old utils standard streams
2000-01-18 Rahul Jain Added CreateDOMDocument sample.
2000-01-13 Dean Roddey Added a NetAccessorException for use by implementations of the NetAccessor abstraction, if they need to report errors during processing
2000-01-12 Dean Roddey get the C++ and Java versions of error messages more into sync.
2000-01-11 Dean Roddey Moved the input source classes from / to framework/.
2000-01-11 Dean Roddey Changes to deal with multiply nested, relative paths, entities
  • Port to Solaris.
  • Improved error recovery and clarified error messages.
  • Added DOMTest program.
  • Released &XercesCName; after incorporating ICU as a value-added plug-in.
  • Has bug fixes, better conformance, better speed and cleaner internal architecture
  • Three additional samples added: PParse, StdInParse and EnumVal
  • Experimental DOM Level 2 support
  • Support for namespaces
  • Loadable message text enabling future translations to be easily plugged-in
  • Pluggable validators
  • Pluggable transcoders
  • Reorganized the util directory to better manage different platforms and compilers
  • Created initial code base derived from IBM's XML4C Version 2.0
  • Modified documentation to reflect new name (Xerces-C)
xerces-c-3.2.2/doc/psviwriter.xml000644 000765 000024 00000005270 13241160343 017551 0ustar00scantorstaff000000 000000

PSVIWriter shows how to access the Post Schema Validation Infoset (PSVI) and Schema Component Model information for the parsed document.

This program parses the specified XML file, then exposes the PSVI and Schema Component Model information.

Usage: PSVIWriter [options] <XML file | List file> This program invokes the SAX2XMLReaderImpl, and then exposes the underlying PSVI of each parsed XML file, using SAX2 API. Options: -f Enable full schema constraint checking processing. Defaults to off. -o=xxx Output PSVI to file xxx (default is stdout) -e=xxx Output errors to file xxx (default is stdout) -u=xxx Handle unrepresentable chars [fail | rep | ref*]. -x=XXX Use a particular encoding for output (UTF8*). -l Indicate the input file is a List File that has a list of xml files. Default to off (Input file is an XML file). -? Show this help. * = Default if not provided explicitly.

Here is some sample output from PSVWriter (as the output is verbose it has been truncated)

cd &XercesC3InstallDir;/samples/data PSVIWriter personal.xml <document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:psv="http://apache.org/xml/2001/PSVInfosetExtension" xmlns="http://www.w3.org/2001/05/XMLInfoset"> <characterEncodingScheme>UTF8</characterEncodingScheme> <standalone xsi:nil="true"/> <version>1.0</version> <children> <comment> <content> @version: </content> </comment> ...
xerces-c-3.2.2/doc/senumval.xml000644 000765 000024 00000010667 13241160343 017173 0ustar00scantorstaff000000 000000

SEnumVal shows how to enumerate the markup declarations in a Schema Grammar.

This program parses the specified XML file, then shows how to enumerate the contents of the Schema Grammar.

Usage: SEnumVal <XML file> This program parses a file, then shows how to enumerate the contents of the Schema Grammar. Essentially, shows how one can access the Schema information stored in internal data structures.

Here is a sample output from SEnumVal

cd &XercesC3InstallDir;/samples/data SEnumVal personal-schema.xml Name: personnel Model Type: Children Create Reason: Declared ContentType: OneOrMore Content Model: (person)+ ComplexType: TypeName: ,C0 ContentType: OneOrMore -------------------------------------------- Name: person Model Type: Children Create Reason: Declared ContentType: Sequence Content Model: (name,email*,url*,link?) ComplexType: TypeName: ,C1 ContentType: Sequence Attributes: Name: salary Type: CDATA Default Type: #IMPLIED Base Datatype: Decimal Facets: fractionDigits=0 Name: id Type: ID Default Type: #REQUIRED Base Datatype: ID Name: contr Type: CDATA Default Type: #DEFAULT Value: false Base Datatype: string Enumeration: true false Name: note Type: CDATA Default Type: #IMPLIED Base Datatype: string -------------------------------------------- Name: name Model Type: Children Create Reason: Declared ContentType: All Content Model: All(family,given) ComplexType: TypeName: ,C3 ContentType: All -------------------------------------------- Name: family Model Type: Simple Create Reason: Declared Base Datatype: string -------------------------------------------- Name: given Model Type: Simple Create Reason: Declared Base Datatype: string -------------------------------------------- Name: email Model Type: Simple Create Reason: Declared Base Datatype: string -------------------------------------------- Name: url Model Type: Empty Create Reason: Declared Content Model: EMPTY ComplexType: TypeName: ,C4 Attributes: Name: href Type: CDATA Default Type: #DEFAULT Value: http:// Base Datatype: string -------------------------------------------- Name: link Model Type: Empty Create Reason: Declared Content Model: EMPTY ComplexType: TypeName: ,C5 Attributes: Name: subordinates Type: IDREFS Default Type: #IMPLIED Base Datatype: List Name: manager Type: IDREF Default Type: #IMPLIED Base Datatype: IDREF --------------------------------------------
xerces-c-3.2.2/doc/Doxyfile.in000644 000765 000024 00000330107 13241416724 016733 0ustar00scantorstaff000000 000000 # Doxyfile 1.8.13 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. # # All text after a single hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv # built into libc) for the transcoding. See http://www.gnu.org/software/libiconv # for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the # project for which the documentation is generated. This name is used in the # title of most generated pages and in a few other places. # The default value is: My Project. PROJECT_NAME = Xerces-C++ # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. PROJECT_NUMBER = @VERSION@ # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. OUTPUT_DIRECTORY = @abs_top_builddir@/doc/html # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes # performance problems for the file system. # The default value is: NO. CREATE_SUBDIRS = NO # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode # U+3044. # The default value is: NO. ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, # Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), # Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, # Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, # Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, # Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, # Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. # The default value is: YES. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator that is # used to form the text in various listings. Each string in this list, if found # as the leading text of the brief description, will be stripped from the text # and the result, after processing the whole list, is used as the annotated # text. Otherwise, the brief description is used as-is. If left blank, the # following values are used ($name is automatically replaced with the name of # the entity):The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief # description. # The default value is: NO. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. # The default value is: NO. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. FULL_PATH_NAMES = No # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand # part of the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the path to # strip. # # Note that you can specify absolute paths here, but also relative paths, which # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. STRIP_FROM_PATH = @abs_top_srcdir@/src \ @abs_top_builddir@/src # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which # header file to include in order to use a class. If left blank only the name of # the header file containing the class definition is used. Otherwise one should # specify the list of include paths that are normally passed to the compiler # using the -I flag. STRIP_FROM_INC_PATH = @abs_top_srcdir@/src \ @abs_top_builddir@/src # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. # The default value is: NO. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # first line (until the first dot) of a Javadoc-style comment as the brief # description. If set to NO, the Javadoc-style will behave just like regular Qt- # style comments (thus requiring an explicit @brief command for a brief # description.) # The default value is: NO. JAVADOC_AUTOBRIEF = YES # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus # requiring an explicit \brief command for a brief description.) # The default value is: NO. QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a # multi-line C++ special comment block (i.e. a block of //! or /// comments) as # a brief description. This used to be the default behavior. The new default is # to treat a multi-line C++ comment block as a detailed description. Set this # tag to YES if you prefer the old behavior instead. # # Note that setting this tag to YES also means that rational rose comments are # not recognized any more. # The default value is: NO. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new # page for each member. If set to NO, the documentation of a member will be part # of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen # uses this value to replace tabs by spaces in code fragments. # Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that act as commands in # the documentation. An alias has the form: # name=value # For example adding # "sideeffect=@par Side Effects:\n" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all # members will be omitted, etc. # The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or # Python sources only. Doxygen will then generate output that is more tailored # for that language. For instance, namespaces will be presented as packages, # qualified scopes will look different, etc. # The default value is: NO. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources. Doxygen will then generate output that is tailored for Fortran. # The default value is: NO. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for VHDL. # The default value is: NO. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, Javascript, # C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: # FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: # Fortran. In the later case the parser tries to guess whether the code is fixed # or free formatted code, this is the default for Fortran type files), VHDL. For # instance to make doxygen treat .inc files as Fortran files (default is PHP), # and .f files as C (default is Fortran), use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable # documentation. See http://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. # The default value is: YES. MARKDOWN_SUPPORT = YES # When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up # to that level are automatically included in the table of contents, even if # they do not have an id attribute. # Note: This feature currently applies only to Markdown headings. # Minimum value: 0, maximum value: 99, default value: 0. # This tag requires that the tag MARKDOWN_SUPPORT is set to YES. TOC_INCLUDE_HEADINGS = 0 # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or # globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should set this # tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); # versus func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. # The default value is: NO. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. # The default value is: NO. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: # http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate # getter and setter methods for a property. Setting this option to YES will make # doxygen to replace the get and set methods by a property in the documentation. # This will only work if the methods are indeed getting or setting a simple # type. If this is not the case, or you want to show the methods anyway, you # should set this option to NO. # The default value is: YES. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO # If one adds a struct or class to a group and this option is enabled, then also # any nested class or struct is added to the same group. By default this option # is disabled and one has to add nested compounds explicitly via \ingroup. # The default value is: NO. GROUP_NESTED_COMPOUNDS = NO # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent # subgrouping. Alternatively, this can be done per class using the # \nosubgrouping command. # The default value is: YES. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions # are shown inside the group in which they are included (e.g. using \ingroup) # instead of on a separate page (for HTML and Man pages) or section (for LaTeX # and RTF). # # Note that this feature does not work in combination with # SEPARATE_MEMBER_PAGES. # The default value is: NO. INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions # with only public data fields or simple typedef fields will be shown inline in # the documentation of the scope in which they are defined (i.e. file, # namespace, or group documentation), provided this scope is documented. If set # to NO, structs, classes, and unions are shown on a separate page (for HTML and # Man pages) or section (for LaTeX and RTF). # The default value is: NO. INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or # enum is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically be # useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. # The default value is: NO. TYPEDEF_HIDES_STRUCT = NO # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can be # an expensive process and often the same symbol appears multiple times in the # code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small # doxygen will become slower. If the cache is too large, memory is wasted. The # cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range # is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 # symbols. At the end of a run doxygen will report the cache usage and suggest # the optimal cache size from a speed point of view. # Minimum value: 0, maximum value: 9, default value: 0. LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. # Note: This will also disable the warnings about undocumented members that are # normally produced when WARNINGS is set to YES. # The default value is: NO. EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are # included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base name of # the file that contains the anonymous namespace. By default anonymous namespace # are hidden. # The default value is: NO. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation # section is generated. This option has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set # to NO, these classes will be included in the various overviews. This option # has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # (class|struct|union) declarations. If set to NO, these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any # documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation that is typed after a # \internal command is included. If the tag is set to NO then the documentation # will be excluded. Set it to YES to include the internal documentation. # The default value is: NO. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file # names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. # The default value is: system dependent. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO # If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will # append additional text to a page's title, such as Class Reference. If set to # YES the compound reference will be hidden. # The default value is: NO. HIDE_COMPOUND_REFERENCE= NO # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. SHOW_INCLUDE_FILES = NO # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each # grouped member an include statement to the documentation, telling the reader # which file to include in order to use the member. # The default value is: NO. SHOW_GROUPED_MEMB_INC = NO # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the # documentation for inline members. # The default value is: YES. INLINE_INFO = NO # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and # destructors are listed first. If set to NO the constructors will appear in the # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief # member documentation. # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting # detailed member documentation. # The default value is: NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy # of group names into alphabetical order. If set to NO the group names will # appear in their defined order. # The default value is: NO. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by # fully-qualified names, including namespaces. If set to NO, the class list will # be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the alphabetical # list. # The default value is: NO. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between # the prototype and the implementation of a member function even if there is # only one candidate or it is obvious which candidate to choose by doing a # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still # accept a match between prototype and implementation in such cases. # The default value is: NO. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo # list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test # list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional documentation # sections, marked by \if ... \endif and \cond # ... \endcond blocks. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the # documentation. If the initializer consists of more lines than specified here # it will be hidden. Use a value of 0 to hide initializers completely. The # appearance of the value of individual variables and macros / defines can be # controlled using \showinitializer or \hideinitializer command in the # documentation regardless of this setting. # Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at # the bottom of the documentation of classes and structs. If set to YES, the # list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # will remove the Files entry from the Quick Index and from the Folder Tree View # (if specified). # The default value is: YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # page. This will remove the Namespaces entry from the Quick Index and from the # Folder Tree View (if specified). # The default value is: YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command command input-file, where command is the value of the # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml # will be used as the name of the layout file. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated to # standard output by doxygen. If QUIET is set to YES this implies that the # messages are off. # The default value is: NO. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. # The default value is: YES. WARNINGS = YES # If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some parameters # in a documented function, or documenting parameters that don't exist or using # markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong or incomplete # parameter documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = NO # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when # a warning is encountered. # The default value is: NO. WARN_AS_ERROR = NO # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard # error (stderr). WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = @abs_top_srcdir@/src/xercesc/dom \ @abs_top_srcdir@/src/xercesc/framework \ @abs_top_srcdir@/src/xercesc/framework/psvi \ @abs_top_srcdir@/src/xercesc/sax \ @abs_top_srcdir@/src/xercesc/parsers \ @abs_top_srcdir@/src/xercesc/util \ @abs_top_srcdir@/src/xercesc/sax2 # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv # documentation (see: http://www.gnu.org/software/libiconv) for the list of # possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, # *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, # *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. FILE_PATTERNS = *.hpp # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. # The default value is: NO. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* EXCLUDE_PATTERNS = *Impl.hpp \ DOM_*.hpp \ DOMParser.hpp \ ChildNode.hpp \ DOM.hpp \ DomMemDebug.hpp \ MemDebug.hpp \ DStringPool.hpp \ NodeIDMap.hpp \ NameNodeFilter.hpp \ NodeVector.hpp \ DOMString.hpp \ ParentNode.hpp \ DOMCasts.hpp \ DOMChildNode.hpp \ DOMDeepNodeListPool.hpp \ DOMNodeIDMap.hpp \ DOMNodeVector.hpp \ DOMParentNode.hpp \ DOMStringPool.hpp \ NameIdPool.hpp \ KVStringPair.hpp \ Janitor.hpp \ BitOps.hpp \ BitSet.hpp \ CountedPointer.hpp \ TransENameMap.hpp \ EncodingValidator.hpp \ FlagJanitor.hpp \ Hashers.hpp \ KeyValuePair.hpp \ KeyRefPair.hpp \ KVStringPair.hpp \ NameIdPool.hpp \ NodeIDMap.hpp \ NameNodeFilter.hpp \ NodeVector.hpp \ BaseRefVectorOf.hpp \ RefArrayVectorOf.hpp \ RefArrayOf.hpp \ RefHash*.hpp \ RefStackOf.hpp \ RefVectorOf.hpp \ ValueHashTableOf.hpp \ ValueArrayOf.hpp \ ValueStackOf.hpp \ ValueVectorOf.hpp \ XML256TableTranscoder.hpp \ XML88591Transcoder.hpp \ XMLASCIITranscoder.hpp \ XMLBufferMgr.hpp \ XMLBuffer.hpp \ XMLChTranscoder.hpp \ XMLEBCDICTranscoder.hpp \ XMLEnumerator.hpp \ XMLExceptMsgs.hpp \ XMLIBM1140Transcoder.hpp \ XMLMsgLoader.hpp \ Mutexes.hpp \ XMLPScanToken.hpp \ XMLRecognizer.hpp \ XMLRefInfo.hpp \ StringPool.hpp \ XMLUCS4Transcoder.hpp \ XMLUTF16Transcoder.hpp \ XMLUTF8Transcoder.hpp \ XMLWin1252Transcoder.hpp \ XercesVersion.hpp # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands # irrespective of the value of the RECURSIVE tag. # The default value is: NO. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or directories # that contain images that are to be included in the documentation (see the # \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command: # # # # where is the value of the INPUT_FILTER tag, and is the # name of an input file. Doxygen will then use the output that the filter # program writes to standard output. If FILTER_PATTERNS is specified, this tag # will be ignored. # # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: pattern=filter # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and # it is also possible to disable source filtering for a specific pattern using # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will be # generated. Documented entities will be cross-referenced with these sources. # # Note: To get rid of all source code in the generated output, make sure that # also VERBATIM_HEADERS is set to NO. # The default value is: NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. # The default value is: NO. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any # special comment blocks from generated source code fragments. Normal C, C++ and # Fortran comments will always remain visible. # The default value is: YES. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented # function all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES then for each documented function # all documented entities called/used by that function will be listed. # The default value is: NO. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. REFERENCES_LINK_SOURCE = YES # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the # source code will show a tooltip with additional information such as prototype, # brief description and links to the definition and documentation. Since this # will make the HTML file larger and loading of large files a bit slower, you # can opt to disable this feature. # The default value is: YES. # This tag requires that the tag SOURCE_BROWSER is set to YES. SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system # (see http://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global # - Enable SOURCE_BROWSER and USE_HTAGS in the config file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # # Doxygen will invoke htags (and that will in turn invoke gtags), so these # tools must be available from the command line (i.e. in the search path). # # The result: instead of the source browser generated by doxygen, the links to # source code will now point to the output of htags. # The default value is: NO. # This tag requires that the tag SOURCE_BROWSER is set to YES. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a # verbatim copy of the header file for each class for which an include is # specified. Set to NO to disable this. # See also: Section \class. # The default value is: YES. VERBATIM_HEADERS = YES # If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the # clang parser (see: http://clang.llvm.org/) for more accurate parsing at the # cost of reduced performance. This can be particularly helpful with template # rich C++ code for which doxygen's built-in parser lacks the necessary type # information. # Note: The availability of this option depends on whether or not doxygen was # generated with the -Duse-libclang=ON option for CMake. # The default value is: NO. CLANG_ASSISTED_PARSING = NO # If clang assisted parsing is enabled you can provide the compiler with command # line options that you would normally use when invoking the compiler. Note that # the include paths will already be set by doxygen for the files and directories # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all # compounds will be generated. Enable this if the project contains a lot of # classes, structs, unions or interfaces. # The default value is: YES. ALPHABETICAL_INDEX = YES # The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in # which the alphabetical index list will be split. # Minimum value: 1, maximum value: 20, default value: 5. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. COLS_IN_ALPHA_INDEX = 2 # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_OUTPUT = apiDocs-3 # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). # The default value is: .html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a user-defined HTML header file for # each generated HTML page. If the tag is left blank doxygen will generate a # standard header. # # To get valid HTML the header file that includes any scripts and style sheets # that doxygen needs, which is dependent on the configuration options used (e.g. # the setting GENERATE_TREEVIEW). It is highly recommended to start with a # default header using # doxygen -w html new_header.html new_footer.html new_stylesheet.css # YourConfigFile # and then modify the file new_header.html. See also section "Doxygen usage" # for information on how to generate the default header that doxygen normally # uses. # Note: The header is subject to change so you typically have to regenerate the # default header when upgrading to a newer version of doxygen. For a description # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard # footer. See HTML_HEADER for more information on how to generate a default # footer and what special commands can be used inside the footer. See also # section "Doxygen usage" for information on how to generate the default footer # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of # the HTML output. If left blank doxygen will generate a default style sheet. # See also section "Doxygen usage" for information on how to generate the style # sheet that doxygen normally uses. # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as # it is more robust and this tag (HTML_STYLESHEET) will in the future become # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the # standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that the # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # http://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # in the HTML output. For a value of 0 the output will use grayscales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the # luminance component of the colors in the HTML output. Values below 100 # gradually make the output lighter, whereas values above 100 make the output # darker. The value divided by 100 is the actual gamma applied, so 80 represents # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not # change the gamma. # Minimum value: 40, maximum value: 240, default value: 80. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this # to YES can help to show when doxygen was last run and thus if the # documentation is up to date. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = NO # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to # such a level that at most the specified number of entries are visible (unless # a fully collapsed tree already exceeds this amount). So setting the number of # entries 1 will produce a full collapsed tree by default. 0 is a special value # representing an infinite number of entries and will result in a full expanded # tree by default. # Minimum value: 0, maximum value: 9999, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development # environment (see: http://developer.apple.com/tools/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_DOCSET = NO # This tag determines the name of the docset feed. A documentation feed provides # an umbrella under which multiple documentation sets from a single provider # (such as a company or product suite) can be grouped. # The default value is: Doxygen generated docs. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_FEEDNAME = "Doxygen generated docs" # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_BUNDLE_ID = org.doxygen.Project # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. # The default value is: org.doxygen.Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. # The default value is: Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop # (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML # files are now used as the Windows 98 help format, and will replace the old # Windows help format (.hlp) on all Windows platforms in the future. Compressed # HTML files also contain an index, a table of contents, and you can search for # words in the documentation. The HTML workshop also contains a viewer for # compressed HTML files. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO # The CHM_FILE tag can be used to specify the file name of the resulting .chm # file. You can add a path in front of the file if the result should not be # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO # The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members to # the table of contents of the HTML help documentation and to the tree view. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help # (.qch) of the generated HTML documentation. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify # the file name of the resulting .qch file. The path specified is relative to # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace # (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual # Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- # folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To # install this plugin and make it available under the help contents menu in # Eclipse, the contents of the directory containing the HTML and XML files needs # to be copied into the plugins directory of eclipse. The name of the directory # within the plugins directory should be the same as the ECLIPSE_DOC_ID value. # After copying Eclipse needs to be restarted before the help appears. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_ECLIPSEHELP = NO # A unique identifier for the Eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have this # name. Each documentation set should have its own identifier. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. ECLIPSE_DOC_ID = org.doxygen.Project # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top # of each HTML page. A value of NO enables the index and the value YES disables # it. Since the tabs in the index contain the same information as the navigation # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag # value is set to YES, a side panel will be generated containing a tree-like # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has # the same information as the tab index, you could consider setting # DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = NO # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # # Note that a value of 0 will completely suppress the enum values from appearing # in the overview section. # Minimum value: 0, maximum value: 20, default value: 4. # This tag requires that the tag GENERATE_HTML is set to YES. ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used # to set the initial width (in pixels) of the frame in which the tree is shown. # Minimum value: 0, maximum value: 1500, default value: 250. # This tag requires that the tag GENERATE_HTML is set to YES. TREEVIEW_WIDTH = 250 # If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML # output directory to force them to be regenerated. # Minimum value: 8, maximum value: 50, default value: 10. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # # Note that when changing this option you need to delete any form_*.png files in # the HTML output directory before the changes have effect. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. USE_MATHJAX = NO # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: # http://docs.mathjax.org/en/latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_FORMAT = HTML-CSS # When MathJax is enabled you need to specify the location relative to the HTML # output directory using the MATHJAX_RELPATH option. The destination directory # should contain the MathJax.js script. For instance, if the mathjax directory # is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of # MathJax from http://www.mathjax.org before deployment. # The default value is: http://cdn.mathjax.org/mathjax/latest. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site # (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and # should work on any modern browser. Note that when using HTML help # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) # there is already a search function so this one should typically be disabled. # For large projects the javascript based search engine can be slow, then # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to # search using the keyboard; to jump to the search box use + S # (what the is depends on the OS and browser, but it is typically # , /